ep-craft 0.1.32 → 0.1.34

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 (205) hide show
  1. package/dist/components/button/index.d.ts +12 -0
  2. package/dist/components/button-group/index.d.ts +3 -2
  3. package/dist/components/button-group/index.js +7 -3
  4. package/dist/components/button-group/src/button-group.d.ts +48 -0
  5. package/dist/components/button-group/src/button-group.js +7 -0
  6. package/dist/components/button-group/src/button-group.vue.d.ts +16 -0
  7. package/dist/components/button-group/src/button-group.vue.js +42 -0
  8. package/dist/components/button-group/src/button-group2.vue.js +4 -0
  9. package/dist/components/checkbox/index.js +6 -5
  10. package/dist/components/collection/index.d.ts +8 -0
  11. package/dist/components/collection/src/collection-item.vue.d.ts +2 -0
  12. package/dist/components/collection/src/collection-item.vue.js +10 -0
  13. package/dist/components/collection/src/collection-item2.vue.js +8 -0
  14. package/dist/components/collection/src/collection.d.ts +39 -0
  15. package/dist/components/collection/src/collection.js +52 -0
  16. package/dist/components/collection/src/collection.vue.d.ts +2 -0
  17. package/dist/components/collection/src/collection.vue.js +10 -0
  18. package/dist/components/collection/src/collection2.vue.js +7 -0
  19. package/dist/components/collection/src/tokens.d.ts +18 -0
  20. package/dist/components/divider/index.d.ts +24 -2
  21. package/dist/components/divider/index.js +8 -3
  22. package/dist/components/divider/src/divider.d.ts +30 -0
  23. package/dist/components/divider/src/divider.js +34 -0
  24. package/dist/components/divider/src/divider.vue.d.ts +24 -0
  25. package/dist/components/divider/src/divider.vue.js +39 -0
  26. package/dist/components/divider/src/divider2.vue.js +4 -0
  27. package/dist/components/dropdown/index.d.ts +3017 -3
  28. package/dist/components/dropdown/index.js +23 -3
  29. package/dist/components/dropdown/src/dropdown-item-impl.vue.d.ts +79 -0
  30. package/dist/components/dropdown/src/dropdown-item-impl.vue.js +40 -0
  31. package/dist/components/dropdown/src/dropdown-item-impl2.vue.js +68 -0
  32. package/dist/components/dropdown/src/dropdown-item.vue.d.ts +169 -0
  33. package/dist/components/dropdown/src/dropdown-item.vue.js +35 -0
  34. package/dist/components/dropdown/src/dropdown-item2.vue.js +63 -0
  35. package/dist/components/dropdown/src/dropdown-menu.vue.d.ts +27 -0
  36. package/dist/components/dropdown/src/dropdown-menu.vue.js +24 -0
  37. package/dist/components/dropdown/src/dropdown-menu2.vue.js +75 -0
  38. package/dist/components/dropdown/src/dropdown.d.ts +200 -0
  39. package/dist/components/dropdown/src/dropdown.js +201 -0
  40. package/dist/components/dropdown/src/dropdown.vue.d.ts +1126 -0
  41. package/dist/components/dropdown/src/dropdown.vue.js +127 -0
  42. package/dist/components/dropdown/src/dropdown2.vue.js +127 -0
  43. package/dist/components/dropdown/src/instance.d.ts +2 -0
  44. package/dist/components/dropdown/src/tokens.d.ts +13 -0
  45. package/dist/components/dropdown/src/tokens.js +5 -0
  46. package/dist/components/dropdown/src/useDropdown.d.ts +5 -0
  47. package/dist/components/dropdown/src/useDropdown.js +15 -0
  48. package/dist/components/dropdown-item/index.d.ts +1 -4
  49. package/dist/components/dropdown-menu/index.d.ts +1 -4
  50. package/dist/components/index.js +129 -131
  51. package/dist/components/popover/index.d.ts +121 -3
  52. package/dist/components/popover/index.js +19 -4
  53. package/dist/components/popover/src/directive.d.ts +4 -0
  54. package/dist/components/popover/src/directive.js +15 -0
  55. package/dist/components/popover/src/popover.d.ts +291 -0
  56. package/dist/components/popover/src/popover.js +168 -0
  57. package/dist/components/popover/src/popover.vue.d.ts +53 -0
  58. package/dist/components/popover/src/popover.vue.js +125 -0
  59. package/dist/components/popover/src/popover2.vue.js +4 -0
  60. package/dist/components/progress/index.d.ts +35 -2
  61. package/dist/components/progress/index.js +10 -4
  62. package/dist/components/progress/src/progress.d.ts +97 -0
  63. package/dist/components/progress/src/progress.js +104 -0
  64. package/dist/components/progress/src/progress.vue.d.ts +30 -0
  65. package/dist/components/progress/src/progress.vue.js +179 -0
  66. package/dist/components/progress/src/progress2.vue.js +4 -0
  67. package/dist/components/roving-focus-group/index.d.ts +14 -0
  68. package/dist/components/roving-focus-group/index.js +15 -0
  69. package/dist/components/roving-focus-group/src/roving-focus-group-impl.vue.d.ts +50 -0
  70. package/dist/components/roving-focus-group/src/roving-focus-group-impl.vue.js +10 -0
  71. package/dist/components/roving-focus-group/src/roving-focus-group-impl2.vue.js +115 -0
  72. package/dist/components/roving-focus-group/src/roving-focus-group.d.ts +56 -0
  73. package/dist/components/roving-focus-group/src/roving-focus-group.js +43 -0
  74. package/dist/components/roving-focus-group/src/roving-focus-group.vue.d.ts +67 -0
  75. package/dist/components/roving-focus-group/src/roving-focus-group.vue.js +13 -0
  76. package/dist/components/roving-focus-group/src/roving-focus-group2.vue.js +21 -0
  77. package/dist/components/roving-focus-group/src/roving-focus-item.vue.d.ts +43 -0
  78. package/dist/components/roving-focus-group/src/roving-focus-item.vue.js +20 -0
  79. package/dist/components/roving-focus-group/src/roving-focus-item2.vue.js +78 -0
  80. package/dist/components/roving-focus-group/src/tokens.d.ts +28 -0
  81. package/dist/components/roving-focus-group/src/tokens.js +5 -0
  82. package/dist/components/roving-focus-group/src/utils.d.ts +8 -0
  83. package/dist/components/roving-focus-group/src/utils.js +28 -0
  84. package/dist/components/table/index.d.ts +56 -3
  85. package/dist/components/table/index.js +20 -4
  86. package/dist/components/table/src/composables/use-scrollbar.d.ts +6 -0
  87. package/dist/components/table/src/composables/use-scrollbar.js +24 -0
  88. package/dist/components/table/src/config.d.ts +87 -0
  89. package/dist/components/table/src/config.js +210 -0
  90. package/dist/components/table/src/filter-panel.vue.d.ts +837 -0
  91. package/dist/components/table/src/filter-panel.vue.js +130 -0
  92. package/dist/components/table/src/filter-panel2.vue.js +155 -0
  93. package/dist/components/table/src/h-helper.d.ts +13 -0
  94. package/dist/components/table/src/h-helper.js +30 -0
  95. package/dist/components/table/src/layout-observer.d.ts +8 -0
  96. package/dist/components/table/src/layout-observer.js +49 -0
  97. package/dist/components/table/src/store/current.d.ts +15 -0
  98. package/dist/components/table/src/store/current.js +45 -0
  99. package/dist/components/table/src/store/expand.d.ts +14 -0
  100. package/dist/components/table/src/store/expand.js +55 -0
  101. package/dist/components/table/src/store/helper.d.ts +548 -0
  102. package/dist/components/table/src/store/helper.js +61 -0
  103. package/dist/components/table/src/store/index.d.ts +1107 -0
  104. package/dist/components/table/src/store/index.js +123 -0
  105. package/dist/components/table/src/store/tree.d.ts +27 -0
  106. package/dist/components/table/src/store/tree.js +153 -0
  107. package/dist/components/table/src/store/watcher.d.ts +88 -0
  108. package/dist/components/table/src/store/watcher.js +483 -0
  109. package/dist/components/table/src/table/defaults.d.ts +560 -0
  110. package/dist/components/table/src/table/defaults.js +236 -0
  111. package/dist/components/table/src/table/key-render-helper.d.ts +2 -0
  112. package/dist/components/table/src/table/key-render-helper.js +18 -0
  113. package/dist/components/table/src/table/style-helper.d.ts +51 -0
  114. package/dist/components/table/src/table/style-helper.js +169 -0
  115. package/dist/components/table/src/table/utils-helper.d.ts +16 -0
  116. package/dist/components/table/src/table/utils-helper.js +36 -0
  117. package/dist/components/table/src/table-body/defaults.d.ts +39 -0
  118. package/dist/components/table/src/table-body/defaults.js +25 -0
  119. package/dist/components/table/src/table-body/events-helper.d.ts +19 -0
  120. package/dist/components/table/src/table-body/events-helper.js +126 -0
  121. package/dist/components/table/src/table-body/index.d.ts +84 -0
  122. package/dist/components/table/src/table-body/index.js +77 -0
  123. package/dist/components/table/src/table-body/render-helper.d.ts +18 -0
  124. package/dist/components/table/src/table-body/render-helper.js +188 -0
  125. package/dist/components/table/src/table-body/styles-helper.d.ts +15 -0
  126. package/dist/components/table/src/table-body/styles-helper.js +98 -0
  127. package/dist/components/table/src/table-body/td-wrapper.vue.d.ts +33 -0
  128. package/dist/components/table/src/table-body/td-wrapper.vue.js +26 -0
  129. package/dist/components/table/src/table-body/td-wrapper2.vue.js +4 -0
  130. package/dist/components/table/src/table-column/defaults.d.ts +348 -0
  131. package/dist/components/table/src/table-column/defaults.js +152 -0
  132. package/dist/components/table/src/table-column/index.d.ts +2 -0
  133. package/dist/components/table/src/table-column/index.vue.d.ts +32 -0
  134. package/dist/components/table/src/table-column/index.vue.js +161 -0
  135. package/dist/components/table/src/table-column/index2.vue.js +4 -0
  136. package/dist/components/table/src/table-column/render-helper.d.ts +17 -0
  137. package/dist/components/table/src/table-column/render-helper.js +116 -0
  138. package/dist/components/table/src/table-column/watcher-helper.d.ts +8 -0
  139. package/dist/components/table/src/table-column/watcher-helper.js +85 -0
  140. package/dist/components/table/src/table-footer/index.d.ts +79 -0
  141. package/dist/components/table/src/table-footer/index.js +110 -0
  142. package/dist/components/table/src/table-footer/mapState-helper.d.ts +9 -0
  143. package/dist/components/table/src/table-footer/mapState-helper.js +16 -0
  144. package/dist/components/table/src/table-footer/style-helper.d.ts +9 -0
  145. package/dist/components/table/src/table-footer/style-helper.js +42 -0
  146. package/dist/components/table/src/table-header/event-helper.d.ts +14 -0
  147. package/dist/components/table/src/table-header/event-helper.js +113 -0
  148. package/dist/components/table/src/table-header/index.d.ts +361 -0
  149. package/dist/components/table/src/table-header/index.js +255 -0
  150. package/dist/components/table/src/table-header/style.helper.d.ts +10 -0
  151. package/dist/components/table/src/table-header/style.helper.js +73 -0
  152. package/dist/components/table/src/table-header/utils-helper.d.ts +10 -0
  153. package/dist/components/table/src/table-header/utils-helper.js +45 -0
  154. package/dist/components/table/src/table-layout.d.ts +37 -0
  155. package/dist/components/table/src/table-layout.js +144 -0
  156. package/dist/components/table/src/table.vue.d.ts +734 -0
  157. package/dist/components/table/src/table.vue.js +443 -0
  158. package/dist/components/table/src/table2.vue.js +4 -0
  159. package/dist/components/table/src/tableColumn.d.ts +2 -0
  160. package/dist/components/table/src/tokens.d.ts +3 -0
  161. package/dist/components/table/src/tokens.js +4 -0
  162. package/dist/components/table/src/util.d.ts +55 -0
  163. package/dist/components/table/src/util.js +310 -0
  164. package/dist/components/table-column/index.d.ts +40 -3
  165. package/dist/components/table-column/index.js +6 -3
  166. package/dist/components/upload/index.d.ts +45 -2
  167. package/dist/components/upload/index.js +23 -4
  168. package/dist/components/upload/src/ajax.d.ts +9 -0
  169. package/dist/components/upload/src/ajax.js +58 -0
  170. package/dist/components/upload/src/constants.d.ts +5 -0
  171. package/dist/components/upload/src/constants.js +4 -0
  172. package/dist/components/upload/src/upload-content.d.ts +136 -0
  173. package/dist/components/upload/src/upload-content.js +53 -0
  174. package/dist/components/upload/src/upload-content.vue.d.ts +38 -0
  175. package/dist/components/upload/src/upload-content.vue.js +186 -0
  176. package/dist/components/upload/src/upload-content2.vue.js +4 -0
  177. package/dist/components/upload/src/upload-dragger.d.ts +22 -0
  178. package/dist/components/upload/src/upload-dragger.js +19 -0
  179. package/dist/components/upload/src/upload-dragger.vue.d.ts +19 -0
  180. package/dist/components/upload/src/upload-dragger.vue.js +91 -0
  181. package/dist/components/upload/src/upload-dragger2.vue.js +4 -0
  182. package/dist/components/upload/src/upload-list.d.ts +45 -0
  183. package/dist/components/upload/src/upload-list.js +39 -0
  184. package/dist/components/upload/src/upload-list.vue.d.ts +28 -0
  185. package/dist/components/upload/src/upload-list.vue.js +182 -0
  186. package/dist/components/upload/src/upload-list2.vue.js +4 -0
  187. package/dist/components/upload/src/upload.d.ts +361 -0
  188. package/dist/components/upload/src/upload.js +216 -0
  189. package/dist/components/upload/src/upload.vue.d.ts +64 -0
  190. package/dist/components/upload/src/upload.vue.js +150 -0
  191. package/dist/components/upload/src/upload2.vue.js +4 -0
  192. package/dist/components/upload/src/use-handlers.d.ts +60 -0
  193. package/dist/components/upload/src/use-handlers.js +111 -0
  194. package/dist/directives/mousewheel/index.js +28 -0
  195. package/dist/ep-craft.js +277 -236
  196. package/dist/index.d.ts +67 -0
  197. package/dist/utils/dom/event.js +12 -11
  198. package/dist/utils/objects.js +10 -9
  199. package/dist/utils/vue/install.js +21 -18
  200. package/dist/utils/vue/refs.js +8 -0
  201. package/dist/vendored-components.d.ts +1 -1
  202. package/dist/vendored-components.js +44 -4
  203. package/package.json +1 -1
  204. package/dist/components/dropdown-item/index.js +0 -6
  205. package/dist/components/dropdown-menu/index.js +0 -6
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,17 @@
1
+ import type { ComputedRef, RendererNode, Slots } from 'vue';
2
+ import type { TableColumn, TableColumnCtx } from './defaults';
3
+ import type { DefaultRow, Table } from '../table/defaults';
4
+ declare function useRender<T extends DefaultRow>(props: TableColumnCtx<T>, slots: Slots, owner: ComputedRef<Table<T>>): {
5
+ columnId: import("vue").Ref<string, string>;
6
+ realAlign: import("vue").Ref<string | null | undefined, string | null | undefined>;
7
+ isSubColumn: import("vue").Ref<boolean, boolean>;
8
+ realHeaderAlign: import("vue").Ref<string | null | undefined, string | null | undefined>;
9
+ columnOrTableParent: ComputedRef<Table<T> | TableColumn<T>>;
10
+ setColumnWidth: (column: TableColumnCtx<T>) => TableColumnCtx<T>;
11
+ setColumnForcedProps: (column: TableColumnCtx<T>) => TableColumnCtx<T>;
12
+ setColumnRenders: (column: TableColumnCtx<T>) => TableColumnCtx<T>;
13
+ getPropsData: (...propsKey: string[][]) => Record<string, any>;
14
+ getColumnElIndex: (children: T[], child: RendererNode | null) => number;
15
+ updateColumnOrder: () => void;
16
+ };
17
+ export default useRender;
@@ -0,0 +1,116 @@
1
+ import { getCurrentInstance as V, ref as o, watchEffect as x, computed as b, h as v, Fragment as k, createTextVNode as H, renderSlot as W, Comment as S, unref as y } from "vue";
2
+ import { isUndefined as N } from "../../../../utils/types.js";
3
+ import "lodash-unified";
4
+ import "@vueuse/core";
5
+ import { debugWarn as j } from "../../../../utils/error.js";
6
+ import { isArray as E } from "@vue/shared";
7
+ import "@element-plus/icons-vue";
8
+ import { useNamespace as M } from "../../../../hooks/use-namespace/index.js";
9
+ import "../../../../hooks/use-size/index.js";
10
+ import "@popperjs/core";
11
+ import "../../../../hooks/use-z-index/index.js";
12
+ import "../../../../hooks/use-delayed-toggle/index.js";
13
+ import "../../../../hooks/use-aria/index.js";
14
+ import "../../../../hooks/use-model-toggle/index.js";
15
+ import "../../../../hooks/use-empty-values/index.js";
16
+ import { defaultRenderCell as U, treeCellPrefix as q, cellForced as z, getDefaultClassName as B } from "../config.js";
17
+ import { parseWidth as G, parseMinWidth as J, ensureValidVNode as K } from "../util.js";
18
+ function he(i, a, m) {
19
+ const s = V(), I = o(""), w = o(!1), d = o(), p = o(), g = M("table");
20
+ x(() => {
21
+ d.value = i.align ? `is-${i.align}` : null, d.value;
22
+ }), x(() => {
23
+ p.value = i.headerAlign ? `is-${i.headerAlign}` : d.value, p.value;
24
+ });
25
+ const P = b(() => {
26
+ let e = s.vnode.vParent || s.parent;
27
+ for (; e && !e.tableId && !e.columnId; )
28
+ e = e.vnode.vParent || e.parent;
29
+ return e;
30
+ }), $ = b(() => {
31
+ const { store: e } = s.parent;
32
+ if (!e) return !1;
33
+ const { treeData: r } = e.states, t = r.value;
34
+ return t && Object.keys(t).length > 0;
35
+ }), h = o(G(i.width)), C = o(J(i.minWidth)), O = (e) => (h.value && (e.width = h.value), C.value && (e.minWidth = C.value), !h.value && C.value && (e.width = void 0), e.minWidth || (e.minWidth = 80), e.realWidth = Number(
36
+ N(e.width) ? e.minWidth : e.width
37
+ ), e), T = (e) => {
38
+ const r = e.type, t = z[r] || {};
39
+ Object.keys(t).forEach((l) => {
40
+ const u = t[l];
41
+ l !== "className" && !N(u) && (e[l] = u);
42
+ });
43
+ const n = B(r);
44
+ if (n) {
45
+ const l = `${y(g.namespace)}-${n}`;
46
+ e.className = e.className ? `${e.className} ${l}` : l;
47
+ }
48
+ return e;
49
+ }, A = (e) => {
50
+ E(e) ? e.forEach((t) => r(t)) : r(e);
51
+ function r(t) {
52
+ var l;
53
+ const n = (l = t == null ? void 0 : t.type) == null ? void 0 : l.name;
54
+ (n === "EpTableColumn" || n === "ElTableColumn") && (t.vParent = s);
55
+ }
56
+ };
57
+ return {
58
+ columnId: I,
59
+ realAlign: d,
60
+ isSubColumn: w,
61
+ realHeaderAlign: p,
62
+ columnOrTableParent: P,
63
+ setColumnWidth: O,
64
+ setColumnForcedProps: T,
65
+ setColumnRenders: (e) => {
66
+ i.renderHeader ? j(
67
+ "TableColumn",
68
+ "Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header."
69
+ ) : e.type !== "selection" && (e.renderHeader = (t) => {
70
+ if (s.columnConfig.value.label, a.header) {
71
+ const n = a.header(t);
72
+ if (K(n))
73
+ return v(k, n);
74
+ }
75
+ return H(e.label);
76
+ }), a["filter-icon"] && (e.renderFilterIcon = (t) => W(a, "filter-icon", t)), a.expand && (e.renderExpand = (t) => W(a, "expand", t));
77
+ let r = e.renderCell;
78
+ return e.type === "expand" ? (e.renderCell = (t) => v(
79
+ "div",
80
+ {
81
+ class: "cell"
82
+ },
83
+ [r(t)]
84
+ ), m.value.renderExpanded = (t) => a.default ? a.default(t) : a.default) : (r = r || U, e.renderCell = (t) => {
85
+ let n = null;
86
+ if (a.default) {
87
+ const f = a.default(t);
88
+ n = f.some((F) => F.type !== S) ? f : r(t);
89
+ } else
90
+ n = r(t);
91
+ const { columns: l } = m.value.store.states, u = l.value.findIndex(
92
+ (f) => f.type === "default"
93
+ ), R = $.value && t.cellIndex === u, D = q(t, R), c = {
94
+ class: "cell",
95
+ style: {}
96
+ };
97
+ return e.showOverflowTooltip && (c.class = `${c.class} ${y(g.namespace)}-tooltip`, c.style = {
98
+ width: `${(t.column.realWidth || Number(t.column.width)) - 1}px`
99
+ }), A(n), v("div", c, [D, n]);
100
+ }), e;
101
+ },
102
+ getPropsData: (...e) => e.reduce(
103
+ (r, t) => (E(t) && t.forEach((n) => {
104
+ r[n] = i[n];
105
+ }), r),
106
+ {}
107
+ ),
108
+ getColumnElIndex: (e, r) => Array.prototype.indexOf.call(e, r),
109
+ updateColumnOrder: () => {
110
+ m.value.store.commit("updateColumnOrder", s.columnConfig.value);
111
+ }
112
+ };
113
+ }
114
+ export {
115
+ he as default
116
+ };
@@ -0,0 +1,8 @@
1
+ import type { ComputedRef } from 'vue';
2
+ import type { DefaultRow } from '../table/defaults';
3
+ import type { TableColumnCtx } from './defaults';
4
+ declare function useWatcher<T extends DefaultRow>(owner: ComputedRef<any>, props_: Partial<TableColumnCtx<T>>): {
5
+ registerComplexWatchers: () => void;
6
+ registerNormalWatchers: () => void;
7
+ };
8
+ export default useWatcher;
@@ -0,0 +1,85 @@
1
+ import { getCurrentInstance as v, watch as f } from "vue";
2
+ import { isUndefined as p } from "../../../../utils/types.js";
3
+ import "lodash-unified";
4
+ import "@vueuse/core";
5
+ import { hasOwn as u } from "@vue/shared";
6
+ import "@element-plus/icons-vue";
7
+ import { parseWidth as g, parseMinWidth as C } from "../util.js";
8
+ import "../../../config-provider/index.js";
9
+ import { useGlobalConfig as w } from "../../../config-provider/src/hooks/use-global-config.js";
10
+ function d(r, i) {
11
+ return r.reduce((o, c) => (o[c] = c, o), i);
12
+ }
13
+ function K(r, i) {
14
+ const o = v();
15
+ return {
16
+ registerComplexWatchers: () => {
17
+ const m = ["fixed"], s = {
18
+ realWidth: "width",
19
+ realMinWidth: "minWidth"
20
+ }, n = d(m, s);
21
+ Object.keys(n).forEach((a) => {
22
+ const l = s[a];
23
+ u(i, l) && f(
24
+ () => i[l],
25
+ (e) => {
26
+ let t = e;
27
+ l === "width" && a === "realWidth" && (t = g(e)), l === "minWidth" && a === "realMinWidth" && (t = C(e)), o.columnConfig.value[l] = t, o.columnConfig.value[a] = t;
28
+ const h = l === "fixed";
29
+ r.value.store.scheduleLayout(h);
30
+ }
31
+ );
32
+ });
33
+ },
34
+ registerNormalWatchers: () => {
35
+ const m = [
36
+ "label",
37
+ "filters",
38
+ "filterMultiple",
39
+ "filteredValue",
40
+ "sortable",
41
+ "index",
42
+ "formatter",
43
+ "className",
44
+ "labelClassName",
45
+ "filterClassName",
46
+ "showOverflowTooltip",
47
+ "tooltipFormatter",
48
+ "resizable"
49
+ ], s = ["showOverflowTooltip"], n = {
50
+ property: "prop",
51
+ align: "realAlign",
52
+ headerAlign: "realHeaderAlign"
53
+ }, a = d(m, n);
54
+ Object.keys(a).forEach((e) => {
55
+ const t = n[e];
56
+ u(i, t) && f(
57
+ () => i[t],
58
+ (h) => {
59
+ o.columnConfig.value[e] = h, (e === "filters" || e === "filterMethod") && (o.columnConfig.value.filterable = !!(o.columnConfig.value.filters || o.columnConfig.value.filterMethod));
60
+ }
61
+ );
62
+ }), s.forEach((e) => {
63
+ u(r.value.props, e) && f(
64
+ () => r.value.props[e],
65
+ (t) => {
66
+ o.columnConfig.value.type !== "selection" && p(i[e]) && (o.columnConfig.value[e] = t);
67
+ }
68
+ );
69
+ });
70
+ const l = w("table");
71
+ l.value && u(l.value, "showOverflowTooltip") && f(
72
+ () => {
73
+ var e;
74
+ return (e = l.value) == null ? void 0 : e.showOverflowTooltip;
75
+ },
76
+ (e) => {
77
+ o.columnConfig.value.type !== "selection" && (!p(i.showOverflowTooltip) || !p(r.value.props.showOverflowTooltip) || (o.columnConfig.value.showOverflowTooltip = e));
78
+ }
79
+ );
80
+ }
81
+ };
82
+ }
83
+ export {
84
+ K as default
85
+ };
@@ -0,0 +1,79 @@
1
+ import type { Store } from '../store';
2
+ import type { PropType } from 'vue';
3
+ import type { DefaultRow, Sort, SummaryMethod } from '../table/defaults';
4
+ export interface TableFooter<T extends DefaultRow> {
5
+ fixed: string;
6
+ store: Store<T>;
7
+ summaryMethod: SummaryMethod<T>;
8
+ sumText: string;
9
+ border: boolean;
10
+ defaultSort: Sort;
11
+ }
12
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
13
+ fixed: {
14
+ type: StringConstructor;
15
+ default: string;
16
+ };
17
+ store: {
18
+ required: true;
19
+ type: PropType<TableFooter<any>["store"]>;
20
+ };
21
+ summaryMethod: PropType<TableFooter<any>["summaryMethod"]>;
22
+ sumText: StringConstructor;
23
+ border: BooleanConstructor;
24
+ defaultSort: {
25
+ type: PropType<TableFooter<any>["defaultSort"]>;
26
+ default: () => {
27
+ prop: string;
28
+ order: string;
29
+ };
30
+ };
31
+ }>, {
32
+ ns: {
33
+ namespace: import("vue").ComputedRef<string>;
34
+ b: (blockSuffix?: string) => string;
35
+ e: (element?: string) => string;
36
+ m: (modifier?: string) => string;
37
+ be: (blockSuffix?: string, element?: string) => string;
38
+ em: (element?: string, modifier?: string) => string;
39
+ bm: (blockSuffix?: string, modifier?: string) => string;
40
+ bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
41
+ is: {
42
+ (name: string, state: boolean | undefined): string;
43
+ (name: string): string;
44
+ };
45
+ cssVar: (object: Record<string, string>) => Record<string, string>;
46
+ cssVarName: (name: string) => string;
47
+ cssVarBlock: (object: Record<string, string>) => Record<string, string>;
48
+ cssVarBlockName: (name: string) => string;
49
+ };
50
+ onScrollableChange: (layout: import("../table-layout").default<any>) => void;
51
+ onColumnsChange: (layout: import("../table-layout").default<any>) => void;
52
+ getCellClasses: (columns: import("../..").TableColumnCtx<any>[], cellIndex: number) => string[];
53
+ getCellStyles: (column: import("../..").TableColumnCtx<any>, cellIndex: number) => import("vue").CSSProperties | undefined;
54
+ columns: import("vue").ComputedRef<import("../..").TableColumnCtx<DefaultRow>[]>;
55
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
56
+ fixed: {
57
+ type: StringConstructor;
58
+ default: string;
59
+ };
60
+ store: {
61
+ required: true;
62
+ type: PropType<TableFooter<any>["store"]>;
63
+ };
64
+ summaryMethod: PropType<TableFooter<any>["summaryMethod"]>;
65
+ sumText: StringConstructor;
66
+ border: BooleanConstructor;
67
+ defaultSort: {
68
+ type: PropType<TableFooter<any>["defaultSort"]>;
69
+ default: () => {
70
+ prop: string;
71
+ order: string;
72
+ };
73
+ };
74
+ }>> & Readonly<{}>, {
75
+ fixed: string;
76
+ border: boolean;
77
+ defaultSort: Sort;
78
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
79
+ export default _default;
@@ -0,0 +1,110 @@
1
+ import { defineComponent as h, h as l, inject as y } from "vue";
2
+ import { useNamespace as C } from "../../../../hooks/use-namespace/index.js";
3
+ import "@vue/shared";
4
+ import "lodash-unified";
5
+ import "@vueuse/core";
6
+ import "@element-plus/icons-vue";
7
+ import "../../../../hooks/use-size/index.js";
8
+ import "@popperjs/core";
9
+ import "../../../../hooks/use-z-index/index.js";
10
+ import "../../../../hooks/use-delayed-toggle/index.js";
11
+ import "../../../../hooks/use-aria/index.js";
12
+ import "../../../../hooks/use-model-toggle/index.js";
13
+ import "../../../../hooks/use-empty-values/index.js";
14
+ import g from "../layout-observer.js";
15
+ import { TABLE_INJECTION_KEY as S } from "../tokens.js";
16
+ import E from "./style-helper.js";
17
+ const $ = h({
18
+ name: "ElTableFooter",
19
+ props: {
20
+ fixed: {
21
+ type: String,
22
+ default: ""
23
+ },
24
+ store: {
25
+ required: !0,
26
+ type: Object
27
+ },
28
+ summaryMethod: Function,
29
+ sumText: String,
30
+ border: Boolean,
31
+ defaultSort: {
32
+ type: Object,
33
+ default: () => ({
34
+ prop: "",
35
+ order: ""
36
+ })
37
+ }
38
+ },
39
+ setup(s) {
40
+ const n = y(S), i = C("table"), { getCellClasses: m, getCellStyles: u, columns: p } = E(
41
+ s
42
+ ), { onScrollableChange: r, onColumnsChange: e } = g(n);
43
+ return {
44
+ ns: i,
45
+ onScrollableChange: r,
46
+ onColumnsChange: e,
47
+ getCellClasses: m,
48
+ getCellStyles: u,
49
+ columns: p
50
+ };
51
+ },
52
+ render() {
53
+ const { columns: s, getCellStyles: n, getCellClasses: i, summaryMethod: m, sumText: u } = this, p = this.store.states.data.value;
54
+ let r = [];
55
+ return m ? r = m({
56
+ columns: s,
57
+ data: p
58
+ }) : s.forEach((e, t) => {
59
+ if (t === 0) {
60
+ r[t] = u;
61
+ return;
62
+ }
63
+ const c = p.map((o) => Number(o[e.property])), f = [];
64
+ let b = !0;
65
+ c.forEach((o) => {
66
+ if (!Number.isNaN(+o)) {
67
+ b = !1;
68
+ const a = `${o}`.split(".")[1];
69
+ f.push(a ? a.length : 0);
70
+ }
71
+ });
72
+ const N = Math.max.apply(null, f);
73
+ b ? r[t] = "" : r[t] = c.reduce((o, a) => {
74
+ const d = Number(a);
75
+ return Number.isNaN(+d) ? o : Number.parseFloat(
76
+ (o + a).toFixed(Math.min(N, 20))
77
+ );
78
+ }, 0);
79
+ }), l(
80
+ l("tfoot", [
81
+ l("tr", {}, [
82
+ ...s.map(
83
+ (e, t) => l(
84
+ "td",
85
+ {
86
+ key: t,
87
+ colspan: e.colSpan,
88
+ rowspan: e.rowSpan,
89
+ class: i(s, t),
90
+ style: n(e, t)
91
+ },
92
+ [
93
+ l(
94
+ "div",
95
+ {
96
+ class: ["cell", e.labelClassName]
97
+ },
98
+ [r[t]]
99
+ )
100
+ ]
101
+ )
102
+ )
103
+ ])
104
+ ])
105
+ );
106
+ }
107
+ });
108
+ export {
109
+ $ as default
110
+ };
@@ -0,0 +1,9 @@
1
+ declare function useMapState(): {
2
+ leftFixedLeafCount: import("vue").ComputedRef<number>;
3
+ rightFixedLeafCount: import("vue").ComputedRef<number>;
4
+ columnsCount: import("vue").ComputedRef<number>;
5
+ leftFixedCount: import("vue").ComputedRef<number>;
6
+ rightFixedCount: import("vue").ComputedRef<number>;
7
+ columns: import("vue").ComputedRef<import("../..").TableColumnCtx<import("../..").DefaultRow>[]>;
8
+ };
9
+ export default useMapState;
@@ -0,0 +1,16 @@
1
+ import { inject as i, computed as n } from "vue";
2
+ import { TABLE_INJECTION_KEY as c } from "../tokens.js";
3
+ function r() {
4
+ const e = i(c), t = e == null ? void 0 : e.store, u = n(() => (t == null ? void 0 : t.states.fixedLeafColumnsLength.value) ?? 0), l = n(() => (t == null ? void 0 : t.states.rightFixedColumns.value.length) ?? 0), s = n(() => (t == null ? void 0 : t.states.columns.value.length) ?? 0), a = n(() => (t == null ? void 0 : t.states.fixedColumns.value.length) ?? 0), o = n(() => (t == null ? void 0 : t.states.rightFixedColumns.value.length) ?? 0);
5
+ return {
6
+ leftFixedLeafCount: u,
7
+ rightFixedLeafCount: l,
8
+ columnsCount: s,
9
+ leftFixedCount: a,
10
+ rightFixedCount: o,
11
+ columns: n(() => (t == null ? void 0 : t.states.columns.value) ?? [])
12
+ };
13
+ }
14
+ export {
15
+ r as default
16
+ };
@@ -0,0 +1,9 @@
1
+ import type { TableColumnCtx } from '../table-column/defaults';
2
+ import type { DefaultRow } from '../table/defaults';
3
+ import type { TableFooter } from '.';
4
+ declare function useStyle<T extends DefaultRow>(props: TableFooter<T>): {
5
+ getCellClasses: (columns: TableColumnCtx<T>[], cellIndex: number) => string[];
6
+ getCellStyles: (column: TableColumnCtx<T>, cellIndex: number) => import("vue").CSSProperties | undefined;
7
+ columns: import("vue").ComputedRef<TableColumnCtx<DefaultRow>[]>;
8
+ };
9
+ export default useStyle;
@@ -0,0 +1,42 @@
1
+ import { useNamespace as a } from "../../../../hooks/use-namespace/index.js";
2
+ import "vue";
3
+ import "@vue/shared";
4
+ import "lodash-unified";
5
+ import "@vueuse/core";
6
+ import "@element-plus/icons-vue";
7
+ import "../../../../hooks/use-size/index.js";
8
+ import "@popperjs/core";
9
+ import "../../../../hooks/use-z-index/index.js";
10
+ import "../../../../hooks/use-delayed-toggle/index.js";
11
+ import "../../../../hooks/use-aria/index.js";
12
+ import "../../../../hooks/use-model-toggle/index.js";
13
+ import "../../../../hooks/use-empty-values/index.js";
14
+ import { getFixedColumnOffset as n, ensurePosition as r, getFixedColumnsClass as p } from "../util.js";
15
+ import c from "./mapState-helper.js";
16
+ function q(i) {
17
+ const { columns: m } = c(), s = a("table");
18
+ return {
19
+ getCellClasses: (o, e) => {
20
+ const t = o[e], l = [
21
+ s.e("cell"),
22
+ t.id,
23
+ t.align,
24
+ t.labelClassName,
25
+ ...p(s.b(), e, t.fixed, i.store)
26
+ ];
27
+ return t.className && l.push(t.className), t.children || l.push(s.is("leaf")), l;
28
+ },
29
+ getCellStyles: (o, e) => {
30
+ const t = n(
31
+ e,
32
+ o.fixed,
33
+ i.store
34
+ );
35
+ return r(t, "left"), r(t, "right"), t;
36
+ },
37
+ columns: m
38
+ };
39
+ }
40
+ export {
41
+ q as default
42
+ };
@@ -0,0 +1,14 @@
1
+ import type { EmitFn } from '@element-plus/utils';
2
+ import type { TableHeaderProps } from '.';
3
+ import type { TableColumnCtx } from '../table-column/defaults';
4
+ import type { DefaultRow, TableSortOrder } from '../table/defaults';
5
+ declare function useEvent<T extends DefaultRow>(props: TableHeaderProps<T>, emit: EmitFn<string[]>): {
6
+ handleHeaderClick: (event: PointerEvent, column: TableColumnCtx<T>) => void;
7
+ handleHeaderContextMenu: (event: PointerEvent, column: TableColumnCtx<T>) => void;
8
+ handleMouseDown: (event: MouseEvent, column: TableColumnCtx<T>) => void;
9
+ handleMouseMove: (event: MouseEvent, column: TableColumnCtx<T>) => void;
10
+ handleMouseOut: () => void;
11
+ handleSortClick: (event: Event, column: TableColumnCtx<T>, givenOrder?: TableSortOrder | boolean) => void;
12
+ handleFilterClick: (event: Event) => void;
13
+ };
14
+ export default useEvent;
@@ -0,0 +1,113 @@
1
+ import { getCurrentInstance as A, inject as D, ref as x } from "vue";
2
+ import { isNull as H } from "lodash-unified";
3
+ import { isElement as O } from "../../../../utils/types.js";
4
+ import { isClient as P } from "@vueuse/core";
5
+ import "@vue/shared";
6
+ import { hasClass as M, removeClass as z, addClass as X } from "../../../../utils/dom/style.js";
7
+ import "@element-plus/icons-vue";
8
+ import { TABLE_INJECTION_KEY as $ } from "../tokens.js";
9
+ function G(m, b) {
10
+ const y = A(), l = D($), E = (t) => {
11
+ t.stopPropagation();
12
+ }, S = (t, e) => {
13
+ !e.filters && e.sortable ? k(t, e, !1) : e.filterable && !e.sortable && E(t), l == null || l.emit("header-click", e, t);
14
+ }, T = (t, e) => {
15
+ l == null || l.emit("header-contextmenu", e, t);
16
+ }, v = x(null), g = x(!1), h = x(), N = (t, e) => {
17
+ var n, o;
18
+ if (P && !(e.children && e.children.length > 0) && v.value && m.border && v.value.id === e.id) {
19
+ g.value = !0;
20
+ const r = l;
21
+ b("set-drag-visible", !0);
22
+ const c = r == null ? void 0 : r.vnode.el, s = c == null ? void 0 : c.getBoundingClientRect().left, d = (o = (n = y == null ? void 0 : y.vnode) == null ? void 0 : n.el) == null ? void 0 : o.querySelector(`th.${e.id}`), i = d.getBoundingClientRect(), a = i.left - s + 30;
23
+ X(d, "noclick"), h.value = {
24
+ startMouseLeft: t.clientX,
25
+ startLeft: i.right - s,
26
+ startColumnLeft: i.left - s,
27
+ tableLeft: s
28
+ };
29
+ const u = r == null ? void 0 : r.refs.resizeProxy;
30
+ u.style.left = `${h.value.startLeft}px`, document.onselectstart = function() {
31
+ return !1;
32
+ }, document.ondragstart = function() {
33
+ return !1;
34
+ };
35
+ const f = (L) => {
36
+ const p = L.clientX - h.value.startMouseLeft, w = h.value.startLeft + p;
37
+ u.style.left = `${Math.max(a, w)}px`;
38
+ }, C = () => {
39
+ if (g.value) {
40
+ const { startColumnLeft: L, startLeft: p } = h.value, q = Number.parseInt(u.style.left, 10) - L;
41
+ e.width = e.realWidth = q, r == null || r.emit(
42
+ "header-dragend",
43
+ e.width,
44
+ p - L,
45
+ e,
46
+ t
47
+ ), requestAnimationFrame(() => {
48
+ m.store.scheduleLayout(!1, !0);
49
+ }), document.body.style.cursor = "", g.value = !1, v.value = null, h.value = void 0, b("set-drag-visible", !1);
50
+ }
51
+ document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", C), document.onselectstart = null, document.ondragstart = null, setTimeout(() => {
52
+ z(d, "noclick");
53
+ }, 0);
54
+ };
55
+ document.addEventListener("mousemove", f), document.addEventListener("mouseup", C);
56
+ }
57
+ }, R = (t, e) => {
58
+ var u;
59
+ if (!m.border || e.children && e.children.length > 0) return;
60
+ const n = t.target, o = O(n) ? n.closest("th") : null;
61
+ if (!o)
62
+ return;
63
+ const r = M(o, "is-sortable");
64
+ if (r) {
65
+ const f = g.value ? "col-resize" : "";
66
+ o.style.cursor = f;
67
+ const C = o.querySelector(".caret-wrapper");
68
+ C && (C.style.cursor = f);
69
+ }
70
+ if (!e.resizable || g.value) {
71
+ v.value = null;
72
+ return;
73
+ }
74
+ const c = o.getBoundingClientRect(), s = ((u = o.parentNode) == null ? void 0 : u.lastElementChild) === o, d = m.allowDragLastColumn || !s, i = c.width > 12 && c.right - t.clientX < 8 && d, a = i ? "col-resize" : "";
75
+ document.body.style.cursor = a, v.value = i ? e : null, r && (o.style.cursor = a);
76
+ }, B = () => {
77
+ !P || g.value || (document.body.style.cursor = "");
78
+ }, I = ({ order: t, sortOrders: e }) => {
79
+ if (t === "") return e[0];
80
+ const n = e.indexOf(t || null);
81
+ return e[n > e.length - 2 ? 0 : n + 1];
82
+ }, k = (t, e, n) => {
83
+ var u;
84
+ t.stopPropagation();
85
+ const o = e.order === n ? null : n || I(e), r = (u = t.target) == null ? void 0 : u.closest("th");
86
+ if (r && M(r, "noclick")) {
87
+ z(r, "noclick");
88
+ return;
89
+ }
90
+ if (!e.sortable) return;
91
+ const c = t.currentTarget;
92
+ if (["ascending", "descending"].some(
93
+ (f) => M(c, f) && !e.sortOrders.includes(f)
94
+ ))
95
+ return;
96
+ const s = m.store.states;
97
+ let d = s.sortProp.value, i;
98
+ const a = s.sortingColumn.value;
99
+ (a !== e || a === e && H(a.order)) && (a && (a.order = null), s.sortingColumn.value = e, d = e.property ?? null), o ? i = e.order = o : i = e.order = null, s.sortProp.value = d, s.sortOrder.value = i, l == null || l.store.commit("changeSortCondition");
100
+ };
101
+ return {
102
+ handleHeaderClick: S,
103
+ handleHeaderContextMenu: T,
104
+ handleMouseDown: N,
105
+ handleMouseMove: R,
106
+ handleMouseOut: B,
107
+ handleSortClick: k,
108
+ handleFilterClick: E
109
+ };
110
+ }
111
+ export {
112
+ G as default
113
+ };