st-comp 0.0.178 → 0.0.180

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/es/ChartLayout.cjs +1 -1
  2. package/es/ChartLayout.js +3 -3
  3. package/es/FactorWarning.cjs +1 -1
  4. package/es/FactorWarning.js +29 -33
  5. package/es/Kline.cjs +1 -1
  6. package/es/Kline.js +14 -18
  7. package/es/KlineBasic.cjs +1 -1
  8. package/es/KlineBasic.js +25 -30
  9. package/es/KlineConfig.cjs +1 -1
  10. package/es/KlineConfig.js +457 -419
  11. package/es/KlineNew.cjs +1 -1
  12. package/es/KlineNew.js +13 -16
  13. package/es/KlinePlus.cjs +3 -3
  14. package/es/KlinePlus.js +140 -142
  15. package/es/Pagination.cjs +1 -1
  16. package/es/Pagination.js +274 -276
  17. package/es/PasswordPrompt.cjs +1 -1
  18. package/es/PasswordPrompt.js +3 -3
  19. package/es/Table.cjs +1 -1
  20. package/es/Table.js +21 -23
  21. package/es/User.cjs +1 -1
  22. package/es/User.js +472 -482
  23. package/es/VarSelectDialog.cjs +3 -3
  24. package/es/VarSelectDialog.js +440 -2878
  25. package/es/VarietySearch.cjs +12 -12
  26. package/es/VarietySearch.js +1199 -1176
  27. package/es/VirtualTable.cjs +1 -13
  28. package/es/VirtualTable.js +1547 -1567
  29. package/es/{_initCloneObject-da90eef0.js → _initCloneObject-346b7ee2.js} +25 -26
  30. package/es/_initCloneObject-e2f0deb9.cjs +1 -0
  31. package/es/base-62a70f61.js +288 -0
  32. package/es/base-ef747d02.cjs +5 -0
  33. package/es/config-provider-178bb43c.cjs +1 -0
  34. package/es/config-provider-2e733cae.js +58 -0
  35. package/es/dayjs.min-2c20abe6.cjs +1 -0
  36. package/es/{dayjs.min-54a4e095.js → dayjs.min-8313b006.js} +96 -93
  37. package/es/{debounce-9e323221.cjs → debounce-0b77a317.cjs} +1 -1
  38. package/es/{debounce-3cec4646.js → debounce-5f2ec4be.js} +19 -19
  39. package/es/{dropdown-82b80e8b.js → dropdown-d06edf54.js} +49 -39
  40. package/es/dropdown-f2fec683.cjs +1 -0
  41. package/es/el-button-5b08c08a.js +272 -0
  42. package/es/el-button-fc46a173.cjs +1 -0
  43. package/es/el-dialog-0b7166c9.cjs +1 -0
  44. package/es/el-dialog-d8d0da7a.js +276 -0
  45. package/es/{el-divider-fd2b4e2e.js → el-divider-2f300113.js} +1 -1
  46. package/es/{el-divider-40c50ce7.cjs → el-divider-4713d74c.cjs} +1 -1
  47. package/es/{el-empty-412fc297.js → el-empty-87a86f30.js} +57 -80
  48. package/es/el-empty-bb2b0235.cjs +1 -0
  49. package/es/el-form-item-caffd133.cjs +12 -0
  50. package/es/el-form-item-ff9c7d98.js +1267 -0
  51. package/es/el-input-6db30c8c.js +531 -0
  52. package/es/el-input-9c912678.cjs +1 -0
  53. package/es/el-input-number-05f150e5.js +311 -0
  54. package/es/el-input-number-6fe73563.cjs +1 -0
  55. package/es/el-loading-8514feaa.cjs +1 -0
  56. package/es/el-loading-93842445.js +203 -0
  57. package/es/el-menu-item-7a57c1be.cjs +1 -0
  58. package/es/el-menu-item-a886fbdd.js +768 -0
  59. package/es/el-message-8aa674f2.js +406 -0
  60. package/es/el-message-aad5b42b.cjs +1 -0
  61. package/es/el-message-box-2b6b2b68.js +550 -0
  62. package/es/el-message-box-53f355d7.cjs +1 -0
  63. package/es/el-overlay-540b2a02.js +324 -0
  64. package/es/el-overlay-96630a2e.cjs +1 -0
  65. package/es/el-popconfirm-2afdf6fb.cjs +1 -0
  66. package/es/el-popconfirm-c18d8035.js +162 -0
  67. package/es/el-popper-544fd77e.js +2412 -0
  68. package/es/el-popper-73466d7a.cjs +1 -0
  69. package/es/el-scrollbar-691cfc11.cjs +1 -0
  70. package/es/el-scrollbar-fae984e3.js +763 -0
  71. package/es/el-segmented-a7493831.js +142 -0
  72. package/es/el-segmented-b6bd3c0e.cjs +1 -0
  73. package/es/el-select-5959e837.cjs +1 -0
  74. package/es/el-select-ea8feecf.js +1251 -0
  75. package/es/el-table-column-9ef52443.js +3878 -0
  76. package/es/el-table-column-b824ac5c.cjs +14 -0
  77. package/es/el-tag-2fc9b9eb.js +116 -0
  78. package/es/el-tag-ecad6d02.cjs +1 -0
  79. package/es/index-2e331d74.js +10 -0
  80. package/es/{index-a8e9ec0f.js → index-34592e82.js} +176 -182
  81. package/es/index-3a74eae4.cjs +1 -0
  82. package/es/{index-1c41bd56.js → index-5d4e5c51.js} +3 -3
  83. package/es/{index-e348d5e8.cjs → index-694bb944.cjs} +1 -1
  84. package/es/{index-ee1cebbc.js → index-74fb90c7.js} +5 -5
  85. package/es/{index-d577b81b.js → index-8d7ae5dc.js} +2 -2
  86. package/es/index-a9095b4a.js +163 -0
  87. package/es/index-a93dd9c4.cjs +1 -0
  88. package/es/index-ebd2fd7e.cjs +1 -0
  89. package/es/index-f1c702f6.cjs +1 -0
  90. package/es/{index-19fa1fcf.cjs → index-f6afafaa.cjs} +1 -1
  91. package/es/{raf-bfbf42e4.js → raf-41aed4d4.js} +1 -1
  92. package/es/{raf-07cb6953.cjs → raf-8249652f.cjs} +1 -1
  93. package/es/{scroll-e3cb691f.js → scroll-7d352c1f.js} +2 -2
  94. package/es/{scroll-4769a65d.cjs → scroll-b108dabd.cjs} +1 -1
  95. package/es/style.css +1 -1
  96. package/es/use-global-config-03735617.cjs +1 -0
  97. package/es/use-global-config-4b185eb5.js +71 -0
  98. package/es/validator-0e688e4e.cjs +1 -0
  99. package/es/validator-d12a8f8c.js +5 -0
  100. package/es/vnode-4db20540.cjs +1 -0
  101. package/es/vnode-a0795a4b.js +70 -0
  102. package/es/{zh-cn-d883afa8.js → zh-cn-0ff32188.js} +5 -4
  103. package/es/{zh-cn-b24a7dc9.cjs → zh-cn-adf19c4b.cjs} +1 -1
  104. package/lib/bundle.js +1 -1
  105. package/lib/bundle.umd.cjs +226 -245
  106. package/lib/{index-0f16f8b0.js → index-9341884f.js} +44358 -46367
  107. package/lib/{python-e9c32bc9.js → python-5c9b3e4e.js} +1 -1
  108. package/lib/style.css +1 -1
  109. package/package.json +2 -2
  110. package/packages/KlinePlus/index.vue +2 -1
  111. package/packages/VarSelectDialog/index.vue +43 -67
  112. package/packages/VarietySearch/components/FactorScreen/FactorDescription.vue +4 -2
  113. package/packages/VarietySearch/components/FactorScreen/index.vue +6 -4
  114. package/packages/index.ts +0 -2
  115. package/src/pages/VarSelectDialog/index.vue +1 -1
  116. package/src/router/routes.ts +0 -5
  117. package/es/Dialog.cjs +0 -1
  118. package/es/Dialog.js +0 -95
  119. package/es/_commonjsHelpers-10dfc225.js +0 -8
  120. package/es/_commonjsHelpers-87b0abe8.cjs +0 -1
  121. package/es/_initCloneObject-9ccbb113.cjs +0 -1
  122. package/es/base-bdc10baa.cjs +0 -5
  123. package/es/base-d9284bf0.js +0 -304
  124. package/es/castArray-37eb9980.cjs +0 -1
  125. package/es/castArray-b0ab0165.js +0 -10
  126. package/es/config-provider-ec6b09df.cjs +0 -1
  127. package/es/config-provider-f0151e9f.js +0 -47
  128. package/es/dayjs.min-19fb125f.cjs +0 -1
  129. package/es/dropdown-b2dab5bb.cjs +0 -1
  130. package/es/el-button-34665425.js +0 -237
  131. package/es/el-button-960edd49.cjs +0 -1
  132. package/es/el-dialog-a412484e.js +0 -267
  133. package/es/el-dialog-cd484c1f.cjs +0 -1
  134. package/es/el-empty-627ec09e.cjs +0 -1
  135. package/es/el-form-item-668ba024.js +0 -1263
  136. package/es/el-form-item-e1c3104b.cjs +0 -12
  137. package/es/el-input-22e66e37.js +0 -523
  138. package/es/el-input-5163bda3.cjs +0 -1
  139. package/es/el-input-number-481e21c5.js +0 -284
  140. package/es/el-input-number-eb54cde4.cjs +0 -1
  141. package/es/el-loading-15a5501c.cjs +0 -1
  142. package/es/el-loading-d4e403ab.js +0 -187
  143. package/es/el-menu-item-404c10e5.js +0 -772
  144. package/es/el-menu-item-ac89e804.cjs +0 -1
  145. package/es/el-message-ad87b9dd.cjs +0 -1
  146. package/es/el-message-box-41f39f6d.js +0 -558
  147. package/es/el-message-box-6694f827.cjs +0 -1
  148. package/es/el-message-ef506caa.js +0 -375
  149. package/es/el-overlay-4a9fa4e1.js +0 -269
  150. package/es/el-overlay-e5d318c3.cjs +0 -1
  151. package/es/el-popconfirm-7b9183aa.js +0 -140
  152. package/es/el-popconfirm-a497b279.cjs +0 -1
  153. package/es/el-popper-14a9d493.cjs +0 -1
  154. package/es/el-popper-e73466eb.js +0 -2263
  155. package/es/el-scrollbar-45318df0.js +0 -201
  156. package/es/el-scrollbar-8bf765f2.cjs +0 -1
  157. package/es/el-segmented-3ba6d664.cjs +0 -1
  158. package/es/el-segmented-41820018.js +0 -135
  159. package/es/el-select-1d2309a1.cjs +0 -1
  160. package/es/el-select-d7a00294.js +0 -1130
  161. package/es/el-table-column-a2d0c635.js +0 -3805
  162. package/es/el-table-column-be9a76bb.cjs +0 -14
  163. package/es/el-tag-7f391090.js +0 -280
  164. package/es/el-tag-8d49d4d2.cjs +0 -1
  165. package/es/index-02ca0096.cjs +0 -5
  166. package/es/index-3120be08.js +0 -14
  167. package/es/index-5b81f4da.cjs +0 -1
  168. package/es/index-85a32a00.js +0 -59
  169. package/es/index-8d3c5e96.cjs +0 -3
  170. package/es/index-94f38460.js +0 -306
  171. package/es/index-a99a5307.cjs +0 -1
  172. package/es/index-b90c746b.cjs +0 -1
  173. package/es/index-d94bae37.cjs +0 -1
  174. package/es/index-d99fdc6d.js +0 -159
  175. package/es/use-form-common-props-592797e2.cjs +0 -2
  176. package/es/use-form-common-props-cc347a83.js +0 -171
  177. package/es/use-global-config-584b62f1.cjs +0 -1
  178. package/es/use-global-config-c7f0a7e3.js +0 -73
  179. package/es/validator-10fa54fe.js +0 -5
  180. package/es/validator-af488a9a.cjs +0 -1
  181. package/es/vnode-1b827c99.cjs +0 -1
  182. package/es/vnode-6be33bb1.js +0 -14
  183. package/packages/Dialog/index.ts +0 -8
  184. package/packages/Dialog/index.vue +0 -54
  185. package/src/pages/Dialog/index.vue +0 -16
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue"),oe=require("./el-scrollbar-8bf765f2.cjs"),H=require("./index-19fa1fcf.cjs"),y=require("./index-d94bae37.cjs"),l=require("./base-bdc10baa.cjs"),Q=require("./el-popper-14a9d493.cjs"),se=require("./index-eea0bcb3.cjs"),V=require("./use-form-common-props-592797e2.cjs"),le=require("./el-tag-8d49d4d2.cjs"),ae=require("./typescript-b63f8e83.cjs"),ue=require("./vnode-1b827c99.cjs"),re=e.defineComponent({name:"ElCollapseTransition"}),ie=e.defineComponent({...re,setup(t){const s=l.useNamespace("collapse-transition"),o=n=>{n.style.maxHeight="",n.style.overflow=n.dataset.oldOverflow,n.style.paddingTop=n.dataset.oldPaddingTop,n.style.paddingBottom=n.dataset.oldPaddingBottom},d={beforeEnter(n){n.dataset||(n.dataset={}),n.dataset.oldPaddingTop=n.style.paddingTop,n.dataset.oldPaddingBottom=n.style.paddingBottom,n.style.height&&(n.dataset.elExistsHeight=n.style.height),n.style.maxHeight=0,n.style.paddingTop=0,n.style.paddingBottom=0},enter(n){requestAnimationFrame(()=>{n.dataset.oldOverflow=n.style.overflow,n.dataset.elExistsHeight?n.style.maxHeight=n.dataset.elExistsHeight:n.scrollHeight!==0?n.style.maxHeight=`${n.scrollHeight}px`:n.style.maxHeight=0,n.style.paddingTop=n.dataset.oldPaddingTop,n.style.paddingBottom=n.dataset.oldPaddingBottom,n.style.overflow="hidden"})},afterEnter(n){n.style.maxHeight="",n.style.overflow=n.dataset.oldOverflow},enterCancelled(n){o(n)},beforeLeave(n){n.dataset||(n.dataset={}),n.dataset.oldPaddingTop=n.style.paddingTop,n.dataset.oldPaddingBottom=n.style.paddingBottom,n.dataset.oldOverflow=n.style.overflow,n.style.maxHeight=`${n.scrollHeight}px`,n.style.overflow="hidden"},leave(n){n.scrollHeight!==0&&(n.style.maxHeight=0,n.style.paddingTop=0,n.style.paddingBottom=0)},afterLeave(n){o(n)},leaveCancelled(n){o(n)}};return(n,C)=>(e.openBlock(),e.createBlock(e.Transition,e.mergeProps({name:e.unref(s).b()},e.toHandlers(d)),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16,["name"]))}});var ce=l._export_sfc(ie,[["__file","collapse-transition.vue"]]);const de=l.withInstall(ce);let pe=class{constructor(s,o){this.parent=s,this.domNode=o,this.subIndex=0,this.subIndex=0,this.init()}init(){this.subMenuItems=this.domNode.querySelectorAll("li"),this.addListeners()}gotoSubIndex(s){s===this.subMenuItems.length?s=0:s<0&&(s=this.subMenuItems.length-1),this.subMenuItems[s].focus(),this.subIndex=s}addListeners(){const s=this.parent.domNode;Array.prototype.forEach.call(this.subMenuItems,o=>{o.addEventListener("keydown",d=>{let n=!1;switch(d.code){case y.EVENT_CODE.down:{this.gotoSubIndex(this.subIndex+1),n=!0;break}case y.EVENT_CODE.up:{this.gotoSubIndex(this.subIndex-1),n=!0;break}case y.EVENT_CODE.tab:{y.triggerEvent(s,"mouseleave");break}case y.EVENT_CODE.enter:case y.EVENT_CODE.numpadEnter:case y.EVENT_CODE.space:{n=!0,d.currentTarget.click();break}}return n&&(d.preventDefault(),d.stopPropagation()),!1})})}},me=class{constructor(s,o){this.domNode=s,this.submenu=null,this.submenu=null,this.init(o)}init(s){this.domNode.setAttribute("tabindex","0");const o=this.domNode.querySelector(`.${s}-menu`);o&&(this.submenu=new pe(this,o)),this.addListeners()}addListeners(){this.domNode.addEventListener("keydown",s=>{let o=!1;switch(s.code){case y.EVENT_CODE.down:{y.triggerEvent(s.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(0),o=!0;break}case y.EVENT_CODE.up:{y.triggerEvent(s.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(this.submenu.subMenuItems.length-1),o=!0;break}case y.EVENT_CODE.tab:{y.triggerEvent(s.currentTarget,"mouseleave");break}case y.EVENT_CODE.enter:case y.EVENT_CODE.numpadEnter:case y.EVENT_CODE.space:{o=!0,s.currentTarget.click();break}}o&&s.preventDefault()})}},ve=class{constructor(s,o){this.domNode=s,this.init(o)}init(s){const o=this.domNode.childNodes;Array.from(o).forEach(d=>{d.nodeType===1&&new me(d,s)})}};const fe=e.defineComponent({name:"ElMenuCollapseTransition",setup(){const t=l.useNamespace("menu");return{listeners:{onBeforeEnter:o=>o.style.opacity="0.2",onEnter(o,d){l.addClass(o,`${t.namespace.value}-opacity-transition`),o.style.opacity="1",d()},onAfterEnter(o){l.removeClass(o,`${t.namespace.value}-opacity-transition`),o.style.opacity=""},onBeforeLeave(o){o.dataset||(o.dataset={}),l.hasClass(o,t.m("collapse"))?(l.removeClass(o,t.m("collapse")),o.dataset.oldOverflow=o.style.overflow,o.dataset.scrollWidth=o.clientWidth.toString(),l.addClass(o,t.m("collapse"))):(l.addClass(o,t.m("collapse")),o.dataset.oldOverflow=o.style.overflow,o.dataset.scrollWidth=o.clientWidth.toString(),l.removeClass(o,t.m("collapse"))),o.style.width=`${o.scrollWidth}px`,o.style.overflow="hidden"},onLeave(o){l.addClass(o,"horizontal-collapse-transition"),o.style.width=`${o.dataset.scrollWidth}px`}}}}});function he(t,s,o,d,n,C){return e.openBlock(),e.createBlock(e.Transition,e.mergeProps({mode:"out-in"},t.listeners),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}var ge=l._export_sfc(fe,[["render",he],["__file","menu-collapse-transition.vue"]]);function X(t,s){const o=e.computed(()=>{let n=t.parent;const C=[s.value];for(;n.type.name!=="ElMenu";)n.props.index&&C.unshift(n.props.index),n=n.parent;return C});return{parentMenu:e.computed(()=>{let n=t.parent;for(;n&&!["ElMenu","ElSubMenu"].includes(n.type.name);)n=n.parent;return n}),indexPath:o}}function be(t){return e.computed(()=>{const o=t.backgroundColor;return o?new se.TinyColor(o).shade(20).toString():""})}const Y=(t,s)=>{const o=l.useNamespace("menu");return e.computed(()=>o.cssVarBlock({"text-color":t.textColor||"","hover-text-color":t.textColor||"","bg-color":t.backgroundColor||"","hover-bg-color":be(t).value||"","active-color":t.activeTextColor||"",level:`${s}`}))},Me=l.buildProps({index:{type:String,required:!0},showTimeout:Number,hideTimeout:Number,popperClass:String,disabled:Boolean,teleported:{type:Boolean,default:void 0},popperOffset:Number,expandCloseIcon:{type:V.iconPropType},expandOpenIcon:{type:V.iconPropType},collapseCloseIcon:{type:V.iconPropType},collapseOpenIcon:{type:V.iconPropType}}),U="ElSubMenu";var K=e.defineComponent({name:U,props:Me,setup(t,{slots:s,expose:o}){const d=e.getCurrentInstance(),{indexPath:n,parentMenu:C}=X(d,e.computed(()=>t.index)),v=l.useNamespace("menu"),E=l.useNamespace("sub-menu"),i=e.inject("rootMenu");i||l.throwError(U,"can not inject root menu");const m=e.inject(`subMenu:${C.value.uid}`);m||l.throwError(U,"can not inject sub menu");const f=e.ref({}),b=e.ref({});let I;const S=e.ref(!1),W=e.ref(),q=e.ref(null),N=e.computed(()=>_.value==="horizontal"&&w.value?"bottom-start":"right-start"),O=e.computed(()=>_.value==="horizontal"&&w.value||_.value==="vertical"&&!i.props.collapse?t.expandCloseIcon&&t.expandOpenIcon?x.value?t.expandOpenIcon:t.expandCloseIcon:H.arrow_down_default:t.collapseCloseIcon&&t.collapseOpenIcon?x.value?t.collapseOpenIcon:t.collapseCloseIcon:H.arrow_right_default),w=e.computed(()=>m.level===0),z=e.computed(()=>{const r=t.teleported;return r===void 0?w.value:r}),F=e.computed(()=>i.props.collapse?`${v.namespace.value}-zoom-in-left`:`${v.namespace.value}-zoom-in-top`),R=e.computed(()=>_.value==="horizontal"&&w.value?["bottom-start","bottom-end","top-start","top-end","right-start","left-start"]:["right-start","right","right-end","left-start","bottom-start","bottom-end","top-start","top-end"]),x=e.computed(()=>i.openedMenus.includes(t.index)),P=e.computed(()=>{let r=!1;return Object.values(f.value).forEach(p=>{p.active&&(r=!0)}),Object.values(b.value).forEach(p=>{p.active&&(r=!0)}),r}),_=e.computed(()=>i.props.mode),$=e.reactive({index:t.index,indexPath:n,active:P}),D=Y(i.props,m.level+1),L=e.computed(()=>{var r;return(r=t.popperOffset)!=null?r:i.props.popperOffset}),B=e.computed(()=>{var r;return(r=t.popperClass)!=null?r:i.props.popperClass}),j=e.computed(()=>{var r;return(r=t.showTimeout)!=null?r:i.props.showTimeout}),G=e.computed(()=>{var r;return(r=t.hideTimeout)!=null?r:i.props.hideTimeout}),a=()=>{var r,p,M;return(M=(p=(r=q.value)==null?void 0:r.popperRef)==null?void 0:p.popperInstanceRef)==null?void 0:M.destroy()},u=r=>{r||a()},c=()=>{i.props.menuTrigger==="hover"&&i.props.mode==="horizontal"||i.props.collapse&&i.props.mode==="vertical"||t.disabled||i.handleSubMenuClick({index:t.index,indexPath:n.value,active:P.value})},h=(r,p=j.value)=>{var M;if(r.type!=="focus"){if(i.props.menuTrigger==="click"&&i.props.mode==="horizontal"||!i.props.collapse&&i.props.mode==="vertical"||t.disabled){m.mouseInChild.value=!0;return}m.mouseInChild.value=!0,I==null||I(),{stop:I}=l.useTimeoutFn(()=>{i.openMenu(t.index,n.value)},p),z.value&&((M=C.value.vnode.el)==null||M.dispatchEvent(new MouseEvent("mouseenter")))}},g=(r=!1)=>{var p;if(i.props.menuTrigger==="click"&&i.props.mode==="horizontal"||!i.props.collapse&&i.props.mode==="vertical"){m.mouseInChild.value=!1;return}I==null||I(),m.mouseInChild.value=!1,{stop:I}=l.useTimeoutFn(()=>!S.value&&i.closeMenu(t.index,n.value),G.value),z.value&&r&&((p=m.handleMouseleave)==null||p.call(m,!0))};e.watch(()=>i.props.collapse,r=>u(!!r));{const r=M=>{b.value[M.index]=M},p=M=>{delete b.value[M.index]};e.provide(`subMenu:${d.uid}`,{addSubMenu:r,removeSubMenu:p,handleMouseleave:g,mouseInChild:S,level:m.level+1})}return o({opened:x}),e.onMounted(()=>{i.addSubMenu($),m.addSubMenu($)}),e.onBeforeUnmount(()=>{m.removeSubMenu($),i.removeSubMenu($)}),()=>{var r;const p=[(r=s.title)==null?void 0:r.call(s),e.h(H.ElIcon,{class:E.e("icon-arrow"),style:{transform:x.value?t.expandCloseIcon&&t.expandOpenIcon||t.collapseCloseIcon&&t.collapseOpenIcon&&i.props.collapse?"none":"rotateZ(180deg)":"none"}},{default:()=>l.isString(O.value)?e.h(d.appContext.components[O.value]):e.h(O.value)})],M=i.isMenuPopup?e.h(Q.ElTooltip,{ref:q,visible:x.value,effect:"light",pure:!0,offset:L.value,showArrow:!1,persistent:!0,popperClass:B.value,placement:N.value,teleported:z.value,fallbackPlacements:R.value,transition:F.value,gpuAcceleration:!1},{content:()=>{var T;return e.h("div",{class:[v.m(_.value),v.m("popup-container"),B.value],onMouseenter:k=>h(k,100),onMouseleave:()=>g(!0),onFocus:k=>h(k,100)},[e.h("ul",{class:[v.b(),v.m("popup"),v.m(`popup-${N.value}`)],style:D.value},[(T=s.default)==null?void 0:T.call(s)])])},default:()=>e.h("div",{class:E.e("title"),onClick:c},p)}):e.h(e.Fragment,{},[e.h("div",{class:E.e("title"),ref:W,onClick:c},p),e.h(de,{},{default:()=>{var T;return e.withDirectives(e.h("ul",{role:"menu",class:[v.b(),v.m("inline")],style:D.value},[(T=s.default)==null?void 0:T.call(s)]),[[e.vShow,x.value]])}})]);return e.h("li",{class:[E.b(),E.is("active",P.value),E.is("opened",x.value),E.is("disabled",t.disabled)],role:"menuitem",ariaHaspopup:!0,ariaExpanded:x.value,onMouseenter:h,onMouseleave:()=>g(),onFocus:h},[M])}}});const ye=l.buildProps({mode:{type:String,values:["horizontal","vertical"],default:"vertical"},defaultActive:{type:String,default:""},defaultOpeneds:{type:l.definePropType(Array),default:()=>ae.mutable([])},uniqueOpened:Boolean,router:Boolean,menuTrigger:{type:String,values:["hover","click"],default:"hover"},collapse:Boolean,backgroundColor:String,textColor:String,activeTextColor:String,closeOnClickOutside:Boolean,collapseTransition:{type:Boolean,default:!0},ellipsis:{type:Boolean,default:!0},popperOffset:{type:Number,default:6},ellipsisIcon:{type:V.iconPropType,default:()=>H.more_default},popperEffect:{type:l.definePropType(String),default:"dark"},popperClass:String,showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300}}),Z=t=>l.isArray(t)&&t.every(s=>l.isString(s)),Ee={close:(t,s)=>l.isString(t)&&Z(s),open:(t,s)=>l.isString(t)&&Z(s),select:(t,s,o,d)=>l.isString(t)&&Z(s)&&l.isObject(o)&&(d===void 0||d instanceof Promise)};var Ce=e.defineComponent({name:"ElMenu",props:ye,emits:Ee,setup(t,{emit:s,slots:o,expose:d}){const n=e.getCurrentInstance(),C=n.appContext.config.globalProperties.$router,v=e.ref(),E=l.useNamespace("menu"),i=l.useNamespace("sub-menu"),m=e.ref(-1),f=e.ref(t.defaultOpeneds&&!t.collapse?t.defaultOpeneds.slice(0):[]),b=e.ref(t.defaultActive),I=e.ref({}),S=e.ref({}),W=e.computed(()=>t.mode==="horizontal"||t.mode==="vertical"&&t.collapse),q=()=>{const a=b.value&&I.value[b.value];if(!a||t.mode==="horizontal"||t.collapse)return;a.indexPath.forEach(c=>{const h=S.value[c];h&&N(c,h.indexPath)})},N=(a,u)=>{f.value.includes(a)||(t.uniqueOpened&&(f.value=f.value.filter(c=>u.includes(c))),f.value.push(a),s("open",a,u))},O=a=>{const u=f.value.indexOf(a);u!==-1&&f.value.splice(u,1)},w=(a,u)=>{O(a),s("close",a,u)},z=({index:a,indexPath:u})=>{f.value.includes(a)?w(a,u):N(a,u)},F=a=>{(t.mode==="horizontal"||t.collapse)&&(f.value=[]);const{index:u,indexPath:c}=a;if(!(l.isNil(u)||l.isNil(c)))if(t.router&&C){const h=a.route||u,g=C.push(h).then(r=>(r||(b.value=u),r));s("select",u,c,{index:u,indexPath:c,route:h},g)}else b.value=u,s("select",u,c,{index:u,indexPath:c})},R=a=>{const u=I.value,c=u[a]||b.value&&u[b.value]||u[t.defaultActive];c?b.value=c.index:b.value=a},x=a=>{const u=getComputedStyle(a),c=Number.parseInt(u.marginLeft,10),h=Number.parseInt(u.marginRight,10);return a.offsetWidth+c+h||0},P=()=>{var a,u;if(!v.value)return-1;const c=Array.from((u=(a=v.value)==null?void 0:a.childNodes)!=null?u:[]).filter(A=>A.nodeName!=="#text"||A.nodeValue),h=64,g=getComputedStyle(v.value),r=Number.parseInt(g.paddingLeft,10),p=Number.parseInt(g.paddingRight,10),M=v.value.clientWidth-r-p;let T=0,k=0;return c.forEach((A,ne)=>{A.nodeName!=="#comment"&&(T+=x(A),T<=M-h&&(k=ne+1))}),k===c.length?-1:k},_=a=>S.value[a].indexPath,$=(a,u=33.34)=>{let c;return()=>{c&&clearTimeout(c),c=setTimeout(()=>{a()},u)}};let D=!0;const L=()=>{if(m.value===P())return;const a=()=>{m.value=-1,e.nextTick(()=>{m.value=P()})};D?a():$(a)(),D=!1};e.watch(()=>t.defaultActive,a=>{I.value[a]||(b.value=""),R(a)}),e.watch(()=>t.collapse,a=>{a&&(f.value=[])}),e.watch(I.value,q);let B;e.watchEffect(()=>{t.mode==="horizontal"&&t.ellipsis?B=oe.useResizeObserver(v,L).stop:B==null||B()});const j=e.ref(!1);{const a=g=>{S.value[g.index]=g},u=g=>{delete S.value[g.index]},c=g=>{I.value[g.index]=g},h=g=>{delete I.value[g.index]};e.provide("rootMenu",e.reactive({props:t,openedMenus:f,items:I,subMenus:S,activeIndex:b,isMenuPopup:W,addMenuItem:c,removeMenuItem:h,addSubMenu:a,removeSubMenu:u,openMenu:N,closeMenu:w,handleMenuItemClick:F,handleSubMenuClick:z})),e.provide(`subMenu:${n.uid}`,{addSubMenu:a,removeSubMenu:u,mouseInChild:j,level:0})}e.onMounted(()=>{t.mode==="horizontal"&&new ve(n.vnode.el,E.namespace.value)}),d({open:u=>{const{indexPath:c}=S.value[u];c.forEach(h=>N(h,c))},close:O,handleResize:L});const G=Y(t,0);return()=>{var a,u;let c=(u=(a=o.default)==null?void 0:a.call(o))!=null?u:[];const h=[];if(t.mode==="horizontal"&&v.value){const p=ue.flattedChildren(c),M=m.value===-1?p:p.slice(0,m.value),T=m.value===-1?[]:p.slice(m.value);T!=null&&T.length&&t.ellipsis&&(c=M,h.push(e.h(K,{index:"sub-menu-more",class:i.e("hide-arrow"),popperOffset:t.popperOffset},{title:()=>e.h(H.ElIcon,{class:i.e("icon-more")},{default:()=>e.h(t.ellipsisIcon)}),default:()=>T})))}const g=t.closeOnClickOutside?[[le.ClickOutside,()=>{f.value.length&&(j.value||(f.value.forEach(p=>s("close",p,_(p))),f.value=[]))}]]:[],r=e.withDirectives(e.h("ul",{key:String(t.collapse),role:"menubar",ref:v,style:G.value,class:{[E.b()]:!0,[E.m(t.mode)]:!0,[E.m("collapse")]:t.collapse}},[...c,...h]),g);return t.collapseTransition&&t.mode==="vertical"?e.h(ge,()=>r):r}}});const Ie=l.buildProps({index:{type:l.definePropType([String,null]),default:null},route:{type:l.definePropType([String,Object])},disabled:Boolean}),Te={click:t=>l.isString(t.index)&&l.isArray(t.indexPath)},J="ElMenuItem",xe=e.defineComponent({name:J,components:{ElTooltip:Q.ElTooltip},props:Ie,emits:Te,setup(t,{emit:s}){const o=e.getCurrentInstance(),d=e.inject("rootMenu"),n=l.useNamespace("menu"),C=l.useNamespace("menu-item");d||l.throwError(J,"can not inject root menu");const{parentMenu:v,indexPath:E}=X(o,e.toRef(t,"index")),i=e.inject(`subMenu:${v.value.uid}`);i||l.throwError(J,"can not inject sub menu");const m=e.computed(()=>t.index===d.activeIndex),f=e.reactive({index:t.index,indexPath:E,active:m}),b=()=>{t.disabled||(d.handleMenuItemClick({index:t.index,indexPath:E.value,route:t.route}),s("click",f))};return e.onMounted(()=>{i.addSubMenu(f),d.addMenuItem(f)}),e.onBeforeUnmount(()=>{i.removeSubMenu(f),d.removeMenuItem(f)}),{parentMenu:v,rootMenu:d,active:m,nsMenu:n,nsMenuItem:C,handleClick:b}}});function Se(t,s,o,d,n,C){const v=e.resolveComponent("el-tooltip");return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass([t.nsMenuItem.b(),t.nsMenuItem.is("active",t.active),t.nsMenuItem.is("disabled",t.disabled)]),role:"menuitem",tabindex:"-1",onClick:t.handleClick},[t.parentMenu.type.name==="ElMenu"&&t.rootMenu.props.collapse&&t.$slots.title?(e.openBlock(),e.createBlock(v,{key:0,effect:t.rootMenu.props.popperEffect,placement:"right","fallback-placements":["left"],persistent:""},{content:e.withCtx(()=>[e.renderSlot(t.$slots,"title")]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.nsMenu.be("tooltip","trigger"))},[e.renderSlot(t.$slots,"default")],2)]),_:3},8,["effect"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"default"),e.renderSlot(t.$slots,"title")],64))],10,["onClick"])}var ee=l._export_sfc(xe,[["render",Se],["__file","menu-item.vue"]]);const Ne={title:String},we="ElMenuItemGroup",_e=e.defineComponent({name:we,props:Ne,setup(){return{ns:l.useNamespace("menu-item-group")}}});function ke(t,s,o,d,n,C){return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.ns.b())},[e.createElementVNode("div",{class:e.normalizeClass(t.ns.e("title"))},[t.$slots.title?e.renderSlot(t.$slots,"title",{key:1}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.title),1)],64))],2),e.createElementVNode("ul",null,[e.renderSlot(t.$slots,"default")])],2)}var te=l._export_sfc(_e,[["render",ke],["__file","menu-item-group.vue"]]);const Oe=l.withInstall(Ce,{MenuItem:ee,MenuItemGroup:te,SubMenu:K}),Pe=l.withNoopInstall(ee);l.withNoopInstall(te);l.withNoopInstall(K);exports.ElMenu=Oe;exports.ElMenuItem=Pe;
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue"),k=require("./el-scrollbar-8bf765f2.cjs"),o=require("./base-bdc10baa.cjs"),w=require("./index-19fa1fcf.cjs"),b=require("./use-form-common-props-592797e2.cjs"),_=require("./typescript-b63f8e83.cjs"),D=require("./use-global-config-584b62f1.cjs"),O=require("./index-d94bae37.cjs"),p=require("./config-provider-ec6b09df.cjs"),P=o.buildProps({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"},showZero:{type:Boolean,default:!0},color:String,badgeStyle:{type:o.definePropType([String,Object,Array])},offset:{type:o.definePropType(Array),default:[0,0]},badgeClass:{type:String}}),q=e.defineComponent({name:"ElBadge"}),F=e.defineComponent({...q,props:P,setup(s,{expose:t}){const n=s,a=o.useNamespace("badge"),r=e.computed(()=>n.isDot?"":o.isNumber(n.value)&&o.isNumber(n.max)?n.max<n.value?`${n.max}+`:`${n.value}`:`${n.value}`),f=e.computed(()=>{var l,c,m,g,y;return[{backgroundColor:n.color,marginRight:o.addUnit(-((c=(l=n.offset)==null?void 0:l[0])!=null?c:0)),marginTop:o.addUnit((g=(m=n.offset)==null?void 0:m[1])!=null?g:0)},(y=n.badgeStyle)!=null?y:{}]});return t({content:r}),(l,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(a).b())},[e.renderSlot(l.$slots,"default"),e.createVNode(e.Transition,{name:`${e.unref(a).namespace.value}-zoom-in-center`,persisted:""},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("sup",{class:e.normalizeClass([e.unref(a).e("content"),e.unref(a).em("content",l.type),e.unref(a).is("fixed",!!l.$slots.default),e.unref(a).is("dot",l.isDot),e.unref(a).is("hide-zero",!l.showZero&&n.value===0),l.badgeClass]),style:e.normalizeStyle(e.unref(f))},[e.renderSlot(l.$slots,"content",{value:e.unref(r)},()=>[e.createTextVNode(e.toDisplayString(e.unref(r)),1)])],6),[[e.vShow,!l.hidden&&(e.unref(r)||l.isDot||l.$slots.content)]])]),_:3},8,["name"])],2))}});var H=o._export_sfc(F,[["__file","badge.vue"]]);const A=o.withInstall(H),E=["success","info","warning","error"],u=_.mutable({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:o.isClient?document.body:void 0}),R=o.buildProps({customClass:{type:String,default:u.customClass},center:{type:Boolean,default:u.center},dangerouslyUseHTMLString:{type:Boolean,default:u.dangerouslyUseHTMLString},duration:{type:Number,default:u.duration},icon:{type:b.iconPropType,default:u.icon},id:{type:String,default:u.id},message:{type:o.definePropType([String,Object,Function]),default:u.message},onClose:{type:o.definePropType(Function),default:u.onClose},showClose:{type:Boolean,default:u.showClose},type:{type:String,values:E,default:u.type},plain:{type:Boolean,default:u.plain},offset:{type:Number,default:u.offset},zIndex:{type:Number,default:u.zIndex},grouping:{type:Boolean,default:u.grouping},repeatNum:{type:Number,default:u.repeatNum}}),U={destroy:()=>!0},d=e.shallowReactive([]),Z=s=>{const t=d.findIndex(r=>r.id===s),n=d[t];let a;return t>0&&(a=d[t-1]),{current:n,prev:a}},j=s=>{const{prev:t}=Z(s);return t?t.vm.exposed.bottom.value:0},G=(s,t)=>d.findIndex(a=>a.id===s)>0?16:t,W=e.defineComponent({name:"ElMessage"}),J=e.defineComponent({...W,props:R,emits:U,setup(s,{expose:t}){const n=s,{Close:a}=b.TypeComponents,{ns:r,zIndex:f}=D.useGlobalComponentSettings("message"),{currentZIndex:l,nextZIndex:c}=f,m=e.ref(),g=e.ref(!1),y=e.ref(0);let h;const M=e.computed(()=>n.type?n.type==="error"?"danger":n.type:"info"),$=e.computed(()=>{const i=n.type;return{[r.bm("icon",i)]:i&&b.TypeComponentsMap[i]}}),T=e.computed(()=>n.icon||b.TypeComponentsMap[n.type]||""),I=e.computed(()=>j(n.id)),N=e.computed(()=>G(n.id,n.offset)+I.value),V=e.computed(()=>y.value+N.value),x=e.computed(()=>({top:`${N.value}px`,zIndex:l.value}));function B(){n.duration!==0&&({stop:h}=o.useTimeoutFn(()=>{v()},n.duration))}function S(){h==null||h()}function v(){g.value=!1}function L({code:i}){i===O.EVENT_CODE.esc&&v()}return e.onMounted(()=>{B(),c(),g.value=!0}),e.watch(()=>n.repeatNum,()=>{S(),B()}),k.useEventListener(document,"keydown",L),k.useResizeObserver(m,()=>{y.value=m.value.getBoundingClientRect().height}),t({visible:g,bottom:V,close:v}),(i,oe)=>(e.openBlock(),e.createBlock(e.Transition,{name:e.unref(r).b("fade"),onBeforeLeave:i.onClose,onAfterLeave:se=>i.$emit("destroy"),persisted:""},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{id:i.id,ref_key:"messageRef",ref:m,class:e.normalizeClass([e.unref(r).b(),{[e.unref(r).m(i.type)]:i.type},e.unref(r).is("center",i.center),e.unref(r).is("closable",i.showClose),e.unref(r).is("plain",i.plain),i.customClass]),style:e.normalizeStyle(e.unref(x)),role:"alert",onMouseenter:S,onMouseleave:B},[i.repeatNum>1?(e.openBlock(),e.createBlock(e.unref(A),{key:0,value:i.repeatNum,type:e.unref(M),class:e.normalizeClass(e.unref(r).e("badge"))},null,8,["value","type","class"])):e.createCommentVNode("v-if",!0),e.unref(T)?(e.openBlock(),e.createBlock(e.unref(w.ElIcon),{key:1,class:e.normalizeClass([e.unref(r).e("icon"),e.unref($)])},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(T))))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0),e.renderSlot(i.$slots,"default",{},()=>[i.dangerouslyUseHTMLString?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),e.createElementVNode("p",{class:e.normalizeClass(e.unref(r).e("content")),innerHTML:i.message},null,10,["innerHTML"])],2112)):(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(e.unref(r).e("content"))},e.toDisplayString(i.message),3))]),i.showClose?(e.openBlock(),e.createBlock(e.unref(w.ElIcon),{key:2,class:e.normalizeClass(e.unref(r).e("closeBtn")),onClick:e.withModifiers(v,["stop"])},{default:e.withCtx(()=>[e.createVNode(e.unref(a))]),_:1},8,["class","onClick"])):e.createCommentVNode("v-if",!0)],46,["id"]),[[e.vShow,g.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var K=o._export_sfc(J,[["__file","message.vue"]]);let Q=1;const z=s=>{const t=!s||o.isString(s)||e.isVNode(s)||o.isFunction(s)?{message:s}:s,n={...u,...t};if(!n.appendTo)n.appendTo=document.body;else if(o.isString(n.appendTo)){let a=document.querySelector(n.appendTo);o.isElement(a)||(o.debugWarn("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),a=document.body),n.appendTo=a}return o.isBoolean(p.messageConfig.grouping)&&!n.grouping&&(n.grouping=p.messageConfig.grouping),o.isNumber(p.messageConfig.duration)&&n.duration===3e3&&(n.duration=p.messageConfig.duration),o.isNumber(p.messageConfig.offset)&&n.offset===16&&(n.offset=p.messageConfig.offset),o.isBoolean(p.messageConfig.showClose)&&!n.showClose&&(n.showClose=p.messageConfig.showClose),n},X=s=>{const t=d.indexOf(s);if(t===-1)return;d.splice(t,1);const{handler:n}=s;n.close()},Y=({appendTo:s,...t},n)=>{const a=`message_${Q++}`,r=t.onClose,f=document.createElement("div"),l={...t,id:a,onClose:()=>{r==null||r(),X(y)},onDestroy:()=>{e.render(null,f)}},c=e.createVNode(K,l,o.isFunction(l.message)||e.isVNode(l.message)?{default:o.isFunction(l.message)?l.message:()=>l.message}:null);c.appContext=n||C._context,e.render(c,f),s.appendChild(f.firstElementChild);const m=c.component,y={id:a,vnode:c,vm:m,handler:{close:()=>{m.exposed.visible.value=!1}},props:c.component.props};return y},C=(s={},t)=>{if(!o.isClient)return{close:()=>{}};const n=z(s);if(n.grouping&&d.length){const r=d.find(({vnode:f})=>{var l;return((l=f.props)==null?void 0:l.message)===n.message});if(r)return r.props.repeatNum+=1,r.props.type=n.type,r.handler}if(o.isNumber(p.messageConfig.max)&&d.length>=p.messageConfig.max)return{close:()=>{}};const a=Y(n,t);return d.push(a),a.handler};E.forEach(s=>{C[s]=(t={},n)=>{const a=z(t);return C({...a,type:s},n)}});function ee(s){for(const t of d)(!s||s===t.props.type)&&t.handler.close()}C.closeAll=ee;C._context=null;const ne=o.withInstallFunction(C,"$message");exports.ElMessage=ne;
@@ -1,558 +0,0 @@
1
- import { defineComponent as Y, ref as B, computed as E, useAttrs as ke, onMounted as me, onUpdated as Me, openBlock as p, createBlock as b, resolveDynamicComponent as V, normalizeClass as r, unref as Se, normalizeStyle as X, withCtx as h, renderSlot as pe, nextTick as P, reactive as Ie, markRaw as se, watch as ae, onBeforeUnmount as Ae, toRefs as Le, resolveComponent as I, Transition as Re, withDirectives as j, createVNode as T, createElementVNode as y, withModifiers as N, createElementBlock as q, createCommentVNode as A, toDisplayString as O, withKeys as K, createTextVNode as W, vShow as G, isVNode as ve, render as ge } from "vue";
2
- import { b as $e, u as ze, x as Z, _ as he, w as Oe, y as J, i as _, p as Ve, z as le, e as Pe, A as ie, n as De } from "./base-d9284bf0.js";
3
- import { e as He, a as Fe, T as Ne, g as re } from "./use-form-common-props-cc347a83.js";
4
- import { E as Ke } from "./el-button-34665425.js";
5
- import { E as Ue } from "./el-input-22e66e37.js";
6
- import { E as je, b as qe, c as We } from "./el-overlay-4a9fa4e1.js";
7
- import { E as Ge, l as ue } from "./index-ee1cebbc.js";
8
- import { o as ce, E as Xe, b as Ze } from "./index-94f38460.js";
9
- import { i as Je } from "./validator-10fa54fe.js";
10
- import { u as Qe } from "./use-global-config-c7f0a7e3.js";
11
- import { a as de } from "./index-a8e9ec0f.js";
12
- import { u as Ye } from "./el-dialog-a412484e.js";
13
- const _e = $e({
14
- type: {
15
- type: String,
16
- values: ["primary", "success", "info", "warning", "danger", ""],
17
- default: ""
18
- },
19
- size: {
20
- type: String,
21
- values: He,
22
- default: ""
23
- },
24
- truncated: Boolean,
25
- lineClamp: {
26
- type: [String, Number]
27
- },
28
- tag: {
29
- type: String,
30
- default: "span"
31
- }
32
- }), xe = Y({
33
- name: "ElText"
34
- }), en = /* @__PURE__ */ Y({
35
- ...xe,
36
- props: _e,
37
- setup(e) {
38
- const t = e, o = B(), i = Fe(), a = ze("text"), s = E(() => [
39
- a.b(),
40
- a.m(t.type),
41
- a.m(i.value),
42
- a.is("truncated", t.truncated),
43
- a.is("line-clamp", !Z(t.lineClamp))
44
- ]), u = ke().title, f = () => {
45
- var c, n, M, S, d;
46
- if (u)
47
- return;
48
- let R = !1;
49
- const U = ((c = o.value) == null ? void 0 : c.textContent) || "";
50
- if (t.truncated) {
51
- const m = (n = o.value) == null ? void 0 : n.offsetWidth, C = (M = o.value) == null ? void 0 : M.scrollWidth;
52
- m && C && C > m && (R = !0);
53
- } else if (!Z(t.lineClamp)) {
54
- const m = (S = o.value) == null ? void 0 : S.offsetHeight, C = (d = o.value) == null ? void 0 : d.scrollHeight;
55
- m && C && C > m && (R = !0);
56
- }
57
- R ? o.value.setAttribute("title", U) : o.value.removeAttribute("title");
58
- };
59
- return me(f), Me(f), (c, n) => (p(), b(V(c.tag), {
60
- ref_key: "textRef",
61
- ref: o,
62
- class: r(Se(s)),
63
- style: X({ "-webkit-line-clamp": c.lineClamp })
64
- }, {
65
- default: h(() => [
66
- pe(c.$slots, "default")
67
- ]),
68
- _: 3
69
- }, 8, ["class", "style"]));
70
- }
71
- });
72
- var nn = /* @__PURE__ */ he(en, [["__file", "text.vue"]]);
73
- const Mn = Oe(nn), Q = "_trap-focus-children", k = [], fe = (e) => {
74
- var t;
75
- if (k.length === 0)
76
- return;
77
- const o = k[k.length - 1][Q];
78
- if (o.length > 0 && e.code === Xe.tab) {
79
- if (o.length === 1) {
80
- e.preventDefault(), document.activeElement !== o[0] && o[0].focus();
81
- return;
82
- }
83
- const i = e.shiftKey, a = e.target === o[0], s = e.target === o[o.length - 1];
84
- if (a && i && (e.preventDefault(), o[o.length - 1].focus()), s && !i && (e.preventDefault(), o[0].focus()), process.env.NODE_ENV === "test") {
85
- const u = o.indexOf(e.target);
86
- u !== -1 && ((t = o[i ? u - 1 : u + 1]) == null || t.focus());
87
- }
88
- }
89
- }, on = {
90
- beforeMount(e) {
91
- e[Q] = ce(e), k.push(e), k.length <= 1 && document.addEventListener("keydown", fe);
92
- },
93
- updated(e) {
94
- P(() => {
95
- e[Q] = ce(e);
96
- });
97
- },
98
- unmounted() {
99
- k.shift(), k.length === 0 && document.removeEventListener("keydown", fe);
100
- }
101
- }, tn = Y({
102
- name: "ElMessageBox",
103
- directives: {
104
- TrapFocus: on
105
- },
106
- components: {
107
- ElButton: Ke,
108
- ElFocusTrap: Ze,
109
- ElInput: Ue,
110
- ElOverlay: je,
111
- ElIcon: Ge,
112
- ...Ne
113
- },
114
- inheritAttrs: !1,
115
- props: {
116
- buttonSize: {
117
- type: String,
118
- validator: Je
119
- },
120
- modal: {
121
- type: Boolean,
122
- default: !0
123
- },
124
- lockScroll: {
125
- type: Boolean,
126
- default: !0
127
- },
128
- showClose: {
129
- type: Boolean,
130
- default: !0
131
- },
132
- closeOnClickModal: {
133
- type: Boolean,
134
- default: !0
135
- },
136
- closeOnPressEscape: {
137
- type: Boolean,
138
- default: !0
139
- },
140
- closeOnHashChange: {
141
- type: Boolean,
142
- default: !0
143
- },
144
- center: Boolean,
145
- draggable: Boolean,
146
- overflow: Boolean,
147
- roundButton: {
148
- default: !1,
149
- type: Boolean
150
- },
151
- container: {
152
- type: String,
153
- default: "body"
154
- },
155
- boxType: {
156
- type: String,
157
- default: ""
158
- }
159
- },
160
- emits: ["vanish", "action"],
161
- setup(e, { emit: t }) {
162
- const {
163
- locale: o,
164
- zIndex: i,
165
- ns: a,
166
- size: s
167
- } = Qe("message-box", E(() => e.buttonSize)), { t: u } = o, { nextZIndex: f } = i, c = B(!1), n = Ie({
168
- autofocus: !0,
169
- beforeClose: null,
170
- callback: null,
171
- cancelButtonText: "",
172
- cancelButtonClass: "",
173
- confirmButtonText: "",
174
- confirmButtonClass: "",
175
- customClass: "",
176
- customStyle: {},
177
- dangerouslyUseHTMLString: !1,
178
- distinguishCancelAndClose: !1,
179
- icon: "",
180
- inputPattern: null,
181
- inputPlaceholder: "",
182
- inputType: "text",
183
- inputValue: "",
184
- inputValidator: void 0,
185
- inputErrorMessage: "",
186
- message: "",
187
- modalFade: !0,
188
- modalClass: "",
189
- showCancelButton: !1,
190
- showConfirmButton: !0,
191
- type: "",
192
- title: void 0,
193
- showInput: !1,
194
- action: "",
195
- confirmButtonLoading: !1,
196
- cancelButtonLoading: !1,
197
- confirmButtonLoadingIcon: se(ue),
198
- cancelButtonLoadingIcon: se(ue),
199
- confirmButtonDisabled: !1,
200
- editorErrorMessage: "",
201
- validateError: !1,
202
- zIndex: f()
203
- }), M = E(() => {
204
- const l = n.type;
205
- return { [a.bm("icon", l)]: l && re[l] };
206
- }), S = de(), d = de(), R = E(() => {
207
- const l = n.type;
208
- return n.icon || l && re[l] || "";
209
- }), U = E(() => !!n.message), m = B(), C = B(), $ = B(), H = B(), x = B(), ye = E(() => n.confirmButtonClass);
210
- ae(() => n.inputValue, async (l) => {
211
- await P(), e.boxType === "prompt" && l !== null && ne();
212
- }, { immediate: !0 }), ae(() => c.value, (l) => {
213
- var v, g;
214
- l && (e.boxType !== "prompt" && (n.autofocus ? $.value = (g = (v = x.value) == null ? void 0 : v.$el) != null ? g : m.value : $.value = m.value), n.zIndex = f()), e.boxType === "prompt" && (l ? P().then(() => {
215
- var te;
216
- H.value && H.value.$el && (n.autofocus ? $.value = (te = Be()) != null ? te : m.value : $.value = m.value);
217
- }) : (n.editorErrorMessage = "", n.validateError = !1));
218
- });
219
- const be = E(() => e.draggable), Ce = E(() => e.overflow);
220
- Ye(m, C, be, Ce), me(async () => {
221
- await P(), e.closeOnHashChange && window.addEventListener("hashchange", z);
222
- }), Ae(() => {
223
- e.closeOnHashChange && window.removeEventListener("hashchange", z);
224
- });
225
- function z() {
226
- c.value && (c.value = !1, P(() => {
227
- n.action && t("action", n.action);
228
- }));
229
- }
230
- const ee = () => {
231
- e.closeOnClickModal && F(n.distinguishCancelAndClose ? "close" : "cancel");
232
- }, Ee = We(ee), we = (l) => {
233
- if (n.inputType !== "textarea")
234
- return l.preventDefault(), F("confirm");
235
- }, F = (l) => {
236
- var v;
237
- e.boxType === "prompt" && l === "confirm" && !ne() || (n.action = l, n.beforeClose ? (v = n.beforeClose) == null || v.call(n, l, n, z) : z());
238
- }, ne = () => {
239
- if (e.boxType === "prompt") {
240
- const l = n.inputPattern;
241
- if (l && !l.test(n.inputValue || ""))
242
- return n.editorErrorMessage = n.inputErrorMessage || u("el.messagebox.error"), n.validateError = !0, !1;
243
- const v = n.inputValidator;
244
- if (J(v)) {
245
- const g = v(n.inputValue);
246
- if (g === !1)
247
- return n.editorErrorMessage = n.inputErrorMessage || u("el.messagebox.error"), n.validateError = !0, !1;
248
- if (_(g))
249
- return n.editorErrorMessage = g, n.validateError = !0, !1;
250
- }
251
- }
252
- return n.editorErrorMessage = "", n.validateError = !1, !0;
253
- }, Be = () => {
254
- var l, v;
255
- const g = (l = H.value) == null ? void 0 : l.$refs;
256
- return (v = g == null ? void 0 : g.input) != null ? v : g == null ? void 0 : g.textarea;
257
- }, oe = () => {
258
- F("close");
259
- }, Te = () => {
260
- e.closeOnPressEscape && oe();
261
- };
262
- return e.lockScroll && qe(c), {
263
- ...Le(n),
264
- ns: a,
265
- overlayEvent: Ee,
266
- visible: c,
267
- hasMessage: U,
268
- typeClass: M,
269
- contentId: S,
270
- inputId: d,
271
- btnSize: s,
272
- iconComponent: R,
273
- confirmButtonClasses: ye,
274
- rootRef: m,
275
- focusStartRef: $,
276
- headerRef: C,
277
- inputRef: H,
278
- confirmRef: x,
279
- doClose: z,
280
- handleClose: oe,
281
- onCloseRequested: Te,
282
- handleWrapperClick: ee,
283
- handleInputEnter: we,
284
- handleAction: F,
285
- t: u
286
- };
287
- }
288
- });
289
- function sn(e, t, o, i, a, s) {
290
- const u = I("el-icon"), f = I("close"), c = I("el-input"), n = I("el-button"), M = I("el-focus-trap"), S = I("el-overlay");
291
- return p(), b(Re, {
292
- name: "fade-in-linear",
293
- onAfterLeave: (d) => e.$emit("vanish"),
294
- persisted: ""
295
- }, {
296
- default: h(() => [
297
- j(T(S, {
298
- "z-index": e.zIndex,
299
- "overlay-class": [e.ns.is("message-box"), e.modalClass],
300
- mask: e.modal
301
- }, {
302
- default: h(() => [
303
- y("div", {
304
- role: "dialog",
305
- "aria-label": e.title,
306
- "aria-modal": "true",
307
- "aria-describedby": e.showInput ? void 0 : e.contentId,
308
- class: r(`${e.ns.namespace.value}-overlay-message-box`),
309
- onClick: e.overlayEvent.onClick,
310
- onMousedown: e.overlayEvent.onMousedown,
311
- onMouseup: e.overlayEvent.onMouseup
312
- }, [
313
- T(M, {
314
- loop: "",
315
- trapped: e.visible,
316
- "focus-trap-el": e.rootRef,
317
- "focus-start-el": e.focusStartRef,
318
- onReleaseRequested: e.onCloseRequested
319
- }, {
320
- default: h(() => [
321
- y("div", {
322
- ref: "rootRef",
323
- class: r([
324
- e.ns.b(),
325
- e.customClass,
326
- e.ns.is("draggable", e.draggable),
327
- { [e.ns.m("center")]: e.center }
328
- ]),
329
- style: X(e.customStyle),
330
- tabindex: "-1",
331
- onClick: N(() => {
332
- }, ["stop"])
333
- }, [
334
- e.title !== null && e.title !== void 0 ? (p(), q("div", {
335
- key: 0,
336
- ref: "headerRef",
337
- class: r([e.ns.e("header"), { "show-close": e.showClose }])
338
- }, [
339
- y("div", {
340
- class: r(e.ns.e("title"))
341
- }, [
342
- e.iconComponent && e.center ? (p(), b(u, {
343
- key: 0,
344
- class: r([e.ns.e("status"), e.typeClass])
345
- }, {
346
- default: h(() => [
347
- (p(), b(V(e.iconComponent)))
348
- ]),
349
- _: 1
350
- }, 8, ["class"])) : A("v-if", !0),
351
- y("span", null, O(e.title), 1)
352
- ], 2),
353
- e.showClose ? (p(), q("button", {
354
- key: 0,
355
- type: "button",
356
- class: r(e.ns.e("headerbtn")),
357
- "aria-label": e.t("el.messagebox.close"),
358
- onClick: (d) => e.handleAction(e.distinguishCancelAndClose ? "close" : "cancel"),
359
- onKeydown: K(N((d) => e.handleAction(e.distinguishCancelAndClose ? "close" : "cancel"), ["prevent"]), ["enter"])
360
- }, [
361
- T(u, {
362
- class: r(e.ns.e("close"))
363
- }, {
364
- default: h(() => [
365
- T(f)
366
- ]),
367
- _: 1
368
- }, 8, ["class"])
369
- ], 42, ["aria-label", "onClick", "onKeydown"])) : A("v-if", !0)
370
- ], 2)) : A("v-if", !0),
371
- y("div", {
372
- id: e.contentId,
373
- class: r(e.ns.e("content"))
374
- }, [
375
- y("div", {
376
- class: r(e.ns.e("container"))
377
- }, [
378
- e.iconComponent && !e.center && e.hasMessage ? (p(), b(u, {
379
- key: 0,
380
- class: r([e.ns.e("status"), e.typeClass])
381
- }, {
382
- default: h(() => [
383
- (p(), b(V(e.iconComponent)))
384
- ]),
385
- _: 1
386
- }, 8, ["class"])) : A("v-if", !0),
387
- e.hasMessage ? (p(), q("div", {
388
- key: 1,
389
- class: r(e.ns.e("message"))
390
- }, [
391
- pe(e.$slots, "default", {}, () => [
392
- e.dangerouslyUseHTMLString ? (p(), b(V(e.showInput ? "label" : "p"), {
393
- key: 1,
394
- for: e.showInput ? e.inputId : void 0,
395
- innerHTML: e.message
396
- }, null, 8, ["for", "innerHTML"])) : (p(), b(V(e.showInput ? "label" : "p"), {
397
- key: 0,
398
- for: e.showInput ? e.inputId : void 0
399
- }, {
400
- default: h(() => [
401
- W(O(e.dangerouslyUseHTMLString ? "" : e.message), 1)
402
- ]),
403
- _: 1
404
- }, 8, ["for"]))
405
- ])
406
- ], 2)) : A("v-if", !0)
407
- ], 2),
408
- j(y("div", {
409
- class: r(e.ns.e("input"))
410
- }, [
411
- T(c, {
412
- id: e.inputId,
413
- ref: "inputRef",
414
- modelValue: e.inputValue,
415
- "onUpdate:modelValue": (d) => e.inputValue = d,
416
- type: e.inputType,
417
- placeholder: e.inputPlaceholder,
418
- "aria-invalid": e.validateError,
419
- class: r({ invalid: e.validateError }),
420
- onKeydown: K(e.handleInputEnter, ["enter"])
421
- }, null, 8, ["id", "modelValue", "onUpdate:modelValue", "type", "placeholder", "aria-invalid", "class", "onKeydown"]),
422
- y("div", {
423
- class: r(e.ns.e("errormsg")),
424
- style: X({
425
- visibility: e.editorErrorMessage ? "visible" : "hidden"
426
- })
427
- }, O(e.editorErrorMessage), 7)
428
- ], 2), [
429
- [G, e.showInput]
430
- ])
431
- ], 10, ["id"]),
432
- y("div", {
433
- class: r(e.ns.e("btns"))
434
- }, [
435
- e.showCancelButton ? (p(), b(n, {
436
- key: 0,
437
- loading: e.cancelButtonLoading,
438
- "loading-icon": e.cancelButtonLoadingIcon,
439
- class: r([e.cancelButtonClass]),
440
- round: e.roundButton,
441
- size: e.btnSize,
442
- onClick: (d) => e.handleAction("cancel"),
443
- onKeydown: K(N((d) => e.handleAction("cancel"), ["prevent"]), ["enter"])
444
- }, {
445
- default: h(() => [
446
- W(O(e.cancelButtonText || e.t("el.messagebox.cancel")), 1)
447
- ]),
448
- _: 1
449
- }, 8, ["loading", "loading-icon", "class", "round", "size", "onClick", "onKeydown"])) : A("v-if", !0),
450
- j(T(n, {
451
- ref: "confirmRef",
452
- type: "primary",
453
- loading: e.confirmButtonLoading,
454
- "loading-icon": e.confirmButtonLoadingIcon,
455
- class: r([e.confirmButtonClasses]),
456
- round: e.roundButton,
457
- disabled: e.confirmButtonDisabled,
458
- size: e.btnSize,
459
- onClick: (d) => e.handleAction("confirm"),
460
- onKeydown: K(N((d) => e.handleAction("confirm"), ["prevent"]), ["enter"])
461
- }, {
462
- default: h(() => [
463
- W(O(e.confirmButtonText || e.t("el.messagebox.confirm")), 1)
464
- ]),
465
- _: 1
466
- }, 8, ["loading", "loading-icon", "class", "round", "disabled", "size", "onClick", "onKeydown"]), [
467
- [G, e.showConfirmButton]
468
- ])
469
- ], 2)
470
- ], 14, ["onClick"])
471
- ]),
472
- _: 3
473
- }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onReleaseRequested"])
474
- ], 42, ["aria-label", "aria-describedby", "onClick", "onMousedown", "onMouseup"])
475
- ]),
476
- _: 3
477
- }, 8, ["z-index", "overlay-class", "mask"]), [
478
- [G, e.visible]
479
- ])
480
- ]),
481
- _: 3
482
- }, 8, ["onAfterLeave"]);
483
- }
484
- var an = /* @__PURE__ */ he(tn, [["render", sn], ["__file", "index.vue"]]);
485
- const D = /* @__PURE__ */ new Map(), ln = (e) => {
486
- let t = document.body;
487
- return e.appendTo && (_(e.appendTo) && (t = document.querySelector(e.appendTo)), ie(e.appendTo) && (t = e.appendTo), ie(t) || (De("ElMessageBox", "the appendTo option is not an HTMLElement. Falling back to document.body."), t = document.body)), t;
488
- }, rn = (e, t, o = null) => {
489
- const i = T(an, e, J(e.message) || ve(e.message) ? {
490
- default: J(e.message) ? e.message : () => e.message
491
- } : null);
492
- return i.appContext = o, ge(i, t), ln(e).appendChild(t.firstElementChild), i.component;
493
- }, un = () => document.createElement("div"), cn = (e, t) => {
494
- const o = un();
495
- e.onVanish = () => {
496
- ge(null, o), D.delete(a);
497
- }, e.onAction = (s) => {
498
- const u = D.get(a);
499
- let f;
500
- e.showInput ? f = { value: a.inputValue, action: s } : f = s, e.callback ? e.callback(f, i.proxy) : s === "cancel" || s === "close" ? e.distinguishCancelAndClose && s !== "cancel" ? u.reject("close") : u.reject("cancel") : u.resolve(f);
501
- };
502
- const i = rn(e, o, t), a = i.proxy;
503
- for (const s in e)
504
- le(e, s) && !le(a.$props, s) && (a[s] = e[s]);
505
- return a.visible = !0, a;
506
- };
507
- function L(e, t = null) {
508
- if (!Ve)
509
- return Promise.reject();
510
- let o;
511
- return _(e) || ve(e) ? e = {
512
- message: e
513
- } : o = e.callback, new Promise((i, a) => {
514
- const s = cn(e, t ?? L._context);
515
- D.set(s, {
516
- options: e,
517
- callback: o,
518
- resolve: i,
519
- reject: a
520
- });
521
- });
522
- }
523
- const dn = ["alert", "confirm", "prompt"], fn = {
524
- alert: { closeOnPressEscape: !1, closeOnClickModal: !1 },
525
- confirm: { showCancelButton: !0 },
526
- prompt: { showCancelButton: !0, showInput: !0 }
527
- };
528
- dn.forEach((e) => {
529
- L[e] = mn(e);
530
- });
531
- function mn(e) {
532
- return (t, o, i, a) => {
533
- let s = "";
534
- return Pe(o) ? (i = o, s = "") : Z(o) ? s = "" : s = o, L(Object.assign({
535
- title: s,
536
- message: t,
537
- type: "",
538
- ...fn[e]
539
- }, i, {
540
- boxType: e
541
- }), a);
542
- };
543
- }
544
- L.close = () => {
545
- D.forEach((e, t) => {
546
- t.doClose();
547
- }), D.clear();
548
- };
549
- L._context = null;
550
- const w = L;
551
- w.install = (e) => {
552
- w._context = e._context, e.config.globalProperties.$msgbox = w, e.config.globalProperties.$messageBox = w, e.config.globalProperties.$alert = w.alert, e.config.globalProperties.$confirm = w.confirm, e.config.globalProperties.$prompt = w.prompt;
553
- };
554
- const Sn = w;
555
- export {
556
- Sn as E,
557
- Mn as a
558
- };
@@ -1 +0,0 @@
1
- "use strict";const n=require("vue"),i=require("./base-bdc10baa.cjs"),T=require("./use-form-common-props-592797e2.cjs"),J=require("./el-button-960edd49.cjs"),Q=require("./el-input-5163bda3.cjs"),A=require("./el-overlay-e5d318c3.cjs"),O=require("./index-19fa1fcf.cjs"),I=require("./index-d94bae37.cjs"),Y=require("./validator-af488a9a.cjs"),x=require("./use-global-config-584b62f1.cjs"),q=require("./index-02ca0096.cjs"),_=require("./el-dialog-cd484c1f.cjs"),ee=i.buildProps({type:{type:String,values:["primary","success","info","warning","danger",""],default:""},size:{type:String,values:T.componentSizes,default:""},truncated:Boolean,lineClamp:{type:[String,Number]},tag:{type:String,default:"span"}}),ne=n.defineComponent({name:"ElText"}),oe=n.defineComponent({...ne,props:ee,setup(e){const l=e,t=n.ref(),c=T.useFormSize(),a=i.useNamespace("text"),s=n.computed(()=>[a.b(),a.m(l.type),a.m(c.value),a.is("truncated",l.truncated),a.is("line-clamp",!i.isUndefined(l.lineClamp))]),u=n.useAttrs().title,m=()=>{var d,o,b,E,f;if(u)return;let w=!1;const N=((d=t.value)==null?void 0:d.textContent)||"";if(l.truncated){const p=(o=t.value)==null?void 0:o.offsetWidth,C=(b=t.value)==null?void 0:b.scrollWidth;p&&C&&C>p&&(w=!0)}else if(!i.isUndefined(l.lineClamp)){const p=(E=t.value)==null?void 0:E.offsetHeight,C=(f=t.value)==null?void 0:f.scrollHeight;p&&C&&C>p&&(w=!0)}w?t.value.setAttribute("title",N):t.value.removeAttribute("title")};return n.onMounted(m),n.onUpdated(m),(d,o)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(d.tag),{ref_key:"textRef",ref:t,class:n.normalizeClass(n.unref(s)),style:n.normalizeStyle({"-webkit-line-clamp":d.lineClamp})},{default:n.withCtx(()=>[n.renderSlot(d.$slots,"default")]),_:3},8,["class","style"]))}});var te=i._export_sfc(oe,[["__file","text.vue"]]);const le=i.withInstall(te),R="_trap-focus-children",y=[],K=e=>{var l;if(y.length===0)return;const t=y[y.length-1][R];if(t.length>0&&e.code===I.EVENT_CODE.tab){if(t.length===1){e.preventDefault(),document.activeElement!==t[0]&&t[0].focus();return}const c=e.shiftKey,a=e.target===t[0],s=e.target===t[t.length-1];if(a&&c&&(e.preventDefault(),t[t.length-1].focus()),s&&!c&&(e.preventDefault(),t[0].focus()),process.env.NODE_ENV==="test"){const u=t.indexOf(e.target);u!==-1&&((l=t[c?u-1:u+1])==null||l.focus())}}},se={beforeMount(e){e[R]=I.obtainAllFocusableElements(e),y.push(e),y.length<=1&&document.addEventListener("keydown",K)},updated(e){n.nextTick(()=>{e[R]=I.obtainAllFocusableElements(e)})},unmounted(){y.shift(),y.length===0&&document.removeEventListener("keydown",K)}},ae=n.defineComponent({name:"ElMessageBox",directives:{TrapFocus:se},components:{ElButton:J.ElButton,ElFocusTrap:I.ElFocusTrap,ElInput:Q.ElInput,ElOverlay:A.ElOverlay,ElIcon:O.ElIcon,...T.TypeComponents},inheritAttrs:!1,props:{buttonSize:{type:String,validator:Y.isValidComponentSize},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(e,{emit:l}){const{locale:t,zIndex:c,ns:a,size:s}=x.useGlobalComponentSettings("message-box",n.computed(()=>e.buttonSize)),{t:u}=t,{nextZIndex:m}=c,d=n.ref(!1),o=n.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:"",inputValidator:void 0,inputErrorMessage:"",message:"",modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:n.markRaw(O.loading_default),cancelButtonLoadingIcon:n.markRaw(O.loading_default),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:m()}),b=n.computed(()=>{const r=o.type;return{[a.bm("icon",r)]:r&&T.TypeComponentsMap[r]}}),E=q.useId(),f=q.useId(),w=n.computed(()=>{const r=o.type;return o.icon||r&&T.TypeComponentsMap[r]||""}),N=n.computed(()=>!!o.message),p=n.ref(),C=n.ref(),k=n.ref(),V=n.ref(),$=n.ref(),H=n.computed(()=>o.confirmButtonClass);n.watch(()=>o.inputValue,async r=>{await n.nextTick(),e.boxType==="prompt"&&r!==null&&L()},{immediate:!0}),n.watch(()=>d.value,r=>{var v,g;r&&(e.boxType!=="prompt"&&(o.autofocus?k.value=(g=(v=$.value)==null?void 0:v.$el)!=null?g:p.value:k.value=p.value),o.zIndex=m()),e.boxType==="prompt"&&(r?n.nextTick().then(()=>{var F;V.value&&V.value.$el&&(o.autofocus?k.value=(F=X())!=null?F:p.value:k.value=p.value)}):(o.editorErrorMessage="",o.validateError=!1))});const U=n.computed(()=>e.draggable),j=n.computed(()=>e.overflow);_.useDraggable(p,C,U,j),n.onMounted(async()=>{await n.nextTick(),e.closeOnHashChange&&window.addEventListener("hashchange",S)}),n.onBeforeUnmount(()=>{e.closeOnHashChange&&window.removeEventListener("hashchange",S)});function S(){d.value&&(d.value=!1,n.nextTick(()=>{o.action&&l("action",o.action)}))}const D=()=>{e.closeOnClickModal&&z(o.distinguishCancelAndClose?"close":"cancel")},G=A.useSameTarget(D),W=r=>{if(o.inputType!=="textarea")return r.preventDefault(),z("confirm")},z=r=>{var v;e.boxType==="prompt"&&r==="confirm"&&!L()||(o.action=r,o.beforeClose?(v=o.beforeClose)==null||v.call(o,r,o,S):S())},L=()=>{if(e.boxType==="prompt"){const r=o.inputPattern;if(r&&!r.test(o.inputValue||""))return o.editorErrorMessage=o.inputErrorMessage||u("el.messagebox.error"),o.validateError=!0,!1;const v=o.inputValidator;if(i.isFunction(v)){const g=v(o.inputValue);if(g===!1)return o.editorErrorMessage=o.inputErrorMessage||u("el.messagebox.error"),o.validateError=!0,!1;if(i.isString(g))return o.editorErrorMessage=g,o.validateError=!0,!1}}return o.editorErrorMessage="",o.validateError=!1,!0},X=()=>{var r,v;const g=(r=V.value)==null?void 0:r.$refs;return(v=g==null?void 0:g.input)!=null?v:g==null?void 0:g.textarea},P=()=>{z("close")},Z=()=>{e.closeOnPressEscape&&P()};return e.lockScroll&&A.useLockscreen(d),{...n.toRefs(o),ns:a,overlayEvent:G,visible:d,hasMessage:N,typeClass:b,contentId:E,inputId:f,btnSize:s,iconComponent:w,confirmButtonClasses:H,rootRef:p,focusStartRef:k,headerRef:C,inputRef:V,confirmRef:$,doClose:S,handleClose:P,onCloseRequested:Z,handleWrapperClick:D,handleInputEnter:W,handleAction:z,t:u}}});function re(e,l,t,c,a,s){const u=n.resolveComponent("el-icon"),m=n.resolveComponent("close"),d=n.resolveComponent("el-input"),o=n.resolveComponent("el-button"),b=n.resolveComponent("el-focus-trap"),E=n.resolveComponent("el-overlay");return n.openBlock(),n.createBlock(n.Transition,{name:"fade-in-linear",onAfterLeave:f=>e.$emit("vanish"),persisted:""},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(E,{"z-index":e.zIndex,"overlay-class":[e.ns.is("message-box"),e.modalClass],mask:e.modal},{default:n.withCtx(()=>[n.createElementVNode("div",{role:"dialog","aria-label":e.title,"aria-modal":"true","aria-describedby":e.showInput?void 0:e.contentId,class:n.normalizeClass(`${e.ns.namespace.value}-overlay-message-box`),onClick:e.overlayEvent.onClick,onMousedown:e.overlayEvent.onMousedown,onMouseup:e.overlayEvent.onMouseup},[n.createVNode(b,{loop:"",trapped:e.visible,"focus-trap-el":e.rootRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:n.withCtx(()=>[n.createElementVNode("div",{ref:"rootRef",class:n.normalizeClass([e.ns.b(),e.customClass,e.ns.is("draggable",e.draggable),{[e.ns.m("center")]:e.center}]),style:n.normalizeStyle(e.customStyle),tabindex:"-1",onClick:n.withModifiers(()=>{},["stop"])},[e.title!==null&&e.title!==void 0?(n.openBlock(),n.createElementBlock("div",{key:0,ref:"headerRef",class:n.normalizeClass([e.ns.e("header"),{"show-close":e.showClose}])},[n.createElementVNode("div",{class:n.normalizeClass(e.ns.e("title"))},[e.iconComponent&&e.center?(n.openBlock(),n.createBlock(u,{key:0,class:n.normalizeClass([e.ns.e("status"),e.typeClass])},{default:n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):n.createCommentVNode("v-if",!0),n.createElementVNode("span",null,n.toDisplayString(e.title),1)],2),e.showClose?(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:n.normalizeClass(e.ns.e("headerbtn")),"aria-label":e.t("el.messagebox.close"),onClick:f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),onKeydown:n.withKeys(n.withModifiers(f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[n.createVNode(u,{class:n.normalizeClass(e.ns.e("close"))},{default:n.withCtx(()=>[n.createVNode(m)]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):n.createCommentVNode("v-if",!0)],2)):n.createCommentVNode("v-if",!0),n.createElementVNode("div",{id:e.contentId,class:n.normalizeClass(e.ns.e("content"))},[n.createElementVNode("div",{class:n.normalizeClass(e.ns.e("container"))},[e.iconComponent&&!e.center&&e.hasMessage?(n.openBlock(),n.createBlock(u,{key:0,class:n.normalizeClass([e.ns.e("status"),e.typeClass])},{default:n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):n.createCommentVNode("v-if",!0),e.hasMessage?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(e.ns.e("message"))},[n.renderSlot(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.showInput?"label":"p"),{key:1,for:e.showInput?e.inputId:void 0,innerHTML:e.message},null,8,["for","innerHTML"])):(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.showInput?"label":"p"),{key:0,for:e.showInput?e.inputId:void 0},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.dangerouslyUseHTMLString?"":e.message),1)]),_:1},8,["for"]))])],2)):n.createCommentVNode("v-if",!0)],2),n.withDirectives(n.createElementVNode("div",{class:n.normalizeClass(e.ns.e("input"))},[n.createVNode(d,{id:e.inputId,ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":f=>e.inputValue=f,type:e.inputType,placeholder:e.inputPlaceholder,"aria-invalid":e.validateError,class:n.normalizeClass({invalid:e.validateError}),onKeydown:n.withKeys(e.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),n.createElementVNode("div",{class:n.normalizeClass(e.ns.e("errormsg")),style:n.normalizeStyle({visibility:e.editorErrorMessage?"visible":"hidden"})},n.toDisplayString(e.editorErrorMessage),7)],2),[[n.vShow,e.showInput]])],10,["id"]),n.createElementVNode("div",{class:n.normalizeClass(e.ns.e("btns"))},[e.showCancelButton?(n.openBlock(),n.createBlock(o,{key:0,loading:e.cancelButtonLoading,"loading-icon":e.cancelButtonLoadingIcon,class:n.normalizeClass([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:f=>e.handleAction("cancel"),onKeydown:n.withKeys(n.withModifiers(f=>e.handleAction("cancel"),["prevent"]),["enter"])},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.cancelButtonText||e.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):n.createCommentVNode("v-if",!0),n.withDirectives(n.createVNode(o,{ref:"confirmRef",type:"primary",loading:e.confirmButtonLoading,"loading-icon":e.confirmButtonLoadingIcon,class:n.normalizeClass([e.confirmButtonClasses]),round:e.roundButton,disabled:e.confirmButtonDisabled,size:e.btnSize,onClick:f=>e.handleAction("confirm"),onKeydown:n.withKeys(n.withModifiers(f=>e.handleAction("confirm"),["prevent"]),["enter"])},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.confirmButtonText||e.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[n.vShow,e.showConfirmButton]])],2)],14,["onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,["aria-label","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["z-index","overlay-class","mask"]),[[n.vShow,e.visible]])]),_:3},8,["onAfterLeave"])}var ie=i._export_sfc(ae,[["render",re],["__file","index.vue"]]);const M=new Map,ce=e=>{let l=document.body;return e.appendTo&&(i.isString(e.appendTo)&&(l=document.querySelector(e.appendTo)),i.isElement(e.appendTo)&&(l=e.appendTo),i.isElement(l)||(i.debugWarn("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),l=document.body)),l},ue=(e,l,t=null)=>{const c=n.createVNode(ie,e,i.isFunction(e.message)||n.isVNode(e.message)?{default:i.isFunction(e.message)?e.message:()=>e.message}:null);return c.appContext=t,n.render(c,l),ce(e).appendChild(l.firstElementChild),c.component},de=()=>document.createElement("div"),fe=(e,l)=>{const t=de();e.onVanish=()=>{n.render(null,t),M.delete(a)},e.onAction=s=>{const u=M.get(a);let m;e.showInput?m={value:a.inputValue,action:s}:m=s,e.callback?e.callback(m,c.proxy):s==="cancel"||s==="close"?e.distinguishCancelAndClose&&s!=="cancel"?u.reject("close"):u.reject("cancel"):u.resolve(m)};const c=ue(e,t,l),a=c.proxy;for(const s in e)i.hasOwn(e,s)&&!i.hasOwn(a.$props,s)&&(a[s]=e[s]);return a.visible=!0,a};function B(e,l=null){if(!i.isClient)return Promise.reject();let t;return i.isString(e)||n.isVNode(e)?e={message:e}:t=e.callback,new Promise((c,a)=>{const s=fe(e,l??B._context);M.set(s,{options:e,callback:t,resolve:c,reject:a})})}const me=["alert","confirm","prompt"],pe={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};me.forEach(e=>{B[e]=ve(e)});function ve(e){return(l,t,c,a)=>{let s="";return i.isObject(t)?(c=t,s=""):i.isUndefined(t)?s="":s=t,B(Object.assign({title:s,message:l,type:"",...pe[e]},c,{boxType:e}),a)}}B.close=()=>{M.forEach((e,l)=>{l.doClose()}),M.clear()};B._context=null;const h=B;h.install=e=>{h._context=e._context,e.config.globalProperties.$msgbox=h,e.config.globalProperties.$messageBox=h,e.config.globalProperties.$alert=h.alert,e.config.globalProperties.$confirm=h.confirm,e.config.globalProperties.$prompt=h.prompt};const ge=h;exports.ElMessageBox=ge;exports.ElText=le;