code-monkey-ui 1.1.6 → 1.1.7-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (551) hide show
  1. package/dist/index.full.js +8 -4
  2. package/dist/index.full.min.js +16 -16
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +17 -17
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +8 -4
  7. package/es/components/affix/index.mjs +2 -2
  8. package/es/components/affix/src/affix.mjs +117 -26
  9. package/es/components/affix/src/affix.mjs.map +1 -1
  10. package/es/components/affix/src/affix2.mjs +26 -117
  11. package/es/components/affix/src/affix2.mjs.map +1 -1
  12. package/es/components/autocomplete/index.mjs +2 -2
  13. package/es/components/autocomplete/src/autocomplete.mjs +361 -81
  14. package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
  15. package/es/components/autocomplete/src/autocomplete2.mjs +81 -361
  16. package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
  17. package/es/components/avatar/index.mjs +2 -2
  18. package/es/components/avatar/src/avatar.mjs +67 -32
  19. package/es/components/avatar/src/avatar.mjs.map +1 -1
  20. package/es/components/avatar/src/avatar2.mjs +32 -67
  21. package/es/components/avatar/src/avatar2.mjs.map +1 -1
  22. package/es/components/backtop/index.mjs +2 -2
  23. package/es/components/backtop/src/backtop.mjs +54 -21
  24. package/es/components/backtop/src/backtop.mjs.map +1 -1
  25. package/es/components/backtop/src/backtop2.mjs +21 -54
  26. package/es/components/backtop/src/backtop2.mjs.map +1 -1
  27. package/es/components/badge/index.mjs +2 -2
  28. package/es/components/badge/src/badge.mjs +55 -17
  29. package/es/components/badge/src/badge.mjs.map +1 -1
  30. package/es/components/badge/src/badge2.mjs +17 -55
  31. package/es/components/badge/src/badge2.mjs.map +1 -1
  32. package/es/components/breadcrumb/index.mjs +2 -2
  33. package/es/components/breadcrumb/src/breadcrumb.mjs +11 -36
  34. package/es/components/breadcrumb/src/breadcrumb.mjs.map +1 -1
  35. package/es/components/breadcrumb/src/breadcrumb2.mjs +36 -11
  36. package/es/components/breadcrumb/src/breadcrumb2.mjs.map +1 -1
  37. package/es/components/button/index.mjs +1 -1
  38. package/es/components/button/src/button-group.mjs +6 -30
  39. package/es/components/button/src/button-group.mjs.map +1 -1
  40. package/es/components/button/src/button-group2.mjs +30 -6
  41. package/es/components/button/src/button-group2.mjs.map +1 -1
  42. package/es/components/calendar/src/calendar2.mjs +1 -1
  43. package/es/components/calendar/src/date-table.mjs +33 -87
  44. package/es/components/calendar/src/date-table.mjs.map +1 -1
  45. package/es/components/calendar/src/date-table2.mjs +87 -33
  46. package/es/components/calendar/src/date-table2.mjs.map +1 -1
  47. package/es/components/calendar/src/use-date-table.mjs +1 -1
  48. package/es/components/carousel/index.mjs +4 -4
  49. package/es/components/carousel/src/carousel-item.mjs +8 -69
  50. package/es/components/carousel/src/carousel-item.mjs.map +1 -1
  51. package/es/components/carousel/src/carousel-item2.mjs +69 -8
  52. package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
  53. package/es/components/carousel/src/carousel.mjs +56 -169
  54. package/es/components/carousel/src/carousel.mjs.map +1 -1
  55. package/es/components/carousel/src/carousel2.mjs +169 -56
  56. package/es/components/carousel/src/carousel2.mjs.map +1 -1
  57. package/es/components/cascader/index.mjs +2 -2
  58. package/es/components/cascader/src/cascader.mjs +626 -65
  59. package/es/components/cascader/src/cascader.mjs.map +1 -1
  60. package/es/components/cascader/src/cascader2.mjs +65 -626
  61. package/es/components/cascader/src/cascader2.mjs.map +1 -1
  62. package/es/components/checkbox/index.mjs +2 -2
  63. package/es/components/checkbox/src/checkbox-button.mjs +1 -1
  64. package/es/components/checkbox/src/checkbox.mjs +117 -50
  65. package/es/components/checkbox/src/checkbox.mjs.map +1 -1
  66. package/es/components/checkbox/src/checkbox2.mjs +50 -117
  67. package/es/components/checkbox/src/checkbox2.mjs.map +1 -1
  68. package/es/components/collapse/index.mjs +2 -2
  69. package/es/components/collapse/src/collapse-item.mjs +14 -91
  70. package/es/components/collapse/src/collapse-item.mjs.map +1 -1
  71. package/es/components/collapse/src/collapse-item2.mjs +91 -14
  72. package/es/components/collapse/src/collapse-item2.mjs.map +1 -1
  73. package/es/components/countdown/index.mjs +2 -2
  74. package/es/components/countdown/src/countdown.mjs +23 -74
  75. package/es/components/countdown/src/countdown.mjs.map +1 -1
  76. package/es/components/countdown/src/countdown2.mjs +74 -23
  77. package/es/components/countdown/src/countdown2.mjs.map +1 -1
  78. package/es/components/dialog/src/dialog-content.mjs +29 -89
  79. package/es/components/dialog/src/dialog-content.mjs.map +1 -1
  80. package/es/components/dialog/src/dialog-content2.mjs +89 -29
  81. package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
  82. package/es/components/dialog/src/dialog.mjs +1 -1
  83. package/es/components/dialog/src/dialog2.mjs +1 -1
  84. package/es/components/divider/index.mjs +2 -2
  85. package/es/components/divider/src/divider.mjs +35 -17
  86. package/es/components/divider/src/divider.mjs.map +1 -1
  87. package/es/components/divider/src/divider2.mjs +17 -35
  88. package/es/components/divider/src/divider2.mjs.map +1 -1
  89. package/es/components/drawer/index.mjs +2 -2
  90. package/es/components/drawer/src/drawer.mjs +176 -26
  91. package/es/components/drawer/src/drawer.mjs.map +1 -1
  92. package/es/components/drawer/src/drawer2.mjs +26 -176
  93. package/es/components/drawer/src/drawer2.mjs.map +1 -1
  94. package/es/components/dropdown/index.mjs +2 -2
  95. package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
  96. package/es/components/dropdown/src/dropdown-item.mjs +1 -1
  97. package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
  98. package/es/components/dropdown/src/dropdown.mjs +97 -306
  99. package/es/components/dropdown/src/dropdown.mjs.map +1 -1
  100. package/es/components/dropdown/src/dropdown2.mjs +306 -97
  101. package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
  102. package/es/components/dsh-cascader/src/dsh-cascader2.mjs +1 -1
  103. package/es/components/dsh-select/index.d.ts +1 -1
  104. package/es/components/dsh-select/src/select.mjs +1 -1
  105. package/es/components/dsh-select/src/select.vue.d.ts +1 -1
  106. package/es/components/dsh-select/src/useSelect.d.ts +1 -1
  107. package/es/components/dsh-select/src/useSelect.mjs +9 -5
  108. package/es/components/dsh-select/src/useSelect.mjs.map +1 -1
  109. package/es/components/empty/index.mjs +2 -2
  110. package/es/components/empty/src/empty.mjs +11 -55
  111. package/es/components/empty/src/empty.mjs.map +1 -1
  112. package/es/components/empty/src/empty2.mjs +55 -11
  113. package/es/components/empty/src/empty2.mjs.map +1 -1
  114. package/es/components/form/index.mjs +2 -2
  115. package/es/components/form/src/form.mjs +54 -148
  116. package/es/components/form/src/form.mjs.map +1 -1
  117. package/es/components/form/src/form2.mjs +148 -54
  118. package/es/components/form/src/form2.mjs.map +1 -1
  119. package/es/components/image/index.mjs +2 -2
  120. package/es/components/image/src/image.mjs +225 -61
  121. package/es/components/image/src/image.mjs.map +1 -1
  122. package/es/components/image/src/image2.mjs +61 -225
  123. package/es/components/image/src/image2.mjs.map +1 -1
  124. package/es/components/index.mjs +42 -42
  125. package/es/components/input/index.mjs +2 -2
  126. package/es/components/input/src/input.mjs +453 -109
  127. package/es/components/input/src/input.mjs.map +1 -1
  128. package/es/components/input/src/input2.mjs +109 -453
  129. package/es/components/input/src/input2.mjs.map +1 -1
  130. package/es/components/input-number/index.mjs +2 -2
  131. package/es/components/input-number/src/input-number.mjs +58 -314
  132. package/es/components/input-number/src/input-number.mjs.map +1 -1
  133. package/es/components/input-number/src/input-number2.mjs +314 -58
  134. package/es/components/input-number/src/input-number2.mjs.map +1 -1
  135. package/es/components/link/index.mjs +2 -2
  136. package/es/components/link/src/link.mjs +50 -21
  137. package/es/components/link/src/link.mjs.map +1 -1
  138. package/es/components/link/src/link2.mjs +21 -50
  139. package/es/components/link/src/link2.mjs.map +1 -1
  140. package/es/components/notification/index.mjs +1 -1
  141. package/es/components/notification/src/notification.mjs +67 -149
  142. package/es/components/notification/src/notification.mjs.map +1 -1
  143. package/es/components/notification/src/notification2.mjs +149 -67
  144. package/es/components/notification/src/notification2.mjs.map +1 -1
  145. package/es/components/notification/src/notify.mjs +2 -2
  146. package/es/components/page-header/index.mjs +2 -2
  147. package/es/components/page-header/src/page-header.mjs +103 -17
  148. package/es/components/page-header/src/page-header.mjs.map +1 -1
  149. package/es/components/page-header/src/page-header2.mjs +17 -103
  150. package/es/components/page-header/src/page-header2.mjs.map +1 -1
  151. package/es/components/pagination/src/components/sizes.mjs +23 -69
  152. package/es/components/pagination/src/components/sizes.mjs.map +1 -1
  153. package/es/components/pagination/src/components/sizes2.mjs +69 -23
  154. package/es/components/pagination/src/components/sizes2.mjs.map +1 -1
  155. package/es/components/pagination/src/pagination.mjs +1 -1
  156. package/es/components/popconfirm/index.mjs +2 -2
  157. package/es/components/popconfirm/src/popconfirm.mjs +110 -47
  158. package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
  159. package/es/components/popconfirm/src/popconfirm2.mjs +47 -110
  160. package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
  161. package/es/components/popover/index.mjs +2 -2
  162. package/es/components/popover/src/popover.mjs +111 -66
  163. package/es/components/popover/src/popover.mjs.map +1 -1
  164. package/es/components/popover/src/popover2.mjs +66 -111
  165. package/es/components/popover/src/popover2.mjs.map +1 -1
  166. package/es/components/popper/index.mjs +2 -2
  167. package/es/components/popper/src/arrow.mjs +8 -37
  168. package/es/components/popper/src/arrow.mjs.map +1 -1
  169. package/es/components/popper/src/arrow2.mjs +37 -8
  170. package/es/components/popper/src/arrow2.mjs.map +1 -1
  171. package/es/components/radio/index.mjs +4 -4
  172. package/es/components/radio/src/radio-button.mjs +1 -1
  173. package/es/components/radio/src/radio-group.mjs +68 -36
  174. package/es/components/radio/src/radio-group.mjs.map +1 -1
  175. package/es/components/radio/src/radio-group2.mjs +36 -68
  176. package/es/components/radio/src/radio-group2.mjs.map +1 -1
  177. package/es/components/radio/src/radio.mjs +73 -30
  178. package/es/components/radio/src/radio.mjs.map +1 -1
  179. package/es/components/radio/src/radio2.mjs +30 -73
  180. package/es/components/radio/src/radio2.mjs.map +1 -1
  181. package/es/components/scrollbar/index.mjs +1 -1
  182. package/es/components/scrollbar/src/bar.mjs +17 -42
  183. package/es/components/scrollbar/src/bar.mjs.map +1 -1
  184. package/es/components/scrollbar/src/bar2.mjs +42 -17
  185. package/es/components/scrollbar/src/bar2.mjs.map +1 -1
  186. package/es/components/scrollbar/src/scrollbar2.mjs +1 -1
  187. package/es/components/scrollbar/src/thumb.mjs +11 -130
  188. package/es/components/scrollbar/src/thumb.mjs.map +1 -1
  189. package/es/components/scrollbar/src/thumb2.mjs +130 -11
  190. package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
  191. package/es/components/select/src/select.mjs +1 -1
  192. package/es/components/skeleton/index.mjs +2 -2
  193. package/es/components/skeleton/src/skeleton-item.mjs +18 -23
  194. package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
  195. package/es/components/skeleton/src/skeleton-item2.mjs +23 -18
  196. package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
  197. package/es/components/skeleton/src/skeleton.mjs +1 -1
  198. package/es/components/slider/index.mjs +2 -2
  199. package/es/components/slider/src/slider.mjs +91 -233
  200. package/es/components/slider/src/slider.mjs.map +1 -1
  201. package/es/components/slider/src/slider2.mjs +233 -91
  202. package/es/components/slider/src/slider2.mjs.map +1 -1
  203. package/es/components/statistic/index.mjs +2 -2
  204. package/es/components/statistic/src/statistic.mjs +25 -70
  205. package/es/components/statistic/src/statistic.mjs.map +1 -1
  206. package/es/components/statistic/src/statistic2.mjs +70 -25
  207. package/es/components/statistic/src/statistic2.mjs.map +1 -1
  208. package/es/components/steps/index.mjs +4 -4
  209. package/es/components/steps/src/item.mjs +191 -19
  210. package/es/components/steps/src/item.mjs.map +1 -1
  211. package/es/components/steps/src/item2.mjs +19 -191
  212. package/es/components/steps/src/item2.mjs.map +1 -1
  213. package/es/components/steps/src/steps.mjs +39 -36
  214. package/es/components/steps/src/steps.mjs.map +1 -1
  215. package/es/components/steps/src/steps2.mjs +36 -39
  216. package/es/components/steps/src/steps2.mjs.map +1 -1
  217. package/es/components/switch/index.mjs +2 -2
  218. package/es/components/switch/src/switch.mjs +264 -98
  219. package/es/components/switch/src/switch.mjs.map +1 -1
  220. package/es/components/switch/src/switch2.mjs +98 -264
  221. package/es/components/switch/src/switch2.mjs.map +1 -1
  222. package/es/components/tag/index.mjs +2 -2
  223. package/es/components/tag/src/tag.mjs +94 -33
  224. package/es/components/tag/src/tag.mjs.map +1 -1
  225. package/es/components/tag/src/tag2.mjs +33 -94
  226. package/es/components/tag/src/tag2.mjs.map +1 -1
  227. package/es/components/text/index.mjs +2 -2
  228. package/es/components/text/src/text.mjs +24 -38
  229. package/es/components/text/src/text.mjs.map +1 -1
  230. package/es/components/text/src/text2.mjs +38 -24
  231. package/es/components/text/src/text2.mjs.map +1 -1
  232. package/es/components/time-select/index.mjs +1 -1
  233. package/es/components/time-select/src/time-select.mjs +48 -120
  234. package/es/components/time-select/src/time-select.mjs.map +1 -1
  235. package/es/components/time-select/src/time-select2.mjs +120 -48
  236. package/es/components/time-select/src/time-select2.mjs.map +1 -1
  237. package/es/components/timeline/index.mjs +2 -2
  238. package/es/components/timeline/src/timeline-item.mjs +72 -42
  239. package/es/components/timeline/src/timeline-item.mjs.map +1 -1
  240. package/es/components/timeline/src/timeline-item2.mjs +42 -72
  241. package/es/components/timeline/src/timeline-item2.mjs.map +1 -1
  242. package/es/components/tooltip/src/tooltip.mjs +1 -1
  243. package/es/components/tooltip/src/tooltip2.mjs +1 -1
  244. package/es/components/tooltip-v2/index.mjs +4 -4
  245. package/es/components/tooltip-v2/src/arrow.mjs +22 -37
  246. package/es/components/tooltip-v2/src/arrow.mjs.map +1 -1
  247. package/es/components/tooltip-v2/src/arrow2.mjs +37 -22
  248. package/es/components/tooltip-v2/src/arrow2.mjs.map +1 -1
  249. package/es/components/tooltip-v2/src/content.mjs +50 -112
  250. package/es/components/tooltip-v2/src/content.mjs.map +1 -1
  251. package/es/components/tooltip-v2/src/content2.mjs +112 -50
  252. package/es/components/tooltip-v2/src/content2.mjs.map +1 -1
  253. package/es/components/tooltip-v2/src/tooltip.mjs +73 -20
  254. package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
  255. package/es/components/tooltip-v2/src/tooltip2.mjs +20 -73
  256. package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
  257. package/es/components/transfer/src/composables/use-check.mjs +1 -1
  258. package/es/components/transfer/src/transfer-panel.mjs +128 -19
  259. package/es/components/transfer/src/transfer-panel.mjs.map +1 -1
  260. package/es/components/transfer/src/transfer-panel2.mjs +19 -128
  261. package/es/components/transfer/src/transfer-panel2.mjs.map +1 -1
  262. package/es/components/transfer/src/transfer.mjs +1 -1
  263. package/es/components/upload/index.mjs +4 -4
  264. package/es/components/upload/src/upload-content.mjs +194 -33
  265. package/es/components/upload/src/upload-content.mjs.map +1 -1
  266. package/es/components/upload/src/upload-content2.mjs +33 -194
  267. package/es/components/upload/src/upload-content2.mjs.map +1 -1
  268. package/es/components/upload/src/upload-dragger.mjs +11 -72
  269. package/es/components/upload/src/upload-dragger.mjs.map +1 -1
  270. package/es/components/upload/src/upload-dragger2.mjs +72 -11
  271. package/es/components/upload/src/upload-dragger2.mjs.map +1 -1
  272. package/es/components/upload/src/upload-list2.mjs +1 -1
  273. package/es/components/upload/src/upload.mjs +116 -101
  274. package/es/components/upload/src/upload.mjs.map +1 -1
  275. package/es/components/upload/src/upload2.mjs +101 -116
  276. package/es/components/upload/src/upload2.mjs.map +1 -1
  277. package/es/components/upload/src/use-handlers.mjs +1 -1
  278. package/es/index.mjs +42 -42
  279. package/lib/components/affix/index.js +2 -2
  280. package/lib/components/affix/src/affix.js +117 -27
  281. package/lib/components/affix/src/affix.js.map +1 -1
  282. package/lib/components/affix/src/affix2.js +27 -117
  283. package/lib/components/affix/src/affix2.js.map +1 -1
  284. package/lib/components/autocomplete/index.js +2 -2
  285. package/lib/components/autocomplete/src/autocomplete.js +360 -81
  286. package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
  287. package/lib/components/autocomplete/src/autocomplete2.js +81 -360
  288. package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
  289. package/lib/components/avatar/index.js +2 -2
  290. package/lib/components/avatar/src/avatar.js +67 -33
  291. package/lib/components/avatar/src/avatar.js.map +1 -1
  292. package/lib/components/avatar/src/avatar2.js +33 -67
  293. package/lib/components/avatar/src/avatar2.js.map +1 -1
  294. package/lib/components/backtop/index.js +2 -2
  295. package/lib/components/backtop/src/backtop.js +54 -22
  296. package/lib/components/backtop/src/backtop.js.map +1 -1
  297. package/lib/components/backtop/src/backtop2.js +22 -54
  298. package/lib/components/backtop/src/backtop2.js.map +1 -1
  299. package/lib/components/badge/index.js +2 -2
  300. package/lib/components/badge/src/badge.js +55 -17
  301. package/lib/components/badge/src/badge.js.map +1 -1
  302. package/lib/components/badge/src/badge2.js +17 -55
  303. package/lib/components/badge/src/badge2.js.map +1 -1
  304. package/lib/components/breadcrumb/index.js +2 -2
  305. package/lib/components/breadcrumb/src/breadcrumb.js +11 -36
  306. package/lib/components/breadcrumb/src/breadcrumb.js.map +1 -1
  307. package/lib/components/breadcrumb/src/breadcrumb2.js +36 -11
  308. package/lib/components/breadcrumb/src/breadcrumb2.js.map +1 -1
  309. package/lib/components/button/index.js +1 -1
  310. package/lib/components/button/src/button-group.js +6 -30
  311. package/lib/components/button/src/button-group.js.map +1 -1
  312. package/lib/components/button/src/button-group2.js +30 -6
  313. package/lib/components/button/src/button-group2.js.map +1 -1
  314. package/lib/components/calendar/src/calendar2.js +1 -1
  315. package/lib/components/calendar/src/date-table.js +37 -87
  316. package/lib/components/calendar/src/date-table.js.map +1 -1
  317. package/lib/components/calendar/src/date-table2.js +87 -37
  318. package/lib/components/calendar/src/date-table2.js.map +1 -1
  319. package/lib/components/calendar/src/use-date-table.js +1 -1
  320. package/lib/components/carousel/index.js +4 -4
  321. package/lib/components/carousel/src/carousel-item.js +8 -69
  322. package/lib/components/carousel/src/carousel-item.js.map +1 -1
  323. package/lib/components/carousel/src/carousel-item2.js +69 -8
  324. package/lib/components/carousel/src/carousel-item2.js.map +1 -1
  325. package/lib/components/carousel/src/carousel.js +57 -169
  326. package/lib/components/carousel/src/carousel.js.map +1 -1
  327. package/lib/components/carousel/src/carousel2.js +169 -57
  328. package/lib/components/carousel/src/carousel2.js.map +1 -1
  329. package/lib/components/cascader/index.js +2 -2
  330. package/lib/components/cascader/src/cascader.js +626 -66
  331. package/lib/components/cascader/src/cascader.js.map +1 -1
  332. package/lib/components/cascader/src/cascader2.js +66 -626
  333. package/lib/components/cascader/src/cascader2.js.map +1 -1
  334. package/lib/components/checkbox/index.js +2 -2
  335. package/lib/components/checkbox/src/checkbox-button.js +1 -1
  336. package/lib/components/checkbox/src/checkbox.js +117 -51
  337. package/lib/components/checkbox/src/checkbox.js.map +1 -1
  338. package/lib/components/checkbox/src/checkbox2.js +51 -117
  339. package/lib/components/checkbox/src/checkbox2.js.map +1 -1
  340. package/lib/components/collapse/index.js +2 -2
  341. package/lib/components/collapse/src/collapse-item.js +14 -91
  342. package/lib/components/collapse/src/collapse-item.js.map +1 -1
  343. package/lib/components/collapse/src/collapse-item2.js +91 -14
  344. package/lib/components/collapse/src/collapse-item2.js.map +1 -1
  345. package/lib/components/countdown/index.js +2 -2
  346. package/lib/components/countdown/src/countdown.js +24 -74
  347. package/lib/components/countdown/src/countdown.js.map +1 -1
  348. package/lib/components/countdown/src/countdown2.js +74 -24
  349. package/lib/components/countdown/src/countdown2.js.map +1 -1
  350. package/lib/components/dialog/src/dialog-content.js +29 -88
  351. package/lib/components/dialog/src/dialog-content.js.map +1 -1
  352. package/lib/components/dialog/src/dialog-content2.js +88 -29
  353. package/lib/components/dialog/src/dialog-content2.js.map +1 -1
  354. package/lib/components/dialog/src/dialog.js +1 -1
  355. package/lib/components/dialog/src/dialog2.js +1 -1
  356. package/lib/components/divider/index.js +2 -2
  357. package/lib/components/divider/src/divider.js +35 -17
  358. package/lib/components/divider/src/divider.js.map +1 -1
  359. package/lib/components/divider/src/divider2.js +17 -35
  360. package/lib/components/divider/src/divider2.js.map +1 -1
  361. package/lib/components/drawer/index.js +2 -2
  362. package/lib/components/drawer/src/drawer.js +176 -27
  363. package/lib/components/drawer/src/drawer.js.map +1 -1
  364. package/lib/components/drawer/src/drawer2.js +27 -176
  365. package/lib/components/drawer/src/drawer2.js.map +1 -1
  366. package/lib/components/dropdown/index.js +2 -2
  367. package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
  368. package/lib/components/dropdown/src/dropdown-item.js +1 -1
  369. package/lib/components/dropdown/src/dropdown-menu.js +1 -1
  370. package/lib/components/dropdown/src/dropdown.js +106 -306
  371. package/lib/components/dropdown/src/dropdown.js.map +1 -1
  372. package/lib/components/dropdown/src/dropdown2.js +306 -106
  373. package/lib/components/dropdown/src/dropdown2.js.map +1 -1
  374. package/lib/components/dsh-cascader/src/dsh-cascader2.js +1 -1
  375. package/lib/components/dsh-select/index.d.ts +1 -1
  376. package/lib/components/dsh-select/src/select.js +1 -1
  377. package/lib/components/dsh-select/src/select.vue.d.ts +1 -1
  378. package/lib/components/dsh-select/src/useSelect.d.ts +1 -1
  379. package/lib/components/dsh-select/src/useSelect.js +8 -4
  380. package/lib/components/dsh-select/src/useSelect.js.map +1 -1
  381. package/lib/components/empty/index.js +2 -2
  382. package/lib/components/empty/src/empty.js +11 -55
  383. package/lib/components/empty/src/empty.js.map +1 -1
  384. package/lib/components/empty/src/empty2.js +55 -11
  385. package/lib/components/empty/src/empty2.js.map +1 -1
  386. package/lib/components/form/index.js +2 -2
  387. package/lib/components/form/src/form.js +54 -147
  388. package/lib/components/form/src/form.js.map +1 -1
  389. package/lib/components/form/src/form2.js +147 -54
  390. package/lib/components/form/src/form2.js.map +1 -1
  391. package/lib/components/image/index.js +2 -2
  392. package/lib/components/image/src/image.js +224 -61
  393. package/lib/components/image/src/image.js.map +1 -1
  394. package/lib/components/image/src/image2.js +61 -224
  395. package/lib/components/image/src/image2.js.map +1 -1
  396. package/lib/components/index.js +42 -42
  397. package/lib/components/input/index.js +2 -2
  398. package/lib/components/input/src/input.js +452 -109
  399. package/lib/components/input/src/input.js.map +1 -1
  400. package/lib/components/input/src/input2.js +109 -452
  401. package/lib/components/input/src/input2.js.map +1 -1
  402. package/lib/components/input-number/index.js +2 -2
  403. package/lib/components/input-number/src/input-number.js +57 -312
  404. package/lib/components/input-number/src/input-number.js.map +1 -1
  405. package/lib/components/input-number/src/input-number2.js +312 -57
  406. package/lib/components/input-number/src/input-number2.js.map +1 -1
  407. package/lib/components/link/index.js +2 -2
  408. package/lib/components/link/src/link.js +50 -22
  409. package/lib/components/link/src/link.js.map +1 -1
  410. package/lib/components/link/src/link2.js +22 -50
  411. package/lib/components/link/src/link2.js.map +1 -1
  412. package/lib/components/notification/index.js +1 -1
  413. package/lib/components/notification/src/notification.js +68 -148
  414. package/lib/components/notification/src/notification.js.map +1 -1
  415. package/lib/components/notification/src/notification2.js +148 -68
  416. package/lib/components/notification/src/notification2.js.map +1 -1
  417. package/lib/components/notification/src/notify.js +2 -2
  418. package/lib/components/page-header/index.js +2 -2
  419. package/lib/components/page-header/src/page-header.js +103 -18
  420. package/lib/components/page-header/src/page-header.js.map +1 -1
  421. package/lib/components/page-header/src/page-header2.js +18 -103
  422. package/lib/components/page-header/src/page-header2.js.map +1 -1
  423. package/lib/components/pagination/src/components/sizes.js +23 -69
  424. package/lib/components/pagination/src/components/sizes.js.map +1 -1
  425. package/lib/components/pagination/src/components/sizes2.js +69 -23
  426. package/lib/components/pagination/src/components/sizes2.js.map +1 -1
  427. package/lib/components/pagination/src/pagination.js +1 -1
  428. package/lib/components/popconfirm/index.js +2 -2
  429. package/lib/components/popconfirm/src/popconfirm.js +110 -48
  430. package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
  431. package/lib/components/popconfirm/src/popconfirm2.js +48 -110
  432. package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
  433. package/lib/components/popover/index.js +2 -2
  434. package/lib/components/popover/src/popover.js +111 -67
  435. package/lib/components/popover/src/popover.js.map +1 -1
  436. package/lib/components/popover/src/popover2.js +67 -111
  437. package/lib/components/popover/src/popover2.js.map +1 -1
  438. package/lib/components/popper/index.js +2 -2
  439. package/lib/components/popper/src/arrow.js +9 -37
  440. package/lib/components/popper/src/arrow.js.map +1 -1
  441. package/lib/components/popper/src/arrow2.js +37 -9
  442. package/lib/components/popper/src/arrow2.js.map +1 -1
  443. package/lib/components/radio/index.js +4 -4
  444. package/lib/components/radio/src/radio-button.js +1 -1
  445. package/lib/components/radio/src/radio-group.js +68 -37
  446. package/lib/components/radio/src/radio-group.js.map +1 -1
  447. package/lib/components/radio/src/radio-group2.js +37 -68
  448. package/lib/components/radio/src/radio-group2.js.map +1 -1
  449. package/lib/components/radio/src/radio.js +73 -32
  450. package/lib/components/radio/src/radio.js.map +1 -1
  451. package/lib/components/radio/src/radio2.js +32 -73
  452. package/lib/components/radio/src/radio2.js.map +1 -1
  453. package/lib/components/scrollbar/index.js +1 -1
  454. package/lib/components/scrollbar/src/bar.js +17 -42
  455. package/lib/components/scrollbar/src/bar.js.map +1 -1
  456. package/lib/components/scrollbar/src/bar2.js +42 -17
  457. package/lib/components/scrollbar/src/bar2.js.map +1 -1
  458. package/lib/components/scrollbar/src/scrollbar2.js +1 -1
  459. package/lib/components/scrollbar/src/thumb.js +11 -130
  460. package/lib/components/scrollbar/src/thumb.js.map +1 -1
  461. package/lib/components/scrollbar/src/thumb2.js +130 -11
  462. package/lib/components/scrollbar/src/thumb2.js.map +1 -1
  463. package/lib/components/select/src/select.js +1 -1
  464. package/lib/components/skeleton/index.js +2 -2
  465. package/lib/components/skeleton/src/skeleton-item.js +18 -23
  466. package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
  467. package/lib/components/skeleton/src/skeleton-item2.js +23 -18
  468. package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
  469. package/lib/components/skeleton/src/skeleton.js +1 -1
  470. package/lib/components/slider/index.js +2 -2
  471. package/lib/components/slider/src/slider.js +92 -233
  472. package/lib/components/slider/src/slider.js.map +1 -1
  473. package/lib/components/slider/src/slider2.js +233 -92
  474. package/lib/components/slider/src/slider2.js.map +1 -1
  475. package/lib/components/statistic/index.js +2 -2
  476. package/lib/components/statistic/src/statistic.js +25 -70
  477. package/lib/components/statistic/src/statistic.js.map +1 -1
  478. package/lib/components/statistic/src/statistic2.js +70 -25
  479. package/lib/components/statistic/src/statistic2.js.map +1 -1
  480. package/lib/components/steps/index.js +4 -4
  481. package/lib/components/steps/src/item.js +191 -19
  482. package/lib/components/steps/src/item.js.map +1 -1
  483. package/lib/components/steps/src/item2.js +19 -191
  484. package/lib/components/steps/src/item2.js.map +1 -1
  485. package/lib/components/steps/src/steps.js +39 -37
  486. package/lib/components/steps/src/steps.js.map +1 -1
  487. package/lib/components/steps/src/steps2.js +37 -39
  488. package/lib/components/steps/src/steps2.js.map +1 -1
  489. package/lib/components/switch/index.js +2 -2
  490. package/lib/components/switch/src/switch.js +263 -98
  491. package/lib/components/switch/src/switch.js.map +1 -1
  492. package/lib/components/switch/src/switch2.js +98 -263
  493. package/lib/components/switch/src/switch2.js.map +1 -1
  494. package/lib/components/tag/index.js +2 -2
  495. package/lib/components/tag/src/tag.js +94 -34
  496. package/lib/components/tag/src/tag.js.map +1 -1
  497. package/lib/components/tag/src/tag2.js +34 -94
  498. package/lib/components/tag/src/tag2.js.map +1 -1
  499. package/lib/components/text/index.js +2 -2
  500. package/lib/components/text/src/text.js +24 -38
  501. package/lib/components/text/src/text.js.map +1 -1
  502. package/lib/components/text/src/text2.js +38 -24
  503. package/lib/components/text/src/text2.js.map +1 -1
  504. package/lib/components/time-select/index.js +1 -1
  505. package/lib/components/time-select/src/time-select.js +48 -125
  506. package/lib/components/time-select/src/time-select.js.map +1 -1
  507. package/lib/components/time-select/src/time-select2.js +125 -48
  508. package/lib/components/time-select/src/time-select2.js.map +1 -1
  509. package/lib/components/timeline/index.js +2 -2
  510. package/lib/components/timeline/src/timeline-item.js +72 -42
  511. package/lib/components/timeline/src/timeline-item.js.map +1 -1
  512. package/lib/components/timeline/src/timeline-item2.js +42 -72
  513. package/lib/components/timeline/src/timeline-item2.js.map +1 -1
  514. package/lib/components/tooltip/src/tooltip.js +1 -1
  515. package/lib/components/tooltip/src/tooltip2.js +1 -1
  516. package/lib/components/tooltip-v2/index.js +4 -4
  517. package/lib/components/tooltip-v2/src/arrow.js +23 -37
  518. package/lib/components/tooltip-v2/src/arrow.js.map +1 -1
  519. package/lib/components/tooltip-v2/src/arrow2.js +37 -23
  520. package/lib/components/tooltip-v2/src/arrow2.js.map +1 -1
  521. package/lib/components/tooltip-v2/src/content.js +50 -112
  522. package/lib/components/tooltip-v2/src/content.js.map +1 -1
  523. package/lib/components/tooltip-v2/src/content2.js +112 -50
  524. package/lib/components/tooltip-v2/src/content2.js.map +1 -1
  525. package/lib/components/tooltip-v2/src/tooltip.js +73 -20
  526. package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
  527. package/lib/components/tooltip-v2/src/tooltip2.js +20 -73
  528. package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
  529. package/lib/components/transfer/src/composables/use-check.js +1 -1
  530. package/lib/components/transfer/src/transfer-panel.js +128 -21
  531. package/lib/components/transfer/src/transfer-panel.js.map +1 -1
  532. package/lib/components/transfer/src/transfer-panel2.js +21 -128
  533. package/lib/components/transfer/src/transfer-panel2.js.map +1 -1
  534. package/lib/components/transfer/src/transfer.js +1 -1
  535. package/lib/components/upload/index.js +4 -4
  536. package/lib/components/upload/src/upload-content.js +193 -32
  537. package/lib/components/upload/src/upload-content.js.map +1 -1
  538. package/lib/components/upload/src/upload-content2.js +32 -193
  539. package/lib/components/upload/src/upload-content2.js.map +1 -1
  540. package/lib/components/upload/src/upload-dragger.js +12 -72
  541. package/lib/components/upload/src/upload-dragger.js.map +1 -1
  542. package/lib/components/upload/src/upload-dragger2.js +72 -12
  543. package/lib/components/upload/src/upload-dragger2.js.map +1 -1
  544. package/lib/components/upload/src/upload-list2.js +1 -1
  545. package/lib/components/upload/src/upload.js +116 -104
  546. package/lib/components/upload/src/upload.js.map +1 -1
  547. package/lib/components/upload/src/upload2.js +104 -116
  548. package/lib/components/upload/src/upload2.js.map +1 -1
  549. package/lib/components/upload/src/use-handlers.js +1 -1
  550. package/lib/index.js +42 -42
  551. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"link2.js","sources":["../../../../../../packages/components/link/src/link.vue"],"sourcesContent":["<template>\n <a\n :class=\"linkKls\"\n :href=\"disabled || !href ? undefined : href\"\n @click=\"handleClick\"\n >\n <el-icon v-if=\"icon\"><component :is=\"icon\" /></el-icon>\n <span v-if=\"$slots.default\" :class=\"ns.e('inner')\">\n <slot />\n </span>\n\n <slot v-if=\"$slots.icon\" name=\"icon\" />\n </a>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { ElIcon } from '@code-monkey-ui/components/icon'\nimport { useNamespace } from '@code-monkey-ui/hooks'\nimport { linkEmits, linkProps } from './link'\n\ndefineOptions({\n name: 'ElLink',\n})\nconst props = defineProps(linkProps)\nconst emit = defineEmits(linkEmits)\n\nconst ns = useNamespace('link')\n\nconst linkKls = computed(() => [\n ns.b(),\n ns.m(props.type),\n ns.is('disabled', props.disabled),\n ns.is('underline', props.underline && !props.disabled),\n])\n\nfunction handleClick(event: MouseEvent) {\n if (!props.disabled) emit('click', event)\n}\n</script>\n"],"names":["useNamespace","computed"],"mappings":";;;;;;;;;;;;uCAqBc,CAAA;AAAA,EACZ,IAAM,EAAA,QAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAM,MAAA,EAAA,GAAKA,mBAAa,MAAM,CAAA,CAAA;AAE9B,IAAM,MAAA,OAAA,GAAUC,aAAS,MAAM;AAAA,MAC7B,GAAG,CAAE,EAAA;AAAA,MACL,EAAA,CAAG,CAAE,CAAA,KAAA,CAAM,IAAI,CAAA;AAAA,MACf,EAAG,CAAA,EAAA,CAAG,UAAY,EAAA,KAAA,CAAM,QAAQ,CAAA;AAAA,MAChC,GAAG,EAAG,CAAA,WAAA,EAAa,MAAM,SAAa,IAAA,CAAC,MAAM,QAAQ,CAAA;AAAA,KACtD,CAAA,CAAA;AAED,IAAA,SAAA,WAAA,CAAqB,KAAmB,EAAA;AACtC,MAAA,IAAI,CAAC,KAAM,CAAA,QAAA;AAAU,QAAA,IAAA,CAAK,SAAS,KAAK,CAAA,CAAA;AAAA,KAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"link2.js","sources":["../../../../../../packages/components/link/src/link.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@code-monkey-ui/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Link from './link.vue'\n\nexport const linkProps = buildProps({\n /**\n * @description type\n */\n type: {\n type: String,\n values: ['primary', 'success', 'warning', 'info', 'danger', 'default'],\n default: 'default',\n },\n /**\n * @description whether the component has underline\n */\n underline: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether the component is disabled\n */\n disabled: { type: Boolean, default: false },\n /**\n * @description same as native hyperlink's `href`\n */\n href: { type: String, default: '' },\n /**\n * @description icon component\n */\n icon: {\n type: iconPropType,\n },\n} as const)\nexport type LinkProps = ExtractPropTypes<typeof linkProps>\n\nexport const linkEmits = {\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\nexport type LinkEmits = typeof linkEmits\n\nexport type LinkInstance = InstanceType<typeof Link>\n"],"names":["buildProps","iconPropType"],"mappings":";;;;;;;;AACY,MAAC,SAAS,GAAGA,kBAAU,CAAC;AACpC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC;AAC1E,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AAC7C,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AACrC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,iBAAY;AACtB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,SAAS,GAAG;AACzB,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C;;;;;"}
@@ -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,157 +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 { ns, zIndex } = useGlobalConfig.useGlobalComponentSettings("notification");
31
- const { nextZIndex, currentZIndex } = zIndex;
32
- const { Close } = icon.CloseComponents;
33
- const visible = vue.ref(false);
34
- let timer = void 0;
35
- const typeClass = vue.computed(() => {
36
- const type = props.type;
37
- return type && icon.TypeComponentsMap[props.type] ? ns.m(type) : "";
38
- });
39
- const iconComponent = vue.computed(() => {
40
- if (!props.type)
41
- return props.icon;
42
- return icon.TypeComponentsMap[props.type] || props.icon;
43
- });
44
- const horizontalClass = vue.computed(() => props.position.endsWith("right") ? "right" : "left");
45
- const verticalProperty = vue.computed(() => props.position.startsWith("top") ? "top" : "bottom");
46
- const positionStyle = vue.computed(() => {
47
- var _a;
48
- return {
49
- [verticalProperty.value]: `${props.offset}px`,
50
- zIndex: (_a = props.zIndex) != null ? _a : currentZIndex.value
51
- };
52
- });
53
- function startTimer() {
54
- if (props.duration > 0) {
55
- ;
56
- ({ stop: timer } = core.useTimeoutFn(() => {
57
- if (visible.value)
58
- close();
59
- }, props.duration));
60
- }
61
- }
62
- function clearTimer() {
63
- timer == null ? void 0 : timer();
64
- }
65
- function close() {
66
- visible.value = false;
67
- }
68
- function onKeydown({ code }) {
69
- if (code === aria.EVENT_CODE.delete || code === aria.EVENT_CODE.backspace) {
70
- clearTimer();
71
- } else if (code === aria.EVENT_CODE.esc) {
72
- if (visible.value) {
73
- close();
74
- }
75
- } else {
76
- startTimer();
77
- }
78
- }
79
- vue.onMounted(() => {
80
- startTimer();
81
- nextZIndex();
82
- visible.value = true;
83
- });
84
- core.useEventListener(document, "keydown", onKeydown);
85
- expose({
86
- visible,
87
- close
88
- });
89
- return (_ctx, _cache) => {
90
- return vue.openBlock(), vue.createBlock(vue.Transition, {
91
- name: vue.unref(ns).b("fade"),
92
- onBeforeLeave: _ctx.onClose,
93
- onAfterLeave: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("destroy")),
94
- persisted: ""
95
- }, {
96
- default: vue.withCtx(() => [
97
- vue.withDirectives(vue.createElementVNode("div", {
98
- id: _ctx.id,
99
- class: vue.normalizeClass([vue.unref(ns).b(), _ctx.customClass, vue.unref(horizontalClass)]),
100
- style: vue.normalizeStyle(vue.unref(positionStyle)),
101
- role: "alert",
102
- onMouseenter: clearTimer,
103
- onMouseleave: startTimer,
104
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
105
- }, [
106
- vue.unref(iconComponent) ? (vue.openBlock(), vue.createBlock(vue.unref(index.ElIcon), {
107
- key: 0,
108
- class: vue.normalizeClass([vue.unref(ns).e("icon"), vue.unref(typeClass)])
109
- }, {
110
- default: vue.withCtx(() => [
111
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(iconComponent))))
112
- ]),
113
- _: 1
114
- }, 8, ["class"])) : vue.createCommentVNode("v-if", true),
115
- vue.createElementVNode("div", {
116
- class: vue.normalizeClass(vue.unref(ns).e("group"))
117
- }, [
118
- vue.createElementVNode("h2", {
119
- class: vue.normalizeClass(vue.unref(ns).e("title")),
120
- textContent: vue.toDisplayString(_ctx.title)
121
- }, null, 10, _hoisted_2),
122
- vue.withDirectives(vue.createElementVNode("div", {
123
- class: vue.normalizeClass(vue.unref(ns).e("content")),
124
- style: vue.normalizeStyle(!!_ctx.title ? void 0 : { margin: 0 })
125
- }, [
126
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
127
- !_ctx.dangerouslyUseHTMLString ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_3, vue.toDisplayString(_ctx.message), 1)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
128
- vue.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),
129
- vue.createElementVNode("p", { innerHTML: _ctx.message }, null, 8, _hoisted_4)
130
- ], 2112))
131
- ])
132
- ], 6), [
133
- [vue.vShow, _ctx.message]
134
- ]),
135
- _ctx.showClose ? (vue.openBlock(), vue.createBlock(vue.unref(index.ElIcon), {
136
- key: 0,
137
- class: vue.normalizeClass(vue.unref(ns).e("closeBtn")),
138
- onClick: vue.withModifiers(close, ["stop"])
139
- }, {
140
- default: vue.withCtx(() => [
141
- vue.createVNode(vue.unref(Close))
142
- ]),
143
- _: 1
144
- }, 8, ["class", "onClick"])) : vue.createCommentVNode("v-if", true)
145
- ], 2)
146
- ], 46, _hoisted_1), [
147
- [vue.vShow, visible.value]
148
- ])
149
- ]),
150
- _: 3
151
- }, 8, ["name", "onBeforeLeave"]);
152
- };
153
- }
154
- });
155
- var NotificationConstructor = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "D:\\project\\work\\code-monkey-ui\\packages\\components\\notification\\src\\notification.vue"]]);
71
+ const notificationEmits = {
72
+ destroy: () => true
73
+ };
156
74
 
157
- exports["default"] = NotificationConstructor;
75
+ exports.notificationEmits = notificationEmits;
76
+ exports.notificationProps = notificationProps;
77
+ exports.notificationTypes = notificationTypes;
158
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 >\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 '@code-monkey-ui/utils'\nimport { EVENT_CODE } from '@code-monkey-ui/constants'\nimport { ElIcon } from '@code-monkey-ui/components/icon'\nimport { useGlobalComponentSettings } from '@code-monkey-ui/components/config-provider'\nimport { notificationEmits, notificationProps } from './notification'\n\nimport type { CSSProperties } from 'vue'\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":["useGlobalComponentSettings","CloseComponents","ref","computed","TypeComponentsMap","useTimeoutFn","EVENT_CODE","onMounted","useEventListener"],"mappings":";;;;;;;;;;;;;;;;;;;;uCAkDc,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAA,MAAM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AA;AAAA,IACX,MAAA,CAAA;AAAA,MAEA,OAAA;AAAA,MACD,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"notification.js","sources":["../../../../../../packages/components/notification/src/notification.ts"],"sourcesContent":["import { buildProps, definePropType, iconPropType } from '@code-monkey-ui/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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: true });
4
4
 
5
+ var vue = require('vue');
6
+ var core = require('@vueuse/core');
5
7
  require('../../../utils/index.js');
6
- var runtime = require('../../../utils/vue/props/runtime.js');
8
+ require('../../../constants/index.js');
9
+ var index = require('../../icon/index.js');
10
+ require('../../config-provider/index.js');
11
+ var notification = require('./notification.js');
12
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
13
+ var useGlobalConfig = require('../../config-provider/src/hooks/use-global-config.js');
7
14
  var icon = require('../../../utils/vue/icon.js');
15
+ var aria = require('../../../constants/aria.js');
8
16
 
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
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"
70
23
  });
71
- const notificationEmits = {
72
- destroy: () => true
73
- };
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 { ns, zIndex } = useGlobalConfig.useGlobalComponentSettings("notification");
31
+ const { nextZIndex, currentZIndex } = zIndex;
32
+ const { Close } = icon.CloseComponents;
33
+ const visible = vue.ref(false);
34
+ let timer = void 0;
35
+ const typeClass = vue.computed(() => {
36
+ const type = props.type;
37
+ return type && icon.TypeComponentsMap[props.type] ? ns.m(type) : "";
38
+ });
39
+ const iconComponent = vue.computed(() => {
40
+ if (!props.type)
41
+ return props.icon;
42
+ return icon.TypeComponentsMap[props.type] || props.icon;
43
+ });
44
+ const horizontalClass = vue.computed(() => props.position.endsWith("right") ? "right" : "left");
45
+ const verticalProperty = vue.computed(() => props.position.startsWith("top") ? "top" : "bottom");
46
+ const positionStyle = vue.computed(() => {
47
+ var _a;
48
+ return {
49
+ [verticalProperty.value]: `${props.offset}px`,
50
+ zIndex: (_a = props.zIndex) != null ? _a : currentZIndex.value
51
+ };
52
+ });
53
+ function startTimer() {
54
+ if (props.duration > 0) {
55
+ ;
56
+ ({ stop: timer } = core.useTimeoutFn(() => {
57
+ if (visible.value)
58
+ close();
59
+ }, props.duration));
60
+ }
61
+ }
62
+ function clearTimer() {
63
+ timer == null ? void 0 : timer();
64
+ }
65
+ function close() {
66
+ visible.value = false;
67
+ }
68
+ function onKeydown({ code }) {
69
+ if (code === aria.EVENT_CODE.delete || code === aria.EVENT_CODE.backspace) {
70
+ clearTimer();
71
+ } else if (code === aria.EVENT_CODE.esc) {
72
+ if (visible.value) {
73
+ close();
74
+ }
75
+ } else {
76
+ startTimer();
77
+ }
78
+ }
79
+ vue.onMounted(() => {
80
+ startTimer();
81
+ nextZIndex();
82
+ visible.value = true;
83
+ });
84
+ core.useEventListener(document, "keydown", onKeydown);
85
+ expose({
86
+ visible,
87
+ close
88
+ });
89
+ return (_ctx, _cache) => {
90
+ return vue.openBlock(), vue.createBlock(vue.Transition, {
91
+ name: vue.unref(ns).b("fade"),
92
+ onBeforeLeave: _ctx.onClose,
93
+ onAfterLeave: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("destroy")),
94
+ persisted: ""
95
+ }, {
96
+ default: vue.withCtx(() => [
97
+ vue.withDirectives(vue.createElementVNode("div", {
98
+ id: _ctx.id,
99
+ class: vue.normalizeClass([vue.unref(ns).b(), _ctx.customClass, vue.unref(horizontalClass)]),
100
+ style: vue.normalizeStyle(vue.unref(positionStyle)),
101
+ role: "alert",
102
+ onMouseenter: clearTimer,
103
+ onMouseleave: startTimer,
104
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
105
+ }, [
106
+ vue.unref(iconComponent) ? (vue.openBlock(), vue.createBlock(vue.unref(index.ElIcon), {
107
+ key: 0,
108
+ class: vue.normalizeClass([vue.unref(ns).e("icon"), vue.unref(typeClass)])
109
+ }, {
110
+ default: vue.withCtx(() => [
111
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(iconComponent))))
112
+ ]),
113
+ _: 1
114
+ }, 8, ["class"])) : vue.createCommentVNode("v-if", true),
115
+ vue.createElementVNode("div", {
116
+ class: vue.normalizeClass(vue.unref(ns).e("group"))
117
+ }, [
118
+ vue.createElementVNode("h2", {
119
+ class: vue.normalizeClass(vue.unref(ns).e("title")),
120
+ textContent: vue.toDisplayString(_ctx.title)
121
+ }, null, 10, _hoisted_2),
122
+ vue.withDirectives(vue.createElementVNode("div", {
123
+ class: vue.normalizeClass(vue.unref(ns).e("content")),
124
+ style: vue.normalizeStyle(!!_ctx.title ? void 0 : { margin: 0 })
125
+ }, [
126
+ vue.renderSlot(_ctx.$slots, "default", {}, () => [
127
+ !_ctx.dangerouslyUseHTMLString ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_3, vue.toDisplayString(_ctx.message), 1)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
128
+ vue.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),
129
+ vue.createElementVNode("p", { innerHTML: _ctx.message }, null, 8, _hoisted_4)
130
+ ], 2112))
131
+ ])
132
+ ], 6), [
133
+ [vue.vShow, _ctx.message]
134
+ ]),
135
+ _ctx.showClose ? (vue.openBlock(), vue.createBlock(vue.unref(index.ElIcon), {
136
+ key: 0,
137
+ class: vue.normalizeClass(vue.unref(ns).e("closeBtn")),
138
+ onClick: vue.withModifiers(close, ["stop"])
139
+ }, {
140
+ default: vue.withCtx(() => [
141
+ vue.createVNode(vue.unref(Close))
142
+ ]),
143
+ _: 1
144
+ }, 8, ["class", "onClick"])) : vue.createCommentVNode("v-if", true)
145
+ ], 2)
146
+ ], 46, _hoisted_1), [
147
+ [vue.vShow, visible.value]
148
+ ])
149
+ ]),
150
+ _: 3
151
+ }, 8, ["name", "onBeforeLeave"]);
152
+ };
153
+ }
154
+ });
155
+ var NotificationConstructor = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "D:\\project\\work\\code-monkey-ui\\packages\\components\\notification\\src\\notification.vue"]]);
74
156
 
75
- exports.notificationEmits = notificationEmits;
76
- exports.notificationProps = notificationProps;
77
- exports.notificationTypes = notificationTypes;
157
+ exports["default"] = NotificationConstructor;
78
158
  //# sourceMappingURL=notification2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification2.js","sources":["../../../../../../packages/components/notification/src/notification.ts"],"sourcesContent":["import { buildProps, definePropType, iconPropType } from '@code-monkey-ui/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;;;;;;"}
1
+ {"version":3,"file":"notification2.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 >\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 '@code-monkey-ui/utils'\nimport { EVENT_CODE } from '@code-monkey-ui/constants'\nimport { ElIcon } from '@code-monkey-ui/components/icon'\nimport { useGlobalComponentSettings } from '@code-monkey-ui/components/config-provider'\nimport { notificationEmits, notificationProps } from './notification'\n\nimport type { CSSProperties } from 'vue'\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":["useGlobalComponentSettings","CloseComponents","ref","computed","TypeComponentsMap","useTimeoutFn","EVENT_CODE","onMounted","useEventListener"],"mappings":";;;;;;;;;;;;;;;;;;;;uCAkDc,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAA,MAAM,EAAE,EAAA,EAAI,MAAW,EAAA,GAAAA,0CAAA,CAA2B,cAAc,CAAA,CAAA;AAChE,IAAM,MAAA,EAAE,YAAY,aAAkB,EAAA,GAAA,MAAA,CAAA;AAEtC,IAAA,MAAM,EAAE,KAAU,EAAA,GAAAC,oBAAA,CAAA;AAElB,IAAM,MAAA,OAAA,GAAUC,QAAI,KAAK,CAAA,CAAA;AACzB,IAAA,IAAI,KAAkC,GAAA,KAAA,CAAA,CAAA;AAEtC,IAAM,MAAA,SAAA,GAAYC,aAAS,MAAM;AAC/B,MAAA,MAAM,OAAO,KAAM,CAAA,IAAA,CAAA;AACnB,MAAA,OAAO,QAAQC,sBAAkB,CAAA,KAAA,CAAM,QAAQ,EAAG,CAAA,CAAA,CAAE,IAAI,CAAI,GAAA,EAAA,CAAA;AAAA,KAC7D,CAAA,CAAA;AAED,IAAM,MAAA,aAAA,GAAgBD,aAAS,MAAM;AACnC,MAAA,IAAI,CAAC,KAAM,CAAA,IAAA;AAAM,QAAA,OAAO,KAAM,CAAA,IAAA,CAAA;AAC9B,MAAO,OAAAC,sBAAA,CAAkB,KAAM,CAAA,IAAA,CAAA,IAAS,KAAM,CAAA,IAAA,CAAA;AAAA,KAC/C,CAAA,CAAA;AAED,IAAM,MAAA,eAAA,GAAkBD,aAAS,MAC/B,KAAA,CAAM,S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AA,eAAA,CAAA,GAAA,EAAA;AACjB,QAAM,IAAA,OAAA,CAAA,KAAA,EAAA;AAAA,UACR,KAAA,EAAA,CAAA;AAAA,SACK;AACL,OAAW,MAAA;AAAA,QACb,UAAA,EAAA,CAAA;AAAA,OACF;AAGA,KAAA;AACE,IAAWC,aAAA,CAAA,MAAA;AACX,MAAW,UAAA,EAAA,CAAA;AACX,MAAA,UAAgB,EAAA,CAAA;AAAA,MACjB,OAAA,CAAA,KAAA,GAAA,IAAA,CAAA;AAED,KAAiB,CAAA,CAAA;AAEjB,IAAaC,qBAAA,CAAA,QAAA,EAAA,SAAA,EAAA,SAAA,CAAA,CAAA;AAAA,IACX,MAAA,CAAA;AAAA,MAEA,OAAA;AAAA,MACD,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
6
  require('../../../utils/index.js');
7
- var notification = require('./notification.js');
8
- var notification$1 = require('./notification2.js');
7
+ var notification = require('./notification2.js');
8
+ var notification$1 = require('./notification.js');
9
9
  var core = require('@vueuse/core');
10
10
  var types = require('../../../utils/types.js');
11
11
  var shared = require('@vue/shared');
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('../../utils/index.js');
6
- var pageHeader$1 = require('./src/page-header2.js');
7
- var pageHeader = require('./src/page-header.js');
6
+ var pageHeader$1 = require('./src/page-header.js');
7
+ var pageHeader = require('./src/page-header2.js');
8
8
  var install = require('../../utils/vue/install.js');
9
9
 
10
10
  const ElPageHeader = install.withInstall(pageHeader$1["default"]);