@element-plus/nightly 0.0.20211231 → 0.0.20220104

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 (917) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +48424 -47505
  4. package/dist/index.full.min.js +11 -11
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +11 -11
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +8812 -7911
  9. package/es/components/autocomplete/index.d.ts +26 -18
  10. package/es/components/autocomplete/src/index.vue.d.ts +13 -10
  11. package/es/components/autocomplete/src/index.vue_vue_type_script_lang.mjs +14 -18
  12. package/es/components/autocomplete/src/index.vue_vue_type_script_lang.mjs.map +1 -1
  13. package/es/components/autocomplete/src/index.vue_vue_type_template_id_2f09f285_lang.mjs +52 -49
  14. package/es/components/autocomplete/src/index.vue_vue_type_template_id_2f09f285_lang.mjs.map +1 -1
  15. package/es/components/carousel/index.d.ts +4 -4
  16. package/es/components/carousel/src/main.vue.d.ts +4 -4
  17. package/es/components/cascader/index.d.ts +1118 -6532
  18. package/es/components/cascader/src/index.vue.d.ts +559 -3267
  19. package/es/components/cascader/src/index.vue_vue_type_script_lang.mjs +10 -10
  20. package/es/components/cascader/src/index.vue_vue_type_script_lang.mjs.map +1 -1
  21. package/es/components/cascader/src/index.vue_vue_type_template_id_0429c2db_lang.mjs +12 -12
  22. package/es/components/cascader/src/index.vue_vue_type_template_id_0429c2db_lang.mjs.map +1 -1
  23. package/es/components/cascader-panel/src/index.vue_vue_type_script_lang.mjs +3 -0
  24. package/es/components/cascader-panel/src/index.vue_vue_type_script_lang.mjs.map +1 -1
  25. package/es/components/cascader-panel/src/index.vue_vue_type_template_id_97c48f5c_lang.mjs.map +1 -1
  26. package/es/components/checkbox/index.d.ts +1 -1
  27. package/es/components/checkbox/src/checkbox.vue.d.ts +1 -1
  28. package/es/components/collapse-transition/src/collapse-transition.vue_vue_type_script_lang.mjs +7 -13
  29. package/es/components/collapse-transition/src/collapse-transition.vue_vue_type_script_lang.mjs.map +1 -1
  30. package/es/components/collapse-transition/src/collapse-transition.vue_vue_type_template_id_f68ae30a_lang.mjs +2 -2
  31. package/es/components/collapse-transition/src/collapse-transition.vue_vue_type_template_id_f68ae30a_lang.mjs.map +1 -1
  32. package/es/components/collection/index.d.ts +2 -0
  33. package/es/components/collection/index.mjs +3 -0
  34. package/es/components/{popper/src → collection}/index.mjs.map +1 -1
  35. package/es/components/collection/src/collection-item.mjs +7 -0
  36. package/es/components/collection/src/collection-item.mjs.map +1 -0
  37. package/es/components/collection/src/collection-item.vue.d.ts +2 -0
  38. package/es/components/collection/src/collection-item.vue_vue_type_script_lang.mjs +9 -0
  39. package/es/components/collection/src/collection-item.vue_vue_type_script_lang.mjs.map +1 -0
  40. package/es/components/collection/src/collection-item.vue_vue_type_template_id_dd23be6a_lang.mjs +8 -0
  41. package/es/components/collection/src/collection-item.vue_vue_type_template_id_dd23be6a_lang.mjs.map +1 -0
  42. package/es/components/collection/src/collection.d.ts +263 -0
  43. package/es/components/collection/src/collection.mjs +68 -0
  44. package/es/components/collection/src/collection.mjs.map +1 -0
  45. package/es/components/collection/src/collection.vue.d.ts +2 -0
  46. package/es/components/collection/src/collection.vue_vue_type_script_lang.mjs +8 -0
  47. package/es/components/collection/src/collection.vue_vue_type_script_lang.mjs.map +1 -0
  48. package/es/components/collection/src/collection.vue_vue_type_template_id_5f9c2545_lang.mjs +8 -0
  49. package/es/components/collection/src/collection.vue_vue_type_template_id_5f9c2545_lang.mjs.map +1 -0
  50. package/es/components/collection/src/collection2.mjs +7 -0
  51. package/es/components/collection/src/collection2.mjs.map +1 -0
  52. package/es/components/collection/src/tokens.d.ts +12 -0
  53. package/es/components/collection/src/tokens.mjs +2 -0
  54. package/es/components/collection/src/tokens.mjs.map +1 -0
  55. package/es/components/color-picker/index.d.ts +0 -2
  56. package/es/components/color-picker/src/index.vue.d.ts +0 -2
  57. package/es/components/color-picker/src/index.vue_vue_type_script_lang.mjs +2 -4
  58. package/es/components/color-picker/src/index.vue_vue_type_script_lang.mjs.map +1 -1
  59. package/es/components/color-picker/src/index.vue_vue_type_template_id_46a474d5_lang.mjs +9 -10
  60. package/es/components/color-picker/src/index.vue_vue_type_template_id_46a474d5_lang.mjs.map +1 -1
  61. package/es/components/config-provider/index.d.ts +1 -1
  62. package/es/components/config-provider/src/config-provider.d.ts +1 -1
  63. package/es/components/config-provider/src/config-provider.mjs +4 -14
  64. package/es/components/config-provider/src/config-provider.mjs.map +1 -1
  65. package/es/components/date-picker/index.d.ts +4 -4
  66. package/es/components/date-picker/src/date-picker.d.ts +2 -2
  67. package/es/components/descriptions/index.d.ts +4 -4
  68. package/es/components/descriptions/src/description-item.d.ts +2 -2
  69. package/es/components/dialog/index.d.ts +5 -5
  70. package/es/components/dialog/src/dialog.vue.d.ts +5 -5
  71. package/es/components/drawer/index.d.ts +5 -5
  72. package/es/components/drawer/src/drawer.vue.d.ts +5 -5
  73. package/es/components/dropdown/index.d.ts +767 -84
  74. package/es/components/dropdown/src/dropdown-item-impl.mjs +7 -0
  75. package/es/components/dropdown/src/dropdown-item-impl.mjs.map +1 -0
  76. package/es/components/dropdown/src/dropdown-item-impl.vue.d.ts +39 -0
  77. package/es/components/dropdown/src/dropdown-item-impl.vue_vue_type_script_lang.mjs +53 -0
  78. package/es/components/dropdown/src/dropdown-item-impl.vue_vue_type_script_lang.mjs.map +1 -0
  79. package/es/components/dropdown/src/dropdown-item-impl.vue_vue_type_template_id_6daab4f2_lang.mjs +33 -0
  80. package/es/components/dropdown/src/dropdown-item-impl.vue_vue_type_template_id_6daab4f2_lang.mjs.map +1 -0
  81. package/es/components/dropdown/src/dropdown-item.vue.d.ts +17 -9
  82. package/es/components/dropdown/src/dropdown-item.vue_vue_type_script_lang.mjs +51 -21
  83. package/es/components/dropdown/src/dropdown-item.vue_vue_type_script_lang.mjs.map +1 -1
  84. package/es/components/dropdown/src/dropdown-item.vue_vue_type_template_id_396ed16b_lang.mjs +30 -20
  85. package/es/components/dropdown/src/dropdown-item.vue_vue_type_template_id_396ed16b_lang.mjs.map +1 -1
  86. package/es/components/dropdown/src/dropdown-menu.vue.d.ts +17 -6
  87. package/es/components/dropdown/src/dropdown-menu.vue_vue_type_script_lang.mjs +59 -23
  88. package/es/components/dropdown/src/dropdown-menu.vue_vue_type_script_lang.mjs.map +1 -1
  89. package/es/components/dropdown/src/dropdown-menu.vue_vue_type_template_id_617b3492_lang.mjs +12 -9
  90. package/es/components/dropdown/src/dropdown-menu.vue_vue_type_template_id_617b3492_lang.mjs.map +1 -1
  91. package/es/components/dropdown/src/dropdown.d.ts +295 -1
  92. package/es/components/dropdown/src/dropdown.mjs +84 -0
  93. package/es/components/dropdown/src/dropdown.mjs.map +1 -1
  94. package/es/components/dropdown/src/dropdown.vue.d.ts +712 -73
  95. package/es/components/dropdown/src/dropdown.vue_vue_type_script_lang.mjs +60 -153
  96. package/es/components/dropdown/src/dropdown.vue_vue_type_script_lang.mjs.map +1 -1
  97. package/es/components/dropdown/src/dropdown.vue_vue_type_template_id_3ed790a5_lang.mjs +92 -52
  98. package/es/components/dropdown/src/dropdown.vue_vue_type_template_id_3ed790a5_lang.mjs.map +1 -1
  99. package/es/components/dropdown/src/tokens.d.ts +8 -0
  100. package/es/components/dropdown/src/tokens.mjs +4 -0
  101. package/es/components/dropdown/src/tokens.mjs.map +1 -0
  102. package/es/components/focus-trap/index.d.ts +5 -0
  103. package/es/components/focus-trap/index.mjs +6 -0
  104. package/es/components/focus-trap/index.mjs.map +1 -0
  105. package/es/components/focus-trap/src/focus-trap.mjs +7 -0
  106. package/es/components/focus-trap/src/focus-trap.mjs.map +1 -0
  107. package/es/components/focus-trap/src/focus-trap.vue.d.ts +21 -0
  108. package/es/components/focus-trap/src/focus-trap.vue_vue_type_script_lang.mjs +137 -0
  109. package/es/components/focus-trap/src/focus-trap.vue_vue_type_script_lang.mjs.map +1 -0
  110. package/es/components/focus-trap/src/focus-trap.vue_vue_type_template_id_4a8a10c5_lang.mjs +8 -0
  111. package/es/components/focus-trap/src/focus-trap.vue_vue_type_template_id_4a8a10c5_lang.mjs.map +1 -0
  112. package/es/components/focus-trap/src/tokens.d.ts +11 -0
  113. package/es/components/focus-trap/src/tokens.mjs +12 -0
  114. package/es/components/focus-trap/src/tokens.mjs.map +1 -0
  115. package/es/components/focus-trap/src/utils.d.ts +18 -0
  116. package/es/components/focus-trap/src/utils.mjs +92 -0
  117. package/es/components/focus-trap/src/utils.mjs.map +1 -0
  118. package/es/components/image/index.d.ts +2 -2
  119. package/es/components/image/src/image.vue.d.ts +2 -2
  120. package/es/components/index.mjs +8 -7
  121. package/es/components/index.mjs.map +1 -1
  122. package/es/components/input/index.d.ts +5 -5
  123. package/es/components/input/src/input.vue.d.ts +5 -5
  124. package/es/components/input-number/index.d.ts +12 -12
  125. package/es/components/input-number/src/input-number.vue.d.ts +12 -12
  126. package/es/components/menu/index.d.ts +9 -3
  127. package/es/components/menu/src/menu-item.vue.d.ts +4 -2
  128. package/es/components/menu/src/menu-item.vue_vue_type_script_lang.mjs +3 -3
  129. package/es/components/menu/src/menu-item.vue_vue_type_script_lang.mjs.map +1 -1
  130. package/es/components/menu/src/menu.d.ts +1 -1
  131. package/es/components/menu/src/menu.mjs +2 -1
  132. package/es/components/menu/src/menu.mjs.map +1 -1
  133. package/es/components/menu/src/sub-menu.mjs +18 -21
  134. package/es/components/menu/src/sub-menu.mjs.map +1 -1
  135. package/es/components/menu/src/types.d.ts +2 -0
  136. package/es/components/message-box/src/index.vue.d.ts +2 -2
  137. package/es/components/pagination/index.d.ts +2 -2
  138. package/es/components/pagination/src/pagination.d.ts +2 -2
  139. package/es/components/popconfirm/index.d.ts +19 -12
  140. package/es/components/popconfirm/index.mjs +1 -1
  141. package/es/components/popconfirm/src/popconfirm.d.ts +3 -5
  142. package/es/components/popconfirm/src/popconfirm.mjs +11 -5
  143. package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
  144. package/es/components/popconfirm/src/popconfirm.vue.d.ts +19 -13
  145. package/es/components/popconfirm/src/popconfirm.vue_vue_type_script_lang.mjs +22 -20
  146. package/es/components/popconfirm/src/popconfirm.vue_vue_type_script_lang.mjs.map +1 -1
  147. package/es/components/popconfirm/src/popconfirm.vue_vue_type_template_id_16409d25_lang.mjs +12 -13
  148. package/es/components/popconfirm/src/popconfirm.vue_vue_type_template_id_16409d25_lang.mjs.map +1 -1
  149. package/es/components/popover/index.d.ts +1690 -420
  150. package/es/components/popover/src/directive.mjs +7 -13
  151. package/es/components/popover/src/directive.mjs.map +1 -1
  152. package/es/components/popover/src/index.mjs +2 -0
  153. package/es/components/popover/src/index.mjs.map +1 -1
  154. package/es/components/popover/src/index.vue.d.ts +846 -213
  155. package/es/components/popover/src/index.vue_vue_type_script_lang.mjs +41 -107
  156. package/es/components/popover/src/index.vue_vue_type_script_lang.mjs.map +1 -1
  157. package/es/components/popover/src/index.vue_vue_type_template_id_15486cf0_lang.mjs +31 -0
  158. package/es/components/popover/src/index.vue_vue_type_template_id_15486cf0_lang.mjs.map +1 -0
  159. package/es/components/popover/src/popover.d.ts +70 -0
  160. package/es/components/popover/src/popover.mjs +31 -0
  161. package/es/components/popover/src/popover.mjs.map +1 -0
  162. package/es/components/popper/index.d.ts +7 -3479
  163. package/es/components/popper/index.mjs +13 -14
  164. package/es/components/popper/index.mjs.map +1 -1
  165. package/es/components/popper/src/arrow.mjs +7 -0
  166. package/es/components/popper/src/arrow.mjs.map +1 -0
  167. package/es/components/popper/src/arrow.vue.d.ts +12 -0
  168. package/es/components/popper/src/arrow.vue_vue_type_script_lang.mjs +27 -0
  169. package/es/components/popper/src/arrow.vue_vue_type_script_lang.mjs.map +1 -0
  170. package/es/components/popper/src/arrow.vue_vue_type_template_id_8ab40b80_lang.mjs +13 -0
  171. package/es/components/popper/src/arrow.vue_vue_type_template_id_8ab40b80_lang.mjs.map +1 -0
  172. package/es/components/popper/src/container.d.ts +3 -0
  173. package/es/components/popper/src/container.mjs +22 -0
  174. package/es/components/popper/src/container.mjs.map +1 -0
  175. package/es/components/popper/src/content.mjs +7 -0
  176. package/es/components/popper/src/content.mjs.map +1 -0
  177. package/es/components/popper/src/content.vue.d.ts +299 -0
  178. package/es/components/popper/src/content.vue_vue_type_script_lang.mjs +85 -0
  179. package/es/components/popper/src/content.vue_vue_type_script_lang.mjs.map +1 -0
  180. package/es/components/popper/src/content.vue_vue_type_template_id_611b76f0_lang.mjs +16 -0
  181. package/es/components/popper/src/content.vue_vue_type_template_id_611b76f0_lang.mjs.map +1 -0
  182. package/es/components/popper/src/popper.d.ts +58 -0
  183. package/es/components/popper/src/popper.mjs +98 -0
  184. package/es/components/popper/src/popper.mjs.map +1 -0
  185. package/es/components/popper/src/popper.vue.d.ts +3 -0
  186. package/es/components/popper/src/popper.vue_vue_type_script_lang.mjs +19 -0
  187. package/es/components/popper/src/popper.vue_vue_type_script_lang.mjs.map +1 -0
  188. package/es/components/popper/src/popper.vue_vue_type_template_id_77a3d185_lang.mjs +8 -0
  189. package/es/components/popper/src/popper.vue_vue_type_template_id_77a3d185_lang.mjs.map +1 -0
  190. package/es/components/popper/src/popper2.mjs +7 -0
  191. package/es/components/popper/src/popper2.mjs.map +1 -0
  192. package/es/components/popper/src/tokens.d.ts +14 -0
  193. package/es/components/popper/src/tokens.mjs +5 -0
  194. package/es/components/popper/src/tokens.mjs.map +1 -0
  195. package/es/components/popper/src/trigger.mjs +7 -0
  196. package/es/components/popper/src/trigger.mjs.map +1 -0
  197. package/es/components/popper/src/trigger.vue.d.ts +45 -0
  198. package/es/components/popper/src/trigger.vue_vue_type_script_lang.mjs +66 -0
  199. package/es/components/popper/src/trigger.vue_vue_type_script_lang.mjs.map +1 -0
  200. package/es/components/popper/src/trigger.vue_vue_type_template_id_4fb6e0af_lang.mjs +16 -0
  201. package/es/components/popper/src/trigger.vue_vue_type_template_id_4fb6e0af_lang.mjs.map +1 -0
  202. package/es/components/popper/src/utils.d.ts +55 -0
  203. package/es/components/popper/src/utils.mjs +76 -0
  204. package/es/components/popper/src/utils.mjs.map +1 -0
  205. package/es/components/radio/index.mjs +2 -2
  206. package/es/components/radio/src/radio-button.mjs +5 -11
  207. package/es/components/radio/src/radio-button.mjs.map +1 -1
  208. package/es/components/radio/src/radio-button.vue_vue_type_script_lang.mjs +1 -1
  209. package/es/components/radio/src/radio-button2.mjs +11 -5
  210. package/es/components/radio/src/radio-button2.mjs.map +1 -1
  211. package/es/components/roving-focus-group/index.d.ts +7 -0
  212. package/es/components/roving-focus-group/index.mjs +9 -0
  213. package/es/components/roving-focus-group/index.mjs.map +1 -0
  214. package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs +7 -0
  215. package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs.map +1 -0
  216. package/es/components/roving-focus-group/src/roving-focus-group-impl.vue.d.ts +43 -0
  217. package/es/components/roving-focus-group/src/roving-focus-group-impl.vue_vue_type_script_lang.mjs +102 -0
  218. package/es/components/roving-focus-group/src/roving-focus-group-impl.vue_vue_type_script_lang.mjs.map +1 -0
  219. package/es/components/roving-focus-group/src/roving-focus-group-impl.vue_vue_type_template_id_e5cee750_lang.mjs +8 -0
  220. package/es/components/roving-focus-group/src/roving-focus-group-impl.vue_vue_type_template_id_e5cee750_lang.mjs.map +1 -0
  221. package/es/components/roving-focus-group/src/roving-focus-group.d.ts +269 -0
  222. package/es/components/roving-focus-group/src/roving-focus-group.mjs +32 -0
  223. package/es/components/roving-focus-group/src/roving-focus-group.mjs.map +1 -0
  224. package/es/components/roving-focus-group/src/roving-focus-group.vue.d.ts +2 -0
  225. package/es/components/roving-focus-group/src/roving-focus-group.vue_vue_type_script_lang.mjs +15 -0
  226. package/es/components/roving-focus-group/src/roving-focus-group.vue_vue_type_script_lang.mjs.map +1 -0
  227. package/es/components/roving-focus-group/src/roving-focus-group.vue_vue_type_template_id_91b51b76_lang.mjs +20 -0
  228. package/es/components/roving-focus-group/src/roving-focus-group.vue_vue_type_template_id_91b51b76_lang.mjs.map +1 -0
  229. package/es/components/roving-focus-group/src/roving-focus-group2.mjs +7 -0
  230. package/es/components/roving-focus-group/src/roving-focus-group2.mjs.map +1 -0
  231. package/es/components/roving-focus-group/src/roving-focus-item.mjs +7 -0
  232. package/es/components/roving-focus-group/src/roving-focus-item.mjs.map +1 -0
  233. package/es/components/roving-focus-group/src/roving-focus-item.vue.d.ts +29 -0
  234. package/es/components/roving-focus-group/src/roving-focus-item.vue_vue_type_script_lang.mjs +100 -0
  235. package/es/components/roving-focus-group/src/roving-focus-item.vue_vue_type_script_lang.mjs.map +1 -0
  236. package/es/components/roving-focus-group/src/roving-focus-item.vue_vue_type_template_id_5f657dbd_lang.mjs +18 -0
  237. package/es/components/roving-focus-group/src/roving-focus-item.vue_vue_type_template_id_5f657dbd_lang.mjs.map +1 -0
  238. package/es/components/roving-focus-group/src/tokens.d.ts +27 -0
  239. package/es/components/roving-focus-group/src/tokens.mjs +5 -0
  240. package/es/components/roving-focus-group/src/tokens.mjs.map +1 -0
  241. package/es/components/roving-focus-group/src/utils.d.ts +8 -0
  242. package/es/components/roving-focus-group/src/utils.mjs +48 -0
  243. package/es/components/roving-focus-group/src/utils.mjs.map +1 -0
  244. package/es/components/select/index.d.ts +680 -14
  245. package/es/components/select/src/select-dropdown.vue.d.ts +1 -1
  246. package/es/components/select/src/select-dropdown.vue_vue_type_script_lang.mjs +1 -0
  247. package/es/components/select/src/select-dropdown.vue_vue_type_script_lang.mjs.map +1 -1
  248. package/es/components/select/src/select-dropdown.vue_vue_type_template_id_46cf6eee_lang.mjs.map +1 -1
  249. package/es/components/select/src/select.vue.d.ts +681 -15
  250. package/es/components/select/src/select.vue_vue_type_script_lang.mjs +25 -11
  251. package/es/components/select/src/select.vue_vue_type_script_lang.mjs.map +1 -1
  252. package/es/components/select/src/select.vue_vue_type_template_id_33774f85_lang.mjs +11 -12
  253. package/es/components/select/src/select.vue_vue_type_template_id_33774f85_lang.mjs.map +1 -1
  254. package/es/components/select/src/token.d.ts +1 -0
  255. package/es/components/select/src/token.mjs.map +1 -1
  256. package/es/components/select/src/useSelect.d.ts +671 -7
  257. package/es/components/select/src/useSelect.mjs +33 -23
  258. package/es/components/select/src/useSelect.mjs.map +1 -1
  259. package/es/components/select-v2/index.d.ts +1326 -16
  260. package/es/components/select-v2/src/select.vue.d.ts +665 -10
  261. package/es/components/select-v2/src/select.vue_vue_type_script_lang.mjs +2 -2
  262. package/es/components/select-v2/src/select.vue_vue_type_script_lang.mjs.map +1 -1
  263. package/es/components/select-v2/src/select.vue_vue_type_template_id_13e598a4_lang.mjs +8 -9
  264. package/es/components/select-v2/src/select.vue_vue_type_template_id_13e598a4_lang.mjs.map +1 -1
  265. package/es/components/select-v2/src/useSelect.d.ts +659 -4
  266. package/es/components/select-v2/src/useSelect.mjs +7 -7
  267. package/es/components/select-v2/src/useSelect.mjs.map +1 -1
  268. package/es/components/slider/src/button.vue_vue_type_script_lang.mjs +2 -2
  269. package/es/components/slider/src/button.vue_vue_type_script_lang.mjs.map +1 -1
  270. package/es/components/slot/index.d.ts +5 -0
  271. package/es/components/slot/index.mjs +2 -0
  272. package/es/components/slot/index.mjs.map +1 -0
  273. package/es/components/slot/src/only-child.d.ts +5 -0
  274. package/es/components/slot/src/only-child.mjs +61 -0
  275. package/es/components/slot/src/only-child.mjs.map +1 -0
  276. package/es/components/table/index.d.ts +4 -4
  277. package/es/components/table/src/filter-panel.vue.d.ts +654 -4
  278. package/es/components/table/src/filter-panel.vue_vue_type_script_lang.mjs +5 -7
  279. package/es/components/table/src/filter-panel.vue_vue_type_script_lang.mjs.map +1 -1
  280. package/es/components/table/src/filter-panel.vue_vue_type_template_id_fde1c940_lang.mjs +8 -9
  281. package/es/components/table/src/filter-panel.vue_vue_type_template_id_fde1c940_lang.mjs.map +1 -1
  282. package/es/components/table/src/table-column/index.d.ts +1 -1
  283. package/es/components/table/src/table.vue.d.ts +2 -2
  284. package/es/components/table/src/util.d.ts +2 -2
  285. package/es/components/teleport/index.d.ts +11 -8
  286. package/es/components/teleport/src/teleport.d.ts +4 -3
  287. package/es/components/teleport/src/teleport.mjs +5 -1
  288. package/es/components/teleport/src/teleport.mjs.map +1 -1
  289. package/es/components/teleport/src/teleport.vue.d.ts +11 -8
  290. package/es/components/teleport/src/teleport.vue_vue_type_script_lang.mjs +1 -2
  291. package/es/components/teleport/src/teleport.vue_vue_type_script_lang.mjs.map +1 -1
  292. package/es/components/teleport/src/teleport.vue_vue_type_template_id_787c6a36_lang.mjs +3 -2
  293. package/es/components/teleport/src/teleport.vue_vue_type_template_id_787c6a36_lang.mjs.map +1 -1
  294. package/es/components/time-picker/index.d.ts +4 -4
  295. package/es/components/time-picker/src/common/picker.vue.d.ts +663 -9
  296. package/es/components/time-picker/src/common/picker.vue_vue_type_script_lang.mjs +29 -17
  297. package/es/components/time-picker/src/common/picker.vue_vue_type_script_lang.mjs.map +1 -1
  298. package/es/components/time-picker/src/common/picker.vue_vue_type_template_id_1d54be91_lang.mjs +38 -38
  299. package/es/components/time-picker/src/common/picker.vue_vue_type_template_id_1d54be91_lang.mjs.map +1 -1
  300. package/es/components/time-picker/src/time-picker.d.ts +2 -2
  301. package/es/components/time-select/index.d.ts +4 -4
  302. package/es/components/time-select/src/time-select.vue.d.ts +2 -2
  303. package/es/components/tooltip/index.d.ts +346 -430
  304. package/es/components/tooltip/index.mjs +6 -7
  305. package/es/components/tooltip/index.mjs.map +1 -1
  306. package/es/components/tooltip/src/content.mjs +7 -0
  307. package/es/components/tooltip/src/content.mjs.map +1 -0
  308. package/es/components/tooltip/src/content.vue.d.ts +809 -0
  309. package/es/components/tooltip/src/content.vue_vue_type_script_lang.mjs +135 -0
  310. package/es/components/tooltip/src/content.vue_vue_type_script_lang.mjs.map +1 -0
  311. package/es/components/tooltip/src/content.vue_vue_type_template_id_20254f8d_lang.mjs +65 -0
  312. package/es/components/tooltip/src/content.vue_vue_type_template_id_20254f8d_lang.mjs.map +1 -0
  313. package/es/components/tooltip/src/tokens.d.ts +14 -0
  314. package/es/components/tooltip/src/tokens.mjs +4 -0
  315. package/es/components/tooltip/src/tokens.mjs.map +1 -0
  316. package/es/components/tooltip/src/tooltip.d.ts +146 -0
  317. package/es/components/tooltip/src/tooltip.mjs +63 -0
  318. package/es/components/tooltip/src/tooltip.mjs.map +1 -0
  319. package/es/components/tooltip/src/tooltip.vue.d.ts +383 -0
  320. package/es/components/tooltip/src/tooltip.vue_vue_type_script_lang.mjs +104 -0
  321. package/es/components/tooltip/src/tooltip.vue_vue_type_script_lang.mjs.map +1 -0
  322. package/es/components/tooltip/src/tooltip.vue_vue_type_template_id_694d1617_lang.mjs +67 -0
  323. package/es/components/tooltip/src/tooltip.vue_vue_type_template_id_694d1617_lang.mjs.map +1 -0
  324. package/es/components/tooltip/src/tooltip2.mjs +7 -0
  325. package/es/components/tooltip/src/tooltip2.mjs.map +1 -0
  326. package/es/components/tooltip/src/trigger.mjs +7 -0
  327. package/es/components/tooltip/src/trigger.mjs.map +1 -0
  328. package/es/components/tooltip/src/trigger.vue.d.ts +39 -0
  329. package/es/components/tooltip/src/trigger.vue_vue_type_script_lang.mjs +60 -0
  330. package/es/components/tooltip/src/trigger.vue_vue_type_script_lang.mjs.map +1 -0
  331. package/es/components/tooltip/src/trigger.vue_vue_type_template_id_0ec0b94c_lang.mjs +27 -0
  332. package/es/components/tooltip/src/trigger.vue_vue_type_template_id_0ec0b94c_lang.mjs.map +1 -0
  333. package/es/components/tooltip/src/utils.d.ts +4 -0
  334. package/es/components/tooltip/src/utils.mjs +18 -0
  335. package/es/components/tooltip/src/utils.mjs.map +1 -0
  336. package/es/components/tree/index.d.ts +4 -4
  337. package/es/components/tree/src/model/tree-store.mjs +1 -1
  338. package/es/components/tree/src/model/tree-store.mjs.map +1 -1
  339. package/es/components/tree/src/tree.vue.d.ts +2 -2
  340. package/es/components/tree-v2/src/tree-node.vue.d.ts +1 -1
  341. package/es/components/virtual-list/src/builders/build-list.d.ts +1 -1
  342. package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +1 -1
  343. package/es/components/virtual-list/src/components/fixed-size-list.d.ts +1 -1
  344. package/es/components/visual-hidden/index.d.ts +3 -0
  345. package/es/components/visual-hidden/index.mjs +4 -0
  346. package/es/components/{popper/src/renderers → visual-hidden}/index.mjs.map +0 -0
  347. package/es/components/visual-hidden/src/visual-hidden.mjs +7 -0
  348. package/es/components/visual-hidden/src/visual-hidden.mjs.map +1 -0
  349. package/es/components/visual-hidden/src/visual-hidden.vue.d.ts +12 -0
  350. package/es/components/visual-hidden/src/visual-hidden.vue_vue_type_script_lang.mjs +34 -0
  351. package/es/components/visual-hidden/src/visual-hidden.vue_vue_type_script_lang.mjs.map +1 -0
  352. package/es/components/visual-hidden/src/visual-hidden.vue_vue_type_template_id_4cbd1102_lang.mjs +8 -0
  353. package/es/components/visual-hidden/src/visual-hidden.vue_vue_type_template_id_4cbd1102_lang.mjs.map +1 -0
  354. package/es/defaults.d.ts +11 -1
  355. package/es/directives/click-outside/index.mjs.map +1 -1
  356. package/es/hooks/index.d.ts +8 -1
  357. package/es/hooks/index.mjs +9 -3
  358. package/es/hooks/index.mjs.map +1 -1
  359. package/es/hooks/use-delayed-toggle/index.d.ts +13 -0
  360. package/es/hooks/use-delayed-toggle/index.mjs +39 -0
  361. package/es/hooks/use-delayed-toggle/index.mjs.map +1 -0
  362. package/es/hooks/use-escape-keydown/index.d.ts +1 -0
  363. package/es/hooks/use-escape-keydown/index.mjs +21 -0
  364. package/es/hooks/use-escape-keydown/index.mjs.map +1 -0
  365. package/es/hooks/use-focus/index.d.ts +3 -1
  366. package/es/hooks/use-focus/index.mjs.map +1 -1
  367. package/es/hooks/use-forward-ref/index.d.ts +13 -0
  368. package/es/hooks/use-forward-ref/index.mjs +27 -0
  369. package/es/hooks/use-forward-ref/index.mjs.map +1 -0
  370. package/es/hooks/use-global-config/index.d.ts +14 -2
  371. package/es/hooks/use-global-config/index.mjs +25 -5
  372. package/es/hooks/use-global-config/index.mjs.map +1 -1
  373. package/es/hooks/use-id/index.d.ts +8 -0
  374. package/es/hooks/use-id/index.mjs +24 -0
  375. package/es/hooks/use-id/index.mjs.map +1 -0
  376. package/es/hooks/use-intermediate-render/index.d.ts +11 -0
  377. package/es/hooks/use-intermediate-render/index.mjs +43 -0
  378. package/es/hooks/use-intermediate-render/index.mjs.map +1 -0
  379. package/es/hooks/use-model-toggle/index.d.ts +18 -9
  380. package/es/hooks/use-model-toggle/index.mjs +103 -93
  381. package/es/hooks/use-model-toggle/index.mjs.map +1 -1
  382. package/es/hooks/use-popper-container/index.d.ts +3 -0
  383. package/es/hooks/use-popper-container/index.mjs +22 -0
  384. package/es/hooks/use-popper-container/index.mjs.map +1 -0
  385. package/es/hooks/use-restore-active/index.mjs +1 -1
  386. package/es/hooks/use-restore-active/index.mjs.map +1 -1
  387. package/es/index.d.ts +11 -1
  388. package/es/index.mjs +17 -10
  389. package/es/index.mjs.map +1 -1
  390. package/es/make-installer.d.ts +2 -1
  391. package/es/make-installer.mjs +12 -1
  392. package/es/make-installer.mjs.map +1 -1
  393. package/es/tokens/config-provider.d.ts +2 -2
  394. package/es/tokens/config-provider.mjs.map +1 -1
  395. package/es/utils/aria.d.ts +4 -0
  396. package/es/utils/aria.mjs +5 -1
  397. package/es/utils/aria.mjs.map +1 -1
  398. package/es/utils/dom.d.ts +9 -1
  399. package/es/utils/dom.mjs +27 -1
  400. package/es/utils/dom.mjs.map +1 -1
  401. package/es/utils/isServer.d.ts +2 -0
  402. package/es/utils/isServer.mjs +4 -0
  403. package/es/utils/isServer.mjs.map +1 -0
  404. package/es/utils/props.d.ts +2 -2
  405. package/es/utils/props.mjs +1 -1
  406. package/es/utils/props.mjs.map +1 -1
  407. package/es/utils/util.d.ts +1 -0
  408. package/es/utils/util.mjs +12 -1
  409. package/es/utils/util.mjs.map +1 -1
  410. package/es/version.d.ts +1 -1
  411. package/es/version.mjs +1 -1
  412. package/es/version.mjs.map +1 -1
  413. package/lib/components/autocomplete/index.d.ts +26 -18
  414. package/lib/components/autocomplete/src/index.vue.d.ts +13 -10
  415. package/lib/components/autocomplete/src/index.vue_vue_type_script_lang.js +13 -17
  416. package/lib/components/autocomplete/src/index.vue_vue_type_script_lang.js.map +1 -1
  417. package/lib/components/autocomplete/src/index.vue_vue_type_template_id_2f09f285_lang.js +51 -48
  418. package/lib/components/autocomplete/src/index.vue_vue_type_template_id_2f09f285_lang.js.map +1 -1
  419. package/lib/components/carousel/index.d.ts +4 -4
  420. package/lib/components/carousel/src/main.vue.d.ts +4 -4
  421. package/lib/components/cascader/index.d.ts +1118 -6532
  422. package/lib/components/cascader/src/index.vue.d.ts +559 -3267
  423. package/lib/components/cascader/src/index.vue_vue_type_script_lang.js +10 -10
  424. package/lib/components/cascader/src/index.vue_vue_type_script_lang.js.map +1 -1
  425. package/lib/components/cascader/src/index.vue_vue_type_template_id_0429c2db_lang.js +12 -12
  426. package/lib/components/cascader/src/index.vue_vue_type_template_id_0429c2db_lang.js.map +1 -1
  427. package/lib/components/cascader-panel/src/index.vue_vue_type_script_lang.js +3 -0
  428. package/lib/components/cascader-panel/src/index.vue_vue_type_script_lang.js.map +1 -1
  429. package/lib/components/cascader-panel/src/index.vue_vue_type_template_id_97c48f5c_lang.js.map +1 -1
  430. package/lib/components/checkbox/index.d.ts +1 -1
  431. package/lib/components/checkbox/src/checkbox.vue.d.ts +1 -1
  432. package/lib/components/collapse-transition/src/collapse-transition.vue_vue_type_script_lang.js +7 -13
  433. package/lib/components/collapse-transition/src/collapse-transition.vue_vue_type_script_lang.js.map +1 -1
  434. package/lib/components/collapse-transition/src/collapse-transition.vue_vue_type_template_id_f68ae30a_lang.js +1 -1
  435. package/lib/components/collapse-transition/src/collapse-transition.vue_vue_type_template_id_f68ae30a_lang.js.map +1 -1
  436. package/lib/components/collection/index.d.ts +2 -0
  437. package/lib/components/collection/index.js +12 -0
  438. package/lib/components/{popper/src → collection}/index.js.map +0 -0
  439. package/lib/components/collection/src/collection-item.js +12 -0
  440. package/lib/components/collection/src/collection-item.js.map +1 -0
  441. package/lib/components/collection/src/collection-item.vue.d.ts +2 -0
  442. package/lib/components/collection/src/collection-item.vue_vue_type_script_lang.js +13 -0
  443. package/lib/components/collection/src/collection-item.vue_vue_type_script_lang.js.map +1 -0
  444. package/lib/components/collection/src/collection-item.vue_vue_type_template_id_dd23be6a_lang.js +12 -0
  445. package/lib/components/collection/src/collection-item.vue_vue_type_template_id_dd23be6a_lang.js.map +1 -0
  446. package/lib/components/collection/src/collection.d.ts +263 -0
  447. package/lib/components/collection/src/collection.js +73 -0
  448. package/lib/components/collection/src/collection.js.map +1 -0
  449. package/lib/components/collection/src/collection.vue.d.ts +2 -0
  450. package/lib/components/collection/src/collection.vue_vue_type_script_lang.js +12 -0
  451. package/lib/components/collection/src/collection.vue_vue_type_script_lang.js.map +1 -0
  452. package/lib/components/collection/src/collection.vue_vue_type_template_id_5f9c2545_lang.js +12 -0
  453. package/lib/components/collection/src/collection.vue_vue_type_template_id_5f9c2545_lang.js.map +1 -0
  454. package/lib/components/collection/src/collection2.js +12 -0
  455. package/lib/components/collection/src/collection2.js.map +1 -0
  456. package/lib/components/collection/src/tokens.d.ts +12 -0
  457. package/lib/components/collection/src/tokens.js +3 -0
  458. package/lib/components/collection/src/tokens.js.map +1 -0
  459. package/lib/components/color-picker/index.d.ts +0 -2
  460. package/lib/components/color-picker/src/index.vue.d.ts +0 -2
  461. package/lib/components/color-picker/src/index.vue_vue_type_script_lang.js +2 -4
  462. package/lib/components/color-picker/src/index.vue_vue_type_script_lang.js.map +1 -1
  463. package/lib/components/color-picker/src/index.vue_vue_type_template_id_46a474d5_lang.js +9 -10
  464. package/lib/components/color-picker/src/index.vue_vue_type_template_id_46a474d5_lang.js.map +1 -1
  465. package/lib/components/config-provider/index.d.ts +1 -1
  466. package/lib/components/config-provider/src/config-provider.d.ts +1 -1
  467. package/lib/components/config-provider/src/config-provider.js +3 -13
  468. package/lib/components/config-provider/src/config-provider.js.map +1 -1
  469. package/lib/components/date-picker/index.d.ts +4 -4
  470. package/lib/components/date-picker/src/date-picker.d.ts +2 -2
  471. package/lib/components/descriptions/index.d.ts +4 -4
  472. package/lib/components/descriptions/src/description-item.d.ts +2 -2
  473. package/lib/components/dialog/index.d.ts +5 -5
  474. package/lib/components/dialog/src/dialog.vue.d.ts +5 -5
  475. package/lib/components/drawer/index.d.ts +5 -5
  476. package/lib/components/drawer/src/drawer.vue.d.ts +5 -5
  477. package/lib/components/dropdown/index.d.ts +767 -84
  478. package/lib/components/dropdown/src/dropdown-item-impl.js +12 -0
  479. package/lib/components/dropdown/src/dropdown-item-impl.js.map +1 -0
  480. package/lib/components/dropdown/src/dropdown-item-impl.vue.d.ts +39 -0
  481. package/lib/components/dropdown/src/dropdown-item-impl.vue_vue_type_script_lang.js +57 -0
  482. package/lib/components/dropdown/src/dropdown-item-impl.vue_vue_type_script_lang.js.map +1 -0
  483. package/lib/components/dropdown/src/dropdown-item-impl.vue_vue_type_template_id_6daab4f2_lang.js +37 -0
  484. package/lib/components/dropdown/src/dropdown-item-impl.vue_vue_type_template_id_6daab4f2_lang.js.map +1 -0
  485. package/lib/components/dropdown/src/dropdown-item.vue.d.ts +17 -9
  486. package/lib/components/dropdown/src/dropdown-item.vue_vue_type_script_lang.js +50 -20
  487. package/lib/components/dropdown/src/dropdown-item.vue_vue_type_script_lang.js.map +1 -1
  488. package/lib/components/dropdown/src/dropdown-item.vue_vue_type_template_id_396ed16b_lang.js +29 -19
  489. package/lib/components/dropdown/src/dropdown-item.vue_vue_type_template_id_396ed16b_lang.js.map +1 -1
  490. package/lib/components/dropdown/src/dropdown-menu.vue.d.ts +17 -6
  491. package/lib/components/dropdown/src/dropdown-menu.vue_vue_type_script_lang.js +57 -21
  492. package/lib/components/dropdown/src/dropdown-menu.vue_vue_type_script_lang.js.map +1 -1
  493. package/lib/components/dropdown/src/dropdown-menu.vue_vue_type_template_id_617b3492_lang.js +11 -8
  494. package/lib/components/dropdown/src/dropdown-menu.vue_vue_type_template_id_617b3492_lang.js.map +1 -1
  495. package/lib/components/dropdown/src/dropdown.d.ts +295 -1
  496. package/lib/components/dropdown/src/dropdown.js +96 -0
  497. package/lib/components/dropdown/src/dropdown.js.map +1 -1
  498. package/lib/components/dropdown/src/dropdown.vue.d.ts +712 -73
  499. package/lib/components/dropdown/src/dropdown.vue_vue_type_script_lang.js +59 -152
  500. package/lib/components/dropdown/src/dropdown.vue_vue_type_script_lang.js.map +1 -1
  501. package/lib/components/dropdown/src/dropdown.vue_vue_type_template_id_3ed790a5_lang.js +91 -51
  502. package/lib/components/dropdown/src/dropdown.vue_vue_type_template_id_3ed790a5_lang.js.map +1 -1
  503. package/lib/components/dropdown/src/tokens.d.ts +8 -0
  504. package/lib/components/dropdown/src/tokens.js +8 -0
  505. package/lib/components/dropdown/src/tokens.js.map +1 -0
  506. package/lib/components/focus-trap/index.d.ts +5 -0
  507. package/lib/components/focus-trap/index.js +27 -0
  508. package/lib/components/focus-trap/index.js.map +1 -0
  509. package/lib/components/focus-trap/src/focus-trap.js +12 -0
  510. package/lib/components/focus-trap/src/focus-trap.js.map +1 -0
  511. package/lib/components/focus-trap/src/focus-trap.vue.d.ts +21 -0
  512. package/lib/components/focus-trap/src/focus-trap.vue_vue_type_script_lang.js +141 -0
  513. package/lib/components/focus-trap/src/focus-trap.vue_vue_type_script_lang.js.map +1 -0
  514. package/lib/components/focus-trap/src/focus-trap.vue_vue_type_template_id_4a8a10c5_lang.js +12 -0
  515. package/lib/components/focus-trap/src/focus-trap.vue_vue_type_template_id_4a8a10c5_lang.js.map +1 -0
  516. package/lib/components/focus-trap/src/tokens.d.ts +11 -0
  517. package/lib/components/focus-trap/src/tokens.js +21 -0
  518. package/lib/components/focus-trap/src/tokens.js.map +1 -0
  519. package/lib/components/focus-trap/src/utils.d.ts +18 -0
  520. package/lib/components/focus-trap/src/utils.js +102 -0
  521. package/lib/components/focus-trap/src/utils.js.map +1 -0
  522. package/lib/components/image/index.d.ts +2 -2
  523. package/lib/components/image/src/image.vue.d.ts +2 -2
  524. package/lib/components/index.js +93 -85
  525. package/lib/components/index.js.map +1 -1
  526. package/lib/components/input/index.d.ts +5 -5
  527. package/lib/components/input/src/input.vue.d.ts +5 -5
  528. package/lib/components/input-number/index.d.ts +12 -12
  529. package/lib/components/input-number/src/input-number.vue.d.ts +12 -12
  530. package/lib/components/menu/index.d.ts +9 -3
  531. package/lib/components/menu/src/menu-item.vue.d.ts +4 -2
  532. package/lib/components/menu/src/menu-item.vue_vue_type_script_lang.js +3 -3
  533. package/lib/components/menu/src/menu-item.vue_vue_type_script_lang.js.map +1 -1
  534. package/lib/components/menu/src/menu.d.ts +1 -1
  535. package/lib/components/menu/src/menu.js +2 -1
  536. package/lib/components/menu/src/menu.js.map +1 -1
  537. package/lib/components/menu/src/sub-menu.js +18 -21
  538. package/lib/components/menu/src/sub-menu.js.map +1 -1
  539. package/lib/components/menu/src/types.d.ts +2 -0
  540. package/lib/components/message-box/src/index.vue.d.ts +2 -2
  541. package/lib/components/pagination/index.d.ts +2 -2
  542. package/lib/components/pagination/src/pagination.d.ts +2 -2
  543. package/lib/components/popconfirm/index.d.ts +19 -12
  544. package/lib/components/popconfirm/index.js +0 -1
  545. package/lib/components/popconfirm/index.js.map +1 -1
  546. package/lib/components/popconfirm/src/popconfirm.d.ts +3 -5
  547. package/lib/components/popconfirm/src/popconfirm.js +10 -5
  548. package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
  549. package/lib/components/popconfirm/src/popconfirm.vue.d.ts +19 -13
  550. package/lib/components/popconfirm/src/popconfirm.vue_vue_type_script_lang.js +20 -18
  551. package/lib/components/popconfirm/src/popconfirm.vue_vue_type_script_lang.js.map +1 -1
  552. package/lib/components/popconfirm/src/popconfirm.vue_vue_type_template_id_16409d25_lang.js +11 -12
  553. package/lib/components/popconfirm/src/popconfirm.vue_vue_type_template_id_16409d25_lang.js.map +1 -1
  554. package/lib/components/popover/index.d.ts +1690 -420
  555. package/lib/components/popover/src/directive.js +7 -13
  556. package/lib/components/popover/src/directive.js.map +1 -1
  557. package/lib/components/popover/src/index.js +2 -0
  558. package/lib/components/popover/src/index.js.map +1 -1
  559. package/lib/components/popover/src/index.vue.d.ts +846 -213
  560. package/lib/components/popover/src/index.vue_vue_type_script_lang.js +40 -106
  561. package/lib/components/popover/src/index.vue_vue_type_script_lang.js.map +1 -1
  562. package/lib/components/popover/src/index.vue_vue_type_template_id_15486cf0_lang.js +35 -0
  563. package/lib/components/popover/src/index.vue_vue_type_template_id_15486cf0_lang.js.map +1 -0
  564. package/lib/components/popover/src/popover.d.ts +70 -0
  565. package/lib/components/popover/src/popover.js +35 -0
  566. package/lib/components/popover/src/popover.js.map +1 -0
  567. package/lib/components/popper/index.d.ts +7 -3479
  568. package/lib/components/popper/index.js +24 -20
  569. package/lib/components/popper/index.js.map +1 -1
  570. package/lib/components/popper/src/arrow.js +12 -0
  571. package/lib/components/popper/src/arrow.js.map +1 -0
  572. package/lib/components/popper/src/arrow.vue.d.ts +12 -0
  573. package/lib/components/popper/src/arrow.vue_vue_type_script_lang.js +31 -0
  574. package/lib/components/popper/src/arrow.vue_vue_type_script_lang.js.map +1 -0
  575. package/lib/components/popper/src/arrow.vue_vue_type_template_id_8ab40b80_lang.js +17 -0
  576. package/lib/components/popper/src/arrow.vue_vue_type_template_id_8ab40b80_lang.js.map +1 -0
  577. package/lib/components/popper/src/container.d.ts +3 -0
  578. package/lib/components/popper/src/container.js +28 -0
  579. package/lib/components/popper/src/container.js.map +1 -0
  580. package/lib/components/popper/src/content.js +12 -0
  581. package/lib/components/popper/src/content.js.map +1 -0
  582. package/lib/components/popper/src/content.vue.d.ts +299 -0
  583. package/lib/components/popper/src/content.vue_vue_type_script_lang.js +89 -0
  584. package/lib/components/popper/src/content.vue_vue_type_script_lang.js.map +1 -0
  585. package/lib/components/popper/src/content.vue_vue_type_template_id_611b76f0_lang.js +20 -0
  586. package/lib/components/popper/src/content.vue_vue_type_template_id_611b76f0_lang.js.map +1 -0
  587. package/lib/components/popper/src/popper.d.ts +58 -0
  588. package/lib/components/popper/src/popper.js +107 -0
  589. package/lib/components/popper/src/popper.js.map +1 -0
  590. package/lib/components/popper/src/popper.vue.d.ts +3 -0
  591. package/lib/components/popper/src/popper.vue_vue_type_script_lang.js +23 -0
  592. package/lib/components/popper/src/popper.vue_vue_type_script_lang.js.map +1 -0
  593. package/lib/components/popper/src/popper.vue_vue_type_template_id_77a3d185_lang.js +12 -0
  594. package/lib/components/popper/src/popper.vue_vue_type_template_id_77a3d185_lang.js.map +1 -0
  595. package/lib/components/popper/src/popper2.js +12 -0
  596. package/lib/components/popper/src/popper2.js.map +1 -0
  597. package/lib/components/popper/src/tokens.d.ts +14 -0
  598. package/lib/components/popper/src/tokens.js +10 -0
  599. package/lib/components/popper/src/tokens.js.map +1 -0
  600. package/lib/components/popper/src/trigger.js +12 -0
  601. package/lib/components/popper/src/trigger.js.map +1 -0
  602. package/lib/components/popper/src/trigger.vue.d.ts +45 -0
  603. package/lib/components/popper/src/trigger.vue_vue_type_script_lang.js +70 -0
  604. package/lib/components/popper/src/trigger.vue_vue_type_script_lang.js.map +1 -0
  605. package/lib/components/popper/src/trigger.vue_vue_type_template_id_4fb6e0af_lang.js +20 -0
  606. package/lib/components/popper/src/trigger.vue_vue_type_template_id_4fb6e0af_lang.js.map +1 -0
  607. package/lib/components/popper/src/utils.d.ts +55 -0
  608. package/lib/components/popper/src/utils.js +81 -0
  609. package/lib/components/popper/src/utils.js.map +1 -0
  610. package/lib/components/radio/index.js +2 -2
  611. package/lib/components/radio/src/radio-button.js +5 -10
  612. package/lib/components/radio/src/radio-button.js.map +1 -1
  613. package/lib/components/radio/src/radio-button.vue_vue_type_script_lang.js +1 -1
  614. package/lib/components/radio/src/radio-button2.js +10 -5
  615. package/lib/components/radio/src/radio-button2.js.map +1 -1
  616. package/lib/components/roving-focus-group/index.d.ts +7 -0
  617. package/lib/components/roving-focus-group/index.js +25 -0
  618. package/lib/components/roving-focus-group/index.js.map +1 -0
  619. package/lib/components/roving-focus-group/src/roving-focus-group-impl.js +12 -0
  620. package/lib/components/roving-focus-group/src/roving-focus-group-impl.js.map +1 -0
  621. package/lib/components/roving-focus-group/src/roving-focus-group-impl.vue.d.ts +43 -0
  622. package/lib/components/roving-focus-group/src/roving-focus-group-impl.vue_vue_type_script_lang.js +106 -0
  623. package/lib/components/roving-focus-group/src/roving-focus-group-impl.vue_vue_type_script_lang.js.map +1 -0
  624. package/lib/components/roving-focus-group/src/roving-focus-group-impl.vue_vue_type_template_id_e5cee750_lang.js +12 -0
  625. package/lib/components/roving-focus-group/src/roving-focus-group-impl.vue_vue_type_template_id_e5cee750_lang.js.map +1 -0
  626. package/lib/components/roving-focus-group/src/roving-focus-group.d.ts +269 -0
  627. package/lib/components/roving-focus-group/src/roving-focus-group.js +40 -0
  628. package/lib/components/roving-focus-group/src/roving-focus-group.js.map +1 -0
  629. package/lib/components/roving-focus-group/src/roving-focus-group.vue.d.ts +2 -0
  630. package/lib/components/roving-focus-group/src/roving-focus-group.vue_vue_type_script_lang.js +19 -0
  631. package/lib/components/roving-focus-group/src/roving-focus-group.vue_vue_type_script_lang.js.map +1 -0
  632. package/lib/components/roving-focus-group/src/roving-focus-group.vue_vue_type_template_id_91b51b76_lang.js +24 -0
  633. package/lib/components/roving-focus-group/src/roving-focus-group.vue_vue_type_template_id_91b51b76_lang.js.map +1 -0
  634. package/lib/components/roving-focus-group/src/roving-focus-group2.js +12 -0
  635. package/lib/components/roving-focus-group/src/roving-focus-group2.js.map +1 -0
  636. package/lib/components/roving-focus-group/src/roving-focus-item.js +12 -0
  637. package/lib/components/roving-focus-group/src/roving-focus-item.js.map +1 -0
  638. package/lib/components/roving-focus-group/src/roving-focus-item.vue.d.ts +29 -0
  639. package/lib/components/roving-focus-group/src/roving-focus-item.vue_vue_type_script_lang.js +104 -0
  640. package/lib/components/roving-focus-group/src/roving-focus-item.vue_vue_type_script_lang.js.map +1 -0
  641. package/lib/components/roving-focus-group/src/roving-focus-item.vue_vue_type_template_id_5f657dbd_lang.js +22 -0
  642. package/lib/components/roving-focus-group/src/roving-focus-item.vue_vue_type_template_id_5f657dbd_lang.js.map +1 -0
  643. package/lib/components/roving-focus-group/src/tokens.d.ts +27 -0
  644. package/lib/components/roving-focus-group/src/tokens.js +10 -0
  645. package/lib/components/roving-focus-group/src/tokens.js.map +1 -0
  646. package/lib/components/roving-focus-group/src/utils.d.ts +8 -0
  647. package/lib/components/roving-focus-group/src/utils.js +54 -0
  648. package/lib/components/roving-focus-group/src/utils.js.map +1 -0
  649. package/lib/components/select/index.d.ts +680 -14
  650. package/lib/components/select/src/select-dropdown.vue.d.ts +1 -1
  651. package/lib/components/select/src/select-dropdown.vue_vue_type_script_lang.js +1 -0
  652. package/lib/components/select/src/select-dropdown.vue_vue_type_script_lang.js.map +1 -1
  653. package/lib/components/select/src/select-dropdown.vue_vue_type_template_id_46cf6eee_lang.js.map +1 -1
  654. package/lib/components/select/src/select.vue.d.ts +681 -15
  655. package/lib/components/select/src/select.vue_vue_type_script_lang.js +24 -10
  656. package/lib/components/select/src/select.vue_vue_type_script_lang.js.map +1 -1
  657. package/lib/components/select/src/select.vue_vue_type_template_id_33774f85_lang.js +11 -12
  658. package/lib/components/select/src/select.vue_vue_type_template_id_33774f85_lang.js.map +1 -1
  659. package/lib/components/select/src/token.d.ts +1 -0
  660. package/lib/components/select/src/token.js.map +1 -1
  661. package/lib/components/select/src/useSelect.d.ts +671 -7
  662. package/lib/components/select/src/useSelect.js +33 -23
  663. package/lib/components/select/src/useSelect.js.map +1 -1
  664. package/lib/components/select-v2/index.d.ts +1326 -16
  665. package/lib/components/select-v2/src/select.vue.d.ts +665 -10
  666. package/lib/components/select-v2/src/select.vue_vue_type_script_lang.js +2 -2
  667. package/lib/components/select-v2/src/select.vue_vue_type_script_lang.js.map +1 -1
  668. package/lib/components/select-v2/src/select.vue_vue_type_template_id_13e598a4_lang.js +8 -9
  669. package/lib/components/select-v2/src/select.vue_vue_type_template_id_13e598a4_lang.js.map +1 -1
  670. package/lib/components/select-v2/src/useSelect.d.ts +659 -4
  671. package/lib/components/select-v2/src/useSelect.js +11 -11
  672. package/lib/components/select-v2/src/useSelect.js.map +1 -1
  673. package/lib/components/slider/src/button.vue_vue_type_script_lang.js +1 -1
  674. package/lib/components/slider/src/button.vue_vue_type_script_lang.js.map +1 -1
  675. package/lib/components/slot/index.d.ts +5 -0
  676. package/lib/components/slot/index.js +10 -0
  677. package/lib/components/{popper/src/renderers → slot}/index.js.map +1 -1
  678. package/lib/components/slot/src/only-child.d.ts +5 -0
  679. package/lib/components/slot/src/only-child.js +65 -0
  680. package/lib/components/slot/src/only-child.js.map +1 -0
  681. package/lib/components/table/index.d.ts +4 -4
  682. package/lib/components/table/src/filter-panel.vue.d.ts +654 -4
  683. package/lib/components/table/src/filter-panel.vue_vue_type_script_lang.js +5 -7
  684. package/lib/components/table/src/filter-panel.vue_vue_type_script_lang.js.map +1 -1
  685. package/lib/components/table/src/filter-panel.vue_vue_type_template_id_fde1c940_lang.js +8 -9
  686. package/lib/components/table/src/filter-panel.vue_vue_type_template_id_fde1c940_lang.js.map +1 -1
  687. package/lib/components/table/src/table-column/index.d.ts +1 -1
  688. package/lib/components/table/src/table.vue.d.ts +2 -2
  689. package/lib/components/table/src/util.d.ts +2 -2
  690. package/lib/components/teleport/index.d.ts +11 -8
  691. package/lib/components/teleport/src/teleport.d.ts +4 -3
  692. package/lib/components/teleport/src/teleport.js +5 -1
  693. package/lib/components/teleport/src/teleport.js.map +1 -1
  694. package/lib/components/teleport/src/teleport.vue.d.ts +11 -8
  695. package/lib/components/teleport/src/teleport.vue_vue_type_script_lang.js +1 -2
  696. package/lib/components/teleport/src/teleport.vue_vue_type_script_lang.js.map +1 -1
  697. package/lib/components/teleport/src/teleport.vue_vue_type_template_id_787c6a36_lang.js +3 -2
  698. package/lib/components/teleport/src/teleport.vue_vue_type_template_id_787c6a36_lang.js.map +1 -1
  699. package/lib/components/time-picker/index.d.ts +4 -4
  700. package/lib/components/time-picker/src/common/picker.vue.d.ts +663 -9
  701. package/lib/components/time-picker/src/common/picker.vue_vue_type_script_lang.js +33 -21
  702. package/lib/components/time-picker/src/common/picker.vue_vue_type_script_lang.js.map +1 -1
  703. package/lib/components/time-picker/src/common/picker.vue_vue_type_template_id_1d54be91_lang.js +37 -37
  704. package/lib/components/time-picker/src/common/picker.vue_vue_type_template_id_1d54be91_lang.js.map +1 -1
  705. package/lib/components/time-picker/src/time-picker.d.ts +2 -2
  706. package/lib/components/time-select/index.d.ts +4 -4
  707. package/lib/components/time-select/src/time-select.vue.d.ts +2 -2
  708. package/lib/components/tooltip/index.d.ts +346 -430
  709. package/lib/components/tooltip/index.js +9 -7
  710. package/lib/components/tooltip/index.js.map +1 -1
  711. package/lib/components/tooltip/src/content.js +12 -0
  712. package/lib/components/tooltip/src/content.js.map +1 -0
  713. package/lib/components/tooltip/src/content.vue.d.ts +809 -0
  714. package/lib/components/tooltip/src/content.vue_vue_type_script_lang.js +139 -0
  715. package/lib/components/tooltip/src/content.vue_vue_type_script_lang.js.map +1 -0
  716. package/lib/components/tooltip/src/content.vue_vue_type_template_id_20254f8d_lang.js +69 -0
  717. package/lib/components/tooltip/src/content.vue_vue_type_template_id_20254f8d_lang.js.map +1 -0
  718. package/lib/components/tooltip/src/tokens.d.ts +14 -0
  719. package/lib/components/tooltip/src/tokens.js +8 -0
  720. package/lib/components/tooltip/src/tokens.js.map +1 -0
  721. package/lib/components/tooltip/src/tooltip.d.ts +146 -0
  722. package/lib/components/tooltip/src/tooltip.js +69 -0
  723. package/lib/components/tooltip/src/tooltip.js.map +1 -0
  724. package/lib/components/tooltip/src/tooltip.vue.d.ts +383 -0
  725. package/lib/components/tooltip/src/tooltip.vue_vue_type_script_lang.js +108 -0
  726. package/lib/components/tooltip/src/tooltip.vue_vue_type_script_lang.js.map +1 -0
  727. package/lib/components/tooltip/src/tooltip.vue_vue_type_template_id_694d1617_lang.js +71 -0
  728. package/lib/components/tooltip/src/tooltip.vue_vue_type_template_id_694d1617_lang.js.map +1 -0
  729. package/lib/components/tooltip/src/tooltip2.js +12 -0
  730. package/lib/components/tooltip/src/tooltip2.js.map +1 -0
  731. package/lib/components/tooltip/src/trigger.js +12 -0
  732. package/lib/components/tooltip/src/trigger.js.map +1 -0
  733. package/lib/components/tooltip/src/trigger.vue.d.ts +39 -0
  734. package/lib/components/tooltip/src/trigger.vue_vue_type_script_lang.js +64 -0
  735. package/lib/components/tooltip/src/trigger.vue_vue_type_script_lang.js.map +1 -0
  736. package/lib/components/tooltip/src/trigger.vue_vue_type_template_id_0ec0b94c_lang.js +31 -0
  737. package/lib/components/tooltip/src/trigger.vue_vue_type_template_id_0ec0b94c_lang.js.map +1 -0
  738. package/lib/components/tooltip/src/utils.d.ts +4 -0
  739. package/lib/components/tooltip/src/utils.js +23 -0
  740. package/lib/components/tooltip/src/utils.js.map +1 -0
  741. package/lib/components/tree/index.d.ts +4 -4
  742. package/lib/components/tree/src/model/tree-store.js +1 -1
  743. package/lib/components/tree/src/model/tree-store.js.map +1 -1
  744. package/lib/components/tree/src/tree.vue.d.ts +2 -2
  745. package/lib/components/tree-v2/src/tree-node.vue.d.ts +1 -1
  746. package/lib/components/virtual-list/src/builders/build-list.d.ts +1 -1
  747. package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +1 -1
  748. package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +1 -1
  749. package/lib/components/visual-hidden/index.d.ts +3 -0
  750. package/lib/components/visual-hidden/index.js +12 -0
  751. package/lib/components/visual-hidden/index.js.map +1 -0
  752. package/lib/components/visual-hidden/src/visual-hidden.js +12 -0
  753. package/lib/components/visual-hidden/src/visual-hidden.js.map +1 -0
  754. package/lib/components/visual-hidden/src/visual-hidden.vue.d.ts +12 -0
  755. package/lib/components/visual-hidden/src/visual-hidden.vue_vue_type_script_lang.js +38 -0
  756. package/lib/components/visual-hidden/src/visual-hidden.vue_vue_type_script_lang.js.map +1 -0
  757. package/lib/components/visual-hidden/src/visual-hidden.vue_vue_type_template_id_4cbd1102_lang.js +12 -0
  758. package/lib/components/visual-hidden/src/visual-hidden.vue_vue_type_template_id_4cbd1102_lang.js.map +1 -0
  759. package/lib/defaults.d.ts +11 -1
  760. package/lib/directives/click-outside/index.js.map +1 -1
  761. package/lib/hooks/index.d.ts +8 -1
  762. package/lib/hooks/index.js +37 -20
  763. package/lib/hooks/index.js.map +1 -1
  764. package/lib/hooks/use-delayed-toggle/index.d.ts +13 -0
  765. package/lib/hooks/use-delayed-toggle/index.js +44 -0
  766. package/lib/hooks/use-delayed-toggle/index.js.map +1 -0
  767. package/lib/hooks/use-escape-keydown/index.d.ts +1 -0
  768. package/lib/hooks/use-escape-keydown/index.js +25 -0
  769. package/lib/hooks/use-escape-keydown/index.js.map +1 -0
  770. package/lib/hooks/use-focus/index.d.ts +3 -1
  771. package/lib/hooks/use-focus/index.js.map +1 -1
  772. package/lib/hooks/use-forward-ref/index.d.ts +13 -0
  773. package/lib/hooks/use-forward-ref/index.js +33 -0
  774. package/lib/hooks/use-forward-ref/index.js.map +1 -0
  775. package/lib/hooks/use-global-config/index.d.ts +14 -2
  776. package/lib/hooks/use-global-config/index.js +24 -3
  777. package/lib/hooks/use-global-config/index.js.map +1 -1
  778. package/lib/hooks/use-id/index.d.ts +8 -0
  779. package/lib/hooks/use-id/index.js +29 -0
  780. package/lib/hooks/use-id/index.js.map +1 -0
  781. package/lib/hooks/use-intermediate-render/index.d.ts +11 -0
  782. package/lib/hooks/use-intermediate-render/index.js +47 -0
  783. package/lib/hooks/use-intermediate-render/index.js.map +1 -0
  784. package/lib/hooks/use-model-toggle/index.d.ts +18 -9
  785. package/lib/hooks/use-model-toggle/index.js +102 -91
  786. package/lib/hooks/use-model-toggle/index.js.map +1 -1
  787. package/lib/hooks/use-popper-container/index.d.ts +3 -0
  788. package/lib/hooks/use-popper-container/index.js +28 -0
  789. package/lib/hooks/use-popper-container/index.js.map +1 -0
  790. package/lib/hooks/use-restore-active/index.js +1 -1
  791. package/lib/hooks/use-restore-active/index.js.map +1 -1
  792. package/lib/index.d.ts +11 -1
  793. package/lib/index.js +168 -143
  794. package/lib/index.js.map +1 -1
  795. package/lib/make-installer.d.ts +2 -1
  796. package/lib/make-installer.js +12 -1
  797. package/lib/make-installer.js.map +1 -1
  798. package/lib/tokens/config-provider.d.ts +2 -2
  799. package/lib/tokens/config-provider.js.map +1 -1
  800. package/lib/utils/aria.d.ts +4 -0
  801. package/lib/utils/aria.js +5 -1
  802. package/lib/utils/aria.js.map +1 -1
  803. package/lib/utils/dom.d.ts +9 -1
  804. package/lib/utils/dom.js +30 -0
  805. package/lib/utils/dom.js.map +1 -1
  806. package/lib/utils/isServer.d.ts +2 -0
  807. package/lib/utils/isServer.js +8 -0
  808. package/lib/utils/isServer.js.map +1 -0
  809. package/lib/utils/props.d.ts +2 -2
  810. package/lib/utils/props.js +1 -1
  811. package/lib/utils/props.js.map +1 -1
  812. package/lib/utils/util.d.ts +1 -0
  813. package/lib/utils/util.js +12 -0
  814. package/lib/utils/util.js.map +1 -1
  815. package/lib/version.d.ts +1 -1
  816. package/lib/version.js +1 -1
  817. package/lib/version.js.map +1 -1
  818. package/package.json +2 -2
  819. package/tags.json +1 -1
  820. package/theme-chalk/base.css +1 -1
  821. package/theme-chalk/el-collapse.css +1 -1
  822. package/theme-chalk/el-date-picker.css +1 -1
  823. package/theme-chalk/el-dropdown.css +1 -1
  824. package/theme-chalk/el-menu.css +1 -1
  825. package/theme-chalk/el-table-column.css +1 -1
  826. package/theme-chalk/el-time-picker.css +1 -1
  827. package/theme-chalk/el-time-select.css +1 -1
  828. package/theme-chalk/el-tree.css +1 -1
  829. package/theme-chalk/index.css +1 -1
  830. package/theme-chalk/src/common/transition.scss +8 -0
  831. package/theme-chalk/src/dropdown.scss +1 -2
  832. package/theme-chalk/src/table-column.scss +0 -1
  833. package/web-types.json +1 -1
  834. package/es/components/popover/src/usePopover.d.ts +0 -32
  835. package/es/components/popover/src/usePopover.mjs +0 -38
  836. package/es/components/popover/src/usePopover.mjs.map +0 -1
  837. package/es/components/popper/src/index.mjs +0 -5
  838. package/es/components/popper/src/index.vue.d.ts +0 -1737
  839. package/es/components/popper/src/index.vue_vue_type_script_lang.mjs +0 -103
  840. package/es/components/popper/src/index.vue_vue_type_script_lang.mjs.map +0 -1
  841. package/es/components/popper/src/renderers/arrow.d.ts +0 -3
  842. package/es/components/popper/src/renderers/arrow.mjs +0 -12
  843. package/es/components/popper/src/renderers/arrow.mjs.map +0 -1
  844. package/es/components/popper/src/renderers/index.d.ts +0 -3
  845. package/es/components/popper/src/renderers/index.mjs +0 -4
  846. package/es/components/popper/src/renderers/popper.d.ts +0 -23
  847. package/es/components/popper/src/renderers/popper.mjs +0 -51
  848. package/es/components/popper/src/renderers/popper.mjs.map +0 -1
  849. package/es/components/popper/src/renderers/trigger.d.ts +0 -13
  850. package/es/components/popper/src/renderers/trigger.mjs +0 -13
  851. package/es/components/popper/src/renderers/trigger.mjs.map +0 -1
  852. package/es/components/popper/src/use-popper/build-modifiers.d.ts +0 -10
  853. package/es/components/popper/src/use-popper/build-modifiers.mjs +0 -50
  854. package/es/components/popper/src/use-popper/build-modifiers.mjs.map +0 -1
  855. package/es/components/popper/src/use-popper/defaults.d.ts +0 -142
  856. package/es/components/popper/src/use-popper/defaults.mjs +0 -116
  857. package/es/components/popper/src/use-popper/defaults.mjs.map +0 -1
  858. package/es/components/popper/src/use-popper/index.d.ts +0 -1554
  859. package/es/components/popper/src/use-popper/index.mjs +0 -235
  860. package/es/components/popper/src/use-popper/index.mjs.map +0 -1
  861. package/es/components/popper/src/use-popper/popper-options.d.ts +0 -20
  862. package/es/components/popper/src/use-popper/popper-options.mjs +0 -22
  863. package/es/components/popper/src/use-popper/popper-options.mjs.map +0 -1
  864. package/es/components/tooltip/src/index.d.ts +0 -240
  865. package/es/components/tooltip/src/index.mjs +0 -101
  866. package/es/components/tooltip/src/index.mjs.map +0 -1
  867. package/es/hooks/use-popper/index.d.ts +0 -103
  868. package/es/hooks/use-popper/index.mjs +0 -256
  869. package/es/hooks/use-popper/index.mjs.map +0 -1
  870. package/es/hooks/use-popper/use-popper-options.d.ts +0 -49
  871. package/es/hooks/use-popper/use-popper-options.mjs +0 -47
  872. package/es/hooks/use-popper/use-popper-options.mjs.map +0 -1
  873. package/es/hooks/use-popper/use-target-events.d.ts +0 -13
  874. package/es/hooks/use-popper/use-target-events.mjs +0 -68
  875. package/es/hooks/use-popper/use-target-events.mjs.map +0 -1
  876. package/lib/components/popover/src/usePopover.d.ts +0 -32
  877. package/lib/components/popover/src/usePopover.js +0 -44
  878. package/lib/components/popover/src/usePopover.js.map +0 -1
  879. package/lib/components/popper/src/index.js +0 -10
  880. package/lib/components/popper/src/index.vue.d.ts +0 -1737
  881. package/lib/components/popper/src/index.vue_vue_type_script_lang.js +0 -107
  882. package/lib/components/popper/src/index.vue_vue_type_script_lang.js.map +0 -1
  883. package/lib/components/popper/src/renderers/arrow.d.ts +0 -3
  884. package/lib/components/popper/src/renderers/arrow.js +0 -16
  885. package/lib/components/popper/src/renderers/arrow.js.map +0 -1
  886. package/lib/components/popper/src/renderers/index.d.ts +0 -3
  887. package/lib/components/popper/src/renderers/index.js +0 -14
  888. package/lib/components/popper/src/renderers/popper.d.ts +0 -23
  889. package/lib/components/popper/src/renderers/popper.js +0 -55
  890. package/lib/components/popper/src/renderers/popper.js.map +0 -1
  891. package/lib/components/popper/src/renderers/trigger.d.ts +0 -13
  892. package/lib/components/popper/src/renderers/trigger.js +0 -17
  893. package/lib/components/popper/src/renderers/trigger.js.map +0 -1
  894. package/lib/components/popper/src/use-popper/build-modifiers.d.ts +0 -10
  895. package/lib/components/popper/src/use-popper/build-modifiers.js +0 -54
  896. package/lib/components/popper/src/use-popper/build-modifiers.js.map +0 -1
  897. package/lib/components/popper/src/use-popper/defaults.d.ts +0 -142
  898. package/lib/components/popper/src/use-popper/defaults.js +0 -121
  899. package/lib/components/popper/src/use-popper/defaults.js.map +0 -1
  900. package/lib/components/popper/src/use-popper/index.d.ts +0 -1554
  901. package/lib/components/popper/src/use-popper/index.js +0 -242
  902. package/lib/components/popper/src/use-popper/index.js.map +0 -1
  903. package/lib/components/popper/src/use-popper/popper-options.d.ts +0 -20
  904. package/lib/components/popper/src/use-popper/popper-options.js +0 -26
  905. package/lib/components/popper/src/use-popper/popper-options.js.map +0 -1
  906. package/lib/components/tooltip/src/index.d.ts +0 -240
  907. package/lib/components/tooltip/src/index.js +0 -105
  908. package/lib/components/tooltip/src/index.js.map +0 -1
  909. package/lib/hooks/use-popper/index.d.ts +0 -103
  910. package/lib/hooks/use-popper/index.js +0 -264
  911. package/lib/hooks/use-popper/index.js.map +0 -1
  912. package/lib/hooks/use-popper/use-popper-options.d.ts +0 -49
  913. package/lib/hooks/use-popper/use-popper-options.js +0 -53
  914. package/lib/hooks/use-popper/use-popper-options.js.map +0 -1
  915. package/lib/hooks/use-popper/use-target-events.d.ts +0 -13
  916. package/lib/hooks/use-popper/use-target-events.js +0 -73
  917. package/lib/hooks/use-popper/use-target-events.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-model-toggle/index.ts"],"sourcesContent":["import { computed, getCurrentInstance, watch, onMounted } from 'vue'\nimport { isFunction } from '@vue/shared'\nimport { isClient } from '@vueuse/core'\nimport { isBool } from '@element-plus/utils/util'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/utils/constants'\nimport { buildProps, definePropType } from '@element-plus/utils/props'\nimport type { RouteLocationNormalizedLoaded } from 'vue-router'\n\nimport type { Ref, ComponentPublicInstance, ExtractPropTypes } from 'vue'\n\nexport const useModelToggleProps = buildProps({\n modelValue: {\n type: definePropType<boolean | null>(Boolean),\n default: null,\n },\n 'onUpdate:modelValue': Function,\n})\nexport type UseModelToggleProps = ExtractPropTypes<typeof useModelToggleProps>\n\nexport const useModelToggleEmits = [UPDATE_MODEL_EVENT]\n\nexport type ModelToggleParams = {\n indicator: Ref<boolean>\n shouldHideWhenRouteChanges?: Ref<boolean>\n shouldProceed?: () => boolean\n onShow?: () => void\n onHide?: () => void\n}\n\nexport const useModelToggle = ({\n indicator,\n shouldHideWhenRouteChanges,\n shouldProceed,\n onShow,\n onHide,\n}: ModelToggleParams) => {\n const instance = getCurrentInstance()!\n const props = instance.props as UseModelToggleProps & { disabled: boolean }\n const { emit } = instance\n\n const hasUpdateHandler = computed(() =>\n isFunction(props['onUpdate:modelValue'])\n )\n // when it matches the default value we say this is absent\n // though this could be mistakenly passed from the user but we need to rule out that\n // condition\n const isModelBindingAbsent = computed(() => props.modelValue === null)\n\n const doShow = () => {\n if (indicator.value === true) {\n return\n }\n\n indicator.value = true\n if (isFunction(onShow)) {\n onShow()\n }\n }\n\n const doHide = () => {\n if (indicator.value === false) {\n return\n }\n\n indicator.value = false\n\n if (isFunction(onHide)) {\n onHide()\n }\n }\n\n const show = () => {\n if (\n props.disabled === true ||\n (isFunction(shouldProceed) && !shouldProceed())\n )\n return\n\n const shouldEmit = hasUpdateHandler.value && isClient\n\n if (shouldEmit) {\n emit(UPDATE_MODEL_EVENT, true)\n }\n\n if (isModelBindingAbsent.value || !shouldEmit) {\n doShow()\n }\n }\n\n const hide = () => {\n if (props.disabled === true || !isClient) return\n\n const shouldEmit = hasUpdateHandler.value && isClient\n\n if (shouldEmit) {\n emit(UPDATE_MODEL_EVENT, false)\n }\n\n if (isModelBindingAbsent.value || !shouldEmit) {\n doHide()\n }\n }\n\n const onChange = (val: boolean) => {\n if (!isBool(val)) return\n if (props.disabled && val) {\n if (hasUpdateHandler.value) {\n emit(UPDATE_MODEL_EVENT, false)\n }\n } else if (indicator.value !== val) {\n if (val) {\n doShow()\n } else {\n doHide()\n }\n }\n }\n\n const toggle = () => {\n if (indicator.value) {\n hide()\n } else {\n show()\n }\n }\n\n watch(() => props.modelValue, onChange as any)\n\n if (\n shouldHideWhenRouteChanges &&\n instance.appContext.config.globalProperties.$route !== undefined\n ) {\n watch(\n () => ({\n ...(\n instance.proxy as ComponentPublicInstance<{\n $route: RouteLocationNormalizedLoaded\n }>\n ).$route,\n }),\n () => {\n if (shouldHideWhenRouteChanges.value && indicator.value) {\n hide()\n }\n }\n )\n }\n\n onMounted(() => {\n onChange(props.modelValue as boolean)\n })\n\n return {\n hide,\n show,\n toggle,\n }\n}\n"],"names":[],"mappings":";;;;;;;AAMY,MAAC,mBAAmB,GAAG,UAAU,CAAC;AAC9C,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC;AACjC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,qBAAqB,EAAE,QAAQ;AACjC,CAAC,EAAE;AACS,MAAC,mBAAmB,GAAG,CAAC,kBAAkB,EAAE;AAC5C,MAAC,cAAc,GAAG,CAAC;AAC/B,EAAE,SAAS;AACX,EAAE,0BAA0B;AAC5B,EAAE,aAAa;AACf,EAAE,MAAM;AACR,EAAE,MAAM;AACR,CAAC,KAAK;AACN,EAAE,MAAM,QAAQ,GAAG,kBAAkB,EAAE,CAAC;AACxC,EAAE,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;AAC/B,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;AAC5B,EAAE,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,UAAU,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;AACpF,EAAE,MAAM,oBAAoB,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC;AACzE,EAAE,MAAM,MAAM,GAAG,MAAM;AACvB,IAAI,IAAI,SAAS,CAAC,KAAK,KAAK,IAAI,EAAE;AAClC,MAAM,OAAO;AACb,KAAK;AACL,IAAI,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC;AAC3B,IAAI,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE;AAC5B,MAAM,MAAM,EAAE,CAAC;AACf,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,MAAM,MAAM,GA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../packages/hooks/use-model-toggle/index.ts"],"sourcesContent":["import { computed, getCurrentInstance, watch, onMounted } from 'vue'\nimport { isFunction } from '@vue/shared'\nimport { isClient } from '@vueuse/core'\nimport { isBool } from '@element-plus/utils/util'\nimport { buildProp, definePropType } from '@element-plus/utils/props'\nimport type { RouteLocationNormalizedLoaded } from 'vue-router'\n\nimport type { Ref, ComponentPublicInstance, ExtractPropTypes } from 'vue'\n\nexport const createModelToggleComposable = (name: string) => {\n const useModelToggleProps = {\n [name]: buildProp({\n type: definePropType<boolean | null>(Boolean),\n default: null,\n } as const),\n [`onUpdate:${name}`]: buildProp({\n type: definePropType<(val: boolean) => void>(Function),\n } as const),\n }\n\n const useModelToggleEmits = [`update:${name}`]\n\n const useModelToggle = ({\n indicator,\n shouldHideWhenRouteChanges,\n shouldProceed,\n onShow,\n onHide,\n }: ModelToggleParams) => {\n const instance = getCurrentInstance()!\n const props = instance.props as UseModelToggleProps & { disabled: boolean }\n const { emit } = instance\n\n const updateEventKey = `update:${name}`\n\n const hasUpdateHandler = computed(() =>\n isFunction(props[`onUpdate:${name}`])\n )\n // when it matches the default value we say this is absent\n // though this could be mistakenly passed from the user but we need to rule out that\n // condition\n const isModelBindingAbsent = computed(() => props[name] === null)\n\n const doShow = () => {\n if (indicator.value === true) {\n return\n }\n\n indicator.value = true\n if (isFunction(onShow)) {\n onShow()\n }\n }\n\n const doHide = () => {\n if (indicator.value === false) {\n return\n }\n\n indicator.value = false\n\n if (isFunction(onHide)) {\n onHide()\n }\n }\n\n const show = () => {\n if (\n props.disabled === true ||\n (isFunction(shouldProceed) && !shouldProceed())\n )\n return\n\n const shouldEmit = hasUpdateHandler.value && isClient\n\n if (shouldEmit) {\n emit(updateEventKey, true)\n }\n\n if (isModelBindingAbsent.value || !shouldEmit) {\n doShow()\n }\n }\n\n const hide = () => {\n if (props.disabled === true || !isClient) return\n\n const shouldEmit = hasUpdateHandler.value && isClient\n\n if (shouldEmit) {\n emit(updateEventKey, false)\n }\n\n if (isModelBindingAbsent.value || !shouldEmit) {\n doHide()\n }\n }\n\n const onChange = (val: boolean) => {\n if (!isBool(val)) return\n if (props.disabled && val) {\n if (hasUpdateHandler.value) {\n emit(updateEventKey, false)\n }\n } else if (indicator.value !== val) {\n if (val) {\n doShow()\n } else {\n doHide()\n }\n }\n }\n\n const toggle = () => {\n if (indicator.value) {\n hide()\n } else {\n show()\n }\n }\n\n watch(() => props[name], onChange as any)\n\n if (\n shouldHideWhenRouteChanges &&\n instance.appContext.config.globalProperties.$route !== undefined\n ) {\n watch(\n () => ({\n ...(\n instance.proxy as ComponentPublicInstance<{\n $route: RouteLocationNormalizedLoaded\n }>\n ).$route,\n }),\n () => {\n if (shouldHideWhenRouteChanges.value && indicator.value) {\n hide()\n }\n }\n )\n }\n\n onMounted(() => {\n onChange(props[name] as boolean)\n })\n\n return {\n hide,\n show,\n toggle,\n }\n }\n\n return {\n useModelToggle,\n useModelToggleProps,\n useModelToggleEmits,\n }\n}\n\nconst { useModelToggle, useModelToggleProps, useModelToggleEmits } =\n createModelToggleComposable('modelValue')\n\nexport { useModelToggle, useModelToggleEmits, useModelToggleProps }\n\nexport type UseModelToggleProps = ExtractPropTypes<typeof useModelToggleProps>\n\nexport type ModelToggleParams = {\n indicator: Ref<boolean>\n shouldHideWhenRouteChanges?: Ref<boolean>\n shouldProceed?: () => boolean\n onShow?: () => void\n onHide?: () => void\n}\n"],"names":[],"mappings":";;;;;;AAKY,MAAC,2BAA2B,GAAG,CAAC,IAAI,KAAK;AACrD,EAAE,MAAM,oBAAoB,GAAG;AAC/B,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;AACtB,MAAM,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC;AACnC,MAAM,OAAO,EAAE,IAAI;AACnB,KAAK,CAAC;AACN,IAAI,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC;AACpC,MAAM,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AACpC,KA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AG,2BAA2B,CAAC,YAAY;;;;"}
@@ -0,0 +1,3 @@
1
+ export declare const POPPER_CONTAINER_ID: string;
2
+ export declare const POPPER_CONTAINER_SELECTOR: string;
3
+ export declare const usePopperContainer: () => void;
@@ -0,0 +1,22 @@
1
+ import { onBeforeMount } from 'vue';
2
+ import { generateId } from '../../utils/util.mjs';
3
+ import isServer from '../../utils/isServer.mjs';
4
+
5
+ let cachedContainer;
6
+ const POPPER_CONTAINER_ID = `el-popper-container-${generateId()}`;
7
+ const POPPER_CONTAINER_SELECTOR = `#${POPPER_CONTAINER_ID}`;
8
+ const usePopperContainer = () => {
9
+ onBeforeMount(() => {
10
+ if (isServer)
11
+ return;
12
+ if (process.env.NODE_ENV === "test" || !cachedContainer) {
13
+ const container = document.createElement("div");
14
+ container.id = POPPER_CONTAINER_ID;
15
+ document.body.appendChild(container);
16
+ cachedContainer = container;
17
+ }
18
+ });
19
+ };
20
+
21
+ export { POPPER_CONTAINER_ID, POPPER_CONTAINER_SELECTOR, usePopperContainer };
22
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-popper-container/index.ts"],"sourcesContent":["import { onBeforeMount } from 'vue'\nimport { generateId } from '@element-plus/utils/util'\nimport isServer from '@element-plus/utils/isServer'\n\nlet cachedContainer: HTMLElement\n\nexport const POPPER_CONTAINER_ID = `el-popper-container-${generateId()}`\n\nexport const POPPER_CONTAINER_SELECTOR = `#${POPPER_CONTAINER_ID}`\n\nexport const usePopperContainer = () => {\n onBeforeMount(() => {\n if (isServer) return\n\n // This is for bypassing the error that when under testing env, we often encounter\n // document.body.innerHTML = '' situation\n // for this we need to disable the caching since it's not really needed\n if (process.env.NODE_ENV === 'test' || !cachedContainer) {\n const container = document.createElement('div')\n container.id = POPPER_CONTAINER_ID\n document.body.appendChild(container)\n cachedContainer = container\n }\n })\n}\n"],"names":[],"mappings":";;;;AAGA,IAAI,eAAe,CAAC;AACR,MAAC,mBAAmB,GAAG,CAAC,oBAAoB,EAAE,UAAU,EAAE,CAAC,EAAE;AAC7D,MAAC,yBAAyB,GAAG,CAAC,CAAC,EAAE,mBAAmB,CAAC,EAAE;AACvD,MAAC,kBAAkB,GAAG,MAAM;AACxC,EAAE,aAAa,CAAC,MAAM;AACtB,IAAI,IAAI,QAAQ;AAChB,MAAM,OAAO;AACb,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,IAAI,CAAC,eAAe,EAAE;AAC7D,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AACtD,MAAM,SAAS,CAAC,EAAE,GAAG,mBAAmB,CAAC;AACzC,MAAM,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;AAC3C,MAAM,eAAe,GAAG,SAAS,CAAC;AAClC,KAAK;AACL,GAAG,CAAC,CAAC;AACL;;;;"}
@@ -10,7 +10,7 @@ const useRestoreActive = (toggle, initialFocus) => {
10
10
  (_b = (_a = initialFocus.value).focus) == null ? void 0 : _b.call(_a);
11
11
  }
12
12
  } else {
13
- if (process.env.NODE_ENV === "testing") {
13
+ if (process.env.NODE_ENV === "test") {
14
14
  previousActive.focus.call(previousActive);
15
15
  } else {
16
16
  previousActive.focus();
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-restore-active/index.ts"],"sourcesContent":["import { isRef, watch } from 'vue'\nimport type { Ref } from 'vue'\n\n/**\n * This method provides dialogable components the ability to restore previously activated element before\n * the dialog gets opened\n */\nexport const useRestoreActive = (\n toggle: Ref<boolean>,\n initialFocus?: Ref<HTMLElement>\n) => {\n let previousActive: HTMLElement\n watch(\n () => toggle.value,\n (val) => {\n if (val) {\n previousActive = document.activeElement as HTMLElement\n if (isRef(initialFocus)) {\n initialFocus.value.focus?.()\n }\n } else {\n if (process.env.NODE_ENV === 'testing') {\n previousActive.focus.call(previousActive)\n } else {\n previousActive.focus()\n }\n }\n }\n )\n}\n"],"names":[],"mappings":";;AACY,MAAC,gBAAgB,GAAG,CAAC,MAAM,EAAE,YAAY,KAAK;AAC1D,EAAE,IAAI,cAAc,CAAC;AACrB,EAAE,KAAK,CAAC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,KAAK;AACrC,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC;AACf,IAAI,IAAI,GAAG,EAAE;AACb,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC;AAC9C,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,EAAE;AAC/B,QAAQ,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,YAAY,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC9E,OAAO;AACP,KAAK,MAAM;AACX,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,EAAE;AAC9C,QAAQ,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAClD,OAAO,MAAM;AACb,QAAQ,cAAc,CAAC,KAAK,EAAE,CAAC;AAC/B,OAAO;AACP,KAAK;AACL,GAAG,CAAC,CAAC;AACL;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-restore-active/index.ts"],"sourcesContent":["import { isRef, watch } from 'vue'\nimport type { Ref } from 'vue'\n\n/**\n * This method provides dialogable components the ability to restore previously activated element before\n * the dialog gets opened\n */\nexport const useRestoreActive = (\n toggle: Ref<boolean>,\n initialFocus?: Ref<HTMLElement>\n) => {\n let previousActive: HTMLElement\n watch(\n () => toggle.value,\n (val) => {\n if (val) {\n previousActive = document.activeElement as HTMLElement\n if (isRef(initialFocus)) {\n initialFocus.value.focus?.()\n }\n } else {\n if (process.env.NODE_ENV === 'test') {\n previousActive.focus.call(previousActive)\n } else {\n previousActive.focus()\n }\n }\n }\n )\n}\n"],"names":[],"mappings":";;AACY,MAAC,gBAAgB,GAAG,CAAC,MAAM,EAAE,YAAY,KAAK;AAC1D,EAAE,IAAI,cAAc,CAAC;AACrB,EAAE,KAAK,CAAC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,KAAK;AACrC,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC;AACf,IAAI,IAAI,GAAG,EAAE;AACb,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC;AAC9C,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,EAAE;AAC/B,QAAQ,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,YAAY,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC9E,OAAO;AACP,KAAK,MAAM;AACX,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE;AAC3C,QAAQ,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAClD,OAAO,MAAM;AACb,QAAQ,cAAc,CAAC,KAAK,EAAE,CAAC;AAC/B,OAAO;AACP,KAAK;AACL,GAAG,CAAC,CAAC;AACL;;;;"}
package/es/index.d.ts CHANGED
@@ -4,6 +4,16 @@ export * from 'element-plus/es/directives';
4
4
  export * from 'element-plus/es/hooks';
5
5
  export * from 'element-plus/es/tokens';
6
6
  export { makeInstaller } from './make-installer';
7
- export declare const install: (app: import("vue").App<any>) => void;
7
+ export declare const install: (app: import("vue").App<any>, options?: {
8
+ readonly size?: unknown;
9
+ readonly button?: unknown;
10
+ readonly zIndex?: unknown;
11
+ readonly locale?: unknown;
12
+ } & {} & {
13
+ button?: import("element-plus/es/components").ButtonConfigContext | undefined;
14
+ size?: import("./utils/props").BuildPropType<StringConstructor, "small" | "default" | "large", unknown> | undefined;
15
+ locale?: import("./locale").Language | undefined;
16
+ zIndex?: number | undefined;
17
+ }) => void;
8
18
  export declare const version: string;
9
19
  export default installer;
package/es/index.mjs CHANGED
@@ -76,19 +76,19 @@ export { pageHeaderEmits, pageHeaderProps } from './components/page-header/src/p
76
76
  export { ElPageHeader } from './components/page-header/index.mjs';
77
77
  export { paginationEmits, paginationProps } from './components/pagination/src/pagination.mjs';
78
78
  export { ElPagination } from './components/pagination/index.mjs';
79
- export { popconfirmEmits, popconfirmProps } from './components/popconfirm/src/popconfirm.mjs';
79
+ export { popconfirmProps } from './components/popconfirm/src/popconfirm.mjs';
80
80
  export { ElPopconfirm } from './components/popconfirm/index.mjs';
81
- export { Effect, default as popperDefaultProps } from './components/popper/src/use-popper/defaults.mjs';
82
- export { default as usePopper } from './components/popper/src/use-popper/index.mjs';
83
- export { default as renderPopper } from './components/popper/src/renderers/popper.mjs';
84
- export { default as renderTrigger } from './components/popper/src/renderers/trigger.mjs';
85
- export { default as renderArrow } from './components/popper/src/renderers/arrow.mjs';
81
+ export { default as ElPopperArrow } from './components/popper/src/arrow.vue_vue_type_script_lang.mjs';
82
+ export { default as ElPopperTrigger } from './components/popper/src/trigger.vue_vue_type_script_lang.mjs';
83
+ export { default as ElPopperContent } from './components/popper/src/content.vue_vue_type_script_lang.mjs';
84
+ export { Effect, usePopperArrowProps, usePopperContentProps, usePopperCoreConfigProps, usePopperProps, usePopperTriggerProps } from './components/popper/src/popper.mjs';
85
+ export { POPPER_CONTENT_INJECTION_KEY, POPPER_INJECTION_KEY } from './components/popper/src/tokens.mjs';
86
86
  export { ElPopper } from './components/popper/index.mjs';
87
87
  export { progressProps } from './components/progress/src/progress.mjs';
88
88
  export { ElProgress } from './components/progress/index.mjs';
89
89
  export { radioEmits, radioProps, radioPropsBase, useRadio } from './components/radio/src/radio.mjs';
90
90
  export { radioGroupEmits, radioGroupProps } from './components/radio/src/radio-group.mjs';
91
- export { radioButtonProps } from './components/radio/src/radio-button.mjs';
91
+ export { radioButtonProps } from './components/radio/src/radio-button2.mjs';
92
92
  export { ElRadio, ElRadioButton, ElRadioGroup } from './components/radio/index.mjs';
93
93
  export { rateEmits, rateProps } from './components/rate/src/rate.mjs';
94
94
  export { ElRate } from './components/rate/index.mjs';
@@ -130,6 +130,7 @@ export { default as TimePickPanel } from './components/time-picker/src/time-pick
130
130
  export { ElTimePicker } from './components/time-picker/index.mjs';
131
131
  export { ElTimeSelect } from './components/time-select/index.mjs';
132
132
  export { ElTimeline, ElTimelineItem } from './components/timeline/index.mjs';
133
+ export { useTooltipContentProps, useTooltipProps, useTooltipTriggerProps } from './components/tooltip/src/tooltip.mjs';
133
134
  export { ElTooltip } from './components/tooltip/index.mjs';
134
135
  export { CHANGE_EVENT } from './utils/constants.mjs';
135
136
  export { ElTransfer } from './components/transfer/index.mjs';
@@ -158,12 +159,11 @@ export { useAttrs } from './hooks/use-attrs/index.mjs';
158
159
  export { useDisabled, useSize, useSizeProp } from './hooks/use-common-props/index.mjs';
159
160
  export { useFocus } from './hooks/use-focus/index.mjs';
160
161
  export { useFormItem } from './hooks/use-form-item/index.mjs';
161
- export { useGlobalConfig } from './hooks/use-global-config/index.mjs';
162
+ export { provideGlobalConfig, useGlobalConfig } from './hooks/use-global-config/index.mjs';
162
163
  export { buildTranslator, localeContextKey, localeProviderMaker, provideLocale, translate, useLocale, useLocaleProps } from './hooks/use-locale/index.mjs';
163
164
  export { useLockscreen } from './hooks/use-lockscreen/index.mjs';
164
165
  export { useModal } from './hooks/use-modal/index.mjs';
165
- export { useModelToggle, useModelToggleEmits, useModelToggleProps } from './hooks/use-model-toggle/index.mjs';
166
- export { DARK_EFFECT, LIGHT_EFFECT, usePopperControlProps, usePopperHook, usePopperProps } from './hooks/use-popper/index.mjs';
166
+ export { createModelToggleComposable, useModelToggle, useModelToggleEmits, useModelToggleProps } from './hooks/use-model-toggle/index.mjs';
167
167
  export { usePreventGlobal } from './hooks/use-prevent-global/index.mjs';
168
168
  export { useProp } from './hooks/use-prop/index.mjs';
169
169
  export { useRestoreActive } from './hooks/use-restore-active/index.mjs';
@@ -171,6 +171,13 @@ export { useSameTarget } from './hooks/use-same-target/index.mjs';
171
171
  export { useTeleport } from './hooks/use-teleport/index.mjs';
172
172
  export { useThrottleRender } from './hooks/use-throttle-render/index.mjs';
173
173
  export { useTimeout } from './hooks/use-timeout/index.mjs';
174
+ export { useTransitionFallthrough, useTransitionFallthroughEmits } from './hooks/use-transition-fallthrough/index.mjs';
175
+ export { ID_INJECTION_KEY, useId } from './hooks/use-id/index.mjs';
176
+ export { useEscapeKeydown } from './hooks/use-escape-keydown/index.mjs';
177
+ export { POPPER_CONTAINER_ID, POPPER_CONTAINER_SELECTOR, usePopperContainer } from './hooks/use-popper-container/index.mjs';
178
+ export { useDelayedRender } from './hooks/use-intermediate-render/index.mjs';
179
+ export { useDelayedToggle, useDelayedToggleProps } from './hooks/use-delayed-toggle/index.mjs';
180
+ export { FORWARD_REF_INJECTION_KEY, useForwardRef, useForwardRefDirective } from './hooks/use-forward-ref/index.mjs';
174
181
  export { elFormItemKey, elFormKey } from './tokens/form.mjs';
175
182
  export { buttonGroupContextKey } from './tokens/button.mjs';
176
183
  export { elBreadcrumbKey } from './tokens/breadcrumb.mjs';
package/es/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../packages/element-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@element-plus/components'\nexport * from '@element-plus/directives'\nexport * from '@element-plus/hooks'\nexport * from '@element-plus/tokens'\nexport { makeInstaller } from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMY,MAAC,OAAO,GAAG,SAAS,CAAC,QAAQ;AAC7B,MAAC,OAAO,GAAG,SAAS,CAAC;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../packages/element-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@element-plus/components'\nexport * from '@element-plus/directives'\nexport * from '@element-plus/hooks'\nexport * from '@element-plus/tokens'\nexport { makeInstaller } from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMY,MAAC,OAAO,GAAG,SAAS,CAAC,QAAQ;AAC7B,MAAC,OAAO,GAAG,SAAS,CAAC;;;;"}
@@ -1,5 +1,6 @@
1
1
  import type { App, Plugin } from 'vue';
2
+ import type { ConfigProviderContext } from 'element-plus/es/tokens';
2
3
  export declare const makeInstaller: (components?: Plugin[]) => {
3
4
  version: string;
4
- install: (app: App) => void;
5
+ install: (app: App, options?: ConfigProviderContext) => void;
5
6
  };
@@ -1,12 +1,23 @@
1
+ import { watch, unref } from 'vue';
2
+ import './hooks/index.mjs';
3
+ import { isNumber } from './utils/util.mjs';
4
+ import { PopupManager } from './utils/popup-manager.mjs';
1
5
  import { version } from './version.mjs';
6
+ import { provideGlobalConfig } from './hooks/use-global-config/index.mjs';
2
7
 
3
8
  const INSTALLED_KEY = Symbol("INSTALLED_KEY");
4
9
  const makeInstaller = (components = []) => {
5
- const install = (app) => {
10
+ const install = (app, options = {}) => {
6
11
  if (app[INSTALLED_KEY])
7
12
  return;
8
13
  app[INSTALLED_KEY] = true;
9
14
  components.forEach((c) => app.use(c));
15
+ provideGlobalConfig(options, app);
16
+ watch(() => unref(options).zIndex, () => {
17
+ const zIndex = unref(options).zIndex;
18
+ if (isNumber(zIndex))
19
+ PopupManager.globalInitialZIndex = zIndex;
20
+ }, { immediate: true });
10
21
  };
11
22
  return {
12
23
  version,
@@ -1 +1 @@
1
- {"version":3,"file":"make-installer.mjs","sources":["../../../packages/element-plus/make-installer.ts"],"sourcesContent":["import { version } from './version'\nimport type { App, Plugin } from 'vue'\n\nconst INSTALLED_KEY = Symbol('INSTALLED_KEY')\n\nexport const makeInstaller = (components: Plugin[] = []) => {\n const install = (app: App) => {\n if (app[INSTALLED_KEY]) return\n\n app[INSTALLED_KEY] = true\n components.forEach((c) => app.use(c))\n }\n\n return {\n version,\n install,\n }\n}\n"],"names":[],"mappings":";;AACA,MAAM,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAClC,MAAC,aAAa,GAAG,CAAC,UAAU,GAAG,EAAE,KAAK;AAClD,EAAE,MAAM,OAAO,GAAG,CAAC,GAAG,KAAK;AAC3B,IAAI,IAAI,GAAG,CAAC,aAAa,CAAC;AAC1B,MAAM,OAAO;AACb,IAAI,GAAG,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC;AAC9B,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1C,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,OAAO;AACX,IAAI,OAAO;AACX,GAAG,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"make-installer.mjs","sources":["../../../packages/element-plus/make-installer.ts"],"sourcesContent":["import { watch, unref } from 'vue'\nimport { provideGlobalConfig } from '@element-plus/hooks'\nimport { isNumber } from '@element-plus/utils/util'\nimport { PopupManager } from '@element-plus/utils/popup-manager'\nimport { version } from './version'\nimport type { App, Plugin } from 'vue'\nimport type { ConfigProviderContext } from '@element-plus/tokens'\n\nconst INSTALLED_KEY = Symbol('INSTALLED_KEY')\n\nexport const makeInstaller = (components: Plugin[] = []) => {\n const install = (app: App, options: ConfigProviderContext = {}) => {\n if (app[INSTALLED_KEY]) return\n\n app[INSTALLED_KEY] = true\n components.forEach((c) => app.use(c))\n provideGlobalConfig(options, app)\n\n watch(\n () => unref(options).zIndex,\n () => {\n const zIndex = unref(options).zIndex\n if (isNumber(zIndex)) PopupManager.globalInitialZIndex = zIndex\n },\n { immediate: true }\n )\n }\n\n return {\n version,\n install,\n }\n}\n"],"names":[],"mappings":";;;;;;;AAKA,MAAM,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAClC,MAAC,aAAa,GAAG,CAAC,UAAU,GAAG,EAAE,KAAK;AAClD,EAAE,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,OAAO,GAAG,EAAE,KAAK;AACzC,IAAI,IAAI,GAAG,CAAC,aAAa,CAAC;AAC1B,MAAM,OAAO;AACb,IAAI,GAAG,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC;AAC9B,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1C,IAAI,mBAAmB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AACtC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM;AAC7C,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;AAC3C,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC;AAC1B,QAAQ,YAAY,CAAC,mBAAmB,GAAG,MAAM,CAAC;AAClD,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC5B,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,OAAO;AACX,IAAI,OAAO;AACX,GAAG,CAAC;AACJ;;;;"}
@@ -1,4 +1,4 @@
1
1
  import type { configProviderProps } from 'element-plus/es/components/config-provider';
2
- import type { InjectionKey, ExtractPropTypes } from 'vue';
2
+ import type { InjectionKey, ExtractPropTypes, Ref } from 'vue';
3
3
  export declare type ConfigProviderContext = ExtractPropTypes<typeof configProviderProps>;
4
- export declare const configProviderContextKey: InjectionKey<ConfigProviderContext>;
4
+ export declare const configProviderContextKey: InjectionKey<Ref<ConfigProviderContext>>;
@@ -1 +1 @@
1
- {"version":3,"file":"config-provider.mjs","sources":["../../../../packages/tokens/config-provider.ts"],"sourcesContent":["import type { configProviderProps } from '@element-plus/components/config-provider'\nimport type { InjectionKey, ExtractPropTypes } from 'vue'\n\nexport type ConfigProviderContext = ExtractPropTypes<typeof configProviderProps>\n\nexport const configProviderContextKey: InjectionKey<ConfigProviderContext> =\n Symbol()\n"],"names":[],"mappings":"AAAY,MAAC,wBAAwB,GAAG,MAAM;;;;"}
1
+ {"version":3,"file":"config-provider.mjs","sources":["../../../../packages/tokens/config-provider.ts"],"sourcesContent":["import type { configProviderProps } from '@element-plus/components/config-provider'\nimport type { InjectionKey, ExtractPropTypes, Ref } from 'vue'\n\nexport type ConfigProviderContext = ExtractPropTypes<typeof configProviderProps>\n\nexport const configProviderContextKey: InjectionKey<\n Ref<ConfigProviderContext>\n> = Symbol()\n"],"names":[],"mappings":"AAAY,MAAC,wBAAwB,GAAG,MAAM;;;;"}
@@ -11,6 +11,10 @@ export declare const EVENT_CODE: {
11
11
  delete: string;
12
12
  backspace: string;
13
13
  numpadEnter: string;
14
+ pageUp: string;
15
+ pageDown: string;
16
+ home: string;
17
+ end: string;
14
18
  };
15
19
  /**
16
20
  * Determine if the testing element is visible on screen no matter if its on the viewport or not
package/es/utils/aria.mjs CHANGED
@@ -9,7 +9,11 @@ const EVENT_CODE = {
9
9
  esc: "Escape",
10
10
  delete: "Delete",
11
11
  backspace: "Backspace",
12
- numpadEnter: "NumpadEnter"
12
+ numpadEnter: "NumpadEnter",
13
+ pageUp: "PageUp",
14
+ pageDown: "PageDown",
15
+ home: "Home",
16
+ end: "End"
13
17
  };
14
18
  const FOCUSABLE_ELEMENT_SELECTORS = `a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])`;
15
19
  const isVisible = (element) => {
@@ -1 +1 @@
1
- {"version":3,"file":"aria.mjs","sources":["../../../../packages/utils/aria.ts"],"sourcesContent":["import type { Nullable } from '@element-plus/utils/types'\nexport const EVENT_CODE = {\n tab: 'Tab',\n enter: 'Enter',\n space: 'Space',\n left: 'ArrowLeft', // 37\n up: 'ArrowUp', // 38\n right: 'ArrowRight', // 39\n down: 'ArrowDown', // 40\n esc: 'Escape',\n delete: 'Delete',\n backspace: 'Backspace',\n numpadEnter: 'NumpadEnter',\n}\n\nconst FOCUSABLE_ELEMENT_SELECTORS = `a[href],button:not([disabled]),button:not([hidden]),:not([tabindex=\"-1\"]),input:not([disabled]),input:not([type=\"hidden\"]),select:not([disabled]),textarea:not([disabled])`\n\n/**\n * Determine if the testing element is visible on screen no matter if its on the viewport or not\n */\nexport const isVisible = (element: HTMLElement) => {\n if (process.env.NODE_ENV === 'test') return true\n const computed = getComputedStyle(element)\n // element.offsetParent won't work on fix positioned\n // WARNING: potential issue here, going to need some expert advices on this issue\n return computed.position === 'fixed' ? false : element.offsetParent !== null\n}\n\nexport const obtainAllFocusableElements = (\n element: HTMLElement\n): HTMLElement[] => {\n return Array.from(\n element.querySelectorAll<HTMLElement>(FOCUSABLE_ELEMENT_SELECTORS)\n ).filter((item: HTMLElement) => isFocusable(item) && isVisible(item))\n}\n\n/**\n * @desc Determine if target element is focusable\n * @param element {HTMLElement}\n * @returns {Boolean} true if it is focusable\n */\nexport const isFocusable = (element: HTMLElement): boolean => {\n if (\n element.tabIndex > 0 ||\n (element.tabIndex === 0 && element.getAttribute('tabIndex') !== null)\n ) {\n return true\n }\n // HTMLButtonElement has disabled\n if ((element as HTMLButtonElement).disabled) {\n return false\n }\n\n switch (element.nodeName) {\n case 'A': {\n // casting current element to Specific HTMLElement in order to be more type precise\n return (\n !!(element as HTMLAnchorElement).href &&\n (element as HTMLAnchorElement).rel !== 'ignore'\n )\n }\n case 'INPUT': {\n return !(\n (element as HTMLInputElement).type === 'hidden' ||\n (element as HTMLInputElement).type === 'file'\n )\n }\n case 'BUTTON':\n case 'SELECT':\n case 'TEXTAREA': {\n return true\n }\n default: {\n return false\n }\n }\n}\n\n/**\n * @desc Set Attempt to set focus on the current node.\n * @param element\n * The node to attempt to focus on.\n * @returns\n * true if element is focused.\n */\nexport const attemptFocus = (element: HTMLElement): boolean => {\n if (!isFocusable(element)) {\n return false\n }\n Utils.IgnoreUtilFocusChanges = true\n // Remove the old try catch block since there will be no error to be thrown\n element.focus?.()\n Utils.IgnoreUtilFocusChanges = false\n return document.activeElement === element\n}\n\n/**\n * Trigger an event\n * mouseenter, mouseleave, mouseover, keyup, change, click, etc.\n * @param {HTMLElement} elm\n * @param {String} name\n * @param {*} opts\n */\nexport const triggerEvent = function (\n elm: HTMLElement,\n name: string,\n ...opts: Array<boolean>\n): HTMLElement {\n let eventName: string\n\n if (name.includes('mouse') || name.includes('click')) {\n eventName = 'MouseEvents'\n } else if (name.includes('key')) {\n eventName = 'KeyboardEvent'\n } else {\n eventName = 'HTMLEvents'\n }\n const evt = document.createEvent(eventName)\n\n evt.initEvent(name, ...opts)\n elm.dispatchEvent(evt)\n return elm\n}\n\nexport const isLeaf = (el: HTMLElement) => !el.getAttribute('aria-owns')\n\nexport const getSibling = (\n el: HTMLElement,\n distance: number,\n elClass: string\n): Nullable<Element> => {\n const { parentNode } = el\n if (!parentNode) return null\n const siblings = parentNode.querySelectorAll(elClass)\n const index = Array.prototype.indexOf.call(siblings, el)\n return siblings[index + distance] || null\n}\n\nexport const focusNode = (el) => {\n if (!el) return\n el.focus()\n !isLeaf(el) && el.click()\n}\n\nconst Utils = {\n IgnoreUtilFocusChanges: false,\n /**\n * @desc Set focus on descendant nodes until the first focusable element is\n * found.\n * @param {HTMLElement} element\n * DOM node for which to find the first focusable descendant.\n * @returns {Boolean}\n * true if a focusable element is found and focus is set.\n */\n focusFirstDescendant(element: HTMLElement): boolean {\n for (let i = 0; i < element.childNodes.length; i++) {\n const child = element.childNodes[i] as HTMLElement\n if (attemptFocus(child) || this.focusFirstDescendant(child)) {\n return true\n }\n }\n return false\n },\n /**\n * @desc Find the last descendant node that is focusable.\n * @param {HTMLElement} element\n * DOM node for which to find the last focusable descendant.\n * @returns {Boolean}\n * true if a focusable element is found and focus is set.\n */\n focusLastDescendant(element: HTMLElement): boolean {\n for (let i = element.childNodes.length - 1; i >= 0; i--) {\n const child = element.childNodes[i] as HTMLElement\n if (attemptFocus(child) || this.focusLastDescendant(child)) {\n return true\n }\n }\n return false\n },\n}\n\nexport default Utils\n"],"names":[],"mappings":"AAAY,MAAC,UAAU,GAAG;AAC1B,EAAE,GAAG,EAAE,KAAK;AACZ,EAAE,KAAK,EAAE,OAAO;AAChB,EAAE,KAAK,EAAE,OAAO;AAChB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,EAAE,EAAE,SAAS;AACf,EAAE,KAAK,EAAE,YAAY;AACrB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,GAAG,EAAE,QAAQ;AACf,EAAE,MAAM,EAAE,QAAQ;AAClB,EAAE,SAAS,EAAE,WAAW;AACxB,EAAE,WAAW,EAAE,aAAa;AAC5B,EAAE;AACF,MAAM,2BAA2B,GAAG,CAAC,0KAA0K,CAAC,CAAC;AACrM,MAAC,SAAS,GAAG,CAAC,OAAO,KAAK;AACtC,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM;AACrC,IAAI,OAAO,IAAI,CAAC;AAChB,EAAE,MAAM,QAAQ,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAC7C,EAAE,OAAO,QAAQ,CAAC,QAAQ,KAAK,OAAO,GAAG,KAAK,GAAG,OAAO,CAAC,YAAY,KAAK,IAAI,CAAC;AAC/E,EAAE;AACU,MAAC,0BAA0B,GAAG,CAAC,OAAO,K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mBAAmB,CAAC,KAAK,CAAC,EAAE;AAClE,QAAQ,OAAO,IAAI,CAAC;AACpB,OAAO;AACP,KAAK;AACL,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"aria.mjs","sources":["../../../../packages/utils/aria.ts"],"sourcesContent":["import type { Nullable } from '@element-plus/utils/types'\nexport const EVENT_CODE = {\n tab: 'Tab',\n enter: 'Enter',\n space: 'Space',\n left: 'ArrowLeft', // 37\n up: 'ArrowUp', // 38\n right: 'ArrowRight', // 39\n down: 'ArrowDown', // 40\n esc: 'Escape',\n delete: 'Delete',\n backspace: 'Backspace',\n numpadEnter: 'NumpadEnter',\n pageUp: 'PageUp',\n pageDown: 'PageDown',\n home: 'Home',\n end: 'End',\n}\n\nconst FOCUSABLE_ELEMENT_SELECTORS = `a[href],button:not([disabled]),button:not([hidden]),:not([tabindex=\"-1\"]),input:not([disabled]),input:not([type=\"hidden\"]),select:not([disabled]),textarea:not([disabled])`\n\n/**\n * Determine if the testing element is visible on screen no matter if its on the viewport or not\n */\nexport const isVisible = (element: HTMLElement) => {\n if (process.env.NODE_ENV === 'test') return true\n const computed = getComputedStyle(element)\n // element.offsetParent won't work on fix positioned\n // WARNING: potential issue here, going to need some expert advices on this issue\n return computed.position === 'fixed' ? false : element.offsetParent !== null\n}\n\nexport const obtainAllFocusableElements = (\n element: HTMLElement\n): HTMLElement[] => {\n return Array.from(\n element.querySelectorAll<HTMLElement>(FOCUSABLE_ELEMENT_SELECTORS)\n ).filter((item: HTMLElement) => isFocusable(item) && isVisible(item))\n}\n\n/**\n * @desc Determine if target element is focusable\n * @param element {HTMLElement}\n * @returns {Boolean} true if it is focusable\n */\nexport const isFocusable = (element: HTMLElement): boolean => {\n if (\n element.tabIndex > 0 ||\n (element.tabIndex === 0 && element.getAttribute('tabIndex') !== null)\n ) {\n return true\n }\n // HTMLButtonElement has disabled\n if ((element as HTMLButtonElement).disabled) {\n return false\n }\n\n switch (element.nodeName) {\n case 'A': {\n // casting current element to Specific HTMLElement in order to be more type precise\n return (\n !!(element as HTMLAnchorElement).href &&\n (element as HTMLAnchorElement).rel !== 'ignore'\n )\n }\n case 'INPUT': {\n return !(\n (element as HTMLInputElement).type === 'hidden' ||\n (element as HTMLInputElement).type === 'file'\n )\n }\n case 'BUTTON':\n case 'SELECT':\n case 'TEXTAREA': {\n return true\n }\n default: {\n return false\n }\n }\n}\n\n/**\n * @desc Set Attempt to set focus on the current node.\n * @param element\n * The node to attempt to focus on.\n * @returns\n * true if element is focused.\n */\nexport const attemptFocus = (element: HTMLElement): boolean => {\n if (!isFocusable(element)) {\n return false\n }\n Utils.IgnoreUtilFocusChanges = true\n // Remove the old try catch block since there will be no error to be thrown\n element.focus?.()\n Utils.IgnoreUtilFocusChanges = false\n return document.activeElement === element\n}\n\n/**\n * Trigger an event\n * mouseenter, mouseleave, mouseover, keyup, change, click, etc.\n * @param {HTMLElement} elm\n * @param {String} name\n * @param {*} opts\n */\nexport const triggerEvent = function (\n elm: HTMLElement,\n name: string,\n ...opts: Array<boolean>\n): HTMLElement {\n let eventName: string\n\n if (name.includes('mouse') || name.includes('click')) {\n eventName = 'MouseEvents'\n } else if (name.includes('key')) {\n eventName = 'KeyboardEvent'\n } else {\n eventName = 'HTMLEvents'\n }\n const evt = document.createEvent(eventName)\n\n evt.initEvent(name, ...opts)\n elm.dispatchEvent(evt)\n return elm\n}\n\nexport const isLeaf = (el: HTMLElement) => !el.getAttribute('aria-owns')\n\nexport const getSibling = (\n el: HTMLElement,\n distance: number,\n elClass: string\n): Nullable<Element> => {\n const { parentNode } = el\n if (!parentNode) return null\n const siblings = parentNode.querySelectorAll(elClass)\n const index = Array.prototype.indexOf.call(siblings, el)\n return siblings[index + distance] || null\n}\n\nexport const focusNode = (el) => {\n if (!el) return\n el.focus()\n !isLeaf(el) && el.click()\n}\n\nconst Utils = {\n IgnoreUtilFocusChanges: false,\n /**\n * @desc Set focus on descendant nodes until the first focusable element is\n * found.\n * @param {HTMLElement} element\n * DOM node for which to find the first focusable descendant.\n * @returns {Boolean}\n * true if a focusable element is found and focus is set.\n */\n focusFirstDescendant(element: HTMLElement): boolean {\n for (let i = 0; i < element.childNodes.length; i++) {\n const child = element.childNodes[i] as HTMLElement\n if (attemptFocus(child) || this.focusFirstDescendant(child)) {\n return true\n }\n }\n return false\n },\n /**\n * @desc Find the last descendant node that is focusable.\n * @param {HTMLElement} element\n * DOM node for which to find the last focusable descendant.\n * @returns {Boolean}\n * true if a focusable element is found and focus is set.\n */\n focusLastDescendant(element: HTMLElement): boolean {\n for (let i = element.childNodes.length - 1; i >= 0; i--) {\n const child = element.childNodes[i] as HTMLElement\n if (attemptFocus(child) || this.focusLastDescendant(child)) {\n return true\n }\n }\n return false\n },\n}\n\nexport default Utils\n"],"names":[],"mappings":"AAAY,MAAC,UAAU,GAAG;AAC1B,EAAE,GAAG,EAAE,KAAK;AACZ,EAAE,KAAK,EAAE,OAAO;AAChB,EAAE,KAAK,EAAE,OAAO;AAChB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,EAAE,EAAE,SAAS;AACf,EAAE,KAAK,EAAE,YAAY;AACrB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,GAAG,EAAE,QAAQ;AACf,EAAE,MAAM,EAAE,QAAQ;AAClB,EAAE,SAAS,EAAE,WAAW;AACxB,EAAE,WAAW,EAAE,aAAa;AAC5B,EAAE,MAAM,EAAE,QAAQ;AAClB,EAAE,QAAQ,EAAE,UAAU;AACtB,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,GAAG,EAAE,KAAK;AACZ,EAAE;AACF,MAAM,2BAA2B,GAAG,CAAC,0KAA0K,CAAC,CAAC;AACrM,MAAC,SAAS,GAAG,CAAC,OAAO,KAAK;AACtC,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM;AACrC,IAAI,OAAO,IAAI,CAAC;AAChB,EAAE,MAAM,QAAQ,GAAG,gBAAgB,CAAC,OAAO,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AAI,CAAC,EAAE,CAAC,EAAE,EAAE;AAC7D,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAC1C,MAAM,IAAI,YAAY,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE;AAClE,QAAQ,OAAO,IAAI,CAAC;AACpB,OAAO;AACP,KAAK;AACL,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;;;;"}
package/es/utils/dom.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { CSSProperties } from 'vue';
1
+ import type { CSSProperties, ComponentPublicInstance, Ref } from 'vue';
2
2
  import type { Nullable } from './types';
3
3
  export declare const on: (element: HTMLElement | Document | Window, event: string, handler: EventListenerOrEventListenerObject, useCapture?: boolean) => void;
4
4
  export declare const off: (element: HTMLElement | Document | Window, event: string, handler: EventListenerOrEventListenerObject, useCapture?: boolean) => void;
@@ -19,3 +19,11 @@ export declare const getClientXY: (event: MouseEvent | TouchEvent) => {
19
19
  clientX: number;
20
20
  clientY: number;
21
21
  };
22
+ export declare const composeEventHandlers: <E>(theirsHandler?: ((event: E) => boolean | void) | undefined, oursHandler?: ((event: E) => void) | undefined, { checkForDefaultPrevented }?: {
23
+ checkForDefaultPrevented?: boolean | undefined;
24
+ }) => (event: E) => void;
25
+ declare type WhenMouseHandler = (e: PointerEvent) => any;
26
+ export declare const whenMouse: (handler: WhenMouseHandler) => WhenMouseHandler;
27
+ export declare const composeStoppableHandler: <E extends Event>(handler: (e: E) => void) => (e: E) => void;
28
+ export declare const composeRefs: (...refs: Ref<HTMLElement | null>[]) => (el: Element | ComponentPublicInstance | null) => void;
29
+ export {};
package/es/utils/dom.mjs CHANGED
@@ -177,6 +177,32 @@ const getClientXY = (event) => {
177
177
  clientY
178
178
  };
179
179
  };
180
+ const composeEventHandlers = (theirsHandler, oursHandler, { checkForDefaultPrevented = true } = {}) => {
181
+ const handleEvent = (event) => {
182
+ const shouldPrevent = theirsHandler == null ? void 0 : theirsHandler(event);
183
+ if (checkForDefaultPrevented === false || !shouldPrevent) {
184
+ return oursHandler == null ? void 0 : oursHandler(event);
185
+ }
186
+ };
187
+ return handleEvent;
188
+ };
189
+ const whenMouse = (handler) => {
190
+ return (e) => e.pointerType === "mouse" ? handler(e) : void 0;
191
+ };
192
+ const composeStoppableHandler = (handler) => {
193
+ return (e) => {
194
+ if (!e.defaultPrevented) {
195
+ handler(e);
196
+ }
197
+ };
198
+ };
199
+ const composeRefs = (...refs) => {
200
+ return (el) => {
201
+ refs.forEach((ref) => {
202
+ ref.value = el;
203
+ });
204
+ };
205
+ };
180
206
 
181
- export { addClass, getClientXY, getOffsetTop, getOffsetTopDistance, getScrollContainer, getStyle, hasClass, isInContainer, isScroll, off, on, once, removeClass, removeStyle, setStyle, stop };
207
+ export { addClass, composeEventHandlers, composeRefs, composeStoppableHandler, getClientXY, getOffsetTop, getOffsetTopDistance, getScrollContainer, getStyle, hasClass, isInContainer, isScroll, off, on, once, removeClass, removeStyle, setStyle, stop, whenMouse };
182
208
  //# sourceMappingURL=dom.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom.mjs","sources":["../../../../packages/utils/dom.ts"],"sourcesContent":["import { isClient } from '@vueuse/core'\nimport { camelize, isObject } from './util'\nimport type { CSSProperties } from 'vue'\n\nimport type { Nullable } from './types'\n\n/* istanbul ignore next */\nconst trimArr = function (s: string) {\n return (s || '').split(' ').filter((item) => !!item.trim())\n}\n\n/* istanbul ignore next */\nexport const on = function (\n element: HTMLElement | Document | Window,\n event: string,\n handler: EventListenerOrEventListenerObject,\n useCapture = false\n): void {\n if (element && event && handler) {\n element?.addEventListener(event, handler, useCapture)\n }\n}\n\n/* istanbul ignore next */\nexport const off = function (\n element: HTMLElement | Document | Window,\n event: string,\n handler: EventListenerOrEventListenerObject,\n useCapture = false\n): void {\n if (element && event && handler) {\n element?.removeEventListener(event, handler, useCapture)\n }\n}\n\n/* istanbul ignore next */\nexport const once = function (\n el: HTMLElement,\n event: string,\n fn: EventListener\n): void {\n const listener = function (this: any, ...args: any) {\n if (fn) {\n fn.apply(this, args)\n }\n off(el, event, listener)\n }\n on(el, event, listener)\n}\n\n/* istanbul ignore next */\nexport function hasClass(el: HTMLElement | Element, cls: string): boolean {\n if (!el || !cls) return false\n if (cls.indexOf(' ') !== -1)\n throw new Error('className should not contain space.')\n if (el.classList) {\n return el.classList.contains(cls)\n } else {\n const className = el.getAttribute('class') || ''\n return className.split(' ').includes(cls)\n }\n}\n\n/* istanbul ignore next */\nexport function addClass(el: HTMLElement | Element, cls: string): void {\n if (!el) return\n let className = el.getAttribute('class') || ''\n const curClass = trimArr(className)\n const classes = (cls || '')\n .split(' ')\n .filter((item) => !curClass.includes(item) && !!item.trim())\n\n if (el.classList) {\n el.classList.add(...classes)\n } else {\n className += ` ${classes.join(' ')}`\n el.setAttribute('class', className)\n }\n}\n\n/* istanbul ignore next */\nexport function removeClass(el: HTMLElement | Element, cls: string): void {\n if (!el || !cls) return\n const classes = trimArr(cls)\n let curClass = el.getAttribute('class') || ''\n\n if (el.classList) {\n el.classList.remove(...classes)\n return\n }\n classes.forEach((item) => {\n curClass = curClass.replace(` ${item} `, ' ')\n })\n const className = trimArr(curClass).join(' ')\n el.setAttribute('class', className)\n}\n\n/* istanbul ignore next */\n// Here I want to use the type CSSProperties, but the definition for CSSProperties\n// has { [index: number]: string } in its type annotation, which does not satisfy the method\n// camelize(s: string)\n// Same as the return type\nexport const getStyle = function (\n element: HTMLElement,\n styleName: string\n): string {\n if (!isClient) return ''\n if (!element || !styleName) return ''\n styleName = camelize(styleName)\n if (styleName === 'float') {\n styleName = 'cssFloat'\n }\n try {\n const style = element.style[styleName]\n if (style) return style\n const computed = document.defaultView?.getComputedStyle(element, '')\n return computed ? computed[styleName] : ''\n } catch (e) {\n return element.style[styleName]\n }\n}\n\n/* istanbul ignore next */\nexport function setStyle(\n element: HTMLElement,\n styleName: CSSProperties | string,\n value?: string\n): void {\n if (!element || !styleName) return\n\n if (isObject(styleName)) {\n Object.keys(styleName).forEach((prop) => {\n setStyle(element, prop, styleName[prop])\n })\n } else {\n styleName = camelize(styleName)\n element.style[styleName] = value\n }\n}\n\nexport function removeStyle(\n element: HTMLElement,\n style: CSSProperties | string\n) {\n if (!element || !style) return\n\n if (isObject(style)) {\n Object.keys(style).forEach((prop) => {\n setStyle(element, prop, '')\n })\n } else {\n setStyle(element, style, '')\n }\n}\n\nexport const isScroll = (\n el: HTMLElement,\n isVertical?: Nullable<boolean>\n): RegExpMatchArray | null => {\n if (!isClient) return null\n const determinedDirection = isVertical === null || isVertical === undefined\n const overflow = determinedDirection\n ? getStyle(el, 'overflow')\n : isVertical\n ? getStyle(el, 'overflow-y')\n : getStyle(el, 'overflow-x')\n\n return overflow.match(/(scroll|auto|overlay)/)\n}\n\nexport const getScrollContainer = (\n el: HTMLElement,\n isVertical?: Nullable<boolean>\n): Window | HTMLElement | undefined => {\n if (!isClient) return\n\n let parent: HTMLElement = el\n while (parent) {\n if ([window, document, document.documentElement].includes(parent)) {\n return window\n }\n if (isScroll(parent, isVertical)) {\n return parent\n }\n parent = parent.parentNode as HTMLElement\n }\n return parent\n}\n\nexport const isInContainer = (\n el: Element | undefined,\n container: Element | Window | undefined\n): boolean => {\n if (!isClient || !el || !container) return false\n\n const elRect = el.getBoundingClientRect()\n\n let containerRect: Pick<DOMRect, 'top' | 'bottom' | 'left' | 'right'>\n if (container instanceof Element) {\n containerRect = container.getBoundingClientRect()\n } else {\n containerRect = {\n top: 0,\n right: window.innerWidth,\n bottom: window.innerHeight,\n left: 0,\n }\n }\n return (\n elRect.top < containerRect.bottom &&\n elRect.bottom > containerRect.top &&\n elRect.right > containerRect.left &&\n elRect.left < containerRect.right\n )\n}\n\nexport const getOffsetTop = (el: HTMLElement) => {\n let offset = 0\n let parent = el\n\n while (parent) {\n offset += parent.offsetTop\n parent = parent.offsetParent as HTMLElement\n }\n\n return offset\n}\n\nexport const getOffsetTopDistance = (\n el: HTMLElement,\n containerEl: HTMLElement\n) => {\n return Math.abs(getOffsetTop(el) - getOffsetTop(containerEl))\n}\n\nexport const stop = (e: Event) => e.stopPropagation()\n\nexport const getClientXY = (event: MouseEvent | TouchEvent) => {\n let clientX: number\n let clientY: number\n if (event.type === 'touchend') {\n clientY = (event as TouchEvent).changedTouches[0].clientY\n clientX = (event as TouchEvent).changedTouches[0].clientX\n } else if (event.type.startsWith('touch')) {\n clientY = (event as TouchEvent).touches[0].clientY\n clientX = (event as TouchEvent).touches[0].clientX\n } else {\n clientY = (event as MouseEvent).clientY\n clientX = (event as MouseEvent).clientX\n }\n return {\n clientX,\n clientY,\n }\n}\n"],"names":[],"mappings":";;;;AAEA,MAAM,OAAO,GAAG,SAAS,CAAC,EAAE;AAC5B,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AAC9D,CAAC,CAAC;AACU,MAAC,EAAE,GAAG,SAAS,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,GAAG,KAAK,EAAE;AACxE,EAAE,IAAI,OAAO,IAAI,KAAK,IAAI,OAAO,EAAE;AACnC,IAAI,OAAO,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AACpF,GAAG;AACH,EAAE;AACU,MAAC,GAAG,GAAG,SAAS,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,GAAG,KAAK,EAAE;AACzE,EAAE,IAAI,OAAO,IAAI,KAAK,IAAI,OAAO,EAAE;AACnC,IAAI,OAAO,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AACvF,GAAG;AACH,EAAE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IAAI,OAAO;AACX,IAAI,OAAO;AACX,GAAG,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"dom.mjs","sources":["../../../../packages/utils/dom.ts"],"sourcesContent":["import { isClient } from '@vueuse/core'\nimport { camelize, isObject } from './util'\nimport type { CSSProperties, ComponentPublicInstance, Ref } from 'vue'\n\nimport type { Nullable } from './types'\n\n/* istanbul ignore next */\nconst trimArr = function (s: string) {\n return (s || '').split(' ').filter((item) => !!item.trim())\n}\n\n/* istanbul ignore next */\nexport const on = function (\n element: HTMLElement | Document | Window,\n event: string,\n handler: EventListenerOrEventListenerObject,\n useCapture = false\n): void {\n if (element && event && handler) {\n element?.addEventListener(event, handler, useCapture)\n }\n}\n\n/* istanbul ignore next */\nexport const off = function (\n element: HTMLElement | Document | Window,\n event: string,\n handler: EventListenerOrEventListenerObject,\n useCapture = false\n): void {\n if (element && event && handler) {\n element?.removeEventListener(event, handler, useCapture)\n }\n}\n\n/* istanbul ignore next */\nexport const once = function (\n el: HTMLElement,\n event: string,\n fn: EventListener\n): void {\n const listener = function (this: any, ...args: any) {\n if (fn) {\n fn.apply(this, args)\n }\n off(el, event, listener)\n }\n on(el, event, listener)\n}\n\n/* istanbul ignore next */\nexport function hasClass(el: HTMLElement | Element, cls: string): boolean {\n if (!el || !cls) return false\n if (cls.indexOf(' ') !== -1)\n throw new Error('className should not contain space.')\n if (el.classList) {\n return el.classList.contains(cls)\n } else {\n const className = el.getAttribute('class') || ''\n return className.split(' ').includes(cls)\n }\n}\n\n/* istanbul ignore next */\nexport function addClass(el: HTMLElement | Element, cls: string): void {\n if (!el) return\n let className = el.getAttribute('class') || ''\n const curClass = trimArr(className)\n const classes = (cls || '')\n .split(' ')\n .filter((item) => !curClass.includes(item) && !!item.trim())\n\n if (el.classList) {\n el.classList.add(...classes)\n } else {\n className += ` ${classes.join(' ')}`\n el.setAttribute('class', className)\n }\n}\n\n/* istanbul ignore next */\nexport function removeClass(el: HTMLElement | Element, cls: string): void {\n if (!el || !cls) return\n const classes = trimArr(cls)\n let curClass = el.getAttribute('class') || ''\n\n if (el.classList) {\n el.classList.remove(...classes)\n return\n }\n classes.forEach((item) => {\n curClass = curClass.replace(` ${item} `, ' ')\n })\n const className = trimArr(curClass).join(' ')\n el.setAttribute('class', className)\n}\n\n/* istanbul ignore next */\n// Here I want to use the type CSSProperties, but the definition for CSSProperties\n// has { [index: number]: string } in its type annotation, which does not satisfy the method\n// camelize(s: string)\n// Same as the return type\nexport const getStyle = function (\n element: HTMLElement,\n styleName: string\n): string {\n if (!isClient) return ''\n if (!element || !styleName) return ''\n styleName = camelize(styleName)\n if (styleName === 'float') {\n styleName = 'cssFloat'\n }\n try {\n const style = element.style[styleName]\n if (style) return style\n const computed = document.defaultView?.getComputedStyle(element, '')\n return computed ? computed[styleName] : ''\n } catch (e) {\n return element.style[styleName]\n }\n}\n\n/* istanbul ignore next */\nexport function setStyle(\n element: HTMLElement,\n styleName: CSSProperties | string,\n value?: string\n): void {\n if (!element || !styleName) return\n\n if (isObject(styleName)) {\n Object.keys(styleName).forEach((prop) => {\n setStyle(element, prop, styleName[prop])\n })\n } else {\n styleName = camelize(styleName)\n element.style[styleName] = value\n }\n}\n\nexport function removeStyle(\n element: HTMLElement,\n style: CSSProperties | string\n) {\n if (!element || !style) return\n\n if (isObject(style)) {\n Object.keys(style).forEach((prop) => {\n setStyle(element, prop, '')\n })\n } else {\n setStyle(element, style, '')\n }\n}\n\nexport const isScroll = (\n el: HTMLElement,\n isVertical?: Nullable<boolean>\n): RegExpMatchArray | null => {\n if (!isClient) return null\n const determinedDirection = isVertical === null || isVertical === undefined\n const overflow = determinedDirection\n ? getStyle(el, 'overflow')\n : isVertical\n ? getStyle(el, 'overflow-y')\n : getStyle(el, 'overflow-x')\n\n return overflow.match(/(scroll|auto|overlay)/)\n}\n\nexport const getScrollContainer = (\n el: HTMLElement,\n isVertical?: Nullable<boolean>\n): Window | HTMLElement | undefined => {\n if (!isClient) return\n\n let parent: HTMLElement = el\n while (parent) {\n if ([window, document, document.documentElement].includes(parent)) {\n return window\n }\n if (isScroll(parent, isVertical)) {\n return parent\n }\n parent = parent.parentNode as HTMLElement\n }\n return parent\n}\n\nexport const isInContainer = (\n el: Element | undefined,\n container: Element | Window | undefined\n): boolean => {\n if (!isClient || !el || !container) return false\n\n const elRect = el.getBoundingClientRect()\n\n let containerRect: Pick<DOMRect, 'top' | 'bottom' | 'left' | 'right'>\n if (container instanceof Element) {\n containerRect = container.getBoundingClientRect()\n } else {\n containerRect = {\n top: 0,\n right: window.innerWidth,\n bottom: window.innerHeight,\n left: 0,\n }\n }\n return (\n elRect.top < containerRect.bottom &&\n elRect.bottom > containerRect.top &&\n elRect.right > containerRect.left &&\n elRect.left < containerRect.right\n )\n}\n\nexport const getOffsetTop = (el: HTMLElement) => {\n let offset = 0\n let parent = el\n\n while (parent) {\n offset += parent.offsetTop\n parent = parent.offsetParent as HTMLElement\n }\n\n return offset\n}\n\nexport const getOffsetTopDistance = (\n el: HTMLElement,\n containerEl: HTMLElement\n) => {\n return Math.abs(getOffsetTop(el) - getOffsetTop(containerEl))\n}\n\nexport const stop = (e: Event) => e.stopPropagation()\n\nexport const getClientXY = (event: MouseEvent | TouchEvent) => {\n let clientX: number\n let clientY: number\n if (event.type === 'touchend') {\n clientY = (event as TouchEvent).changedTouches[0].clientY\n clientX = (event as TouchEvent).changedTouches[0].clientX\n } else if (event.type.startsWith('touch')) {\n clientY = (event as TouchEvent).touches[0].clientY\n clientX = (event as TouchEvent).touches[0].clientX\n } else {\n clientY = (event as MouseEvent).clientY\n clientX = (event as MouseEvent).clientX\n }\n return {\n clientX,\n clientY,\n }\n}\n\nexport const composeEventHandlers = <E>(\n theirsHandler?: (event: E) => boolean | void,\n oursHandler?: (event: E) => void,\n { checkForDefaultPrevented = true } = {}\n) => {\n const handleEvent = (event: E) => {\n const shouldPrevent = theirsHandler?.(event)\n\n if (checkForDefaultPrevented === false || !shouldPrevent) {\n return oursHandler?.(event)\n }\n }\n return handleEvent\n}\n\ntype WhenMouseHandler = (e: PointerEvent) => any\n\nexport const whenMouse = (handler: WhenMouseHandler): WhenMouseHandler => {\n return (e: PointerEvent) =>\n e.pointerType === 'mouse' ? handler(e) : undefined\n}\n\nexport const composeStoppableHandler = <E extends Event>(\n handler: (e: E) => void\n) => {\n return (e: E) => {\n if (!e.defaultPrevented) {\n handler(e)\n }\n }\n}\n\nexport const composeRefs = (...refs: Ref<HTMLElement | null>[]) => {\n return (el: Element | ComponentPublicInstance | null) => {\n refs.forEach((ref) => {\n ref.value = el as HTMLElement | null\n })\n }\n}\n"],"names":[],"mappings":";;;;AAEA,MAAM,OAAO,GAAG,SAAS,CAAC,EAAE;AAC5B,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AAC9D,CAAC,CAAC;AACU,MAAC,EAAE,GAAG,SAAS,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,GAAG,KAAK,EAAE;AACxE,EAAE,IAAI,OAAO,IAAI,KAAK,IAAI,OAAO,EAAE;AACnC,IAAI,OAAO,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AACpF,GAAG;AACH,EAAE;AACU,MAAC,GAAG,GAAG,SAAS,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,GAAG,KAAK,EAAE;AACzE,EAAE,IAAI,OAAO,IAAI,KAAK,IAAI,OAAO,EAAE;AACnC,IAAI,OAAO,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AACvF,GAAG;AACH,EAAE;AACU,MAAC,IAAI,GAAG,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,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U,MAAC,oBAAoB,GAAG,CAAC,aAAa,EAAE,WAAW,EAAE,EAAE,wBAAwB,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK;AAC9G,EAAE,MAAM,WAAW,GAAG,CAAC,KAAK,KAAK;AACjC,IAAI,MAAM,aAAa,GAAG,aAAa,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;AAChF,IAAI,IAAI,wBAAwB,KAAK,KAAK,IAAI,CAAC,aAAa,EAAE;AAC9D,MAAM,OAAO,WAAW,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;AAC/D,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,OAAO,WAAW,CAAC;AACrB,EAAE;AACU,MAAC,SAAS,GAAG,CAAC,OAAO,KAAK;AACtC,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,KAAK,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;AAChE,EAAE;AACU,MAAC,uBAAuB,GAAG,CAAC,OAAO,KAAK;AACpD,EAAE,OAAO,CAAC,CAAC,KAAK;AAChB,IAAI,IAAI,CAAC,CAAC,CAAC,gBAAgB,EAAE;AAC7B,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;AACjB,KAAK;AACL,GAAG,CAAC;AACJ,EAAE;AACU,MAAC,WAAW,GAAG,CAAC,GAAG,IAAI,KAAK;AACxC,EAAE,OAAO,CAAC,EAAE,KAAK;AACjB,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK;AAC1B,MAAM,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC;AACrB,KAAK,CAAC,CAAC;AACP,GAAG,CAAC;AACJ;;;;"}
@@ -0,0 +1,2 @@
1
+ declare const _default: false;
2
+ export default _default;
@@ -0,0 +1,4 @@
1
+ var isServer = !(globalThis ? globalThis.document : window);
2
+
3
+ export { isServer as default };
4
+ //# sourceMappingURL=isServer.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isServer.mjs","sources":["../../../../packages/utils/isServer.ts"],"sourcesContent":["export default !(globalThis ? globalThis.document : window)\n"],"names":[],"mappings":"AAAA,eAAe,EAAE,UAAU,GAAG,UAAU,CAAC,QAAQ,GAAG,MAAM,CAAC;;;;"}
@@ -4,7 +4,7 @@ declare const wrapperKey: unique symbol;
4
4
  export declare type PropWrapper<T> = {
5
5
  [wrapperKey]: T;
6
6
  };
7
- export declare const propKey: unique symbol;
7
+ export declare const propKey = "__elPropsReservedKey";
8
8
  declare type ResolveProp<T> = ExtractPropTypes<{
9
9
  key: {
10
10
  type: T;
@@ -66,7 +66,7 @@ declare type NativePropType = [
66
66
  } | undefined | null
67
67
  ];
68
68
  export declare const buildProps: <O extends { [K in keyof O]: O[K] extends BuildPropReturn<any, any, any, any, any> ? O[K] : [O[K]] extends NativePropType ? O[K] : O[K] extends BuildPropOption<infer T, infer D, infer R, infer V, infer C> ? D extends BuildPropType<T, V, C> ? BuildPropOption<T, D, R, V, C> : never : never; }>(props: O) => { [K_1 in keyof O]: O[K_1] extends {
69
- [propKey]: boolean;
69
+ __elPropsReservedKey: boolean;
70
70
  } ? O[K_1] : [O[K_1]] extends NativePropType ? O[K_1] : O[K_1] extends BuildPropOption<infer T_1, infer _D, infer R_1, infer V_1, infer C_1> ? BuildPropReturn<T_1, O[K_1]["default"], R_1, V_1, C_1> : never; };
71
71
  export declare const definePropType: <T>(val: any) => PropWrapper<T>;
72
72
  export declare const keyOf: <T>(arr: T) => (keyof T)[];
@@ -3,7 +3,7 @@ import { isObject } from '@vue/shared';
3
3
  import fromPairs from 'lodash/fromPairs';
4
4
 
5
5
  const wrapperKey = Symbol();
6
- const propKey = Symbol();
6
+ const propKey = "__elPropsReservedKey";
7
7
  function buildProp(option, key) {
8
8
  if (!isObject(option) || !!option[propKey])
9
9
  return option;
@@ -1 +1 @@
1
- {"version":3,"file":"props.mjs","sources":["../../../../packages/utils/props.ts"],"sourcesContent":["import { warn } from 'vue'\nimport { isObject } from '@vue/shared'\nimport fromPairs from 'lodash/fromPairs'\nimport type { ExtractPropTypes, PropType } from '@vue/runtime-core'\nimport type { Mutable } from './types'\n\nconst wrapperKey = Symbol()\nexport type PropWrapper<T> = { [wrapperKey]: T }\n\nexport const propKey = Symbol()\n\ntype ResolveProp<T> = ExtractPropTypes<{\n key: { type: T; required: true }\n}>['key']\ntype ResolvePropType<T> = ResolveProp<T> extends { type: infer V }\n ? V\n : ResolveProp<T>\ntype ResolvePropTypeWithReadonly<T> = Readonly<T> extends Readonly<\n Array<infer A>\n>\n ? ResolvePropType<A[]>\n : ResolvePropType<T>\n\ntype IfUnknown<T, V> = [unknown] extends [T] ? V : T\n\nexport type BuildPropOption<T, D extends BuildPropType<T, V, C>, R, V, C> = {\n type?: T\n values?: readonly V[]\n required?: R\n default?: R extends true\n ? never\n : D extends Record<string, unknown> | Array<any>\n ? () => D\n : (() => D) | D\n validator?: ((val: any) => val is C) | ((val: any) => boolean)\n}\n\ntype _BuildPropType<T, V, C> =\n | (T extends PropWrapper<unknown>\n ? T[typeof wrapperKey]\n : [V] extends [never]\n ? ResolvePropTypeWithReadonly<T>\n : never)\n | V\n | C\nexport type BuildPropType<T, V, C> = _BuildPropType<\n IfUnknown<T, never>,\n IfUnknown<V, never>,\n IfUnknown<C, never>\n>\n\ntype _BuildPropDefault<T, D> = [T] extends [\n // eslint-disable-next-line @typescript-eslint/ban-types\n Record<string, unknown> | Array<any> | Function\n]\n ? D\n : D extends () => T\n ? ReturnType<D>\n : D\n\nexport type BuildPropDefault<T, D, R> = R extends true\n ? { readonly default?: undefined }\n : {\n readonly default: Exclude<D, undefined> extends never\n ? undefined\n : Exclude<_BuildPropDefault<T, D>, undefined>\n }\nexport type BuildPropReturn<T, D, R, V, C> = {\n readonly type: PropType<BuildPropType<T, V, C>>\n readonly required: IfUnknown<R, false>\n readonly validator: ((val: unknown) => boolean) | undefined\n [propKey]: true\n} & BuildPropDefault<\n BuildPropType<T, V, C>,\n IfUnknown<D, never>,\n IfUnknown<R, false>\n>\n\n/**\n * @description Build prop. It can better optimize prop types\n * @description 生成 prop,能更好地优化类型\n * @example\n // limited options\n // the type will be PropType<'light' | 'dark'>\n buildProp({\n type: String,\n values: ['light', 'dark'],\n } as const)\n * @example\n // limited options and other types\n // the type will be PropType<'small' | 'large' | number>\n buildProp({\n type: [String, Number],\n values: ['small', 'large'],\n validator: (val: unknown): val is number => typeof val === 'number',\n } as const)\n @link see more: https://github.com/element-plus/element-plus/pull/3341\n */\nexport function buildProp<\n T = never,\n D extends BuildPropType<T, V, C> = never,\n R extends boolean = false,\n V = never,\n C = never\n>(\n option: BuildPropOption<T, D, R, V, C>,\n key?: string\n): BuildPropReturn<T, D, R, V, C> {\n // filter native prop type and nested prop, e.g `null`, `undefined` (from `buildProps`)\n if (!isObject(option) || !!option[propKey]) return option as any\n\n const { values, required, default: defaultValue, type, validator } = option\n\n const _validator =\n values || validator\n ? (val: unknown) => {\n let valid = false\n let allowedValues: unknown[] = []\n\n if (values) {\n allowedValues = [...values, defaultValue]\n valid ||= allowedValues.includes(val)\n }\n if (validator) valid ||= validator(val)\n\n if (!valid && allowedValues.length > 0) {\n const allowValuesText = [...new Set(allowedValues)]\n .map((value) => JSON.stringify(value))\n .join(', ')\n warn(\n `Invalid prop: validation failed${\n key ? ` for prop \"${key}\"` : ''\n }. Expected one of [${allowValuesText}], got value ${JSON.stringify(\n val\n )}.`\n )\n }\n return valid\n }\n : undefined\n\n return {\n type:\n typeof type === 'object' &&\n Object.getOwnPropertySymbols(type).includes(wrapperKey)\n ? type[wrapperKey]\n : type,\n required: !!required,\n default: defaultValue,\n validator: _validator,\n [propKey]: true,\n } as unknown as BuildPropReturn<T, D, R, V, C>\n}\n\ntype NativePropType = [\n ((...args: any) => any) | { new (...args: any): any } | undefined | null\n]\n\nexport const buildProps = <\n O extends {\n [K in keyof O]: O[K] extends BuildPropReturn<any, any, any, any, any>\n ? O[K]\n : [O[K]] extends NativePropType\n ? O[K]\n : O[K] extends BuildPropOption<\n infer T,\n infer D,\n infer R,\n infer V,\n infer C\n >\n ? D extends BuildPropType<T, V, C>\n ? BuildPropOption<T, D, R, V, C>\n : never\n : never\n }\n>(\n props: O\n) =>\n fromPairs(\n Object.entries(props).map(([key, option]) => [\n key,\n buildProp(option as any, key),\n ])\n ) as unknown as {\n [K in keyof O]: O[K] extends { [propKey]: boolean }\n ? O[K]\n : [O[K]] extends NativePropType\n ? O[K]\n : O[K] extends BuildPropOption<\n infer T,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n infer _D,\n infer R,\n infer V,\n infer C\n >\n ? BuildPropReturn<T, O[K]['default'], R, V, C>\n : never\n }\n\nexport const definePropType = <T>(val: any) =>\n ({ [wrapperKey]: val } as PropWrapper<T>)\n\nexport const keyOf = <T>(arr: T) => Object.keys(arr) as Array<keyof T>\nexport const mutable = <T extends readonly any[] | Record<string, unknown>>(\n val: T\n) => val as Mutable<typeof val>\n\nexport const componentSize = ['large', 'default', 'small'] as const\n"],"names":[],"mappings":";;;;AAGA,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC;AAChB,MAAC,OAAO,GAAG,MAAM,GAAG;AACzB,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE;AACvC,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;AAC5C,IAAI,OAAO,MAAM,CAAC;AAClB,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;AAC9E,EAAE,MAAM,UAAU,GAAG,MAAM,IAAI,SAAS,GAAG,CAAC,GAAG,KAAK;AACpD,IAAI,IAAI,KAAK,GAAG,KAAK,CAAC;AACtB,IAAI,IAAI,aAAa,GAAG,EAAE,CAAC;AAC3B,IAAI,IAAI,MAAM,EAA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C,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK;AAC5F,EAAE,GAAG;AACL,EAAE,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC;AACxB,CAAC,CAAC,EAAE;AACQ,MAAC,cAAc,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,UAAU,GAAG,GAAG,EAAE,EAAE;AACnD,MAAC,KAAK,GAAG,CAAC,GAAG,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;AACnC,MAAC,OAAO,GAAG,CAAC,GAAG,KAAK,IAAI;AACxB,MAAC,aAAa,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO;;;;"}
1
+ {"version":3,"file":"props.mjs","sources":["../../../../packages/utils/props.ts"],"sourcesContent":["import { warn } from 'vue'\nimport { isObject } from '@vue/shared'\nimport fromPairs from 'lodash/fromPairs'\nimport type { ExtractPropTypes, PropType } from '@vue/runtime-core'\nimport type { Mutable } from './types'\n\nconst wrapperKey = Symbol()\nexport type PropWrapper<T> = { [wrapperKey]: T }\n\nexport const propKey = '__elPropsReservedKey'\n\ntype ResolveProp<T> = ExtractPropTypes<{\n key: { type: T; required: true }\n}>['key']\ntype ResolvePropType<T> = ResolveProp<T> extends { type: infer V }\n ? V\n : ResolveProp<T>\ntype ResolvePropTypeWithReadonly<T> = Readonly<T> extends Readonly<\n Array<infer A>\n>\n ? ResolvePropType<A[]>\n : ResolvePropType<T>\n\ntype IfUnknown<T, V> = [unknown] extends [T] ? V : T\n\nexport type BuildPropOption<T, D extends BuildPropType<T, V, C>, R, V, C> = {\n type?: T\n values?: readonly V[]\n required?: R\n default?: R extends true\n ? never\n : D extends Record<string, unknown> | Array<any>\n ? () => D\n : (() => D) | D\n validator?: ((val: any) => val is C) | ((val: any) => boolean)\n}\n\ntype _BuildPropType<T, V, C> =\n | (T extends PropWrapper<unknown>\n ? T[typeof wrapperKey]\n : [V] extends [never]\n ? ResolvePropTypeWithReadonly<T>\n : never)\n | V\n | C\nexport type BuildPropType<T, V, C> = _BuildPropType<\n IfUnknown<T, never>,\n IfUnknown<V, never>,\n IfUnknown<C, never>\n>\n\ntype _BuildPropDefault<T, D> = [T] extends [\n // eslint-disable-next-line @typescript-eslint/ban-types\n Record<string, unknown> | Array<any> | Function\n]\n ? D\n : D extends () => T\n ? ReturnType<D>\n : D\n\nexport type BuildPropDefault<T, D, R> = R extends true\n ? { readonly default?: undefined }\n : {\n readonly default: Exclude<D, undefined> extends never\n ? undefined\n : Exclude<_BuildPropDefault<T, D>, undefined>\n }\nexport type BuildPropReturn<T, D, R, V, C> = {\n readonly type: PropType<BuildPropType<T, V, C>>\n readonly required: IfUnknown<R, false>\n readonly validator: ((val: unknown) => boolean) | undefined\n [propKey]: true\n} & BuildPropDefault<\n BuildPropType<T, V, C>,\n IfUnknown<D, never>,\n IfUnknown<R, false>\n>\n\n/**\n * @description Build prop. It can better optimize prop types\n * @description 生成 prop,能更好地优化类型\n * @example\n // limited options\n // the type will be PropType<'light' | 'dark'>\n buildProp({\n type: String,\n values: ['light', 'dark'],\n } as const)\n * @example\n // limited options and other types\n // the type will be PropType<'small' | 'large' | number>\n buildProp({\n type: [String, Number],\n values: ['small', 'large'],\n validator: (val: unknown): val is number => typeof val === 'number',\n } as const)\n @link see more: https://github.com/element-plus/element-plus/pull/3341\n */\nexport function buildProp<\n T = never,\n D extends BuildPropType<T, V, C> = never,\n R extends boolean = false,\n V = never,\n C = never\n>(\n option: BuildPropOption<T, D, R, V, C>,\n key?: string\n): BuildPropReturn<T, D, R, V, C> {\n // filter native prop type and nested prop, e.g `null`, `undefined` (from `buildProps`)\n if (!isObject(option) || !!option[propKey]) return option as any\n\n const { values, required, default: defaultValue, type, validator } = option\n\n const _validator =\n values || validator\n ? (val: unknown) => {\n let valid = false\n let allowedValues: unknown[] = []\n\n if (values) {\n allowedValues = [...values, defaultValue]\n valid ||= allowedValues.includes(val)\n }\n if (validator) valid ||= validator(val)\n\n if (!valid && allowedValues.length > 0) {\n const allowValuesText = [...new Set(allowedValues)]\n .map((value) => JSON.stringify(value))\n .join(', ')\n warn(\n `Invalid prop: validation failed${\n key ? ` for prop \"${key}\"` : ''\n }. Expected one of [${allowValuesText}], got value ${JSON.stringify(\n val\n )}.`\n )\n }\n return valid\n }\n : undefined\n\n return {\n type:\n typeof type === 'object' &&\n Object.getOwnPropertySymbols(type).includes(wrapperKey)\n ? type[wrapperKey]\n : type,\n required: !!required,\n default: defaultValue,\n validator: _validator,\n [propKey]: true,\n } as unknown as BuildPropReturn<T, D, R, V, C>\n}\n\ntype NativePropType = [\n ((...args: any) => any) | { new (...args: any): any } | undefined | null\n]\n\nexport const buildProps = <\n O extends {\n [K in keyof O]: O[K] extends BuildPropReturn<any, any, any, any, any>\n ? O[K]\n : [O[K]] extends NativePropType\n ? O[K]\n : O[K] extends BuildPropOption<\n infer T,\n infer D,\n infer R,\n infer V,\n infer C\n >\n ? D extends BuildPropType<T, V, C>\n ? BuildPropOption<T, D, R, V, C>\n : never\n : never\n }\n>(\n props: O\n) =>\n fromPairs(\n Object.entries(props).map(([key, option]) => [\n key,\n buildProp(option as any, key),\n ])\n ) as unknown as {\n [K in keyof O]: O[K] extends { [propKey]: boolean }\n ? O[K]\n : [O[K]] extends NativePropType\n ? O[K]\n : O[K] extends BuildPropOption<\n infer T,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n infer _D,\n infer R,\n infer V,\n infer C\n >\n ? BuildPropReturn<T, O[K]['default'], R, V, C>\n : never\n }\n\nexport const definePropType = <T>(val: any) =>\n ({ [wrapperKey]: val } as PropWrapper<T>)\n\nexport const keyOf = <T>(arr: T) => Object.keys(arr) as Array<keyof T>\nexport const mutable = <T extends readonly any[] | Record<string, unknown>>(\n val: T\n) => val as Mutable<typeof val>\n\nexport const componentSize = ['large', 'default', 'small'] as const\n"],"names":[],"mappings":";;;;AAGA,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC;A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AC,CAAC,CAAC,CAAC;AACzJ,KAAK;AACL,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG,GAAG,KAAK,CAAC,CAAC;AACb,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI;AACvH,IAAI,QAAQ,EAAE,CAAC,CAAC,QAAQ;AACxB,IAAI,OAAO,EAAE,YAAY;AACzB,IAAI,SAAS,EAAE,UAAU;AACzB,IAAI,CAAC,OAAO,GAAG,IAAI;AACnB,GAAG,CAAC;AACJ,CAAC;AACW,MAAC,UAAU,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK;AAC5F,EAAE,GAAG;AACL,EAAE,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC;AACxB,CAAC,CAAC,EAAE;AACQ,MAAC,cAAc,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,UAAU,GAAG,GAAG,EAAE,EAAE;AACnD,MAAC,KAAK,GAAG,CAAC,GAAG,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;AACnC,MAAC,OAAO,GAAG,CAAC,GAAG,KAAK,IAAI;AACxB,MAAC,aAAa,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO;;;;"}
@@ -52,3 +52,4 @@ export declare function isEqualWithFunction(obj: any, other: any): boolean;
52
52
  * @returns (val: T) => void
53
53
  */
54
54
  export declare const refAttacher: <T extends HTMLElement | ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>>(ref: Ref<T>) => (val: T) => void;
55
+ export declare const merge: <T extends Record<string, any>>(a: T, b: T) => T;
package/es/utils/util.mjs CHANGED
@@ -138,6 +138,17 @@ const refAttacher = (ref) => {
138
138
  ref.value = val;
139
139
  };
140
140
  };
141
+ const merge = (a, b) => {
142
+ var _a;
143
+ const keys = [
144
+ .../* @__PURE__ */ new Set([...Object.keys(a), ...Object.keys(b)])
145
+ ];
146
+ const obj = {};
147
+ for (const key of keys) {
148
+ obj[key] = (_a = b[key]) != null ? _a : a[key];
149
+ }
150
+ return obj;
151
+ };
141
152
 
142
- export { SCOPE, addUnit, arrayFlat, autoprefixer, clearTimer, coerceTruthyValueToArray, deduplicate, escapeRegexpString, generateId, getPropByPath, getRandomInt, getValueByPath, isBool, isEmpty, isEqualWithFunction, isFirefox, isHTMLElement, isNumber, isUndefined, kebabCase, rafThrottle, refAttacher, toObject };
153
+ export { SCOPE, addUnit, arrayFlat, autoprefixer, clearTimer, coerceTruthyValueToArray, deduplicate, escapeRegexpString, generateId, getPropByPath, getRandomInt, getValueByPath, isBool, isEmpty, isEqualWithFunction, isFirefox, isHTMLElement, isNumber, isUndefined, kebabCase, merge, rafThrottle, refAttacher, toObject };
143
154
  //# sourceMappingURL=util.mjs.map