code-monkey-ui 1.1.4-beta → 1.1.4

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 (555) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.full.js +670 -608
  3. package/dist/index.full.min.js +20 -16
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +20 -16
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +534 -472
  8. package/es/components/affix/index.mjs +2 -2
  9. package/es/components/affix/src/affix.mjs +117 -26
  10. package/es/components/affix/src/affix.mjs.map +1 -1
  11. package/es/components/affix/src/affix2.mjs +26 -117
  12. package/es/components/affix/src/affix2.mjs.map +1 -1
  13. package/es/components/alert/index.mjs +2 -2
  14. package/es/components/alert/src/alert.mjs +36 -96
  15. package/es/components/alert/src/alert.mjs.map +1 -1
  16. package/es/components/alert/src/alert2.mjs +96 -36
  17. package/es/components/alert/src/alert2.mjs.map +1 -1
  18. package/es/components/autocomplete/index.mjs +2 -2
  19. package/es/components/autocomplete/src/autocomplete.mjs +361 -81
  20. package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
  21. package/es/components/autocomplete/src/autocomplete2.mjs +81 -361
  22. package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
  23. package/es/components/badge/index.mjs +2 -2
  24. package/es/components/badge/src/badge.mjs +55 -17
  25. package/es/components/badge/src/badge.mjs.map +1 -1
  26. package/es/components/badge/src/badge2.mjs +17 -55
  27. package/es/components/badge/src/badge2.mjs.map +1 -1
  28. package/es/components/batch/index.d.ts +743 -23
  29. package/es/components/batch/src/batch.d.ts +8 -1
  30. package/es/components/batch/src/batch.mjs +11 -4
  31. package/es/components/batch/src/batch.mjs.map +1 -1
  32. package/es/components/batch/src/batch.vue.d.ts +743 -23
  33. package/es/components/batch/src/batch2.mjs +74 -26
  34. package/es/components/batch/src/batch2.mjs.map +1 -1
  35. package/es/components/batch/src/constants.d.ts +6 -0
  36. package/es/components/batch/src/constants.mjs +4 -0
  37. package/es/components/batch/src/constants.mjs.map +1 -0
  38. package/es/components/batch/src/use-batch.d.ts +2 -1
  39. package/es/components/batch/src/use-batch.mjs +5 -2
  40. package/es/components/batch/src/use-batch.mjs.map +1 -1
  41. package/es/components/batch/style/css.d.ts +4 -0
  42. package/es/components/batch/style/css.mjs +4 -0
  43. package/es/components/batch/style/css.mjs.map +1 -1
  44. package/es/components/batch/style/index.d.ts +4 -0
  45. package/es/components/batch/style/index.mjs +4 -0
  46. package/es/components/batch/style/index.mjs.map +1 -1
  47. package/es/components/cascader/src/cascader2.mjs +1 -1
  48. package/es/components/cascader-panel/src/index.mjs +1 -1
  49. package/es/components/cascader-panel/src/menu.mjs +1 -1
  50. package/es/components/cascader-panel/src/node.mjs +209 -116
  51. package/es/components/cascader-panel/src/node.mjs.map +1 -1
  52. package/es/components/cascader-panel/src/node2.mjs +116 -209
  53. package/es/components/cascader-panel/src/node2.mjs.map +1 -1
  54. package/es/components/cascader-panel/src/store.mjs +1 -1
  55. package/es/components/check-tag/index.mjs +2 -2
  56. package/es/components/check-tag/src/check-tag.mjs +12 -31
  57. package/es/components/check-tag/src/check-tag.mjs.map +1 -1
  58. package/es/components/check-tag/src/check-tag2.mjs +31 -12
  59. package/es/components/check-tag/src/check-tag2.mjs.map +1 -1
  60. package/es/components/col/index.mjs +2 -2
  61. package/es/components/col/src/col.mjs +43 -66
  62. package/es/components/col/src/col.mjs.map +1 -1
  63. package/es/components/col/src/col2.mjs +66 -43
  64. package/es/components/col/src/col2.mjs.map +1 -1
  65. package/es/components/collapse/index.mjs +2 -2
  66. package/es/components/collapse/src/collapse.mjs +17 -28
  67. package/es/components/collapse/src/collapse.mjs.map +1 -1
  68. package/es/components/collapse/src/collapse2.mjs +28 -17
  69. package/es/components/collapse/src/collapse2.mjs.map +1 -1
  70. package/es/components/collection/index.mjs +1 -1
  71. package/es/components/collection/src/collection.mjs +10 -62
  72. package/es/components/collection/src/collection.mjs.map +1 -1
  73. package/es/components/collection/src/collection2.mjs +62 -10
  74. package/es/components/collection/src/collection2.mjs.map +1 -1
  75. package/es/components/color-picker/index.mjs +2 -2
  76. package/es/components/color-picker/src/color-picker.mjs +40 -402
  77. package/es/components/color-picker/src/color-picker.mjs.map +1 -1
  78. package/es/components/color-picker/src/color-picker2.mjs +402 -40
  79. package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
  80. package/es/components/color-picker/src/components/predefine.mjs +1 -1
  81. package/es/components/countdown/index.mjs +2 -2
  82. package/es/components/countdown/src/countdown.mjs +74 -23
  83. package/es/components/countdown/src/countdown.mjs.map +1 -1
  84. package/es/components/countdown/src/countdown2.mjs +23 -74
  85. package/es/components/countdown/src/countdown2.mjs.map +1 -1
  86. package/es/components/descriptions/src/description.mjs +1 -1
  87. package/es/components/descriptions/src/descriptions-row.mjs +7 -64
  88. package/es/components/descriptions/src/descriptions-row.mjs.map +1 -1
  89. package/es/components/descriptions/src/descriptions-row2.mjs +64 -7
  90. package/es/components/descriptions/src/descriptions-row2.mjs.map +1 -1
  91. package/es/components/dialog/src/dialog-content.mjs +89 -29
  92. package/es/components/dialog/src/dialog-content.mjs.map +1 -1
  93. package/es/components/dialog/src/dialog-content2.mjs +29 -89
  94. package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
  95. package/es/components/dialog/src/dialog.mjs +1 -1
  96. package/es/components/dialog/src/dialog2.mjs +1 -1
  97. package/es/components/divider/index.mjs +2 -2
  98. package/es/components/divider/src/divider.mjs +17 -35
  99. package/es/components/divider/src/divider.mjs.map +1 -1
  100. package/es/components/divider/src/divider2.mjs +35 -17
  101. package/es/components/divider/src/divider2.mjs.map +1 -1
  102. package/es/components/drawer/index.mjs +2 -2
  103. package/es/components/drawer/src/drawer.mjs +176 -26
  104. package/es/components/drawer/src/drawer.mjs.map +1 -1
  105. package/es/components/drawer/src/drawer2.mjs +26 -176
  106. package/es/components/drawer/src/drawer2.mjs.map +1 -1
  107. package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
  108. package/es/components/dropdown/src/dropdown.mjs +1 -1
  109. package/es/components/dsh-cascader/index.d.ts +12 -0
  110. package/es/components/dsh-cascader/src/dsh-cascader.mjs +1 -1
  111. package/es/components/dsh-cascader/src/dsh-cascader.vue.d.ts +6 -0
  112. package/es/components/dsh-cascader-panel/index.d.ts +4 -0
  113. package/es/components/dsh-cascader-panel/src/config.d.ts +1 -0
  114. package/es/components/dsh-cascader-panel/src/config.mjs +2 -1
  115. package/es/components/dsh-cascader-panel/src/config.mjs.map +1 -1
  116. package/es/components/dsh-cascader-panel/src/dsh-node-content.d.ts +8 -0
  117. package/es/components/dsh-cascader-panel/src/dsh-node-content.mjs +8 -2
  118. package/es/components/dsh-cascader-panel/src/dsh-node-content.mjs.map +1 -1
  119. package/es/components/dsh-cascader-panel/src/index.mjs +19 -24
  120. package/es/components/dsh-cascader-panel/src/index.mjs.map +1 -1
  121. package/es/components/dsh-cascader-panel/src/index.vue.d.ts +2 -0
  122. package/es/components/dsh-cascader-panel/src/menu.mjs +1 -1
  123. package/es/components/dsh-cascader-panel/src/node.d.ts +1 -0
  124. package/es/components/dsh-cascader-panel/src/node.mjs +229 -115
  125. package/es/components/dsh-cascader-panel/src/node.mjs.map +1 -1
  126. package/es/components/dsh-cascader-panel/src/node2.mjs +115 -226
  127. package/es/components/dsh-cascader-panel/src/node2.mjs.map +1 -1
  128. package/es/components/dsh-cascader-panel/src/store.mjs +6 -7
  129. package/es/components/dsh-cascader-panel/src/store.mjs.map +1 -1
  130. package/es/components/dsh-select/src/select.mjs +1 -1
  131. package/es/components/image-viewer/index.mjs +2 -2
  132. package/es/components/image-viewer/src/image-viewer.mjs +401 -41
  133. package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
  134. package/es/components/image-viewer/src/image-viewer2.mjs +41 -401
  135. package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
  136. package/es/components/index.mjs +34 -34
  137. package/es/components/menu/index.mjs +4 -4
  138. package/es/components/menu/src/menu-item-group.mjs +35 -4
  139. package/es/components/menu/src/menu-item-group.mjs.map +1 -1
  140. package/es/components/menu/src/menu-item-group2.mjs +4 -35
  141. package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
  142. package/es/components/menu/src/menu-item.mjs +97 -14
  143. package/es/components/menu/src/menu-item.mjs.map +1 -1
  144. package/es/components/menu/src/menu-item2.mjs +14 -97
  145. package/es/components/menu/src/menu-item2.mjs.map +1 -1
  146. package/es/components/message/index.mjs +1 -1
  147. package/es/components/message/src/message.mjs +86 -148
  148. package/es/components/message/src/message.mjs.map +1 -1
  149. package/es/components/message/src/message2.mjs +148 -86
  150. package/es/components/message/src/message2.mjs.map +1 -1
  151. package/es/components/message/src/method.mjs +2 -2
  152. package/es/components/notification/index.mjs +1 -1
  153. package/es/components/notification/src/notification.mjs +149 -67
  154. package/es/components/notification/src/notification.mjs.map +1 -1
  155. package/es/components/notification/src/notification2.mjs +67 -149
  156. package/es/components/notification/src/notification2.mjs.map +1 -1
  157. package/es/components/notification/src/notify.mjs +2 -2
  158. package/es/components/pagination/src/components/jumper.mjs +60 -9
  159. package/es/components/pagination/src/components/jumper.mjs.map +1 -1
  160. package/es/components/pagination/src/components/jumper2.mjs +9 -60
  161. package/es/components/pagination/src/components/jumper2.mjs.map +1 -1
  162. package/es/components/pagination/src/components/next.mjs +38 -19
  163. package/es/components/pagination/src/components/next.mjs.map +1 -1
  164. package/es/components/pagination/src/components/next2.mjs +19 -38
  165. package/es/components/pagination/src/components/next2.mjs.map +1 -1
  166. package/es/components/pagination/src/components/sizes.mjs +23 -69
  167. package/es/components/pagination/src/components/sizes.mjs.map +1 -1
  168. package/es/components/pagination/src/components/sizes2.mjs +69 -23
  169. package/es/components/pagination/src/components/sizes2.mjs.map +1 -1
  170. package/es/components/pagination/src/pagination.mjs +3 -3
  171. package/es/components/popper/index.mjs +6 -6
  172. package/es/components/popper/src/arrow.mjs +8 -37
  173. package/es/components/popper/src/arrow.mjs.map +1 -1
  174. package/es/components/popper/src/arrow2.mjs +37 -8
  175. package/es/components/popper/src/arrow2.mjs.map +1 -1
  176. package/es/components/popper/src/popper.mjs +25 -32
  177. package/es/components/popper/src/popper.mjs.map +1 -1
  178. package/es/components/popper/src/popper2.mjs +32 -25
  179. package/es/components/popper/src/popper2.mjs.map +1 -1
  180. package/es/components/popper/src/trigger.mjs +119 -31
  181. package/es/components/popper/src/trigger.mjs.map +1 -1
  182. package/es/components/popper/src/trigger2.mjs +31 -119
  183. package/es/components/popper/src/trigger2.mjs.map +1 -1
  184. package/es/components/radio/index.mjs +6 -6
  185. package/es/components/radio/src/radio-button.mjs +66 -9
  186. package/es/components/radio/src/radio-button.mjs.map +1 -1
  187. package/es/components/radio/src/radio-button2.mjs +9 -66
  188. package/es/components/radio/src/radio-button2.mjs.map +1 -1
  189. package/es/components/radio/src/radio-group.mjs +36 -68
  190. package/es/components/radio/src/radio-group.mjs.map +1 -1
  191. package/es/components/radio/src/radio-group2.mjs +68 -36
  192. package/es/components/radio/src/radio-group2.mjs.map +1 -1
  193. package/es/components/radio/src/radio.mjs +30 -73
  194. package/es/components/radio/src/radio.mjs.map +1 -1
  195. package/es/components/radio/src/radio2.mjs +73 -30
  196. package/es/components/radio/src/radio2.mjs.map +1 -1
  197. package/es/components/result/index.mjs +2 -2
  198. package/es/components/result/src/result.mjs +29 -63
  199. package/es/components/result/src/result.mjs.map +1 -1
  200. package/es/components/result/src/result2.mjs +63 -29
  201. package/es/components/result/src/result2.mjs.map +1 -1
  202. package/es/components/roving-focus-group/src/roving-focus-group.mjs +1 -1
  203. package/es/components/row/index.mjs +2 -2
  204. package/es/components/row/src/row.mjs +45 -29
  205. package/es/components/row/src/row.mjs.map +1 -1
  206. package/es/components/row/src/row2.mjs +29 -45
  207. package/es/components/row/src/row2.mjs.map +1 -1
  208. package/es/components/select/src/select.mjs +1 -1
  209. package/es/components/skeleton/index.d.ts +1 -1
  210. package/es/components/skeleton/index.mjs +4 -4
  211. package/es/components/skeleton/src/skeleton-item.mjs +23 -18
  212. package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
  213. package/es/components/skeleton/src/skeleton-item2.mjs +18 -23
  214. package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
  215. package/es/components/skeleton/src/skeleton.mjs +22 -49
  216. package/es/components/skeleton/src/skeleton.mjs.map +1 -1
  217. package/es/components/skeleton/src/skeleton.vue.d.ts +1 -1
  218. package/es/components/skeleton/src/skeleton2.mjs +49 -22
  219. package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
  220. package/es/components/slider/src/button.mjs +21 -93
  221. package/es/components/slider/src/button.mjs.map +1 -1
  222. package/es/components/slider/src/button2.mjs +93 -21
  223. package/es/components/slider/src/button2.mjs.map +1 -1
  224. package/es/components/slider/src/slider2.mjs +1 -1
  225. package/es/components/switch/index.mjs +2 -2
  226. package/es/components/switch/src/switch.mjs +264 -98
  227. package/es/components/switch/src/switch.mjs.map +1 -1
  228. package/es/components/switch/src/switch2.mjs +98 -264
  229. package/es/components/switch/src/switch2.mjs.map +1 -1
  230. package/es/components/table/src/table-header/event-helper.mjs +6 -1
  231. package/es/components/table/src/table-header/event-helper.mjs.map +1 -1
  232. package/es/components/tabs/index.mjs +2 -2
  233. package/es/components/tabs/src/tab-pane.mjs +72 -13
  234. package/es/components/tabs/src/tab-pane.mjs.map +1 -1
  235. package/es/components/tabs/src/tab-pane2.mjs +13 -72
  236. package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
  237. package/es/components/tag/index.mjs +2 -2
  238. package/es/components/tag/src/tag.mjs +94 -33
  239. package/es/components/tag/src/tag.mjs.map +1 -1
  240. package/es/components/tag/src/tag2.mjs +33 -94
  241. package/es/components/tag/src/tag2.mjs.map +1 -1
  242. package/es/components/text/index.mjs +2 -2
  243. package/es/components/text/src/text.mjs +38 -24
  244. package/es/components/text/src/text.mjs.map +1 -1
  245. package/es/components/text/src/text2.mjs +24 -38
  246. package/es/components/text/src/text2.mjs.map +1 -1
  247. package/es/components/tooltip/index.mjs +2 -2
  248. package/es/components/tooltip/src/tooltip.mjs +170 -31
  249. package/es/components/tooltip/src/tooltip.mjs.map +1 -1
  250. package/es/components/tooltip/src/tooltip2.mjs +31 -170
  251. package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
  252. package/es/components/tooltip/src/trigger.mjs +1 -1
  253. package/es/components/tooltip/src/trigger2.mjs +1 -1
  254. package/es/components/tooltip-v2/index.mjs +1 -1
  255. package/es/components/tooltip-v2/src/content.mjs +50 -112
  256. package/es/components/tooltip-v2/src/content.mjs.map +1 -1
  257. package/es/components/tooltip-v2/src/content2.mjs +112 -50
  258. package/es/components/tooltip-v2/src/content2.mjs.map +1 -1
  259. package/es/components/tooltip-v2/src/tooltip.mjs +2 -2
  260. package/es/components/tooltip-v2/src/tooltip2.mjs +1 -1
  261. package/es/components/transfer/src/composables/use-check.mjs +1 -1
  262. package/es/components/transfer/src/transfer-panel.mjs +128 -19
  263. package/es/components/transfer/src/transfer-panel.mjs.map +1 -1
  264. package/es/components/transfer/src/transfer-panel2.mjs +19 -128
  265. package/es/components/transfer/src/transfer-panel2.mjs.map +1 -1
  266. package/es/components/transfer/src/transfer2.mjs +1 -1
  267. package/es/components/upload/index.mjs +1 -1
  268. package/es/components/upload/src/upload-content.mjs +33 -194
  269. package/es/components/upload/src/upload-content.mjs.map +1 -1
  270. package/es/components/upload/src/upload-content2.mjs +194 -33
  271. package/es/components/upload/src/upload-content2.mjs.map +1 -1
  272. package/es/components/upload/src/upload2.mjs +1 -1
  273. package/es/components/visual-hidden/index.mjs +3 -3
  274. package/es/components/visual-hidden/src/visual-hidden.mjs +35 -7
  275. package/es/components/visual-hidden/src/visual-hidden.mjs.map +1 -1
  276. package/es/components/visual-hidden/src/visual-hidden2.mjs +7 -35
  277. package/es/components/visual-hidden/src/visual-hidden2.mjs.map +1 -1
  278. package/es/index.mjs +34 -34
  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/alert/index.js +2 -2
  285. package/lib/components/alert/src/alert.js +37 -95
  286. package/lib/components/alert/src/alert.js.map +1 -1
  287. package/lib/components/alert/src/alert2.js +95 -37
  288. package/lib/components/alert/src/alert2.js.map +1 -1
  289. package/lib/components/autocomplete/index.js +2 -2
  290. package/lib/components/autocomplete/src/autocomplete.js +360 -81
  291. package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
  292. package/lib/components/autocomplete/src/autocomplete2.js +81 -360
  293. package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
  294. package/lib/components/badge/index.js +2 -2
  295. package/lib/components/badge/src/badge.js +55 -17
  296. package/lib/components/badge/src/badge.js.map +1 -1
  297. package/lib/components/badge/src/badge2.js +17 -55
  298. package/lib/components/badge/src/badge2.js.map +1 -1
  299. package/lib/components/batch/index.d.ts +743 -23
  300. package/lib/components/batch/src/batch.d.ts +8 -1
  301. package/lib/components/batch/src/batch.js +11 -4
  302. package/lib/components/batch/src/batch.js.map +1 -1
  303. package/lib/components/batch/src/batch.vue.d.ts +743 -23
  304. package/lib/components/batch/src/batch2.js +73 -25
  305. package/lib/components/batch/src/batch2.js.map +1 -1
  306. package/lib/components/batch/src/constants.d.ts +6 -0
  307. package/lib/components/batch/src/constants.js +8 -0
  308. package/lib/components/batch/src/constants.js.map +1 -0
  309. package/lib/components/batch/src/use-batch.d.ts +2 -1
  310. package/lib/components/batch/src/use-batch.js +4 -1
  311. package/lib/components/batch/src/use-batch.js.map +1 -1
  312. package/lib/components/batch/style/css.d.ts +4 -0
  313. package/lib/components/batch/style/css.js +4 -0
  314. package/lib/components/batch/style/css.js.map +1 -1
  315. package/lib/components/batch/style/index.d.ts +4 -0
  316. package/lib/components/batch/style/index.js +4 -0
  317. package/lib/components/batch/style/index.js.map +1 -1
  318. package/lib/components/cascader/src/cascader2.js +1 -1
  319. package/lib/components/cascader-panel/src/index.js +1 -1
  320. package/lib/components/cascader-panel/src/menu.js +1 -1
  321. package/lib/components/cascader-panel/src/node.js +209 -116
  322. package/lib/components/cascader-panel/src/node.js.map +1 -1
  323. package/lib/components/cascader-panel/src/node2.js +116 -209
  324. package/lib/components/cascader-panel/src/node2.js.map +1 -1
  325. package/lib/components/cascader-panel/src/store.js +1 -1
  326. package/lib/components/check-tag/index.js +2 -2
  327. package/lib/components/check-tag/src/check-tag.js +13 -31
  328. package/lib/components/check-tag/src/check-tag.js.map +1 -1
  329. package/lib/components/check-tag/src/check-tag2.js +31 -13
  330. package/lib/components/check-tag/src/check-tag2.js.map +1 -1
  331. package/lib/components/col/index.js +2 -2
  332. package/lib/components/col/src/col.js +43 -66
  333. package/lib/components/col/src/col.js.map +1 -1
  334. package/lib/components/col/src/col2.js +66 -43
  335. package/lib/components/col/src/col2.js.map +1 -1
  336. package/lib/components/collapse/index.js +2 -2
  337. package/lib/components/collapse/src/collapse.js +19 -28
  338. package/lib/components/collapse/src/collapse.js.map +1 -1
  339. package/lib/components/collapse/src/collapse2.js +28 -19
  340. package/lib/components/collapse/src/collapse2.js.map +1 -1
  341. package/lib/components/collection/index.js +1 -1
  342. package/lib/components/collection/src/collection.js +9 -62
  343. package/lib/components/collection/src/collection.js.map +1 -1
  344. package/lib/components/collection/src/collection2.js +62 -9
  345. package/lib/components/collection/src/collection2.js.map +1 -1
  346. package/lib/components/color-picker/index.js +2 -2
  347. package/lib/components/color-picker/src/color-picker.js +40 -400
  348. package/lib/components/color-picker/src/color-picker.js.map +1 -1
  349. package/lib/components/color-picker/src/color-picker2.js +400 -40
  350. package/lib/components/color-picker/src/color-picker2.js.map +1 -1
  351. package/lib/components/color-picker/src/components/predefine.js +1 -1
  352. package/lib/components/countdown/index.js +2 -2
  353. package/lib/components/countdown/src/countdown.js +74 -24
  354. package/lib/components/countdown/src/countdown.js.map +1 -1
  355. package/lib/components/countdown/src/countdown2.js +24 -74
  356. package/lib/components/countdown/src/countdown2.js.map +1 -1
  357. package/lib/components/descriptions/src/description.js +1 -1
  358. package/lib/components/descriptions/src/descriptions-row.js +7 -64
  359. package/lib/components/descriptions/src/descriptions-row.js.map +1 -1
  360. package/lib/components/descriptions/src/descriptions-row2.js +64 -7
  361. package/lib/components/descriptions/src/descriptions-row2.js.map +1 -1
  362. package/lib/components/dialog/src/dialog-content.js +88 -29
  363. package/lib/components/dialog/src/dialog-content.js.map +1 -1
  364. package/lib/components/dialog/src/dialog-content2.js +29 -88
  365. package/lib/components/dialog/src/dialog-content2.js.map +1 -1
  366. package/lib/components/dialog/src/dialog.js +1 -1
  367. package/lib/components/dialog/src/dialog2.js +1 -1
  368. package/lib/components/divider/index.js +2 -2
  369. package/lib/components/divider/src/divider.js +17 -35
  370. package/lib/components/divider/src/divider.js.map +1 -1
  371. package/lib/components/divider/src/divider2.js +35 -17
  372. package/lib/components/divider/src/divider2.js.map +1 -1
  373. package/lib/components/drawer/index.js +2 -2
  374. package/lib/components/drawer/src/drawer.js +176 -27
  375. package/lib/components/drawer/src/drawer.js.map +1 -1
  376. package/lib/components/drawer/src/drawer2.js +27 -176
  377. package/lib/components/drawer/src/drawer2.js.map +1 -1
  378. package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
  379. package/lib/components/dropdown/src/dropdown.js +1 -1
  380. package/lib/components/dsh-cascader/index.d.ts +12 -0
  381. package/lib/components/dsh-cascader/src/dsh-cascader.js +1 -1
  382. package/lib/components/dsh-cascader/src/dsh-cascader.vue.d.ts +6 -0
  383. package/lib/components/dsh-cascader-panel/index.d.ts +4 -0
  384. package/lib/components/dsh-cascader-panel/src/config.d.ts +1 -0
  385. package/lib/components/dsh-cascader-panel/src/config.js +2 -1
  386. package/lib/components/dsh-cascader-panel/src/config.js.map +1 -1
  387. package/lib/components/dsh-cascader-panel/src/dsh-node-content.d.ts +8 -0
  388. package/lib/components/dsh-cascader-panel/src/dsh-node-content.js +8 -2
  389. package/lib/components/dsh-cascader-panel/src/dsh-node-content.js.map +1 -1
  390. package/lib/components/dsh-cascader-panel/src/index.js +19 -24
  391. package/lib/components/dsh-cascader-panel/src/index.js.map +1 -1
  392. package/lib/components/dsh-cascader-panel/src/index.vue.d.ts +2 -0
  393. package/lib/components/dsh-cascader-panel/src/menu.js +1 -1
  394. package/lib/components/dsh-cascader-panel/src/node.d.ts +1 -0
  395. package/lib/components/dsh-cascader-panel/src/node.js +229 -115
  396. package/lib/components/dsh-cascader-panel/src/node.js.map +1 -1
  397. package/lib/components/dsh-cascader-panel/src/node2.js +115 -226
  398. package/lib/components/dsh-cascader-panel/src/node2.js.map +1 -1
  399. package/lib/components/dsh-cascader-panel/src/store.js +6 -7
  400. package/lib/components/dsh-cascader-panel/src/store.js.map +1 -1
  401. package/lib/components/dsh-select/src/select.js +1 -1
  402. package/lib/components/image-viewer/index.js +2 -2
  403. package/lib/components/image-viewer/src/image-viewer.js +401 -42
  404. package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
  405. package/lib/components/image-viewer/src/image-viewer2.js +42 -401
  406. package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
  407. package/lib/components/index.js +34 -34
  408. package/lib/components/menu/index.js +4 -4
  409. package/lib/components/menu/src/menu-item-group.js +35 -4
  410. package/lib/components/menu/src/menu-item-group.js.map +1 -1
  411. package/lib/components/menu/src/menu-item-group2.js +4 -35
  412. package/lib/components/menu/src/menu-item-group2.js.map +1 -1
  413. package/lib/components/menu/src/menu-item.js +97 -15
  414. package/lib/components/menu/src/menu-item.js.map +1 -1
  415. package/lib/components/menu/src/menu-item2.js +15 -97
  416. package/lib/components/menu/src/menu-item2.js.map +1 -1
  417. package/lib/components/message/index.js +1 -1
  418. package/lib/components/message/src/message.js +88 -147
  419. package/lib/components/message/src/message.js.map +1 -1
  420. package/lib/components/message/src/message2.js +147 -88
  421. package/lib/components/message/src/message2.js.map +1 -1
  422. package/lib/components/message/src/method.js +2 -2
  423. package/lib/components/notification/index.js +1 -1
  424. package/lib/components/notification/src/notification.js +148 -68
  425. package/lib/components/notification/src/notification.js.map +1 -1
  426. package/lib/components/notification/src/notification2.js +68 -148
  427. package/lib/components/notification/src/notification2.js.map +1 -1
  428. package/lib/components/notification/src/notify.js +2 -2
  429. package/lib/components/pagination/src/components/jumper.js +60 -9
  430. package/lib/components/pagination/src/components/jumper.js.map +1 -1
  431. package/lib/components/pagination/src/components/jumper2.js +9 -60
  432. package/lib/components/pagination/src/components/jumper2.js.map +1 -1
  433. package/lib/components/pagination/src/components/next.js +38 -19
  434. package/lib/components/pagination/src/components/next.js.map +1 -1
  435. package/lib/components/pagination/src/components/next2.js +19 -38
  436. package/lib/components/pagination/src/components/next2.js.map +1 -1
  437. package/lib/components/pagination/src/components/sizes.js +23 -69
  438. package/lib/components/pagination/src/components/sizes.js.map +1 -1
  439. package/lib/components/pagination/src/components/sizes2.js +69 -23
  440. package/lib/components/pagination/src/components/sizes2.js.map +1 -1
  441. package/lib/components/pagination/src/pagination.js +3 -3
  442. package/lib/components/popper/index.js +6 -6
  443. package/lib/components/popper/src/arrow.js +9 -37
  444. package/lib/components/popper/src/arrow.js.map +1 -1
  445. package/lib/components/popper/src/arrow2.js +37 -9
  446. package/lib/components/popper/src/arrow2.js.map +1 -1
  447. package/lib/components/popper/src/popper.js +28 -32
  448. package/lib/components/popper/src/popper.js.map +1 -1
  449. package/lib/components/popper/src/popper2.js +32 -28
  450. package/lib/components/popper/src/popper2.js.map +1 -1
  451. package/lib/components/popper/src/trigger.js +119 -32
  452. package/lib/components/popper/src/trigger.js.map +1 -1
  453. package/lib/components/popper/src/trigger2.js +32 -119
  454. package/lib/components/popper/src/trigger2.js.map +1 -1
  455. package/lib/components/radio/index.js +6 -6
  456. package/lib/components/radio/src/radio-button.js +66 -9
  457. package/lib/components/radio/src/radio-button.js.map +1 -1
  458. package/lib/components/radio/src/radio-button2.js +9 -66
  459. package/lib/components/radio/src/radio-button2.js.map +1 -1
  460. package/lib/components/radio/src/radio-group.js +37 -68
  461. package/lib/components/radio/src/radio-group.js.map +1 -1
  462. package/lib/components/radio/src/radio-group2.js +68 -37
  463. package/lib/components/radio/src/radio-group2.js.map +1 -1
  464. package/lib/components/radio/src/radio.js +32 -73
  465. package/lib/components/radio/src/radio.js.map +1 -1
  466. package/lib/components/radio/src/radio2.js +73 -32
  467. package/lib/components/radio/src/radio2.js.map +1 -1
  468. package/lib/components/result/index.js +2 -2
  469. package/lib/components/result/src/result.js +31 -63
  470. package/lib/components/result/src/result.js.map +1 -1
  471. package/lib/components/result/src/result2.js +63 -31
  472. package/lib/components/result/src/result2.js.map +1 -1
  473. package/lib/components/roving-focus-group/src/roving-focus-group.js +1 -1
  474. package/lib/components/row/index.js +2 -2
  475. package/lib/components/row/src/row.js +45 -31
  476. package/lib/components/row/src/row.js.map +1 -1
  477. package/lib/components/row/src/row2.js +31 -45
  478. package/lib/components/row/src/row2.js.map +1 -1
  479. package/lib/components/select/src/select.js +1 -1
  480. package/lib/components/skeleton/index.d.ts +1 -1
  481. package/lib/components/skeleton/index.js +4 -4
  482. package/lib/components/skeleton/src/skeleton-item.js +23 -18
  483. package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
  484. package/lib/components/skeleton/src/skeleton-item2.js +18 -23
  485. package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
  486. package/lib/components/skeleton/src/skeleton.js +22 -49
  487. package/lib/components/skeleton/src/skeleton.js.map +1 -1
  488. package/lib/components/skeleton/src/skeleton.vue.d.ts +1 -1
  489. package/lib/components/skeleton/src/skeleton2.js +49 -22
  490. package/lib/components/skeleton/src/skeleton2.js.map +1 -1
  491. package/lib/components/slider/src/button.js +22 -93
  492. package/lib/components/slider/src/button.js.map +1 -1
  493. package/lib/components/slider/src/button2.js +93 -22
  494. package/lib/components/slider/src/button2.js.map +1 -1
  495. package/lib/components/slider/src/slider2.js +1 -1
  496. package/lib/components/switch/index.js +2 -2
  497. package/lib/components/switch/src/switch.js +263 -98
  498. package/lib/components/switch/src/switch.js.map +1 -1
  499. package/lib/components/switch/src/switch2.js +98 -263
  500. package/lib/components/switch/src/switch2.js.map +1 -1
  501. package/lib/components/table/src/table-header/event-helper.js +6 -1
  502. package/lib/components/table/src/table-header/event-helper.js.map +1 -1
  503. package/lib/components/tabs/index.js +2 -2
  504. package/lib/components/tabs/src/tab-pane.js +72 -13
  505. package/lib/components/tabs/src/tab-pane.js.map +1 -1
  506. package/lib/components/tabs/src/tab-pane2.js +13 -72
  507. package/lib/components/tabs/src/tab-pane2.js.map +1 -1
  508. package/lib/components/tag/index.js +2 -2
  509. package/lib/components/tag/src/tag.js +94 -34
  510. package/lib/components/tag/src/tag.js.map +1 -1
  511. package/lib/components/tag/src/tag2.js +34 -94
  512. package/lib/components/tag/src/tag2.js.map +1 -1
  513. package/lib/components/text/index.js +2 -2
  514. package/lib/components/text/src/text.js +38 -24
  515. package/lib/components/text/src/text.js.map +1 -1
  516. package/lib/components/text/src/text2.js +24 -38
  517. package/lib/components/text/src/text2.js.map +1 -1
  518. package/lib/components/tooltip/index.js +2 -2
  519. package/lib/components/tooltip/src/tooltip.js +169 -34
  520. package/lib/components/tooltip/src/tooltip.js.map +1 -1
  521. package/lib/components/tooltip/src/tooltip2.js +34 -169
  522. package/lib/components/tooltip/src/tooltip2.js.map +1 -1
  523. package/lib/components/tooltip/src/trigger.js +1 -1
  524. package/lib/components/tooltip/src/trigger2.js +1 -1
  525. package/lib/components/tooltip-v2/index.js +1 -1
  526. package/lib/components/tooltip-v2/src/content.js +50 -112
  527. package/lib/components/tooltip-v2/src/content.js.map +1 -1
  528. package/lib/components/tooltip-v2/src/content2.js +112 -50
  529. package/lib/components/tooltip-v2/src/content2.js.map +1 -1
  530. package/lib/components/tooltip-v2/src/tooltip.js +2 -2
  531. package/lib/components/tooltip-v2/src/tooltip2.js +1 -1
  532. package/lib/components/transfer/src/composables/use-check.js +1 -1
  533. package/lib/components/transfer/src/transfer-panel.js +128 -21
  534. package/lib/components/transfer/src/transfer-panel.js.map +1 -1
  535. package/lib/components/transfer/src/transfer-panel2.js +21 -128
  536. package/lib/components/transfer/src/transfer-panel2.js.map +1 -1
  537. package/lib/components/transfer/src/transfer2.js +1 -1
  538. package/lib/components/upload/index.js +1 -1
  539. package/lib/components/upload/src/upload-content.js +31 -192
  540. package/lib/components/upload/src/upload-content.js.map +1 -1
  541. package/lib/components/upload/src/upload-content2.js +192 -31
  542. package/lib/components/upload/src/upload-content2.js.map +1 -1
  543. package/lib/components/upload/src/upload2.js +1 -1
  544. package/lib/components/visual-hidden/index.js +2 -2
  545. package/lib/components/visual-hidden/src/visual-hidden.js +35 -7
  546. package/lib/components/visual-hidden/src/visual-hidden.js.map +1 -1
  547. package/lib/components/visual-hidden/src/visual-hidden2.js +7 -35
  548. package/lib/components/visual-hidden/src/visual-hidden2.js.map +1 -1
  549. package/lib/index.js +34 -34
  550. package/package.json +1 -1
  551. package/theme-chalk/el-batch.css +1 -1
  552. package/theme-chalk/el-dsh-cascader.css +1 -1
  553. package/theme-chalk/index.css +1 -1
  554. package/theme-chalk/src/batch.scss +3 -2
  555. package/theme-chalk/src/dsh/dsh-cascader.scss +3 -3
@@ -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/notification.js');
7
+ var notification = require('./src/notification2.js');
8
8
  var install = require('../../utils/vue/install.js');
9
9
 
10
10
  const ElNotification = install.withInstallFunction(notify["default"], "$notify");
@@ -2,77 +2,157 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: 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('./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');
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=notification.js.map
@@ -1 +1 @@
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,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":"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":"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"}
@@ -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('./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');
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=notification2.js.map
@@ -1 +1 @@
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":"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"}
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;;;;;;"}
@@ -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('./notification2.js');
8
- var notification$1 = require('./notification.js');
7
+ var notification = require('./notification.js');
8
+ var notification$1 = require('./notification2.js');
9
9
  var core = require('@vueuse/core');
10
10
  var types = require('../../../utils/types.js');
11
11
  var shared = require('@vue/shared');