1 line
7.7 KiB
Plaintext
1 line
7.7 KiB
Plaintext
|
|
{"version":3,"file":"dialog.mjs","names":[],"sources":["../../../../../../packages/components/dialog/src/dialog.ts"],"sourcesContent":["import { buildProps, definePropType, isBoolean } from '@element-plus/utils'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport {\n dialogContentProps,\n dialogContentPropsDefaults,\n} from './dialog-content'\n\nimport type { ExtractPublicPropTypes, InjectionKey, TransitionProps } from 'vue'\nimport type { DialogContentProps } from './dialog-content'\nimport type Dialog from './dialog.vue'\n\ntype DoneFn = (cancel?: boolean) => void\n\nexport type DialogBeforeCloseFn = (done: DoneFn) => void\n\nexport type DialogTransition = string | TransitionProps\n\n/**\n * @description dialog component props\n */\nexport interface DialogProps extends DialogContentProps {\n /**\n * @description whether to append Dialog itself to body. A nested Dialog should have this attribute set to `true`\n */\n appendToBody?: boolean\n /**\n * @description which element the Dialog appends to\n */\n appendTo?: string | HTMLElement\n /**\n * @description callback before Dialog closes, and it will prevent Dialog from closing, use done to close the dialog\n */\n beforeClose?: DialogBeforeCloseFn\n /**\n * @description destroy elements in Dialog when closed\n */\n destroyOnClose?: boolean\n /**\n * @description whether the Dialog can be closed by clicking the mask\n */\n closeOnClickModal?: boolean\n /**\n * @description whether the Dialog can be closed by pressing ESC\n */\n closeOnPressEscape?: boolean\n /**\n * @description whether scroll of body is disabled while Dialog is displayed\n */\n lockScroll?: boolean\n /**\n * @description whether a mask is displayed\n */\n modal?: boolean\n /**\n * @description whether the mask is penetrable\n */\n modalPenetrable?: boolean\n /**\n * @description the Time(milliseconds) before open\n */\n openDelay?: number\n /**\n * @description the Time(milliseconds) before close\n */\n closeDelay?: number\n /**\n * @description value for `margin-top` of Dialog CSS, default is 15vh\n */\n top?: string\n /**\n * @description visibility of Dialog\n */\n modelValue?: boolean\n /**\n * @description custom class names for mask\n */\n modalClass?: string\n /**\n * @description width of Dialog, default is 50%\n */\n width?: string | number\n /**\n * @description same as z-index in native CSS, z-order of dialog\n */\n zIndex?: number\n /**\n * @description trap focus within dialog\n */\n trapFocus?: boolean\n /**\n * @description header's aria-level attribute\n */\n headerAriaLevel?: string\n /**\n * @description custom transition configuration for dialog animation, it can be a string (transition name) or an object with Vue transition props\n */\n transition?: DialogTransition\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `DialogProps` instead.\n */\nexport const dialogProps = buildProps({\n ...dialogContentProps,\n /**\n * @description whether to append Dialog itself to body. A nested Dialog should have this attribute set to `true`\n */\n appendToBody: Boolean,\n /**\n * @description which element the Dialog appends to\n */\n appendTo: {\n type: definePropType<string | HTMLElement>([String, Object]),\n default: 'body',\n },\n /**\n * @description callback before Dialog closes, and it will prevent Dialog from closing, use done to close the dialog\n */\n beforeClose: {\n type: definePropType<DialogBeforeCloseFn>(Function),\n },\n /**\n * @description destroy elements in Dialog when closed\n */\n destroyOnClose: Boolean,\n /**\n * @description whether the Dialog can be closed by clicking the mask\n */\n closeOnClickModal: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether the Dialog can be closed by pressing ESC\n */\n closeOnPressEscape: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether scroll of body is disabled while Dialog is displayed\n */\n lock
|