element-ps 2.0.30 → 2.0.31

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 (386) hide show
  1. package/dist/index.full.js +124 -9
  2. package/dist/index.full.min.js +8 -8
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +8 -8
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +124 -9
  7. package/es/components/affix/index.mjs +2 -2
  8. package/es/components/affix/src/affix.mjs +82 -19
  9. package/es/components/affix/src/affix.mjs.map +1 -1
  10. package/es/components/affix/src/affix2.mjs +19 -82
  11. package/es/components/affix/src/affix2.mjs.map +1 -1
  12. package/es/components/autocomplete/index.d.ts +5 -5
  13. package/es/components/autocomplete/src/autocomplete.mjs +1 -1
  14. package/es/components/autocomplete/src/autocomplete.vue.d.ts +5 -5
  15. package/es/components/badge/index.mjs +2 -2
  16. package/es/components/badge/src/badge.mjs +54 -17
  17. package/es/components/badge/src/badge.mjs.map +1 -1
  18. package/es/components/badge/src/badge2.mjs +17 -54
  19. package/es/components/badge/src/badge2.mjs.map +1 -1
  20. package/es/components/breadcrumb/index.mjs +2 -2
  21. package/es/components/breadcrumb/src/breadcrumb-item.mjs +46 -11
  22. package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
  23. package/es/components/breadcrumb/src/breadcrumb-item2.mjs +11 -46
  24. package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
  25. package/es/components/button/index.mjs +1 -1
  26. package/es/components/button/src/button-group.mjs +5 -30
  27. package/es/components/button/src/button-group.mjs.map +1 -1
  28. package/es/components/button/src/button-group2.mjs +30 -5
  29. package/es/components/button/src/button-group2.mjs.map +1 -1
  30. package/es/components/calendar/index.mjs +2 -2
  31. package/es/components/calendar/src/calendar.mjs +9 -188
  32. package/es/components/calendar/src/calendar.mjs.map +1 -1
  33. package/es/components/calendar/src/calendar2.mjs +188 -9
  34. package/es/components/calendar/src/calendar2.mjs.map +1 -1
  35. package/es/components/calendar/src/date-table.mjs +27 -146
  36. package/es/components/calendar/src/date-table.mjs.map +1 -1
  37. package/es/components/calendar/src/date-table2.mjs +146 -27
  38. package/es/components/calendar/src/date-table2.mjs.map +1 -1
  39. package/es/components/cascader/src/index.mjs +1 -1
  40. package/es/components/dropdown/index.d.ts +3 -3
  41. package/es/components/dropdown/index.mjs +2 -2
  42. package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
  43. package/es/components/dropdown/src/dropdown-item.mjs +1 -1
  44. package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
  45. package/es/components/dropdown/src/dropdown.d.ts +1 -1
  46. package/es/components/dropdown/src/dropdown.mjs +100 -109
  47. package/es/components/dropdown/src/dropdown.mjs.map +1 -1
  48. package/es/components/dropdown/src/dropdown.vue.d.ts +3 -3
  49. package/es/components/dropdown/src/dropdown2.mjs +109 -100
  50. package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
  51. package/es/components/empty/index.mjs +2 -2
  52. package/es/components/empty/src/empty.mjs +11 -56
  53. package/es/components/empty/src/empty.mjs.map +1 -1
  54. package/es/components/empty/src/empty2.mjs +56 -11
  55. package/es/components/empty/src/empty2.mjs.map +1 -1
  56. package/es/components/icon/index.mjs +2 -2
  57. package/es/components/icon/src/icon.mjs +35 -8
  58. package/es/components/icon/src/icon.mjs.map +1 -1
  59. package/es/components/icon/src/icon2.mjs +8 -35
  60. package/es/components/icon/src/icon2.mjs.map +1 -1
  61. package/es/components/image/index.mjs +2 -2
  62. package/es/components/image/src/image.mjs +127 -50
  63. package/es/components/image/src/image.mjs.map +1 -1
  64. package/es/components/image/src/image2.mjs +50 -127
  65. package/es/components/image/src/image2.mjs.map +1 -1
  66. package/es/components/index.mjs +22 -22
  67. package/es/components/input/index.mjs +2 -2
  68. package/es/components/input/src/input.mjs +295 -85
  69. package/es/components/input/src/input.mjs.map +1 -1
  70. package/es/components/input/src/input2.mjs +85 -295
  71. package/es/components/input/src/input2.mjs.map +1 -1
  72. package/es/components/menu/index.d.ts +5 -3
  73. package/es/components/menu/src/menu-item2.mjs +9 -1
  74. package/es/components/menu/src/menu-item2.mjs.map +1 -1
  75. package/es/components/menu/src/menu.d.ts +7 -4
  76. package/es/components/menu/src/menu.mjs +86 -6
  77. package/es/components/menu/src/menu.mjs.map +1 -1
  78. package/es/components/menu/src/sub-menu.mjs +35 -4
  79. package/es/components/menu/src/sub-menu.mjs.map +1 -1
  80. package/es/components/menu/src/types.d.ts +8 -0
  81. package/es/components/popconfirm/index.mjs +2 -2
  82. package/es/components/popconfirm/src/popconfirm.mjs +20 -53
  83. package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
  84. package/es/components/popconfirm/src/popconfirm2.mjs +53 -20
  85. package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
  86. package/es/components/popover/index.d.ts +6 -6
  87. package/es/components/popover/src/index.vue.d.ts +3 -3
  88. package/es/components/popover/src/popover.d.ts +1 -1
  89. package/es/components/popover/src/popover.mjs +2 -2
  90. package/es/components/popper/index.mjs +2 -2
  91. package/es/components/popper/src/arrow.mjs +31 -7
  92. package/es/components/popper/src/arrow.mjs.map +1 -1
  93. package/es/components/popper/src/arrow2.mjs +7 -31
  94. package/es/components/popper/src/arrow2.mjs.map +1 -1
  95. package/es/components/radio/index.mjs +4 -4
  96. package/es/components/radio/src/radio-button.mjs +1 -1
  97. package/es/components/radio/src/radio-button2.mjs +1 -1
  98. package/es/components/radio/src/radio-group.mjs +37 -18
  99. package/es/components/radio/src/radio-group.mjs.map +1 -1
  100. package/es/components/radio/src/radio-group2.mjs +18 -37
  101. package/es/components/radio/src/radio-group2.mjs.map +1 -1
  102. package/es/components/radio/src/radio.mjs +74 -62
  103. package/es/components/radio/src/radio.mjs.map +1 -1
  104. package/es/components/radio/src/radio2.mjs +62 -74
  105. package/es/components/radio/src/radio2.mjs.map +1 -1
  106. package/es/components/rate/index.mjs +2 -2
  107. package/es/components/rate/src/rate.mjs +84 -169
  108. package/es/components/rate/src/rate.mjs.map +1 -1
  109. package/es/components/rate/src/rate2.mjs +169 -84
  110. package/es/components/rate/src/rate2.mjs.map +1 -1
  111. package/es/components/result/index.mjs +2 -2
  112. package/es/components/result/src/result.mjs +28 -73
  113. package/es/components/result/src/result.mjs.map +1 -1
  114. package/es/components/result/src/result2.mjs +73 -28
  115. package/es/components/result/src/result2.mjs.map +1 -1
  116. package/es/components/roving-focus-group/index.mjs +3 -3
  117. package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs +1 -1
  118. package/es/components/roving-focus-group/src/roving-focus-group.mjs +27 -29
  119. package/es/components/roving-focus-group/src/roving-focus-group.mjs.map +1 -1
  120. package/es/components/roving-focus-group/src/roving-focus-group2.mjs +29 -27
  121. package/es/components/roving-focus-group/src/roving-focus-group2.mjs.map +1 -1
  122. package/es/components/roving-focus-group/src/roving-focus-item.mjs +1 -1
  123. package/es/components/scrollbar/index.mjs +3 -3
  124. package/es/components/scrollbar/src/bar.mjs +35 -22
  125. package/es/components/scrollbar/src/bar.mjs.map +1 -1
  126. package/es/components/scrollbar/src/bar2.mjs +22 -35
  127. package/es/components/scrollbar/src/bar2.mjs.map +1 -1
  128. package/es/components/scrollbar/src/scrollbar.mjs +112 -42
  129. package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
  130. package/es/components/scrollbar/src/scrollbar2.mjs +42 -112
  131. package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
  132. package/es/components/scrollbar/src/thumb.mjs +11 -59
  133. package/es/components/scrollbar/src/thumb.mjs.map +1 -1
  134. package/es/components/scrollbar/src/thumb2.mjs +59 -11
  135. package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
  136. package/es/components/select/index.d.ts +5 -5
  137. package/es/components/select/src/select.mjs +1 -1
  138. package/es/components/select/src/select.vue.d.ts +5 -5
  139. package/es/components/select/src/useSelect.d.ts +5 -5
  140. package/es/components/select-v2/index.d.ts +10 -10
  141. package/es/components/select-v2/src/defaults.mjs +1 -1
  142. package/es/components/select-v2/src/option-item.vue.d.ts +1 -1
  143. package/es/components/select-v2/src/select.vue.d.ts +5 -5
  144. package/es/components/select-v2/src/useSelect.d.ts +5 -5
  145. package/es/components/switch/index.mjs +2 -2
  146. package/es/components/switch/src/switch.mjs +176 -81
  147. package/es/components/switch/src/switch.mjs.map +1 -1
  148. package/es/components/switch/src/switch2.mjs +81 -176
  149. package/es/components/switch/src/switch2.mjs.map +1 -1
  150. package/es/components/table/index.d.ts +1 -1
  151. package/es/components/table/src/filter-panel.vue.d.ts +5 -5
  152. package/es/components/table/src/table.vue.d.ts +1 -1
  153. package/es/components/tabs/index.mjs +1 -1
  154. package/es/components/tabs/src/tab-bar.mjs +76 -7
  155. package/es/components/tabs/src/tab-bar.mjs.map +1 -1
  156. package/es/components/tabs/src/tab-bar2.mjs +7 -76
  157. package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
  158. package/es/components/tabs/src/tab-nav.mjs +1 -1
  159. package/es/components/teleport/index.mjs +2 -2
  160. package/es/components/teleport/src/teleport.mjs +18 -43
  161. package/es/components/teleport/src/teleport.mjs.map +1 -1
  162. package/es/components/teleport/src/teleport2.mjs +43 -18
  163. package/es/components/teleport/src/teleport2.mjs.map +1 -1
  164. package/es/components/time-picker/src/common/picker.vue.d.ts +5 -5
  165. package/es/components/timeline/index.mjs +2 -2
  166. package/es/components/timeline/src/timeline-item.mjs +39 -73
  167. package/es/components/timeline/src/timeline-item.mjs.map +1 -1
  168. package/es/components/timeline/src/timeline-item2.mjs +73 -39
  169. package/es/components/timeline/src/timeline-item2.mjs.map +1 -1
  170. package/es/components/tooltip/index.d.ts +3 -3
  171. package/es/components/tooltip/index.mjs +2 -2
  172. package/es/components/tooltip/src/tooltip.d.ts +1 -1
  173. package/es/components/tooltip/src/tooltip.mjs +64 -51
  174. package/es/components/tooltip/src/tooltip.mjs.map +1 -1
  175. package/es/components/tooltip/src/tooltip.vue.d.ts +3 -3
  176. package/es/components/tooltip/src/tooltip2.mjs +51 -64
  177. package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
  178. package/es/components/tooltip/src/trigger.mjs +1 -1
  179. package/es/components/tooltip/src/trigger.vue.d.ts +3 -3
  180. package/es/components/tooltip-v2/index.mjs +3 -3
  181. package/es/components/tooltip-v2/src/arrow.mjs +38 -22
  182. package/es/components/tooltip-v2/src/arrow.mjs.map +1 -1
  183. package/es/components/tooltip-v2/src/arrow2.mjs +22 -38
  184. package/es/components/tooltip-v2/src/arrow2.mjs.map +1 -1
  185. package/es/components/tooltip-v2/src/root.mjs +81 -17
  186. package/es/components/tooltip-v2/src/root.mjs.map +1 -1
  187. package/es/components/tooltip-v2/src/root2.mjs +17 -81
  188. package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
  189. package/es/components/tooltip-v2/src/tooltip.mjs +3 -3
  190. package/es/components/tooltip-v2/src/tooltip2.mjs +6 -6
  191. package/es/components/tooltip-v2/src/trigger.mjs +89 -11
  192. package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
  193. package/es/components/tooltip-v2/src/trigger2.mjs +11 -89
  194. package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
  195. package/es/index.mjs +22 -22
  196. package/lib/components/affix/index.js +2 -2
  197. package/lib/components/affix/src/affix.js +82 -19
  198. package/lib/components/affix/src/affix.js.map +1 -1
  199. package/lib/components/affix/src/affix2.js +19 -82
  200. package/lib/components/affix/src/affix2.js.map +1 -1
  201. package/lib/components/autocomplete/index.d.ts +5 -5
  202. package/lib/components/autocomplete/src/autocomplete.js +1 -1
  203. package/lib/components/autocomplete/src/autocomplete.vue.d.ts +5 -5
  204. package/lib/components/badge/index.js +2 -2
  205. package/lib/components/badge/src/badge.js +54 -17
  206. package/lib/components/badge/src/badge.js.map +1 -1
  207. package/lib/components/badge/src/badge2.js +17 -54
  208. package/lib/components/badge/src/badge2.js.map +1 -1
  209. package/lib/components/breadcrumb/index.js +2 -2
  210. package/lib/components/breadcrumb/src/breadcrumb-item.js +46 -11
  211. package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
  212. package/lib/components/breadcrumb/src/breadcrumb-item2.js +11 -46
  213. package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
  214. package/lib/components/button/index.js +1 -1
  215. package/lib/components/button/src/button-group.js +5 -30
  216. package/lib/components/button/src/button-group.js.map +1 -1
  217. package/lib/components/button/src/button-group2.js +30 -5
  218. package/lib/components/button/src/button-group2.js.map +1 -1
  219. package/lib/components/calendar/index.js +2 -2
  220. package/lib/components/calendar/src/calendar.js +9 -192
  221. package/lib/components/calendar/src/calendar.js.map +1 -1
  222. package/lib/components/calendar/src/calendar2.js +192 -9
  223. package/lib/components/calendar/src/calendar2.js.map +1 -1
  224. package/lib/components/calendar/src/date-table.js +30 -151
  225. package/lib/components/calendar/src/date-table.js.map +1 -1
  226. package/lib/components/calendar/src/date-table2.js +151 -30
  227. package/lib/components/calendar/src/date-table2.js.map +1 -1
  228. package/lib/components/cascader/src/index.js +1 -1
  229. package/lib/components/dropdown/index.d.ts +3 -3
  230. package/lib/components/dropdown/index.js +2 -2
  231. package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
  232. package/lib/components/dropdown/src/dropdown-item.js +1 -1
  233. package/lib/components/dropdown/src/dropdown-menu.js +1 -1
  234. package/lib/components/dropdown/src/dropdown.d.ts +1 -1
  235. package/lib/components/dropdown/src/dropdown.js +109 -109
  236. package/lib/components/dropdown/src/dropdown.js.map +1 -1
  237. package/lib/components/dropdown/src/dropdown.vue.d.ts +3 -3
  238. package/lib/components/dropdown/src/dropdown2.js +109 -109
  239. package/lib/components/dropdown/src/dropdown2.js.map +1 -1
  240. package/lib/components/empty/index.js +2 -2
  241. package/lib/components/empty/src/empty.js +11 -56
  242. package/lib/components/empty/src/empty.js.map +1 -1
  243. package/lib/components/empty/src/empty2.js +56 -11
  244. package/lib/components/empty/src/empty2.js.map +1 -1
  245. package/lib/components/icon/index.js +2 -2
  246. package/lib/components/icon/src/icon.js +35 -8
  247. package/lib/components/icon/src/icon.js.map +1 -1
  248. package/lib/components/icon/src/icon2.js +8 -35
  249. package/lib/components/icon/src/icon2.js.map +1 -1
  250. package/lib/components/image/index.js +2 -2
  251. package/lib/components/image/src/image.js +127 -50
  252. package/lib/components/image/src/image.js.map +1 -1
  253. package/lib/components/image/src/image2.js +50 -127
  254. package/lib/components/image/src/image2.js.map +1 -1
  255. package/lib/components/index.js +22 -22
  256. package/lib/components/input/index.js +2 -2
  257. package/lib/components/input/src/input.js +294 -84
  258. package/lib/components/input/src/input.js.map +1 -1
  259. package/lib/components/input/src/input2.js +84 -294
  260. package/lib/components/input/src/input2.js.map +1 -1
  261. package/lib/components/menu/index.d.ts +5 -3
  262. package/lib/components/menu/src/menu-item2.js +8 -0
  263. package/lib/components/menu/src/menu-item2.js.map +1 -1
  264. package/lib/components/menu/src/menu.d.ts +7 -4
  265. package/lib/components/menu/src/menu.js +87 -7
  266. package/lib/components/menu/src/menu.js.map +1 -1
  267. package/lib/components/menu/src/sub-menu.js +34 -3
  268. package/lib/components/menu/src/sub-menu.js.map +1 -1
  269. package/lib/components/menu/src/types.d.ts +8 -0
  270. package/lib/components/popconfirm/index.js +2 -2
  271. package/lib/components/popconfirm/src/popconfirm.js +20 -53
  272. package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
  273. package/lib/components/popconfirm/src/popconfirm2.js +53 -20
  274. package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
  275. package/lib/components/popover/index.d.ts +6 -6
  276. package/lib/components/popover/src/index.vue.d.ts +3 -3
  277. package/lib/components/popover/src/popover.d.ts +1 -1
  278. package/lib/components/popover/src/popover.js +2 -2
  279. package/lib/components/popper/index.js +2 -2
  280. package/lib/components/popper/src/arrow.js +31 -7
  281. package/lib/components/popper/src/arrow.js.map +1 -1
  282. package/lib/components/popper/src/arrow2.js +7 -31
  283. package/lib/components/popper/src/arrow2.js.map +1 -1
  284. package/lib/components/radio/index.js +4 -4
  285. package/lib/components/radio/src/radio-button.js +1 -1
  286. package/lib/components/radio/src/radio-button2.js +1 -1
  287. package/lib/components/radio/src/radio-group.js +37 -18
  288. package/lib/components/radio/src/radio-group.js.map +1 -1
  289. package/lib/components/radio/src/radio-group2.js +18 -37
  290. package/lib/components/radio/src/radio-group2.js.map +1 -1
  291. package/lib/components/radio/src/radio.js +73 -64
  292. package/lib/components/radio/src/radio.js.map +1 -1
  293. package/lib/components/radio/src/radio2.js +64 -73
  294. package/lib/components/radio/src/radio2.js.map +1 -1
  295. package/lib/components/rate/index.js +2 -2
  296. package/lib/components/rate/src/rate.js +84 -169
  297. package/lib/components/rate/src/rate.js.map +1 -1
  298. package/lib/components/rate/src/rate2.js +169 -84
  299. package/lib/components/rate/src/rate2.js.map +1 -1
  300. package/lib/components/result/index.js +2 -2
  301. package/lib/components/result/src/result.js +30 -73
  302. package/lib/components/result/src/result.js.map +1 -1
  303. package/lib/components/result/src/result2.js +73 -30
  304. package/lib/components/result/src/result2.js.map +1 -1
  305. package/lib/components/roving-focus-group/index.js +2 -2
  306. package/lib/components/roving-focus-group/src/roving-focus-group-impl.js +1 -1
  307. package/lib/components/roving-focus-group/src/roving-focus-group.js +27 -33
  308. package/lib/components/roving-focus-group/src/roving-focus-group.js.map +1 -1
  309. package/lib/components/roving-focus-group/src/roving-focus-group2.js +33 -27
  310. package/lib/components/roving-focus-group/src/roving-focus-group2.js.map +1 -1
  311. package/lib/components/roving-focus-group/src/roving-focus-item.js +1 -1
  312. package/lib/components/scrollbar/index.js +3 -3
  313. package/lib/components/scrollbar/src/bar.js +35 -22
  314. package/lib/components/scrollbar/src/bar.js.map +1 -1
  315. package/lib/components/scrollbar/src/bar2.js +22 -35
  316. package/lib/components/scrollbar/src/bar2.js.map +1 -1
  317. package/lib/components/scrollbar/src/scrollbar.js +112 -42
  318. package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
  319. package/lib/components/scrollbar/src/scrollbar2.js +42 -112
  320. package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
  321. package/lib/components/scrollbar/src/thumb.js +11 -59
  322. package/lib/components/scrollbar/src/thumb.js.map +1 -1
  323. package/lib/components/scrollbar/src/thumb2.js +59 -11
  324. package/lib/components/scrollbar/src/thumb2.js.map +1 -1
  325. package/lib/components/select/index.d.ts +5 -5
  326. package/lib/components/select/src/select.js +1 -1
  327. package/lib/components/select/src/select.vue.d.ts +5 -5
  328. package/lib/components/select/src/useSelect.d.ts +5 -5
  329. package/lib/components/select-v2/index.d.ts +10 -10
  330. package/lib/components/select-v2/src/defaults.js +1 -1
  331. package/lib/components/select-v2/src/option-item.vue.d.ts +1 -1
  332. package/lib/components/select-v2/src/select.vue.d.ts +5 -5
  333. package/lib/components/select-v2/src/useSelect.d.ts +5 -5
  334. package/lib/components/switch/index.js +2 -2
  335. package/lib/components/switch/src/switch.js +176 -81
  336. package/lib/components/switch/src/switch.js.map +1 -1
  337. package/lib/components/switch/src/switch2.js +81 -176
  338. package/lib/components/switch/src/switch2.js.map +1 -1
  339. package/lib/components/table/index.d.ts +1 -1
  340. package/lib/components/table/src/filter-panel.vue.d.ts +5 -5
  341. package/lib/components/table/src/table.vue.d.ts +1 -1
  342. package/lib/components/tabs/index.js +1 -1
  343. package/lib/components/tabs/src/tab-bar.js +76 -7
  344. package/lib/components/tabs/src/tab-bar.js.map +1 -1
  345. package/lib/components/tabs/src/tab-bar2.js +7 -76
  346. package/lib/components/tabs/src/tab-bar2.js.map +1 -1
  347. package/lib/components/tabs/src/tab-nav.js +1 -1
  348. package/lib/components/teleport/index.js +2 -2
  349. package/lib/components/teleport/src/teleport.js +18 -43
  350. package/lib/components/teleport/src/teleport.js.map +1 -1
  351. package/lib/components/teleport/src/teleport2.js +43 -18
  352. package/lib/components/teleport/src/teleport2.js.map +1 -1
  353. package/lib/components/time-picker/src/common/picker.vue.d.ts +5 -5
  354. package/lib/components/timeline/index.js +2 -2
  355. package/lib/components/timeline/src/timeline-item.js +39 -73
  356. package/lib/components/timeline/src/timeline-item.js.map +1 -1
  357. package/lib/components/timeline/src/timeline-item2.js +73 -39
  358. package/lib/components/timeline/src/timeline-item2.js.map +1 -1
  359. package/lib/components/tooltip/index.d.ts +3 -3
  360. package/lib/components/tooltip/index.js +2 -2
  361. package/lib/components/tooltip/src/tooltip.d.ts +1 -1
  362. package/lib/components/tooltip/src/tooltip.js +65 -50
  363. package/lib/components/tooltip/src/tooltip.js.map +1 -1
  364. package/lib/components/tooltip/src/tooltip.vue.d.ts +3 -3
  365. package/lib/components/tooltip/src/tooltip2.js +50 -65
  366. package/lib/components/tooltip/src/tooltip2.js.map +1 -1
  367. package/lib/components/tooltip/src/trigger.js +1 -1
  368. package/lib/components/tooltip/src/trigger.vue.d.ts +3 -3
  369. package/lib/components/tooltip-v2/index.js +3 -3
  370. package/lib/components/tooltip-v2/src/arrow.js +38 -23
  371. package/lib/components/tooltip-v2/src/arrow.js.map +1 -1
  372. package/lib/components/tooltip-v2/src/arrow2.js +23 -38
  373. package/lib/components/tooltip-v2/src/arrow2.js.map +1 -1
  374. package/lib/components/tooltip-v2/src/root.js +81 -17
  375. package/lib/components/tooltip-v2/src/root.js.map +1 -1
  376. package/lib/components/tooltip-v2/src/root2.js +17 -81
  377. package/lib/components/tooltip-v2/src/root2.js.map +1 -1
  378. package/lib/components/tooltip-v2/src/tooltip.js +3 -3
  379. package/lib/components/tooltip-v2/src/tooltip2.js +6 -6
  380. package/lib/components/tooltip-v2/src/trigger.js +89 -11
  381. package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
  382. package/lib/components/tooltip-v2/src/trigger2.js +11 -89
  383. package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
  384. package/lib/index.js +22 -22
  385. package/package.json +1 -1
  386. package/web-types.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"date-table.mjs","sources":["../../../../../../packages/components/calendar/src/date-table.vue"],"sourcesContent":["<template>\n <table\n :class=\"[nsTable.b(), nsTable.is('range', isInRange)]\"\n cellspacing=\"0\"\n cellpadding=\"0\"\n >\n <thead v-if=\"!hideHeader\">\n <th v-for=\"day in weekDays\" :key=\"day\">{{ day }}</th>\n </thead>\n\n <tbody>\n <tr\n v-for=\"(row, index) in rows\"\n :key=\"index\"\n :class=\"{\n [nsTable.e('row')]: true,\n [nsTable.em('row', 'hide-border')]: index === 0 && hideHeader,\n }\"\n >\n <td\n v-for=\"(cell, key) in row\"\n :key=\"key\"\n :class=\"getCellClass(cell)\"\n >\n <div :class=\"nsDay.b()\">\n <slot name=\"dateCell\" :data=\"getSlotData(cell)\">\n <span>{{ cell.text }}</span>\n </slot>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport dayjs from 'dayjs'\nimport localeData from 'dayjs/plugin/localeData.js'\nimport { useLocale, useNamespace } from '@element-ps/hooks'\nimport { rangeArr } from '@element-ps/components/time-picker'\nimport { WEEK_DAYS } from '@element-ps/constants'\nimport {\n dateTableProps,\n getMonthDays,\n getPrevMonthLastDays,\n toNestedArr,\n} from './date-table'\nimport type { CalendarDateCell, CalendarDateCellType } from './date-table'\nimport type { Dayjs } from 'dayjs'\n\ndayjs.extend(localeData)\n\ndefineOptions({\n name: 'DateTable',\n})\n\nconst props = defineProps(dateTableProps)\n\nconst { t, lang } = useLocale()\nconst nsTable = useNamespace('calendar-table')\nconst nsDay = useNamespace('calendar-day')\n\nconst now = dayjs().locale(lang.value)\n// todo better way to get Day.js locale object\nconst firstDayOfWeek: number = (now as any).$locale().weekStart || 0\n\nconst isInRange = computed(() => !!props.range && !!props.range.length)\n\nconst rows = computed(() => {\n let days: CalendarDateCell[] = []\n if (isInRange.value) {\n const [start, end] = props.range!\n const currentMonthRange: CalendarDateCell[] = rangeArr(\n end.date() - start.date() + 1\n ).map((index) => ({\n text: start.date() + index,\n type: 'current',\n }))\n\n let remaining = currentMonthRange.length % 7\n remaining = remaining === 0 ? 0 : 7 - remaining\n const nextMonthRange: CalendarDateCell[] = rangeArr(remaining).map(\n (_, index) => ({\n text: index + 1,\n type: 'next',\n })\n )\n days = currentMonthRange.concat(nextMonthRange)\n } else {\n const firstDay = props.date.startOf('month').day()\n const prevMonthDays: CalendarDateCell[] = getPrevMonthLastDays(\n props.date,\n firstDay - firstDayOfWeek\n ).map((day) => ({\n text: day,\n type: 'prev',\n }))\n const currentMonthDays: CalendarDateCell[] = getMonthDays(props.date).map(\n (day) => ({\n text: day,\n type: 'current',\n })\n )\n days = [...prevMonthDays, ...currentMonthDays]\n const remaining = 7 - (days.length % 7 || 7)\n const nextMonthDays: CalendarDateCell[] = rangeArr(remaining).map(\n (_, index) => ({\n text: index + 1,\n type: 'next',\n })\n )\n days = days.concat(nextMonthDays)\n }\n return toNestedArr(days)\n})\n\nconst weekDays = computed(() => {\n const start = firstDayOfWeek\n if (start === 0) {\n return WEEK_DAYS.map((_) => t(`el.datepicker.weeks.${_}`))\n } else {\n return WEEK_DAYS.slice(start)\n .concat(WEEK_DAYS.slice(0, start))\n .map((_) => t(`el.datepicker.weeks.${_}`))\n }\n})\n\nconst getFormattedDate = (day: number, type: CalendarDateCellType): Dayjs => {\n switch (type) {\n case 'prev':\n return props.date.startOf('month').subtract(1, 'month').date(day)\n case 'next':\n return props.date.startOf('month').add(1, 'month').date(day)\n case 'current':\n return props.date.date(day)\n }\n}\n\nconst getCellClass = ({ text, type }: CalendarDateCell) => {\n const classes: string[] = [type]\n if (type === 'current') {\n const date = getFormattedDate(text, type)\n if (date.isSame(props.selectedDay, 'day')) {\n classes.push(nsDay.is('selected'))\n }\n if (date.isSame(now, 'day')) {\n classes.push(nsDay.is('today'))\n }\n }\n return classes\n}\n\nconst getSlotData = ({ text, type }: CalendarDateCell) => {\n const day = getFormattedDate(text, type)\n return {\n isSelected: day.isSame(props.selectedDay),\n type: `${type}-month`,\n day: day.format('YYYY-MM-DD'),\n date: day.toDate(),\n }\n}\n\ndefineExpose({\n /** @description toggle date panel */\n getFormattedDate,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;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,CAAA,UAAA,CAAA,CAAA,CAAA;AAAA,SACA;AACA,QAAA,IAAA,IAAA,CAAA,MAAA,CAAA,GAAA,EAAA,KAAA,CAAA,EAAA;AACA,UAAA,OAAA,CAAA,IAAA,CAAA,KAAA,CAAA,EAAA,CAAA,OAAA,CAAA,CAAA,CAAA;AAAA,SACA;AAAA,OACA;AACA,MAAA,OAAA,OAAA,CAAA;AAAA,KACA,CAAA;AAEA,IAAA,MAAA,WAAA,GAAA,CAAA,EAAA,IAAA,EAAA,IAAA,EAAA,KAAA;AACA,MAAA,MAAA,GAAA,GAAA,gBAAA,CAAA,IAAA,EAAA,IAAA,CAAA,CAAA;AACA,MAAA,OAAA;AAAA,QACA,UAAA,EAAA,GAAA,CAAA,MAAA,CAAA,KAAA,CAAA,WAAA,CAAA;AAAA,QACA,MAAA,CAAA,EAAA,IAAA,CAAA,MAAA,CAAA;AAAA,QACA,GAAA,EAAA,GAAA,CAAA,MAAA,CAAA,YAAA,CAAA;AAAA,QACA,IAAA,EAAA,IAAA,MAAA,EAAA;AAAA,OACA,CAAA;AAAA,KACA,CAAA;AAEA,IAAA,MAAA,CAAA;AAAA,MAEA,gBAAA;AAAA,KACA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"date-table.mjs","sources":["../../../../../../packages/components/calendar/src/date-table.ts"],"sourcesContent":["import { buildProps, definePropType, isObject } from '@element-ps/utils'\nimport { rangeArr } from '@element-ps/components/time-picker'\nimport type { ExtractPropTypes } from 'vue'\nimport type { Dayjs } from 'dayjs'\nimport type DateTable from './date-table.vue'\n\nexport type CalendarDateCellType = 'next' | 'prev' | 'current'\nexport type CalendarDateCell = {\n text: number\n type: CalendarDateCellType\n}\n\nexport const getPrevMonthLastDays = (date: Dayjs, count: number) => {\n const lastDay = date.subtract(1, 'month').endOf('month').date()\n return rangeArr(count).map((_, index) => lastDay - (count - index - 1))\n}\n\nexport const getMonthDays = (date: Dayjs) => {\n const days = date.daysInMonth()\n return rangeArr(days).map((_, index) => index + 1)\n}\n\nexport const toNestedArr = (days: CalendarDateCell[]) =>\n rangeArr(days.length / 7).map((index) => {\n const start = index * 7\n return days.slice(start, start + 7)\n })\n\nexport const dateTableProps = buildProps({\n selectedDay: {\n type: definePropType<Dayjs>(Object),\n },\n range: {\n type: definePropType<[Dayjs, Dayjs]>(Array),\n },\n date: {\n type: definePropType<Dayjs>(Object),\n required: true,\n },\n hideHeader: {\n type: Boolean,\n },\n} as const)\nexport type DateTableProps = ExtractPropTypes<typeof dateTableProps>\n\nexport type DateTableInstance = InstanceType<typeof DateTable>\n"],"names":[],"mappings":";;;;;AAEY,MAAC,oBAAoB,GAAG,CAAC,IAAI,EAAE,KAAK,KAAK;AACrD,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;AAClE,EAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,OAAO,IAAI,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1E,EAAE;AACU,MAAC,YAAY,GAAG,CAAC,IAAI,KAAK;AACtC,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;AAClC,EAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC;AACrD,EAAE;AACU,MAAC,WAAW,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK;AAC9E,EAAE,MAAM,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;AAC1B,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AACtC,CAAC,EAAE;AACS,MAAC,cAAc,GAAG,UAAU,CAAC;AACzC,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,OAAO;AACjB,GAAG;AACH,CAAC;;;;"}
@@ -1,35 +1,154 @@
1
- import '../../../utils/index.mjs';
1
+ import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, Fragment, renderList, toDisplayString, createCommentVNode, createElementVNode, renderSlot } from 'vue';
2
+ import dayjs from 'dayjs';
3
+ import localeData from 'dayjs/plugin/localeData.js';
4
+ import '../../../hooks/index.mjs';
2
5
  import '../../time-picker/index.mjs';
6
+ import '../../../constants/index.mjs';
7
+ import { dateTableProps, getPrevMonthLastDays, getMonthDays, toNestedArr } from './date-table.mjs';
8
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
9
+ import { useLocale } from '../../../hooks/use-locale/index.mjs';
10
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
3
11
  import { rangeArr } from '../../time-picker/src/common/date-utils.mjs';
4
- import { buildProps, definePropType } from '../../../utils/vue/props.mjs';
12
+ import { WEEK_DAYS } from '../../../constants/date.mjs';
5
13
 
6
- const getPrevMonthLastDays = (date, count) => {
7
- const lastDay = date.subtract(1, "month").endOf("month").date();
8
- return rangeArr(count).map((_, index) => lastDay - (count - index - 1));
14
+ const _hoisted_1 = { key: 0 };
15
+ const __default__ = {
16
+ name: "DateTable"
9
17
  };
10
- const getMonthDays = (date) => {
11
- const days = date.daysInMonth();
12
- return rangeArr(days).map((_, index) => index + 1);
13
- };
14
- const toNestedArr = (days) => rangeArr(days.length / 7).map((index) => {
15
- const start = index * 7;
16
- return days.slice(start, start + 7);
17
- });
18
- const dateTableProps = buildProps({
19
- selectedDay: {
20
- type: definePropType(Object)
21
- },
22
- range: {
23
- type: definePropType(Array)
24
- },
25
- date: {
26
- type: definePropType(Object),
27
- required: true
28
- },
29
- hideHeader: {
30
- type: Boolean
18
+ const _sfc_main = /* @__PURE__ */ defineComponent({
19
+ ...__default__,
20
+ props: dateTableProps,
21
+ setup(__props, { expose }) {
22
+ const props = __props;
23
+ dayjs.extend(localeData);
24
+ const { t, lang } = useLocale();
25
+ const nsTable = useNamespace("calendar-table");
26
+ const nsDay = useNamespace("calendar-day");
27
+ const now = dayjs().locale(lang.value);
28
+ const firstDayOfWeek = now.$locale().weekStart || 0;
29
+ const isInRange = computed(() => !!props.range && !!props.range.length);
30
+ const rows = computed(() => {
31
+ let days = [];
32
+ if (isInRange.value) {
33
+ const [start, end] = props.range;
34
+ const currentMonthRange = rangeArr(end.date() - start.date() + 1).map((index) => ({
35
+ text: start.date() + index,
36
+ type: "current"
37
+ }));
38
+ let remaining = currentMonthRange.length % 7;
39
+ remaining = remaining === 0 ? 0 : 7 - remaining;
40
+ const nextMonthRange = rangeArr(remaining).map((_, index) => ({
41
+ text: index + 1,
42
+ type: "next"
43
+ }));
44
+ days = currentMonthRange.concat(nextMonthRange);
45
+ } else {
46
+ const firstDay = props.date.startOf("month").day();
47
+ const prevMonthDays = getPrevMonthLastDays(props.date, firstDay - firstDayOfWeek).map((day) => ({
48
+ text: day,
49
+ type: "prev"
50
+ }));
51
+ const currentMonthDays = getMonthDays(props.date).map((day) => ({
52
+ text: day,
53
+ type: "current"
54
+ }));
55
+ days = [...prevMonthDays, ...currentMonthDays];
56
+ const remaining = 7 - (days.length % 7 || 7);
57
+ const nextMonthDays = rangeArr(remaining).map((_, index) => ({
58
+ text: index + 1,
59
+ type: "next"
60
+ }));
61
+ days = days.concat(nextMonthDays);
62
+ }
63
+ return toNestedArr(days);
64
+ });
65
+ const weekDays = computed(() => {
66
+ const start = firstDayOfWeek;
67
+ if (start === 0) {
68
+ return WEEK_DAYS.map((_) => t(`el.datepicker.weeks.${_}`));
69
+ } else {
70
+ return WEEK_DAYS.slice(start).concat(WEEK_DAYS.slice(0, start)).map((_) => t(`el.datepicker.weeks.${_}`));
71
+ }
72
+ });
73
+ const getFormattedDate = (day, type) => {
74
+ switch (type) {
75
+ case "prev":
76
+ return props.date.startOf("month").subtract(1, "month").date(day);
77
+ case "next":
78
+ return props.date.startOf("month").add(1, "month").date(day);
79
+ case "current":
80
+ return props.date.date(day);
81
+ }
82
+ };
83
+ const getCellClass = ({ text, type }) => {
84
+ const classes = [type];
85
+ if (type === "current") {
86
+ const date = getFormattedDate(text, type);
87
+ if (date.isSame(props.selectedDay, "day")) {
88
+ classes.push(nsDay.is("selected"));
89
+ }
90
+ if (date.isSame(now, "day")) {
91
+ classes.push(nsDay.is("today"));
92
+ }
93
+ }
94
+ return classes;
95
+ };
96
+ const getSlotData = ({ text, type }) => {
97
+ const day = getFormattedDate(text, type);
98
+ return {
99
+ isSelected: day.isSame(props.selectedDay),
100
+ type: `${type}-month`,
101
+ day: day.format("YYYY-MM-DD"),
102
+ date: day.toDate()
103
+ };
104
+ };
105
+ expose({
106
+ getFormattedDate
107
+ });
108
+ return (_ctx, _cache) => {
109
+ return openBlock(), createElementBlock("table", {
110
+ class: normalizeClass([unref(nsTable).b(), unref(nsTable).is("range", unref(isInRange))]),
111
+ cellspacing: "0",
112
+ cellpadding: "0"
113
+ }, [
114
+ !_ctx.hideHeader ? (openBlock(), createElementBlock("thead", _hoisted_1, [
115
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(weekDays), (day) => {
116
+ return openBlock(), createElementBlock("th", { key: day }, toDisplayString(day), 1);
117
+ }), 128))
118
+ ])) : createCommentVNode("v-if", true),
119
+ createElementVNode("tbody", null, [
120
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(rows), (row, index) => {
121
+ return openBlock(), createElementBlock("tr", {
122
+ key: index,
123
+ class: normalizeClass({
124
+ [unref(nsTable).e("row")]: true,
125
+ [unref(nsTable).em("row", "hide-border")]: index === 0 && _ctx.hideHeader
126
+ })
127
+ }, [
128
+ (openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, key) => {
129
+ return openBlock(), createElementBlock("td", {
130
+ key,
131
+ class: normalizeClass(getCellClass(cell))
132
+ }, [
133
+ createElementVNode("div", {
134
+ class: normalizeClass(unref(nsDay).b())
135
+ }, [
136
+ renderSlot(_ctx.$slots, "dateCell", {
137
+ data: getSlotData(cell)
138
+ }, () => [
139
+ createElementVNode("span", null, toDisplayString(cell.text), 1)
140
+ ])
141
+ ], 2)
142
+ ], 2);
143
+ }), 128))
144
+ ], 2);
145
+ }), 128))
146
+ ])
147
+ ], 2);
148
+ };
31
149
  }
32
150
  });
151
+ var DateTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-ps/packages/components/calendar/src/date-table.vue"]]);
33
152
 
34
- export { dateTableProps, getMonthDays, getPrevMonthLastDays, toNestedArr };
153
+ export { DateTable as default };
35
154
  //# sourceMappingURL=date-table2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-table2.mjs","sources":["../../../../../../packages/components/calendar/src/date-table.ts"],"sourcesContent":["import { buildProps, definePropType, isObject } from '@element-ps/utils'\nimport { rangeArr } from '@element-ps/components/time-picker'\nimport type { ExtractPropTypes } from 'vue'\nimport type { Dayjs } from 'dayjs'\nimport type DateTable from './date-table.vue'\n\nexport type CalendarDateCellType = 'next' | 'prev' | 'current'\nexport type CalendarDateCell = {\n text: number\n type: CalendarDateCellType\n}\n\nexport const getPrevMonthLastDays = (date: Dayjs, count: number) => {\n const lastDay = date.subtract(1, 'month').endOf('month').date()\n return rangeArr(count).map((_, index) => lastDay - (count - index - 1))\n}\n\nexport const getMonthDays = (date: Dayjs) => {\n const days = date.daysInMonth()\n return rangeArr(days).map((_, index) => index + 1)\n}\n\nexport const toNestedArr = (days: CalendarDateCell[]) =>\n rangeArr(days.length / 7).map((index) => {\n const start = index * 7\n return days.slice(start, start + 7)\n })\n\nexport const dateTableProps = buildProps({\n selectedDay: {\n type: definePropType<Dayjs>(Object),\n },\n range: {\n type: definePropType<[Dayjs, Dayjs]>(Array),\n },\n date: {\n type: definePropType<Dayjs>(Object),\n required: true,\n },\n hideHeader: {\n type: Boolean,\n },\n} as const)\nexport type DateTableProps = ExtractPropTypes<typeof dateTableProps>\n\nexport type DateTableInstance = InstanceType<typeof DateTable>\n"],"names":[],"mappings":";;;;;AAEY,MAAC,oBAAoB,GAAG,CAAC,IAAI,EAAE,KAAK,KAAK;AACrD,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;AAClE,EAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,OAAO,IAAI,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1E,EAAE;AACU,MAAC,YAAY,GAAG,CAAC,IAAI,KAAK;AACtC,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;AAClC,EAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC;AACrD,EAAE;AACU,MAAC,WAAW,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK;AAC9E,EAAE,MAAM,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;AAC1B,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AACtC,CAAC,EAAE;AACS,MAAC,cAAc,GAAG,UAAU,CAAC;AACzC,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,OAAO;AACjB,GAAG;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"date-table2.mjs","sources":["../../../../../../packages/components/calendar/src/date-table.vue"],"sourcesContent":["<template>\n <table\n :class=\"[nsTable.b(), nsTable.is('range', isInRange)]\"\n cellspacing=\"0\"\n cellpadding=\"0\"\n >\n <thead v-if=\"!hideHeader\">\n <th v-for=\"day in weekDays\" :key=\"day\">{{ day }}</th>\n </thead>\n\n <tbody>\n <tr\n v-for=\"(row, index) in rows\"\n :key=\"index\"\n :class=\"{\n [nsTable.e('row')]: true,\n [nsTable.em('row', 'hide-border')]: index === 0 && hideHeader,\n }\"\n >\n <td\n v-for=\"(cell, key) in row\"\n :key=\"key\"\n :class=\"getCellClass(cell)\"\n >\n <div :class=\"nsDay.b()\">\n <slot name=\"dateCell\" :data=\"getSlotData(cell)\">\n <span>{{ cell.text }}</span>\n </slot>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport dayjs from 'dayjs'\nimport localeData from 'dayjs/plugin/localeData.js'\nimport { useLocale, useNamespace } from '@element-ps/hooks'\nimport { rangeArr } from '@element-ps/components/time-picker'\nimport { WEEK_DAYS } from '@element-ps/constants'\nimport {\n dateTableProps,\n getMonthDays,\n getPrevMonthLastDays,\n toNestedArr,\n} from './date-table'\nimport type { CalendarDateCell, CalendarDateCellType } from './date-table'\nimport type { Dayjs } from 'dayjs'\n\ndayjs.extend(localeData)\n\ndefineOptions({\n name: 'DateTable',\n})\n\nconst props = defineProps(dateTableProps)\n\nconst { t, lang } = useLocale()\nconst nsTable = useNamespace('calendar-table')\nconst nsDay = useNamespace('calendar-day')\n\nconst now = dayjs().locale(lang.value)\n// todo better way to get Day.js locale object\nconst firstDayOfWeek: number = (now as any).$locale().weekStart || 0\n\nconst isInRange = computed(() => !!props.range && !!props.range.length)\n\nconst rows = computed(() => {\n let days: CalendarDateCell[] = []\n if (isInRange.value) {\n const [start, end] = props.range!\n const currentMonthRange: CalendarDateCell[] = rangeArr(\n end.date() - start.date() + 1\n ).map((index) => ({\n text: start.date() + index,\n type: 'current',\n }))\n\n let remaining = currentMonthRange.length % 7\n remaining = remaining === 0 ? 0 : 7 - remaining\n const nextMonthRange: CalendarDateCell[] = rangeArr(remaining).map(\n (_, index) => ({\n text: index + 1,\n type: 'next',\n })\n )\n days = currentMonthRange.concat(nextMonthRange)\n } else {\n const firstDay = props.date.startOf('month').day()\n const prevMonthDays: CalendarDateCell[] = getPrevMonthLastDays(\n props.date,\n firstDay - firstDayOfWeek\n ).map((day) => ({\n text: day,\n type: 'prev',\n }))\n const currentMonthDays: CalendarDateCell[] = getMonthDays(props.date).map(\n (day) => ({\n text: day,\n type: 'current',\n })\n )\n days = [...prevMonthDays, ...currentMonthDays]\n const remaining = 7 - (days.length % 7 || 7)\n const nextMonthDays: CalendarDateCell[] = rangeArr(remaining).map(\n (_, index) => ({\n text: index + 1,\n type: 'next',\n })\n )\n days = days.concat(nextMonthDays)\n }\n return toNestedArr(days)\n})\n\nconst weekDays = computed(() => {\n const start = firstDayOfWeek\n if (start === 0) {\n return WEEK_DAYS.map((_) => t(`el.datepicker.weeks.${_}`))\n } else {\n return WEEK_DAYS.slice(start)\n .concat(WEEK_DAYS.slice(0, start))\n .map((_) => t(`el.datepicker.weeks.${_}`))\n }\n})\n\nconst getFormattedDate = (day: number, type: CalendarDateCellType): Dayjs => {\n switch (type) {\n case 'prev':\n return props.date.startOf('month').subtract(1, 'month').date(day)\n case 'next':\n return props.date.startOf('month').add(1, 'month').date(day)\n case 'current':\n return props.date.date(day)\n }\n}\n\nconst getCellClass = ({ text, type }: CalendarDateCell) => {\n const classes: string[] = [type]\n if (type === 'current') {\n const date = getFormattedDate(text, type)\n if (date.isSame(props.selectedDay, 'day')) {\n classes.push(nsDay.is('selected'))\n }\n if (date.isSame(now, 'day')) {\n classes.push(nsDay.is('today'))\n }\n }\n return classes\n}\n\nconst getSlotData = ({ text, type }: CalendarDateCell) => {\n const day = getFormattedDate(text, type)\n return {\n isSelected: day.isSame(props.selectedDay),\n type: `${type}-month`,\n day: day.format('YYYY-MM-DD'),\n date: day.toDate(),\n }\n}\n\ndefineExpose({\n /** @description toggle date panel */\n getFormattedDate,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmDA,IAAA,KAAA,CAAA,OAAA,UAAA,CAAA,CAAA;AAQA,IAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,GAAA,SAAA,EAAA,CAAA;AACA,IAAA,MAAA,OAAA,GAAA,aAAA,gBAAA,CAAA,CAAA;AACA,IAAA,MAAA,KAAA,GAAA,aAAA,cAAA,CAAA,CAAA;AAEA,IAAA,MAAA,GAAA,GAAA,KAAA,EAAA,CAAA,MAAA,CAAA,KAAA,KAAA,CAAA,CAAA;AAEA,IAAA,MAAA,cAAA,GAAA,GAAA,CAAA,OAAA,EAAA,CAAA,SAAA,IAAA,CAAA,CAAA;AAEA,IAAA,MAAA,SAAA,GAAA,QAAA,CAAA,MAAA,CAAA,CAAA,KAAA,CAAA,KAAA,IAAA,CAAA,CAAA,KAAA,CAAA,KAAA,CAAA,MAAA,CAAA,CAAA;AAEA,IAAA,MAAA,IAAA,GAAA,SAAA,MAAA;AACA,MAAA,IAAA,OAAA,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;AAAA,QACA,IAAA,EAAA,IAAA,MAAA,EAAA;AAAA,OACA,CAAA;AAAA,KACA,CAAA;AAEA,IAAA,MAAA,CAAA;AAAA,MAEA,gBAAA;AAAA,KACA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -13,7 +13,7 @@ import { CircleClose, Check, ArrowDown } from '@element-plus/icons-vue';
13
13
  import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
14
14
  import { CommonProps } from '../../cascader-panel/src/config.mjs';
15
15
  import { isValidComponentSize } from '../../../utils/vue/validator.mjs';
16
- import { useTooltipContentProps } from '../../tooltip/src/tooltip2.mjs';
16
+ import { useTooltipContentProps } from '../../tooltip/src/tooltip.mjs';
17
17
  import { tagProps } from '../../tag/src/tag.mjs';
18
18
  import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
19
19
  import { useLocale } from '../../../hooks/use-locale/index.mjs';
@@ -1,5 +1,5 @@
1
1
  export declare const PsDropdown: import("element-ps/es/utils").SFCWithInstall<import("vue").DefineComponent<{
2
- readonly trigger: import("element-ps/es/utils").BuildPropReturn<import("element-ps/es/utils").PropWrapper<"click" | "contextmenu" | "focus" | "hover" | ("click" | "contextmenu" | "focus" | "hover")[]>, "hover", unknown, unknown, unknown>;
2
+ readonly trigger: import("element-ps/es/utils").BuildPropReturn<import("element-ps/es/utils").PropWrapper<"hover" | "focus" | "click" | "contextmenu" | ("hover" | "focus" | "click" | "contextmenu")[]>, "hover", unknown, unknown, unknown>;
3
3
  readonly effect: {
4
4
  readonly default: "light";
5
5
  readonly type: import("vue").PropType<string>;
@@ -47,7 +47,7 @@ export declare const PsDropdown: import("element-ps/es/utils").SFCWithInstall<im
47
47
  triggeringElementRef: import("vue").Ref<any>;
48
48
  referenceElementRef: import("vue").Ref<any>;
49
49
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "visible-change" | "command")[], "click" | "visible-change" | "command", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
50
- readonly trigger: import("element-ps/es/utils").BuildPropReturn<import("element-ps/es/utils").PropWrapper<"click" | "contextmenu" | "focus" | "hover" | ("click" | "contextmenu" | "focus" | "hover")[]>, "hover", unknown, unknown, unknown>;
50
+ readonly trigger: import("element-ps/es/utils").BuildPropReturn<import("element-ps/es/utils").PropWrapper<"hover" | "focus" | "click" | "contextmenu" | ("hover" | "focus" | "click" | "contextmenu")[]>, "hover", unknown, unknown, unknown>;
51
51
  readonly effect: {
52
52
  readonly default: "light";
53
53
  readonly type: import("vue").PropType<string>;
@@ -79,7 +79,7 @@ export declare const PsDropdown: import("element-ps/es/utils").SFCWithInstall<im
79
79
  type: import("element-ps/es/utils").BuildPropType<import("element-ps/es/utils").PropWrapper<import("element-ps/es/utils").BuildPropType<StringConstructor, "" | "default" | "primary" | "success" | "warning" | "info" | "danger" | "text", unknown>>, unknown, unknown>;
80
80
  size: string;
81
81
  disabled: import("element-ps/es/utils").BuildPropType<BooleanConstructor, unknown, unknown>;
82
- trigger: import("element-ps/es/utils").BuildPropType<import("element-ps/es/utils").PropWrapper<"click" | "contextmenu" | "focus" | "hover" | ("click" | "contextmenu" | "focus" | "hover")[]>, unknown, unknown>;
82
+ trigger: import("element-ps/es/utils").BuildPropType<import("element-ps/es/utils").PropWrapper<"hover" | "focus" | "click" | "contextmenu" | ("hover" | "focus" | "click" | "contextmenu")[]>, unknown, unknown>;
83
83
  offset: number;
84
84
  effect: string;
85
85
  tabindex: import("element-ps/es/utils").BuildPropType<import("element-ps/es/utils").PropWrapper<string | number>, unknown, unknown>;
@@ -1,8 +1,8 @@
1
1
  import '../../utils/index.mjs';
2
- import Dropdown from './src/dropdown.mjs';
2
+ import Dropdown from './src/dropdown2.mjs';
3
3
  import DropdownItem from './src/dropdown-item.mjs';
4
4
  import DropdownMenu from './src/dropdown-menu.mjs';
5
- export { DROPDOWN_COLLECTION_INJECTION_KEY, DROPDOWN_COLLECTION_ITEM_INJECTION_KEY, FIRST_KEYS, FIRST_LAST_KEYS, LAST_KEYS, PsCollection, PsCollectionItem, dropdownItemProps, dropdownMenuProps, dropdownProps } from './src/dropdown2.mjs';
5
+ export { DROPDOWN_COLLECTION_INJECTION_KEY, DROPDOWN_COLLECTION_ITEM_INJECTION_KEY, FIRST_KEYS, FIRST_LAST_KEYS, LAST_KEYS, PsCollection, PsCollectionItem, dropdownItemProps, dropdownMenuProps, dropdownProps } from './src/dropdown.mjs';
6
6
  export { DROPDOWN_INJECTION_KEY } from './src/tokens.mjs';
7
7
  import { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';
8
8
 
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, resolveComponent, openBlock, createElementBlock, Fragment, mergeProps, createCommentVNode, createElementVNode, createBlock, withCtx, resolveDynamicComponent, renderSlot } from 'vue';
2
2
  import { PsIcon } from '../../icon/index.mjs';
3
3
  import '../../../hooks/index.mjs';
4
- import { dropdownItemProps } from './dropdown2.mjs';
4
+ import { dropdownItemProps } from './dropdown.mjs';
5
5
  import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
6
  import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, ref, computed, unref, resolveComponent, openBlock, createBlock, withCtx, createVNode, normalizeProps, guardReactiveProps, renderSlot } from 'vue';
2
2
  import '../../roving-focus-group/index.mjs';
3
3
  import PsDropdownItemImpl from './dropdown-item-impl.mjs';
4
- import { PsCollectionItem, dropdownItemProps } from './dropdown2.mjs';
4
+ import { PsCollectionItem, dropdownItemProps } from './dropdown.mjs';
5
5
  import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
6
  import PsRovingFocusItem from '../../roving-focus-group/src/roving-focus-item.mjs';
7
7
 
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, renderSlot } from 'vue';
2
2
  import '../../../hooks/index.mjs';
3
- import { dropdownMenuProps } from './dropdown2.mjs';
3
+ import { dropdownMenuProps } from './dropdown.mjs';
4
4
  import { useDropdown } from './useDropdown.mjs';
5
5
  import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
6
  import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
@@ -15,7 +15,7 @@ export interface IPsDropdownInstance {
15
15
  triggerElm?: ComputedRef<Nullable<HTMLButtonElement>>;
16
16
  }
17
17
  export declare const dropdownProps: {
18
- readonly trigger: import("element-ps/es/utils").BuildPropReturn<import("element-ps/es/utils").PropWrapper<"click" | "contextmenu" | "focus" | "hover" | ("click" | "contextmenu" | "focus" | "hover")[]>, "hover", unknown, unknown, unknown>;
18
+ readonly trigger: import("element-ps/es/utils").BuildPropReturn<import("element-ps/es/utils").PropWrapper<"hover" | "focus" | "click" | "contextmenu" | ("hover" | "focus" | "click" | "contextmenu")[]>, "hover", unknown, unknown, unknown>;
19
19
  readonly effect: {
20
20
  readonly default: "light";
21
21
  readonly type: import("vue").PropType<string>;
@@ -1,115 +1,106 @@
1
- import { defineComponent, getCurrentInstance, ref, computed, provide, toRef, resolveComponent, openBlock, createElementBlock, normalizeClass, renderSlot, createCommentVNode, createBlock, withCtx, createVNode, mergeProps } from 'vue';
2
- import { PsButton } from '../../button/index.mjs';
3
- import { PsIcon } from '../../icon/index.mjs';
4
1
  import '../../../utils/index.mjs';
5
- import { ArrowDown } from '@element-plus/icons-vue';
6
- import '../../../hooks/index.mjs';
7
- import { dropdownProps } from './dropdown2.mjs';
8
- import { DROPDOWN_INJECTION_KEY } from './tokens.mjs';
9
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
10
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
11
- import { addUnit } from '../../../utils/dom/style.mjs';
12
- import { useSize } from '../../../hooks/use-common-props/index.mjs';
2
+ import '../../../constants/index.mjs';
3
+ import '../../collection/index.mjs';
4
+ import '../../tooltip/index.mjs';
5
+ import { buildProps, definePropType } from '../../../utils/vue/props.mjs';
6
+ import { useTooltipTriggerProps, useTooltipContentProps } from '../../tooltip/src/tooltip.mjs';
7
+ import { iconPropType } from '../../../utils/vue/icon.mjs';
8
+ import { EVENT_CODE } from '../../../constants/aria.mjs';
9
+ import { createCollectionWithScope } from '../../collection/src/collection2.mjs';
13
10
 
14
- const { ButtonGroup: PsButtonGroup } = PsButton;
15
- const _sfc_main = defineComponent({
16
- name: "PsDropdown",
17
- components: {
18
- PsButton,
19
- PsButtonGroup,
20
- PsIcon,
21
- ArrowDown
22
- },
23
- props: dropdownProps,
24
- emits: ["visible-change", "click", "command"],
25
- setup(props) {
26
- const _instance = getCurrentInstance();
27
- const ns = useNamespace("dropdown");
28
- const triggeringElementRef = ref();
29
- const referenceElementRef = ref();
30
- const popperRef = ref(null);
31
- const contentRef = ref(null);
32
- const scrollbar = ref(null);
33
- const currentTabId = ref(null);
34
- const isUsingKeyboard = ref(false);
35
- const wrapStyle = computed(() => ({
36
- maxHeight: addUnit(props.maxHeight)
37
- }));
38
- const dropdownTriggerKls = computed(() => [ns.m(dropdownSize.value)]);
39
- const dropdownSize = useSize();
40
- provide(DROPDOWN_INJECTION_KEY, {
41
- contentRef,
42
- isUsingKeyboard
43
- });
44
- provide("elDropdown", {
45
- instance: _instance,
46
- dropdownSize,
47
- trigger: toRef(props, "trigger"),
48
- hideOnClick: toRef(props, "hideOnClick")
49
- });
50
- return {
51
- ns,
52
- scrollbar,
53
- wrapStyle,
54
- dropdownTriggerKls,
55
- dropdownSize,
56
- currentTabId,
57
- popperRef,
58
- triggeringElementRef,
59
- referenceElementRef
60
- };
11
+ const dropdownProps = buildProps({
12
+ trigger: useTooltipTriggerProps.trigger,
13
+ effect: {
14
+ ...useTooltipContentProps.effect,
15
+ default: "light"
16
+ },
17
+ type: {
18
+ type: definePropType(String)
19
+ },
20
+ placement: {
21
+ type: definePropType(String),
22
+ default: "bottom"
23
+ },
24
+ popperOptions: {
25
+ type: definePropType(Object),
26
+ default: () => ({})
27
+ },
28
+ size: {
29
+ type: String,
30
+ default: ""
31
+ },
32
+ splitButton: Boolean,
33
+ hideOnClick: {
34
+ type: Boolean,
35
+ default: true
36
+ },
37
+ loop: {
38
+ type: Boolean
39
+ },
40
+ showTimeout: {
41
+ type: Number,
42
+ default: 150
43
+ },
44
+ hideTimeout: {
45
+ type: Number,
46
+ default: 150
47
+ },
48
+ tabindex: {
49
+ type: definePropType([Number, String]),
50
+ default: 0
51
+ },
52
+ maxHeight: {
53
+ type: definePropType([Number, String]),
54
+ default: ""
55
+ },
56
+ popperClass: {
57
+ type: String,
58
+ default: ""
59
+ },
60
+ disabled: {
61
+ type: Boolean,
62
+ default: false
63
+ },
64
+ buttonProps: {
65
+ type: definePropType(Object)
66
+ },
67
+ offset: {
68
+ type: Number,
69
+ default: 0
70
+ },
71
+ showArrow: {
72
+ type: Boolean,
73
+ default: true
61
74
  }
62
75
  });
63
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
64
- const _component_ps_button = resolveComponent("ps-button");
65
- const _component_arrow_down = resolveComponent("arrow-down");
66
- const _component_ps_icon = resolveComponent("ps-icon");
67
- const _component_ps_button_group = resolveComponent("ps-button-group");
68
- return openBlock(), createElementBlock("div", {
69
- class: normalizeClass([_ctx.ns.b(), _ctx.ns.is("disabled", _ctx.disabled)])
70
- }, [
71
- !_ctx.splitButton ? (openBlock(), createElementBlock("div", {
72
- key: 0,
73
- class: normalizeClass(_ctx.dropdownTriggerKls)
74
- }, [
75
- renderSlot(_ctx.$slots, "default")
76
- ], 2)) : createCommentVNode("v-if", true),
77
- _ctx.splitButton ? (openBlock(), createBlock(_component_ps_button_group, { key: 1 }, {
78
- default: withCtx(() => [
79
- createVNode(_component_ps_button, mergeProps({ ref: "referenceElementRef" }, _ctx.buttonProps, {
80
- size: _ctx.dropdownSize,
81
- type: _ctx.type,
82
- disabled: _ctx.disabled
83
- }), {
84
- default: withCtx(() => [
85
- renderSlot(_ctx.$slots, "default")
86
- ]),
87
- _: 3
88
- }, 16, ["size", "type", "disabled"]),
89
- createVNode(_component_ps_button, mergeProps({ ref: "triggeringElementRef" }, _ctx.buttonProps, {
90
- size: _ctx.dropdownSize,
91
- type: _ctx.type,
92
- class: _ctx.ns.e("caret-button"),
93
- disabled: _ctx.disabled
94
- }), {
95
- default: withCtx(() => [
96
- createVNode(_component_ps_icon, {
97
- class: normalizeClass(_ctx.ns.e("icon"))
98
- }, {
99
- default: withCtx(() => [
100
- createVNode(_component_arrow_down)
101
- ]),
102
- _: 1
103
- }, 8, ["class"])
104
- ]),
105
- _: 1
106
- }, 16, ["size", "type", "class", "disabled"])
107
- ]),
108
- _: 3
109
- })) : createCommentVNode("v-if", true)
110
- ], 2);
111
- }
112
- var Dropdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/meng/workspace/element-ps/packages/components/dropdown/src/dropdown.vue"]]);
76
+ const dropdownItemProps = buildProps({
77
+ command: {
78
+ type: [Object, String, Number],
79
+ default: () => ({})
80
+ },
81
+ disabled: Boolean,
82
+ divided: Boolean,
83
+ textValue: String,
84
+ icon: {
85
+ type: iconPropType
86
+ }
87
+ });
88
+ const dropdownMenuProps = buildProps({
89
+ onKeydown: { type: definePropType(Function) }
90
+ });
91
+ const FIRST_KEYS = [
92
+ EVENT_CODE.down,
93
+ EVENT_CODE.pageDown,
94
+ EVENT_CODE.home
95
+ ];
96
+ const LAST_KEYS = [EVENT_CODE.up, EVENT_CODE.pageUp, EVENT_CODE.end];
97
+ const FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];
98
+ const {
99
+ PsCollection,
100
+ PsCollectionItem,
101
+ COLLECTION_INJECTION_KEY,
102
+ COLLECTION_ITEM_INJECTION_KEY
103
+ } = createCollectionWithScope("Dropdown");
113
104
 
114
- export { Dropdown as default };
105
+ export { COLLECTION_INJECTION_KEY as DROPDOWN_COLLECTION_INJECTION_KEY, COLLECTION_ITEM_INJECTION_KEY as DROPDOWN_COLLECTION_ITEM_INJECTION_KEY, FIRST_KEYS, FIRST_LAST_KEYS, LAST_KEYS, PsCollection, PsCollectionItem, dropdownItemProps, dropdownMenuProps, dropdownProps };
115
106
  //# sourceMappingURL=dropdown.mjs.map