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.
- package/dist/components/button/index.d.ts +12 -0
- package/dist/components/button-group/index.d.ts +3 -2
- package/dist/components/button-group/index.js +7 -3
- package/dist/components/button-group/src/button-group.d.ts +48 -0
- package/dist/components/button-group/src/button-group.js +7 -0
- package/dist/components/button-group/src/button-group.vue.d.ts +16 -0
- package/dist/components/button-group/src/button-group.vue.js +42 -0
- package/dist/components/button-group/src/button-group2.vue.js +4 -0
- package/dist/components/checkbox/index.js +6 -5
- package/dist/components/collection/index.d.ts +8 -0
- package/dist/components/collection/src/collection-item.vue.d.ts +2 -0
- package/dist/components/collection/src/collection-item.vue.js +10 -0
- package/dist/components/collection/src/collection-item2.vue.js +8 -0
- package/dist/components/collection/src/collection.d.ts +39 -0
- package/dist/components/collection/src/collection.js +52 -0
- package/dist/components/collection/src/collection.vue.d.ts +2 -0
- package/dist/components/collection/src/collection.vue.js +10 -0
- package/dist/components/collection/src/collection2.vue.js +7 -0
- package/dist/components/collection/src/tokens.d.ts +18 -0
- package/dist/components/divider/index.d.ts +24 -2
- package/dist/components/divider/index.js +8 -3
- package/dist/components/divider/src/divider.d.ts +30 -0
- package/dist/components/divider/src/divider.js +34 -0
- package/dist/components/divider/src/divider.vue.d.ts +24 -0
- package/dist/components/divider/src/divider.vue.js +39 -0
- package/dist/components/divider/src/divider2.vue.js +4 -0
- package/dist/components/dropdown/index.d.ts +3017 -3
- package/dist/components/dropdown/index.js +23 -3
- package/dist/components/dropdown/src/dropdown-item-impl.vue.d.ts +79 -0
- package/dist/components/dropdown/src/dropdown-item-impl.vue.js +40 -0
- package/dist/components/dropdown/src/dropdown-item-impl2.vue.js +68 -0
- package/dist/components/dropdown/src/dropdown-item.vue.d.ts +169 -0
- package/dist/components/dropdown/src/dropdown-item.vue.js +35 -0
- package/dist/components/dropdown/src/dropdown-item2.vue.js +63 -0
- package/dist/components/dropdown/src/dropdown-menu.vue.d.ts +27 -0
- package/dist/components/dropdown/src/dropdown-menu.vue.js +24 -0
- package/dist/components/dropdown/src/dropdown-menu2.vue.js +75 -0
- package/dist/components/dropdown/src/dropdown.d.ts +200 -0
- package/dist/components/dropdown/src/dropdown.js +201 -0
- package/dist/components/dropdown/src/dropdown.vue.d.ts +1126 -0
- package/dist/components/dropdown/src/dropdown.vue.js +127 -0
- package/dist/components/dropdown/src/dropdown2.vue.js +127 -0
- package/dist/components/dropdown/src/instance.d.ts +2 -0
- package/dist/components/dropdown/src/tokens.d.ts +13 -0
- package/dist/components/dropdown/src/tokens.js +5 -0
- package/dist/components/dropdown/src/useDropdown.d.ts +5 -0
- package/dist/components/dropdown/src/useDropdown.js +15 -0
- package/dist/components/dropdown-item/index.d.ts +1 -4
- package/dist/components/dropdown-menu/index.d.ts +1 -4
- package/dist/components/index.js +129 -131
- package/dist/components/popover/index.d.ts +121 -3
- package/dist/components/popover/index.js +19 -4
- package/dist/components/popover/src/directive.d.ts +4 -0
- package/dist/components/popover/src/directive.js +15 -0
- package/dist/components/popover/src/popover.d.ts +291 -0
- package/dist/components/popover/src/popover.js +168 -0
- package/dist/components/popover/src/popover.vue.d.ts +53 -0
- package/dist/components/popover/src/popover.vue.js +125 -0
- package/dist/components/popover/src/popover2.vue.js +4 -0
- package/dist/components/progress/index.d.ts +35 -2
- package/dist/components/progress/index.js +10 -4
- package/dist/components/progress/src/progress.d.ts +97 -0
- package/dist/components/progress/src/progress.js +104 -0
- package/dist/components/progress/src/progress.vue.d.ts +30 -0
- package/dist/components/progress/src/progress.vue.js +179 -0
- package/dist/components/progress/src/progress2.vue.js +4 -0
- package/dist/components/roving-focus-group/index.d.ts +14 -0
- package/dist/components/roving-focus-group/index.js +15 -0
- package/dist/components/roving-focus-group/src/roving-focus-group-impl.vue.d.ts +50 -0
- package/dist/components/roving-focus-group/src/roving-focus-group-impl.vue.js +10 -0
- package/dist/components/roving-focus-group/src/roving-focus-group-impl2.vue.js +115 -0
- package/dist/components/roving-focus-group/src/roving-focus-group.d.ts +56 -0
- package/dist/components/roving-focus-group/src/roving-focus-group.js +43 -0
- package/dist/components/roving-focus-group/src/roving-focus-group.vue.d.ts +67 -0
- package/dist/components/roving-focus-group/src/roving-focus-group.vue.js +13 -0
- package/dist/components/roving-focus-group/src/roving-focus-group2.vue.js +21 -0
- package/dist/components/roving-focus-group/src/roving-focus-item.vue.d.ts +43 -0
- package/dist/components/roving-focus-group/src/roving-focus-item.vue.js +20 -0
- package/dist/components/roving-focus-group/src/roving-focus-item2.vue.js +78 -0
- package/dist/components/roving-focus-group/src/tokens.d.ts +28 -0
- package/dist/components/roving-focus-group/src/tokens.js +5 -0
- package/dist/components/roving-focus-group/src/utils.d.ts +8 -0
- package/dist/components/roving-focus-group/src/utils.js +28 -0
- package/dist/components/table/index.d.ts +56 -3
- package/dist/components/table/index.js +20 -4
- package/dist/components/table/src/composables/use-scrollbar.d.ts +6 -0
- package/dist/components/table/src/composables/use-scrollbar.js +24 -0
- package/dist/components/table/src/config.d.ts +87 -0
- package/dist/components/table/src/config.js +210 -0
- package/dist/components/table/src/filter-panel.vue.d.ts +837 -0
- package/dist/components/table/src/filter-panel.vue.js +130 -0
- package/dist/components/table/src/filter-panel2.vue.js +155 -0
- package/dist/components/table/src/h-helper.d.ts +13 -0
- package/dist/components/table/src/h-helper.js +30 -0
- package/dist/components/table/src/layout-observer.d.ts +8 -0
- package/dist/components/table/src/layout-observer.js +49 -0
- package/dist/components/table/src/store/current.d.ts +15 -0
- package/dist/components/table/src/store/current.js +45 -0
- package/dist/components/table/src/store/expand.d.ts +14 -0
- package/dist/components/table/src/store/expand.js +55 -0
- package/dist/components/table/src/store/helper.d.ts +548 -0
- package/dist/components/table/src/store/helper.js +61 -0
- package/dist/components/table/src/store/index.d.ts +1107 -0
- package/dist/components/table/src/store/index.js +123 -0
- package/dist/components/table/src/store/tree.d.ts +27 -0
- package/dist/components/table/src/store/tree.js +153 -0
- package/dist/components/table/src/store/watcher.d.ts +88 -0
- package/dist/components/table/src/store/watcher.js +483 -0
- package/dist/components/table/src/table/defaults.d.ts +560 -0
- package/dist/components/table/src/table/defaults.js +236 -0
- package/dist/components/table/src/table/key-render-helper.d.ts +2 -0
- package/dist/components/table/src/table/key-render-helper.js +18 -0
- package/dist/components/table/src/table/style-helper.d.ts +51 -0
- package/dist/components/table/src/table/style-helper.js +169 -0
- package/dist/components/table/src/table/utils-helper.d.ts +16 -0
- package/dist/components/table/src/table/utils-helper.js +36 -0
- package/dist/components/table/src/table-body/defaults.d.ts +39 -0
- package/dist/components/table/src/table-body/defaults.js +25 -0
- package/dist/components/table/src/table-body/events-helper.d.ts +19 -0
- package/dist/components/table/src/table-body/events-helper.js +126 -0
- package/dist/components/table/src/table-body/index.d.ts +84 -0
- package/dist/components/table/src/table-body/index.js +77 -0
- package/dist/components/table/src/table-body/render-helper.d.ts +18 -0
- package/dist/components/table/src/table-body/render-helper.js +188 -0
- package/dist/components/table/src/table-body/styles-helper.d.ts +15 -0
- package/dist/components/table/src/table-body/styles-helper.js +98 -0
- package/dist/components/table/src/table-body/td-wrapper.vue.d.ts +33 -0
- package/dist/components/table/src/table-body/td-wrapper.vue.js +26 -0
- package/dist/components/table/src/table-body/td-wrapper2.vue.js +4 -0
- package/dist/components/table/src/table-column/defaults.d.ts +348 -0
- package/dist/components/table/src/table-column/defaults.js +152 -0
- package/dist/components/table/src/table-column/index.d.ts +2 -0
- package/dist/components/table/src/table-column/index.vue.d.ts +32 -0
- package/dist/components/table/src/table-column/index.vue.js +161 -0
- package/dist/components/table/src/table-column/index2.vue.js +4 -0
- package/dist/components/table/src/table-column/render-helper.d.ts +17 -0
- package/dist/components/table/src/table-column/render-helper.js +116 -0
- package/dist/components/table/src/table-column/watcher-helper.d.ts +8 -0
- package/dist/components/table/src/table-column/watcher-helper.js +85 -0
- package/dist/components/table/src/table-footer/index.d.ts +79 -0
- package/dist/components/table/src/table-footer/index.js +110 -0
- package/dist/components/table/src/table-footer/mapState-helper.d.ts +9 -0
- package/dist/components/table/src/table-footer/mapState-helper.js +16 -0
- package/dist/components/table/src/table-footer/style-helper.d.ts +9 -0
- package/dist/components/table/src/table-footer/style-helper.js +42 -0
- package/dist/components/table/src/table-header/event-helper.d.ts +14 -0
- package/dist/components/table/src/table-header/event-helper.js +113 -0
- package/dist/components/table/src/table-header/index.d.ts +361 -0
- package/dist/components/table/src/table-header/index.js +255 -0
- package/dist/components/table/src/table-header/style.helper.d.ts +10 -0
- package/dist/components/table/src/table-header/style.helper.js +73 -0
- package/dist/components/table/src/table-header/utils-helper.d.ts +10 -0
- package/dist/components/table/src/table-header/utils-helper.js +45 -0
- package/dist/components/table/src/table-layout.d.ts +37 -0
- package/dist/components/table/src/table-layout.js +144 -0
- package/dist/components/table/src/table.vue.d.ts +734 -0
- package/dist/components/table/src/table.vue.js +443 -0
- package/dist/components/table/src/table2.vue.js +4 -0
- package/dist/components/table/src/tableColumn.d.ts +2 -0
- package/dist/components/table/src/tokens.d.ts +3 -0
- package/dist/components/table/src/tokens.js +4 -0
- package/dist/components/table/src/util.d.ts +55 -0
- package/dist/components/table/src/util.js +310 -0
- package/dist/components/table-column/index.d.ts +40 -3
- package/dist/components/table-column/index.js +6 -3
- package/dist/components/upload/index.d.ts +45 -2
- package/dist/components/upload/index.js +23 -4
- package/dist/components/upload/src/ajax.d.ts +9 -0
- package/dist/components/upload/src/ajax.js +58 -0
- package/dist/components/upload/src/constants.d.ts +5 -0
- package/dist/components/upload/src/constants.js +4 -0
- package/dist/components/upload/src/upload-content.d.ts +136 -0
- package/dist/components/upload/src/upload-content.js +53 -0
- package/dist/components/upload/src/upload-content.vue.d.ts +38 -0
- package/dist/components/upload/src/upload-content.vue.js +186 -0
- package/dist/components/upload/src/upload-content2.vue.js +4 -0
- package/dist/components/upload/src/upload-dragger.d.ts +22 -0
- package/dist/components/upload/src/upload-dragger.js +19 -0
- package/dist/components/upload/src/upload-dragger.vue.d.ts +19 -0
- package/dist/components/upload/src/upload-dragger.vue.js +91 -0
- package/dist/components/upload/src/upload-dragger2.vue.js +4 -0
- package/dist/components/upload/src/upload-list.d.ts +45 -0
- package/dist/components/upload/src/upload-list.js +39 -0
- package/dist/components/upload/src/upload-list.vue.d.ts +28 -0
- package/dist/components/upload/src/upload-list.vue.js +182 -0
- package/dist/components/upload/src/upload-list2.vue.js +4 -0
- package/dist/components/upload/src/upload.d.ts +361 -0
- package/dist/components/upload/src/upload.js +216 -0
- package/dist/components/upload/src/upload.vue.d.ts +64 -0
- package/dist/components/upload/src/upload.vue.js +150 -0
- package/dist/components/upload/src/upload2.vue.js +4 -0
- package/dist/components/upload/src/use-handlers.d.ts +60 -0
- package/dist/components/upload/src/use-handlers.js +111 -0
- package/dist/directives/mousewheel/index.js +28 -0
- package/dist/ep-craft.js +277 -236
- package/dist/index.d.ts +67 -0
- package/dist/utils/dom/event.js +12 -11
- package/dist/utils/objects.js +10 -9
- package/dist/utils/vue/install.js +21 -18
- package/dist/utils/vue/refs.js +8 -0
- package/dist/vendored-components.d.ts +1 -1
- package/dist/vendored-components.js +44 -4
- package/package.json +1 -1
- package/dist/components/dropdown-item/index.js +0 -6
- package/dist/components/dropdown-menu/index.js +0 -6
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { inject as Y, ref as M, h as F } from "vue";
|
|
2
|
+
import { debounce as I } from "lodash-unified";
|
|
3
|
+
import "@vue/shared";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import { isGreaterThan as h } from "../../../../utils/numbers.js";
|
|
6
|
+
import { hasClass as O, addClass as Q, removeClass as U } from "../../../../utils/dom/style.js";
|
|
7
|
+
import "@element-plus/icons-vue";
|
|
8
|
+
import { getCell as f, getColumnByCell as L, createTablePopper as V, removePopper as m } from "../util.js";
|
|
9
|
+
import { TABLE_INJECTION_KEY as X } from "../tokens.js";
|
|
10
|
+
function dt(a) {
|
|
11
|
+
const r = Y(X), k = M(""), v = M(F("div")), u = (t, e, l) => {
|
|
12
|
+
var i, d;
|
|
13
|
+
const o = r, n = f(t);
|
|
14
|
+
let s = null;
|
|
15
|
+
const c = (i = o == null ? void 0 : o.vnode.el) == null ? void 0 : i.dataset.prefix;
|
|
16
|
+
n && (s = L(
|
|
17
|
+
{
|
|
18
|
+
columns: ((d = a.store) == null ? void 0 : d.states.columns.value) ?? []
|
|
19
|
+
},
|
|
20
|
+
n,
|
|
21
|
+
c
|
|
22
|
+
), s && (o == null || o.emit(`cell-${l}`, e, s, n, t))), o == null || o.emit(`row-${l}`, e, s, t);
|
|
23
|
+
}, y = (t, e) => {
|
|
24
|
+
u(t, e, "dblclick");
|
|
25
|
+
}, P = (t, e) => {
|
|
26
|
+
var l;
|
|
27
|
+
(l = a.store) == null || l.commit("setCurrentRow", e), u(t, e, "click");
|
|
28
|
+
}, S = (t, e) => {
|
|
29
|
+
u(t, e, "contextmenu");
|
|
30
|
+
}, b = I((t) => {
|
|
31
|
+
var e;
|
|
32
|
+
(e = a.store) == null || e.commit("setHoverRow", t);
|
|
33
|
+
}, 30), W = I(() => {
|
|
34
|
+
var t;
|
|
35
|
+
(t = a.store) == null || t.commit("setHoverRow", null);
|
|
36
|
+
}, 30), $ = (t) => {
|
|
37
|
+
const e = window.getComputedStyle(t, null), l = Number.parseInt(e.paddingLeft, 10) || 0, o = Number.parseInt(e.paddingRight, 10) || 0, n = Number.parseInt(e.paddingTop, 10) || 0, s = Number.parseInt(e.paddingBottom, 10) || 0;
|
|
38
|
+
return {
|
|
39
|
+
left: l,
|
|
40
|
+
right: o,
|
|
41
|
+
top: n,
|
|
42
|
+
bottom: s
|
|
43
|
+
};
|
|
44
|
+
}, p = (t, e, l) => {
|
|
45
|
+
var n;
|
|
46
|
+
let o = (n = e == null ? void 0 : e.target) == null ? void 0 : n.parentNode;
|
|
47
|
+
for (; t > 1 && (o = o == null ? void 0 : o.nextSibling, !(!o || o.nodeName !== "TR")); )
|
|
48
|
+
l(o, "hover-row hover-fixed-row"), t--;
|
|
49
|
+
};
|
|
50
|
+
return {
|
|
51
|
+
handleDoubleClick: y,
|
|
52
|
+
handleClick: P,
|
|
53
|
+
handleContextMenu: S,
|
|
54
|
+
handleMouseEnter: b,
|
|
55
|
+
handleMouseLeave: W,
|
|
56
|
+
handleCellMouseEnter: (t, e, l) => {
|
|
57
|
+
var w, x, N, R, E, T, B;
|
|
58
|
+
if (!r) return;
|
|
59
|
+
const o = r, n = f(t), s = (w = o == null ? void 0 : o.vnode.el) == null ? void 0 : w.dataset.prefix;
|
|
60
|
+
let c = null;
|
|
61
|
+
if (n) {
|
|
62
|
+
if (c = L(
|
|
63
|
+
{
|
|
64
|
+
columns: ((x = a.store) == null ? void 0 : x.states.columns.value) ?? []
|
|
65
|
+
},
|
|
66
|
+
n,
|
|
67
|
+
s
|
|
68
|
+
), !c)
|
|
69
|
+
return;
|
|
70
|
+
n.rowSpan > 1 && p(n.rowSpan, t, Q);
|
|
71
|
+
const g = o.hoverState = {
|
|
72
|
+
cell: n,
|
|
73
|
+
column: c,
|
|
74
|
+
row: e
|
|
75
|
+
};
|
|
76
|
+
o == null || o.emit(
|
|
77
|
+
"cell-mouse-enter",
|
|
78
|
+
g.row,
|
|
79
|
+
g.column,
|
|
80
|
+
g.cell,
|
|
81
|
+
t
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
if (!l) {
|
|
85
|
+
((N = m) == null ? void 0 : N.trigger) === n && ((R = m) == null || R());
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const i = t.target.querySelector(
|
|
89
|
+
".cell"
|
|
90
|
+
);
|
|
91
|
+
if (!(O(i, `${s}-tooltip`) && i.childNodes.length && ((E = i.textContent) != null && E.trim())))
|
|
92
|
+
return;
|
|
93
|
+
const d = document.createRange();
|
|
94
|
+
d.setStart(i, 0), d.setEnd(i, i.childNodes.length);
|
|
95
|
+
const { width: _, height: j } = d.getBoundingClientRect(), { width: C, height: q } = i.getBoundingClientRect(), { top: z, left: A, right: D, bottom: G } = $(i), J = A + D, K = z + G;
|
|
96
|
+
h(_ + J, C) || h(j + K, q) || // When using a high-resolution screen, it is possible that a returns cellChild.scrollWidth value of 1921 and
|
|
97
|
+
// cellChildWidth returns a value of 1920.994140625. #16856 #16673
|
|
98
|
+
h(i.scrollWidth, C) ? V(
|
|
99
|
+
l,
|
|
100
|
+
((n == null ? void 0 : n.innerText) || (n == null ? void 0 : n.textContent)) ?? "",
|
|
101
|
+
e,
|
|
102
|
+
c,
|
|
103
|
+
n,
|
|
104
|
+
o
|
|
105
|
+
) : ((T = m) == null ? void 0 : T.trigger) === n && ((B = m) == null || B());
|
|
106
|
+
},
|
|
107
|
+
handleCellMouseLeave: (t) => {
|
|
108
|
+
const e = f(t);
|
|
109
|
+
if (!e) return;
|
|
110
|
+
e.rowSpan > 1 && p(e.rowSpan, t, U);
|
|
111
|
+
const l = r == null ? void 0 : r.hoverState;
|
|
112
|
+
r == null || r.emit(
|
|
113
|
+
"cell-mouse-leave",
|
|
114
|
+
l == null ? void 0 : l.row,
|
|
115
|
+
l == null ? void 0 : l.column,
|
|
116
|
+
l == null ? void 0 : l.cell,
|
|
117
|
+
t
|
|
118
|
+
);
|
|
119
|
+
},
|
|
120
|
+
tooltipContent: k,
|
|
121
|
+
tooltipTrigger: v
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
export {
|
|
125
|
+
dt as default
|
|
126
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
store: {
|
|
4
|
+
required: boolean;
|
|
5
|
+
type: import("vue").PropType<import("./defaults").TableBodyProps<any>["store"]>;
|
|
6
|
+
};
|
|
7
|
+
stripe: BooleanConstructor;
|
|
8
|
+
tooltipEffect: StringConstructor;
|
|
9
|
+
tooltipOptions: {
|
|
10
|
+
type: import("vue").PropType<import("./defaults").TableBodyProps<any>["tooltipOptions"]>;
|
|
11
|
+
};
|
|
12
|
+
context: {
|
|
13
|
+
default: () => {};
|
|
14
|
+
type: import("vue").PropType<import("./defaults").TableBodyProps<any>["context"]>;
|
|
15
|
+
};
|
|
16
|
+
rowClassName: import("vue").PropType<import("./defaults").TableBodyProps<any>["rowClassName"]>;
|
|
17
|
+
rowStyle: import("vue").PropType<import("./defaults").TableBodyProps<any>["rowStyle"]>;
|
|
18
|
+
fixed: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
highlight: BooleanConstructor;
|
|
23
|
+
}>, {
|
|
24
|
+
ns: {
|
|
25
|
+
namespace: import("vue").ComputedRef<string>;
|
|
26
|
+
b: (blockSuffix?: string) => string;
|
|
27
|
+
e: (element?: string) => string;
|
|
28
|
+
m: (modifier?: string) => string;
|
|
29
|
+
be: (blockSuffix?: string, element?: string) => string;
|
|
30
|
+
em: (element?: string, modifier?: string) => string;
|
|
31
|
+
bm: (blockSuffix?: string, modifier?: string) => string;
|
|
32
|
+
bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
|
|
33
|
+
is: {
|
|
34
|
+
(name: string, state: boolean | undefined): string;
|
|
35
|
+
(name: string): string;
|
|
36
|
+
};
|
|
37
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
38
|
+
cssVarName: (name: string) => string;
|
|
39
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
40
|
+
cssVarBlockName: (name: string) => string;
|
|
41
|
+
};
|
|
42
|
+
onColumnsChange: (layout: import("../table-layout").default<import("../..").DefaultRow>) => void;
|
|
43
|
+
onScrollableChange: (layout: import("../table-layout").default<import("../..").DefaultRow>) => void;
|
|
44
|
+
wrappedRowRender: (row: any, $index: number) => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
}> | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
47
|
+
[key: string]: any;
|
|
48
|
+
}>[] | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
}>[][];
|
|
51
|
+
tooltipContent: import("vue").Ref<string, string>;
|
|
52
|
+
tooltipTrigger: import("vue").Ref<VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
53
|
+
[key: string]: any;
|
|
54
|
+
}>, VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
55
|
+
[key: string]: any;
|
|
56
|
+
}>>;
|
|
57
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
58
|
+
store: {
|
|
59
|
+
required: boolean;
|
|
60
|
+
type: import("vue").PropType<import("./defaults").TableBodyProps<any>["store"]>;
|
|
61
|
+
};
|
|
62
|
+
stripe: BooleanConstructor;
|
|
63
|
+
tooltipEffect: StringConstructor;
|
|
64
|
+
tooltipOptions: {
|
|
65
|
+
type: import("vue").PropType<import("./defaults").TableBodyProps<any>["tooltipOptions"]>;
|
|
66
|
+
};
|
|
67
|
+
context: {
|
|
68
|
+
default: () => {};
|
|
69
|
+
type: import("vue").PropType<import("./defaults").TableBodyProps<any>["context"]>;
|
|
70
|
+
};
|
|
71
|
+
rowClassName: import("vue").PropType<import("./defaults").TableBodyProps<any>["rowClassName"]>;
|
|
72
|
+
rowStyle: import("vue").PropType<import("./defaults").TableBodyProps<any>["rowStyle"]>;
|
|
73
|
+
fixed: {
|
|
74
|
+
type: StringConstructor;
|
|
75
|
+
default: string;
|
|
76
|
+
};
|
|
77
|
+
highlight: BooleanConstructor;
|
|
78
|
+
}>> & Readonly<{}>, {
|
|
79
|
+
fixed: string;
|
|
80
|
+
highlight: boolean;
|
|
81
|
+
stripe: boolean;
|
|
82
|
+
context: import("../..").Table<any>;
|
|
83
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
84
|
+
export default _default;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { defineComponent as S, h as B, getCurrentInstance as D, inject as O, watch as P, onUnmounted as _ } from "vue";
|
|
2
|
+
import "@vue/shared";
|
|
3
|
+
import "lodash-unified";
|
|
4
|
+
import { isClient as j } from "@vueuse/core";
|
|
5
|
+
import { rAF as k } from "../../../../utils/raf.js";
|
|
6
|
+
import { addClass as N, removeClass as R } from "../../../../utils/dom/style.js";
|
|
7
|
+
import "@element-plus/icons-vue";
|
|
8
|
+
import { useNamespace as F } 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 J from "../layout-observer.js";
|
|
17
|
+
import { removePopper as K } from "../util.js";
|
|
18
|
+
import { TABLE_INJECTION_KEY as U } from "../tokens.js";
|
|
19
|
+
import Y from "./render-helper.js";
|
|
20
|
+
import $ from "./defaults.js";
|
|
21
|
+
const ao = S({
|
|
22
|
+
name: "ElTableBody",
|
|
23
|
+
props: $,
|
|
24
|
+
setup(i) {
|
|
25
|
+
var v;
|
|
26
|
+
const t = D(), c = O(U), m = F("table"), { wrappedRowRender: d, tooltipContent: T, tooltipTrigger: y } = Y(i), { onColumnsChange: E, onScrollableChange: L } = J(c), f = [];
|
|
27
|
+
return P((v = i.store) == null ? void 0 : v.states.hoverRow, (n, A) => {
|
|
28
|
+
var C, w;
|
|
29
|
+
const h = t == null ? void 0 : t.vnode.el, l = Array.from((h == null ? void 0 : h.children) || []).filter(
|
|
30
|
+
(o) => o == null ? void 0 : o.classList.contains(`${m.e("row")}`)
|
|
31
|
+
);
|
|
32
|
+
let a = n;
|
|
33
|
+
const s = (C = l[a]) == null ? void 0 : C.childNodes;
|
|
34
|
+
if (s != null && s.length) {
|
|
35
|
+
let o = 0;
|
|
36
|
+
Array.from(s).reduce((r, p, e) => {
|
|
37
|
+
var b, g;
|
|
38
|
+
return ((b = s[e]) == null ? void 0 : b.colSpan) > 1 && (o = (g = s[e]) == null ? void 0 : g.colSpan), p.nodeName !== "TD" && o === 0 && r.push(e), o > 0 && o--, r;
|
|
39
|
+
}, []).forEach((r) => {
|
|
40
|
+
var p;
|
|
41
|
+
for (a = n; a > 0; ) {
|
|
42
|
+
const e = (p = l[a - 1]) == null ? void 0 : p.childNodes;
|
|
43
|
+
if (e[r] && e[r].nodeName === "TD" && e[r].rowSpan > 1) {
|
|
44
|
+
N(e[r], "hover-cell"), f.push(e[r]);
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
a--;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
} else
|
|
51
|
+
f.forEach((o) => R(o, "hover-cell")), f.length = 0;
|
|
52
|
+
!((w = i.store) != null && w.states.isComplex.value) || !j || k(() => {
|
|
53
|
+
const o = l[A], u = l[n];
|
|
54
|
+
o && !o.classList.contains("hover-fixed-row") && R(o, "hover-row"), u && N(u, "hover-row");
|
|
55
|
+
});
|
|
56
|
+
}), _(() => {
|
|
57
|
+
var n;
|
|
58
|
+
(n = K) == null || n();
|
|
59
|
+
}), {
|
|
60
|
+
ns: m,
|
|
61
|
+
onColumnsChange: E,
|
|
62
|
+
onScrollableChange: L,
|
|
63
|
+
wrappedRowRender: d,
|
|
64
|
+
tooltipContent: T,
|
|
65
|
+
tooltipTrigger: y
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
render() {
|
|
69
|
+
const { wrappedRowRender: i, store: t } = this, c = (t == null ? void 0 : t.states.data.value) || [];
|
|
70
|
+
return B("tbody", { tabIndex: -1 }, [
|
|
71
|
+
c.reduce((m, d) => m.concat(i(d, m.length)), [])
|
|
72
|
+
]);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
export {
|
|
76
|
+
ao as default
|
|
77
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TableBodyProps } from './defaults';
|
|
2
|
+
import type { DefaultRow } from '../table/defaults';
|
|
3
|
+
declare function useRender<T extends DefaultRow>(props: Partial<TableBodyProps<T>>): {
|
|
4
|
+
wrappedRowRender: (row: T, $index: number) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}>[] | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}>[][];
|
|
11
|
+
tooltipContent: import("vue").Ref<string, string>;
|
|
12
|
+
tooltipTrigger: import("vue").Ref<import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}>, import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}>>;
|
|
17
|
+
};
|
|
18
|
+
export default useRender;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { inject as X, computed as Z, h as M } from "vue";
|
|
2
|
+
import { merge as D } from "lodash-unified";
|
|
3
|
+
import { useNamespace as $ } from "../../../../hooks/use-namespace/index.js";
|
|
4
|
+
import { isBoolean as k, isPropAbsent as ee } from "../../../../utils/types.js";
|
|
5
|
+
import "@vueuse/core";
|
|
6
|
+
import "@vue/shared";
|
|
7
|
+
import "@element-plus/icons-vue";
|
|
8
|
+
import "../../../../hooks/use-size/index.js";
|
|
9
|
+
import "@popperjs/core";
|
|
10
|
+
import "../../../../hooks/use-z-index/index.js";
|
|
11
|
+
import "../../../../hooks/use-delayed-toggle/index.js";
|
|
12
|
+
import "../../../../hooks/use-aria/index.js";
|
|
13
|
+
import "../../../../hooks/use-model-toggle/index.js";
|
|
14
|
+
import "../../../../hooks/use-empty-values/index.js";
|
|
15
|
+
import { getRowIdentity as _ } from "../util.js";
|
|
16
|
+
import { TABLE_INJECTION_KEY as le } from "../tokens.js";
|
|
17
|
+
import ne from "./events-helper.js";
|
|
18
|
+
import te from "./styles-helper.js";
|
|
19
|
+
import oe from "./td-wrapper.vue.js";
|
|
20
|
+
function Me(i) {
|
|
21
|
+
const a = X(le), x = $("table"), {
|
|
22
|
+
handleDoubleClick: S,
|
|
23
|
+
handleClick: j,
|
|
24
|
+
handleContextMenu: R,
|
|
25
|
+
handleMouseEnter: q,
|
|
26
|
+
handleMouseLeave: A,
|
|
27
|
+
handleCellMouseEnter: B,
|
|
28
|
+
handleCellMouseLeave: W,
|
|
29
|
+
tooltipContent: F,
|
|
30
|
+
tooltipTrigger: J
|
|
31
|
+
} = ne(i), {
|
|
32
|
+
getRowStyle: P,
|
|
33
|
+
getRowClass: Y,
|
|
34
|
+
getCellStyle: w,
|
|
35
|
+
getCellClass: G,
|
|
36
|
+
getSpan: H,
|
|
37
|
+
getColspanRealWidth: I
|
|
38
|
+
} = te(i);
|
|
39
|
+
let N = -1;
|
|
40
|
+
const Q = Z(() => {
|
|
41
|
+
var l;
|
|
42
|
+
return (l = i.store) == null ? void 0 : l.states.columns.value.findIndex(
|
|
43
|
+
({ type: t }) => t === "default"
|
|
44
|
+
);
|
|
45
|
+
}), b = (l, t) => {
|
|
46
|
+
var f;
|
|
47
|
+
const n = (f = a == null ? void 0 : a.props) == null ? void 0 : f.rowKey;
|
|
48
|
+
return n ? _(l, n) : t;
|
|
49
|
+
}, K = (l, t, n, f = !1) => {
|
|
50
|
+
const { tooltipEffect: O, tooltipOptions: v, store: h } = i, { indent: z, columns: C } = h.states, y = [];
|
|
51
|
+
let L = !0;
|
|
52
|
+
return n && (y.push(x.em("row", `level-${n.level}`)), L = !!n.display), t === 0 && (N = -1), i.stripe && L && N++, y.push(...Y(l, t, N)), M(
|
|
53
|
+
"tr",
|
|
54
|
+
{
|
|
55
|
+
style: [L ? null : { display: "none" }, P(l, t)],
|
|
56
|
+
class: y,
|
|
57
|
+
key: b(l, t),
|
|
58
|
+
onDblclick: (e) => S(e, l),
|
|
59
|
+
onClick: (e) => j(e, l),
|
|
60
|
+
onContextmenu: (e) => R(e, l),
|
|
61
|
+
onMouseenter: () => q(t),
|
|
62
|
+
onMouseleave: A
|
|
63
|
+
},
|
|
64
|
+
C.value.map((e, o) => {
|
|
65
|
+
const { rowspan: d, colspan: p } = H(l, e, t, o);
|
|
66
|
+
if (!d || !p)
|
|
67
|
+
return null;
|
|
68
|
+
const u = Object.assign({}, e);
|
|
69
|
+
u.realWidth = I(
|
|
70
|
+
C.value,
|
|
71
|
+
p,
|
|
72
|
+
o
|
|
73
|
+
);
|
|
74
|
+
const c = {
|
|
75
|
+
store: h,
|
|
76
|
+
_self: i.context || a,
|
|
77
|
+
column: u,
|
|
78
|
+
row: l,
|
|
79
|
+
$index: t,
|
|
80
|
+
cellIndex: o,
|
|
81
|
+
expanded: f
|
|
82
|
+
};
|
|
83
|
+
o === Q.value && n && (c.treeNode = {
|
|
84
|
+
indent: n.level && n.level * z.value,
|
|
85
|
+
level: n.level
|
|
86
|
+
}, k(n.expanded) && (c.treeNode.expanded = n.expanded, "loading" in n && (c.treeNode.loading = n.loading), "noLazyChildren" in n && (c.treeNode.noLazyChildren = n.noLazyChildren)));
|
|
87
|
+
const g = `${b(l, t)},${o}`, m = u.columnKey || u.rawColumnKey || "", E = e.showOverflowTooltip && D(
|
|
88
|
+
{
|
|
89
|
+
effect: O
|
|
90
|
+
},
|
|
91
|
+
v,
|
|
92
|
+
e.showOverflowTooltip
|
|
93
|
+
);
|
|
94
|
+
return M(
|
|
95
|
+
oe,
|
|
96
|
+
{
|
|
97
|
+
style: w(t, o, l, e),
|
|
98
|
+
class: G(t, o, l, e, p - 1),
|
|
99
|
+
key: `${m}${g}`,
|
|
100
|
+
rowspan: d,
|
|
101
|
+
colspan: p,
|
|
102
|
+
onMouseenter: (r) => B(
|
|
103
|
+
r,
|
|
104
|
+
l,
|
|
105
|
+
E
|
|
106
|
+
),
|
|
107
|
+
onMouseleave: W
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
default: () => U(o, e, c)
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
})
|
|
114
|
+
);
|
|
115
|
+
}, U = (l, t, n) => t.renderCell(n);
|
|
116
|
+
return {
|
|
117
|
+
wrappedRowRender: (l, t) => {
|
|
118
|
+
const n = i.store, { isRowExpanded: f, assertRowKey: O } = n, { treeData: v, lazyTreeNodeMap: h, childrenColumnName: z, rowKey: C } = n.states, y = n.states.columns.value;
|
|
119
|
+
if (y.some(({ type: s }) => s === "expand")) {
|
|
120
|
+
const s = f(l), e = K(l, t, void 0, s), o = a == null ? void 0 : a.renderExpanded;
|
|
121
|
+
if (!o)
|
|
122
|
+
return console.error("[Element Error]renderExpanded is required."), e;
|
|
123
|
+
const d = [[e]];
|
|
124
|
+
return (a.props.preserveExpandedContent || s) && d[0].push(
|
|
125
|
+
M(
|
|
126
|
+
"tr",
|
|
127
|
+
{
|
|
128
|
+
key: `expanded-row__${e.key}`,
|
|
129
|
+
style: { display: s ? "" : "none" }
|
|
130
|
+
},
|
|
131
|
+
[
|
|
132
|
+
M(
|
|
133
|
+
"td",
|
|
134
|
+
{
|
|
135
|
+
colspan: y.length,
|
|
136
|
+
class: `${x.e("cell")} ${x.e("expanded-cell")}`
|
|
137
|
+
},
|
|
138
|
+
[o({ row: l, $index: t, store: n, expanded: s })]
|
|
139
|
+
)
|
|
140
|
+
]
|
|
141
|
+
)
|
|
142
|
+
), d;
|
|
143
|
+
} else if (Object.keys(v.value).length) {
|
|
144
|
+
O();
|
|
145
|
+
const s = _(l, C.value);
|
|
146
|
+
let e = v.value[s], o = null;
|
|
147
|
+
e && (o = {
|
|
148
|
+
expanded: e.expanded,
|
|
149
|
+
level: e.level,
|
|
150
|
+
display: !0,
|
|
151
|
+
noLazyChildren: void 0,
|
|
152
|
+
loading: void 0
|
|
153
|
+
}, k(e.lazy) && (o && k(e.loaded) && e.loaded && (o.noLazyChildren = !(e.children && e.children.length)), o.loading = e.loading));
|
|
154
|
+
const d = [K(l, t, o ?? void 0)];
|
|
155
|
+
if (e) {
|
|
156
|
+
let p = 0;
|
|
157
|
+
const u = (g, m) => {
|
|
158
|
+
g && g.length && m && g.forEach((E) => {
|
|
159
|
+
const r = {
|
|
160
|
+
display: m.display && m.expanded,
|
|
161
|
+
level: m.level + 1,
|
|
162
|
+
expanded: !1,
|
|
163
|
+
noLazyChildren: !1,
|
|
164
|
+
loading: !1
|
|
165
|
+
}, T = _(E, C.value);
|
|
166
|
+
if (ee(T))
|
|
167
|
+
throw new Error("For nested data item, row-key is required.");
|
|
168
|
+
if (e = { ...v.value[T] }, e && (r.expanded = e.expanded, e.level = e.level || r.level, e.display = !!(e.expanded && r.display), k(e.lazy) && (k(e.loaded) && e.loaded && (r.noLazyChildren = !(e.children && e.children.length)), r.loading = e.loading)), p++, d.push(K(E, t + p, r)), e) {
|
|
169
|
+
const V = h.value[T] || E[z.value];
|
|
170
|
+
u(V, e);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
};
|
|
174
|
+
e.display = !0;
|
|
175
|
+
const c = h.value[s] || l[z.value];
|
|
176
|
+
u(c, e);
|
|
177
|
+
}
|
|
178
|
+
return d;
|
|
179
|
+
} else
|
|
180
|
+
return K(l, t, void 0);
|
|
181
|
+
},
|
|
182
|
+
tooltipContent: F,
|
|
183
|
+
tooltipTrigger: J
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
export {
|
|
187
|
+
Me as default
|
|
188
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TableColumnCtx } from '../table-column/defaults';
|
|
2
|
+
import type { TableBodyProps } from './defaults';
|
|
3
|
+
import type { DefaultRow } from '../table/defaults';
|
|
4
|
+
declare function useStyles<T extends DefaultRow>(props: Partial<TableBodyProps<T>>): {
|
|
5
|
+
getRowStyle: (row: T, rowIndex: number) => any;
|
|
6
|
+
getRowClass: (row: T, rowIndex: number, displayIndex: number) => string[];
|
|
7
|
+
getCellStyle: (rowIndex: number, columnIndex: number, row: T, column: TableColumnCtx<T>) => import("vue").CSSProperties;
|
|
8
|
+
getCellClass: (rowIndex: number, columnIndex: number, row: T, column: TableColumnCtx<T>, offset: number) => string;
|
|
9
|
+
getSpan: (row: T, column: TableColumnCtx<T>, rowIndex: number, columnIndex: number) => {
|
|
10
|
+
rowspan: number;
|
|
11
|
+
colspan: number;
|
|
12
|
+
};
|
|
13
|
+
getColspanRealWidth: (columns: TableColumnCtx<T>[], colspan: number, index: number) => number;
|
|
14
|
+
};
|
|
15
|
+
export default useStyles;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { inject as h } from "vue";
|
|
2
|
+
import { useNamespace as w } from "../../../../hooks/use-namespace/index.js";
|
|
3
|
+
import { isFunction as u, isArray as S, isObject as d, isString as m } from "@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 { getFixedColumnsClass as y, getFixedColumnOffset as N, ensurePosition as g } from "../util.js";
|
|
15
|
+
import { TABLE_INJECTION_KEY as p } from "../tokens.js";
|
|
16
|
+
function z(a) {
|
|
17
|
+
const e = h(p), f = w("table");
|
|
18
|
+
return {
|
|
19
|
+
getRowStyle: (r, i) => {
|
|
20
|
+
const l = e == null ? void 0 : e.props.rowStyle;
|
|
21
|
+
return u(l) ? l.call(null, {
|
|
22
|
+
row: r,
|
|
23
|
+
rowIndex: i
|
|
24
|
+
}) : l || null;
|
|
25
|
+
},
|
|
26
|
+
getRowClass: (r, i, l) => {
|
|
27
|
+
var o;
|
|
28
|
+
const s = [f.e("row")];
|
|
29
|
+
e != null && e.props.highlightCurrentRow && r === ((o = a.store) == null ? void 0 : o.states.currentRow.value) && s.push("current-row"), a.stripe && l % 2 === 1 && s.push(f.em("row", "striped"));
|
|
30
|
+
const t = e == null ? void 0 : e.props.rowClassName;
|
|
31
|
+
return m(t) ? s.push(t) : u(t) && s.push(
|
|
32
|
+
t.call(null, {
|
|
33
|
+
row: r,
|
|
34
|
+
rowIndex: i
|
|
35
|
+
})
|
|
36
|
+
), s;
|
|
37
|
+
},
|
|
38
|
+
getCellStyle: (r, i, l, s) => {
|
|
39
|
+
const t = e == null ? void 0 : e.props.cellStyle;
|
|
40
|
+
let o = t ?? {};
|
|
41
|
+
u(t) && (o = t.call(null, {
|
|
42
|
+
rowIndex: r,
|
|
43
|
+
columnIndex: i,
|
|
44
|
+
row: l,
|
|
45
|
+
column: s
|
|
46
|
+
}));
|
|
47
|
+
const n = N(
|
|
48
|
+
i,
|
|
49
|
+
a == null ? void 0 : a.fixed,
|
|
50
|
+
a.store
|
|
51
|
+
);
|
|
52
|
+
return g(n, "left"), g(n, "right"), Object.assign({}, o, n);
|
|
53
|
+
},
|
|
54
|
+
getCellClass: (r, i, l, s, t) => {
|
|
55
|
+
const o = y(
|
|
56
|
+
f.b(),
|
|
57
|
+
i,
|
|
58
|
+
a == null ? void 0 : a.fixed,
|
|
59
|
+
a.store,
|
|
60
|
+
void 0,
|
|
61
|
+
t
|
|
62
|
+
), n = [s.id, s.align, s.className, ...o], c = e == null ? void 0 : e.props.cellClassName;
|
|
63
|
+
return m(c) ? n.push(c) : u(c) && n.push(
|
|
64
|
+
c.call(null, {
|
|
65
|
+
rowIndex: r,
|
|
66
|
+
columnIndex: i,
|
|
67
|
+
row: l,
|
|
68
|
+
column: s
|
|
69
|
+
})
|
|
70
|
+
), n.push(f.e("cell")), n.filter((C) => !!C).join(" ");
|
|
71
|
+
},
|
|
72
|
+
getSpan: (r, i, l, s) => {
|
|
73
|
+
let t = 1, o = 1;
|
|
74
|
+
const n = e == null ? void 0 : e.props.spanMethod;
|
|
75
|
+
if (u(n)) {
|
|
76
|
+
const c = n({
|
|
77
|
+
row: r,
|
|
78
|
+
column: i,
|
|
79
|
+
rowIndex: l,
|
|
80
|
+
columnIndex: s
|
|
81
|
+
});
|
|
82
|
+
S(c) ? (t = c[0], o = c[1]) : d(c) && (t = c.rowspan, o = c.colspan);
|
|
83
|
+
}
|
|
84
|
+
return { rowspan: t, colspan: o };
|
|
85
|
+
},
|
|
86
|
+
getColspanRealWidth: (r, i, l) => {
|
|
87
|
+
if (i < 1)
|
|
88
|
+
return r[l].realWidth;
|
|
89
|
+
const s = r.map(({ realWidth: t, width: o }) => t || o).slice(l, l + i);
|
|
90
|
+
return Number(
|
|
91
|
+
s.reduce((t, o) => Number(t) + Number(o), -1)
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
z as default
|
|
98
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
|
+
colspan: {
|
|
7
|
+
type: NumberConstructor;
|
|
8
|
+
default: number;
|
|
9
|
+
};
|
|
10
|
+
rowspan: {
|
|
11
|
+
type: NumberConstructor;
|
|
12
|
+
default: number;
|
|
13
|
+
};
|
|
14
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
+
colspan: {
|
|
16
|
+
type: NumberConstructor;
|
|
17
|
+
default: number;
|
|
18
|
+
};
|
|
19
|
+
rowspan: {
|
|
20
|
+
type: NumberConstructor;
|
|
21
|
+
default: number;
|
|
22
|
+
};
|
|
23
|
+
}>> & Readonly<{}>, {
|
|
24
|
+
rowspan: number;
|
|
25
|
+
colspan: number;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
27
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineComponent as n, openBlock as o, createElementBlock as t, renderSlot as r } from "vue";
|
|
2
|
+
const p = ["colspan", "rowspan"], c = /* @__PURE__ */ n({
|
|
3
|
+
name: "TableTdWrapper",
|
|
4
|
+
__name: "td-wrapper",
|
|
5
|
+
props: {
|
|
6
|
+
colspan: {
|
|
7
|
+
type: Number,
|
|
8
|
+
default: 1
|
|
9
|
+
},
|
|
10
|
+
rowspan: {
|
|
11
|
+
type: Number,
|
|
12
|
+
default: 1
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
setup(e) {
|
|
16
|
+
return (a, s) => (o(), t("td", {
|
|
17
|
+
colspan: e.colspan,
|
|
18
|
+
rowspan: e.rowspan
|
|
19
|
+
}, [
|
|
20
|
+
r(a.$slots, "default")
|
|
21
|
+
], 8, p));
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
c as default
|
|
26
|
+
};
|