You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

0 lines
45 KiB

1 month ago
  1. {"ast":null,"code":"import { defineComponent, computed, ref, reactive, markRaw, watch, nextTick, onMounted, onBeforeUnmount, toRefs, resolveComponent, openBlock, createBlock, Transition, withCtx, withDirectives, createVNode, createElementVNode, normalizeClass, normalizeStyle, withModifiers, createElementBlock, resolveDynamicComponent, createCommentVNode, toDisplayString, withKeys, renderSlot, createTextVNode, vShow } from 'vue';\nimport { ElButton } from '../../button/index.mjs';\nimport { ElInput } from '../../input/index.mjs';\nimport { ElOverlay } from '../../overlay/index.mjs';\nimport { ElIcon } from '../../icon/index.mjs';\nimport { Loading } from '@element-plus/icons-vue';\nimport ElFocusTrap from '../../focus-trap/src/focus-trap.mjs';\nimport _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';\nimport TrapFocus from '../../../directives/trap-focus/index.mjs';\nimport { TypeComponents, TypeComponentsMap } from '../../../utils/vue/icon.mjs';\nimport { isValidComponentSize } from '../../../utils/vue/validator.mjs';\nimport { useGlobalComponentSettings } from '../../config-provider/src/hooks/use-global-config.mjs';\nimport { useId } from '../../../hooks/use-id/index.mjs';\nimport { useDraggable } from '../../../hooks/use-draggable/index.mjs';\nimport { isFunction, isString } from '@vue/shared';\nimport { useLockscreen } from '../../../hooks/use-lockscreen/index.mjs';\nimport { useSameTarget } from '../../../hooks/use-same-target/index.mjs';\nconst _sfc_main = defineComponent({\n name: \"ElMessageBox\",\n directives: {\n TrapFocus\n },\n components: {\n ElButton,\n ElFocusTrap,\n ElInput,\n ElOverlay,\n ElIcon,\n ...TypeComponents\n },\n inheritAttrs: false,\n props: {\n buttonSize: {\n type: String,\n validator: isValidComponentSize\n },\n modal: {\n type: Boolean,\n default: true\n },\n lockScroll: {\n type: Boolean,\n default: true\n },\n showClose: {\n type: Boolean,\n default: true\n },\n closeOnClickModal: {\n type: Boolean,\n default: true\n },\n closeOnPressEscape: {\n type: Boolean,\n default: true\n },\n closeOnHashChange: {\n type: Boolean,\n default: true\n },\n center: Boolean,\n draggable: Boolean,\n overflow: Boolean,\n roundButton: {\n default: false,\n type: Boolean\n },\n container: {\n type: String,\n default: \"body\"\n },\n boxType: {\n type: String,\n default: \"\"\n }\n },\n emits: [\"vanish\", \"action\"],\n setup(props, {\n emit\n }) {\n const {\n locale,\n zIndex,\n ns,\n size: btnSize\n } = useGlobalComponentSettings(\"message-box\", computed(() => props.buttonSize));\n const {\n t\n } = locale;\n const {\n nextZIndex\n } = zIndex;\n const visible = ref(false);\n const state = reactive({\n autofocus: true,\n beforeClose: null,\n callback: null,\n cancelButtonText: \"\",\n cancelButtonClass: \"\",\n confirmButtonText: \"\",\n confirmButtonClass: \"\",\n customClass: \"\",\n customStyle: {},\n dangerouslyUseHTMLString: false,\n distinguishCancelAndClose: false,\n icon: \"\",\n inputPattern: null,\n inputPlaceholder: \"\",\n inputType: \"text\",\n inputValue: null,\n inputValidator: null,\n inputErrorMessage: \"\",\n message: null,\n modalFade: true,\n modalClass: \"\",\n showCancelButton: false,\n showConfirmButton: true,\n type: \"\",\n title: void 0,\n showInput: false,\n action: \"\",\n confirmButtonLoading: false,\n cancelButtonLoading: false,\n confirmButtonLoadingIcon: markRaw(Loading),\n cancelButtonLoadingIcon: markRaw(Loading),\n confirmButtonDisabled: false,\n editorErrorMessage: \"\",\n validateError: false,\n zIndex: nextZIndex()\n });\n const typeClass = computed(() => {\n const type = state.type;\n return {\n [ns.bm(