UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 3.45 kB
{"version":3,"file":"drawer.mjs","sources":["../../../../../../packages/components/drawer/src/drawer.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport { dialogEmits, dialogProps } from '@element-plus/components/dialog'\n\nimport type { ExtractPublicPropTypes } from 'vue'\nimport type Drawer from './drawer.vue'\nimport type { DialogProps } from '@element-plus/components/dialog'\n\nexport interface DrawerProps extends DialogProps {\n /**\n * @description Set the direction in which the Drawer opens\n */\n direction?: 'ltr' | 'rtl' | 'ttb' | 'btt'\n /**\n * @description Whether to enable the resizable function for the drawer\n */\n resizable?: boolean\n /**\n * @description The size of the Drawer form, when using the number type, is measured in pixels. When using the string type, please pass in 'x%'; otherwise, it will be interpreted as the number type\n */\n size?: string | number\n /**\n * @description You can remove the title from the drawer, so that your drawer will have more space on the screen. If you want to be visited, you must set the title attribute.\n */\n withHeader?: boolean\n /**\n * @description The fade-in and fade-out animation switch of the mask layer\n */\n modalFade?: boolean\n /**\n * @description Help assistive technologies such as screen readers identify content hierarchies\n */\n headerAriaLevel?: string\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `DrawerProps` instead.\n */\nexport const drawerProps = buildProps({\n ...dialogProps,\n direction: {\n type: String,\n default: 'rtl',\n values: ['ltr', 'rtl', 'ttb', 'btt'],\n },\n resizable: Boolean,\n size: {\n type: [String, Number],\n default: '30%',\n },\n withHeader: {\n type: Boolean,\n default: true,\n },\n modalFade: {\n type: Boolean,\n default: true,\n },\n headerAriaLevel: {\n type: String,\n default: '2',\n },\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `DrawerProps` instead.\n */\nexport type DrawerPropsPublic = ExtractPublicPropTypes<typeof drawerProps>\n\nexport const drawerEmits = {\n ...dialogEmits,\n 'resize-start': (evt: MouseEvent, size: number) =>\n evt instanceof MouseEvent && typeof size === 'number',\n resize: (evt: MouseEvent, size: number) =>\n evt instanceof MouseEvent && typeof size === 'number',\n 'resize-end': (evt: MouseEvent, size: number) =>\n evt instanceof MouseEvent && typeof size === 'number',\n}\n\nexport type DrawerEmits = typeof drawerEmits\n\nexport type DrawerInstance = InstanceType<typeof Drawer> & unknown\n"],"names":[],"mappings":";;;AAqCO,MAAM,cAAc,UAAA,CAAW;AAAA,EACpC,GAAG,WAAA;AAAA,EACH,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS,KAAA;AAAA,IACT,MAAA,EAAQ,CAAC,KAAA,EAAO,KAAA,EAAO,OAAO,KAAK;AAAA,GACrC;AAAA,EACA,SAAA,EAAW,OAAA;AAAA,EACX,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA,IACrB,OAAA,EAAS;AAAA,GACX;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA;AAEb,CAAU;AAOH,MAAM,WAAA,GAAc;AAAA,EACzB,GAAG,WAAA;AAAA,EACH,gBAAgB,CAAC,GAAA,EAAiB,SAChC,GAAA,YAAe,UAAA,IAAc,OAAO,IAAA,KAAS,QAAA;AAAA,EAC/C,QAAQ,CAAC,GAAA,EAAiB,SACxB,GAAA,YAAe,UAAA,IAAc,OAAO,IAAA,KAAS,QAAA;AAAA,EAC/C,cAAc,CAAC,GAAA,EAAiB,SAC9B,GAAA,YAAe,UAAA,IAAc,OAAO,IAAA,KAAS;AACjD;;;;"}