element-pe 2.2.99 → 2.2.101

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 (442) hide show
  1. package/dist/index.full.js +73 -44
  2. package/dist/index.full.min.js +13 -13
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +13 -13
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +73 -44
  7. package/es/components/affix/index.mjs +2 -2
  8. package/es/components/affix/src/affix.mjs +26 -119
  9. package/es/components/affix/src/affix.mjs.map +1 -1
  10. package/es/components/affix/src/affix2.mjs +119 -26
  11. package/es/components/affix/src/affix2.mjs.map +1 -1
  12. package/es/components/alert/index.mjs +2 -2
  13. package/es/components/alert/src/alert.mjs +103 -38
  14. package/es/components/alert/src/alert.mjs.map +1 -1
  15. package/es/components/alert/src/alert2.mjs +38 -103
  16. package/es/components/alert/src/alert2.mjs.map +1 -1
  17. package/es/components/autocomplete/src/autocomplete.mjs +1 -1
  18. package/es/components/backtop/index.mjs +2 -2
  19. package/es/components/backtop/src/backtop.mjs +61 -23
  20. package/es/components/backtop/src/backtop.mjs.map +1 -1
  21. package/es/components/backtop/src/backtop2.mjs +23 -61
  22. package/es/components/backtop/src/backtop2.mjs.map +1 -1
  23. package/es/components/badge/index.mjs +2 -2
  24. package/es/components/badge/src/badge.mjs +17 -59
  25. package/es/components/badge/src/badge.mjs.map +1 -1
  26. package/es/components/badge/src/badge2.mjs +59 -17
  27. package/es/components/badge/src/badge2.mjs.map +1 -1
  28. package/es/components/breadcrumb/index.mjs +2 -2
  29. package/es/components/breadcrumb/src/breadcrumb-item.mjs +56 -11
  30. package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
  31. package/es/components/breadcrumb/src/breadcrumb-item2.mjs +11 -56
  32. package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
  33. package/es/components/carousel/index.mjs +2 -2
  34. package/es/components/carousel/src/carousel-item.mjs +8 -69
  35. package/es/components/carousel/src/carousel-item.mjs.map +1 -1
  36. package/es/components/carousel/src/carousel-item2.mjs +69 -8
  37. package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
  38. package/es/components/cascader/index.mjs +2 -2
  39. package/es/components/cascader/src/cascader.mjs +647 -86
  40. package/es/components/cascader/src/cascader.mjs.map +1 -1
  41. package/es/components/cascader/src/cascader2.mjs +86 -647
  42. package/es/components/cascader/src/cascader2.mjs.map +1 -1
  43. package/es/components/cascader-panel/src/index.mjs +1 -1
  44. package/es/components/cascader-panel/src/menu.mjs +1 -1
  45. package/es/components/cascader-panel/src/node.mjs +116 -209
  46. package/es/components/cascader-panel/src/node.mjs.map +1 -1
  47. package/es/components/cascader-panel/src/node2.mjs +209 -116
  48. package/es/components/cascader-panel/src/node2.mjs.map +1 -1
  49. package/es/components/cascader-panel/src/store.mjs +1 -1
  50. package/es/components/collection/index.mjs +1 -1
  51. package/es/components/collection/src/collection.mjs +66 -10
  52. package/es/components/collection/src/collection.mjs.map +1 -1
  53. package/es/components/collection/src/collection2.mjs +10 -66
  54. package/es/components/collection/src/collection2.mjs.map +1 -1
  55. package/es/components/color-picker/src/color-picker.mjs +1 -1
  56. package/es/components/descriptions/src/description2.mjs +1 -1
  57. package/es/components/descriptions/src/descriptions-row.mjs +7 -64
  58. package/es/components/descriptions/src/descriptions-row.mjs.map +1 -1
  59. package/es/components/descriptions/src/descriptions-row2.mjs +64 -7
  60. package/es/components/descriptions/src/descriptions-row2.mjs.map +1 -1
  61. package/es/components/dialog/index.mjs +2 -2
  62. package/es/components/dialog/src/dialog.mjs +175 -72
  63. package/es/components/dialog/src/dialog.mjs.map +1 -1
  64. package/es/components/dialog/src/dialog2.mjs +72 -175
  65. package/es/components/dialog/src/dialog2.mjs.map +1 -1
  66. package/es/components/divider/index.mjs +2 -2
  67. package/es/components/divider/src/divider.mjs +35 -17
  68. package/es/components/divider/src/divider.mjs.map +1 -1
  69. package/es/components/divider/src/divider2.mjs +17 -35
  70. package/es/components/divider/src/divider2.mjs.map +1 -1
  71. package/es/components/drawer/index.mjs +2 -2
  72. package/es/components/drawer/src/drawer.mjs +29 -187
  73. package/es/components/drawer/src/drawer.mjs.map +1 -1
  74. package/es/components/drawer/src/drawer2.mjs +187 -29
  75. package/es/components/drawer/src/drawer2.mjs.map +1 -1
  76. package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
  77. package/es/components/dropdown/src/dropdown.mjs +3 -3
  78. package/es/components/form/index.mjs +2 -2
  79. package/es/components/form/src/form-item.mjs +46 -328
  80. package/es/components/form/src/form-item.mjs.map +1 -1
  81. package/es/components/form/src/form-item2.mjs +328 -46
  82. package/es/components/form/src/form-item2.mjs.map +1 -1
  83. package/es/components/icon/index.mjs +2 -2
  84. package/es/components/icon/src/icon.mjs +8 -36
  85. package/es/components/icon/src/icon.mjs.map +1 -1
  86. package/es/components/icon/src/icon2.mjs +36 -8
  87. package/es/components/icon/src/icon2.mjs.map +1 -1
  88. package/es/components/index.mjs +33 -33
  89. package/es/components/link/index.mjs +2 -2
  90. package/es/components/link/src/link.mjs +50 -21
  91. package/es/components/link/src/link.mjs.map +1 -1
  92. package/es/components/link/src/link2.mjs +21 -50
  93. package/es/components/link/src/link2.mjs.map +1 -1
  94. package/es/components/menu/index.mjs +2 -2
  95. package/es/components/menu/src/menu-item.mjs +14 -97
  96. package/es/components/menu/src/menu-item.mjs.map +1 -1
  97. package/es/components/menu/src/menu-item2.mjs +97 -14
  98. package/es/components/menu/src/menu-item2.mjs.map +1 -1
  99. package/es/components/message/index.mjs +1 -1
  100. package/es/components/message/src/message.mjs +86 -151
  101. package/es/components/message/src/message.mjs.map +1 -1
  102. package/es/components/message/src/message2.mjs +151 -86
  103. package/es/components/message/src/message2.mjs.map +1 -1
  104. package/es/components/message/src/method.mjs +2 -2
  105. package/es/components/notification/index.mjs +1 -1
  106. package/es/components/notification/src/notification.mjs +67 -151
  107. package/es/components/notification/src/notification.mjs.map +1 -1
  108. package/es/components/notification/src/notification2.mjs +151 -67
  109. package/es/components/notification/src/notification2.mjs.map +1 -1
  110. package/es/components/notification/src/notify.mjs +2 -2
  111. package/es/components/pagination/src/components/pager.mjs +17 -218
  112. package/es/components/pagination/src/components/pager.mjs.map +1 -1
  113. package/es/components/pagination/src/components/pager2.mjs +218 -17
  114. package/es/components/pagination/src/components/pager2.mjs.map +1 -1
  115. package/es/components/pagination/src/components/sizes.mjs +71 -23
  116. package/es/components/pagination/src/components/sizes.mjs.map +1 -1
  117. package/es/components/pagination/src/components/sizes2.mjs +23 -71
  118. package/es/components/pagination/src/components/sizes2.mjs.map +1 -1
  119. package/es/components/pagination/src/components/total.mjs +7 -28
  120. package/es/components/pagination/src/components/total.mjs.map +1 -1
  121. package/es/components/pagination/src/components/total2.mjs +28 -7
  122. package/es/components/pagination/src/components/total2.mjs.map +1 -1
  123. package/es/components/pagination/src/pagination.mjs +3 -3
  124. package/es/components/popconfirm/index.mjs +2 -2
  125. package/es/components/popconfirm/src/popconfirm.mjs +110 -47
  126. package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
  127. package/es/components/popconfirm/src/popconfirm2.mjs +47 -110
  128. package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
  129. package/es/components/popover/src/popover.mjs +2 -2
  130. package/es/components/popper/index.mjs +4 -4
  131. package/es/components/popper/src/arrow.mjs +8 -39
  132. package/es/components/popper/src/arrow.mjs.map +1 -1
  133. package/es/components/popper/src/arrow2.mjs +39 -8
  134. package/es/components/popper/src/arrow2.mjs.map +1 -1
  135. package/es/components/popper/src/trigger.mjs +31 -121
  136. package/es/components/popper/src/trigger.mjs.map +1 -1
  137. package/es/components/popper/src/trigger2.mjs +121 -31
  138. package/es/components/popper/src/trigger2.mjs.map +1 -1
  139. package/es/components/progress/index.mjs +2 -2
  140. package/es/components/progress/src/progress.mjs +205 -59
  141. package/es/components/progress/src/progress.mjs.map +1 -1
  142. package/es/components/progress/src/progress2.mjs +59 -205
  143. package/es/components/progress/src/progress2.mjs.map +1 -1
  144. package/es/components/resizable-columns/index.mjs +2 -2
  145. package/es/components/resizable-columns/src/resizable-columns.mjs +264 -21
  146. package/es/components/resizable-columns/src/resizable-columns.mjs.map +1 -1
  147. package/es/components/resizable-columns/src/resizable-columns2.mjs +21 -264
  148. package/es/components/resizable-columns/src/resizable-columns2.mjs.map +1 -1
  149. package/es/components/roving-focus-group/src/roving-focus-group.mjs +1 -1
  150. package/es/components/row/index.mjs +2 -2
  151. package/es/components/row/src/row.mjs +45 -29
  152. package/es/components/row/src/row.mjs.map +1 -1
  153. package/es/components/row/src/row2.mjs +29 -45
  154. package/es/components/row/src/row2.mjs.map +1 -1
  155. package/es/components/scrollbar/src/bar.mjs +17 -42
  156. package/es/components/scrollbar/src/bar.mjs.map +1 -1
  157. package/es/components/scrollbar/src/bar2.mjs +42 -17
  158. package/es/components/scrollbar/src/bar2.mjs.map +1 -1
  159. package/es/components/scrollbar/src/scrollbar.mjs +1 -1
  160. package/es/components/select/src/select.mjs +1 -1
  161. package/es/components/select-v2/src/defaults.mjs +1 -1
  162. package/es/components/select-v2/src/useSelect.mjs +1 -1
  163. package/es/components/select-v2/src/useSelect.mjs.map +1 -1
  164. package/es/components/steps/index.mjs +2 -2
  165. package/es/components/steps/src/steps.mjs +36 -39
  166. package/es/components/steps/src/steps.mjs.map +1 -1
  167. package/es/components/steps/src/steps2.mjs +39 -36
  168. package/es/components/steps/src/steps2.mjs.map +1 -1
  169. package/es/components/switch/index.mjs +2 -2
  170. package/es/components/switch/src/switch.mjs +268 -103
  171. package/es/components/switch/src/switch.mjs.map +1 -1
  172. package/es/components/switch/src/switch2.mjs +103 -268
  173. package/es/components/switch/src/switch2.mjs.map +1 -1
  174. package/es/components/table/src/store/watcher.mjs +42 -15
  175. package/es/components/table/src/store/watcher.mjs.map +1 -1
  176. package/es/components/table/src/table-body/defaults.d.ts +2 -1
  177. package/es/components/table/src/table-body/defaults.mjs +2 -1
  178. package/es/components/table/src/table-body/defaults.mjs.map +1 -1
  179. package/es/components/table/src/table-body/render-helper.mjs +6 -4
  180. package/es/components/table/src/table-body/render-helper.mjs.map +1 -1
  181. package/es/components/text/index.mjs +2 -2
  182. package/es/components/text/src/text.mjs +38 -24
  183. package/es/components/text/src/text.mjs.map +1 -1
  184. package/es/components/text/src/text2.mjs +24 -38
  185. package/es/components/text/src/text2.mjs.map +1 -1
  186. package/es/components/timeline/index.mjs +2 -2
  187. package/es/components/timeline/src/timeline-item.mjs +72 -42
  188. package/es/components/timeline/src/timeline-item.mjs.map +1 -1
  189. package/es/components/timeline/src/timeline-item2.mjs +42 -72
  190. package/es/components/timeline/src/timeline-item2.mjs.map +1 -1
  191. package/es/components/tooltip/index.mjs +4 -4
  192. package/es/components/tooltip/src/content.mjs +31 -179
  193. package/es/components/tooltip/src/content.mjs.map +1 -1
  194. package/es/components/tooltip/src/content2.mjs +179 -31
  195. package/es/components/tooltip/src/content2.mjs.map +1 -1
  196. package/es/components/tooltip/src/tooltip.mjs +31 -175
  197. package/es/components/tooltip/src/tooltip.mjs.map +1 -1
  198. package/es/components/tooltip/src/tooltip2.mjs +175 -31
  199. package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
  200. package/es/components/tooltip/src/trigger.mjs +16 -73
  201. package/es/components/tooltip/src/trigger.mjs.map +1 -1
  202. package/es/components/tooltip/src/trigger2.mjs +73 -16
  203. package/es/components/tooltip/src/trigger2.mjs.map +1 -1
  204. package/es/components/tooltip-v2/src/content2.mjs +1 -1
  205. package/es/components/upload/index.mjs +3 -3
  206. package/es/components/upload/src/upload-content.mjs +1 -1
  207. package/es/components/upload/src/upload-content2.mjs +2 -2
  208. package/es/components/upload/src/upload-dragger.mjs +11 -72
  209. package/es/components/upload/src/upload-dragger.mjs.map +1 -1
  210. package/es/components/upload/src/upload-dragger2.mjs +72 -11
  211. package/es/components/upload/src/upload-dragger2.mjs.map +1 -1
  212. package/es/components/upload/src/upload-list.mjs +1 -1
  213. package/es/components/upload/src/upload.mjs +102 -116
  214. package/es/components/upload/src/upload.mjs.map +1 -1
  215. package/es/components/upload/src/upload2.mjs +116 -102
  216. package/es/components/upload/src/upload2.mjs.map +1 -1
  217. package/es/components/upload/src/use-handlers.mjs +1 -1
  218. package/es/components/visual-hidden/index.mjs +3 -3
  219. package/es/components/visual-hidden/src/visual-hidden.mjs +35 -7
  220. package/es/components/visual-hidden/src/visual-hidden.mjs.map +1 -1
  221. package/es/components/visual-hidden/src/visual-hidden2.mjs +7 -35
  222. package/es/components/visual-hidden/src/visual-hidden2.mjs.map +1 -1
  223. package/es/index.mjs +33 -33
  224. package/lib/components/affix/index.js +2 -2
  225. package/lib/components/affix/src/affix.js +27 -119
  226. package/lib/components/affix/src/affix.js.map +1 -1
  227. package/lib/components/affix/src/affix2.js +119 -27
  228. package/lib/components/affix/src/affix2.js.map +1 -1
  229. package/lib/components/alert/index.js +2 -2
  230. package/lib/components/alert/src/alert.js +102 -39
  231. package/lib/components/alert/src/alert.js.map +1 -1
  232. package/lib/components/alert/src/alert2.js +39 -102
  233. package/lib/components/alert/src/alert2.js.map +1 -1
  234. package/lib/components/autocomplete/src/autocomplete.js +1 -1
  235. package/lib/components/backtop/index.js +2 -2
  236. package/lib/components/backtop/src/backtop.js +61 -24
  237. package/lib/components/backtop/src/backtop.js.map +1 -1
  238. package/lib/components/backtop/src/backtop2.js +24 -61
  239. package/lib/components/backtop/src/backtop2.js.map +1 -1
  240. package/lib/components/badge/index.js +2 -2
  241. package/lib/components/badge/src/badge.js +17 -59
  242. package/lib/components/badge/src/badge.js.map +1 -1
  243. package/lib/components/badge/src/badge2.js +59 -17
  244. package/lib/components/badge/src/badge2.js.map +1 -1
  245. package/lib/components/breadcrumb/index.js +2 -2
  246. package/lib/components/breadcrumb/src/breadcrumb-item.js +56 -11
  247. package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
  248. package/lib/components/breadcrumb/src/breadcrumb-item2.js +11 -56
  249. package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
  250. package/lib/components/carousel/index.js +2 -2
  251. package/lib/components/carousel/src/carousel-item.js +8 -69
  252. package/lib/components/carousel/src/carousel-item.js.map +1 -1
  253. package/lib/components/carousel/src/carousel-item2.js +69 -8
  254. package/lib/components/carousel/src/carousel-item2.js.map +1 -1
  255. package/lib/components/cascader/index.js +2 -2
  256. package/lib/components/cascader/src/cascader.js +647 -87
  257. package/lib/components/cascader/src/cascader.js.map +1 -1
  258. package/lib/components/cascader/src/cascader2.js +87 -647
  259. package/lib/components/cascader/src/cascader2.js.map +1 -1
  260. package/lib/components/cascader-panel/src/index.js +1 -1
  261. package/lib/components/cascader-panel/src/menu.js +1 -1
  262. package/lib/components/cascader-panel/src/node.js +116 -209
  263. package/lib/components/cascader-panel/src/node.js.map +1 -1
  264. package/lib/components/cascader-panel/src/node2.js +209 -116
  265. package/lib/components/cascader-panel/src/node2.js.map +1 -1
  266. package/lib/components/cascader-panel/src/store.js +1 -1
  267. package/lib/components/collection/index.js +1 -1
  268. package/lib/components/collection/src/collection.js +66 -9
  269. package/lib/components/collection/src/collection.js.map +1 -1
  270. package/lib/components/collection/src/collection2.js +9 -66
  271. package/lib/components/collection/src/collection2.js.map +1 -1
  272. package/lib/components/color-picker/src/color-picker.js +1 -1
  273. package/lib/components/descriptions/src/description2.js +1 -1
  274. package/lib/components/descriptions/src/descriptions-row.js +7 -64
  275. package/lib/components/descriptions/src/descriptions-row.js.map +1 -1
  276. package/lib/components/descriptions/src/descriptions-row2.js +64 -7
  277. package/lib/components/descriptions/src/descriptions-row2.js.map +1 -1
  278. package/lib/components/dialog/index.js +2 -2
  279. package/lib/components/dialog/src/dialog.js +175 -73
  280. package/lib/components/dialog/src/dialog.js.map +1 -1
  281. package/lib/components/dialog/src/dialog2.js +73 -175
  282. package/lib/components/dialog/src/dialog2.js.map +1 -1
  283. package/lib/components/divider/index.js +2 -2
  284. package/lib/components/divider/src/divider.js +35 -17
  285. package/lib/components/divider/src/divider.js.map +1 -1
  286. package/lib/components/divider/src/divider2.js +17 -35
  287. package/lib/components/divider/src/divider2.js.map +1 -1
  288. package/lib/components/drawer/index.js +2 -2
  289. package/lib/components/drawer/src/drawer.js +30 -187
  290. package/lib/components/drawer/src/drawer.js.map +1 -1
  291. package/lib/components/drawer/src/drawer2.js +187 -30
  292. package/lib/components/drawer/src/drawer2.js.map +1 -1
  293. package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
  294. package/lib/components/dropdown/src/dropdown.js +3 -3
  295. package/lib/components/form/index.js +2 -2
  296. package/lib/components/form/src/form-item.js +47 -332
  297. package/lib/components/form/src/form-item.js.map +1 -1
  298. package/lib/components/form/src/form-item2.js +332 -47
  299. package/lib/components/form/src/form-item2.js.map +1 -1
  300. package/lib/components/icon/index.js +2 -2
  301. package/lib/components/icon/src/icon.js +8 -36
  302. package/lib/components/icon/src/icon.js.map +1 -1
  303. package/lib/components/icon/src/icon2.js +36 -8
  304. package/lib/components/icon/src/icon2.js.map +1 -1
  305. package/lib/components/index.js +33 -33
  306. package/lib/components/link/index.js +2 -2
  307. package/lib/components/link/src/link.js +50 -22
  308. package/lib/components/link/src/link.js.map +1 -1
  309. package/lib/components/link/src/link2.js +22 -50
  310. package/lib/components/link/src/link2.js.map +1 -1
  311. package/lib/components/menu/index.js +2 -2
  312. package/lib/components/menu/src/menu-item.js +15 -97
  313. package/lib/components/menu/src/menu-item.js.map +1 -1
  314. package/lib/components/menu/src/menu-item2.js +97 -15
  315. package/lib/components/menu/src/menu-item2.js.map +1 -1
  316. package/lib/components/message/index.js +1 -1
  317. package/lib/components/message/src/message.js +88 -150
  318. package/lib/components/message/src/message.js.map +1 -1
  319. package/lib/components/message/src/message2.js +150 -88
  320. package/lib/components/message/src/message2.js.map +1 -1
  321. package/lib/components/message/src/method.js +2 -2
  322. package/lib/components/notification/index.js +1 -1
  323. package/lib/components/notification/src/notification.js +68 -150
  324. package/lib/components/notification/src/notification.js.map +1 -1
  325. package/lib/components/notification/src/notification2.js +150 -68
  326. package/lib/components/notification/src/notification2.js.map +1 -1
  327. package/lib/components/notification/src/notify.js +2 -2
  328. package/lib/components/pagination/src/components/pager.js +17 -218
  329. package/lib/components/pagination/src/components/pager.js.map +1 -1
  330. package/lib/components/pagination/src/components/pager2.js +218 -17
  331. package/lib/components/pagination/src/components/pager2.js.map +1 -1
  332. package/lib/components/pagination/src/components/sizes.js +71 -23
  333. package/lib/components/pagination/src/components/sizes.js.map +1 -1
  334. package/lib/components/pagination/src/components/sizes2.js +23 -71
  335. package/lib/components/pagination/src/components/sizes2.js.map +1 -1
  336. package/lib/components/pagination/src/components/total.js +7 -28
  337. package/lib/components/pagination/src/components/total.js.map +1 -1
  338. package/lib/components/pagination/src/components/total2.js +28 -7
  339. package/lib/components/pagination/src/components/total2.js.map +1 -1
  340. package/lib/components/pagination/src/pagination.js +3 -3
  341. package/lib/components/popconfirm/index.js +2 -2
  342. package/lib/components/popconfirm/src/popconfirm.js +110 -48
  343. package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
  344. package/lib/components/popconfirm/src/popconfirm2.js +48 -110
  345. package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
  346. package/lib/components/popover/src/popover.js +2 -2
  347. package/lib/components/popper/index.js +4 -4
  348. package/lib/components/popper/src/arrow.js +9 -39
  349. package/lib/components/popper/src/arrow.js.map +1 -1
  350. package/lib/components/popper/src/arrow2.js +39 -9
  351. package/lib/components/popper/src/arrow2.js.map +1 -1
  352. package/lib/components/popper/src/trigger.js +32 -121
  353. package/lib/components/popper/src/trigger.js.map +1 -1
  354. package/lib/components/popper/src/trigger2.js +121 -32
  355. package/lib/components/popper/src/trigger2.js.map +1 -1
  356. package/lib/components/progress/index.js +2 -2
  357. package/lib/components/progress/src/progress.js +205 -59
  358. package/lib/components/progress/src/progress.js.map +1 -1
  359. package/lib/components/progress/src/progress2.js +59 -205
  360. package/lib/components/progress/src/progress2.js.map +1 -1
  361. package/lib/components/resizable-columns/index.js +2 -2
  362. package/lib/components/resizable-columns/src/resizable-columns.js +264 -21
  363. package/lib/components/resizable-columns/src/resizable-columns.js.map +1 -1
  364. package/lib/components/resizable-columns/src/resizable-columns2.js +21 -264
  365. package/lib/components/resizable-columns/src/resizable-columns2.js.map +1 -1
  366. package/lib/components/roving-focus-group/src/roving-focus-group.js +1 -1
  367. package/lib/components/row/index.js +2 -2
  368. package/lib/components/row/src/row.js +45 -31
  369. package/lib/components/row/src/row.js.map +1 -1
  370. package/lib/components/row/src/row2.js +31 -45
  371. package/lib/components/row/src/row2.js.map +1 -1
  372. package/lib/components/scrollbar/src/bar.js +17 -42
  373. package/lib/components/scrollbar/src/bar.js.map +1 -1
  374. package/lib/components/scrollbar/src/bar2.js +42 -17
  375. package/lib/components/scrollbar/src/bar2.js.map +1 -1
  376. package/lib/components/scrollbar/src/scrollbar.js +1 -1
  377. package/lib/components/select/src/select.js +1 -1
  378. package/lib/components/select-v2/src/defaults.js +1 -1
  379. package/lib/components/select-v2/src/useSelect.js +1 -1
  380. package/lib/components/select-v2/src/useSelect.js.map +1 -1
  381. package/lib/components/steps/index.js +2 -2
  382. package/lib/components/steps/src/steps.js +37 -39
  383. package/lib/components/steps/src/steps.js.map +1 -1
  384. package/lib/components/steps/src/steps2.js +39 -37
  385. package/lib/components/steps/src/steps2.js.map +1 -1
  386. package/lib/components/switch/index.js +2 -2
  387. package/lib/components/switch/src/switch.js +267 -103
  388. package/lib/components/switch/src/switch.js.map +1 -1
  389. package/lib/components/switch/src/switch2.js +103 -267
  390. package/lib/components/switch/src/switch2.js.map +1 -1
  391. package/lib/components/table/src/store/watcher.js +42 -15
  392. package/lib/components/table/src/store/watcher.js.map +1 -1
  393. package/lib/components/table/src/table-body/defaults.d.ts +2 -1
  394. package/lib/components/table/src/table-body/defaults.js +2 -0
  395. package/lib/components/table/src/table-body/defaults.js.map +1 -1
  396. package/lib/components/table/src/table-body/render-helper.js +6 -4
  397. package/lib/components/table/src/table-body/render-helper.js.map +1 -1
  398. package/lib/components/text/index.js +2 -2
  399. package/lib/components/text/src/text.js +38 -24
  400. package/lib/components/text/src/text.js.map +1 -1
  401. package/lib/components/text/src/text2.js +24 -38
  402. package/lib/components/text/src/text2.js.map +1 -1
  403. package/lib/components/timeline/index.js +2 -2
  404. package/lib/components/timeline/src/timeline-item.js +72 -42
  405. package/lib/components/timeline/src/timeline-item.js.map +1 -1
  406. package/lib/components/timeline/src/timeline-item2.js +42 -72
  407. package/lib/components/timeline/src/timeline-item2.js.map +1 -1
  408. package/lib/components/tooltip/index.js +4 -4
  409. package/lib/components/tooltip/src/content.js +31 -179
  410. package/lib/components/tooltip/src/content.js.map +1 -1
  411. package/lib/components/tooltip/src/content2.js +179 -31
  412. package/lib/components/tooltip/src/content2.js.map +1 -1
  413. package/lib/components/tooltip/src/tooltip.js +33 -173
  414. package/lib/components/tooltip/src/tooltip.js.map +1 -1
  415. package/lib/components/tooltip/src/tooltip2.js +173 -33
  416. package/lib/components/tooltip/src/tooltip2.js.map +1 -1
  417. package/lib/components/tooltip/src/trigger.js +16 -73
  418. package/lib/components/tooltip/src/trigger.js.map +1 -1
  419. package/lib/components/tooltip/src/trigger2.js +73 -16
  420. package/lib/components/tooltip/src/trigger2.js.map +1 -1
  421. package/lib/components/tooltip-v2/src/content2.js +1 -1
  422. package/lib/components/upload/index.js +3 -3
  423. package/lib/components/upload/src/upload-content.js +1 -1
  424. package/lib/components/upload/src/upload-content2.js +2 -2
  425. package/lib/components/upload/src/upload-dragger.js +12 -72
  426. package/lib/components/upload/src/upload-dragger.js.map +1 -1
  427. package/lib/components/upload/src/upload-dragger2.js +72 -12
  428. package/lib/components/upload/src/upload-dragger2.js.map +1 -1
  429. package/lib/components/upload/src/upload-list.js +1 -1
  430. package/lib/components/upload/src/upload.js +105 -116
  431. package/lib/components/upload/src/upload.js.map +1 -1
  432. package/lib/components/upload/src/upload2.js +116 -105
  433. package/lib/components/upload/src/upload2.js.map +1 -1
  434. package/lib/components/upload/src/use-handlers.js +1 -1
  435. package/lib/components/visual-hidden/index.js +2 -2
  436. package/lib/components/visual-hidden/src/visual-hidden.js +35 -7
  437. package/lib/components/visual-hidden/src/visual-hidden.js.map +1 -1
  438. package/lib/components/visual-hidden/src/visual-hidden2.js +7 -35
  439. package/lib/components/visual-hidden/src/visual-hidden2.js.map +1 -1
  440. package/lib/index.js +33 -33
  441. package/package.json +1 -1
  442. package/web-types.json +1 -1
@@ -2,99 +2,161 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('../../../utils/index.js');
6
- var typescript = require('../../../utils/typescript.js');
5
+ var vue = require('vue');
6
+ require('../../config-provider/index.js');
7
7
  var core = require('@vueuse/core');
8
- var runtime = require('../../../utils/vue/props/runtime.js');
8
+ require('../../../utils/index.js');
9
+ require('../../../constants/index.js');
10
+ var index = require('../../badge/index.js');
11
+ var index$1 = require('../../icon/index.js');
12
+ var message = require('./message.js');
13
+ var instance = require('./instance.js');
14
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
15
+ var useGlobalConfig = require('../../config-provider/src/hooks/use-global-config.js');
9
16
  var icon = require('../../../utils/vue/icon.js');
17
+ var aria = require('../../../constants/aria.js');
18
+ var forEditor = require('../../config-provider/src/for-editor.js');
10
19
 
11
- const messageTypes = ["success", "info", "warning", "error"];
12
- const messageDefaults = typescript.mutable({
13
- customClass: "",
14
- center: false,
15
- dangerouslyUseHTMLString: false,
16
- duration: 3e3,
17
- icon: void 0,
18
- id: "",
19
- message: "",
20
- onClose: void 0,
21
- showClose: false,
22
- type: "info",
23
- offset: 16,
24
- zIndex: 0,
25
- grouping: false,
26
- repeatNum: 1,
27
- appendTo: core.isClient ? document.body : void 0
20
+ const _hoisted_1 = ["id"];
21
+ const _hoisted_2 = ["innerHTML"];
22
+ const __default__ = vue.defineComponent({
23
+ name: "ElMessage"
28
24
  });
29
- const messageProps = runtime.buildProps({
30
- customClass: {
31
- type: String,
32
- default: messageDefaults.customClass
33
- },
34
- center: {
35
- type: Boolean,
36
- default: messageDefaults.center
37
- },
38
- dangerouslyUseHTMLString: {
39
- type: Boolean,
40
- default: messageDefaults.dangerouslyUseHTMLString
41
- },
42
- duration: {
43
- type: Number,
44
- default: messageDefaults.duration
45
- },
46
- icon: {
47
- type: icon.iconPropType,
48
- default: messageDefaults.icon
49
- },
50
- id: {
51
- type: String,
52
- default: messageDefaults.id
53
- },
54
- message: {
55
- type: runtime.definePropType([
56
- String,
57
- Object,
58
- Function
59
- ]),
60
- default: messageDefaults.message
61
- },
62
- onClose: {
63
- type: runtime.definePropType(Function),
64
- required: false
65
- },
66
- showClose: {
67
- type: Boolean,
68
- default: messageDefaults.showClose
69
- },
70
- type: {
71
- type: String,
72
- values: messageTypes,
73
- default: messageDefaults.type
74
- },
75
- offset: {
76
- type: Number,
77
- default: messageDefaults.offset
78
- },
79
- zIndex: {
80
- type: Number,
81
- default: messageDefaults.zIndex
82
- },
83
- grouping: {
84
- type: Boolean,
85
- default: messageDefaults.grouping
86
- },
87
- repeatNum: {
88
- type: Number,
89
- default: messageDefaults.repeatNum
25
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
26
+ ...__default__,
27
+ props: message.messageProps,
28
+ emits: message.messageEmits,
29
+ setup(__props, { expose }) {
30
+ const props = __props;
31
+ const forEditor$1 = useGlobalConfig.useGlobalConfig("forEditor");
32
+ const { Close } = icon.TypeComponents;
33
+ const { ns, zIndex } = useGlobalConfig.useGlobalComponentSettings("message");
34
+ const { currentZIndex, nextZIndex } = zIndex;
35
+ const messageRef = vue.ref();
36
+ const visible = vue.ref(false);
37
+ const height = vue.ref(0);
38
+ let stopTimer = void 0;
39
+ const badgeType = vue.computed(() => props.type ? props.type === "error" ? "danger" : props.type : "info");
40
+ const typeClass = vue.computed(() => {
41
+ const type = props.type;
42
+ return { [ns.bm("icon", type)]: type && icon.TypeComponentsMap[type] };
43
+ });
44
+ const iconComponent = vue.computed(() => props.icon || icon.TypeComponentsMap[props.type] || "");
45
+ const lastOffset = vue.computed(() => instance.getLastOffset(props.id));
46
+ const offset = vue.computed(() => instance.getOffsetOrSpace(props.id, props.offset) + lastOffset.value);
47
+ const bottom = vue.computed(() => height.value + offset.value);
48
+ const customStyle = vue.computed(() => ({
49
+ top: `${offset.value}px`,
50
+ zIndex: currentZIndex.value
51
+ }));
52
+ function startTimer() {
53
+ if (props.duration === 0)
54
+ return;
55
+ ({ stop: stopTimer } = core.useTimeoutFn(() => {
56
+ close();
57
+ }, props.duration));
58
+ }
59
+ function clearTimer() {
60
+ stopTimer == null ? void 0 : stopTimer();
61
+ }
62
+ function close() {
63
+ visible.value = false;
64
+ }
65
+ function keydown({ code }) {
66
+ if (code === aria.EVENT_CODE.esc) {
67
+ close();
68
+ }
69
+ }
70
+ vue.onMounted(() => {
71
+ startTimer();
72
+ nextZIndex();
73
+ visible.value = true;
74
+ });
75
+ forEditor.watch(() => props.repeatNum, () => {
76
+ clearTimer();
77
+ startTimer();
78
+ });
79
+ core.useEventListener(document, "keydown", keydown);
80
+ core.useResizeObserver(messageRef, () => {
81
+ height.value = messageRef.value.getBoundingClientRect().height;
82
+ });
83
+ expose({
84
+ visible,
85
+ bottom,
86
+ close
87
+ });
88
+ return (_ctx, _cache) => {
89
+ return vue.openBlock(), vue.createBlock(vue.Transition, {
90
+ name: vue.unref(ns).b("fade"),
91
+ onBeforeLeave: _ctx.onClose,
92
+ onAfterLeave: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("destroy")),
93
+ duration: vue.unref(forEditor$1) ? -1 : 0,
94
+ persisted: ""
95
+ }, {
96
+ default: vue.withCtx(() => [
97
+ vue.withDirectives(vue.createElementVNode("div", {
98
+ id: _ctx.id,
99
+ ref_key: "messageRef",
100
+ ref: messageRef,
101
+ class: vue.normalizeClass([
102
+ vue.unref(ns).b(),
103
+ { [vue.unref(ns).m(_ctx.type)]: _ctx.type && !_ctx.icon },
104
+ vue.unref(ns).is("center", _ctx.center),
105
+ vue.unref(ns).is("closable", _ctx.showClose),
106
+ _ctx.customClass
107
+ ]),
108
+ style: vue.normalizeStyle(vue.unref(customStyle)),
109
+ role: "alert",
110
+ onMouseenter: clearTimer,
111
+ onMouseleave: startTimer
112
+ }, [
113
+ _ctx.repeatNum > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(index.ElBadge), {
114
+ key: 0,
115
+ value: _ctx.repeatNum,
116
+ type: vue.unref(badgeType),
117
+ class: vue.normalizeClass(vue.unref(ns).e("badge"))
118
+ }, null, 8, ["value", "type", "class"])) : vue.createCommentVNode("v-if", true),
119
+ vue.unref(iconComponent) ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), {
120
+ key: 1,
121
+ class: vue.normalizeClass([vue.unref(ns).e("icon"), vue.unref(typeClass)])
122
+ }, {
123
+ default: vue.withCtx(() => [
124
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(iconComponent))))
125
+ ]),
126
+ _: 1
127
+ }, 8, ["class"])) : vue.createCommentVNode("v-if", true),
128
+ vue.renderSlot(_ctx.$slots, "default", {}, () => [
129
+ !_ctx.dangerouslyUseHTMLString ? (vue.openBlock(), vue.createElementBlock("p", {
130
+ key: 0,
131
+ class: vue.normalizeClass(vue.unref(ns).e("content"))
132
+ }, vue.toDisplayString(_ctx.message), 3)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
133
+ vue.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),
134
+ vue.createElementVNode("p", {
135
+ class: vue.normalizeClass(vue.unref(ns).e("content")),
136
+ innerHTML: _ctx.message
137
+ }, null, 10, _hoisted_2)
138
+ ], 2112))
139
+ ]),
140
+ _ctx.showClose ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), {
141
+ key: 2,
142
+ class: vue.normalizeClass(vue.unref(ns).e("closeBtn")),
143
+ onClick: vue.withModifiers(close, ["stop"])
144
+ }, {
145
+ default: vue.withCtx(() => [
146
+ vue.createVNode(vue.unref(Close))
147
+ ]),
148
+ _: 1
149
+ }, 8, ["class", "onClick"])) : vue.createCommentVNode("v-if", true)
150
+ ], 46, _hoisted_1), [
151
+ [vue.vShow, visible.value]
152
+ ])
153
+ ]),
154
+ _: 3
155
+ }, 8, ["name", "onBeforeLeave", "duration"]);
156
+ };
90
157
  }
91
158
  });
92
- const messageEmits = {
93
- destroy: () => true
94
- };
159
+ var MessageConstructor = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "D:\\workspace\\element-pe\\packages\\components\\message\\src\\message.vue"]]);
95
160
 
96
- exports.messageDefaults = messageDefaults;
97
- exports.messageEmits = messageEmits;
98
- exports.messageProps = messageProps;
99
- exports.messageTypes = messageTypes;
161
+ exports["default"] = MessageConstructor;
100
162
  //# sourceMappingURL=message2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"message2.js","sources":["../../../../../../packages/components/message/src/message.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n iconPropType,\n isClient,\n mutable,\n} from '@element-plus/utils'\nimport type { AppContext, ExtractPropTypes, VNode } from 'vue'\nimport type { Mutable } from '@element-plus/utils'\nimport type MessageConstructor from './message.vue'\n\nexport const messageTypes = ['success', 'info', 'warning', 'error'] as const\n\nexport type messageType = typeof messageTypes[number]\n\nexport interface MessageConfigContext {\n max?: number\n}\n\nexport const messageDefaults = mutable({\n customClass: '',\n center: false,\n dangerouslyUseHTMLString: false,\n duration: 3000,\n icon: undefined,\n id: '',\n message: '',\n onClose: undefined,\n showClose: false,\n type: 'info',\n offset: 16,\n zIndex: 0,\n grouping: false,\n repeatNum: 1,\n appendTo: isClient ? document.body : (undefined as never),\n} as const)\n\nexport const messageProps = buildProps({\n /**\n * @description custom class name for Message\n */\n customClass: {\n type: String,\n default: messageDefaults.customClass,\n },\n /**\n * @description whether to center the text\n */\n center: {\n type: Boolean,\n default: messageDefaults.center,\n },\n /**\n * @description whether `message` is treated as HTML string\n */\n dangerouslyUseHTMLString: {\n type: Boolean,\n default: messageDefaults.dangerouslyUseHTMLString,\n },\n /**\n * @description display duration, millisecond. If set to 0, it will not turn off automatically\n */\n duration: {\n type: Number,\n default: messageDefaults.duration,\n },\n /**\n * @description custom icon component, overrides `type`\n */\n icon: {\n type: iconPropType,\n default: messageDefaults.icon,\n },\n /**\n * @description message dom id\n */\n id: {\n type: String,\n default: messageDefaults.id,\n },\n /**\n * @description message text\n */\n message: {\n type: definePropType<string | VNode | (() => VNode)>([\n String,\n Object,\n Function,\n ]),\n default: messageDefaults.message,\n },\n /**\n * @description callback function when closed with the message instance as the parameter\n */\n onClose: {\n type: definePropType<() => void>(Function),\n required: false,\n },\n /**\n * @description whether to show a close button\n */\n showClose: {\n type: Boolean,\n default: messageDefaults.showClose,\n },\n /**\n * @description message type\n */\n type: {\n type: String,\n values: messageTypes,\n default: messageDefaults.type,\n },\n /**\n * @description set the distance to the top of viewport\n */\n offset: {\n type: Number,\n default: messageDefaults.offset,\n },\n /**\n * @description input box size\n */\n zIndex: {\n type: Number,\n default: messageDefaults.zIndex,\n },\n /**\n * @description merge messages with the same content, type of VNode message is not supported\n */\n grouping: {\n type: Boolean,\n default: messageDefaults.grouping,\n },\n /**\n * @description The number of repetitions, similar to badge, is used as the initial number when used with `grouping`\n */\n repeatNum: {\n type: Number,\n default: messageDefaults.repeatNum,\n },\n} as const)\nexport type MessageProps = ExtractPropTypes<typeof messageProps>\n\nexport const messageEmits = {\n destroy: () => true,\n}\nexport type MessageEmits = typeof messageEmits\n\nexport type MessageInstance = InstanceType<typeof MessageConstructor>\n\nexport type MessageOptions = Partial<\n Mutable<\n Omit<MessageProps, 'id'> & {\n appendTo?: HTMLElement | string\n }\n >\n>\nexport type MessageParams = MessageOptions | MessageOptions['message']\nexport type MessageParamsNormalized = Omit<MessageProps, 'id'> & {\n /**\n * @description set the root element for the message, default to `document.body`\n */\n appendTo: HTMLElement\n}\nexport type MessageOptionsWithType = Omit<MessageOptions, 'type'>\nexport type MessageParamsWithType =\n | MessageOptionsWithType\n | MessageOptions['message']\n\nexport interface MessageHandler {\n /**\n * @description close the Message\n */\n close: () => void\n}\n\nexport type MessageFn = {\n (options?: MessageParams, appContext?: null | AppContext): MessageHandler\n closeAll(type?: messageType): void\n}\nexport type MessageTypedFn = (\n options?: MessageParamsWithType,\n appContext?: null | AppContext\n) => MessageHandler\n\nexport interface Message extends MessageFn {\n success: MessageTypedFn\n warning: MessageTypedFn\n info: MessageTypedFn\n error: MessageTypedFn\n}\n"],"names":["mutable","isClient","buildProps","iconPropType","definePropType"],"mappings":"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"}
1
+ {"version":3,"file":"message2.js","sources":["../../../../../../packages/components/message/src/message.vue"],"sourcesContent":["<template>\n <transition\n :name=\"ns.b('fade')\"\n @before-leave=\"onClose\"\n @after-leave=\"$emit('destroy')\"\n :duration=\"forEditor ? -1 : 0\"\n >\n <div\n v-show=\"visible\"\n :id=\"id\"\n ref=\"messageRef\"\n :class=\"[\n ns.b(),\n { [ns.m(type)]: type && !icon },\n ns.is('center', center),\n ns.is('closable', showClose),\n customClass,\n ]\"\n :style=\"customStyle\"\n role=\"alert\"\n @mouseenter=\"clearTimer\"\n @mouseleave=\"startTimer\"\n >\n <el-badge\n v-if=\"repeatNum > 1\"\n :value=\"repeatNum\"\n :type=\"badgeType\"\n :class=\"ns.e('badge')\"\n />\n <el-icon v-if=\"iconComponent\" :class=\"[ns.e('icon'), typeClass]\">\n <component :is=\"iconComponent\" />\n </el-icon>\n <slot>\n <p v-if=\"!dangerouslyUseHTMLString\" :class=\"ns.e('content')\">\n {{ message }}\n </p>\n <!-- Caution here, message could've been compromised, never use user's input as message -->\n <p v-else :class=\"ns.e('content')\" v-html=\"message\" />\n </slot>\n <el-icon v-if=\"showClose\" :class=\"ns.e('closeBtn')\" @click.stop=\"close\">\n <Close />\n </el-icon>\n </div>\n </transition>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, onMounted, ref } from 'vue'\nimport { useGlobalConfig, watch } from '../../config-provider'\nimport { useEventListener, useResizeObserver, useTimeoutFn } from '@vueuse/core'\nimport { TypeComponents, TypeComponentsMap } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport ElBadge from '@element-plus/components/badge'\nimport { useGlobalComponentSettings } from '@element-plus/components/config-provider'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { messageEmits, messageProps } from './message'\nimport { getLastOffset, getOffsetOrSpace } from './instance'\nimport type { BadgeProps } from '@element-plus/components/badge'\nimport type { CSSProperties } from 'vue'\n\nconst forEditor = useGlobalConfig('forEditor')\n\nconst { Close } = TypeComponents\n\ndefineOptions({\n name: 'ElMessage',\n})\n\nconst props = defineProps(messageProps)\ndefineEmits(messageEmits)\n\nconst { ns, zIndex } = useGlobalComponentSettings('message')\nconst { currentZIndex, nextZIndex } = zIndex\n\nconst messageRef = ref<HTMLDivElement>()\nconst visible = ref(false)\nconst height = ref(0)\n\nlet stopTimer: (() => void) | undefined = undefined\n\nconst badgeType = computed<BadgeProps['type']>(() =>\n props.type ? (props.type === 'error' ? 'danger' : props.type) : 'info'\n)\nconst typeClass = computed(() => {\n const type = props.type\n return { [ns.bm('icon', type)]: type && TypeComponentsMap[type] }\n})\nconst iconComponent = computed(\n () => props.icon || TypeComponentsMap[props.type] || ''\n)\n\nconst lastOffset = computed(() => getLastOffset(props.id))\nconst offset = computed(\n () => getOffsetOrSpace(props.id, props.offset) + lastOffset.value\n)\nconst bottom = computed((): number => height.value + offset.value)\nconst customStyle = computed<CSSProperties>(() => ({\n top: `${offset.value}px`,\n zIndex: currentZIndex.value,\n}))\n\nfunction startTimer() {\n if (props.duration === 0) return\n ;({ stop: stopTimer } = useTimeoutFn(() => {\n close()\n }, props.duration))\n}\n\nfunction clearTimer() {\n stopTimer?.()\n}\n\nfunction close() {\n visible.value = false\n}\n\nfunction keydown({ code }: KeyboardEvent) {\n if (code === EVENT_CODE.esc) {\n // press esc to close the message\n close()\n }\n}\n\nonMounted(() => {\n startTimer()\n nextZIndex()\n visible.value = true\n})\n\nwatch(\n () => props.repeatNum,\n () => {\n clearTimer()\n startTimer()\n }\n)\n\nuseEventListener(document, 'keydown', keydown)\n\nuseResizeObserver(messageRef, () => {\n height.value = messageRef.value!.getBoundingClientRect().height\n})\n\ndefineExpose({\n visible,\n bottom,\n close,\n})\n</script>\n"],"names":["forEditor","useGlobalConfig","TypeComponents","useGlobalComponentSettings","ref","computed","TypeComponentsMap","getLastOffset","getOffsetOrSpace","useTimeoutFn","EVENT_CODE","onMounted","watch","useEventListener","useResizeObserver"],"mappings":";;;;;;;;;;;;;;;;;;;;;uCAgEc,CAAA;AAAA,EACZ,IAAM,EAAA,WAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AANA,IAAM,MAAAA,WAAA,GAAYC,gCAAgB,WAAW,CAAA,CAAA;AAE7C,IAAA,MAAM,EAAE,KAAU,EAAA,GAAAC,mBAAA,CAAA;AASlB,IAAA,MAAM,EAAE,EAAA,EAAI,MAAW,EAAA,GAAAC,0CAAA,CAA2B,SAAS,CAAA,CAAA;AAC3D,IAAM,MAAA,EAAE,eAAe,UAAe,EAAA,GAAA,MAAA,CAAA;AAEtC,IAAA,MAAM,aAAaC,OAAoB,EAAA,CAAA;AACvC,IAAM,MAAA,OAAA,GAAUA,QAAI,KAAK,CAAA,CAAA;AACzB,IAAM,MAAA,MAAA,GAASA,QAAI,CAAC,CAAA,CAAA;AAEpB,IAAA,IAAI,SAAsC,GAAA,KAAA,CAAA,CAAA;AAE1C,IAAM,MAAA,SAAA,GAAYC,YAA6B,CAAA,MAC7C,KAAM,CAAA,IAAA,GAAQ,KAAM,CAAA,IAAA,KAAS,OAAU,GAAA,QAAA,GAAW,KAAM,CAAA,IAAA,GAAQ,MAClE,CAAA,CAAA;AACA,IAAM,MAAA,SAAA,GAAYA,aAAS,MAAM;AAC/B,MAAA,MAAM,OAAO,KAAM,CAAA,IAAA,CAAA;AACnB,MAAO,OAAA,EAAE,CAAC,EAAG,CAAA,EAAA,CAAG,QAAQ,IAAI,CAAA,GAAI,IAAQ,IAAAC,sBAAA,CAAkB,IAAM,CAAA,EAAA,CAAA;AAAA,KACjE,CAAA,CAAA;AACD,IAAM,MAAA,aAAA,GAAgBD,aACpB,MAAM,KAAA,CAAM,QAAQC,sBAAkB,CAAA,KAAA,CAAM,SAAS,EACvD,CAAA,CAAA;AAEA,IAAA,MAAM,aAAaD,YAAS,CAAA,MAAME,sBAAc,CAAA,KAAA,CAAM,EAAE,CAAC,CAAA,CAAA;AACzD,IAAM,MAAA,MAAA,GAASF,YACb,CAAA,MAAMG,yBAAiB,CAAA,KAAA,CAAM,IAAI,KAAM,CAAA,MAAM,CAAI,GAAA,UAAA,CAAW,KAC9D,CAAA,CAAA;AACA,IAAA,MAAM,SAASH,YAAS,CAAA,MAAc,MAAO,CAAA,KAAA,GAAQ,OAAO,KAAK,CAAA,CAAA;AACjE,IAAM,MAAA,WAAA,GAAcA,aAAwB,OAAO;AAAA,MACjD,GAAA,EAAK,GAAG,MAAO,CAAA,KAAA,CAAA,EAAA,CAAA;AAAA,MACf,QAAQ,aAAc,CAAA,KAAA;AAAA,KACtB,CAAA,CAAA,CAAA;AAEF,IAAsB,SAAA,UAAA,GAAA;AACpB,MAAA,IAAI,MAAM,QAAa,KAAA,CAAA;AAAG,QAAA,OAAA;AACzB,MAAC,CAAE,EAAA,IAAA,EAAM,SAAU,EAAA,GAAII,kBAAa,MAAM;AACzC,QAAM,KAAA,EAAA,CAAA;AAAA,OACR,EAAG,MAAM,QAAQ,CAAA,EAAA;AAAA,KACnB;AAEA,IAAsB,SAAA,UAAA,GAAA;AACpB,MAAY,SAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,EAAA,CAAA;AAAA,KACd;AAEA,IAAiB,SAAA,KAAA,GAAA;AACf,MAAA,OAAA,CAAQ,KAAQ,GAAA,KAAA,CAAA;AAAA,KAClB;AAEA,IAAA,SAAA,OAAA,CAAiB,EAAE,IAAuB,EAAA,EAAA;AACxC,MAAI,IAAA,IAAA,KAASC,gBAAW,GAAK,EAAA;AAE3B,QAAM,KAAA,EAAA,CAAA;AAAA,OACR;AAAA,KACF;AAEA,IAAAC,aAAA,CAAU,MAAM;AACd,MAAW,UAAA,EAAA,CAAA;AACX,MAAW,UAAA,EAAA,CAAA;AACX,MAAA,OAAA,CAAQ,KAAQ,GAAA,IAAA,CAAA;AAAA,KACjB,CAAA,CAAA;AAED,IACEC,eAAA,CAAA,MAAM,KAAM,CAAA,SAAA,EACZ,MAAM;AACJ,MAAW,UAAA,EAAA,CAAA;AACX,MAAW,UAAA,EAAA,CAAA;AAAA,KAEf,CAAA,CAAA;AAEA,IAAiBC,qBAAA,CAAA,QAAA,EAAU,WAAW,OAAO,CAAA,CAAA;AAE7C,IAAAC,sBAAA,CAAkB,YAAY,MAAM;AAClC,MAAA,MAAA,CAAO,KAAQ,GAAA,UAAA,CAAW,KAAO,CAAA,qBAAA,EAAwB,CAAA,MAAA,CAAA;AAAA,KAC1D,CAAA,CAAA;AAED,IAAa,MAAA,CAAA;AAAA,MACX,OAAA;AAAA,MACA,MAAA;AAAA,MACA,KAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var vue = require('vue');
6
6
  require('../../../utils/index.js');
7
7
  require('../../config-provider/index.js');
8
- var message$2 = require('./message.js');
9
- var message$1 = require('./message2.js');
8
+ var message$2 = require('./message2.js');
9
+ var message$1 = require('./message.js');
10
10
  var instance = require('./instance.js');
11
11
  var shared = require('@vue/shared');
12
12
  var types = require('../../../utils/types.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('../../utils/index.js');
6
6
  var notify = require('./src/notify.js');
7
- var notification = require('./src/notification2.js');
7
+ var notification = require('./src/notification.js');
8
8
  var install = require('../../utils/vue/install.js');
9
9
 
10
10
  const ElNotification = install.withInstallFunction(notify["default"], "$notify");
@@ -2,159 +2,77 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- var core = require('@vueuse/core');
7
5
  require('../../../utils/index.js');
8
- require('../../../constants/index.js');
9
- var index = require('../../icon/index.js');
10
- require('../../config-provider/index.js');
11
- var notification = require('./notification2.js');
12
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
13
- var useGlobalConfig = require('../../config-provider/src/hooks/use-global-config.js');
6
+ var runtime = require('../../../utils/vue/props/runtime.js');
14
7
  var icon = require('../../../utils/vue/icon.js');
15
- var aria = require('../../../constants/aria.js');
16
8
 
17
- const _hoisted_1 = ["id"];
18
- const _hoisted_2 = ["textContent"];
19
- const _hoisted_3 = { key: 0 };
20
- const _hoisted_4 = ["innerHTML"];
21
- const __default__ = vue.defineComponent({
22
- name: "ElNotification"
9
+ const notificationTypes = [
10
+ "success",
11
+ "info",
12
+ "warning",
13
+ "error"
14
+ ];
15
+ const notificationProps = runtime.buildProps({
16
+ customClass: {
17
+ type: String,
18
+ default: ""
19
+ },
20
+ dangerouslyUseHTMLString: {
21
+ type: Boolean,
22
+ default: false
23
+ },
24
+ duration: {
25
+ type: Number,
26
+ default: 4500
27
+ },
28
+ icon: {
29
+ type: icon.iconPropType
30
+ },
31
+ id: {
32
+ type: String,
33
+ default: ""
34
+ },
35
+ message: {
36
+ type: runtime.definePropType([String, Object]),
37
+ default: ""
38
+ },
39
+ offset: {
40
+ type: Number,
41
+ default: 0
42
+ },
43
+ onClick: {
44
+ type: runtime.definePropType(Function),
45
+ default: () => void 0
46
+ },
47
+ onClose: {
48
+ type: runtime.definePropType(Function),
49
+ required: true
50
+ },
51
+ position: {
52
+ type: String,
53
+ values: ["top-right", "top-left", "bottom-right", "bottom-left"],
54
+ default: "top-right"
55
+ },
56
+ showClose: {
57
+ type: Boolean,
58
+ default: true
59
+ },
60
+ title: {
61
+ type: String,
62
+ default: ""
63
+ },
64
+ type: {
65
+ type: String,
66
+ values: [...notificationTypes, ""],
67
+ default: ""
68
+ },
69
+ zIndex: Number
23
70
  });
24
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
25
- ...__default__,
26
- props: notification.notificationProps,
27
- emits: notification.notificationEmits,
28
- setup(__props, { expose }) {
29
- const props = __props;
30
- const forEditor = useGlobalConfig.useGlobalConfig("forEditor");
31
- const { ns, zIndex } = useGlobalConfig.useGlobalComponentSettings("notification");
32
- const { nextZIndex, currentZIndex } = zIndex;
33
- const { Close } = icon.CloseComponents;
34
- const visible = vue.ref(false);
35
- let timer = void 0;
36
- const typeClass = vue.computed(() => {
37
- const type = props.type;
38
- return type && icon.TypeComponentsMap[props.type] ? ns.m(type) : "";
39
- });
40
- const iconComponent = vue.computed(() => {
41
- if (!props.type)
42
- return props.icon;
43
- return icon.TypeComponentsMap[props.type] || props.icon;
44
- });
45
- const horizontalClass = vue.computed(() => props.position.endsWith("right") ? "right" : "left");
46
- const verticalProperty = vue.computed(() => props.position.startsWith("top") ? "top" : "bottom");
47
- const positionStyle = vue.computed(() => {
48
- var _a;
49
- return {
50
- [verticalProperty.value]: `${props.offset}px`,
51
- zIndex: (_a = props.zIndex) != null ? _a : currentZIndex.value
52
- };
53
- });
54
- function startTimer() {
55
- if (props.duration > 0) {
56
- ;
57
- ({ stop: timer } = core.useTimeoutFn(() => {
58
- if (visible.value)
59
- close();
60
- }, props.duration));
61
- }
62
- }
63
- function clearTimer() {
64
- timer == null ? void 0 : timer();
65
- }
66
- function close() {
67
- visible.value = false;
68
- }
69
- function onKeydown({ code }) {
70
- if (code === aria.EVENT_CODE.delete || code === aria.EVENT_CODE.backspace) {
71
- clearTimer();
72
- } else if (code === aria.EVENT_CODE.esc) {
73
- if (visible.value) {
74
- close();
75
- }
76
- } else {
77
- startTimer();
78
- }
79
- }
80
- vue.onMounted(() => {
81
- startTimer();
82
- nextZIndex();
83
- visible.value = true;
84
- });
85
- core.useEventListener(document, "keydown", onKeydown);
86
- expose({
87
- visible,
88
- close
89
- });
90
- return (_ctx, _cache) => {
91
- return vue.openBlock(), vue.createBlock(vue.Transition, {
92
- name: vue.unref(ns).b("fade"),
93
- onBeforeLeave: _ctx.onClose,
94
- onAfterLeave: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("destroy")),
95
- duration: vue.unref(forEditor) ? -1 : 0,
96
- persisted: ""
97
- }, {
98
- default: vue.withCtx(() => [
99
- vue.withDirectives(vue.createElementVNode("div", {
100
- id: _ctx.id,
101
- class: vue.normalizeClass([vue.unref(ns).b(), _ctx.customClass, vue.unref(horizontalClass)]),
102
- style: vue.normalizeStyle(vue.unref(positionStyle)),
103
- role: "alert",
104
- onMouseenter: clearTimer,
105
- onMouseleave: startTimer,
106
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
107
- }, [
108
- vue.unref(iconComponent) ? (vue.openBlock(), vue.createBlock(vue.unref(index.ElIcon), {
109
- key: 0,
110
- class: vue.normalizeClass([vue.unref(ns).e("icon"), vue.unref(typeClass)])
111
- }, {
112
- default: vue.withCtx(() => [
113
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(iconComponent))))
114
- ]),
115
- _: 1
116
- }, 8, ["class"])) : vue.createCommentVNode("v-if", true),
117
- vue.createElementVNode("div", {
118
- class: vue.normalizeClass(vue.unref(ns).e("group"))
119
- }, [
120
- vue.createElementVNode("h2", {
121
- class: vue.normalizeClass(vue.unref(ns).e("title")),
122
- textContent: vue.toDisplayString(_ctx.title)
123
- }, null, 10, _hoisted_2),
124
- vue.withDirectives(vue.createElementVNode("div", {
125
- class: vue.normalizeClass(vue.unref(ns).e("content")),
126
- style: vue.normalizeStyle(!!_ctx.title ? void 0 : { margin: 0 })
127
- }, [
128
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
129
- !_ctx.dangerouslyUseHTMLString ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_3, vue.toDisplayString(_ctx.message), 1)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
130
- vue.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),
131
- vue.createElementVNode("p", { innerHTML: _ctx.message }, null, 8, _hoisted_4)
132
- ], 2112))
133
- ])
134
- ], 6), [
135
- [vue.vShow, _ctx.message]
136
- ]),
137
- _ctx.showClose ? (vue.openBlock(), vue.createBlock(vue.unref(index.ElIcon), {
138
- key: 0,
139
- class: vue.normalizeClass(vue.unref(ns).e("closeBtn")),
140
- onClick: vue.withModifiers(close, ["stop"])
141
- }, {
142
- default: vue.withCtx(() => [
143
- vue.createVNode(vue.unref(Close))
144
- ]),
145
- _: 1
146
- }, 8, ["class", "onClick"])) : vue.createCommentVNode("v-if", true)
147
- ], 2)
148
- ], 46, _hoisted_1), [
149
- [vue.vShow, visible.value]
150
- ])
151
- ]),
152
- _: 3
153
- }, 8, ["name", "onBeforeLeave", "duration"]);
154
- };
155
- }
156
- });
157
- var NotificationConstructor = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "D:\\workspace\\element-pe\\packages\\components\\notification\\src\\notification.vue"]]);
71
+ const notificationEmits = {
72
+ destroy: () => true
73
+ };
158
74
 
159
- exports["default"] = NotificationConstructor;
75
+ exports.notificationEmits = notificationEmits;
76
+ exports.notificationProps = notificationProps;
77
+ exports.notificationTypes = notificationTypes;
160
78
  //# sourceMappingURL=notification.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification.js","sources":["../../../../../../packages/components/notification/src/notification.vue"],"sourcesContent":["<template>\n <transition\n :name=\"ns.b('fade')\"\n @before-leave=\"onClose\"\n @after-leave=\"$emit('destroy')\"\n :duration=\"forEditor ? -1 : 0\"\n >\n <div\n v-show=\"visible\"\n :id=\"id\"\n :class=\"[ns.b(), customClass, horizontalClass]\"\n :style=\"positionStyle\"\n role=\"alert\"\n @mouseenter=\"clearTimer\"\n @mouseleave=\"startTimer\"\n @click=\"onClick\"\n >\n <el-icon v-if=\"iconComponent\" :class=\"[ns.e('icon'), typeClass]\">\n <component :is=\"iconComponent\" />\n </el-icon>\n <div :class=\"ns.e('group')\">\n <h2 :class=\"ns.e('title')\" v-text=\"title\" />\n <div\n v-show=\"message\"\n :class=\"ns.e('content')\"\n :style=\"!!title ? undefined : { margin: 0 }\"\n >\n <slot>\n <p v-if=\"!dangerouslyUseHTMLString\">{{ message }}</p>\n <!-- Caution here, message could've been compromised, never use user's input as message -->\n <p v-else v-html=\"message\" />\n </slot>\n </div>\n <el-icon v-if=\"showClose\" :class=\"ns.e('closeBtn')\" @click.stop=\"close\">\n <Close />\n </el-icon>\n </div>\n </div>\n </transition>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, onMounted, ref } from 'vue'\nimport { useEventListener, useTimeoutFn } from '@vueuse/core'\nimport { CloseComponents, TypeComponentsMap } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useGlobalComponentSettings, useGlobalConfig } from '../../config-provider'\nimport { notificationEmits, notificationProps } from './notification'\n\nimport type { CSSProperties } from 'vue'\n\nconst forEditor = useGlobalConfig('forEditor')\n\ndefineOptions({\n name: 'ElNotification',\n})\n\nconst props = defineProps(notificationProps)\ndefineEmits(notificationEmits)\n\nconst { ns, zIndex } = useGlobalComponentSettings('notification')\nconst { nextZIndex, currentZIndex } = zIndex\n\nconst { Close } = CloseComponents\n\nconst visible = ref(false)\nlet timer: (() => void) | undefined = undefined\n\nconst typeClass = computed(() => {\n const type = props.type\n return type && TypeComponentsMap[props.type] ? ns.m(type) : ''\n})\n\nconst iconComponent = computed(() => {\n if (!props.type) return props.icon\n return TypeComponentsMap[props.type] || props.icon\n})\n\nconst horizontalClass = computed(() =>\n props.position.endsWith('right') ? 'right' : 'left'\n)\n\nconst verticalProperty = computed(() =>\n props.position.startsWith('top') ? 'top' : 'bottom'\n)\n\nconst positionStyle = computed<CSSProperties>(() => {\n return {\n [verticalProperty.value]: `${props.offset}px`,\n zIndex: props.zIndex ?? currentZIndex.value,\n }\n})\n\nfunction startTimer() {\n if (props.duration > 0) {\n ;({ stop: timer } = useTimeoutFn(() => {\n if (visible.value) close()\n }, props.duration))\n }\n}\n\nfunction clearTimer() {\n timer?.()\n}\n\nfunction close() {\n visible.value = false\n}\n\nfunction onKeydown({ code }: KeyboardEvent) {\n if (code === EVENT_CODE.delete || code === EVENT_CODE.backspace) {\n clearTimer() // press delete/backspace clear timer\n } else if (code === EVENT_CODE.esc) {\n // press esc to close the notification\n if (visible.value) {\n close()\n }\n } else {\n startTimer() // resume timer\n }\n}\n\n// lifecycle\nonMounted(() => {\n startTimer()\n nextZIndex()\n visible.value = true\n})\n\nuseEventListener(document, 'keydown', onKeydown)\n\ndefineExpose({\n visible,\n /** @description close notification */\n close,\n})\n</script>\n"],"names":["useGlobalConfig","useGlobalComponentSettings","CloseComponents","ref","computed","TypeComponentsMap","useTimeoutFn","EVENT_CODE","onMounted","useEventListener"],"mappings":"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"}
1
+ {"version":3,"file":"notification.js","sources":["../../../../../../packages/components/notification/src/notification.ts"],"sourcesContent":["import { buildProps, definePropType, iconPropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes, VNode } from 'vue'\nimport type Notification from './notification.vue'\n\nexport const notificationTypes = [\n 'success',\n 'info',\n 'warning',\n 'error',\n] as const\n\nexport const notificationProps = buildProps({\n /**\n * @description custom class name for Notification\n */\n customClass: {\n type: String,\n default: '',\n },\n /**\n * @description whether `message` is treated as HTML string\n */\n dangerouslyUseHTMLString: {\n type: Boolean,\n default: false,\n },\n /**\n * @description duration before close. It will not automatically close if set 0\n */\n duration: {\n type: Number,\n default: 4500,\n },\n /**\n * @description custom icon component. It will be overridden by `type`\n */\n icon: {\n type: iconPropType,\n },\n /**\n * @description notification dom id\n */\n id: {\n type: String,\n default: '',\n },\n /**\n * @description description text\n */\n message: {\n type: definePropType<string | VNode>([String, Object]),\n default: '',\n },\n /**\n * @description offset from the top edge of the screen. Every Notification instance of the same moment should have the same offset\n */\n offset: {\n type: Number,\n default: 0,\n },\n /**\n * @description callback function when notification clicked\n */\n onClick: {\n type: definePropType<() => void>(Function),\n default: () => undefined,\n },\n /**\n * @description callback function when closed\n */\n onClose: {\n type: definePropType<() => void>(Function),\n required: true,\n },\n /**\n * @description custom position\n */\n position: {\n type: String,\n values: ['top-right', 'top-left', 'bottom-right', 'bottom-left'],\n default: 'top-right',\n },\n /**\n * @description whether to show a close button\n */\n showClose: {\n type: Boolean,\n default: true,\n },\n /**\n * @description title\n */\n title: {\n type: String,\n default: '',\n },\n /**\n * @description notification type\n */\n type: {\n type: String,\n values: [...notificationTypes, ''],\n default: '',\n },\n /**\n * @description initial zIndex\n */\n zIndex: Number,\n} as const)\nexport type NotificationProps = ExtractPropTypes<typeof notificationProps>\n\nexport const notificationEmits = {\n destroy: () => true,\n}\nexport type NotificationEmits = typeof notificationEmits\n\nexport type NotificationInstance = InstanceType<typeof Notification>\n\nexport type NotificationOptions = Omit<NotificationProps, 'id'> & {\n /**\n * @description set the root element for the notification, default to `document.body`\n */\n appendTo?: HTMLElement | string\n}\nexport type NotificationOptionsTyped = Omit<NotificationOptions, 'type'>\n\nexport interface NotificationHandle {\n close: () => void\n}\n\nexport type NotificationParams = Partial<NotificationOptions> | string | VNode\nexport type NotificationParamsTyped =\n | Partial<NotificationOptionsTyped>\n | string\n | VNode\n\nexport type NotifyFn = ((\n options?: NotificationParams\n) => NotificationHandle) & { closeAll: () => void }\n\nexport type NotifyTypedFn = (\n options?: NotificationParamsTyped\n) => NotificationHandle\n\nexport interface Notify extends NotifyFn {\n success: NotifyTypedFn\n warning: NotifyTypedFn\n error: NotifyTypedFn\n info: NotifyTypedFn\n}\n\nexport interface NotificationQueueItem {\n vm: VNode\n}\n\nexport type NotificationQueue = NotificationQueueItem[]\n"],"names":["buildProps","iconPropType","definePropType"],"mappings":";;;;;;;;AACY,MAAC,iBAAiB,GAAG;AACjC,EAAE,SAAS;AACX,EAAE,MAAM;AACR,EAAE,SAAS;AACX,EAAE,OAAO;AACT,EAAE;AACU,MAAC,iBAAiB,GAAGA,kBAAU,CAAC;AAC5C,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,wBAAwB,EAAE;AAC5B,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,iBAAY;AACtB,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAEA,sBAAc,CAAC,QAAQ,CAAC;AAClC,IAAI,OAAO,EAAE,MAAM,KAAK,CAAC;AACzB,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAEA,sBAAc,CAAC,QAAQ,CAAC;AAClC,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,CAAC;AACpE,IAAI,OAAO,EAAE,WAAW;AACxB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,GAAG,iBAAiB,EAAE,EAAE,CAAC;AACtC,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE,MAAM;AAChB,CAAC,EAAE;AACS,MAAC,iBAAiB,GAAG;AACjC,EAAE,OAAO,EAAE,MAAM,IAAI;AACrB;;;;;;"}