bgi-plus 1.0.0 → 1.0.1

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 (409) hide show
  1. package/dist/index.css +1 -1
  2. package/es/component.mjs +3 -3
  3. package/es/components/affix/src/affix.d.ts +1 -1
  4. package/es/components/affix/src/affix.vue.d.ts +1 -1
  5. package/es/components/alert/src/alert.d.ts +1 -1
  6. package/es/components/alert/src/alert.vue.d.ts +2 -2
  7. package/es/components/anchor/src/anchor.vue.d.ts +1 -1
  8. package/es/components/autocomplete/src/autocomplete.d.ts +4 -4
  9. package/es/components/autocomplete/src/autocomplete.vue.d.ts +1 -1
  10. package/es/components/avatar/src/avatar-group-props.d.ts +1 -1
  11. package/es/components/avatar/src/avatar-group.d.ts +2 -2
  12. package/es/components/avatar/src/avatar.d.ts +2 -2
  13. package/es/components/backtop/src/backtop.vue.d.ts +1 -1
  14. package/es/components/badge/src/badge.d.ts +1 -1
  15. package/es/components/badge/src/badge.vue.d.ts +1 -1
  16. package/es/components/button/src/button-group.vue.d.ts +1 -1
  17. package/es/components/button/src/button.d.ts +1 -1
  18. package/es/components/button/src/button.vue.d.ts +5 -5
  19. package/es/components/calendar/src/calendar.vue.d.ts +1 -1
  20. package/es/components/carousel/src/carousel-item.vue.d.ts +1 -1
  21. package/es/components/carousel/src/carousel.vue.d.ts +2 -2
  22. package/es/components/cascader/src/cascader.d.ts +3 -3
  23. package/es/components/cascader/src/cascader.vue.d.ts +11 -11
  24. package/es/components/cascader-panel/src/index.vue.d.ts +1 -1
  25. package/es/components/check-tag/src/check-tag.d.ts +1 -1
  26. package/es/components/checkbox/src/checkbox-button.vue.d.ts +4 -4
  27. package/es/components/checkbox/src/checkbox-group.vue.d.ts +4 -4
  28. package/es/components/checkbox/src/checkbox.d.ts +8 -8
  29. package/es/components/checkbox/src/checkbox.vue.d.ts +4 -4
  30. package/es/components/col/src/col.vue.d.ts +2 -2
  31. package/es/components/collapse/src/collapse-item.vue.d.ts +1 -1
  32. package/es/components/collapse/src/collapse.vue.d.ts +1 -1
  33. package/es/components/color-picker/src/color-picker.vue.d.ts +4 -4
  34. package/es/components/color-picker-panel/src/color-picker-panel.vue.d.ts +1 -1
  35. package/es/components/config-provider/src/hooks/use-global-config.d.ts +1 -1
  36. package/es/components/countdown/src/countdown.vue.d.ts +2 -2
  37. package/es/components/date-picker/src/date-picker.d.ts +12 -12
  38. package/es/components/date-picker/src/props.d.ts +1 -1
  39. package/es/components/date-picker-panel/src/date-picker-panel.d.ts +2 -2
  40. package/es/components/descriptions/src/description-item.d.ts +20 -20
  41. package/es/components/descriptions/src/description.vue.d.ts +1 -1
  42. package/es/components/dialog/src/dialog.vue.d.ts +4 -4
  43. package/es/components/divider/src/divider.d.ts +1 -1
  44. package/es/components/drawer/src/drawer.vue.d.ts +4 -4
  45. package/es/components/dropdown/src/dropdown-menu.vue.d.ts +1 -1
  46. package/es/components/dropdown/src/dropdown.d.ts +3 -3
  47. package/es/components/dropdown/src/dropdown.vue.d.ts +95 -95
  48. package/es/components/extend/base-table/src/index.vue.d.ts +5 -5
  49. package/es/components/extend/dna-animation/src/index.vue.d.ts +1 -1
  50. package/es/components/extend/edit-cell/src/index.vue.d.ts +10 -10
  51. package/es/components/extend/edit-table/src/index.vue.d.ts +10 -10
  52. package/es/components/extend/mutiline-text/src/index.vue.d.ts +1 -1
  53. package/es/components/extend/quill-editor/src/index.vue.d.ts +2 -2
  54. package/es/components/extend/v-button/src/index.vue.d.ts +16 -16
  55. package/es/components/extend/v-dialog/src/index.vue.d.ts +4 -4
  56. package/es/components/extend/v-form/src/form-item.vue.d.ts +5 -5
  57. package/es/components/extend/v-form/src/index.vue.d.ts +12 -12
  58. package/es/components/extend/v-input-number/src/input-number.d.ts +2 -2
  59. package/es/components/extend/v-input-number/src/input-number.vue.d.ts +9 -9
  60. package/es/components/extend/v-switch/src/index.vue.d.ts +1 -1
  61. package/es/components/extend/v-upload/src/index.vue.d.ts +6 -6
  62. package/es/components/form/src/form-item.d.ts +1 -1
  63. package/es/components/form/src/form.d.ts +1 -1
  64. package/es/components/form/src/form.vue.d.ts +1 -1
  65. package/es/components/image/src/image.vue.d.ts +1 -1
  66. package/es/components/input/src/input.d.ts +3 -3
  67. package/es/components/input/src/input.vue.d.ts +3 -3
  68. package/es/components/input-number/src/input-number.d.ts +2 -2
  69. package/es/components/input-number/src/input-number.vue.d.ts +9 -9
  70. package/es/components/input-tag/src/input-tag.d.ts +2 -2
  71. package/es/components/input-tag/src/input-tag.vue.d.ts +13 -13
  72. package/es/components/input-tag/style/css.mjs +1 -1
  73. package/es/components/input-tag/style/index.mjs +1 -1
  74. package/es/components/link/src/link.d.ts +1 -1
  75. package/es/components/link/src/link.vue.d.ts +1 -1
  76. package/es/components/mention/src/mention.d.ts +4 -4
  77. package/es/components/menu/src/menu.d.ts +4 -4
  78. package/es/components/message/src/message.d.ts +2 -2
  79. package/es/components/message/src/message.vue.d.ts +7 -7
  80. package/es/components/notification/src/notification.d.ts +1 -1
  81. package/es/components/notification/src/notification.vue.d.ts +5 -5
  82. package/es/components/page-header/src/page-header.vue.d.ts +1 -1
  83. package/es/components/popconfirm/src/popconfirm.d.ts +2 -2
  84. package/es/components/popconfirm/src/popconfirm.vue.d.ts +3 -3
  85. package/es/components/popover/src/popover.d.ts +1 -1
  86. package/es/components/popover/src/popover.vue.d.ts +10 -10
  87. package/es/components/popper/src/composables/use-content.d.ts +3 -3
  88. package/es/components/popper/src/content.d.ts +4 -4
  89. package/es/components/popper/src/content.vue.d.ts +12 -12
  90. package/es/components/popper/src/popper.d.ts +2 -2
  91. package/es/components/progress/src/progress.d.ts +3 -3
  92. package/es/components/progress/src/progress.vue.d.ts +6 -6
  93. package/es/components/radio/src/radio-button.d.ts +3 -3
  94. package/es/components/radio/src/radio-button.vue.d.ts +2 -2
  95. package/es/components/radio/src/radio-group.vue.d.ts +4 -4
  96. package/es/components/radio/src/radio.d.ts +6 -6
  97. package/es/components/radio/src/radio.vue.d.ts +3 -3
  98. package/es/components/rate/src/rate.vue.d.ts +3 -3
  99. package/es/components/result/src/result.d.ts +1 -1
  100. package/es/components/result/src/result.vue.d.ts +1 -1
  101. package/es/components/row/src/row.d.ts +2 -2
  102. package/es/components/row/src/row.vue.d.ts +1 -1
  103. package/es/components/scrollbar/src/scrollbar.vue.d.ts +2 -2
  104. package/es/components/segmented/index.d.ts +2 -2
  105. package/es/components/segmented/src/segmented.d.ts +1 -1
  106. package/es/components/segmented/src/segmented.vue.d.ts +1 -1
  107. package/es/components/select/src/option.d.ts +2 -2
  108. package/es/components/select/src/option.vue.d.ts +5 -5
  109. package/es/components/select/src/select.d.ts +4 -4
  110. package/es/components/select/src/select.vue.d.ts +105 -105
  111. package/es/components/select-v2/src/defaults.d.ts +2 -2
  112. package/es/components/select-v2/src/select.vue.d.ts +86 -86
  113. package/es/components/skeleton/src/skeleton-item.d.ts +1 -1
  114. package/es/components/slider/src/slider.vue.d.ts +6 -6
  115. package/es/components/space/src/space.d.ts +1 -1
  116. package/es/components/statistic/src/statistic.vue.d.ts +1 -1
  117. package/es/components/steps/src/item.d.ts +1 -1
  118. package/es/components/steps/src/item.vue.d.ts +2 -2
  119. package/es/components/steps/src/steps.d.ts +2 -2
  120. package/es/components/switch/src/switch.vue.d.ts +2 -2
  121. package/es/components/table/src/table-column/index.d.ts +18 -18
  122. package/es/components/table/src/table-footer/index.d.ts +1 -1
  123. package/es/components/table/src/table-header/index.d.ts +13 -13
  124. package/es/components/table/src/table.vue.d.ts +43 -43
  125. package/es/components/table/style/css.mjs +1 -1
  126. package/es/components/table/style/index.mjs +1 -1
  127. package/es/components/tabs/src/tab-pane.vue.d.ts +1 -1
  128. package/es/components/tabs/src/tabs.d.ts +5 -5
  129. package/es/components/tag/src/tag.d.ts +1 -1
  130. package/es/components/text/src/text.d.ts +1 -1
  131. package/es/components/text/src/text.vue.d.ts +1 -1
  132. package/es/components/time-picker/src/common/picker.vue.d.ts +12 -12
  133. package/es/components/time-picker/src/common/props.d.ts +1 -1
  134. package/es/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +1 -1
  135. package/es/components/time-picker/src/time-picker.d.ts +12 -12
  136. package/es/components/time-select/src/time-select.vue.d.ts +4 -4
  137. package/es/components/timeline/src/timeline-item.d.ts +2 -2
  138. package/es/components/timeline/src/timeline-item.vue.d.ts +2 -2
  139. package/es/components/tooltip/src/content.d.ts +1 -1
  140. package/es/components/tooltip/src/content.vue.d.ts +15 -15
  141. package/es/components/tooltip/src/tooltip.d.ts +2 -2
  142. package/es/components/tooltip/src/tooltip.vue.d.ts +18 -18
  143. package/es/components/tour/src/content.d.ts +2 -2
  144. package/es/components/tour/src/step.d.ts +1 -1
  145. package/es/components/tour/src/step.vue.d.ts +1 -1
  146. package/es/components/tour/src/tour.d.ts +1 -1
  147. package/es/components/tour/src/tour.vue.d.ts +3 -3
  148. package/es/components/transfer/src/transfer.vue.d.ts +1 -1
  149. package/es/components/tree/src/tree.vue.d.ts +17 -17
  150. package/es/components/tree-select/src/tree-select.vue.d.ts +47 -47
  151. package/es/components/tree-v2/src/tree.vue.d.ts +6 -6
  152. package/es/components/upload/src/upload-content.d.ts +1 -1
  153. package/es/components/upload/src/upload-content.vue.d.ts +2 -2
  154. package/es/components/upload/src/upload-list.d.ts +1 -1
  155. package/es/components/upload/src/upload.d.ts +2 -2
  156. package/es/components/upload/src/upload.vue.d.ts +2 -2
  157. package/es/components/virtual-list/src/builders/build-grid.d.ts +1 -1
  158. package/es/components/virtual-list/src/components/dynamic-size-grid.d.ts +1 -1
  159. package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +1 -1
  160. package/es/components/virtual-list/src/components/fixed-size-grid.d.ts +1 -1
  161. package/es/components/virtual-list/src/components/fixed-size-list.d.ts +1 -1
  162. package/es/hooks/use-floating/index.d.ts +8 -8
  163. package/es/hooks/use-popper/index.d.ts +3 -3
  164. package/es/index.mjs +13 -13
  165. package/es/packages/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.mjs +2 -2
  166. package/es/packages/components/cascader-panel/src/index.vue_vue_type_script_setup_true_lang.mjs +1 -1
  167. package/es/packages/components/color-picker/src/color-picker.vue_vue_type_script_setup_true_lang.mjs +1 -1
  168. package/es/packages/components/countdown/src/countdown.vue_vue_type_script_setup_true_lang.mjs +1 -1
  169. package/es/packages/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue_vue_type_script_setup_true_lang.mjs +1 -1
  170. package/es/packages/components/date-picker-panel/src/date-picker-com/panel-date-range.vue_vue_type_script_setup_true_lang.mjs +1 -1
  171. package/es/packages/components/extend/base-table/src/index.vue_vue_type_script_setup_true_lang.mjs +1 -1
  172. package/es/packages/components/extend/v-input-number/src/input-number.vue_vue_type_script_setup_true_lang.mjs +1 -1
  173. package/es/packages/components/index.mjs +6 -6
  174. package/es/packages/components/input-number/src/input-number.vue_vue_type_script_setup_true_lang.mjs +1 -1
  175. package/es/packages/components/menu/src/menu.mjs +1 -1
  176. package/es/packages/components/menu/src/utils/menu-item.mjs +1 -1
  177. package/es/packages/components/menu/src/utils/submenu.mjs +1 -1
  178. package/es/packages/components/message-box/src/index.vue_vue_type_script_lang.mjs +1 -1
  179. package/es/packages/components/select/src/select.vue_vue_type_script_lang.mjs +1 -1
  180. package/es/packages/components/select-v2/src/select.vue_vue_type_script_lang.mjs +1 -1
  181. package/es/packages/components/table/src/table.vue_vue_type_script_lang.mjs +1 -1
  182. package/es/packages/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_script_setup_true_lang.mjs +1 -1
  183. package/es/packages/constants/index.mjs +2 -2
  184. package/es/packages/directives/trap-focus/index.mjs +1 -1
  185. package/es/plugin.mjs +1 -1
  186. package/es/utils/vue/size.d.ts +1 -1
  187. package/es/utils/vue/vnode.d.ts +2 -2
  188. package/lib/component.js +107 -107
  189. package/lib/components/affix/src/affix.d.ts +1 -1
  190. package/lib/components/affix/src/affix.vue.d.ts +1 -1
  191. package/lib/components/alert/src/alert.d.ts +1 -1
  192. package/lib/components/alert/src/alert.vue.d.ts +2 -2
  193. package/lib/components/anchor/src/anchor.vue.d.ts +1 -1
  194. package/lib/components/autocomplete/src/autocomplete.d.ts +4 -4
  195. package/lib/components/autocomplete/src/autocomplete.vue.d.ts +1 -1
  196. package/lib/components/avatar/src/avatar-group-props.d.ts +1 -1
  197. package/lib/components/avatar/src/avatar-group.d.ts +2 -2
  198. package/lib/components/avatar/src/avatar.d.ts +2 -2
  199. package/lib/components/backtop/src/backtop.vue.d.ts +1 -1
  200. package/lib/components/badge/src/badge.d.ts +1 -1
  201. package/lib/components/badge/src/badge.vue.d.ts +1 -1
  202. package/lib/components/button/src/button-group.vue.d.ts +1 -1
  203. package/lib/components/button/src/button.d.ts +1 -1
  204. package/lib/components/button/src/button.vue.d.ts +5 -5
  205. package/lib/components/calendar/src/calendar.vue.d.ts +1 -1
  206. package/lib/components/carousel/src/carousel-item.vue.d.ts +1 -1
  207. package/lib/components/carousel/src/carousel.vue.d.ts +2 -2
  208. package/lib/components/cascader/src/cascader.d.ts +3 -3
  209. package/lib/components/cascader/src/cascader.vue.d.ts +11 -11
  210. package/lib/components/cascader-panel/src/index.vue.d.ts +1 -1
  211. package/lib/components/check-tag/src/check-tag.d.ts +1 -1
  212. package/lib/components/checkbox/src/checkbox-button.vue.d.ts +4 -4
  213. package/lib/components/checkbox/src/checkbox-group.vue.d.ts +4 -4
  214. package/lib/components/checkbox/src/checkbox.d.ts +8 -8
  215. package/lib/components/checkbox/src/checkbox.vue.d.ts +4 -4
  216. package/lib/components/col/src/col.vue.d.ts +2 -2
  217. package/lib/components/collapse/src/collapse-item.vue.d.ts +1 -1
  218. package/lib/components/collapse/src/collapse.vue.d.ts +1 -1
  219. package/lib/components/color-picker/src/color-picker.vue.d.ts +4 -4
  220. package/lib/components/color-picker-panel/src/color-picker-panel.vue.d.ts +1 -1
  221. package/lib/components/config-provider/src/hooks/use-global-config.d.ts +1 -1
  222. package/lib/components/countdown/src/countdown.vue.d.ts +2 -2
  223. package/lib/components/date-picker/src/date-picker.d.ts +12 -12
  224. package/lib/components/date-picker/src/props.d.ts +1 -1
  225. package/lib/components/date-picker-panel/src/date-picker-panel.d.ts +2 -2
  226. package/lib/components/descriptions/src/description-item.d.ts +20 -20
  227. package/lib/components/descriptions/src/description.vue.d.ts +1 -1
  228. package/lib/components/dialog/src/dialog.vue.d.ts +4 -4
  229. package/lib/components/divider/src/divider.d.ts +1 -1
  230. package/lib/components/drawer/src/drawer.vue.d.ts +4 -4
  231. package/lib/components/dropdown/src/dropdown-menu.vue.d.ts +1 -1
  232. package/lib/components/dropdown/src/dropdown.d.ts +3 -3
  233. package/lib/components/dropdown/src/dropdown.vue.d.ts +95 -95
  234. package/lib/components/extend/base-table/src/index.vue.d.ts +5 -5
  235. package/lib/components/extend/dna-animation/src/index.vue.d.ts +1 -1
  236. package/lib/components/extend/edit-cell/src/index.vue.d.ts +10 -10
  237. package/lib/components/extend/edit-table/src/index.vue.d.ts +10 -10
  238. package/lib/components/extend/mutiline-text/src/index.vue.d.ts +1 -1
  239. package/lib/components/extend/quill-editor/src/index.vue.d.ts +2 -2
  240. package/lib/components/extend/v-button/src/index.vue.d.ts +16 -16
  241. package/lib/components/extend/v-dialog/src/index.vue.d.ts +4 -4
  242. package/lib/components/extend/v-form/src/form-item.vue.d.ts +5 -5
  243. package/lib/components/extend/v-form/src/index.vue.d.ts +12 -12
  244. package/lib/components/extend/v-input-number/src/input-number.d.ts +2 -2
  245. package/lib/components/extend/v-input-number/src/input-number.vue.d.ts +9 -9
  246. package/lib/components/extend/v-switch/src/index.vue.d.ts +1 -1
  247. package/lib/components/extend/v-upload/src/index.vue.d.ts +6 -6
  248. package/lib/components/form/src/form-item.d.ts +1 -1
  249. package/lib/components/form/src/form.d.ts +1 -1
  250. package/lib/components/form/src/form.vue.d.ts +1 -1
  251. package/lib/components/image/src/image.vue.d.ts +1 -1
  252. package/lib/components/input/src/input.d.ts +3 -3
  253. package/lib/components/input/src/input.vue.d.ts +3 -3
  254. package/lib/components/input-number/src/input-number.d.ts +2 -2
  255. package/lib/components/input-number/src/input-number.vue.d.ts +9 -9
  256. package/lib/components/input-tag/src/input-tag.d.ts +2 -2
  257. package/lib/components/input-tag/src/input-tag.vue.d.ts +13 -13
  258. package/lib/components/input-tag/style/css.js +1 -1
  259. package/lib/components/input-tag/style/index.js +1 -1
  260. package/lib/components/link/src/link.d.ts +1 -1
  261. package/lib/components/link/src/link.vue.d.ts +1 -1
  262. package/lib/components/mention/src/mention.d.ts +4 -4
  263. package/lib/components/menu/src/menu.d.ts +4 -4
  264. package/lib/components/message/src/message.d.ts +2 -2
  265. package/lib/components/message/src/message.vue.d.ts +7 -7
  266. package/lib/components/notification/src/notification.d.ts +1 -1
  267. package/lib/components/notification/src/notification.vue.d.ts +5 -5
  268. package/lib/components/page-header/src/page-header.vue.d.ts +1 -1
  269. package/lib/components/popconfirm/src/popconfirm.d.ts +2 -2
  270. package/lib/components/popconfirm/src/popconfirm.vue.d.ts +3 -3
  271. package/lib/components/popover/src/popover.d.ts +1 -1
  272. package/lib/components/popover/src/popover.vue.d.ts +10 -10
  273. package/lib/components/popper/src/composables/use-content.d.ts +3 -3
  274. package/lib/components/popper/src/content.d.ts +4 -4
  275. package/lib/components/popper/src/content.vue.d.ts +12 -12
  276. package/lib/components/popper/src/popper.d.ts +2 -2
  277. package/lib/components/progress/src/progress.d.ts +3 -3
  278. package/lib/components/progress/src/progress.vue.d.ts +6 -6
  279. package/lib/components/radio/src/radio-button.d.ts +3 -3
  280. package/lib/components/radio/src/radio-button.vue.d.ts +2 -2
  281. package/lib/components/radio/src/radio-group.vue.d.ts +4 -4
  282. package/lib/components/radio/src/radio.d.ts +6 -6
  283. package/lib/components/radio/src/radio.vue.d.ts +3 -3
  284. package/lib/components/rate/src/rate.vue.d.ts +3 -3
  285. package/lib/components/result/src/result.d.ts +1 -1
  286. package/lib/components/result/src/result.vue.d.ts +1 -1
  287. package/lib/components/row/src/row.d.ts +2 -2
  288. package/lib/components/row/src/row.vue.d.ts +1 -1
  289. package/lib/components/scrollbar/src/scrollbar.vue.d.ts +2 -2
  290. package/lib/components/segmented/index.d.ts +2 -2
  291. package/lib/components/segmented/src/segmented.d.ts +1 -1
  292. package/lib/components/segmented/src/segmented.vue.d.ts +1 -1
  293. package/lib/components/select/src/option.d.ts +2 -2
  294. package/lib/components/select/src/option.vue.d.ts +5 -5
  295. package/lib/components/select/src/select.d.ts +4 -4
  296. package/lib/components/select/src/select.vue.d.ts +105 -105
  297. package/lib/components/select-v2/src/defaults.d.ts +2 -2
  298. package/lib/components/select-v2/src/select.vue.d.ts +86 -86
  299. package/lib/components/skeleton/src/skeleton-item.d.ts +1 -1
  300. package/lib/components/slider/src/slider.vue.d.ts +6 -6
  301. package/lib/components/space/src/space.d.ts +1 -1
  302. package/lib/components/statistic/src/statistic.vue.d.ts +1 -1
  303. package/lib/components/steps/src/item.d.ts +1 -1
  304. package/lib/components/steps/src/item.vue.d.ts +2 -2
  305. package/lib/components/steps/src/steps.d.ts +2 -2
  306. package/lib/components/switch/src/switch.vue.d.ts +2 -2
  307. package/lib/components/table/src/table-column/index.d.ts +18 -18
  308. package/lib/components/table/src/table-footer/index.d.ts +1 -1
  309. package/lib/components/table/src/table-header/index.d.ts +13 -13
  310. package/lib/components/table/src/table.vue.d.ts +43 -43
  311. package/lib/components/table/style/css.js +1 -1
  312. package/lib/components/table/style/index.js +1 -1
  313. package/lib/components/tabs/src/tab-pane.vue.d.ts +1 -1
  314. package/lib/components/tabs/src/tabs.d.ts +5 -5
  315. package/lib/components/tag/src/tag.d.ts +1 -1
  316. package/lib/components/text/src/text.d.ts +1 -1
  317. package/lib/components/text/src/text.vue.d.ts +1 -1
  318. package/lib/components/time-picker/src/common/picker.vue.d.ts +12 -12
  319. package/lib/components/time-picker/src/common/props.d.ts +1 -1
  320. package/lib/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +1 -1
  321. package/lib/components/time-picker/src/time-picker.d.ts +12 -12
  322. package/lib/components/time-select/src/time-select.vue.d.ts +4 -4
  323. package/lib/components/timeline/src/timeline-item.d.ts +2 -2
  324. package/lib/components/timeline/src/timeline-item.vue.d.ts +2 -2
  325. package/lib/components/tooltip/src/content.d.ts +1 -1
  326. package/lib/components/tooltip/src/content.vue.d.ts +15 -15
  327. package/lib/components/tooltip/src/tooltip.d.ts +2 -2
  328. package/lib/components/tooltip/src/tooltip.vue.d.ts +18 -18
  329. package/lib/components/tour/src/content.d.ts +2 -2
  330. package/lib/components/tour/src/step.d.ts +1 -1
  331. package/lib/components/tour/src/step.vue.d.ts +1 -1
  332. package/lib/components/tour/src/tour.d.ts +1 -1
  333. package/lib/components/tour/src/tour.vue.d.ts +3 -3
  334. package/lib/components/transfer/src/transfer.vue.d.ts +1 -1
  335. package/lib/components/tree/src/tree.vue.d.ts +17 -17
  336. package/lib/components/tree-select/src/tree-select.vue.d.ts +47 -47
  337. package/lib/components/tree-v2/src/tree.vue.d.ts +6 -6
  338. package/lib/components/upload/src/upload-content.d.ts +1 -1
  339. package/lib/components/upload/src/upload-content.vue.d.ts +2 -2
  340. package/lib/components/upload/src/upload-list.d.ts +1 -1
  341. package/lib/components/upload/src/upload.d.ts +2 -2
  342. package/lib/components/upload/src/upload.vue.d.ts +2 -2
  343. package/lib/components/virtual-list/src/builders/build-grid.d.ts +1 -1
  344. package/lib/components/virtual-list/src/components/dynamic-size-grid.d.ts +1 -1
  345. package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +1 -1
  346. package/lib/components/virtual-list/src/components/fixed-size-grid.d.ts +1 -1
  347. package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +1 -1
  348. package/lib/hooks/use-floating/index.d.ts +8 -8
  349. package/lib/hooks/use-popper/index.d.ts +3 -3
  350. package/lib/index.js +261 -261
  351. package/lib/packages/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.js +37 -37
  352. package/lib/packages/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  353. package/lib/packages/components/cascader-panel/src/index.vue_vue_type_script_setup_true_lang.js +11 -11
  354. package/lib/packages/components/cascader-panel/src/index.vue_vue_type_script_setup_true_lang.js.map +1 -1
  355. package/lib/packages/components/color-picker/src/color-picker.vue_vue_type_script_setup_true_lang.js +18 -18
  356. package/lib/packages/components/color-picker/src/color-picker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  357. package/lib/packages/components/countdown/src/countdown.vue_vue_type_script_setup_true_lang.js +1 -1
  358. package/lib/packages/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue_vue_type_script_setup_true_lang.js +18 -18
  359. package/lib/packages/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue_vue_type_script_setup_true_lang.js.map +1 -1
  360. package/lib/packages/components/date-picker-panel/src/date-picker-com/panel-date-range.vue_vue_type_script_setup_true_lang.js +23 -23
  361. package/lib/packages/components/date-picker-panel/src/date-picker-com/panel-date-range.vue_vue_type_script_setup_true_lang.js.map +1 -1
  362. package/lib/packages/components/extend/base-table/src/index.vue_vue_type_script_setup_true_lang.js +24 -24
  363. package/lib/packages/components/extend/base-table/src/index.vue_vue_type_script_setup_true_lang.js.map +1 -1
  364. package/lib/packages/components/extend/v-input-number/src/input-number.vue_vue_type_script_setup_true_lang.js +12 -12
  365. package/lib/packages/components/extend/v-input-number/src/input-number.vue_vue_type_script_setup_true_lang.js.map +1 -1
  366. package/lib/packages/components/index.js +117 -117
  367. package/lib/packages/components/input-number/src/input-number.vue_vue_type_script_setup_true_lang.js +12 -12
  368. package/lib/packages/components/input-number/src/input-number.vue_vue_type_script_setup_true_lang.js.map +1 -1
  369. package/lib/packages/components/menu/src/menu.js +7 -7
  370. package/lib/packages/components/menu/src/menu.js.map +1 -1
  371. package/lib/packages/components/menu/src/utils/menu-item.js +11 -11
  372. package/lib/packages/components/menu/src/utils/menu-item.js.map +1 -1
  373. package/lib/packages/components/menu/src/utils/submenu.js +9 -9
  374. package/lib/packages/components/menu/src/utils/submenu.js.map +1 -1
  375. package/lib/packages/components/message-box/src/index.vue_vue_type_script_lang.js +19 -19
  376. package/lib/packages/components/message-box/src/index.vue_vue_type_script_lang.js.map +1 -1
  377. package/lib/packages/components/select/src/select.vue_vue_type_script_lang.js +10 -10
  378. package/lib/packages/components/select/src/select.vue_vue_type_script_lang.js.map +1 -1
  379. package/lib/packages/components/select-v2/src/select.vue_vue_type_script_lang.js +10 -10
  380. package/lib/packages/components/select-v2/src/select.vue_vue_type_script_lang.js.map +1 -1
  381. package/lib/packages/components/table/src/table.vue_vue_type_script_lang.js +8 -8
  382. package/lib/packages/components/table/src/table.vue_vue_type_script_lang.js.map +1 -1
  383. package/lib/packages/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_script_setup_true_lang.js +10 -10
  384. package/lib/packages/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  385. package/lib/packages/constants/index.js +2 -2
  386. package/lib/packages/directives/trap-focus/index.js +5 -5
  387. package/lib/packages/directives/trap-focus/index.js.map +1 -1
  388. package/lib/plugin.js +6 -6
  389. package/lib/utils/vue/size.d.ts +1 -1
  390. package/lib/utils/vue/vnode.d.ts +2 -2
  391. package/package.json +5 -5
  392. package/theme-chalk/index.css +1 -1
  393. package/theme-chalk/src/extend/base-table.scss +0 -0
  394. package/theme-chalk/src/extend/edit-cell.scss +0 -0
  395. package/theme-chalk/src/extend/edit-table.scss +0 -0
  396. package/theme-chalk/src/extend/form-dialog.scss +0 -0
  397. package/theme-chalk/src/extend/index.scss +0 -0
  398. package/theme-chalk/src/extend/quill-editor.scss +0 -0
  399. package/theme-chalk/src/extend/svg-icon.scss +0 -0
  400. package/theme-chalk/src/extend/system-loading.scss +0 -0
  401. package/theme-chalk/src/extend/v-button.scss +0 -0
  402. package/theme-chalk/src/extend/v-dialog.scss +0 -0
  403. package/theme-chalk/src/extend/v-input-number.scss +0 -0
  404. package/theme-chalk/src/extend/v-switch.scss +0 -0
  405. package/theme-chalk/src/extend/v-table.scss +0 -0
  406. package/theme-chalk/src/extend/v-upload.scss +0 -0
  407. package/theme-chalk/src/table.scss +0 -0
  408. package/web-types.json +1 -1
  409. package/bgi-plus-1.0.0.tgz +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"input-number.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../../../../../packages/components/input-number/src/input-number.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n ns.b(),\n ns.m(inputNumberSize),\n ns.is('disabled', inputNumberDisabled),\n ns.is('without-controls', !controls),\n ns.is('controls-right', controlsAtRight),\n ns.is(align, !!align),\n ]\"\n @dragstart.prevent\n >\n <span\n v-if=\"controls\"\n v-repeat-click=\"decrease\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.decrease')\"\n :class=\"[ns.e('decrease'), ns.is('disabled', minDisabled)]\"\n @keydown.enter=\"decrease\"\n >\n <slot name=\"decrease-icon\">\n <el-icon>\n <arrow-down v-if=\"controlsAtRight\" />\n <minus v-else />\n </el-icon>\n </slot>\n </span>\n <span\n v-if=\"controls\"\n v-repeat-click=\"increase\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.increase')\"\n :class=\"[ns.e('increase'), ns.is('disabled', maxDisabled)]\"\n @keydown.enter=\"increase\"\n >\n <slot name=\"increase-icon\">\n <el-icon>\n <arrow-up v-if=\"controlsAtRight\" />\n <plus v-else />\n </el-icon>\n </slot>\n </span>\n <el-input\n :id=\"id\"\n ref=\"input\"\n type=\"number\"\n :step=\"step\"\n :model-value=\"displayValue\"\n :placeholder=\"placeholder\"\n :readonly=\"readonly\"\n :disabled=\"inputNumberDisabled\"\n :size=\"inputNumberSize\"\n :max=\"max\"\n :min=\"min\"\n :name=\"name\"\n :aria-label=\"ariaLabel\"\n :validate-event=\"false\"\n :inputmode=\"inputmode\"\n @keydown=\"handleKeydown\"\n @blur=\"handleBlur\"\n @focus=\"handleFocus\"\n @input=\"handleInput\"\n @change=\"handleInputChange\"\n >\n <template v-if=\"$slots.prefix\" #prefix>\n <slot name=\"prefix\" />\n </template>\n <template v-if=\"$slots.suffix\" #suffix>\n <slot name=\"suffix\" />\n </template>\n </el-input>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, onMounted, onUpdated, reactive, ref, watch } from 'vue'\nimport { isNil } from 'lodash-unified'\nimport { ElInput } from '@element-plus/components/input'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n useFormDisabled,\n useFormItem,\n useFormSize,\n} from '@element-plus/components/form'\nimport { vRepeatClick } from '@element-plus/directives'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport {\n debugWarn,\n getEventCode,\n getEventKey,\n isNumber,\n isString,\n isUndefined,\n throwError,\n} from '@element-plus/utils'\nimport { ArrowDown, ArrowUp, Minus, Plus } from '@element-plus/icons-vue'\nimport {\n CHANGE_EVENT,\n EVENT_CODE,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { inputNumberEmits } from './input-number'\n\nimport type { InputInstance } from '@element-plus/components/input'\nimport type { InputNumberProps } from './input-number'\n\ndefineOptions({\n name: 'ElInputNumber',\n})\n\nconst props = withDefaults(defineProps<InputNumberProps>(), {\n id: undefined,\n disabled: undefined,\n step: 1,\n max: Number.MAX_SAFE_INTEGER,\n min: Number.MIN_SAFE_INTEGER,\n stepStrictly: false,\n readonly: false,\n controls: true,\n controlsPosition: '',\n valueOnClear: null,\n validateEvent: true,\n inputmode: undefined,\n align: 'center',\n})\nconst emit = defineEmits(inputNumberEmits)\n\nconst { t } = useLocale()\nconst ns = useNamespace('input-number')\nconst input = ref<InputInstance>()\n\ninterface Data {\n currentValue: number | null | undefined\n userInput: null | number | string\n}\nconst data = reactive<Data>({\n currentValue: props.modelValue,\n userInput: null,\n})\n\nconst { formItem } = useFormItem()\n\nconst minDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue <= props.min\n)\nconst maxDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue >= props.max\n)\n\nconst numPrecision = computed(() => {\n const stepPrecision = getPrecision(props.step)\n if (!isUndefined(props.precision)) {\n if (stepPrecision > props.precision) {\n debugWarn(\n 'InputNumber',\n 'precision should not be less than the decimal places of step'\n )\n }\n return props.precision\n } else {\n return Math.max(getPrecision(props.modelValue), stepPrecision)\n }\n})\nconst controlsAtRight = computed(() => {\n return props.controls && props.controlsPosition === 'right'\n})\n\nconst inputNumberSize = useFormSize()\nconst inputNumberDisabled = useFormDisabled()\n\nconst displayValue = computed(() => {\n if (data.userInput !== null) {\n return data.userInput\n }\n let currentValue: number | string | undefined | null = data.currentValue\n if (isNil(currentValue)) return ''\n if (isNumber(currentValue)) {\n if (Number.isNaN(currentValue)) return ''\n if (!isUndefined(props.precision)) {\n currentValue = currentValue.toFixed(props.precision)\n }\n }\n return currentValue\n})\nconst toPrecision = (num: number, pre?: number) => {\n if (isUndefined(pre)) pre = numPrecision.value\n if (pre === 0) return Math.round(num)\n let snum = String(num)\n const pointPos = snum.indexOf('.')\n if (pointPos === -1) return num\n const nums = snum.replace('.', '').split('')\n const datum = nums[pointPos + pre]\n if (!datum) return num\n const length = snum.length\n if (snum.charAt(length - 1) === '5') {\n snum = `${snum.slice(0, Math.max(0, length - 1))}6`\n }\n return Number.parseFloat(Number(snum).toFixed(pre))\n}\nconst getPrecision = (value: number | null | undefined) => {\n if (isNil(value)) return 0\n const valueString = value.toString()\n const dotPosition = valueString.indexOf('.')\n let precision = 0\n if (dotPosition !== -1) {\n precision = valueString.length - dotPosition - 1\n }\n return precision\n}\nconst ensurePrecision = (val: number, coefficient: 1 | -1 = 1) => {\n if (!isNumber(val)) return data.currentValue\n if (val >= Number.MAX_SAFE_INTEGER && coefficient === 1) {\n debugWarn(\n 'InputNumber',\n 'The value has reached the maximum safe integer limit.'\n )\n return val\n } else if (val <= Number.MIN_SAFE_INTEGER && coefficient === -1) {\n debugWarn(\n 'InputNumber',\n 'The value has reached the minimum safe integer limit.'\n )\n return val\n }\n\n // Solve the accuracy problem of JS decimal calculation by converting the value to integer.\n return toPrecision(val + props.step * coefficient)\n}\nconst handleKeydown = (event: KeyboardEvent | Event) => {\n const code = getEventCode(event as KeyboardEvent)\n const key = getEventKey(event as KeyboardEvent)\n\n if (props.disabledScientific && ['e', 'E'].includes(key)) {\n event.preventDefault()\n return\n }\n\n switch (code) {\n case EVENT_CODE.up: {\n event.preventDefault()\n increase()\n break\n }\n case EVENT_CODE.down: {\n event.preventDefault()\n decrease()\n break\n }\n }\n}\nconst increase = () => {\n if (props.readonly || inputNumberDisabled.value || maxDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst decrease = () => {\n if (props.readonly || inputNumberDisabled.value || minDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value, -1)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst verifyValue = (\n value: number | string | null | undefined,\n update?: boolean\n): number | null | undefined => {\n const { max, min, step, precision, stepStrictly, valueOnClear } = props\n if (max < min) {\n throwError('InputNumber', 'min should not be greater than max.')\n }\n let newVal = Number(value)\n if (isNil(value) || Number.isNaN(newVal)) {\n return null\n }\n if (value === '') {\n if (valueOnClear === null) {\n return null\n }\n newVal = isString(valueOnClear) ? { min, max }[valueOnClear] : valueOnClear\n }\n if (stepStrictly) {\n newVal = toPrecision(\n Math.round(toPrecision(newVal / step)) * step,\n precision\n )\n if (newVal !== value) {\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n }\n if (!isUndefined(precision)) {\n newVal = toPrecision(newVal, precision)\n }\n if (newVal > max || newVal < min) {\n newVal = newVal > max ? max : min\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n return newVal\n}\nconst setCurrentValue = (\n value: number | string | null | undefined,\n emitChange = true\n) => {\n const oldVal = data.currentValue\n const newVal = verifyValue(value)\n if (!emitChange) {\n emit(UPDATE_MODEL_EVENT, newVal!)\n return\n }\n data.userInput = null\n if (oldVal === newVal && value) return\n emit(UPDATE_MODEL_EVENT, newVal!)\n if (oldVal !== newVal) {\n emit(CHANGE_EVENT, newVal!, oldVal!)\n }\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n data.currentValue = newVal\n}\nconst handleInput = (value: string) => {\n data.userInput = value\n const newVal = value === '' ? null : Number(value)\n emit(INPUT_EVENT, newVal)\n setCurrentValue(newVal, false)\n}\nconst handleInputChange = (value: string) => {\n const newVal = value !== '' ? Number(value) : ''\n if ((isNumber(newVal) && !Number.isNaN(newVal)) || value === '') {\n setCurrentValue(newVal)\n }\n setCurrentValueToModelValue()\n data.userInput = null\n}\n\nconst focus = () => {\n input.value?.focus?.()\n}\n\nconst blur = () => {\n input.value?.blur?.()\n}\n\nconst handleFocus = (event: MouseEvent | FocusEvent) => {\n emit('focus', event)\n}\n\nconst handleBlur = (event: MouseEvent | FocusEvent) => {\n data.userInput = null\n // When non-numeric content is entered into a numeric input box,\n // the content displayed on the page is not cleared after the value is cleared. #18533\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1398528\n if (data.currentValue === null && input.value?.input) {\n input.value.input.value = ''\n }\n emit('blur', event)\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch((err) => debugWarn(err))\n }\n}\n\nconst setCurrentValueToModelValue = () => {\n if (data.currentValue !== props.modelValue) {\n data.currentValue = props.modelValue\n }\n}\nconst handleWheel = (e: WheelEvent) => {\n if (document.activeElement === e.target) e.preventDefault()\n}\n\nwatch(\n () => props.modelValue,\n (value, oldValue) => {\n const newValue = verifyValue(value, true)\n if (data.userInput === null && newValue !== oldValue) {\n data.currentValue = newValue\n }\n },\n { immediate: true }\n)\n\nwatch(\n () => props.precision,\n () => {\n data.currentValue = verifyValue(props.modelValue)\n }\n)\nonMounted(() => {\n const { min, max, modelValue } = props\n const innerInput = input.value?.input as HTMLInputElement\n innerInput.setAttribute('role', 'spinbutton')\n if (Number.isFinite(max)) {\n innerInput.setAttribute('aria-valuemax', String(max))\n } else {\n innerInput.removeAttribute('aria-valuemax')\n }\n if (Number.isFinite(min)) {\n innerInput.setAttribute('aria-valuemin', String(min))\n } else {\n innerInput.removeAttribute('aria-valuemin')\n }\n innerInput.setAttribute(\n 'aria-valuenow',\n data.currentValue || data.currentValue === 0\n ? String(data.currentValue)\n : ''\n )\n innerInput.setAttribute('aria-disabled', String(inputNumberDisabled.value))\n if (!isNumber(modelValue) && modelValue != null) {\n let val: number | null = Number(modelValue)\n if (Number.isNaN(val)) {\n val = null\n }\n emit(UPDATE_MODEL_EVENT, val!)\n }\n innerInput.addEventListener('wheel', handleWheel, { passive: false })\n})\nonUpdated(() => {\n const innerInput = input.value?.input\n innerInput?.setAttribute('aria-valuenow', `${data.currentValue ?? ''}`)\n})\ndefineExpose({\n /** @description get focus the input component */\n focus,\n /** @description remove focus the input component */\n blur,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+GA,MAAM,QAAQ;EAed,MAAM,OAAO;EAEb,MAAM,EAAE,MAAM,2BAAU;EACxB,MAAM,KAAK,6BAAa,eAAc;EACtC,MAAM,sBAA2B;EAMjC,MAAM,yBAAsB;GAC1B,cAAc,MAAM;GACpB,WAAW;GACZ,CAAA;EAED,MAAM,EAAE,aAAa,mCAAY;EAEjC,MAAM,sCACE,uBAAS,MAAM,WAAW,IAAI,MAAM,cAAc,MAAM,IAChE;EACA,MAAM,sCACE,uBAAS,MAAM,WAAW,IAAI,MAAM,cAAc,MAAM,IAChE;EAEA,MAAM,uCAA8B;GAClC,MAAM,gBAAgB,aAAa,MAAM,KAAI;AAC7C,OAAI,CAAC,0BAAY,MAAM,UAAU,EAAE;AACjC,QAAI,gBAAgB,MAAM,UACxB,yBACE,eACA,+DACF;AAEF,WAAO,MAAM;SAEb,QAAO,KAAK,IAAI,aAAa,MAAM,WAAW,EAAE,cAAa;IAEhE;EACD,MAAM,0CAAiC;AACrC,UAAO,MAAM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;wCAyCf,wBAAA,EAAA;KA3BR,IAAI,QAAA;cACD;KAAJ,KAAI;KACJ,MAAK;KACJ,MAAM,QAAA;KACN,eAAa,aAAA;KACb,aAAa,QAAA;KACb,UAAU,QAAA;KACV,yBAAU,oBAAmB;KAC7B,qBAAM,gBAAe;KACrB,KAAK,QAAA;KACL,KAAK,QAAA;KACL,MAAM,QAAA;KACN,cAAY,QAAA;KACZ,kBAAgB;KAChB,WAAW,QAAA;KACX,WAAS;KACT,QAAM;KACN,SAAO;KACP,SAAO;KACP,UAAQ;uCAEOA,KAAAA,OAAO;WAAS;gCACR,qBAAA,KAAA,QAAA,SAAA;;gBAERA,KAAAA,OAAO;WAAS;gCACR,qBAAA,KAAA,QAAA,SAAA"}
1
+ {"version":3,"file":"input-number.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../../../../../packages/components/input-number/src/input-number.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n ns.b(),\n ns.m(inputNumberSize),\n ns.is('disabled', inputNumberDisabled),\n ns.is('without-controls', !controls),\n ns.is('controls-right', controlsAtRight),\n ns.is(align, !!align),\n ]\"\n @dragstart.prevent\n >\n <span\n v-if=\"controls\"\n v-repeat-click=\"decrease\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.decrease')\"\n :class=\"[ns.e('decrease'), ns.is('disabled', minDisabled)]\"\n @keydown.enter=\"decrease\"\n >\n <slot name=\"decrease-icon\">\n <el-icon>\n <arrow-down v-if=\"controlsAtRight\" />\n <minus v-else />\n </el-icon>\n </slot>\n </span>\n <span\n v-if=\"controls\"\n v-repeat-click=\"increase\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.increase')\"\n :class=\"[ns.e('increase'), ns.is('disabled', maxDisabled)]\"\n @keydown.enter=\"increase\"\n >\n <slot name=\"increase-icon\">\n <el-icon>\n <arrow-up v-if=\"controlsAtRight\" />\n <plus v-else />\n </el-icon>\n </slot>\n </span>\n <el-input\n :id=\"id\"\n ref=\"input\"\n type=\"number\"\n :step=\"step\"\n :model-value=\"displayValue\"\n :placeholder=\"placeholder\"\n :readonly=\"readonly\"\n :disabled=\"inputNumberDisabled\"\n :size=\"inputNumberSize\"\n :max=\"max\"\n :min=\"min\"\n :name=\"name\"\n :aria-label=\"ariaLabel\"\n :validate-event=\"false\"\n :inputmode=\"inputmode\"\n @keydown=\"handleKeydown\"\n @blur=\"handleBlur\"\n @focus=\"handleFocus\"\n @input=\"handleInput\"\n @change=\"handleInputChange\"\n >\n <template v-if=\"$slots.prefix\" #prefix>\n <slot name=\"prefix\" />\n </template>\n <template v-if=\"$slots.suffix\" #suffix>\n <slot name=\"suffix\" />\n </template>\n </el-input>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, onMounted, onUpdated, reactive, ref, watch } from 'vue'\nimport { isNil } from 'lodash-unified'\nimport { ElInput } from '@element-plus/components/input'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n useFormDisabled,\n useFormItem,\n useFormSize,\n} from '@element-plus/components/form'\nimport { vRepeatClick } from '@element-plus/directives'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport {\n debugWarn,\n getEventCode,\n getEventKey,\n isNumber,\n isString,\n isUndefined,\n throwError,\n} from '@element-plus/utils'\nimport { ArrowDown, ArrowUp, Minus, Plus } from '@element-plus/icons-vue'\nimport {\n CHANGE_EVENT,\n EVENT_CODE,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { inputNumberEmits } from './input-number'\n\nimport type { InputInstance } from '@element-plus/components/input'\nimport type { InputNumberProps } from './input-number'\n\ndefineOptions({\n name: 'ElInputNumber',\n})\n\nconst props = withDefaults(defineProps<InputNumberProps>(), {\n id: undefined,\n disabled: undefined,\n step: 1,\n max: Number.MAX_SAFE_INTEGER,\n min: Number.MIN_SAFE_INTEGER,\n stepStrictly: false,\n readonly: false,\n controls: true,\n controlsPosition: '',\n valueOnClear: null,\n validateEvent: true,\n inputmode: undefined,\n align: 'center',\n})\nconst emit = defineEmits(inputNumberEmits)\n\nconst { t } = useLocale()\nconst ns = useNamespace('input-number')\nconst input = ref<InputInstance>()\n\ninterface Data {\n currentValue: number | null | undefined\n userInput: null | number | string\n}\nconst data = reactive<Data>({\n currentValue: props.modelValue,\n userInput: null,\n})\n\nconst { formItem } = useFormItem()\n\nconst minDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue <= props.min\n)\nconst maxDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue >= props.max\n)\n\nconst numPrecision = computed(() => {\n const stepPrecision = getPrecision(props.step)\n if (!isUndefined(props.precision)) {\n if (stepPrecision > props.precision) {\n debugWarn(\n 'InputNumber',\n 'precision should not be less than the decimal places of step'\n )\n }\n return props.precision\n } else {\n return Math.max(getPrecision(props.modelValue), stepPrecision)\n }\n})\nconst controlsAtRight = computed(() => {\n return props.controls && props.controlsPosition === 'right'\n})\n\nconst inputNumberSize = useFormSize()\nconst inputNumberDisabled = useFormDisabled()\n\nconst displayValue = computed(() => {\n if (data.userInput !== null) {\n return data.userInput\n }\n let currentValue: number | string | undefined | null = data.currentValue\n if (isNil(currentValue)) return ''\n if (isNumber(currentValue)) {\n if (Number.isNaN(currentValue)) return ''\n if (!isUndefined(props.precision)) {\n currentValue = currentValue.toFixed(props.precision)\n }\n }\n return currentValue\n})\nconst toPrecision = (num: number, pre?: number) => {\n if (isUndefined(pre)) pre = numPrecision.value\n if (pre === 0) return Math.round(num)\n let snum = String(num)\n const pointPos = snum.indexOf('.')\n if (pointPos === -1) return num\n const nums = snum.replace('.', '').split('')\n const datum = nums[pointPos + pre]\n if (!datum) return num\n const length = snum.length\n if (snum.charAt(length - 1) === '5') {\n snum = `${snum.slice(0, Math.max(0, length - 1))}6`\n }\n return Number.parseFloat(Number(snum).toFixed(pre))\n}\nconst getPrecision = (value: number | null | undefined) => {\n if (isNil(value)) return 0\n const valueString = value.toString()\n const dotPosition = valueString.indexOf('.')\n let precision = 0\n if (dotPosition !== -1) {\n precision = valueString.length - dotPosition - 1\n }\n return precision\n}\nconst ensurePrecision = (val: number, coefficient: 1 | -1 = 1) => {\n if (!isNumber(val)) return data.currentValue\n if (val >= Number.MAX_SAFE_INTEGER && coefficient === 1) {\n debugWarn(\n 'InputNumber',\n 'The value has reached the maximum safe integer limit.'\n )\n return val\n } else if (val <= Number.MIN_SAFE_INTEGER && coefficient === -1) {\n debugWarn(\n 'InputNumber',\n 'The value has reached the minimum safe integer limit.'\n )\n return val\n }\n\n // Solve the accuracy problem of JS decimal calculation by converting the value to integer.\n return toPrecision(val + props.step * coefficient)\n}\nconst handleKeydown = (event: KeyboardEvent | Event) => {\n const code = getEventCode(event as KeyboardEvent)\n const key = getEventKey(event as KeyboardEvent)\n\n if (props.disabledScientific && ['e', 'E'].includes(key)) {\n event.preventDefault()\n return\n }\n\n switch (code) {\n case EVENT_CODE.up: {\n event.preventDefault()\n increase()\n break\n }\n case EVENT_CODE.down: {\n event.preventDefault()\n decrease()\n break\n }\n }\n}\nconst increase = () => {\n if (props.readonly || inputNumberDisabled.value || maxDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst decrease = () => {\n if (props.readonly || inputNumberDisabled.value || minDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value, -1)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst verifyValue = (\n value: number | string | null | undefined,\n update?: boolean\n): number | null | undefined => {\n const { max, min, step, precision, stepStrictly, valueOnClear } = props\n if (max < min) {\n throwError('InputNumber', 'min should not be greater than max.')\n }\n let newVal = Number(value)\n if (isNil(value) || Number.isNaN(newVal)) {\n return null\n }\n if (value === '') {\n if (valueOnClear === null) {\n return null\n }\n newVal = isString(valueOnClear) ? { min, max }[valueOnClear] : valueOnClear\n }\n if (stepStrictly) {\n newVal = toPrecision(\n Math.round(toPrecision(newVal / step)) * step,\n precision\n )\n if (newVal !== value) {\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n }\n if (!isUndefined(precision)) {\n newVal = toPrecision(newVal, precision)\n }\n if (newVal > max || newVal < min) {\n newVal = newVal > max ? max : min\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n return newVal\n}\nconst setCurrentValue = (\n value: number | string | null | undefined,\n emitChange = true\n) => {\n const oldVal = data.currentValue\n const newVal = verifyValue(value)\n if (!emitChange) {\n emit(UPDATE_MODEL_EVENT, newVal!)\n return\n }\n data.userInput = null\n if (oldVal === newVal && value) return\n emit(UPDATE_MODEL_EVENT, newVal!)\n if (oldVal !== newVal) {\n emit(CHANGE_EVENT, newVal!, oldVal!)\n }\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n data.currentValue = newVal\n}\nconst handleInput = (value: string) => {\n data.userInput = value\n const newVal = value === '' ? null : Number(value)\n emit(INPUT_EVENT, newVal)\n setCurrentValue(newVal, false)\n}\nconst handleInputChange = (value: string) => {\n const newVal = value !== '' ? Number(value) : ''\n if ((isNumber(newVal) && !Number.isNaN(newVal)) || value === '') {\n setCurrentValue(newVal)\n }\n setCurrentValueToModelValue()\n data.userInput = null\n}\n\nconst focus = () => {\n input.value?.focus?.()\n}\n\nconst blur = () => {\n input.value?.blur?.()\n}\n\nconst handleFocus = (event: MouseEvent | FocusEvent) => {\n emit('focus', event)\n}\n\nconst handleBlur = (event: MouseEvent | FocusEvent) => {\n data.userInput = null\n // When non-numeric content is entered into a numeric input box,\n // the content displayed on the page is not cleared after the value is cleared. #18533\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1398528\n if (data.currentValue === null && input.value?.input) {\n input.value.input.value = ''\n }\n emit('blur', event)\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch((err) => debugWarn(err))\n }\n}\n\nconst setCurrentValueToModelValue = () => {\n if (data.currentValue !== props.modelValue) {\n data.currentValue = props.modelValue\n }\n}\nconst handleWheel = (e: WheelEvent) => {\n if (document.activeElement === e.target) e.preventDefault()\n}\n\nwatch(\n () => props.modelValue,\n (value, oldValue) => {\n const newValue = verifyValue(value, true)\n if (data.userInput === null && newValue !== oldValue) {\n data.currentValue = newValue\n }\n },\n { immediate: true }\n)\n\nwatch(\n () => props.precision,\n () => {\n data.currentValue = verifyValue(props.modelValue)\n }\n)\nonMounted(() => {\n const { min, max, modelValue } = props\n const innerInput = input.value?.input as HTMLInputElement\n innerInput.setAttribute('role', 'spinbutton')\n if (Number.isFinite(max)) {\n innerInput.setAttribute('aria-valuemax', String(max))\n } else {\n innerInput.removeAttribute('aria-valuemax')\n }\n if (Number.isFinite(min)) {\n innerInput.setAttribute('aria-valuemin', String(min))\n } else {\n innerInput.removeAttribute('aria-valuemin')\n }\n innerInput.setAttribute(\n 'aria-valuenow',\n data.currentValue || data.currentValue === 0\n ? String(data.currentValue)\n : ''\n )\n innerInput.setAttribute('aria-disabled', String(inputNumberDisabled.value))\n if (!isNumber(modelValue) && modelValue != null) {\n let val: number | null = Number(modelValue)\n if (Number.isNaN(val)) {\n val = null\n }\n emit(UPDATE_MODEL_EVENT, val!)\n }\n innerInput.addEventListener('wheel', handleWheel, { passive: false })\n})\nonUpdated(() => {\n const innerInput = input.value?.input\n innerInput?.setAttribute('aria-valuenow', `${data.currentValue ?? ''}`)\n})\ndefineExpose({\n /** @description get focus the input component */\n focus,\n /** @description remove focus the input component */\n blur,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+GA,MAAM,QAAQ;EAed,MAAM,OAAO;EAEb,MAAM,EAAE,MAAM,yBAAU;EACxB,MAAM,KAAK,6BAAa,eAAc;EACtC,MAAM,sBAA2B;EAMjC,MAAM,yBAAsB;GAC1B,cAAc,MAAM;GACpB,WAAW;GACZ,CAAA;EAED,MAAM,EAAE,aAAa,mCAAY;EAEjC,MAAM,sCACE,uBAAS,MAAM,WAAW,IAAI,MAAM,cAAc,MAA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,CAAA,0BAAA;KACb,+BAAK,gBAAG,GAAE,CAAC,EAAC,WAAA,iBAAc,GAAE,CAAC,GAAE,YAAa,YAAA,MAAW,CAAA,CAAA;KACvD,6BAAe,UAAQ,CAAA,QAAA,CAAA;4BAOjB,KAAA,QAAA,iBAAA,EAAA,QAAA,qCADK,uBAAA,EAAA,MAAA;qCAF2B,CAAnB,gBAAA,mEAAmB,gCAAA,EAAA,EAAA,KAAA,GAAA,CAAA,+DACpB,6BAAA,EAAA,EAAA,KAAA,GAAA,CAAA;;6EATH,SAAQ;wCAyCf,wBAAA,EAAA;KA3BR,IAAI,QAAA;cACD;KAAJ,KAAI;KACJ,MAAK;KACJ,MAAM,QAAA;KACN,eAAa,aAAA;KACb,aAAa,QAAA;KACb,UAAU,QAAA;KACV,yBAAU,oBAAmB;KAC7B,qBAAM,gBAAe;KACrB,KAAK,QAAA;KACL,KAAK,QAAA;KACL,MAAM,QAAA;KACN,cAAY,QAAA;KACZ,kBAAgB;KAChB,WAAW,QAAA;KACX,WAAS;KACT,QAAM;KACN,SAAO;KACP,SAAO;KACP,UAAQ;uCAEOA,KAAAA,OAAO;WAAS;gCACR,qBAAA,KAAA,QAAA,SAAA;;gBAERA,KAAAA,OAAO;WAAS;gCACR,qBAAA,KAAA,QAAA,SAAA"}
@@ -5,9 +5,9 @@ const require_runtime$1 = require('../../../utils/vue/props/runtime.js');
5
5
  const require_icon = require('../../../utils/vue/icon.js');
6
6
  const require_vnode = require('../../../utils/vue/vnode.js');
7
7
  const require_typescript = require('../../../utils/typescript.js');
8
- const require_index = require('../../../directives/click-outside/index.js');
9
- const require_index$1 = require('../../../hooks/use-namespace/index.js');
10
- const require_index$2 = require('../../icon/index.js');
8
+ const require_index = require('../../../hooks/use-namespace/index.js');
9
+ const require_index$1 = require('../../icon/index.js');
10
+ const require_index$2 = require('../../../directives/click-outside/index.js');
11
11
  const require_menu_bar = require('./utils/menu-bar.js');
12
12
  const require_menu_collapse_transition = require('./menu-collapse-transition.js');
13
13
  const require_use_menu_css_var = require('./use-menu-css-var.js');
@@ -97,8 +97,8 @@ var menu_default = (0, vue.defineComponent)({
97
97
  const router = instance.appContext.config.globalProperties.$router;
98
98
  const menu = (0, vue.ref)();
99
99
  const subMenu = (0, vue.ref)();
100
- const nsMenu = require_index$1.useNamespace("menu");
101
- const nsSubMenu = require_index$1.useNamespace("sub-menu");
100
+ const nsMenu = require_index.useNamespace("menu");
101
+ const nsSubMenu = require_index.useNamespace("sub-menu");
102
102
  let moreItemWidth = DEFAULT_MORE_ITEM_WIDTH;
103
103
  const sliceIndex = (0, vue.ref)(-1);
104
104
  const openedMenus = (0, vue.ref)(props.defaultOpeneds && !props.collapse ? props.defaultOpeneds.slice(0) : []);
@@ -286,12 +286,12 @@ var menu_default = (0, vue.defineComponent)({
286
286
  class: nsSubMenu.e("hide-arrow"),
287
287
  popperOffset: props.popperOffset
288
288
  }, {
289
- title: () => (0, vue.h)(require_index$2.ElIcon, { class: nsSubMenu.e("icon-more") }, { default: () => (0, vue.h)(props.ellipsisIcon) }),
289
+ title: () => (0, vue.h)(require_index$1.ElIcon, { class: nsSubMenu.e("icon-more") }, { default: () => (0, vue.h)(props.ellipsisIcon) }),
290
290
  default: () => slotMore
291
291
  }));
292
292
  }
293
293
  }
294
- const directives = props.closeOnClickOutside ? [[require_index.default, () => {
294
+ const directives = props.closeOnClickOutside ? [[require_index$2.default, () => {
295
295
  if (!openedMenus.value.length) return;
296
296
  if (!mouseInChild.value) {
297
297
  openedMenus.value.forEach((openedMenu) => emit("close", openedMenu, getIndexPath(openedMenu)));
@@ -1 +1 @@
1
- {"version":3,"file":"menu.js","names":["buildProps","definePropType","mutable","iconPropType","More","isUndefined","useNamespace","MENU_INJECTION_KEY","SUB_MENU_INJECTION_KEY","Menubar","useMenuCssVar","flattedChildren","ElSubMenu","ElIcon","vClickoutside","ElMenuCollapseTransition"],"sources":["../../../../../../../packages/components/menu/src/menu.ts"],"sourcesContent":["import {\n computed,\n defineComponent,\n getCurrentInstance,\n h,\n nextTick,\n onMounted,\n provide,\n reactive,\n ref,\n watch,\n watchEffect,\n withDirectives,\n} from 'vue'\nimport { unrefElement, useResizeObserver } from '@vueuse/core'\nimport { isNil } from 'lodash-unified'\nimport ElIcon from '@element-plus/components/icon'\nimport { More } from '@element-plus/icons-vue'\nimport {\n buildProps,\n definePropType,\n flattedChildren,\n iconPropType,\n isArray,\n isObject,\n isString,\n isUndefined,\n mutable,\n} from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { ClickOutside as vClickoutside } from '@element-plus/directives'\nimport Menubar from './utils/menu-bar'\nimport ElMenuCollapseTransition from './menu-collapse-transition.vue'\nimport ElSubMenu from './sub-menu'\nimport { useMenuCssVar } from './use-menu-css-var'\nimport { MENU_INJECTION_KEY, SUB_MENU_INJECTION_KEY } from './tokens'\n\nimport type { PopperEffect } from '@element-plus/components/popper'\nimport type { MenuItemClicked, MenuProvider, SubMenuProvider } from './types'\nimport type { NavigationFailure, Router } from 'vue-router'\nimport type {\n CSSProperties,\n Component,\n DirectiveArguments,\n ExtractPropTypes,\n ExtractPublicPropTypes,\n VNode,\n VNodeArrayChildren,\n} from 'vue'\nimport type { UseResizeObserverReturn } from '@vueuse/core'\n\nexport const menuProps = buildProps({\n /**\n * @description menu display mode\n */\n mode: {\n type: String,\n values: ['horizontal', 'vertical'],\n default: 'vertical',\n },\n /**\n * @description index of active menu on page load\n */\n defaultActive: {\n type: String,\n default: '',\n },\n /**\n * @description array that contains indexes of currently active sub-menus\n */\n defaultOpeneds: {\n type: definePropType<string[]>(Array),\n default: () => mutable([] as const),\n },\n /**\n * @description whether only one sub-menu can be active\n */\n uniqueOpened: Boolean,\n /**\n * @description whether `vue-router` mode is activated. If true, index will be used as 'path' to activate the route action. Use with `default-active` to set the active item on load.\n */\n router: Boolean,\n /**\n * @description how sub-menus are triggered, only works when `mode` is 'horizontal'\n */\n menuTrigger: {\n type: String,\n values: ['hover', 'click'],\n default: 'hover',\n },\n /**\n * @description whether the menu is collapsed (available only in vertical mode)\n */\n collapse: Boolean,\n /**\n * @description background color of Menu (hex format) (deprecated, use `--bg-color` instead)\n * @deprecated use `--bg-color` instead\n */\n backgroundColor: String,\n /**\n * @description text color of Menu (hex format) (deprecated, use `--text-color` instead)\n * @deprecated use `--text-color` instead\n */\n textColor: String,\n /**\n * @description text color of currently active menu item (hex format) (deprecated, use `--active-color` instead)\n * @deprecated use `--active-color` instead\n */\n activeTextColor: String,\n /**\n * @description optional, whether menu is collapsed when clicking outside\n */\n closeOnClickOutside: Boolean,\n /**\n * @description whether to enable the collapse transition\n */\n collapseTransition: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether the menu is ellipsis (available only in horizontal mode)\n */\n ellipsis: {\n type: Boolean,\n default: true,\n },\n /**\n * @description offset of the popper (effective for all submenus)\n */\n popperOffset: {\n type: Number,\n default: 6,\n },\n /**\n * @description custom ellipsis icon (available only in horizontal mode and ellipsis is true)\n */\n ellipsisIcon: {\n type: iconPropType,\n default: () => More,\n },\n /**\n * @description Tooltip theme, built-in theme: `dark` / `light` when menu is collapsed\n */\n popperEffect: {\n type: definePropType<PopperEffect>(String),\n default: 'dark',\n },\n /**\n * @description custom class name for all popup menus\n */\n popperClass: String,\n /**\n * @description custom style for all popup menus\n */\n popperStyle: {\n type: definePropType<string | CSSProperties>([String, Object]),\n },\n /**\n * @description control timeout for all menus before showing\n */\n showTimeout: {\n type: Number,\n default: 300,\n },\n /**\n * @description control timeout for all menus before hiding\n */\n hideTimeout: {\n type: Number,\n default: 300,\n },\n /**\n * @description when menu inactive and `persistent` is `false` , dropdown menu will be destroyed\n */\n persistent: {\n type: Boolean,\n default: true,\n },\n} as const)\nexport type MenuProps = ExtractPropTypes<typeof menuProps>\nexport type MenuPropsPublic = ExtractPublicPropTypes<typeof menuProps>\n\nconst checkIndexPath = (indexPath: unknown): indexPath is string[] =>\n isArray(indexPath) && indexPath.every((path) => isString(path))\n\nexport const menuEmits = {\n close: (index: string, indexPath: string[]) =>\n isString(index) && checkIndexPath(indexPath),\n\n open: (index: string, indexPath: string[]) =>\n isString(index) && checkIndexPath(indexPath),\n\n select: (\n index: string,\n indexPath: string[],\n item: MenuItemClicked,\n routerResult?: Promise<void | NavigationFailure>\n ) =>\n isString(index) &&\n checkIndexPath(indexPath) &&\n isObject(item) &&\n (isUndefined(routerResult) || routerResult instanceof Promise),\n}\nexport type MenuEmits = typeof menuEmits\n\nconst DEFAULT_MORE_ITEM_WIDTH = 64\n\nexport default defineComponent({\n name: 'ElMenu',\n\n props: menuProps,\n emits: menuEmits,\n\n setup(props, { emit, slots, expose }) {\n const instance = getCurrentInstance()!\n const router = instance.appContext.config.globalProperties.$router as Router\n const menu = ref<HTMLUListElement>()\n const subMenu = ref<HTMLElement>()\n const nsMenu = useNamespace('menu')\n const nsSubMenu = useNamespace('sub-menu')\n let moreItemWidth = DEFAULT_MORE_ITEM_WIDTH\n\n // data\n const sliceIndex = ref(-1)\n\n const openedMenus = ref<MenuProvider['openedMenus']>(\n props.defaultOpeneds && !props.collapse\n ? props.defaultOpeneds.slice(0)\n : []\n )\n const activeIndex = ref<MenuProvider['activeIndex']>(props.defaultActive)\n const items = ref<MenuProvider['items']>({})\n const subMenus = ref<MenuProvider['subMenus']>({})\n\n // computed\n const isMenuPopup = computed<MenuProvider['isMenuPopup']>(\n () =>\n props.mode === 'horizontal' ||\n (props.mode === 'vertical' && props.collapse)\n )\n\n // methods\n const initMenu = () => {\n const activeItem = activeIndex.value && items.value[activeIndex.value]\n if (!activeItem || props.mode === 'horizontal' || props.collapse) return\n\n const indexPath = activeItem.indexPath\n\n // 展开该菜单项的路径上所有子菜单\n // expand all subMenus of the menu item\n indexPath.forEach((index) => {\n const subMenu = subMenus.value[index]\n subMenu && openMenu(index, subMenu.indexPath)\n })\n }\n\n const openMenu: MenuProvider['openMenu'] = (index, indexPath) => {\n if (openedMenus.value.includes(index)) return\n // 将不在该菜单路径下的其余菜单收起\n // collapse all menu that are not under current menu item\n if (props.uniqueOpened) {\n openedMenus.value = openedMenus.value.filter((index: string) =>\n indexPath.includes(index)\n )\n }\n openedMenus.value.push(index)\n emit('open', index, indexPath)\n }\n\n const close = (index: string) => {\n const i = openedMenus.value.indexOf(index)\n if (i !== -1) {\n openedMenus.value.splice(i, 1)\n }\n }\n\n const closeMenu: MenuProvider['closeMenu'] = (index, indexPath) => {\n close(index)\n emit('close', index, indexPath)\n }\n\n const handleSubMenuClick: MenuProvider['handleSubMenuClick'] = ({\n index,\n indexPath,\n }) => {\n const isOpened = openedMenus.value.includes(index)\n\n isOpened ? closeMenu(index, indexPath) : openMenu(index, indexPath)\n }\n\n const handleMenuItemClick: MenuProvider['handleMenuItemClick'] = (\n menuItem\n ) => {\n if (props.mode === 'horizontal' || props.collapse) {\n openedMenus.value = []\n }\n const { index, indexPath } = menuItem\n if (isNil(index) || isNil(indexPath)) return\n\n if (props.router && router) {\n const route = menuItem.route || index\n const routerResult = router.push(route).then((res) => {\n if (!res) activeIndex.value = index\n return res\n })\n emit(\n 'select',\n index,\n indexPath,\n { index, indexPath, route },\n routerResult\n )\n } else {\n activeIndex.value = index\n emit('select', index, indexPath, { index, indexPath })\n }\n }\n\n const updateActiveIndex = (val: string) => {\n const itemsInData = items.value\n const item =\n itemsInData[val] ||\n (activeIndex.value && itemsInData[activeIndex.value]) ||\n itemsInData[props.defaultActive]\n\n activeIndex.value = item?.index ?? val\n }\n\n const calcMenuItemWidth = (menuItem: HTMLElement) => {\n const computedStyle = getComputedStyle(menuItem)\n const marginLeft = Number.parseInt(computedStyle.marginLeft, 10)\n const marginRight = Number.parseInt(computedStyle.marginRight, 10)\n return menuItem.offsetWidth + marginLeft + marginRight || 0\n }\n\n const calcSliceIndex = () => {\n if (!menu.value) return -1\n\n const items = Array.from(menu.value.childNodes).filter(\n (item) =>\n item.nodeName !== '#comment' &&\n (item.nodeName !== '#text' || item.nodeValue)\n ) as HTMLElement[]\n\n const computedMenuStyle = getComputedStyle(menu.value)\n const paddingLeft = Number.parseInt(computedMenuStyle.paddingLeft, 10)\n const paddingRight = Number.parseInt(computedMenuStyle.paddingRight, 10)\n const menuWidth = menu.value.clientWidth - paddingLeft - paddingRight\n\n let calcWidth = 0\n let sliceIndex = 0\n items.forEach((item, index) => {\n calcWidth += calcMenuItemWidth(item)\n if (calcWidth <= menuWidth - moreItemWidth) {\n sliceIndex = index + 1\n }\n })\n return sliceIndex === items.length ? -1 : sliceIndex\n }\n\n const getIndexPath = (index: string) => subMenus.value[index].indexPath\n\n // Common computer monitor FPS is 60Hz, which means 60 redraws per second. Calculation formula: 1000ms/60 ≈ 16.67ms, In order to avoid a certain chance of repeated triggering when `resize`, set wait to 16.67 * 2 = 33.34\n const debounce = (fn: () => void, wait = 33.34) => {\n let timer: ReturnType<typeof setTimeout> | null\n return () => {\n timer && clearTimeout(timer)\n timer = setTimeout(() => {\n fn()\n }, wait)\n }\n }\n\n let isFirstTimeRender = true\n const handleResize = () => {\n const el = unrefElement(subMenu)\n if (el) moreItemWidth = calcMenuItemWidth(el) || DEFAULT_MORE_ITEM_WIDTH\n if (sliceIndex.value === calcSliceIndex()) return\n const callback = () => {\n sliceIndex.value = -1\n nextTick(() => {\n sliceIndex.value = calcSliceIndex()\n })\n }\n // execute callback directly when first time resize to avoid shaking\n isFirstTimeRender ? callback() : debounce(callback)()\n isFirstTimeRender = false\n }\n\n watch(\n () => props.defaultActive,\n (currentActive) => {\n if (!items.value[currentActive]) {\n activeIndex.value = ''\n }\n updateActiveIndex(currentActive)\n }\n )\n\n watch(\n () => props.collapse,\n (value) => {\n if (value) openedMenus.value = []\n }\n )\n\n watch(items.value, initMenu)\n\n let resizeStopper: UseResizeObserverReturn['stop']\n watchEffect(() => {\n if (props.mode === 'horizontal' && props.ellipsis)\n resizeStopper = useResizeObserver(menu, handleResize).stop\n else resizeStopper?.()\n })\n\n const mouseInChild = ref(false)\n\n // provide\n {\n const addSubMenu: MenuProvider['addSubMenu'] = (item) => {\n subMenus.value[item.index] = item\n }\n\n const removeSubMenu: MenuProvider['removeSubMenu'] = (item) => {\n delete subMenus.value[item.index]\n }\n\n const addMenuItem: MenuProvider['addMenuItem'] = (item) => {\n items.value[item.index] = item\n }\n\n const removeMenuItem: MenuProvider['removeMenuItem'] = (item) => {\n delete items.value[item.index]\n }\n\n provide<MenuProvider>(\n MENU_INJECTION_KEY,\n reactive({\n props,\n openedMenus,\n items,\n subMenus,\n activeIndex,\n isMenuPopup,\n\n addMenuItem,\n removeMenuItem,\n addSubMenu,\n removeSubMenu,\n openMenu,\n closeMenu,\n handleMenuItemClick,\n handleSubMenuClick,\n })\n )\n\n provide<SubMenuProvider>(`${SUB_MENU_INJECTION_KEY}${instance.uid}`, {\n addSubMenu,\n removeSubMenu,\n mouseInChild,\n level: 0,\n })\n }\n\n // lifecycle\n onMounted(() => {\n if (props.mode === 'horizontal') {\n new Menubar(instance.vnode.el!, nsMenu.namespace.value)\n }\n })\n\n {\n const open = (index: string) => {\n const { indexPath } = subMenus.value[index]\n indexPath.forEach((i) => openMenu(i, indexPath))\n }\n\n expose({\n open,\n close,\n updateActiveIndex,\n handleResize,\n })\n }\n\n const ulStyle = useMenuCssVar(props, 0)\n\n return () => {\n let slot: VNodeArrayChildren = slots.default?.() ?? []\n const vShowMore: VNode[] = []\n\n if (props.mode === 'horizontal' && menu.value) {\n const originalSlot = (\n flattedChildren(slot) as VNodeArrayChildren\n ).filter((vnode) => {\n // Filter text and comment nodes (https://github.com/vuejs/core/blob/c875019d49b4c36a88d929ccadc31ad414747c7b/packages/shared/src/shapeFlags.ts#L5)\n return (vnode as VNode)?.shapeFlag !== 8\n })\n const slotDefault =\n sliceIndex.value === -1\n ? originalSlot\n : originalSlot.slice(0, sliceIndex.value)\n\n const slotMore =\n sliceIndex.value === -1 ? [] : originalSlot.slice(sliceIndex.value)\n\n if (slotMore?.length && props.ellipsis) {\n slot = slotDefault\n vShowMore.push(\n h(\n ElSubMenu,\n {\n ref: subMenu,\n index: 'sub-menu-more',\n class: nsSubMenu.e('hide-arrow'),\n popperOffset: props.popperOffset,\n },\n {\n title: () =>\n h(\n ElIcon,\n {\n class: nsSubMenu.e('icon-more'),\n },\n {\n default: () => h(props.ellipsisIcon as Component),\n }\n ),\n default: () => slotMore,\n }\n )\n )\n }\n }\n\n const directives: DirectiveArguments = props.closeOnClickOutside\n ? [\n [\n vClickoutside,\n () => {\n if (!openedMenus.value.length) return\n\n if (!mouseInChild.value) {\n openedMenus.value.forEach((openedMenu) =>\n emit('close', openedMenu, getIndexPath(openedMenu))\n )\n\n openedMenus.value = []\n }\n },\n ],\n ]\n : []\n\n const vMenu = withDirectives(\n h(\n 'ul',\n {\n key: String(props.collapse),\n role: 'menubar',\n ref: menu,\n style: ulStyle.value,\n class: {\n [nsMenu.b()]: true,\n [nsMenu.m(props.mode)]: true,\n [nsMenu.m('collapse')]: props.collapse,\n },\n },\n [...slot, ...vShowMore]\n ),\n directives\n )\n\n if (props.collapseTransition && props.mode === 'vertical') {\n return h(ElMenuCollapseTransition, () => vMenu)\n }\n\n return vMenu\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmDA,MAAa,YAAYA,6BAAW;CAIlC,MAAM;EACJ,MAAM;EACN,QAAQ,CAAC,cAAc,WAAW;EAClC,SAAS;EACV;CAID,eAAe;EACb,MAAM;EACN,SAAS;EACV;CAID,gBAAgB;EACd,MAAMC,iCAAyB,MAAM;EACrC,eAAeC,2BAAQ,EAAE,CAAU;EACpC;CAID,cAAc;CAId,QAAQ;CAIR,aAAa;EACX,MAAM;EACN,QAAQ,CAAC,SAAS,QAAQ;EAC1B,SAAS;EACV;CAID,UAAU;CAKV,iBAAiB;CAKjB,WAAW;CAKX,iBAAiB;CAIjB,qBAAqB;CAIrB,oBAAoB;EAClB,MAAM;EACN,SAAS;EACV;CAID,UAAU;EACR,MAAM;EACN,SAAS;EACV;CAID,cAAc;EACZ,MAAM;EACN,SAAS;EACV;CAID,cAAc;EACZ,MAAMC;EACN,eAAeC;EAChB;CAID,cAAc;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AAE;GACtD,MAAM,YAAqB,EAAE;AAE7B,OAAI,MAAM,SAAS,gBAAgB,KAAK,OAAO;IAC7C,MAAM,eACJC,8BAAgB,KAAK,CACrB,QAAQ,UAAU;AAElB,YAAQ,OAAiB,cAAc;MACvC;IACF,MAAM,cACJ,WAAW,UAAU,KACjB,eACA,aAAa,MAAM,GAAG,WAAW,MAAM;IAE7C,MAAM,WACJ,WAAW,UAAU,KAAK,EAAE,GAAG,aAAa,MAAM,WAAW,MAAM;AAErE,QAAI,UAAU,UAAU,MAAM,UAAU;AACtC,YAAO;AACP,eAAU,gBAENC,0BACA;MACE,KAAK;MACL,OAAO;MACP,OAAO,UAAU,EAAE,aAAa;MAChC,cAAc,MAAM;MACrB,EACD;MACE,wBAEIC,wBACA,EACE,OAAO,UAAU,EAAE,YAAY,EAChC,EACD,EACE,0BAAiB,MAAM,aAA0B,EAClD,CACF;MACH,eAAe;MAChB,CACF,CACF;;;GAIL,MAAM,aAAiC,MAAM,sBACzC,CACE,CACEC,6BACM;AACJ,QAAI,CAAC,YAAY,MAAM,OAAQ;AAE/B,QAAI,CAAC,aAAa,OAAO;AACvB,iBAAY,MAAM,SAAS,eACzB,KAAK,SAAS,YAAY,aAAa,WAAW,CAAC,CACpD;AAED,iBAAY,QAAQ,EAAE;;KAG3B,CACF,GACD,EAAE;GAEN,MAAM,2CAEF,MACA;IACE,KAAK,OAAO,MAAM,SAAS;IAC3B,MAAM;IACN,KAAK;IACL,OAAO,QAAQ;IACf,OAAO;MACJ,OAAO,GAAG,GAAG;MACb,OAAO,EAAE,MAAM,KAAK,GAAG;MACvB,OAAO,EAAE,WAAW,GAAG,MAAM;KAC/B;IACF,EACD,CAAC,GAAG,MAAM,GAAG,UAAU,CACxB,EACD,WACD;AAED,OAAI,MAAM,sBAAsB,MAAM,SAAS,WAC7C,mBAASC,gDAAgC,MAAM;AAGjD,UAAO;;;CAGZ,CAAC"}
1
+ {"version":3,"file":"menu.js","names":["buildProps","definePropType","mutable","iconPropType","More","isUndefined","useNamespace","MENU_INJECTION_KEY","SUB_MENU_INJECTION_KEY","Menubar","useMenuCssVar","flattedChildren","ElSubMenu","ElIcon","vClickoutside","ElMenuCollapseTransition"],"sources":["../../../../../../../packages/components/menu/src/menu.ts"],"sourcesContent":["import {\n computed,\n defineComponent,\n getCurrentInstance,\n h,\n nextTick,\n onMounted,\n provide,\n reactive,\n ref,\n watch,\n watchEffect,\n withDirectives,\n} from 'vue'\nimport { unrefElement, useResizeObserver } from '@vueuse/core'\nimport { isNil } from 'lodash-unified'\nimport ElIcon from '@element-plus/components/icon'\nimport { More } from '@element-plus/icons-vue'\nimport {\n buildProps,\n definePropType,\n flattedChildren,\n iconPropType,\n isArray,\n isObject,\n isString,\n isUndefined,\n mutable,\n} from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { ClickOutside as vClickoutside } from '@element-plus/directives'\nimport Menubar from './utils/menu-bar'\nimport ElMenuCollapseTransition from './menu-collapse-transition.vue'\nimport ElSubMenu from './sub-menu'\nimport { useMenuCssVar } from './use-menu-css-var'\nimport { MENU_INJECTION_KEY, SUB_MENU_INJECTION_KEY } from './tokens'\n\nimport type { PopperEffect } from '@element-plus/components/popper'\nimport type { MenuItemClicked, MenuProvider, SubMenuProvider } from './types'\nimport type { NavigationFailure, Router } from 'vue-router'\nimport type {\n CSSProperties,\n Component,\n DirectiveArguments,\n ExtractPropTypes,\n ExtractPublicPropTypes,\n VNode,\n VNodeArrayChildren,\n} from 'vue'\nimport type { UseResizeObserverReturn } from '@vueuse/core'\n\nexport const menuProps = buildProps({\n /**\n * @description menu display mode\n */\n mode: {\n type: String,\n values: ['horizontal', 'vertical'],\n default: 'vertical',\n },\n /**\n * @description index of active menu on page load\n */\n defaultActive: {\n type: String,\n default: '',\n },\n /**\n * @description array that contains indexes of currently active sub-menus\n */\n defaultOpeneds: {\n type: definePropType<string[]>(Array),\n default: () => mutable([] as const),\n },\n /**\n * @description whether only one sub-menu can be active\n */\n uniqueOpened: Boolean,\n /**\n * @description whether `vue-router` mode is activated. If true, index will be used as 'path' to activate the route action. Use with `default-active` to set the active item on load.\n */\n router: Boolean,\n /**\n * @description how sub-menus are triggered, only works when `mode` is 'horizontal'\n */\n menuTrigger: {\n type: String,\n values: ['hover', 'click'],\n default: 'hover',\n },\n /**\n * @description whether the menu is collapsed (available only in vertical mode)\n */\n collapse: Boolean,\n /**\n * @description background color of Menu (hex format) (deprecated, use `--bg-color` instead)\n * @deprecated use `--bg-color` instead\n */\n backgroundColor: String,\n /**\n * @description text color of Menu (hex format) (deprecated, use `--text-color` instead)\n * @deprecated use `--text-color` instead\n */\n textColor: String,\n /**\n * @description text color of currently active menu item (hex format) (deprecated, use `--active-color` instead)\n * @deprecated use `--active-color` instead\n */\n activeTextColor: String,\n /**\n * @description optional, whether menu is collapsed when clicking outside\n */\n closeOnClickOutside: Boolean,\n /**\n * @description whether to enable the collapse transition\n */\n collapseTransition: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether the menu is ellipsis (available only in horizontal mode)\n */\n ellipsis: {\n type: Boolean,\n default: true,\n },\n /**\n * @description offset of the popper (effective for all submenus)\n */\n popperOffset: {\n type: Number,\n default: 6,\n },\n /**\n * @description custom ellipsis icon (available only in horizontal mode and ellipsis is true)\n */\n ellipsisIcon: {\n type: iconPropType,\n default: () => More,\n },\n /**\n * @description Tooltip theme, built-in theme: `dark` / `light` when menu is collapsed\n */\n popperEffect: {\n type: definePropType<PopperEffect>(String),\n default: 'dark',\n },\n /**\n * @description custom class name for all popup menus\n */\n popperClass: String,\n /**\n * @description custom style for all popup menus\n */\n popperStyle: {\n type: definePropType<string | CSSProperties>([String, Object]),\n },\n /**\n * @description control timeout for all menus before showing\n */\n showTimeout: {\n type: Number,\n default: 300,\n },\n /**\n * @description control timeout for all menus before hiding\n */\n hideTimeout: {\n type: Number,\n default: 300,\n },\n /**\n * @description when menu inactive and `persistent` is `false` , dropdown menu will be destroyed\n */\n persistent: {\n type: Boolean,\n default: true,\n },\n} as const)\nexport type MenuProps = ExtractPropTypes<typeof menuProps>\nexport type MenuPropsPublic = ExtractPublicPropTypes<typeof menuProps>\n\nconst checkIndexPath = (indexPath: unknown): indexPath is string[] =>\n isArray(indexPath) && indexPath.every((path) => isString(path))\n\nexport const menuEmits = {\n close: (index: string, indexPath: string[]) =>\n isString(index) && checkIndexPath(indexPath),\n\n open: (index: string, indexPath: string[]) =>\n isString(index) && checkIndexPath(indexPath),\n\n select: (\n index: string,\n indexPath: string[],\n item: MenuItemClicked,\n routerResult?: Promise<void | NavigationFailure>\n ) =>\n isString(index) &&\n checkIndexPath(indexPath) &&\n isObject(item) &&\n (isUndefined(routerResult) || routerResult instanceof Promise),\n}\nexport type MenuEmits = typeof menuEmits\n\nconst DEFAULT_MORE_ITEM_WIDTH = 64\n\nexport default defineComponent({\n name: 'ElMenu',\n\n props: menuProps,\n emits: menuEmits,\n\n setup(props, { emit, slots, expose }) {\n const instance = getCurrentInstance()!\n const router = instance.appContext.config.globalProperties.$router as Router\n const menu = ref<HTMLUListElement>()\n const subMenu = ref<HTMLElement>()\n const nsMenu = useNamespace('menu')\n const nsSubMenu = useNamespace('sub-menu')\n let moreItemWidth = DEFAULT_MORE_ITEM_WIDTH\n\n // data\n const sliceIndex = ref(-1)\n\n const openedMenus = ref<MenuProvider['openedMenus']>(\n props.defaultOpeneds && !props.collapse\n ? props.defaultOpeneds.slice(0)\n : []\n )\n const activeIndex = ref<MenuProvider['activeIndex']>(props.defaultActive)\n const items = ref<MenuProvider['items']>({})\n const subMenus = ref<MenuProvider['subMenus']>({})\n\n // computed\n const isMenuPopup = computed<MenuProvider['isMenuPopup']>(\n () =>\n props.mode === 'horizontal' ||\n (props.mode === 'vertical' && props.collapse)\n )\n\n // methods\n const initMenu = () => {\n const activeItem = activeIndex.value && items.value[activeIndex.value]\n if (!activeItem || props.mode === 'horizontal' || props.collapse) return\n\n const indexPath = activeItem.indexPath\n\n // 展开该菜单项的路径上所有子菜单\n // expand all subMenus of the menu item\n indexPath.forEach((index) => {\n const subMenu = subMenus.value[index]\n subMenu && openMenu(index, subMenu.indexPath)\n })\n }\n\n const openMenu: MenuProvider['openMenu'] = (index, indexPath) => {\n if (openedMenus.value.includes(index)) return\n // 将不在该菜单路径下的其余菜单收起\n // collapse all menu that are not under current menu item\n if (props.uniqueOpened) {\n openedMenus.value = openedMenus.value.filter((index: string) =>\n indexPath.includes(index)\n )\n }\n openedMenus.value.push(index)\n emit('open', index, indexPath)\n }\n\n const close = (index: string) => {\n const i = openedMenus.value.indexOf(index)\n if (i !== -1) {\n openedMenus.value.splice(i, 1)\n }\n }\n\n const closeMenu: MenuProvider['closeMenu'] = (index, indexPath) => {\n close(index)\n emit('close', index, indexPath)\n }\n\n const handleSubMenuClick: MenuProvider['handleSubMenuClick'] = ({\n index,\n indexPath,\n }) => {\n const isOpened = openedMenus.value.includes(index)\n\n isOpened ? closeMenu(index, indexPath) : openMenu(index, indexPath)\n }\n\n const handleMenuItemClick: MenuProvider['handleMenuItemClick'] = (\n menuItem\n ) => {\n if (props.mode === 'horizontal' || props.collapse) {\n openedMenus.value = []\n }\n const { index, indexPath } = menuItem\n if (isNil(index) || isNil(indexPath)) return\n\n if (props.router && router) {\n const route = menuItem.route || index\n const routerResult = router.push(route).then((res) => {\n if (!res) activeIndex.value = index\n return res\n })\n emit(\n 'select',\n index,\n indexPath,\n { index, indexPath, route },\n routerResult\n )\n } else {\n activeIndex.value = index\n emit('select', index, indexPath, { index, indexPath })\n }\n }\n\n const updateActiveIndex = (val: string) => {\n const itemsInData = items.value\n const item =\n itemsInData[val] ||\n (activeIndex.value && itemsInData[activeIndex.value]) ||\n itemsInData[props.defaultActive]\n\n activeIndex.value = item?.index ?? val\n }\n\n const calcMenuItemWidth = (menuItem: HTMLElement) => {\n const computedStyle = getComputedStyle(menuItem)\n const marginLeft = Number.parseInt(computedStyle.marginLeft, 10)\n const marginRight = Number.parseInt(computedStyle.marginRight, 10)\n return menuItem.offsetWidth + marginLeft + marginRight || 0\n }\n\n const calcSliceIndex = () => {\n if (!menu.value) return -1\n\n const items = Array.from(menu.value.childNodes).filter(\n (item) =>\n item.nodeName !== '#comment' &&\n (item.nodeName !== '#text' || item.nodeValue)\n ) as HTMLElement[]\n\n const computedMenuStyle = getComputedStyle(menu.value)\n const paddingLeft = Number.parseInt(computedMenuStyle.paddingLeft, 10)\n const paddingRight = Number.parseInt(computedMenuStyle.paddingRight, 10)\n const menuWidth = menu.value.clientWidth - paddingLeft - paddingRight\n\n let calcWidth = 0\n let sliceIndex = 0\n items.forEach((item, index) => {\n calcWidth += calcMenuItemWidth(item)\n if (calcWidth <= menuWidth - moreItemWidth) {\n sliceIndex = index + 1\n }\n })\n return sliceIndex === items.length ? -1 : sliceIndex\n }\n\n const getIndexPath = (index: string) => subMenus.value[index].indexPath\n\n // Common computer monitor FPS is 60Hz, which means 60 redraws per second. Calculation formula: 1000ms/60 ≈ 16.67ms, In order to avoid a certain chance of repeated triggering when `resize`, set wait to 16.67 * 2 = 33.34\n const debounce = (fn: () => void, wait = 33.34) => {\n let timer: ReturnType<typeof setTimeout> | null\n return () => {\n timer && clearTimeout(timer)\n timer = setTimeout(() => {\n fn()\n }, wait)\n }\n }\n\n let isFirstTimeRender = true\n const handleResize = () => {\n const el = unrefElement(subMenu)\n if (el) moreItemWidth = calcMenuItemWidth(el) || DEFAULT_MORE_ITEM_WIDTH\n if (sliceIndex.value === calcSliceIndex()) return\n const callback = () => {\n sliceIndex.value = -1\n nextTick(() => {\n sliceIndex.value = calcSliceIndex()\n })\n }\n // execute callback directly when first time resize to avoid shaking\n isFirstTimeRender ? callback() : debounce(callback)()\n isFirstTimeRender = false\n }\n\n watch(\n () => props.defaultActive,\n (currentActive) => {\n if (!items.value[currentActive]) {\n activeIndex.value = ''\n }\n updateActiveIndex(currentActive)\n }\n )\n\n watch(\n () => props.collapse,\n (value) => {\n if (value) openedMenus.value = []\n }\n )\n\n watch(items.value, initMenu)\n\n let resizeStopper: UseResizeObserverReturn['stop']\n watchEffect(() => {\n if (props.mode === 'horizontal' && props.ellipsis)\n resizeStopper = useResizeObserver(menu, handleResize).stop\n else resizeStopper?.()\n })\n\n const mouseInChild = ref(false)\n\n // provide\n {\n const addSubMenu: MenuProvider['addSubMenu'] = (item) => {\n subMenus.value[item.index] = item\n }\n\n const removeSubMenu: MenuProvider['removeSubMenu'] = (item) => {\n delete subMenus.value[item.index]\n }\n\n const addMenuItem: MenuProvider['addMenuItem'] = (item) => {\n items.value[item.index] = item\n }\n\n const removeMenuItem: MenuProvider['removeMenuItem'] = (item) => {\n delete items.value[item.index]\n }\n\n provide<MenuProvider>(\n MENU_INJECTION_KEY,\n reactive({\n props,\n openedMenus,\n items,\n subMenus,\n activeIndex,\n isMenuPopup,\n\n addMenuItem,\n removeMenuItem,\n addSubMenu,\n removeSubMenu,\n openMenu,\n closeMenu,\n handleMenuItemClick,\n handleSubMenuClick,\n })\n )\n\n provide<SubMenuProvider>(`${SUB_MENU_INJECTION_KEY}${instance.uid}`, {\n addSubMenu,\n removeSubMenu,\n mouseInChild,\n level: 0,\n })\n }\n\n // lifecycle\n onMounted(() => {\n if (props.mode === 'horizontal') {\n new Menubar(instance.vnode.el!, nsMenu.namespace.value)\n }\n })\n\n {\n const open = (index: string) => {\n const { indexPath } = subMenus.value[index]\n indexPath.forEach((i) => openMenu(i, indexPath))\n }\n\n expose({\n open,\n close,\n updateActiveIndex,\n handleResize,\n })\n }\n\n const ulStyle = useMenuCssVar(props, 0)\n\n return () => {\n let slot: VNodeArrayChildren = slots.default?.() ?? []\n const vShowMore: VNode[] = []\n\n if (props.mode === 'horizontal' && menu.value) {\n const originalSlot = (\n flattedChildren(slot) as VNodeArrayChildren\n ).filter((vnode) => {\n // Filter text and comment nodes (https://github.com/vuejs/core/blob/c875019d49b4c36a88d929ccadc31ad414747c7b/packages/shared/src/shapeFlags.ts#L5)\n return (vnode as VNode)?.shapeFlag !== 8\n })\n const slotDefault =\n sliceIndex.value === -1\n ? originalSlot\n : originalSlot.slice(0, sliceIndex.value)\n\n const slotMore =\n sliceIndex.value === -1 ? [] : originalSlot.slice(sliceIndex.value)\n\n if (slotMore?.length && props.ellipsis) {\n slot = slotDefault\n vShowMore.push(\n h(\n ElSubMenu,\n {\n ref: subMenu,\n index: 'sub-menu-more',\n class: nsSubMenu.e('hide-arrow'),\n popperOffset: props.popperOffset,\n },\n {\n title: () =>\n h(\n ElIcon,\n {\n class: nsSubMenu.e('icon-more'),\n },\n {\n default: () => h(props.ellipsisIcon as Component),\n }\n ),\n default: () => slotMore,\n }\n )\n )\n }\n }\n\n const directives: DirectiveArguments = props.closeOnClickOutside\n ? [\n [\n vClickoutside,\n () => {\n if (!openedMenus.value.length) return\n\n if (!mouseInChild.value) {\n openedMenus.value.forEach((openedMenu) =>\n emit('close', openedMenu, getIndexPath(openedMenu))\n )\n\n openedMenus.value = []\n }\n },\n ],\n ]\n : []\n\n const vMenu = withDirectives(\n h(\n 'ul',\n {\n key: String(props.collapse),\n role: 'menubar',\n ref: menu,\n style: ulStyle.value,\n class: {\n [nsMenu.b()]: true,\n [nsMenu.m(props.mode)]: true,\n [nsMenu.m('collapse')]: props.collapse,\n },\n },\n [...slot, ...vShowMore]\n ),\n directives\n )\n\n if (props.collapseTransition && props.mode === 'vertical') {\n return h(ElMenuCollapseTransition, () => vMenu)\n }\n\n return vMenu\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmDA,MAAa,YAAYA,6BAAW;CAIlC,MAAM;EACJ,MAAM;EACN,QAAQ,CAAC,cAAc,WAAW;EAClC,SAAS;EACV;CAID,eAAe;EACb,MAAM;EACN,SAAS;EACV;CAID,gBAAgB;EACd,MAAMC,iCAAyB,MAAM;EACrC,eAAeC,2BAAQ,EAAE,CAAU;EACpC;CAID,cAAc;CAId,QAAQ;CAIR,aAAa;EACX,MAAM;EACN,QAAQ,CAAC,SAAS,QAAQ;EAC1B,SAAS;EACV;CAID,UAAU;CAKV,iBAAiB;CAKjB,WAAW;CAKX,i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D,CAAC,GAAG,MAAM,GAAG,UAAU,CACxB,EACD,WACD;AAED,OAAI,MAAM,sBAAsB,MAAM,SAAS,WAC7C,mBAASC,gDAAgC,MAAM;AAGjD,UAAO;;;CAGZ,CAAC"}
@@ -1,6 +1,6 @@
1
1
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
- const require_aria = require('../../../../constants/aria.js');
3
- const require_aria$1 = require('../../../../utils/dom/aria.js');
2
+ const require_aria = require('../../../../utils/dom/aria.js');
3
+ const require_aria$1 = require('../../../../constants/aria.js');
4
4
  const require_event = require('../../../../utils/dom/event.js');
5
5
  const require_submenu = require('./submenu.js');
6
6
 
@@ -23,22 +23,22 @@ var MenuItem = class {
23
23
  const code = require_event.getEventCode(event);
24
24
  let prevDef = false;
25
25
  switch (code) {
26
- case require_aria.EVENT_CODE.down:
27
- require_aria$1.triggerEvent(event.currentTarget, "mouseenter");
26
+ case require_aria$1.EVENT_CODE.down:
27
+ require_aria.triggerEvent(event.currentTarget, "mouseenter");
28
28
  this.submenu && this.submenu.gotoSubIndex(0);
29
29
  prevDef = true;
30
30
  break;
31
- case require_aria.EVENT_CODE.up:
32
- require_aria$1.triggerEvent(event.currentTarget, "mouseenter");
31
+ case require_aria$1.EVENT_CODE.up:
32
+ require_aria.triggerEvent(event.currentTarget, "mouseenter");
33
33
  this.submenu && this.submenu.gotoSubIndex(this.submenu.subMenuItems.length - 1);
34
34
  prevDef = true;
35
35
  break;
36
- case require_aria.EVENT_CODE.tab:
37
- require_aria$1.triggerEvent(event.currentTarget, "mouseleave");
36
+ case require_aria$1.EVENT_CODE.tab:
37
+ require_aria.triggerEvent(event.currentTarget, "mouseleave");
38
38
  break;
39
- case require_aria.EVENT_CODE.enter:
40
- case require_aria.EVENT_CODE.numpadEnter:
41
- case require_aria.EVENT_CODE.space:
39
+ case require_aria$1.EVENT_CODE.enter:
40
+ case require_aria$1.EVENT_CODE.numpadEnter:
41
+ case require_aria$1.EVENT_CODE.space:
42
42
  prevDef = true;
43
43
  event.currentTarget.click();
44
44
  break;
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item.js","names":["SubMenu","getEventCode","EVENT_CODE"],"sources":["../../../../../../../../packages/components/menu/src/utils/menu-item.ts"],"sourcesContent":["// @ts-nocheck\nimport { getEventCode, triggerEvent } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport SubMenu from './submenu'\n\nclass MenuItem {\n public submenu: SubMenu = null\n constructor(\n public domNode: HTMLElement,\n namespace: string\n ) {\n this.submenu = null\n this.init(namespace)\n }\n\n init(namespace: string): void {\n this.domNode.setAttribute('tabindex', '0')\n const menuChild = this.domNode.querySelector(`.${namespace}-menu`)\n if (menuChild) {\n this.submenu = new SubMenu(this, menuChild)\n }\n this.addListeners()\n }\n\n addListeners(): void {\n this.domNode.addEventListener('keydown', (event: KeyboardEvent) => {\n const code = getEventCode(event)\n let prevDef = false\n\n switch (code) {\n case EVENT_CODE.down: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseenter')\n this.submenu && this.submenu.gotoSubIndex(0)\n prevDef = true\n break\n }\n case EVENT_CODE.up: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseenter')\n this.submenu &&\n this.submenu.gotoSubIndex(this.submenu.subMenuItems.length - 1)\n prevDef = true\n break\n }\n case EVENT_CODE.tab: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseleave')\n break\n }\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n case EVENT_CODE.space: {\n prevDef = true\n ;(event.currentTarget as HTMLElement).click()\n break\n }\n }\n if (prevDef) {\n event.preventDefault()\n }\n })\n }\n}\n\nexport default MenuItem\n"],"mappings":";;;;;;;AAKA,IAAM,WAAN,MAAe;CAEb,YACE,AAAO,SACP,WACA;EAFO;iBAFiB;AAKxB,OAAK,UAAU;AACf,OAAK,KAAK,UAAU;;CAGtB,KAAK,WAAyB;AAC5B,OAAK,QAAQ,aAAa,YAAY,IAAI;EAC1C,MAAM,YAAY,KAAK,QAAQ,cAAc,IAAI,UAAU,OAAO;AAClE,MAAI,UACF,MAAK,UAAU,IAAIA,wBAAQ,MAAM,UAAU;AAE7C,OAAK,cAAc;;CAGrB,eAAqB;AACnB,OAAK,QAAQ,iBAAiB,YAAY,UAAyB;GACjE,MAAM,OAAOC,2BAAa,MAAM;GAChC,IAAI,UAAU;AAEd,WAAQ,MAAR;IACE,KAAKC,wBAAW;AACd,iCAAa,MAAM,eAA8B,aAAa;AAC9D,UAAK,WAAW,KAAK,QAAQ,aAAa,EAAE;AAC5C,eAAU;AACV;IAEF,KAAKA,wBAAW;AACd,iCAAa,MAAM,eAA8B,aAAa;AAC9D,UAAK,WACH,KAAK,QAAQ,aAAa,KAAK,QAAQ,aAAa,SAAS,EAAE;AACjE,eAAU;AACV;IAEF,KAAKA,wBAAW;AACd,iCAAa,MAAM,eAA8B,aAAa;AAC9D;IAEF,KAAKA,wBAAW;IAChB,KAAKA,wBAAW;IAChB,KAAKA,wBAAW;AACd,eAAU;AACT,KAAC,MAAM,cAA8B,OAAO;AAC7C;;AAGJ,OAAI,QACF,OAAM,gBAAgB;IAExB"}
1
+ {"version":3,"file":"menu-item.js","names":["SubMenu","getEventCode","EVENT_CODE"],"sources":["../../../../../../../../packages/components/menu/src/utils/menu-item.ts"],"sourcesContent":["// @ts-nocheck\nimport { getEventCode, triggerEvent } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport SubMenu from './submenu'\n\nclass MenuItem {\n public submenu: SubMenu = null\n constructor(\n public domNode: HTMLElement,\n namespace: string\n ) {\n this.submenu = null\n this.init(namespace)\n }\n\n init(namespace: string): void {\n this.domNode.setAttribute('tabindex', '0')\n const menuChild = this.domNode.querySelector(`.${namespace}-menu`)\n if (menuChild) {\n this.submenu = new SubMenu(this, menuChild)\n }\n this.addListeners()\n }\n\n addListeners(): void {\n this.domNode.addEventListener('keydown', (event: KeyboardEvent) => {\n const code = getEventCode(event)\n let prevDef = false\n\n switch (code) {\n case EVENT_CODE.down: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseenter')\n this.submenu && this.submenu.gotoSubIndex(0)\n prevDef = true\n break\n }\n case EVENT_CODE.up: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseenter')\n this.submenu &&\n this.submenu.gotoSubIndex(this.submenu.subMenuItems.length - 1)\n prevDef = true\n break\n }\n case EVENT_CODE.tab: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseleave')\n break\n }\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n case EVENT_CODE.space: {\n prevDef = true\n ;(event.currentTarget as HTMLElement).click()\n break\n }\n }\n if (prevDef) {\n event.preventDefault()\n }\n })\n }\n}\n\nexport default MenuItem\n"],"mappings":";;;;;;;AAKA,IAAM,WAAN,MAAe;CAEb,YACE,AAAO,SACP,WACA;EAFO;iBAFiB;AAKxB,OAAK,UAAU;AACf,OAAK,KAAK,UAAU;;CAGtB,KAAK,WAAyB;AAC5B,OAAK,QAAQ,aAAa,YAAY,IAAI;EAC1C,MAAM,YAAY,KAAK,QAAQ,cAAc,IAAI,UAAU,OAAO;AAClE,MAAI,UACF,MAAK,UAAU,IAAIA,wBAAQ,MAAM,UAAU;AAE7C,OAAK,cAAc;;CAGrB,eAAqB;AACnB,OAAK,QAAQ,iBAAiB,YAAY,UAAyB;GACjE,MAAM,OAAOC,2BAAa,MAAM;GAChC,IAAI,UAAU;AAEd,WAAQ,MAAR;IACE,KAAKC,0BAAW;AACd,+BAAa,MAAM,eAA8B,aAAa;AAC9D,UAAK,WAAW,KAAK,QAAQ,aAAa,EAAE;AAC5C,eAAU;AACV;IAEF,KAAKA,0BAAW;AACd,+BAAa,MAAM,eAA8B,aAAa;AAC9D,UAAK,WACH,KAAK,QAAQ,aAAa,KAAK,QAAQ,aAAa,SAAS,EAAE;AACjE,eAAU;AACV;IAEF,KAAKA,0BAAW;AACd,+BAAa,MAAM,eAA8B,aAAa;AAC9D;IAEF,KAAKA,0BAAW;IAChB,KAAKA,0BAAW;IAChB,KAAKA,0BAAW;AACd,eAAU;AACT,KAAC,MAAM,cAA8B,OAAO;AAC7C;;AAGJ,OAAI,QACF,OAAM,gBAAgB;IAExB"}
@@ -1,6 +1,6 @@
1
1
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
- const require_aria = require('../../../../constants/aria.js');
3
- const require_aria$1 = require('../../../../utils/dom/aria.js');
2
+ const require_aria = require('../../../../utils/dom/aria.js');
3
+ const require_aria$1 = require('../../../../constants/aria.js');
4
4
  const require_event = require('../../../../utils/dom/event.js');
5
5
 
6
6
  //#region ../../packages/components/menu/src/utils/submenu.ts
@@ -29,20 +29,20 @@ var SubMenu = class {
29
29
  const code = require_event.getEventCode(event);
30
30
  let prevDef = false;
31
31
  switch (code) {
32
- case require_aria.EVENT_CODE.down:
32
+ case require_aria$1.EVENT_CODE.down:
33
33
  this.gotoSubIndex(this.subIndex + 1);
34
34
  prevDef = true;
35
35
  break;
36
- case require_aria.EVENT_CODE.up:
36
+ case require_aria$1.EVENT_CODE.up:
37
37
  this.gotoSubIndex(this.subIndex - 1);
38
38
  prevDef = true;
39
39
  break;
40
- case require_aria.EVENT_CODE.tab:
41
- require_aria$1.triggerEvent(parentNode, "mouseleave");
40
+ case require_aria$1.EVENT_CODE.tab:
41
+ require_aria.triggerEvent(parentNode, "mouseleave");
42
42
  break;
43
- case require_aria.EVENT_CODE.enter:
44
- case require_aria.EVENT_CODE.numpadEnter:
45
- case require_aria.EVENT_CODE.space:
43
+ case require_aria$1.EVENT_CODE.enter:
44
+ case require_aria$1.EVENT_CODE.numpadEnter:
45
+ case require_aria$1.EVENT_CODE.space:
46
46
  prevDef = true;
47
47
  event.currentTarget.click();
48
48
  break;
@@ -1 +1 @@
1
- {"version":3,"file":"submenu.js","names":["getEventCode","EVENT_CODE"],"sources":["../../../../../../../../packages/components/menu/src/utils/submenu.ts"],"sourcesContent":["// @ts-nocheck\nimport { getEventCode, triggerEvent } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\n\nimport type MenuItem from './menu-item'\n\nclass SubMenu {\n public subMenuItems: NodeList\n public subIndex = 0\n constructor(\n public parent: MenuItem,\n public domNode: ParentNode\n ) {\n this.subIndex = 0\n this.init()\n }\n\n init(): void {\n this.subMenuItems = this.domNode.querySelectorAll('li')\n this.addListeners()\n }\n\n gotoSubIndex(idx: number): void {\n if (idx === this.subMenuItems.length) {\n idx = 0\n } else if (idx < 0) {\n idx = this.subMenuItems.length - 1\n }\n ;(this.subMenuItems[idx] as HTMLElement).focus()\n this.subIndex = idx\n }\n\n addListeners(): void {\n const parentNode = this.parent.domNode\n Array.prototype.forEach.call(this.subMenuItems, (el: Element) => {\n el.addEventListener('keydown', (event: KeyboardEvent) => {\n const code = getEventCode(event)\n let prevDef = false\n\n switch (code) {\n case EVENT_CODE.down: {\n this.gotoSubIndex(this.subIndex + 1)\n prevDef = true\n break\n }\n case EVENT_CODE.up: {\n this.gotoSubIndex(this.subIndex - 1)\n prevDef = true\n break\n }\n case EVENT_CODE.tab: {\n triggerEvent(parentNode as HTMLElement, 'mouseleave')\n break\n }\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n case EVENT_CODE.space: {\n prevDef = true\n ;(event.currentTarget as HTMLElement).click()\n break\n }\n }\n if (prevDef) {\n event.preventDefault()\n event.stopPropagation()\n }\n return false\n })\n })\n }\n}\n\nexport default SubMenu\n"],"mappings":";;;;;;AAMA,IAAM,UAAN,MAAc;CAGZ,YACE,AAAO,QACP,AAAO,SACP;EAFO;EACA;kBAHS;AAKhB,OAAK,WAAW;AAChB,OAAK,MAAM;;CAGb,OAAa;AACX,OAAK,eAAe,KAAK,QAAQ,iBAAiB,KAAK;AACvD,OAAK,cAAc;;CAGrB,aAAa,KAAmB;AAC9B,MAAI,QAAQ,KAAK,aAAa,OAC5B,OAAM;WACG,MAAM,EACf,OAAM,KAAK,aAAa,SAAS;AAElC,EAAC,KAAK,aAAa,KAAqB,OAAO;AAChD,OAAK,WAAW;;CAGlB,eAAqB;EACnB,MAAM,aAAa,KAAK,OAAO;AAC/B,QAAM,UAAU,QAAQ,KAAK,KAAK,eAAe,OAAgB;AAC/D,MAAG,iBAAiB,YAAY,UAAyB;IACvD,MAAM,OAAOA,2BAAa,MAAM;IAChC,IAAI,UAAU;AAEd,YAAQ,MAAR;KACE,KAAKC,wBAAW;AACd,WAAK,aAAa,KAAK,WAAW,EAAE;AACpC,gBAAU;AACV;KAEF,KAAKA,wBAAW;AACd,WAAK,aAAa,KAAK,WAAW,EAAE;AACpC,gBAAU;AACV;KAEF,KAAKA,wBAAW;AACd,kCAAa,YAA2B,aAAa;AACrD;KAEF,KAAKA,wBAAW;KAChB,KAAKA,wBAAW;KAChB,KAAKA,wBAAW;AACd,gBAAU;AACT,MAAC,MAAM,cAA8B,OAAO;AAC7C;;AAGJ,QAAI,SAAS;AACX,WAAM,gBAAgB;AACtB,WAAM,iBAAiB;;AAEzB,WAAO;KACP;IACF"}
1
+ {"version":3,"file":"submenu.js","names":["getEventCode","EVENT_CODE"],"sources":["../../../../../../../../packages/components/menu/src/utils/submenu.ts"],"sourcesContent":["// @ts-nocheck\nimport { getEventCode, triggerEvent } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\n\nimport type MenuItem from './menu-item'\n\nclass SubMenu {\n public subMenuItems: NodeList\n public subIndex = 0\n constructor(\n public parent: MenuItem,\n public domNode: ParentNode\n ) {\n this.subIndex = 0\n this.init()\n }\n\n init(): void {\n this.subMenuItems = this.domNode.querySelectorAll('li')\n this.addListeners()\n }\n\n gotoSubIndex(idx: number): void {\n if (idx === this.subMenuItems.length) {\n idx = 0\n } else if (idx < 0) {\n idx = this.subMenuItems.length - 1\n }\n ;(this.subMenuItems[idx] as HTMLElement).focus()\n this.subIndex = idx\n }\n\n addListeners(): void {\n const parentNode = this.parent.domNode\n Array.prototype.forEach.call(this.subMenuItems, (el: Element) => {\n el.addEventListener('keydown', (event: KeyboardEvent) => {\n const code = getEventCode(event)\n let prevDef = false\n\n switch (code) {\n case EVENT_CODE.down: {\n this.gotoSubIndex(this.subIndex + 1)\n prevDef = true\n break\n }\n case EVENT_CODE.up: {\n this.gotoSubIndex(this.subIndex - 1)\n prevDef = true\n break\n }\n case EVENT_CODE.tab: {\n triggerEvent(parentNode as HTMLElement, 'mouseleave')\n break\n }\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n case EVENT_CODE.space: {\n prevDef = true\n ;(event.currentTarget as HTMLElement).click()\n break\n }\n }\n if (prevDef) {\n event.preventDefault()\n event.stopPropagation()\n }\n return false\n })\n })\n }\n}\n\nexport default SubMenu\n"],"mappings":";;;;;;AAMA,IAAM,UAAN,MAAc;CAGZ,YACE,AAAO,QACP,AAAO,SACP;EAFO;EACA;kBAHS;AAKhB,OAAK,WAAW;AAChB,OAAK,MAAM;;CAGb,OAAa;AACX,OAAK,eAAe,KAAK,QAAQ,iBAAiB,KAAK;AACvD,OAAK,cAAc;;CAGrB,aAAa,KAAmB;AAC9B,MAAI,QAAQ,KAAK,aAAa,OAC5B,OAAM;WACG,MAAM,EACf,OAAM,KAAK,aAAa,SAAS;AAElC,EAAC,KAAK,aAAa,KAAqB,OAAO;AAChD,OAAK,WAAW;;CAGlB,eAAqB;EACnB,MAAM,aAAa,KAAK,OAAO;AAC/B,QAAM,UAAU,QAAQ,KAAK,KAAK,eAAe,OAAgB;AAC/D,MAAG,iBAAiB,YAAY,UAAyB;IACvD,MAAM,OAAOA,2BAAa,MAAM;IAChC,IAAI,UAAU;AAEd,YAAQ,MAAR;KACE,KAAKC,0BAAW;AACd,WAAK,aAAa,KAAK,WAAW,EAAE;AACpC,gBAAU;AACV;KAEF,KAAKA,0BAAW;AACd,WAAK,aAAa,KAAK,WAAW,EAAE;AACpC,gBAAU;AACV;KAEF,KAAKA,0BAAW;AACd,gCAAa,YAA2B,aAAa;AACrD;KAEF,KAAKA,0BAAW;KAChB,KAAKA,0BAAW;KAChB,KAAKA,0BAAW;AACd,gBAAU;AACT,MAAC,MAAM,cAA8B,OAAO;AAC7C;;AAGJ,QAAI,SAAS;AACX,WAAM,gBAAgB;AACtB,WAAM,iBAAiB;;AAEzB,WAAO;KACP;IACF"}
@@ -1,16 +1,16 @@
1
1
  const require_runtime = require('../../../../_virtual/_rolldown/runtime.js');
2
2
  const require_icon = require('../../../utils/vue/icon.js');
3
3
  const require_validator = require('../../../utils/vue/validator.js');
4
- const require_index = require('../../../directives/trap-focus/index.js');
5
- const require_index$1 = require('../../../hooks/use-draggable/index.js');
6
- const require_index$2 = require('../../../hooks/use-lockscreen/index.js');
7
- const require_index$3 = require('../../../hooks/use-same-target/index.js');
8
- const require_index$4 = require('../../../hooks/use-id/index.js');
9
- const require_index$5 = require('../../icon/index.js');
10
- const require_index$6 = require('../../focus-trap/index.js');
11
- const require_index$7 = require('../../input/index.js');
4
+ const require_index = require('../../../hooks/use-draggable/index.js');
5
+ const require_index$1 = require('../../../hooks/use-lockscreen/index.js');
6
+ const require_index$2 = require('../../../hooks/use-same-target/index.js');
7
+ const require_index$3 = require('../../../hooks/use-id/index.js');
8
+ const require_index$4 = require('../../icon/index.js');
9
+ const require_index$5 = require('../../focus-trap/index.js');
10
+ const require_index$6 = require('../../input/index.js');
12
11
  const require_use_global_config = require('../../config-provider/src/hooks/use-global-config.js');
13
- const require_index$8 = require('../../button/index.js');
12
+ const require_index$7 = require('../../button/index.js');
13
+ const require_index$8 = require('../../../directives/trap-focus/index.js');
14
14
  const require_index$9 = require('../../overlay/index.js');
15
15
  let _element_plus_icons_vue = require("@element-plus/icons-vue");
16
16
  let vue = require("vue");
@@ -19,13 +19,13 @@ let _vue_shared = require("@vue/shared");
19
19
  //#region ../../packages/components/message-box/src/index.vue?vue&type=script&lang.ts
20
20
  var index_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
21
21
  name: "ElMessageBox",
22
- directives: { TrapFocus: require_index.default },
22
+ directives: { TrapFocus: require_index$8.default },
23
23
  components: {
24
- ElButton: require_index$8.ElButton,
25
- ElFocusTrap: require_index$6.default,
26
- ElInput: require_index$7.ElInput,
24
+ ElButton: require_index$7.ElButton,
25
+ ElFocusTrap: require_index$5.default,
26
+ ElInput: require_index$6.ElInput,
27
27
  ElOverlay: require_index$9.ElOverlay,
28
- ElIcon: require_index$5.ElIcon,
28
+ ElIcon: require_index$4.ElIcon,
29
29
  ...require_icon.TypeComponents
30
30
  },
31
31
  inheritAttrs: false,
@@ -121,8 +121,8 @@ var index_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
121
121
  const type = state.type;
122
122
  return { [ns.bm("icon", type)]: type && require_icon.TypeComponentsMap[type] };
123
123
  });
124
- const contentId = require_index$4.useId();
125
- const inputId = require_index$4.useId();
124
+ const contentId = require_index$3.useId();
125
+ const inputId = require_index$3.useId();
126
126
  const iconComponent = (0, vue.computed)(() => {
127
127
  const type = state.type;
128
128
  return state.icon || type && require_icon.TypeComponentsMap[type] || "";
@@ -154,7 +154,7 @@ var index_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
154
154
  state.validateError = false;
155
155
  }
156
156
  });
157
- const { isDragging } = require_index$1.useDraggable(rootRef, headerRef, (0, vue.computed)(() => props.draggable), (0, vue.computed)(() => props.overflow));
157
+ const { isDragging } = require_index.useDraggable(rootRef, headerRef, (0, vue.computed)(() => props.draggable), (0, vue.computed)(() => props.overflow));
158
158
  (0, vue.onMounted)(async () => {
159
159
  await (0, vue.nextTick)();
160
160
  if (props.closeOnHashChange) window.addEventListener("hashchange", doClose);
@@ -172,7 +172,7 @@ var index_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
172
172
  const handleWrapperClick = () => {
173
173
  if (props.closeOnClickModal) handleAction(state.distinguishCancelAndClose ? "close" : "cancel");
174
174
  };
175
- const overlayEvent = require_index$3.useSameTarget(handleWrapperClick);
175
+ const overlayEvent = require_index$2.useSameTarget(handleWrapperClick);
176
176
  const handleInputEnter = (e) => {
177
177
  if (state.inputType !== "textarea" && !inputRef.value?.isComposing) {
178
178
  e.preventDefault();
@@ -222,7 +222,7 @@ var index_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
222
222
  const onCloseRequested = () => {
223
223
  if (props.closeOnPressEscape) handleClose();
224
224
  };
225
- if (props.lockScroll) require_index$2.useLockscreen(visible, { ns });
225
+ if (props.lockScroll) require_index$1.useLockscreen(visible, { ns });
226
226
  return {
227
227
  ...(0, vue.toRefs)(state),
228
228
  ns,
@@ -1 +1 @@
1
- {"version":3,"file":"index.vue_vue_type_script_lang.js","names":[],"sources":["../../../../../../../packages/components/message-box/src/index.vue"],"sourcesContent":["<template>\n <transition name=\"fade-in-linear\" @after-leave=\"$emit('vanish')\">\n <el-overlay\n v-show=\"visible\"\n :z-index=\"zIndex\"\n :overlay-class=\"[ns.is('message-box'), modalClass]\"\n :mask=\"modal\"\n >\n <div\n role=\"dialog\"\n :aria-label=\"title\"\n aria-modal=\"true\"\n :aria-describedby=\"!showInput ? contentId : undefined\"\n :class=\"`${ns.namespace.value}-overlay-message-box`\"\n @click=\"overlayEvent.onClick\"\n @mousedown=\"overlayEvent.onMousedown\"\n @mouseup=\"overlayEvent.onMouseup\"\n >\n <el-focus-trap\n loop\n :trapped=\"visible\"\n :focus-trap-el=\"rootRef\"\n :focus-start-el=\"focusStartRef\"\n @release-requested=\"onCloseRequested\"\n >\n <div\n ref=\"rootRef\"\n :class=\"[\n ns.b(),\n customClass,\n ns.is('draggable', draggable),\n ns.is('dragging', isDragging),\n { [ns.m('center')]: center },\n ]\"\n :style=\"customStyle\"\n tabindex=\"-1\"\n @click.stop=\"\"\n >\n <div\n v-if=\"title !== null && title !== undefined\"\n ref=\"headerRef\"\n :class=\"[ns.e('header'), { 'show-close': showClose }]\"\n >\n <div :class=\"ns.e('title')\">\n <el-icon\n v-if=\"iconComponent && center\"\n :class=\"[ns.e('status'), typeClass]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <span>{{ title }}</span>\n </div>\n <button\n v-if=\"showClose\"\n type=\"button\"\n :class=\"ns.e('headerbtn')\"\n :aria-label=\"t('el.messagebox.close')\"\n @click=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n @keydown.prevent.enter=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n >\n <el-icon :class=\"ns.e('close')\">\n <component :is=\"closeIcon || 'close'\" />\n </el-icon>\n </button>\n </div>\n <div :id=\"contentId\" :class=\"ns.e('content')\">\n <div :class=\"ns.e('container')\">\n <el-icon\n v-if=\"iconComponent && !center && hasMessage\"\n :class=\"[ns.e('status'), typeClass]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <div v-if=\"hasMessage\" :class=\"ns.e('message')\">\n <slot>\n <component\n :is=\"showInput ? 'label' : 'p'\"\n v-if=\"!dangerouslyUseHTMLString\"\n :for=\"showInput ? inputId : undefined\"\n v-text=\"message\"\n />\n <component\n :is=\"showInput ? 'label' : 'p'\"\n v-else\n :for=\"showInput ? inputId : undefined\"\n v-html=\"message\"\n />\n </slot>\n </div>\n </div>\n <div v-show=\"showInput\" :class=\"ns.e('input')\">\n <el-input\n :id=\"inputId\"\n ref=\"inputRef\"\n v-model=\"inputValue\"\n :type=\"inputType\"\n :placeholder=\"inputPlaceholder\"\n :aria-invalid=\"validateError\"\n :class=\"{ invalid: validateError }\"\n @keydown.enter=\"handleInputEnter\"\n />\n <div\n :class=\"ns.e('errormsg')\"\n :style=\"{\n visibility: !!editorErrorMessage ? 'visible' : 'hidden',\n }\"\n >\n {{ editorErrorMessage }}\n </div>\n </div>\n </div>\n <div :class=\"ns.e('btns')\">\n <el-button\n v-if=\"showCancelButton\"\n :type=\"cancelButtonType === 'text' ? '' : cancelButtonType\"\n :text=\"cancelButtonType === 'text'\"\n :loading=\"cancelButtonLoading\"\n :loading-icon=\"cancelButtonLoadingIcon\"\n :class=\"[cancelButtonClass]\"\n :round=\"roundButton\"\n :size=\"btnSize\"\n @click=\"handleAction('cancel')\"\n @keydown.prevent.enter=\"handleAction('cancel')\"\n >\n {{ cancelButtonText || t('el.messagebox.cancel') }}\n </el-button>\n <el-button\n v-show=\"showConfirmButton\"\n ref=\"confirmRef\"\n :type=\"confirmButtonType === 'text' ? '' : confirmButtonType\"\n :text=\"confirmButtonType === 'text'\"\n :loading=\"confirmButtonLoading\"\n :loading-icon=\"confirmButtonLoadingIcon\"\n :class=\"[confirmButtonClasses]\"\n :round=\"roundButton\"\n :disabled=\"confirmButtonDisabled\"\n :size=\"btnSize\"\n @click=\"handleAction('confirm')\"\n @keydown.prevent.enter=\"handleAction('confirm')\"\n >\n {{ confirmButtonText || t('el.messagebox.confirm') }}\n </el-button>\n </div>\n </div>\n </el-focus-trap>\n </div>\n </el-overlay>\n </transition>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n markRaw,\n nextTick,\n onBeforeUnmount,\n onMounted,\n reactive,\n ref,\n toRefs,\n watch,\n} from 'vue'\nimport ElButton from '@element-plus/components/button'\nimport { TrapFocus } from '@element-plus/directives'\nimport {\n useDraggable,\n useId,\n useLockscreen,\n useSameTarget,\n} from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { ElOverlay } from '@element-plus/components/overlay'\nimport {\n TypeComponents,\n TypeComponentsMap,\n isFunction,\n isString,\n isValidComponentSize,\n} from '@element-plus/utils'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Loading } from '@element-plus/icons-vue'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport { useGlobalComponentSettings } from '@element-plus/components/config-provider'\n\nimport type { ComponentPublicInstance, PropType } from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type {\n Action,\n MessageBoxState,\n MessageBoxType,\n} from './message-box.type'\nimport type { InputInstance } from '@element-plus/components/input'\n\nexport default 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 as PropType<ComponentSize>,\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: Boolean,\n container: {\n type: String, // default append to body\n default: 'body',\n },\n boxType: {\n type: String as PropType<MessageBoxType>,\n default: '',\n },\n },\n emits: ['vanish', 'action'],\n setup(props, { emit }) {\n // const popup = usePopup(props, doClose)\n const {\n locale,\n zIndex,\n ns,\n size: btnSize,\n } = useGlobalComponentSettings(\n 'message-box',\n computed(() => props.buttonSize)\n )\n\n const { t } = locale\n const { nextZIndex } = zIndex\n\n const visible = ref(false)\n // s represents state\n const state = reactive<MessageBoxState>({\n // autofocus element when open message-box\n autofocus: true,\n beforeClose: null,\n callback: null,\n cancelButtonText: '',\n cancelButtonClass: '',\n confirmButtonText: '',\n confirmButtonClass: '',\n cancelButtonType: '',\n confirmButtonType: 'primary',\n customClass: '',\n customStyle: {},\n dangerouslyUseHTMLString: false,\n distinguishCancelAndClose: false,\n icon: '',\n closeIcon: '',\n inputPattern: null,\n inputPlaceholder: '',\n inputType: 'text',\n inputValue: '',\n inputValidator: undefined,\n inputErrorMessage: '',\n message: '',\n modalFade: true,\n modalClass: '',\n showCancelButton: false,\n showConfirmButton: true,\n type: '',\n title: undefined,\n showInput: false,\n action: '' as Action,\n confirmButtonLoading: false,\n cancelButtonLoading: false,\n confirmButtonLoadingIcon: markRaw(Loading),\n cancelButtonLoadingIcon: markRaw(Loading),\n confirmButtonDisabled: false,\n editorErrorMessage: '',\n // refer to: https://github.com/ElemeFE/element/commit/2999279ae34ef10c373ca795c87b020ed6753eed\n // seemed ok for now without this state.\n // isOnComposition: false, // temporary remove\n validateError: false,\n zIndex: nextZIndex(),\n })\n\n const typeClass = computed(() => {\n const type = state.type\n return { [ns.bm('icon', type)]: type && TypeComponentsMap[type] }\n })\n\n const contentId = useId()\n const inputId = useId()\n\n const iconComponent = computed(() => {\n const type = state.type\n return state.icon || (type && TypeComponentsMap[type]) || ''\n })\n const hasMessage = computed(() => !!state.message)\n const rootRef = ref<HTMLElement>()\n const headerRef = ref<HTMLElement>()\n const focusStartRef = ref<HTMLElement>()\n const inputRef = ref<InputInstance>()\n const confirmRef = ref<ComponentPublicInstance>()\n\n const confirmButtonClasses = computed(() => state.confirmButtonClass)\n\n watch(\n () => state.inputValue,\n async (val) => {\n await nextTick()\n if (props.boxType === 'prompt' && val) {\n validate()\n }\n },\n { immediate: true }\n )\n\n watch(\n () => visible.value,\n (val) => {\n if (val) {\n if (props.boxType !== 'prompt') {\n if (state.autofocus) {\n focusStartRef.value = confirmRef.value?.$el ?? rootRef.value\n } else {\n focusStartRef.value = rootRef.value\n }\n }\n state.zIndex = nextZIndex()\n }\n if (props.boxType !== 'prompt') return\n if (val) {\n nextTick().then(() => {\n if (inputRef.value && inputRef.value.$el) {\n if (state.autofocus) {\n focusStartRef.value = getInputElement() ?? rootRef.value\n } else {\n focusStartRef.value = rootRef.value\n }\n }\n })\n } else {\n state.editorErrorMessage = ''\n state.validateError = false\n }\n }\n )\n\n const draggable = computed(() => props.draggable)\n const overflow = computed(() => props.overflow)\n const { isDragging } = useDraggable(rootRef, headerRef, draggable, overflow)\n\n onMounted(async () => {\n await nextTick()\n if (props.closeOnHashChange) {\n window.addEventListener('hashchange', doClose)\n }\n })\n\n onBeforeUnmount(() => {\n if (props.closeOnHashChange) {\n window.removeEventListener('hashchange', doClose)\n }\n })\n\n function doClose() {\n if (!visible.value) return\n visible.value = false\n nextTick(() => {\n if (state.action) emit('action', state.action)\n })\n }\n\n const handleWrapperClick = () => {\n if (props.closeOnClickModal) {\n handleAction(state.distinguishCancelAndClose ? 'close' : 'cancel')\n }\n }\n\n const overlayEvent = useSameTarget(handleWrapperClick)\n\n const handleInputEnter = (e: KeyboardEvent | Event) => {\n if (state.inputType !== 'textarea' && !inputRef.value?.isComposing) {\n e.preventDefault()\n return handleAction('confirm')\n }\n }\n\n const handleAction = (action: Action) => {\n if (props.boxType === 'prompt' && action === 'confirm' && !validate()) {\n return\n }\n\n state.action = action\n\n if (state.beforeClose) {\n state.beforeClose?.(action, state, doClose)\n } else {\n doClose()\n }\n }\n\n const validate = () => {\n if (props.boxType === 'prompt') {\n const inputPattern = state.inputPattern\n if (inputPattern && !inputPattern.test(state.inputValue || '')) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n const inputValidator = state.inputValidator\n if (isFunction(inputValidator)) {\n const validateResult = inputValidator(state.inputValue)\n if (validateResult === false) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n if (isString(validateResult)) {\n state.editorErrorMessage = validateResult\n state.validateError = true\n return false\n }\n }\n }\n state.editorErrorMessage = ''\n state.validateError = false\n return true\n }\n\n const getInputElement = () => {\n const inputRefs = inputRef.value?.$refs\n return (inputRefs?.input ?? inputRefs?.textarea) as HTMLElement\n }\n\n const handleClose = () => {\n handleAction('close')\n }\n\n // when close on press escape is disabled, pressing esc should not callout\n // any other message box and close any other dialog-ish elements\n // e.g. Dialog has a close on press esc feature, and when it closes, it calls\n // props.beforeClose method to make a intermediate state by callout a message box\n // for some verification or alerting. then if we allow global event like this\n // to dispatch, it could callout another message box.\n const onCloseRequested = () => {\n if (props.closeOnPressEscape) {\n handleClose()\n }\n }\n\n // locks the screen to prevent scroll\n if (props.lockScroll) {\n useLockscreen(visible, { ns })\n }\n\n return {\n ...toRefs(state),\n ns,\n overlayEvent,\n visible,\n hasMessage,\n typeClass,\n contentId,\n inputId,\n btnSize,\n iconComponent,\n confirmButtonClasses,\n rootRef,\n focusStartRef,\n headerRef,\n inputRef,\n isDragging,\n confirmRef,\n doClose, // for outside usage\n handleClose, // for out side usage\n onCloseRequested,\n handleWrapperClick,\n handleInputEnter,\n handleAction,\n t,\n }\n },\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsMA,sEAA+B;CAC7B,MAAM;CACN,YAAY,EACV,kCACD;CACD,YAAY;EACV;EACA;EACA;EACA;EACA;EACA,GAAG;EACJ;CACD,cAAc;CACd,OAAO;EACL,YAAY;GACV,MAAM;GACN,WAAW;GACZ;EACD,OAAO;GACL,MAAM;GACN,SAAS;GACV;EACD,YAAY;GACV,MAAM;GACN,SAAS;GACV;EACD,WAAW;GACT,MAAM;GACN,SAAS;GACV;EACD,mBAAmB;GACjB,MAAM;GACN,SAAS;GACV;EACD,oBAAoB;GAClB,MAAM;GACN,SAAS;GACV;EACD,mBAAmB;GACjB,MAAM;GACN,SAAS;GACV;EACD,QAAQ;EACR,WAAW;EACX,UAAU;EACV,aAAa;EACb,WAAW;GACT,MAAM;GACN,SAAS;GACV;EACD,SAAS;GACP,MAAM;GACN,SAAS;GACV;EACF;CACD,OAAO,CAAC,UAAU,SAAS;CAC3B,MAAM,OAAO,EAAE,QAAQ;EAErB,MAAM,EACJ,QACA,QACA,IACA,MAAM,YACJ,qDACF,uCACe,MAAM,WAAU,CACjC;EAEA,MAAM,EAAE,MAAM;EACd,MAAM,EAAE,eAAe;EAEvB,MAAM,uBAAc,MAAK;EAEzB,MAAM,0BAAkC;GAEtC,WAAW;GACX,aAAa;GACb,UAAU;GACV,kBAAkB;GAClB,mBAAmB;GACnB,mBAAmB;GACnB,oBAAoB;GACpB,kBAAkB;GAClB,mBAAmB;GACnB,aAAa;GACb,aAAa,EAAE;GACf,0BAA0B;GAC1B,2BAA2B;GAC3B,MAAM;GACN,WAAW;GACX,cAAc;GACd,kBAAkB;GAClB,WAAW;GACX,YAAY;GACZ,gBAAgB;GAChB,mBAAmB;GACnB,SAAS;GACT,WAAW;GACX,YAAY;GACZ,kBAAkB;GA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EAAE;AAC5B,YAAM,qBAAqB;AAC3B,YAAM,gBAAgB;AACtB,aAAO;;;;AAIb,SAAM,qBAAqB;AAC3B,SAAM,gBAAgB;AACtB,UAAO;;EAGT,MAAM,wBAAwB;GAC5B,MAAM,YAAY,SAAS,OAAO;AAClC,UAAQ,WAAW,SAAS,WAAW;;EAGzC,MAAM,oBAAoB;AACxB,gBAAa,QAAO;;EAStB,MAAM,yBAAyB;AAC7B,OAAI,MAAM,mBACR,cAAY;;AAKhB,MAAI,MAAM,WACR,+BAAc,SAAS,EAAE,IAAI,CAAA;AAG/B,SAAO;GACL,mBAAU,MAAM;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACF;;CAEH,CAAA"}
1
+ {"version":3,"file":"index.vue_vue_type_script_lang.js","names":[],"sources":["../../../../../../../packages/components/message-box/src/index.vue"],"sourcesContent":["<template>\n <transition name=\"fade-in-linear\" @after-leave=\"$emit('vanish')\">\n <el-overlay\n v-show=\"visible\"\n :z-index=\"zIndex\"\n :overlay-class=\"[ns.is('message-box'), modalClass]\"\n :mask=\"modal\"\n >\n <div\n role=\"dialog\"\n :aria-label=\"title\"\n aria-modal=\"true\"\n :aria-describedby=\"!showInput ? contentId : undefined\"\n :class=\"`${ns.namespace.value}-overlay-message-box`\"\n @click=\"overlayEvent.onClick\"\n @mousedown=\"overlayEvent.onMousedown\"\n @mouseup=\"overlayEvent.onMouseup\"\n >\n <el-focus-trap\n loop\n :trapped=\"visible\"\n :focus-trap-el=\"rootRef\"\n :focus-start-el=\"focusStartRef\"\n @release-requested=\"onCloseRequested\"\n >\n <div\n ref=\"rootRef\"\n :class=\"[\n ns.b(),\n customClass,\n ns.is('draggable', draggable),\n ns.is('dragging', isDragging),\n { [ns.m('center')]: center },\n ]\"\n :style=\"customStyle\"\n tabindex=\"-1\"\n @click.stop=\"\"\n >\n <div\n v-if=\"title !== null && title !== undefined\"\n ref=\"headerRef\"\n :class=\"[ns.e('header'), { 'show-close': showClose }]\"\n >\n <div :class=\"ns.e('title')\">\n <el-icon\n v-if=\"iconComponent && center\"\n :class=\"[ns.e('status'), typeClass]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <span>{{ title }}</span>\n </div>\n <button\n v-if=\"showClose\"\n type=\"button\"\n :class=\"ns.e('headerbtn')\"\n :aria-label=\"t('el.messagebox.close')\"\n @click=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n @keydown.prevent.enter=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n >\n <el-icon :class=\"ns.e('close')\">\n <component :is=\"closeIcon || 'close'\" />\n </el-icon>\n </button>\n </div>\n <div :id=\"contentId\" :class=\"ns.e('content')\">\n <div :class=\"ns.e('container')\">\n <el-icon\n v-if=\"iconComponent && !center && hasMessage\"\n :class=\"[ns.e('status'), typeClass]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <div v-if=\"hasMessage\" :class=\"ns.e('message')\">\n <slot>\n <component\n :is=\"showInput ? 'label' : 'p'\"\n v-if=\"!dangerouslyUseHTMLString\"\n :for=\"showInput ? inputId : undefined\"\n v-text=\"message\"\n />\n <component\n :is=\"showInput ? 'label' : 'p'\"\n v-else\n :for=\"showInput ? inputId : undefined\"\n v-html=\"message\"\n />\n </slot>\n </div>\n </div>\n <div v-show=\"showInput\" :class=\"ns.e('input')\">\n <el-input\n :id=\"inputId\"\n ref=\"inputRef\"\n v-model=\"inputValue\"\n :type=\"inputType\"\n :placeholder=\"inputPlaceholder\"\n :aria-invalid=\"validateError\"\n :class=\"{ invalid: validateError }\"\n @keydown.enter=\"handleInputEnter\"\n />\n <div\n :class=\"ns.e('errormsg')\"\n :style=\"{\n visibility: !!editorErrorMessage ? 'visible' : 'hidden',\n }\"\n >\n {{ editorErrorMessage }}\n </div>\n </div>\n </div>\n <div :class=\"ns.e('btns')\">\n <el-button\n v-if=\"showCancelButton\"\n :type=\"cancelButtonType === 'text' ? '' : cancelButtonType\"\n :text=\"cancelButtonType === 'text'\"\n :loading=\"cancelButtonLoading\"\n :loading-icon=\"cancelButtonLoadingIcon\"\n :class=\"[cancelButtonClass]\"\n :round=\"roundButton\"\n :size=\"btnSize\"\n @click=\"handleAction('cancel')\"\n @keydown.prevent.enter=\"handleAction('cancel')\"\n >\n {{ cancelButtonText || t('el.messagebox.cancel') }}\n </el-button>\n <el-button\n v-show=\"showConfirmButton\"\n ref=\"confirmRef\"\n :type=\"confirmButtonType === 'text' ? '' : confirmButtonType\"\n :text=\"confirmButtonType === 'text'\"\n :loading=\"confirmButtonLoading\"\n :loading-icon=\"confirmButtonLoadingIcon\"\n :class=\"[confirmButtonClasses]\"\n :round=\"roundButton\"\n :disabled=\"confirmButtonDisabled\"\n :size=\"btnSize\"\n @click=\"handleAction('confirm')\"\n @keydown.prevent.enter=\"handleAction('confirm')\"\n >\n {{ confirmButtonText || t('el.messagebox.confirm') }}\n </el-button>\n </div>\n </div>\n </el-focus-trap>\n </div>\n </el-overlay>\n </transition>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n markRaw,\n nextTick,\n onBeforeUnmount,\n onMounted,\n reactive,\n ref,\n toRefs,\n watch,\n} from 'vue'\nimport ElButton from '@element-plus/components/button'\nimport { TrapFocus } from '@element-plus/directives'\nimport {\n useDraggable,\n useId,\n useLockscreen,\n useSameTarget,\n} from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { ElOverlay } from '@element-plus/components/overlay'\nimport {\n TypeComponents,\n TypeComponentsMap,\n isFunction,\n isString,\n isValidComponentSize,\n} from '@element-plus/utils'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Loading } from '@element-plus/icons-vue'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport { useGlobalComponentSettings } from '@element-plus/components/config-provider'\n\nimport type { ComponentPublicInstance, PropType } from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type {\n Action,\n MessageBoxState,\n MessageBoxType,\n} from './message-box.type'\nimport type { InputInstance } from '@element-plus/components/input'\n\nexport default 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 as PropType<ComponentSize>,\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: Boolean,\n container: {\n type: String, // default append to body\n default: 'body',\n },\n boxType: {\n type: String as PropType<MessageBoxType>,\n default: '',\n },\n },\n emits: ['vanish', 'action'],\n setup(props, { emit }) {\n // const popup = usePopup(props, doClose)\n const {\n locale,\n zIndex,\n ns,\n size: btnSize,\n } = useGlobalComponentSettings(\n 'message-box',\n computed(() => props.buttonSize)\n )\n\n const { t } = locale\n const { nextZIndex } = zIndex\n\n const visible = ref(false)\n // s represents state\n const state = reactive<MessageBoxState>({\n // autofocus element when open message-box\n autofocus: true,\n beforeClose: null,\n callback: null,\n cancelButtonText: '',\n cancelButtonClass: '',\n confirmButtonText: '',\n confirmButtonClass: '',\n cancelButtonType: '',\n confirmButtonType: 'primary',\n customClass: '',\n customStyle: {},\n dangerouslyUseHTMLString: false,\n distinguishCancelAndClose: false,\n icon: '',\n closeIcon: '',\n inputPattern: null,\n inputPlaceholder: '',\n inputType: 'text',\n inputValue: '',\n inputValidator: undefined,\n inputErrorMessage: '',\n message: '',\n modalFade: true,\n modalClass: '',\n showCancelButton: false,\n showConfirmButton: true,\n type: '',\n title: undefined,\n showInput: false,\n action: '' as Action,\n confirmButtonLoading: false,\n cancelButtonLoading: false,\n confirmButtonLoadingIcon: markRaw(Loading),\n cancelButtonLoadingIcon: markRaw(Loading),\n confirmButtonDisabled: false,\n editorErrorMessage: '',\n // refer to: https://github.com/ElemeFE/element/commit/2999279ae34ef10c373ca795c87b020ed6753eed\n // seemed ok for now without this state.\n // isOnComposition: false, // temporary remove\n validateError: false,\n zIndex: nextZIndex(),\n })\n\n const typeClass = computed(() => {\n const type = state.type\n return { [ns.bm('icon', type)]: type && TypeComponentsMap[type] }\n })\n\n const contentId = useId()\n const inputId = useId()\n\n const iconComponent = computed(() => {\n const type = state.type\n return state.icon || (type && TypeComponentsMap[type]) || ''\n })\n const hasMessage = computed(() => !!state.message)\n const rootRef = ref<HTMLElement>()\n const headerRef = ref<HTMLElement>()\n const focusStartRef = ref<HTMLElement>()\n const inputRef = ref<InputInstance>()\n const confirmRef = ref<ComponentPublicInstance>()\n\n const confirmButtonClasses = computed(() => state.confirmButtonClass)\n\n watch(\n () => state.inputValue,\n async (val) => {\n await nextTick()\n if (props.boxType === 'prompt' && val) {\n validate()\n }\n },\n { immediate: true }\n )\n\n watch(\n () => visible.value,\n (val) => {\n if (val) {\n if (props.boxType !== 'prompt') {\n if (state.autofocus) {\n focusStartRef.value = confirmRef.value?.$el ?? rootRef.value\n } else {\n focusStartRef.value = rootRef.value\n }\n }\n state.zIndex = nextZIndex()\n }\n if (props.boxType !== 'prompt') return\n if (val) {\n nextTick().then(() => {\n if (inputRef.value && inputRef.value.$el) {\n if (state.autofocus) {\n focusStartRef.value = getInputElement() ?? rootRef.value\n } else {\n focusStartRef.value = rootRef.value\n }\n }\n })\n } else {\n state.editorErrorMessage = ''\n state.validateError = false\n }\n }\n )\n\n const draggable = computed(() => props.draggable)\n const overflow = computed(() => props.overflow)\n const { isDragging } = useDraggable(rootRef, headerRef, draggable, overflow)\n\n onMounted(async () => {\n await nextTick()\n if (props.closeOnHashChange) {\n window.addEventListener('hashchange', doClose)\n }\n })\n\n onBeforeUnmount(() => {\n if (props.closeOnHashChange) {\n window.removeEventListener('hashchange', doClose)\n }\n })\n\n function doClose() {\n if (!visible.value) return\n visible.value = false\n nextTick(() => {\n if (state.action) emit('action', state.action)\n })\n }\n\n const handleWrapperClick = () => {\n if (props.closeOnClickModal) {\n handleAction(state.distinguishCancelAndClose ? 'close' : 'cancel')\n }\n }\n\n const overlayEvent = useSameTarget(handleWrapperClick)\n\n const handleInputEnter = (e: KeyboardEvent | Event) => {\n if (state.inputType !== 'textarea' && !inputRef.value?.isComposing) {\n e.preventDefault()\n return handleAction('confirm')\n }\n }\n\n const handleAction = (action: Action) => {\n if (props.boxType === 'prompt' && action === 'confirm' && !validate()) {\n return\n }\n\n state.action = action\n\n if (state.beforeClose) {\n state.beforeClose?.(action, state, doClose)\n } else {\n doClose()\n }\n }\n\n const validate = () => {\n if (props.boxType === 'prompt') {\n const inputPattern = state.inputPattern\n if (inputPattern && !inputPattern.test(state.inputValue || '')) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n const inputValidator = state.inputValidator\n if (isFunction(inputValidator)) {\n const validateResult = inputValidator(state.inputValue)\n if (validateResult === false) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n if (isString(validateResult)) {\n state.editorErrorMessage = validateResult\n state.validateError = true\n return false\n }\n }\n }\n state.editorErrorMessage = ''\n state.validateError = false\n return true\n }\n\n const getInputElement = () => {\n const inputRefs = inputRef.value?.$refs\n return (inputRefs?.input ?? inputRefs?.textarea) as HTMLElement\n }\n\n const handleClose = () => {\n handleAction('close')\n }\n\n // when close on press escape is disabled, pressing esc should not callout\n // any other message box and close any other dialog-ish elements\n // e.g. Dialog has a close on press esc feature, and when it closes, it calls\n // props.beforeClose method to make a intermediate state by callout a message box\n // for some verification or alerting. then if we allow global event like this\n // to dispatch, it could callout another message box.\n const onCloseRequested = () => {\n if (props.closeOnPressEscape) {\n handleClose()\n }\n }\n\n // locks the screen to prevent scroll\n if (props.lockScroll) {\n useLockscreen(visible, { ns })\n }\n\n return {\n ...toRefs(state),\n ns,\n overlayEvent,\n visible,\n hasMessage,\n typeClass,\n contentId,\n inputId,\n btnSize,\n iconComponent,\n confirmButtonClasses,\n rootRef,\n focusStartRef,\n headerRef,\n inputRef,\n isDragging,\n confirmRef,\n doClose, // for outside usage\n handleClose, // for out side usage\n onCloseRequested,\n handleWrapperClick,\n handleInputEnter,\n handleAction,\n t,\n }\n },\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsMA,sEAA+B;CAC7B,MAAM;CACN,YAAY,EACV,oCACD;CACD,YAAY;EACV;EACA;EACA;EACA;EACA;EACA,GAAG;EACJ;CACD,cAAc;CACd,OAAO;EACL,YAAY;GACV,MAAM;GACN,WAAW;GACZ;EACD,OAAO;GACL,MAAM;GACN,SAAS;GACV;EACD,YAAY;GACV,MAAM;GACN,SAAS;GACV;EACD,WAAW;GACT,MAAM;GACN,SAAS;GACV;EACD,mBAAmB;GACjB,MAAM;GACN,SAAS;GACV;EACD,oBAAoB;GAClB,MAAM;GACN,SAAS;GACV;EACD,mBAAmB;GACjB,MAAM;GACN,SAAS;GACV;EACD,QAAQ;EACR,WAAW;EACX,UAAU;EACV,aAAa;EACb,WAAW;GACT,MAAM;GACN,SAAS;GACV;EACD,SAAS;GACP,MAAM;GACN,SAAS;GACV;EACF;CACD,OAAO,CAAC,UAAU,SAAS;CAC3B,MAAM,OAAO,EAAE,QAAQ;EAErB,MAAM,EACJ,QACA,QACA,IACA,MAAM,YACJ,qDACF,uCACe,MAAM,WAAU,CACjC;EAEA,MAAM,EAAE,MAAM;EACd,MAAM,EAAE,eAAe;EAEvB,MAAM,uBAAc,MAAK;EAEzB,MAAM,0BAAkC;GAEtC,WAAW;GACX,aAAa;GACb,UAAU;GACV,kBAAkB;GAClB,mBAAmB;GACnB,mBAAmB;GACnB,oBAAoB;GACpB,kBAAkB;GAClB,mBAAm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M,iBAAiB,MAAM;AAC7B,oCAAe,eAAe,EAAE;KAC9B,MAAM,iBAAiB,eAAe,MAAM,WAAU;AACtD,SAAI,mBAAmB,OAAO;AAC5B,YAAM,qBACJ,MAAM,qBAAqB,EAAE,sBAAqB;AACpD,YAAM,gBAAgB;AACtB,aAAO;;AAET,mCAAa,eAAe,EAAE;AAC5B,YAAM,qBAAqB;AAC3B,YAAM,gBAAgB;AACtB,aAAO;;;;AAIb,SAAM,qBAAqB;AAC3B,SAAM,gBAAgB;AACtB,UAAO;;EAGT,MAAM,wBAAwB;GAC5B,MAAM,YAAY,SAAS,OAAO;AAClC,UAAQ,WAAW,SAAS,WAAW;;EAGzC,MAAM,oBAAoB;AACxB,gBAAa,QAAO;;EAStB,MAAM,yBAAyB;AAC7B,OAAI,MAAM,mBACR,cAAY;;AAKhB,MAAI,MAAM,WACR,+BAAc,SAAS,EAAE,IAAI,CAAA;AAG/B,SAAO;GACL,mBAAU,MAAM;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACF;;CAEH,CAAA"}
@@ -1,11 +1,11 @@
1
1
  const require_runtime = require('../../../../_virtual/_rolldown/runtime.js');
2
2
  const require_event = require('../../../constants/event.js');
3
3
  const require_vnode = require('../../../utils/vue/vnode.js');
4
- const require_index = require('../../../directives/click-outside/index.js');
5
- const require_index$1 = require('../../../hooks/use-calc-input-width/index.js');
6
- const require_index$2 = require('../../icon/index.js');
7
- const require_index$3 = require('../../tooltip/index.js');
8
- const require_index$4 = require('../../scrollbar/index.js');
4
+ const require_index = require('../../../hooks/use-calc-input-width/index.js');
5
+ const require_index$1 = require('../../icon/index.js');
6
+ const require_index$2 = require('../../tooltip/index.js');
7
+ const require_index$3 = require('../../scrollbar/index.js');
8
+ const require_index$4 = require('../../../directives/click-outside/index.js');
9
9
  const require_index$5 = require('../../tag/index.js');
10
10
  const require_useProps = require('../../select-v2/src/useProps.js');
11
11
  const require_token = require('./token.js');
@@ -54,11 +54,11 @@ var select_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
54
54
  ElOptions: require_options.default,
55
55
  ElOptionGroup: require_option_group.default,
56
56
  ElTag: require_index$5.ElTag,
57
- ElScrollbar: require_index$4.ElScrollbar,
58
- ElTooltip: require_index$3.ElTooltip,
59
- ElIcon: require_index$2.ElIcon
57
+ ElScrollbar: require_index$3.ElScrollbar,
58
+ ElTooltip: require_index$2.ElTooltip,
59
+ ElIcon: require_index$1.ElIcon
60
60
  },
61
- directives: { ClickOutside: require_index.default },
61
+ directives: { ClickOutside: require_index$4.default },
62
62
  props: require_select.selectProps,
63
63
  emits: [
64
64
  require_event.UPDATE_MODEL_EVENT,
@@ -86,7 +86,7 @@ var select_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
86
86
  modelValue
87
87
  });
88
88
  const API = require_useSelect.useSelect(_props, emit);
89
- const { calculatorRef, inputStyle } = require_index$1.useCalcInputWidth();
89
+ const { calculatorRef, inputStyle } = require_index.useCalcInputWidth();
90
90
  const { getLabel, getValue, getOptions, getDisabled } = require_useProps.useProps(props);
91
91
  const getOptionProps = (option) => ({
92
92
  label: getLabel(option),