ep-craft 0.1.37 → 0.1.38

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 (286) hide show
  1. package/dist/components/badge/index.js +6 -5
  2. package/dist/components/calendar/EpCalendar.vue.d.ts +50 -0
  3. package/dist/components/calendar/EpCalendar.vue.js +154 -0
  4. package/dist/components/calendar/EpCalendar2.vue.js +4 -0
  5. package/dist/components/calendar/EpDateTable.vue.d.ts +27 -0
  6. package/dist/components/calendar/EpDateTable.vue.js +89 -0
  7. package/dist/components/calendar/EpDateTable2.vue.js +4 -0
  8. package/dist/components/calendar/EpSelectController.vue.d.ts +8 -0
  9. package/dist/components/calendar/EpSelectController.vue.js +88 -0
  10. package/dist/components/calendar/EpSelectController2.vue.js +4 -0
  11. package/dist/components/calendar/calendar.d.ts +54 -0
  12. package/dist/components/calendar/calendar.js +45 -0
  13. package/dist/components/calendar/date-table.d.ts +53 -0
  14. package/dist/components/calendar/date-table.js +41 -0
  15. package/dist/components/calendar/index.d.ts +13 -2
  16. package/dist/components/calendar/index.js +9 -4
  17. package/dist/components/calendar/instance.d.ts +5 -0
  18. package/dist/components/calendar/select-controller.d.ts +31 -0
  19. package/dist/components/calendar/select-controller.js +21 -0
  20. package/dist/components/calendar/use-calendar.d.ts +13 -0
  21. package/dist/components/calendar/use-calendar.js +84 -0
  22. package/dist/components/calendar/use-date-table.d.ts +18 -0
  23. package/dist/components/calendar/use-date-table.js +99 -0
  24. package/dist/components/carousel/EpCarousel.vue.d.ts +1 -1
  25. package/dist/components/cascader/EpCascader.vue.d.ts +4 -4
  26. package/dist/components/config-provider/index.js +5 -4
  27. package/dist/components/config-provider/src/config-provider-props.d.ts +3 -6
  28. package/dist/components/config-provider/src/config-provider-props.js +1 -1
  29. package/dist/components/config-provider/src/hooks/use-global-config.js +75 -47
  30. package/dist/components/date-picker-panel/src/composables/use-basic-date-table.d.ts +1 -1
  31. package/dist/components/date-picker-panel/src/date-picker-panel.d.ts +1 -1
  32. package/dist/components/dialog/EpDialog.vue.d.ts +61 -0
  33. package/dist/components/dialog/EpDialog.vue.js +214 -0
  34. package/dist/components/dialog/EpDialog2.vue.js +4 -0
  35. package/dist/components/dialog/EpDialogContent.vue.d.ts +31 -0
  36. package/dist/components/dialog/EpDialogContent.vue.js +108 -0
  37. package/dist/components/dialog/EpDialogContent2.vue.js +4 -0
  38. package/dist/components/dialog/constants.d.ts +12 -0
  39. package/dist/components/dialog/constants.js +5 -0
  40. package/dist/components/dialog/dialog-content.d.ts +84 -0
  41. package/dist/components/dialog/dialog-content.js +90 -0
  42. package/dist/components/dialog/dialog.d.ts +173 -0
  43. package/dist/components/dialog/dialog.js +156 -0
  44. package/dist/components/dialog/index.d.ts +20 -2
  45. package/dist/components/dialog/index.js +24 -4
  46. package/dist/components/dialog/instance.d.ts +2 -0
  47. package/dist/components/dialog/use-dialog.d.ts +35 -0
  48. package/dist/components/dialog/use-dialog.js +176 -0
  49. package/dist/components/drawer/EpDrawer.vue.d.ts +67 -0
  50. package/dist/components/drawer/EpDrawer.vue.js +234 -0
  51. package/dist/components/drawer/EpDrawer2.vue.js +4 -0
  52. package/dist/components/drawer/drawer.d.ts +105 -0
  53. package/dist/components/drawer/drawer.js +42 -0
  54. package/dist/components/drawer/index.d.ts +14 -2
  55. package/dist/components/drawer/index.js +9 -4
  56. package/dist/components/drawer/instance.d.ts +2 -0
  57. package/dist/components/drawer/useResizable.d.ts +7 -0
  58. package/dist/components/drawer/useResizable.js +50 -0
  59. package/dist/components/dropdown/src/dropdown-item-impl2.vue.js +2 -2
  60. package/dist/components/dropdown/src/dropdown-item2.vue.js +2 -2
  61. package/dist/components/dropdown/src/dropdown-menu2.vue.js +2 -2
  62. package/dist/components/dropdown/src/dropdown2.vue.js +2 -2
  63. package/dist/components/empty/index.js +2 -1
  64. package/dist/components/form/index.js +11 -9
  65. package/dist/components/form/src/form-item.js +5 -5
  66. package/dist/components/form/src/form.js +5 -6
  67. package/dist/components/form-item/index.js +6 -5
  68. package/dist/components/infinite-scroll/index.d.ts +26 -0
  69. package/dist/components/infinite-scroll/index.js +15 -0
  70. package/dist/components/infinite-scroll/src/index.d.ts +20 -0
  71. package/dist/components/infinite-scroll/src/index.js +109 -0
  72. package/dist/components/loading/index.d.ts +15 -0
  73. package/dist/components/loading/index.js +13 -0
  74. package/dist/components/loading/src/directive.d.ts +13 -0
  75. package/dist/components/loading/src/directive.js +62 -0
  76. package/dist/components/loading/src/loading.d.ts +34 -0
  77. package/dist/components/loading/src/loading.js +121 -0
  78. package/dist/components/loading/src/service.d.ts +8 -0
  79. package/dist/components/loading/src/service.js +67 -0
  80. package/dist/components/loading/src/types.d.ts +47 -0
  81. package/dist/components/message/index.d.ts +3 -0
  82. package/dist/components/message/index.js +18 -0
  83. package/dist/components/message/src/instance.d.ts +18 -0
  84. package/dist/components/message/src/instance.js +18 -0
  85. package/dist/components/message/src/message.d.ts +175 -0
  86. package/dist/components/message/src/message.js +160 -0
  87. package/dist/components/message/src/message.vue.d.ts +38 -0
  88. package/dist/components/message/src/message.vue.js +156 -0
  89. package/dist/components/message/src/message2.vue.js +4 -0
  90. package/dist/components/message/src/method.d.ts +5 -0
  91. package/dist/components/message/src/method.js +123 -0
  92. package/dist/components/message-box/index.d.ts +6 -0
  93. package/dist/components/message-box/index.js +9 -0
  94. package/dist/components/message-box/src/index.vue.d.ts +5517 -0
  95. package/dist/components/message-box/src/index.vue.js +203 -0
  96. package/dist/components/message-box/src/index2.vue.js +237 -0
  97. package/dist/components/message-box/src/message-box.type.d.ts +167 -0
  98. package/dist/components/message-box/src/messageBox.d.ts +3 -0
  99. package/dist/components/message-box/src/messageBox.js +102 -0
  100. package/dist/components/notification/index.d.ts +3 -0
  101. package/dist/components/notification/index.js +15 -0
  102. package/dist/components/notification/src/notification.d.ts +157 -0
  103. package/dist/components/notification/src/notification.js +127 -0
  104. package/dist/components/notification/src/notification.vue.d.ts +34 -0
  105. package/dist/components/notification/src/notification.vue.js +146 -0
  106. package/dist/components/notification/src/notification2.vue.js +4 -0
  107. package/dist/components/notification/src/notify.d.ts +15 -0
  108. package/dist/components/notification/src/notify.js +100 -0
  109. package/dist/components/option/index.js +3 -3
  110. package/dist/components/overlay/index.d.ts +8 -0
  111. package/dist/components/overlay/overlay.d.ts +73 -0
  112. package/dist/components/overlay/overlay.js +80 -0
  113. package/dist/components/page-header/EpPageHeader.vue.d.ts +30 -0
  114. package/dist/components/page-header/EpPageHeader.vue.js +109 -0
  115. package/dist/components/page-header/EpPageHeader2.vue.js +4 -0
  116. package/dist/components/page-header/index.d.ts +13 -2
  117. package/dist/components/page-header/index.js +9 -4
  118. package/dist/components/page-header/instance.d.ts +2 -0
  119. package/dist/components/page-header/page-header.d.ts +26 -0
  120. package/dist/components/page-header/page-header.js +33 -0
  121. package/dist/components/popconfirm/EpPopconfirm.vue.d.ts +36 -0
  122. package/dist/components/popconfirm/EpPopconfirm.vue.js +146 -0
  123. package/dist/components/popconfirm/EpPopconfirm2.vue.js +4 -0
  124. package/dist/components/popconfirm/index.d.ts +14 -2
  125. package/dist/components/popconfirm/index.js +9 -4
  126. package/dist/components/popconfirm/instance.d.ts +2 -0
  127. package/dist/components/popconfirm/popconfirm.d.ts +106 -0
  128. package/dist/components/popconfirm/popconfirm.js +103 -0
  129. package/dist/components/progress/src/progress.vue.d.ts +1 -1
  130. package/dist/components/roving-focus-group/index.js +2 -2
  131. package/dist/components/roving-focus-group/src/roving-focus-group.vue.js +19 -11
  132. package/dist/components/roving-focus-group/src/roving-focus-group2.vue.js +11 -19
  133. package/dist/components/roving-focus-group/src/roving-focus-item.vue.js +76 -18
  134. package/dist/components/roving-focus-group/src/roving-focus-item2.vue.js +18 -76
  135. package/dist/components/select/index.d.ts +21 -21
  136. package/dist/components/select/select.vue.d.ts +7 -7
  137. package/dist/components/select/select2.vue.js +12 -12
  138. package/dist/components/select/src/option.vue.js +5 -5
  139. package/dist/components/select-v2/src/select.vue.d.ts +8 -8
  140. package/dist/components/table-v2/index.d.ts +21 -2
  141. package/dist/components/table-v2/index.js +11 -4
  142. package/dist/components/table-v2/src/EpTableV2.d.ts +359 -0
  143. package/dist/components/table-v2/src/EpTableV2.js +287 -0
  144. package/dist/components/table-v2/src/cell.d.ts +27 -0
  145. package/dist/components/table-v2/src/common.d.ts +42 -0
  146. package/dist/components/table-v2/src/common.js +38 -0
  147. package/dist/components/table-v2/src/components/cell.d.ts +4 -0
  148. package/dist/components/table-v2/src/components/cell.js +20 -0
  149. package/dist/components/table-v2/src/components/expand-icon.d.ts +15 -0
  150. package/dist/components/table-v2/src/components/expand-icon.js +30 -0
  151. package/dist/components/table-v2/src/components/header-cell.d.ts +4 -0
  152. package/dist/components/table-v2/src/components/header-cell.js +15 -0
  153. package/dist/components/table-v2/src/components/header-row.d.ts +59 -0
  154. package/dist/components/table-v2/src/components/header-row.js +41 -0
  155. package/dist/components/table-v2/src/components/header.d.ts +105 -0
  156. package/dist/components/table-v2/src/components/header.js +98 -0
  157. package/dist/components/table-v2/src/components/index.d.ts +11 -0
  158. package/dist/components/table-v2/src/components/row.d.ts +166 -0
  159. package/dist/components/table-v2/src/components/row.js +176 -0
  160. package/dist/components/table-v2/src/components/sort-icon.d.ts +9 -0
  161. package/dist/components/table-v2/src/components/sort-icon.js +21 -0
  162. package/dist/components/table-v2/src/composables/index.d.ts +11 -0
  163. package/dist/components/table-v2/src/composables/use-columns.d.ts +128 -0
  164. package/dist/components/table-v2/src/composables/use-columns.js +73 -0
  165. package/dist/components/table-v2/src/composables/use-data.d.ts +14 -0
  166. package/dist/components/table-v2/src/composables/use-data.js +33 -0
  167. package/dist/components/table-v2/src/composables/use-row.d.ts +31 -0
  168. package/dist/components/table-v2/src/composables/use-row.js +83 -0
  169. package/dist/components/table-v2/src/composables/use-scrollbar.d.ts +31 -0
  170. package/dist/components/table-v2/src/composables/use-scrollbar.js +53 -0
  171. package/dist/components/table-v2/src/composables/use-styles.d.ts +23 -0
  172. package/dist/components/table-v2/src/composables/use-styles.js +66 -0
  173. package/dist/components/table-v2/src/composables/utils.d.ts +3 -0
  174. package/dist/components/table-v2/src/composables/utils.js +19 -0
  175. package/dist/components/table-v2/src/constants.d.ts +18 -0
  176. package/dist/components/table-v2/src/constants.js +12 -0
  177. package/dist/components/table-v2/src/grid.d.ts +105 -0
  178. package/dist/components/table-v2/src/grid.js +56 -0
  179. package/dist/components/table-v2/src/header-cell.d.ts +13 -0
  180. package/dist/components/table-v2/src/header-row.d.ts +26 -0
  181. package/dist/components/table-v2/src/header-row.js +20 -0
  182. package/dist/components/table-v2/src/header.d.ts +44 -0
  183. package/dist/components/table-v2/src/header.js +35 -0
  184. package/dist/components/table-v2/src/private.d.ts +1 -0
  185. package/dist/components/table-v2/src/private.js +4 -0
  186. package/dist/components/table-v2/src/renderers/cell.d.ts +11 -0
  187. package/dist/components/table-v2/src/renderers/cell.js +101 -0
  188. package/dist/components/table-v2/src/renderers/empty.d.ts +7 -0
  189. package/dist/components/table-v2/src/renderers/empty.js +15 -0
  190. package/dist/components/table-v2/src/renderers/footer.d.ts +7 -0
  191. package/dist/components/table-v2/src/renderers/footer.js +14 -0
  192. package/dist/components/table-v2/src/renderers/header-cell.d.ts +14 -0
  193. package/dist/components/table-v2/src/renderers/header-cell.js +77 -0
  194. package/dist/components/table-v2/src/renderers/header.d.ts +9 -0
  195. package/dist/components/table-v2/src/renderers/header.js +53 -0
  196. package/dist/components/table-v2/src/renderers/left-table.d.ts +8 -0
  197. package/dist/components/table-v2/src/renderers/left-table.js +22 -0
  198. package/dist/components/table-v2/src/renderers/main-table.d.ts +8 -0
  199. package/dist/components/table-v2/src/renderers/main-table.js +21 -0
  200. package/dist/components/table-v2/src/renderers/overlay.d.ts +3 -0
  201. package/dist/components/table-v2/src/renderers/overlay.js +14 -0
  202. package/dist/components/table-v2/src/renderers/right-table.d.ts +8 -0
  203. package/dist/components/table-v2/src/renderers/right-table.js +22 -0
  204. package/dist/components/table-v2/src/renderers/row.d.ts +11 -0
  205. package/dist/components/table-v2/src/renderers/row.js +98 -0
  206. package/dist/components/table-v2/src/row.d.ts +101 -0
  207. package/dist/components/table-v2/src/row.js +53 -0
  208. package/dist/components/table-v2/src/table-grid.d.ts +236 -0
  209. package/dist/components/table-v2/src/table-grid.js +240 -0
  210. package/dist/components/table-v2/src/table.d.ts +194 -0
  211. package/dist/components/table-v2/src/table.js +134 -0
  212. package/dist/components/table-v2/src/tokens.d.ts +9 -0
  213. package/dist/components/table-v2/src/tokens.js +5 -0
  214. package/dist/components/table-v2/src/types.d.ts +99 -0
  215. package/dist/components/table-v2/src/use-table.d.ts +98 -0
  216. package/dist/components/table-v2/src/use-table.js +162 -0
  217. package/dist/components/table-v2/src/utils.d.ts +8 -0
  218. package/dist/components/table-v2/src/utils.js +15 -0
  219. package/dist/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +2 -2
  220. package/dist/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +2 -2
  221. package/dist/components/tour/EpTour.vue.d.ts +1 -1
  222. package/dist/components/tree-select/src/tree-select.vue.d.ts +10 -10
  223. package/dist/components/tree-v2/EpTreeNode.vue.d.ts +17 -0
  224. package/dist/components/tree-v2/EpTreeNode.vue.js +127 -0
  225. package/dist/components/tree-v2/EpTreeNode2.vue.js +4 -0
  226. package/dist/components/tree-v2/EpTreeV2.vue.d.ts +61 -0
  227. package/dist/components/tree-v2/EpTreeV2.vue.js +168 -0
  228. package/dist/components/tree-v2/EpTreeV22.vue.js +4 -0
  229. package/dist/components/tree-v2/composables/useCheck.d.ts +15 -0
  230. package/dist/components/tree-v2/composables/useCheck.js +142 -0
  231. package/dist/components/tree-v2/composables/useFilter.d.ts +8 -0
  232. package/dist/components/tree-v2/composables/useFilter.js +50 -0
  233. package/dist/components/tree-v2/composables/useTree.d.ts +404 -0
  234. package/dist/components/tree-v2/composables/useTree.js +228 -0
  235. package/dist/components/tree-v2/index.d.ts +11 -2
  236. package/dist/components/tree-v2/index.js +5 -2
  237. package/dist/components/tree-v2/instance.d.ts +2 -0
  238. package/dist/components/tree-v2/tree-node-content.d.ts +20 -0
  239. package/dist/components/tree-v2/tree-node-content.js +33 -0
  240. package/dist/components/tree-v2/types.d.ts +97 -0
  241. package/dist/components/tree-v2/virtual-tree.d.ts +122 -0
  242. package/dist/components/tree-v2/virtual-tree.js +140 -0
  243. package/dist/components/virtual-list/src/builders/build-grid.d.ts +211 -0
  244. package/dist/components/virtual-list/src/builders/build-grid.js +449 -0
  245. package/dist/components/virtual-list/src/components/dynamic-size-grid.d.ts +212 -0
  246. package/dist/components/virtual-list/src/components/dynamic-size-grid.js +200 -0
  247. package/dist/components/virtual-list/src/components/fixed-size-grid.d.ts +199 -0
  248. package/dist/components/virtual-list/src/components/fixed-size-grid.js +126 -0
  249. package/dist/components/virtual-list/src/hooks/use-grid-touch.d.ts +8 -0
  250. package/dist/components/virtual-list/src/hooks/use-grid-touch.js +40 -0
  251. package/dist/components/virtual-list/src/hooks/use-grid-wheel.d.ts +13 -0
  252. package/dist/components/virtual-list/src/hooks/use-grid-wheel.js +30 -0
  253. package/dist/components/virtual-list/src/props.js +16 -17
  254. package/dist/components/virtual-list/src/utils.js +14 -13
  255. package/dist/components/watermark/EpWatermark.vue.d.ts +18 -0
  256. package/dist/components/watermark/EpWatermark.vue.js +174 -0
  257. package/dist/components/watermark/EpWatermark2.vue.js +4 -0
  258. package/dist/components/watermark/index.d.ts +13 -2
  259. package/dist/components/watermark/index.js +8 -4
  260. package/dist/components/watermark/instance.d.ts +2 -0
  261. package/dist/components/watermark/useClips.d.ts +6 -0
  262. package/dist/components/watermark/useClips.js +91 -0
  263. package/dist/components/watermark/utils.d.ts +8 -0
  264. package/dist/components/watermark/utils.js +21 -0
  265. package/dist/components/watermark/watermark.d.ts +71 -0
  266. package/dist/components/watermark/watermark.js +60 -0
  267. package/dist/constants/date.js +9 -0
  268. package/dist/directives/index.d.ts +11 -0
  269. package/dist/directives/index.js +25 -0
  270. package/dist/directives/trap-focus/index.js +40 -0
  271. package/dist/ep-craft.js +410 -373
  272. package/dist/hooks/index.d.ts +2 -0
  273. package/dist/hooks/use-draggable/index.d.ts +6 -0
  274. package/dist/hooks/use-draggable/index.js +51 -0
  275. package/dist/hooks/use-locale/index.js +12 -12
  276. package/dist/hooks/use-namespace/index.js +23 -23
  277. package/dist/hooks/use-same-target/index.d.ts +5 -0
  278. package/dist/hooks/use-same-target/index.js +20 -0
  279. package/dist/hooks/use-z-index/index.js +15 -15
  280. package/dist/index.d.ts +32 -2
  281. package/dist/utils/dom/aria.js +16 -12
  282. package/dist/utils/vue/icon.js +10 -6
  283. package/dist/utils/vue/install.js +23 -20
  284. package/dist/vendored-components.d.ts +1 -1
  285. package/dist/vendored-components.js +23 -3
  286. package/package.json +1 -1
@@ -0,0 +1,102 @@
1
+ import { isVNode as g, render as h, markRaw as b, createVNode as p } from "vue";
2
+ import { isElement as u, isUndefined as A } from "../../../utils/types.js";
3
+ import "lodash-unified";
4
+ import { isClient as M } from "@vueuse/core";
5
+ import { debugWarn as O } from "../../../utils/error.js";
6
+ import { isString as E, hasOwn as d, isObject as C, isFunction as f } from "@vue/shared";
7
+ import "@element-plus/icons-vue";
8
+ import T from "./index.vue.js";
9
+ const s = /* @__PURE__ */ new Map(), v = (e) => {
10
+ let t = document.body;
11
+ return e.appendTo && (E(e.appendTo) && (t = document.querySelector(e.appendTo)), u(e.appendTo) && (t = e.appendTo), u(t) || (O(
12
+ "ElMessageBox",
13
+ "the appendTo option is not an HTMLElement. Falling back to document.body."
14
+ ), t = document.body)), t;
15
+ }, i = (e, t) => {
16
+ var c;
17
+ const l = (c = e.component) == null ? void 0 : c.proxy;
18
+ return () => l.handleAction(t);
19
+ }, w = (e, t, l = null) => {
20
+ const c = p(
21
+ T,
22
+ e,
23
+ f(e.message) || g(e.message) ? {
24
+ default: f(e.message) ? () => e.message({
25
+ confirm: i(c, "confirm"),
26
+ cancel: i(c, "cancel"),
27
+ close: i(c, "close")
28
+ }) : () => e.message
29
+ } : null
30
+ );
31
+ return c.appContext = l, h(c, t), v(e).appendChild(t.firstElementChild), c.component;
32
+ }, x = () => document.createElement("div"), B = (e, t) => {
33
+ const l = x();
34
+ e.onVanish = () => {
35
+ h(null, l), s.delete(r);
36
+ }, e.onAction = (n) => {
37
+ const m = s.get(r);
38
+ let o;
39
+ e.showInput ? o = { value: r.inputValue, action: n } : o = n, e.callback ? e.callback(o, c.proxy) : n === "cancel" || n === "close" ? e.distinguishCancelAndClose && n !== "cancel" ? m.reject("close") : m.reject("cancel") : m.resolve(o);
40
+ };
41
+ const c = w(e, l, t), r = c.proxy;
42
+ for (const n in e)
43
+ d(e, n) && !d(r.$props, n) && (n === "closeIcon" && C(e[n]) ? r[n] = b(e[n]) : r[n] = e[n]);
44
+ return r.visible = !0, r;
45
+ };
46
+ function a(e, t = null) {
47
+ if (!M) return Promise.reject();
48
+ let l;
49
+ return E(e) || g(e) ? e = {
50
+ message: e
51
+ } : l = e.callback, new Promise((c, r) => {
52
+ const n = B(
53
+ e,
54
+ t ?? a._context
55
+ );
56
+ s.set(n, {
57
+ options: e,
58
+ callback: l,
59
+ resolve: c,
60
+ reject: r
61
+ });
62
+ });
63
+ }
64
+ const S = ["alert", "confirm", "prompt"], _ = {
65
+ alert: { closeOnPressEscape: !1, closeOnClickModal: !1 },
66
+ confirm: { showCancelButton: !0 },
67
+ prompt: { showCancelButton: !0, showInput: !0 }
68
+ };
69
+ S.forEach((e) => {
70
+ a[e] = k(
71
+ e
72
+ );
73
+ });
74
+ function k(e) {
75
+ return (t, l, c, r) => {
76
+ let n = "";
77
+ return C(l) ? (c = l, n = "") : A(l) ? n = "" : n = l, a(
78
+ Object.assign(
79
+ {
80
+ title: n,
81
+ message: t,
82
+ type: "",
83
+ ..._[e]
84
+ },
85
+ c,
86
+ {
87
+ boxType: e
88
+ }
89
+ ),
90
+ r
91
+ );
92
+ };
93
+ }
94
+ a.close = () => {
95
+ s.forEach((e, t) => {
96
+ t.doClose();
97
+ }), s.clear();
98
+ };
99
+ a._context = null;
100
+ export {
101
+ a as default
102
+ };
@@ -0,0 +1,3 @@
1
+ export declare const EpNotification: import("@element-plus/utils").SFCInstallWithContext<import(".").Notify>;
2
+ export default EpNotification;
3
+ export * from './src/notification';
@@ -0,0 +1,15 @@
1
+ import "@vue/shared";
2
+ import "lodash-unified";
3
+ import "@vueuse/core";
4
+ import "@element-plus/icons-vue";
5
+ import "vue";
6
+ import { withInstallFunction as o } from "../../utils/vue/install.js";
7
+ import i from "./src/notify.js";
8
+ import { notificationEmits as y, notificationProps as l, notificationTypes as x } from "./src/notification.js";
9
+ const a = o(i, "$notify");
10
+ export {
11
+ a as EpNotification,
12
+ y as notificationEmits,
13
+ l as notificationProps,
14
+ x as notificationTypes
15
+ };
@@ -0,0 +1,157 @@
1
+ import type { AppContext, ExtractPublicPropTypes, VNode } from 'vue';
2
+ import type { IconPropType } from '@element-plus/utils';
3
+ import type Notification from './notification.vue';
4
+ export declare const notificationTypes: readonly ["primary", "success", "info", "warning", "error"];
5
+ export type NotificationType = (typeof notificationTypes)[number] | '';
6
+ export type NotificationPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
7
+ export interface NotificationProps {
8
+ /**
9
+ * @description custom class name for Notification
10
+ */
11
+ customClass?: string;
12
+ /**
13
+ * @description whether `message` is treated as HTML string
14
+ */
15
+ dangerouslyUseHTMLString?: boolean;
16
+ /**
17
+ * @description duration before close. It will not automatically close if set 0
18
+ */
19
+ duration?: number;
20
+ /**
21
+ * @description custom icon component. It will be overridden by `type`
22
+ */
23
+ icon?: IconPropType;
24
+ /**
25
+ * @description notification dom id
26
+ */
27
+ id?: string;
28
+ /**
29
+ * @description description text
30
+ */
31
+ message?: string | VNode | (() => VNode);
32
+ /**
33
+ * @description offset from the top edge of the screen. Every Notification instance of the same moment should have the same offset
34
+ */
35
+ offset?: number;
36
+ /**
37
+ * @description callback function when notification clicked
38
+ */
39
+ onClick?: () => void;
40
+ /**
41
+ * @description callback function when closed
42
+ */
43
+ onClose: () => void;
44
+ /**
45
+ * @description custom position
46
+ */
47
+ position?: NotificationPosition;
48
+ /**
49
+ * @description whether to show a close button
50
+ */
51
+ showClose?: boolean;
52
+ /**
53
+ * @description title
54
+ */
55
+ title?: string;
56
+ /**
57
+ * @description notification type
58
+ */
59
+ type?: NotificationType;
60
+ /**
61
+ * @description initial zIndex
62
+ */
63
+ zIndex?: number;
64
+ /**
65
+ * @description custom close icon, default is Close
66
+ */
67
+ closeIcon?: IconPropType;
68
+ }
69
+ /**
70
+ * @deprecated Removed after 3.0.0, Use `NotificationProps` instead.
71
+ */
72
+ export declare const notificationProps: {
73
+ readonly customClass: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
74
+ readonly dangerouslyUseHTMLString: BooleanConstructor;
75
+ readonly duration: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 4500, boolean>;
76
+ readonly icon: {
77
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
78
+ readonly required: false;
79
+ readonly validator: ((val: unknown) => boolean) | undefined;
80
+ __epPropKey: true;
81
+ };
82
+ readonly id: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
83
+ readonly message: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | VNode<import("vue").RendererNode, import("vue").RendererElement, {
84
+ [key: string]: any;
85
+ }> | (() => VNode)) | (() => string | VNode<import("vue").RendererNode, import("vue").RendererElement, {
86
+ [key: string]: any;
87
+ }> | (() => VNode)) | (((new (...args: any[]) => string | VNode<import("vue").RendererNode, import("vue").RendererElement, {
88
+ [key: string]: any;
89
+ }> | (() => VNode)) | (() => string | VNode<import("vue").RendererNode, import("vue").RendererElement, {
90
+ [key: string]: any;
91
+ }> | (() => VNode))) | null)[], unknown, unknown, "", boolean>;
92
+ readonly offset: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
93
+ readonly onClick: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => () => void) | (() => () => void) | {
94
+ (): () => void;
95
+ new (): any;
96
+ readonly prototype: any;
97
+ } | (((new (...args: any[]) => () => void) | (() => () => void) | {
98
+ (): () => void;
99
+ new (): any;
100
+ readonly prototype: any;
101
+ }) | null)[], unknown, unknown, () => undefined, boolean>;
102
+ readonly onClose: {
103
+ readonly type: import("vue").PropType<() => void>;
104
+ readonly required: true;
105
+ readonly validator: ((val: unknown) => boolean) | undefined;
106
+ __epPropKey: true;
107
+ };
108
+ readonly position: import("@element-plus/utils").EpPropFinalized<StringConstructor, "top-left" | "top-right" | "bottom-left" | "bottom-right", unknown, "top-right", boolean>;
109
+ readonly showClose: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
110
+ readonly title: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
111
+ readonly type: import("@element-plus/utils").EpPropFinalized<StringConstructor, "" | "error" | "primary" | "success" | "warning" | "info", unknown, "", boolean>;
112
+ readonly zIndex: NumberConstructor;
113
+ readonly closeIcon: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
114
+ };
115
+ /**
116
+ * @deprecated Removed after 3.0.0, Use `NotificationProps` instead.
117
+ */
118
+ export type NotificationPropsPublic = ExtractPublicPropTypes<typeof notificationProps>;
119
+ export declare const notificationEmits: {
120
+ destroy: () => boolean;
121
+ };
122
+ export type NotificationEmits = typeof notificationEmits;
123
+ export type NotificationInstance = InstanceType<typeof Notification> & unknown;
124
+ export type NotificationOptions = Omit<NotificationProps, 'id' | 'onClose'> & {
125
+ /**
126
+ * @description set the root element for the notification, default to `document.body`
127
+ */
128
+ appendTo?: HTMLElement | string;
129
+ /**
130
+ * @description callback function when closed
131
+ */
132
+ onClose?(vm: VNode): void;
133
+ };
134
+ export type NotificationOptionsTyped = Omit<NotificationOptions, 'type'>;
135
+ export interface NotificationHandle {
136
+ close: () => void;
137
+ }
138
+ export type NotificationParams = Partial<NotificationOptions> | string | VNode;
139
+ export type NotificationParamsTyped = Partial<NotificationOptionsTyped> | string | VNode;
140
+ export interface NotifyFn {
141
+ (options?: NotificationParams, appContext?: null | AppContext): NotificationHandle;
142
+ closeAll(): void;
143
+ updateOffsets(position?: NotificationOptions['position']): void;
144
+ _context: AppContext | null;
145
+ }
146
+ export type NotifyTypedFn = (options?: NotificationParamsTyped, appContext?: null | AppContext) => NotificationHandle;
147
+ export interface Notify extends NotifyFn {
148
+ primary: NotifyTypedFn;
149
+ success: NotifyTypedFn;
150
+ warning: NotifyTypedFn;
151
+ error: NotifyTypedFn;
152
+ info: NotifyTypedFn;
153
+ }
154
+ export interface NotificationQueueItem {
155
+ vm: VNode;
156
+ }
157
+ export type NotificationQueue = NotificationQueueItem[];
@@ -0,0 +1,127 @@
1
+ import { Close as o } from "@element-plus/icons-vue";
2
+ import "@vue/shared";
3
+ import "lodash-unified";
4
+ import "@vueuse/core";
5
+ import { iconPropType as e } from "../../../utils/vue/icon.js";
6
+ import "vue";
7
+ import { buildProps as i, definePropType as t } from "../../../utils/vue/props/runtime.js";
8
+ const r = [
9
+ "primary",
10
+ "success",
11
+ "info",
12
+ "warning",
13
+ "error"
14
+ ], d = i({
15
+ /**
16
+ * @description custom class name for Notification
17
+ */
18
+ customClass: {
19
+ type: String,
20
+ default: ""
21
+ },
22
+ /**
23
+ * @description whether `message` is treated as HTML string
24
+ */
25
+ dangerouslyUseHTMLString: Boolean,
26
+ /**
27
+ * @description duration before close. It will not automatically close if set 0
28
+ */
29
+ duration: {
30
+ type: Number,
31
+ default: 4500
32
+ },
33
+ /**
34
+ * @description custom icon component. It will be overridden by `type`
35
+ */
36
+ icon: {
37
+ type: e
38
+ },
39
+ /**
40
+ * @description notification dom id
41
+ */
42
+ id: {
43
+ type: String,
44
+ default: ""
45
+ },
46
+ /**
47
+ * @description description text
48
+ */
49
+ message: {
50
+ type: t([
51
+ String,
52
+ Object,
53
+ Function
54
+ ]),
55
+ default: ""
56
+ },
57
+ /**
58
+ * @description offset from the top edge of the screen. Every Notification instance of the same moment should have the same offset
59
+ */
60
+ offset: {
61
+ type: Number,
62
+ default: 0
63
+ },
64
+ /**
65
+ * @description callback function when notification clicked
66
+ */
67
+ onClick: {
68
+ type: t(Function),
69
+ default: () => {
70
+ }
71
+ },
72
+ /**
73
+ * @description callback function when closed
74
+ */
75
+ onClose: {
76
+ type: t(Function),
77
+ required: !0
78
+ },
79
+ /**
80
+ * @description custom position
81
+ */
82
+ position: {
83
+ type: String,
84
+ values: ["top-right", "top-left", "bottom-right", "bottom-left"],
85
+ default: "top-right"
86
+ },
87
+ /**
88
+ * @description whether to show a close button
89
+ */
90
+ showClose: {
91
+ type: Boolean,
92
+ default: !0
93
+ },
94
+ /**
95
+ * @description title
96
+ */
97
+ title: {
98
+ type: String,
99
+ default: ""
100
+ },
101
+ /**
102
+ * @description notification type
103
+ */
104
+ type: {
105
+ type: String,
106
+ values: [...r, ""],
107
+ default: ""
108
+ },
109
+ /**
110
+ * @description initial zIndex
111
+ */
112
+ zIndex: Number,
113
+ /**
114
+ * @description custom close icon, default is Close
115
+ */
116
+ closeIcon: {
117
+ type: e,
118
+ default: o
119
+ }
120
+ }), y = {
121
+ destroy: () => !0
122
+ };
123
+ export {
124
+ y as notificationEmits,
125
+ d as notificationProps,
126
+ r as notificationTypes
127
+ };
@@ -0,0 +1,34 @@
1
+ import type { NotificationProps } from './notification';
2
+ declare function close(): void;
3
+ declare var __VLS_18: {};
4
+ type __VLS_Slots = {} & {
5
+ default?: (props: typeof __VLS_18) => any;
6
+ };
7
+ declare const __VLS_component: import("vue").DefineComponent<NotificationProps, {
8
+ visible: import("vue").Ref<boolean, boolean>;
9
+ /** @description close notification */
10
+ close: typeof close;
11
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
+ destroy: () => void;
13
+ }, string, import("vue").PublicProps, Readonly<NotificationProps> & Readonly<{
14
+ onDestroy?: (() => any) | undefined;
15
+ }>, {
16
+ position: import("./notification").NotificationPosition;
17
+ offset: number;
18
+ title: string;
19
+ id: string;
20
+ type: import("./notification").NotificationType;
21
+ onClick: () => void;
22
+ message: string | import("vue").VNode | (() => import("vue").VNode);
23
+ duration: number;
24
+ customClass: string;
25
+ showClose: boolean;
26
+ closeIcon: import("@element-plus/utils").IconPropType;
27
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
29
+ export default _default;
30
+ type __VLS_WithSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -0,0 +1,146 @@
1
+ import { defineComponent as O, ref as U, computed as c, onMounted as W, openBlock as s, createBlock as u, Transition as Z, unref as o, withCtx as p, withDirectives as h, createElementVNode as f, normalizeStyle as x, normalizeClass as a, resolveDynamicComponent as b, createCommentVNode as w, toDisplayString as E, renderSlot as j, createElementBlock as T, vShow as I, withModifiers as A, markRaw as G } from "vue";
2
+ import { useEventListener as K, useTimeoutFn as P } from "@vueuse/core";
3
+ import "@vue/shared";
4
+ import "lodash-unified";
5
+ import { getEventCode as R } from "../../../utils/dom/event.js";
6
+ import { TypeComponentsMap as M } from "../../../utils/vue/icon.js";
7
+ import { EVENT_CODE as y } from "../../../constants/aria.js";
8
+ import { ElIcon as S } from "../../icon/index.js";
9
+ import "../../config-provider/index.js";
10
+ import { notificationEmits as q } from "./notification.js";
11
+ import { Close as J } from "@element-plus/icons-vue";
12
+ import { useGlobalComponentSettings as Q } from "../../config-provider/src/hooks/use-global-config.js";
13
+ const X = ["id"], Y = ["textContent"], _ = { key: 0 }, ee = ["innerHTML"], fe = /* @__PURE__ */ O({
14
+ name: "ElNotification",
15
+ __name: "notification",
16
+ props: {
17
+ customClass: { default: "" },
18
+ dangerouslyUseHTMLString: { type: Boolean },
19
+ duration: { default: 4500 },
20
+ icon: {},
21
+ id: { default: "" },
22
+ message: { type: [String, Object, Function], default: "" },
23
+ offset: { default: 0 },
24
+ onClick: { type: Function, default: () => {
25
+ } },
26
+ onClose: {},
27
+ position: { default: "top-right" },
28
+ showClose: { type: Boolean, default: !0 },
29
+ title: { default: "" },
30
+ type: { default: "" },
31
+ zIndex: {},
32
+ closeIcon: { default: G(J) }
33
+ },
34
+ emits: q,
35
+ setup(e, { expose: B }) {
36
+ const t = e, { ns: n, zIndex: L } = Q("notification"), { nextZIndex: z, currentZIndex: D } = L, l = U(!1);
37
+ let d;
38
+ const H = c(() => {
39
+ const i = t.type;
40
+ return i && M[t.type] ? n.m(i) : "";
41
+ }), C = c(() => t.type && M[t.type] || t.icon), N = c(
42
+ () => t.position.endsWith("right") ? "right" : "left"
43
+ ), $ = c(
44
+ () => t.position.startsWith("top") ? "top" : "bottom"
45
+ ), F = c(() => ({
46
+ [$.value]: `${t.offset}px`,
47
+ zIndex: t.zIndex ?? D.value
48
+ }));
49
+ function v() {
50
+ t.duration > 0 && ({ stop: d } = P(() => {
51
+ l.value && m();
52
+ }, t.duration));
53
+ }
54
+ function k() {
55
+ d == null || d();
56
+ }
57
+ function m() {
58
+ l.value = !1;
59
+ }
60
+ function V(i) {
61
+ switch (R(i)) {
62
+ case y.delete:
63
+ case y.backspace:
64
+ k();
65
+ break;
66
+ case y.esc:
67
+ l.value && m();
68
+ break;
69
+ default:
70
+ v();
71
+ break;
72
+ }
73
+ }
74
+ return W(() => {
75
+ v(), z(), l.value = !0;
76
+ }), K(document, "keydown", V), B({
77
+ visible: l,
78
+ /** @description close notification */
79
+ close: m
80
+ }), (i, r) => (s(), u(Z, {
81
+ name: o(n).b("fade"),
82
+ onBeforeLeave: e.onClose,
83
+ onAfterLeave: r[1] || (r[1] = (g) => i.$emit("destroy"))
84
+ }, {
85
+ default: p(() => [
86
+ h(f("div", {
87
+ id: e.id,
88
+ class: a([o(n).b(), e.customClass, N.value]),
89
+ style: x(F.value),
90
+ role: "alert",
91
+ onMouseenter: k,
92
+ onMouseleave: v,
93
+ onClick: r[0] || (r[0] = //@ts-ignore
94
+ (...g) => e.onClick && e.onClick(...g))
95
+ }, [
96
+ C.value ? (s(), u(o(S), {
97
+ key: 0,
98
+ class: a([o(n).e("icon"), H.value])
99
+ }, {
100
+ default: p(() => [
101
+ (s(), u(b(C.value)))
102
+ ]),
103
+ _: 1
104
+ }, 8, ["class"])) : w("", !0),
105
+ f("div", {
106
+ class: a(o(n).e("group"))
107
+ }, [
108
+ f("h2", {
109
+ class: a(o(n).e("title")),
110
+ textContent: E(e.title)
111
+ }, null, 10, Y),
112
+ h(f("div", {
113
+ class: a(o(n).e("content")),
114
+ style: x(e.title ? void 0 : { margin: 0 })
115
+ }, [
116
+ j(i.$slots, "default", {}, () => [
117
+ e.dangerouslyUseHTMLString ? (s(), T("p", {
118
+ key: 1,
119
+ innerHTML: e.message
120
+ }, null, 8, ee)) : (s(), T("p", _, E(e.message), 1))
121
+ ])
122
+ ], 6), [
123
+ [I, e.message]
124
+ ]),
125
+ e.showClose ? (s(), u(o(S), {
126
+ key: 0,
127
+ class: a(o(n).e("closeBtn")),
128
+ onClick: A(m, ["stop"])
129
+ }, {
130
+ default: p(() => [
131
+ (s(), u(b(e.closeIcon)))
132
+ ]),
133
+ _: 1
134
+ }, 8, ["class"])) : w("", !0)
135
+ ], 2)
136
+ ], 46, X), [
137
+ [I, l.value]
138
+ ])
139
+ ]),
140
+ _: 3
141
+ }, 8, ["name", "onBeforeLeave"]));
142
+ }
143
+ });
144
+ export {
145
+ fe as default
146
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./notification.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,15 @@
1
+ import type { VNode } from 'vue';
2
+ import type { NotificationPosition, Notify } from './notification';
3
+ /**
4
+ * This function gets called when user click `x` button or press `esc` or the time reached its limitation.
5
+ * Emitted by transition@before-leave event so that we can fetch the current notification.offsetHeight, if this was called
6
+ * by @after-leave the DOM element will be removed from the page thus we can no longer fetch the offsetHeight.
7
+ * @param {String} id notification id to be closed
8
+ * @param {Position} position the positioning strategy
9
+ * @param {Function} userOnClose the callback called when close passed by user
10
+ */
11
+ export declare function close(id: string, position: NotificationPosition, userOnClose?: (vm: VNode) => void): void;
12
+ export declare function closeAll(): void;
13
+ export declare function updateOffsets(position?: NotificationPosition): void;
14
+ declare const _default: Notify;
15
+ export default _default;