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
@@ -1,6 +1,6 @@
1
1
  import '../../utils/index.mjs';
2
2
  import notify from './src/notify.mjs';
3
- export { notificationEmits, notificationProps, notificationTypes } from './src/notification.mjs';
3
+ export { notificationEmits, notificationProps, notificationTypes } from './src/notification2.mjs';
4
4
  import { withInstallFunction } from '../../utils/vue/install.mjs';
5
5
 
6
6
  const ElNotification = withInstallFunction(notify, "$notify");
@@ -1,72 +1,154 @@
1
+ import { defineComponent, ref, computed, onMounted, openBlock, createBlock, Transition, unref, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, resolveDynamicComponent, createCommentVNode, toDisplayString, renderSlot, createElementBlock, Fragment, vShow, withModifiers, createVNode } from 'vue';
2
+ import { useTimeoutFn, useEventListener } from '@vueuse/core';
1
3
  import '../../../utils/index.mjs';
2
- import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
3
- import { iconPropType } from '../../../utils/vue/icon.mjs';
4
+ import '../../../constants/index.mjs';
5
+ import { ElIcon } from '../../icon/index.mjs';
6
+ import '../../config-provider/index.mjs';
7
+ import { notificationProps, notificationEmits } from './notification2.mjs';
8
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
9
+ import { useGlobalComponentSettings } from '../../config-provider/src/hooks/use-global-config.mjs';
10
+ import { CloseComponents, TypeComponentsMap } from '../../../utils/vue/icon.mjs';
11
+ import { EVENT_CODE } from '../../../constants/aria.mjs';
4
12
 
5
- const notificationTypes = [
6
- "success",
7
- "info",
8
- "warning",
9
- "error"
10
- ];
11
- const notificationProps = buildProps({
12
- customClass: {
13
- type: String,
14
- default: ""
15
- },
16
- dangerouslyUseHTMLString: {
17
- type: Boolean,
18
- default: false
19
- },
20
- duration: {
21
- type: Number,
22
- default: 4500
23
- },
24
- icon: {
25
- type: iconPropType
26
- },
27
- id: {
28
- type: String,
29
- default: ""
30
- },
31
- message: {
32
- type: definePropType([String, Object]),
33
- default: ""
34
- },
35
- offset: {
36
- type: Number,
37
- default: 0
38
- },
39
- onClick: {
40
- type: definePropType(Function),
41
- default: () => void 0
42
- },
43
- onClose: {
44
- type: definePropType(Function),
45
- required: true
46
- },
47
- position: {
48
- type: String,
49
- values: ["top-right", "top-left", "bottom-right", "bottom-left"],
50
- default: "top-right"
51
- },
52
- showClose: {
53
- type: Boolean,
54
- default: true
55
- },
56
- title: {
57
- type: String,
58
- default: ""
59
- },
60
- type: {
61
- type: String,
62
- values: [...notificationTypes, ""],
63
- default: ""
64
- },
65
- zIndex: Number
13
+ const _hoisted_1 = ["id"];
14
+ const _hoisted_2 = ["textContent"];
15
+ const _hoisted_3 = { key: 0 };
16
+ const _hoisted_4 = ["innerHTML"];
17
+ const __default__ = defineComponent({
18
+ name: "ElNotification"
66
19
  });
67
- const notificationEmits = {
68
- destroy: () => true
69
- };
20
+ const _sfc_main = /* @__PURE__ */ defineComponent({
21
+ ...__default__,
22
+ props: notificationProps,
23
+ emits: notificationEmits,
24
+ setup(__props, { expose }) {
25
+ const props = __props;
26
+ const { ns, zIndex } = useGlobalComponentSettings("notification");
27
+ const { nextZIndex, currentZIndex } = zIndex;
28
+ const { Close } = CloseComponents;
29
+ const visible = ref(false);
30
+ let timer = void 0;
31
+ const typeClass = computed(() => {
32
+ const type = props.type;
33
+ return type && TypeComponentsMap[props.type] ? ns.m(type) : "";
34
+ });
35
+ const iconComponent = computed(() => {
36
+ if (!props.type)
37
+ return props.icon;
38
+ return TypeComponentsMap[props.type] || props.icon;
39
+ });
40
+ const horizontalClass = computed(() => props.position.endsWith("right") ? "right" : "left");
41
+ const verticalProperty = computed(() => props.position.startsWith("top") ? "top" : "bottom");
42
+ const positionStyle = computed(() => {
43
+ var _a;
44
+ return {
45
+ [verticalProperty.value]: `${props.offset}px`,
46
+ zIndex: (_a = props.zIndex) != null ? _a : currentZIndex.value
47
+ };
48
+ });
49
+ function startTimer() {
50
+ if (props.duration > 0) {
51
+ ;
52
+ ({ stop: timer } = useTimeoutFn(() => {
53
+ if (visible.value)
54
+ close();
55
+ }, props.duration));
56
+ }
57
+ }
58
+ function clearTimer() {
59
+ timer == null ? void 0 : timer();
60
+ }
61
+ function close() {
62
+ visible.value = false;
63
+ }
64
+ function onKeydown({ code }) {
65
+ if (code === EVENT_CODE.delete || code === EVENT_CODE.backspace) {
66
+ clearTimer();
67
+ } else if (code === EVENT_CODE.esc) {
68
+ if (visible.value) {
69
+ close();
70
+ }
71
+ } else {
72
+ startTimer();
73
+ }
74
+ }
75
+ onMounted(() => {
76
+ startTimer();
77
+ nextZIndex();
78
+ visible.value = true;
79
+ });
80
+ useEventListener(document, "keydown", onKeydown);
81
+ expose({
82
+ visible,
83
+ close
84
+ });
85
+ return (_ctx, _cache) => {
86
+ return openBlock(), createBlock(Transition, {
87
+ name: unref(ns).b("fade"),
88
+ onBeforeLeave: _ctx.onClose,
89
+ onAfterLeave: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("destroy")),
90
+ persisted: ""
91
+ }, {
92
+ default: withCtx(() => [
93
+ withDirectives(createElementVNode("div", {
94
+ id: _ctx.id,
95
+ class: normalizeClass([unref(ns).b(), _ctx.customClass, unref(horizontalClass)]),
96
+ style: normalizeStyle(unref(positionStyle)),
97
+ role: "alert",
98
+ onMouseenter: clearTimer,
99
+ onMouseleave: startTimer,
100
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
101
+ }, [
102
+ unref(iconComponent) ? (openBlock(), createBlock(unref(ElIcon), {
103
+ key: 0,
104
+ class: normalizeClass([unref(ns).e("icon"), unref(typeClass)])
105
+ }, {
106
+ default: withCtx(() => [
107
+ (openBlock(), createBlock(resolveDynamicComponent(unref(iconComponent))))
108
+ ]),
109
+ _: 1
110
+ }, 8, ["class"])) : createCommentVNode("v-if", true),
111
+ createElementVNode("div", {
112
+ class: normalizeClass(unref(ns).e("group"))
113
+ }, [
114
+ createElementVNode("h2", {
115
+ class: normalizeClass(unref(ns).e("title")),
116
+ textContent: toDisplayString(_ctx.title)
117
+ }, null, 10, _hoisted_2),
118
+ withDirectives(createElementVNode("div", {
119
+ class: normalizeClass(unref(ns).e("content")),
120
+ style: normalizeStyle(!!_ctx.title ? void 0 : { margin: 0 })
121
+ }, [
122
+ renderSlot(_ctx.$slots, "default", {}, () => [
123
+ !_ctx.dangerouslyUseHTMLString ? (openBlock(), createElementBlock("p", _hoisted_3, toDisplayString(_ctx.message), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
124
+ createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),
125
+ createElementVNode("p", { innerHTML: _ctx.message }, null, 8, _hoisted_4)
126
+ ], 2112))
127
+ ])
128
+ ], 6), [
129
+ [vShow, _ctx.message]
130
+ ]),
131
+ _ctx.showClose ? (openBlock(), createBlock(unref(ElIcon), {
132
+ key: 0,
133
+ class: normalizeClass(unref(ns).e("closeBtn")),
134
+ onClick: withModifiers(close, ["stop"])
135
+ }, {
136
+ default: withCtx(() => [
137
+ createVNode(unref(Close))
138
+ ]),
139
+ _: 1
140
+ }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
141
+ ], 2)
142
+ ], 46, _hoisted_1), [
143
+ [vShow, visible.value]
144
+ ])
145
+ ]),
146
+ _: 3
147
+ }, 8, ["name", "onBeforeLeave"]);
148
+ };
149
+ }
150
+ });
151
+ var NotificationConstructor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:\\project\\work\\code-monkey-ui\\packages\\components\\notification\\src\\notification.vue"]]);
70
152
 
71
- export { notificationEmits, notificationProps, notificationTypes };
153
+ export { NotificationConstructor as default };
72
154
  //# sourceMappingURL=notification.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification.mjs","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":[],"mappings":";;;;AACY,MAAC,iBAAiB,GAAG;AACjC,EAAE,SAAS;AACX,EAAE,MAAM;AACR,EAAE,SAAS;AACX,EAAE,OAAO;AACT,EAAE;AACU,MAAC,iBAAiB,GAAG,UAAU,CAAC;AAC5C,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,wBAAwB,EAA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,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.mjs","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":[],"mappings":";;;;;;;;;;;;;;;;mCAkDc,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAA,MAAM,EAAE,EAAA,EAAI,MAAW,EAAA,GAAA,0BAAA,CAA2B,cAAc,CAAA,CAAA;AAChE,IAAM,MAAA,EAAE,YAAY,a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;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,154 +1,72 @@
1
- import { defineComponent, ref, computed, onMounted, openBlock, createBlock, Transition, unref, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, resolveDynamicComponent, createCommentVNode, toDisplayString, renderSlot, createElementBlock, Fragment, vShow, withModifiers, createVNode } from 'vue';
2
- import { useTimeoutFn, useEventListener } from '@vueuse/core';
3
1
  import '../../../utils/index.mjs';
4
- import '../../../constants/index.mjs';
5
- import { ElIcon } from '../../icon/index.mjs';
6
- import '../../config-provider/index.mjs';
7
- import { notificationProps, notificationEmits } from './notification.mjs';
8
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
9
- import { useGlobalComponentSettings } from '../../config-provider/src/hooks/use-global-config.mjs';
10
- import { CloseComponents, TypeComponentsMap } from '../../../utils/vue/icon.mjs';
11
- import { EVENT_CODE } from '../../../constants/aria.mjs';
2
+ import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
3
+ import { iconPropType } from '../../../utils/vue/icon.mjs';
12
4
 
13
- const _hoisted_1 = ["id"];
14
- const _hoisted_2 = ["textContent"];
15
- const _hoisted_3 = { key: 0 };
16
- const _hoisted_4 = ["innerHTML"];
17
- const __default__ = defineComponent({
18
- name: "ElNotification"
5
+ const notificationTypes = [
6
+ "success",
7
+ "info",
8
+ "warning",
9
+ "error"
10
+ ];
11
+ const notificationProps = buildProps({
12
+ customClass: {
13
+ type: String,
14
+ default: ""
15
+ },
16
+ dangerouslyUseHTMLString: {
17
+ type: Boolean,
18
+ default: false
19
+ },
20
+ duration: {
21
+ type: Number,
22
+ default: 4500
23
+ },
24
+ icon: {
25
+ type: iconPropType
26
+ },
27
+ id: {
28
+ type: String,
29
+ default: ""
30
+ },
31
+ message: {
32
+ type: definePropType([String, Object]),
33
+ default: ""
34
+ },
35
+ offset: {
36
+ type: Number,
37
+ default: 0
38
+ },
39
+ onClick: {
40
+ type: definePropType(Function),
41
+ default: () => void 0
42
+ },
43
+ onClose: {
44
+ type: definePropType(Function),
45
+ required: true
46
+ },
47
+ position: {
48
+ type: String,
49
+ values: ["top-right", "top-left", "bottom-right", "bottom-left"],
50
+ default: "top-right"
51
+ },
52
+ showClose: {
53
+ type: Boolean,
54
+ default: true
55
+ },
56
+ title: {
57
+ type: String,
58
+ default: ""
59
+ },
60
+ type: {
61
+ type: String,
62
+ values: [...notificationTypes, ""],
63
+ default: ""
64
+ },
65
+ zIndex: Number
19
66
  });
20
- const _sfc_main = /* @__PURE__ */ defineComponent({
21
- ...__default__,
22
- props: notificationProps,
23
- emits: notificationEmits,
24
- setup(__props, { expose }) {
25
- const props = __props;
26
- const { ns, zIndex } = useGlobalComponentSettings("notification");
27
- const { nextZIndex, currentZIndex } = zIndex;
28
- const { Close } = CloseComponents;
29
- const visible = ref(false);
30
- let timer = void 0;
31
- const typeClass = computed(() => {
32
- const type = props.type;
33
- return type && TypeComponentsMap[props.type] ? ns.m(type) : "";
34
- });
35
- const iconComponent = computed(() => {
36
- if (!props.type)
37
- return props.icon;
38
- return TypeComponentsMap[props.type] || props.icon;
39
- });
40
- const horizontalClass = computed(() => props.position.endsWith("right") ? "right" : "left");
41
- const verticalProperty = computed(() => props.position.startsWith("top") ? "top" : "bottom");
42
- const positionStyle = computed(() => {
43
- var _a;
44
- return {
45
- [verticalProperty.value]: `${props.offset}px`,
46
- zIndex: (_a = props.zIndex) != null ? _a : currentZIndex.value
47
- };
48
- });
49
- function startTimer() {
50
- if (props.duration > 0) {
51
- ;
52
- ({ stop: timer } = useTimeoutFn(() => {
53
- if (visible.value)
54
- close();
55
- }, props.duration));
56
- }
57
- }
58
- function clearTimer() {
59
- timer == null ? void 0 : timer();
60
- }
61
- function close() {
62
- visible.value = false;
63
- }
64
- function onKeydown({ code }) {
65
- if (code === EVENT_CODE.delete || code === EVENT_CODE.backspace) {
66
- clearTimer();
67
- } else if (code === EVENT_CODE.esc) {
68
- if (visible.value) {
69
- close();
70
- }
71
- } else {
72
- startTimer();
73
- }
74
- }
75
- onMounted(() => {
76
- startTimer();
77
- nextZIndex();
78
- visible.value = true;
79
- });
80
- useEventListener(document, "keydown", onKeydown);
81
- expose({
82
- visible,
83
- close
84
- });
85
- return (_ctx, _cache) => {
86
- return openBlock(), createBlock(Transition, {
87
- name: unref(ns).b("fade"),
88
- onBeforeLeave: _ctx.onClose,
89
- onAfterLeave: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("destroy")),
90
- persisted: ""
91
- }, {
92
- default: withCtx(() => [
93
- withDirectives(createElementVNode("div", {
94
- id: _ctx.id,
95
- class: normalizeClass([unref(ns).b(), _ctx.customClass, unref(horizontalClass)]),
96
- style: normalizeStyle(unref(positionStyle)),
97
- role: "alert",
98
- onMouseenter: clearTimer,
99
- onMouseleave: startTimer,
100
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
101
- }, [
102
- unref(iconComponent) ? (openBlock(), createBlock(unref(ElIcon), {
103
- key: 0,
104
- class: normalizeClass([unref(ns).e("icon"), unref(typeClass)])
105
- }, {
106
- default: withCtx(() => [
107
- (openBlock(), createBlock(resolveDynamicComponent(unref(iconComponent))))
108
- ]),
109
- _: 1
110
- }, 8, ["class"])) : createCommentVNode("v-if", true),
111
- createElementVNode("div", {
112
- class: normalizeClass(unref(ns).e("group"))
113
- }, [
114
- createElementVNode("h2", {
115
- class: normalizeClass(unref(ns).e("title")),
116
- textContent: toDisplayString(_ctx.title)
117
- }, null, 10, _hoisted_2),
118
- withDirectives(createElementVNode("div", {
119
- class: normalizeClass(unref(ns).e("content")),
120
- style: normalizeStyle(!!_ctx.title ? void 0 : { margin: 0 })
121
- }, [
122
- renderSlot(_ctx.$slots, "default", {}, () => [
123
- !_ctx.dangerouslyUseHTMLString ? (openBlock(), createElementBlock("p", _hoisted_3, toDisplayString(_ctx.message), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
124
- createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),
125
- createElementVNode("p", { innerHTML: _ctx.message }, null, 8, _hoisted_4)
126
- ], 2112))
127
- ])
128
- ], 6), [
129
- [vShow, _ctx.message]
130
- ]),
131
- _ctx.showClose ? (openBlock(), createBlock(unref(ElIcon), {
132
- key: 0,
133
- class: normalizeClass(unref(ns).e("closeBtn")),
134
- onClick: withModifiers(close, ["stop"])
135
- }, {
136
- default: withCtx(() => [
137
- createVNode(unref(Close))
138
- ]),
139
- _: 1
140
- }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
141
- ], 2)
142
- ], 46, _hoisted_1), [
143
- [vShow, visible.value]
144
- ])
145
- ]),
146
- _: 3
147
- }, 8, ["name", "onBeforeLeave"]);
148
- };
149
- }
150
- });
151
- var NotificationConstructor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:\\project\\work\\code-monkey-ui\\packages\\components\\notification\\src\\notification.vue"]]);
67
+ const notificationEmits = {
68
+ destroy: () => true
69
+ };
152
70
 
153
- export { NotificationConstructor as default };
71
+ export { notificationEmits, notificationProps, notificationTypes };
154
72
  //# sourceMappingURL=notification2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification2.mjs","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":[],"mappings":";;;;;;;;;;;;;;;;mCAkDc,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAA,MAAM,EAAE,EAAA,EAAI,MAAW,EAAA,GAAA,0BAAA,CAA2B,cAAc,CAAA,CAAA;AAChE,IAAM,MAAA,EAAE,YAAY,aAAkB,EAAA,GAAA,MAAA,CAAA;AAEtC,IAAA,MAAM,EAAE,KAAU,EAAA,GAAA,eAAA,CAAA;AAElB,IAAM,MAAA,OAAA,GAAU,IAAI,KAAK,CAAA,CAAA;AACzB,IAAA,IAAI,KAAkC,GAAA,KAAA,CAAA,CAAA;AAEtC,IAAM,MAAA,SAAA,GAAY,SAAS,MAAM;AAC/B,MAAA,MAAM,OAAO,KAAM,CAAA,IAAA,CAAA;AACnB,MAAA,OAAO,QAAQ,iBAAkB,CAAA,KAAA,CAAM,QAAQ,EAAG,CAAA,CAAA,CAAE,IAAI,CAAI,GAAA,EAAA,CAAA;AAAA,KAC7D,CAAA,CAAA;AAED,IAAM,MAAA,aAAA,GAAgB,SAAS,MAAM;AACnC,MAAA,IAAI,CAAC,KAAM,CAAA,IAAA;AAAM,QAAA,OAAO,KAAM,CAAA,IAAA,CAAA;AAC9B,MAAO,OAAA,iBAAA,CAAkB,KAAM,CAAA,IAAA,CAAA,IAAS,KAAM,CAAA,IAAA,CAAA;AAAA,KAC/C,CAAA,CAAA;AAED,IAAM,MAAA,eAAA,GAAkB,SAAS,MAC/B,KAAA,CAAM,SAAS,QAAS,CAAA,OAAO,CAAI,GAAA,O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,OAAA,CAAA,KAAA,EAAA;AAAA,UACR,KAAA,EAAA,CAAA;AAAA,SACK;AACL,OAAW,MAAA;AAAA,QACb,UAAA,EAAA,CAAA;AAAA,OACF;AAGA,KAAA;AACE,IAAW,SAAA,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,IAAa,gBAAA,CAAA,QAAA,EAAA,SAAA,EAAA,SAAA,CAAA,CAAA;AAAA,IACX,MAAA,CAAA;AAAA,MAEA,OAAA;AAAA,MACD,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"notification2.mjs","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":[],"mappings":";;;;AACY,MAAC,iBAAiB,GAAG;AACjC,EAAE,SAAS;AACX,EAAE,MAAM;AACR,EAAE,SAAS;AACX,EAAE,OAAO;AACT,EAAE;AACU,MAAC,iBAAiB,GAAG,UAAU,CAAC;AAC5C,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM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,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,7 +1,7 @@
1
1
  import { isVNode, createVNode, render } from 'vue';
2
2
  import '../../../utils/index.mjs';
3
- import NotificationConstructor from './notification2.mjs';
4
- import { notificationTypes } from './notification.mjs';
3
+ import NotificationConstructor from './notification.mjs';
4
+ import { notificationTypes } from './notification2.mjs';
5
5
  import { isClient } from '@vueuse/core';
6
6
  import { isElement } from '../../../utils/types.mjs';
7
7
  import { isString } from '@vue/shared';
@@ -1,14 +1,65 @@
1
- import '../../../../utils/index.mjs';
2
- import '../../../../constants/index.mjs';
3
- import { buildProps } from '../../../../utils/vue/props/runtime.mjs';
4
- import { componentSizes } from '../../../../constants/size.mjs';
1
+ import { defineComponent, ref, computed, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, toDisplayString, createVNode } from 'vue';
2
+ import '../../../../hooks/index.mjs';
3
+ import { ElInput } from '../../../input/index.mjs';
4
+ import { usePagination } from '../usePagination.mjs';
5
+ import { paginationJumperProps } from './jumper2.mjs';
6
+ import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';
7
+ import { useLocale } from '../../../../hooks/use-locale/index.mjs';
8
+ import { useNamespace } from '../../../../hooks/use-namespace/index.mjs';
5
9
 
6
- const paginationJumperProps = buildProps({
7
- size: {
8
- type: String,
9
- values: componentSizes
10
+ const _hoisted_1 = ["disabled"];
11
+ const __default__ = defineComponent({
12
+ name: "ElPaginationJumper"
13
+ });
14
+ const _sfc_main = /* @__PURE__ */ defineComponent({
15
+ ...__default__,
16
+ props: paginationJumperProps,
17
+ setup(__props) {
18
+ const { t } = useLocale();
19
+ const ns = useNamespace("pagination");
20
+ const { pageCount, disabled, currentPage, changeEvent } = usePagination();
21
+ const userInput = ref();
22
+ const innerValue = computed(() => {
23
+ var _a;
24
+ return (_a = userInput.value) != null ? _a : currentPage == null ? void 0 : currentPage.value;
25
+ });
26
+ function handleInput(val) {
27
+ userInput.value = val ? +val : "";
28
+ }
29
+ function handleChange(val) {
30
+ val = Math.trunc(+val);
31
+ changeEvent == null ? void 0 : changeEvent(val);
32
+ userInput.value = void 0;
33
+ }
34
+ return (_ctx, _cache) => {
35
+ return openBlock(), createElementBlock("span", {
36
+ class: normalizeClass(unref(ns).e("jump")),
37
+ disabled: unref(disabled)
38
+ }, [
39
+ createElementVNode("span", {
40
+ class: normalizeClass([unref(ns).e("goto")])
41
+ }, toDisplayString(unref(t)("el.pagination.goto")), 3),
42
+ createVNode(unref(ElInput), {
43
+ size: _ctx.size,
44
+ class: normalizeClass([unref(ns).e("editor"), unref(ns).is("in-pagination")]),
45
+ min: 1,
46
+ max: unref(pageCount),
47
+ disabled: unref(disabled),
48
+ "model-value": unref(innerValue),
49
+ "validate-event": false,
50
+ label: unref(t)("el.pagination.page"),
51
+ type: "number",
52
+ "onUpdate:modelValue": handleInput,
53
+ onChange: handleChange
54
+ }, null, 8, ["size", "class", "max", "disabled", "model-value", "label"]),
55
+ createElementVNode("span", {
56
+ class: normalizeClass([unref(ns).e("classifier")])
57
+ }, toDisplayString(unref(t)("el.pagination.pageClassifier")), 3)
58
+ ], 10, _hoisted_1);
59
+ };
10
60
  }
11
61
  });
62
+ var Jumper = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:\\project\\work\\code-monkey-ui\\packages\\components\\pagination\\src\\components\\jumper.vue"]]);
12
63
 
13
- export { paginationJumperProps };
64
+ export { Jumper as default };
14
65
  //# sourceMappingURL=jumper.mjs.map