@rhino-design/vue 0.2.7 → 0.2.9
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/README.md +100 -18
- package/README.zh-CN.md +120 -0
- package/dist/arco.less +95 -76
- package/dist/components/XButton.vue.js +2 -2
- package/dist/components/XConfigProvider.vue.js +1 -1
- package/dist/components/XMenuOverflowWrap.vue.js +66 -59
- package/dist/components/XScrollbar.vue.js +1 -1
- package/dist/components/XSubMenuPop.vue.js +1 -1
- package/dist/components/XTable.vue.d.ts +1 -0
- package/dist/components/XTable.vue.js +3 -3
- package/dist/components/XTable.vue2.js +774 -614
- package/dist/components/XToast.vue.d.ts +25 -0
- package/dist/components/XToast.vue.js +7 -0
- package/dist/components/XToast.vue2.js +27 -0
- package/dist/components/XTour.vue.d.ts +2 -0
- package/dist/components/XTour.vue.js +69 -61
- package/dist/components/XTree.vue.d.ts +2 -0
- package/dist/components/XTree.vue.js +1 -1
- package/dist/components/XTree.vue2.js +124 -121
- package/dist/components/XTreeNode.vue.d.ts +1 -0
- package/dist/components/XTreeNode.vue.js +2 -2
- package/dist/components/XTreeNode.vue2.js +21 -20
- package/dist/components/XTreeSelect.vue.js +4 -4
- package/dist/components/XTreeSelect.vue2.js +314 -291
- package/dist/components/XWatermark.vue.js +4 -4
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +55 -53
- package/dist/index.cjs +9 -9
- package/dist/index.css +95 -76
- package/dist/index.js +62 -60
- package/dist/index.less +95 -76
- package/dist/index.scss +14853 -0
- package/dist/style.css +95 -76
- package/dist/style.less +95 -76
- package/dist/style.scss +14853 -0
- package/package.json +9 -43
|
@@ -1,38 +1,43 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
import { defineComponent as jt, computed as p, useSlots as Wt, ref as C, watch as W, onUnmounted as Xt, onMounted as It, nextTick as Gt, openBlock as u, createElementBlock as d, normalizeClass as D, createElementVNode as h, normalizeStyle as k, Fragment as x, renderList as A, createCommentVNode as g, renderSlot as w, createTextVNode as L, toDisplayString as $, withModifiers as ye, createBlock as q, createVNode as Q, withCtx as Y, mergeProps as Ut, unref as Re, resolveDynamicComponent as Jt } from "vue";
|
|
2
|
+
import qt from "./XPagination.vue.js";
|
|
3
|
+
import Qt from "./XEmpty.vue.js";
|
|
4
|
+
import Yt from "./XTooltip.vue.js";
|
|
5
|
+
import lt from "./XTableFilter.vue.js";
|
|
6
|
+
import pe from "./XSkeleton.vue.js";
|
|
7
|
+
import { useXConfig as Zt } from "../composables/config.js";
|
|
8
|
+
import { useXConfigProviderSlotRender as el } from "../composables/config-provider.js";
|
|
9
|
+
import { useXI18n as tl } from "../composables/i18n.js";
|
|
10
|
+
const ll = ["rowspan"], nl = ["rowspan"], al = ["rowspan"], sl = ["checked"], ol = { key: 1 }, il = ["colspan", "rowspan", "onClick"], rl = ["data-order", "onClick"], ul = ["onMousedown"], dl = { key: 1 }, cl = ["checked"], fl = { key: 1 }, yl = ["onClick"], pl = ["data-order", "onClick"], gl = ["onMousedown"], vl = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "x-table__skeleton-body"
|
|
13
|
+
}, hl = { class: "x-table__skeleton-shell" }, kl = { key: 2 }, bl = ["colspan"], ml = ["draggable", "onClick", "onDragstart", "onDragover", "onDrop"], xl = ["onClick"], wl = {
|
|
10
14
|
key: 0,
|
|
11
15
|
class: "x-table__loading-icon"
|
|
12
|
-
},
|
|
16
|
+
}, Sl = { key: 1 }, Cl = ["type", "checked", "disabled", "onChange"], $l = ["onClick"], _l = { class: "x-table__cell-content is-ellipsis" }, Rl = {
|
|
13
17
|
key: 0,
|
|
14
18
|
class: "x-table__expanded-row"
|
|
15
|
-
},
|
|
19
|
+
}, Dl = ["colspan"], Ml = ["colspan"], Ll = { key: 3 }, Tl = ["colspan"], Pl = { key: 4 }, zl = {
|
|
16
20
|
key: 0,
|
|
17
21
|
class: "x-table__drag-col"
|
|
18
|
-
},
|
|
22
|
+
}, El = {
|
|
19
23
|
key: 1,
|
|
20
24
|
class: "x-table__expand-col"
|
|
21
|
-
},
|
|
25
|
+
}, Kl = {
|
|
22
26
|
key: 2,
|
|
23
27
|
class: "x-table__selection-col"
|
|
24
|
-
},
|
|
28
|
+
}, Nl = {
|
|
25
29
|
key: 0,
|
|
26
30
|
class: "x-table__loading"
|
|
27
|
-
},
|
|
31
|
+
}, Al = {
|
|
28
32
|
key: 1,
|
|
29
33
|
class: "x-table__pagination"
|
|
30
|
-
},
|
|
34
|
+
}, Bl = 5, Hl = 1e3, Jl = /* @__PURE__ */ jt({
|
|
31
35
|
__name: "XTable",
|
|
32
36
|
props: {
|
|
33
37
|
columns: {},
|
|
34
38
|
data: {},
|
|
35
39
|
loading: { type: Boolean, default: !1 },
|
|
40
|
+
loadingAnimation: { type: Boolean, default: !0 },
|
|
36
41
|
pagination: { type: [Boolean, Object], default: !1 },
|
|
37
42
|
rowSelection: { default: void 0 },
|
|
38
43
|
expandable: { default: void 0 },
|
|
@@ -62,13 +67,13 @@ const jt = ["rowspan"], Vt = ["rowspan"], Wt = ["rowspan"], Xt = ["checked"], It
|
|
|
62
67
|
filterIconAlignLeft: { type: Boolean, default: !1 }
|
|
63
68
|
},
|
|
64
69
|
emits: ["update:selectedRowKeys", "update:expandedRowKeys", "select", "selectAll", "sort", "filter", "expand", "pageChange", "pageSizeChange", "rowClick", "cellClick", "headerClick", "resizeColumn", "change", "drag"],
|
|
65
|
-
setup(
|
|
66
|
-
var
|
|
67
|
-
function
|
|
70
|
+
setup(c, { emit: nt }) {
|
|
71
|
+
var Ze, et;
|
|
72
|
+
function V(e) {
|
|
68
73
|
if (!(e == null || e === ""))
|
|
69
74
|
return typeof e == "number" ? `${e}px` : e;
|
|
70
75
|
}
|
|
71
|
-
function
|
|
76
|
+
function ge(e) {
|
|
72
77
|
if (typeof e == "number") return e;
|
|
73
78
|
if (typeof e == "string") {
|
|
74
79
|
const l = Number.parseFloat(e);
|
|
@@ -76,160 +81,198 @@ const jt = ["rowspan"], Vt = ["rowspan"], Wt = ["rowspan"], Xt = ["checked"], It
|
|
|
76
81
|
}
|
|
77
82
|
return 160;
|
|
78
83
|
}
|
|
79
|
-
function
|
|
84
|
+
function De(e, l) {
|
|
80
85
|
return e === l || e == null && l == null ? !0 : e == null || l == null ? !1 : String(e) === String(l);
|
|
81
86
|
}
|
|
82
|
-
function
|
|
87
|
+
function at(e, l) {
|
|
83
88
|
const t = e.key == null ? "" : String(e.key).trim();
|
|
84
89
|
if (t) return t;
|
|
85
|
-
const
|
|
86
|
-
return
|
|
90
|
+
const n = e.dataIndex == null ? "" : String(e.dataIndex).trim();
|
|
91
|
+
return n || `col-${l.join("-")}`;
|
|
87
92
|
}
|
|
88
|
-
function
|
|
89
|
-
return e.map((t,
|
|
90
|
-
var
|
|
91
|
-
const
|
|
93
|
+
function Z(e, l = []) {
|
|
94
|
+
return e.map((t, n) => {
|
|
95
|
+
var i;
|
|
96
|
+
const s = [...l, n], o = (i = t.children) != null && i.length ? Z(t.children, s) : void 0;
|
|
92
97
|
return {
|
|
93
98
|
...t,
|
|
94
|
-
key:
|
|
95
|
-
children:
|
|
99
|
+
key: at(t, s),
|
|
100
|
+
children: o
|
|
96
101
|
};
|
|
97
102
|
});
|
|
98
103
|
}
|
|
99
|
-
const
|
|
104
|
+
const a = c, ve = p(() => Z(a.columns)), st = Zt(), ot = Wt(), { t: he } = tl(), ke = p(() => a.size ?? st.size.value), it = p(() => a.summaryText === "合计" ? he("table.summaryText", void 0, "合计") : a.summaryText), rt = p(() => a.emptyText === "暂无数据" ? he("table.emptyText", void 0, "暂无数据") : a.emptyText), Me = el(
|
|
100
105
|
"empty",
|
|
101
|
-
|
|
102
|
-
),
|
|
103
|
-
function
|
|
104
|
-
const e =
|
|
105
|
-
var
|
|
106
|
-
for (const
|
|
107
|
-
if ((
|
|
108
|
-
const
|
|
109
|
-
if (
|
|
106
|
+
p(() => ({ component: "table" }))
|
|
107
|
+
), S = nt;
|
|
108
|
+
function ut() {
|
|
109
|
+
const e = Z(a.columns), l = (n) => {
|
|
110
|
+
var s;
|
|
111
|
+
for (const o of n) {
|
|
112
|
+
if ((s = o.children) != null && s.length) {
|
|
113
|
+
const i = l(o.children);
|
|
114
|
+
if (i) return i;
|
|
110
115
|
}
|
|
111
|
-
if (
|
|
112
|
-
return { key:
|
|
113
|
-
if (
|
|
114
|
-
return { key:
|
|
116
|
+
if (o.defaultSortOrder)
|
|
117
|
+
return { key: o.key, order: o.defaultSortOrder };
|
|
118
|
+
if (o.sortOrder)
|
|
119
|
+
return { key: o.key, order: o.sortOrder };
|
|
115
120
|
}
|
|
116
121
|
return null;
|
|
117
122
|
}, t = l(e);
|
|
118
123
|
return t || { key: "", order: null };
|
|
119
124
|
}
|
|
120
|
-
function
|
|
121
|
-
const e = {}, l =
|
|
122
|
-
var
|
|
123
|
-
for (const
|
|
124
|
-
(
|
|
125
|
+
function dt() {
|
|
126
|
+
const e = {}, l = Z(a.columns), t = (n) => {
|
|
127
|
+
var s;
|
|
128
|
+
for (const o of n)
|
|
129
|
+
(s = o.children) != null && s.length && t(o.children), o.defaultFilteredValue ? e[o.key] = o.defaultFilteredValue.map(String) : o.filteredValue && (e[o.key] = o.filteredValue.map(String));
|
|
125
130
|
};
|
|
126
131
|
return t(l), e;
|
|
127
132
|
}
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
133
|
+
const R = C(ut()), E = C(dt()), X = C(1), ee = C(10), be = C((Ze = a.rowSelection) != null && Ze.defaultSelectedRowKeys ? [...a.rowSelection.defaultSelectedRowKeys] : []), te = C((et = a.expandable) != null && et.defaultExpandedRowKeys ? [...a.expandable.defaultExpandedRowKeys] : []), le = C(null), B = C({}), me = C(/* @__PURE__ */ new Set()), j = C(), Le = C(), ne = C(!1), K = C({ isDragging: !1, dragIndex: -1, dropIndex: -1 }), F = C(a.loading), Te = C(a.loading ? Date.now() : 0);
|
|
134
|
+
let I;
|
|
135
|
+
function Pe() {
|
|
136
|
+
I !== void 0 && (clearTimeout(I), I = void 0);
|
|
137
|
+
}
|
|
138
|
+
function ct() {
|
|
139
|
+
const e = Date.now() - Te.value;
|
|
140
|
+
return Math.max(0, Hl - e);
|
|
141
|
+
}
|
|
142
|
+
function ze(e) {
|
|
143
|
+
if (Pe(), e) {
|
|
144
|
+
Te.value = Date.now(), F.value = !0;
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (!F.value) return;
|
|
148
|
+
const l = ct();
|
|
149
|
+
if (l === 0) {
|
|
150
|
+
F.value = !1;
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
I = setTimeout(() => {
|
|
154
|
+
F.value = !1, I = void 0;
|
|
155
|
+
}, l);
|
|
156
|
+
}
|
|
157
|
+
W(
|
|
158
|
+
() => a.loading,
|
|
159
|
+
(e) => {
|
|
160
|
+
ze(e);
|
|
161
|
+
},
|
|
162
|
+
{ immediate: !0 }
|
|
163
|
+
), W(
|
|
164
|
+
() => a.loadingAnimation,
|
|
165
|
+
() => {
|
|
166
|
+
a.loading || ze(!1);
|
|
167
|
+
}
|
|
168
|
+
), Xt(() => {
|
|
169
|
+
Pe();
|
|
170
|
+
});
|
|
171
|
+
const ae = C(0), Ee = C(0), Ke = C(0);
|
|
172
|
+
W(
|
|
173
|
+
() => a.pagination,
|
|
131
174
|
(e) => {
|
|
132
|
-
e && typeof e == "object" && (
|
|
175
|
+
e && typeof e == "object" && (X.value = e.current ?? X.value, ee.value = e.pageSize ?? ee.value);
|
|
133
176
|
},
|
|
134
177
|
{ immediate: !0 }
|
|
135
|
-
),
|
|
178
|
+
), W(
|
|
136
179
|
() => {
|
|
137
180
|
var e;
|
|
138
|
-
return (e =
|
|
181
|
+
return (e = a.rowSelection) == null ? void 0 : e.selectedRowKeys;
|
|
139
182
|
},
|
|
140
183
|
(e) => {
|
|
141
|
-
e !== void 0 && (
|
|
184
|
+
e !== void 0 && (be.value = [...e]);
|
|
142
185
|
},
|
|
143
186
|
{ immediate: !0 }
|
|
144
|
-
),
|
|
187
|
+
), W(
|
|
145
188
|
() => {
|
|
146
189
|
var e;
|
|
147
|
-
return (e =
|
|
190
|
+
return (e = a.expandable) == null ? void 0 : e.expandedRowKeys;
|
|
148
191
|
},
|
|
149
192
|
(e) => {
|
|
150
|
-
e !== void 0 && (
|
|
193
|
+
e !== void 0 && (te.value = [...e]);
|
|
151
194
|
},
|
|
152
195
|
{ immediate: !0 }
|
|
153
|
-
),
|
|
154
|
-
if (
|
|
196
|
+
), It(() => {
|
|
197
|
+
if (a.virtualListProps && j.value && _e(), a.defaultExpandAllRows && a.treeData) {
|
|
155
198
|
const e = [], l = (t) => {
|
|
156
|
-
t.forEach((
|
|
157
|
-
const
|
|
158
|
-
e.push(
|
|
159
|
-
const
|
|
160
|
-
|
|
199
|
+
t.forEach((n, s) => {
|
|
200
|
+
const o = P(n, s);
|
|
201
|
+
e.push(o);
|
|
202
|
+
const i = n[a.childrenColumnName] || [];
|
|
203
|
+
i.length > 0 && l(i);
|
|
161
204
|
});
|
|
162
205
|
};
|
|
163
|
-
l(
|
|
206
|
+
l(a.data), te.value = e;
|
|
164
207
|
}
|
|
165
208
|
});
|
|
166
209
|
function P(e, l) {
|
|
167
|
-
return typeof
|
|
210
|
+
return typeof a.rowKey == "function" ? a.rowKey(e, l) : e[a.rowKey] ?? l;
|
|
168
211
|
}
|
|
169
|
-
function
|
|
170
|
-
return l.dataIndex ? typeof l.dataIndex == "string" && l.dataIndex.includes(".") ? l.dataIndex.split(".").reduce((t,
|
|
212
|
+
function _(e, l) {
|
|
213
|
+
return l.dataIndex ? typeof l.dataIndex == "string" && l.dataIndex.includes(".") ? l.dataIndex.split(".").reduce((t, n) => t == null ? void 0 : t[n], e) : e[l.dataIndex] : "";
|
|
171
214
|
}
|
|
172
|
-
const
|
|
215
|
+
const H = p(() => a.pagination === !1 ? null : a.pagination === !0 ? {} : a.pagination ?? null), N = p(() => {
|
|
173
216
|
var e;
|
|
174
|
-
return ((e =
|
|
175
|
-
}),
|
|
217
|
+
return ((e = a.rowSelection) == null ? void 0 : e.selectedRowKeys) ?? be.value;
|
|
218
|
+
}), se = p(() => {
|
|
176
219
|
var e;
|
|
177
|
-
return ((e =
|
|
178
|
-
}),
|
|
220
|
+
return ((e = a.expandable) == null ? void 0 : e.expandedRowKeys) ?? te.value;
|
|
221
|
+
}), ft = p(() => {
|
|
179
222
|
var e;
|
|
180
|
-
return typeof
|
|
181
|
-
}),
|
|
223
|
+
return typeof a.bordered == "boolean" ? a.bordered : ((e = a.bordered) == null ? void 0 : e.wrapper) ?? !1;
|
|
224
|
+
}), xe = p(() => {
|
|
182
225
|
var e;
|
|
183
|
-
return typeof
|
|
184
|
-
}),
|
|
226
|
+
return typeof a.bordered == "boolean" ? a.bordered : ((e = a.bordered) == null ? void 0 : e.cell) ?? !1;
|
|
227
|
+
}), Ne = p(() => {
|
|
185
228
|
var e;
|
|
186
|
-
return typeof
|
|
187
|
-
}),
|
|
229
|
+
return typeof a.bordered == "boolean" ? a.bordered : ((e = a.bordered) == null ? void 0 : e.headerCell) ?? !1;
|
|
230
|
+
}), b = p(() => {
|
|
188
231
|
const e = [], l = (t) => {
|
|
189
|
-
t.forEach((
|
|
190
|
-
|
|
232
|
+
t.forEach((n) => {
|
|
233
|
+
n.children && n.children.length > 0 ? l(n.children) : e.push(n);
|
|
191
234
|
});
|
|
192
235
|
};
|
|
193
|
-
return l(
|
|
194
|
-
}),
|
|
195
|
-
let e = [...
|
|
236
|
+
return l(ve.value), e;
|
|
237
|
+
}), yt = p(() => {
|
|
238
|
+
let e = [...a.data];
|
|
196
239
|
return Object.entries(E.value).forEach(([l, t]) => {
|
|
197
240
|
if (t.length > 0) {
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
const
|
|
201
|
-
return t.some((
|
|
241
|
+
const n = b.value.find((s) => s.key === l);
|
|
242
|
+
n && (e = e.filter((s) => {
|
|
243
|
+
const o = String(_(s, n));
|
|
244
|
+
return t.some((i) => o.includes(String(i)));
|
|
202
245
|
}));
|
|
203
246
|
}
|
|
204
247
|
}), e;
|
|
205
|
-
}),
|
|
206
|
-
const e = [...
|
|
207
|
-
if (!l || !
|
|
208
|
-
const t =
|
|
209
|
-
return e.sort((
|
|
248
|
+
}), O = p(() => {
|
|
249
|
+
const e = [...yt.value], l = b.value.find((n) => n.key === R.value.key);
|
|
250
|
+
if (!l || !R.value.order) return e;
|
|
251
|
+
const t = R.value.order === "ascend" ? 1 : -1;
|
|
252
|
+
return e.sort((n, s) => {
|
|
210
253
|
if (typeof l.sorter == "function")
|
|
211
|
-
return l.sorter(
|
|
212
|
-
const
|
|
213
|
-
return
|
|
254
|
+
return l.sorter(n, s) * t;
|
|
255
|
+
const o = _(n, l), i = _(s, l);
|
|
256
|
+
return o === i ? 0 : (String(o) > String(i) ? 1 : -1) * t;
|
|
214
257
|
});
|
|
215
258
|
});
|
|
216
|
-
function
|
|
259
|
+
function Ae(e, l) {
|
|
217
260
|
const t = [];
|
|
218
|
-
return e.forEach((
|
|
219
|
-
const
|
|
220
|
-
record:
|
|
221
|
-
index:
|
|
222
|
-
key:
|
|
223
|
-
level:
|
|
224
|
-
hasChildren:
|
|
225
|
-
expanded:
|
|
261
|
+
return e.forEach((n, s) => {
|
|
262
|
+
const o = P(n, s), i = n[a.childrenColumnName] || [], y = n.isLeaf === !0, f = i.length > 0 || !y && !!a.loadMore, v = se.value.includes(o), r = l ? l.level + 1 : 0, m = {
|
|
263
|
+
record: n,
|
|
264
|
+
index: s,
|
|
265
|
+
key: o,
|
|
266
|
+
level: r,
|
|
267
|
+
hasChildren: f,
|
|
268
|
+
expanded: v,
|
|
226
269
|
parent: l,
|
|
227
|
-
loading:
|
|
270
|
+
loading: me.value.has(o)
|
|
228
271
|
};
|
|
229
|
-
t.push(
|
|
272
|
+
t.push(m), v && i.length > 0 && t.push(...Ae(i, m));
|
|
230
273
|
}), t;
|
|
231
274
|
}
|
|
232
|
-
const
|
|
275
|
+
const M = p(() => a.treeData ? Ae(O.value) : O.value.map((e, l) => ({
|
|
233
276
|
record: e,
|
|
234
277
|
index: l,
|
|
235
278
|
key: P(e, l),
|
|
@@ -237,626 +280,743 @@ const jt = ["rowspan"], Vt = ["rowspan"], Wt = ["rowspan"], Xt = ["checked"], It
|
|
|
237
280
|
hasChildren: !1,
|
|
238
281
|
expanded: !1
|
|
239
282
|
})));
|
|
240
|
-
|
|
241
|
-
() =>
|
|
283
|
+
W(
|
|
284
|
+
() => M.value.length,
|
|
242
285
|
() => {
|
|
243
|
-
|
|
286
|
+
a.virtualListProps && Gt(() => _e());
|
|
244
287
|
}
|
|
245
288
|
);
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
-
if (!
|
|
250
|
-
return
|
|
251
|
-
const e =
|
|
252
|
-
return
|
|
253
|
-
...
|
|
254
|
-
_virtualIndex: l +
|
|
289
|
+
const G = p(() => ke.value === "small" ? 40 : ke.value === "large" ? 56 : 48), pt = p(() => a.virtualListProps ? typeof a.virtualListProps.height == "number" ? a.virtualListProps.height : parseInt(a.virtualListProps.height) : 0);
|
|
290
|
+
p(() => M.value.length * G.value);
|
|
291
|
+
const Be = p(() => {
|
|
292
|
+
if (!a.virtualListProps)
|
|
293
|
+
return M.value;
|
|
294
|
+
const e = a.virtualListProps.buffer ?? 5, l = Math.max(0, ae.value - e), t = Math.min(M.value.length, Ee.value + e);
|
|
295
|
+
return M.value.slice(l, t).map((n, s) => ({
|
|
296
|
+
...n,
|
|
297
|
+
_virtualIndex: l + s
|
|
255
298
|
}));
|
|
256
|
-
}),
|
|
257
|
-
if (!
|
|
258
|
-
const e =
|
|
259
|
-
return Math.max(0,
|
|
260
|
-
}),
|
|
261
|
-
if (!
|
|
262
|
-
const e =
|
|
263
|
-
return (
|
|
264
|
-
}),
|
|
265
|
-
if (
|
|
266
|
-
if (!
|
|
267
|
-
const e = (
|
|
268
|
-
return
|
|
269
|
-
}),
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
299
|
+
}), He = p(() => {
|
|
300
|
+
if (!a.virtualListProps) return 0;
|
|
301
|
+
const e = a.virtualListProps.buffer ?? 5;
|
|
302
|
+
return Math.max(0, ae.value - e) * G.value;
|
|
303
|
+
}), Fe = p(() => {
|
|
304
|
+
if (!a.virtualListProps) return 0;
|
|
305
|
+
const e = a.virtualListProps.buffer ?? 5, l = Math.max(0, ae.value - e);
|
|
306
|
+
return (M.value.length - Be.value.length - l) * G.value;
|
|
307
|
+
}), oe = p(() => X.value), U = p(() => ee.value), z = p(() => {
|
|
308
|
+
if (a.virtualListProps) return Be.value;
|
|
309
|
+
if (!H.value) return M.value;
|
|
310
|
+
const e = (oe.value - 1) * U.value;
|
|
311
|
+
return M.value.slice(e, e + U.value);
|
|
312
|
+
}), gt = p(() => F.value), vt = p(() => typeof ot.loading == "function"), ht = p(() => F.value && vt.value);
|
|
313
|
+
function kt(e, l) {
|
|
314
|
+
const t = B.value[e.key] || e.width;
|
|
315
|
+
if (typeof t == "number")
|
|
316
|
+
return `${Math.round(Math.max(36, Math.min(180, t * 0.6)))}px`;
|
|
317
|
+
if (typeof t == "string") {
|
|
318
|
+
const o = Number.parseFloat(t);
|
|
319
|
+
if (Number.isFinite(o))
|
|
320
|
+
return t.trim().endsWith("%") ? `${Math.max(28, Math.min(82, Math.round(o * 0.6)))}%` : `${Math.round(Math.max(36, Math.min(180, o * 0.6)))}px`;
|
|
321
|
+
}
|
|
322
|
+
const n = `${e.key}-${l}`;
|
|
323
|
+
let s = 0;
|
|
324
|
+
for (let o = 0; o < n.length; o += 1)
|
|
325
|
+
s = (s + n.charCodeAt(o)) % 997;
|
|
326
|
+
return `${34 + s % 28}%`;
|
|
327
|
+
}
|
|
328
|
+
const ie = p(() => {
|
|
329
|
+
let e = b.value.length;
|
|
330
|
+
return a.rowSelection && e++, (a.expandable || a.treeData) && e++, a.draggable && e++, e;
|
|
331
|
+
}), bt = p(() => {
|
|
273
332
|
var e;
|
|
274
|
-
return { minWidth:
|
|
275
|
-
}),
|
|
333
|
+
return { minWidth: V((e = a.scroll) == null ? void 0 : e.x) };
|
|
334
|
+
}), mt = p(() => {
|
|
276
335
|
var l, t;
|
|
277
336
|
const e = {};
|
|
278
|
-
return (l =
|
|
279
|
-
}),
|
|
337
|
+
return (l = a.scroll) != null && l.y && (e.maxHeight = V((t = a.scroll) == null ? void 0 : t.y)), a.virtualListProps && (e.height = V(a.virtualListProps.height), e.overflow = "auto"), e;
|
|
338
|
+
}), we = p(() => b.value.some((e) => e.fixed === "left")), xt = p(() => b.value.some((e) => e.fixed === "right")), Oe = p(() => {
|
|
280
339
|
const e = {}, l = {};
|
|
281
340
|
let t = 0;
|
|
282
|
-
|
|
283
|
-
let
|
|
284
|
-
return
|
|
285
|
-
|
|
286
|
-
}), [...
|
|
287
|
-
|
|
341
|
+
we.value && (a.draggable && (t += 40), (a.expandable || a.treeData) && (t += 52), a.rowSelection && (t += 52));
|
|
342
|
+
let n = 0;
|
|
343
|
+
return b.value.forEach((s) => {
|
|
344
|
+
s.fixed === "left" && (e[s.key] = t, t += ge(B.value[s.key] || s.width));
|
|
345
|
+
}), [...b.value].reverse().forEach((s) => {
|
|
346
|
+
s.fixed === "right" && (l[s.key] = n, n += ge(B.value[s.key] || s.width));
|
|
288
347
|
}), { left: e, right: l };
|
|
289
|
-
}),
|
|
290
|
-
if (
|
|
291
|
-
if (!
|
|
292
|
-
const e = (
|
|
293
|
-
return
|
|
294
|
-
}),
|
|
295
|
-
() => !!(
|
|
296
|
-
),
|
|
297
|
-
() =>
|
|
348
|
+
}), re = p(() => {
|
|
349
|
+
if (a.virtualListProps) return M.value.map((l) => l.key);
|
|
350
|
+
if (!H.value) return M.value.map((l) => l.key);
|
|
351
|
+
const e = (oe.value - 1) * U.value;
|
|
352
|
+
return M.value.slice(e, e + U.value).map((l) => l.key);
|
|
353
|
+
}), Se = p(
|
|
354
|
+
() => !!(a.rowSelection && a.rowSelection.type !== "radio" && re.value.length && re.value.every((e) => N.value.includes(e)))
|
|
355
|
+
), wt = p(
|
|
356
|
+
() => re.value.some((e) => N.value.includes(e)) && !Se.value
|
|
298
357
|
);
|
|
299
|
-
function
|
|
300
|
-
return typeof
|
|
358
|
+
function St(e, l) {
|
|
359
|
+
return typeof a.rowClass == "function" ? a.rowClass(e, l) : a.rowClass;
|
|
301
360
|
}
|
|
302
|
-
function
|
|
303
|
-
const t =
|
|
361
|
+
function ue(e, l = !1) {
|
|
362
|
+
const t = B.value[e.key] || e.width, n = {
|
|
304
363
|
textAlign: e.align || "left",
|
|
305
|
-
width:
|
|
306
|
-
minWidth:
|
|
307
|
-
maxWidth:
|
|
364
|
+
width: V(t),
|
|
365
|
+
minWidth: V(e.minWidth || t),
|
|
366
|
+
maxWidth: V(e.maxWidth)
|
|
308
367
|
};
|
|
309
|
-
return e.fixed === "left" && (
|
|
368
|
+
return e.fixed === "left" && (n.position = "sticky", n.left = `${Oe.value.left[e.key] ?? 0}px`, n.zIndex = l ? "5" : "3"), e.fixed === "right" && (n.position = "sticky", n.right = `${Oe.value.right[e.key] ?? 0}px`, n.zIndex = l ? "5" : "3"), n;
|
|
310
369
|
}
|
|
311
|
-
function
|
|
312
|
-
if (!
|
|
370
|
+
function T(e, l = !1) {
|
|
371
|
+
if (!we.value && e !== "drag") return;
|
|
313
372
|
let t = 0;
|
|
314
|
-
return e === "drag" &&
|
|
373
|
+
return e === "drag" && a.draggable ? t = 0 : e === "expand" ? t = a.draggable ? 40 : 0 : e === "selection" && (t = (a.draggable ? 40 : 0) + (a.expandable || a.treeData ? 52 : 0)), {
|
|
315
374
|
position: "sticky",
|
|
316
375
|
left: `${t}px`,
|
|
317
376
|
zIndex: l ? "6" : "4"
|
|
318
377
|
};
|
|
319
378
|
}
|
|
320
|
-
function
|
|
379
|
+
function Ve(e) {
|
|
321
380
|
if (!e.sorter) return;
|
|
322
|
-
const l =
|
|
323
|
-
|
|
381
|
+
const l = R.value.key !== e.key ? "ascend" : R.value.order === "ascend" ? "descend" : R.value.order === "descend" ? null : "ascend";
|
|
382
|
+
R.value = { key: e.key, order: l }, S("sort", e.key, l), S("change", O.value, { type: "sort", sorter: { field: e.key, order: l } });
|
|
324
383
|
}
|
|
325
|
-
function
|
|
384
|
+
function de(e, l) {
|
|
326
385
|
E.value = {
|
|
327
386
|
...E.value,
|
|
328
387
|
[l]: e
|
|
329
|
-
},
|
|
388
|
+
}, X.value = 1, S("filter", E.value), S("change", O.value, { type: "filter", filters: E.value });
|
|
330
389
|
}
|
|
331
|
-
function
|
|
332
|
-
var t,
|
|
333
|
-
((t =
|
|
334
|
-
const l =
|
|
335
|
-
|
|
390
|
+
function ce(e) {
|
|
391
|
+
var t, n, s;
|
|
392
|
+
((t = a.rowSelection) == null ? void 0 : t.selectedRowKeys) === void 0 && (be.value = e), S("update:selectedRowKeys", e);
|
|
393
|
+
const l = a.data.filter((o, i) => e.includes(P(o, i)));
|
|
394
|
+
S("select", e, l), (s = (n = a.rowSelection) == null ? void 0 : n.onChange) == null || s.call(n, e, l);
|
|
336
395
|
}
|
|
337
|
-
function
|
|
396
|
+
function Ce(e) {
|
|
338
397
|
const l = [];
|
|
339
|
-
return (e[
|
|
340
|
-
const
|
|
341
|
-
l.push(
|
|
398
|
+
return (e[a.childrenColumnName] || []).forEach((n, s) => {
|
|
399
|
+
const o = P(n, s);
|
|
400
|
+
l.push(o), l.push(...Ce(n));
|
|
342
401
|
}), l;
|
|
343
402
|
}
|
|
344
|
-
function
|
|
345
|
-
if (!
|
|
346
|
-
const l = (t,
|
|
347
|
-
for (const
|
|
348
|
-
const
|
|
349
|
-
if (
|
|
350
|
-
const
|
|
351
|
-
if (
|
|
403
|
+
function je(e) {
|
|
404
|
+
if (!a.treeData) return;
|
|
405
|
+
const l = (t, n) => {
|
|
406
|
+
for (const s of t) {
|
|
407
|
+
const o = s[a.childrenColumnName] || [];
|
|
408
|
+
if (o.includes(n)) return s;
|
|
409
|
+
const i = l(o, n);
|
|
410
|
+
if (i) return i;
|
|
352
411
|
}
|
|
353
412
|
};
|
|
354
|
-
return l(
|
|
413
|
+
return l(a.data, e);
|
|
355
414
|
}
|
|
356
|
-
function
|
|
357
|
-
var
|
|
358
|
-
const
|
|
359
|
-
if ((
|
|
415
|
+
function Ct(e, l, t) {
|
|
416
|
+
var o, i, y;
|
|
417
|
+
const n = P(e, l);
|
|
418
|
+
if ((o = a.rowSelection) != null && o.getCheckboxProps && a.rowSelection.getCheckboxProps(e).disabled)
|
|
360
419
|
return;
|
|
361
|
-
if (((
|
|
362
|
-
|
|
420
|
+
if (((i = a.rowSelection) == null ? void 0 : i.type) === "radio") {
|
|
421
|
+
ce(t ? [n] : []);
|
|
363
422
|
return;
|
|
364
423
|
}
|
|
365
|
-
const
|
|
366
|
-
if (
|
|
367
|
-
let
|
|
368
|
-
t ? (
|
|
369
|
-
let
|
|
370
|
-
for (;
|
|
371
|
-
const
|
|
372
|
-
(
|
|
373
|
-
const
|
|
374
|
-
return
|
|
375
|
-
}) ?
|
|
424
|
+
const s = ((y = a.rowSelection) == null ? void 0 : y.checkStrictly) !== !1;
|
|
425
|
+
if (a.treeData && s) {
|
|
426
|
+
let f = new Set(N.value);
|
|
427
|
+
t ? (f.add(n), Ce(e).forEach((m) => f.add(m))) : (f.delete(n), Ce(e).forEach((m) => f.delete(m)));
|
|
428
|
+
let v = je(e);
|
|
429
|
+
for (; v; ) {
|
|
430
|
+
const r = P(v, a.data.indexOf(v));
|
|
431
|
+
(v[a.childrenColumnName] || []).every((tt) => {
|
|
432
|
+
const Vt = P(tt, a.data.indexOf(tt));
|
|
433
|
+
return f.has(Vt);
|
|
434
|
+
}) ? f.add(r) : f.delete(r), v = je(v);
|
|
376
435
|
}
|
|
377
|
-
|
|
436
|
+
ce([...f]);
|
|
378
437
|
} else {
|
|
379
|
-
const
|
|
380
|
-
|
|
438
|
+
const f = t ? [.../* @__PURE__ */ new Set([...N.value, n])] : N.value.filter((v) => v !== n);
|
|
439
|
+
ce(f);
|
|
381
440
|
}
|
|
382
441
|
}
|
|
383
|
-
function
|
|
384
|
-
const l =
|
|
385
|
-
|
|
442
|
+
function We(e) {
|
|
443
|
+
const l = re.value, t = e ? [.../* @__PURE__ */ new Set([...N.value, ...l])] : N.value.filter((n) => !l.includes(n));
|
|
444
|
+
ce(t), S("selectAll", t, z.value.map((n) => n.record));
|
|
386
445
|
}
|
|
387
|
-
function
|
|
388
|
-
e instanceof HTMLInputElement && (e.indeterminate =
|
|
446
|
+
function Xe(e) {
|
|
447
|
+
e instanceof HTMLInputElement && (e.indeterminate = wt.value);
|
|
389
448
|
}
|
|
390
|
-
function
|
|
391
|
-
return
|
|
449
|
+
function J(e, l) {
|
|
450
|
+
return se.value.includes(P(e, l));
|
|
392
451
|
}
|
|
393
|
-
function
|
|
394
|
-
if (
|
|
395
|
-
const l = e[
|
|
396
|
-
return l.length > 0 ||
|
|
452
|
+
function Ie(e) {
|
|
453
|
+
if (a.treeData) {
|
|
454
|
+
const l = e[a.childrenColumnName] || [], t = e.isLeaf === !0;
|
|
455
|
+
return l.length > 0 || a.loadMore && !t;
|
|
397
456
|
}
|
|
398
|
-
return
|
|
457
|
+
return a.expandable ? a.expandable.rowExpandable ? a.expandable.rowExpandable(e) : !!(a.expandable.expandedRowRender || !0) : !1;
|
|
399
458
|
}
|
|
400
|
-
function
|
|
401
|
-
var
|
|
402
|
-
if (!
|
|
403
|
-
const t = P(e, l),
|
|
404
|
-
|
|
405
|
-
|
|
459
|
+
function $t(e, l) {
|
|
460
|
+
var i;
|
|
461
|
+
if (!Ie(e)) return;
|
|
462
|
+
const t = P(e, l), n = e[a.childrenColumnName] || [], s = e.isLeaf === !0;
|
|
463
|
+
a.loadMore && n.length === 0 && !s && !J(e, l) && (me.value.add(t), a.loadMore(e, (y) => {
|
|
464
|
+
me.value.delete(t), y && y.length > 0 && (e[a.childrenColumnName] = y);
|
|
406
465
|
}));
|
|
407
|
-
const
|
|
408
|
-
((
|
|
466
|
+
const o = J(e, l) ? se.value.filter((y) => y !== t) : [...se.value, t];
|
|
467
|
+
((i = a.expandable) == null ? void 0 : i.expandedRowKeys) === void 0 && (te.value = o), S("update:expandedRowKeys", o), S("expand", o, t);
|
|
409
468
|
}
|
|
410
|
-
function
|
|
411
|
-
|
|
469
|
+
function Ge(e, l) {
|
|
470
|
+
X.value = e, ee.value = l, S("pageChange", e, l), S("pageSizeChange", l), S("change", O.value, { type: "pagination" });
|
|
412
471
|
}
|
|
413
|
-
function
|
|
414
|
-
l.preventDefault(), l.stopPropagation(),
|
|
415
|
-
const t = l.clientX,
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
},
|
|
419
|
-
|
|
472
|
+
function Ue(e, l) {
|
|
473
|
+
l.preventDefault(), l.stopPropagation(), le.value = e;
|
|
474
|
+
const t = l.clientX, n = b.value.find((y) => y.key === e), s = B.value[e] || ge(n == null ? void 0 : n.width), o = (y) => {
|
|
475
|
+
const f = y.clientX - t, v = Math.max(60, s + f);
|
|
476
|
+
B.value = { ...B.value, [e]: v };
|
|
477
|
+
}, i = () => {
|
|
478
|
+
le.value = null, document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", i), S("resizeColumn", e, B.value[e]);
|
|
420
479
|
};
|
|
421
|
-
document.addEventListener("mousemove",
|
|
480
|
+
document.addEventListener("mousemove", o), document.addEventListener("mouseup", i);
|
|
422
481
|
}
|
|
423
|
-
function
|
|
424
|
-
if (
|
|
425
|
-
const
|
|
426
|
-
if (
|
|
482
|
+
function $e(e, l, t, n) {
|
|
483
|
+
if (a.spanMethod) {
|
|
484
|
+
const y = a.spanMethod({ record: t, column: n, rowIndex: e, columnIndex: l });
|
|
485
|
+
if (y)
|
|
427
486
|
return {
|
|
428
|
-
rowspan:
|
|
429
|
-
colspan:
|
|
487
|
+
rowspan: y.rowspan ?? 1,
|
|
488
|
+
colspan: y.colspan ?? 1,
|
|
430
489
|
skip: !1
|
|
431
490
|
};
|
|
432
491
|
}
|
|
433
|
-
const
|
|
434
|
-
return !
|
|
435
|
-
rowspan: (
|
|
436
|
-
colspan: (
|
|
437
|
-
skip: ((
|
|
492
|
+
const s = `${e}-${n.key}`, o = Rt.value.get(s), i = qe.value.get(s);
|
|
493
|
+
return !o && !i ? { rowspan: 1, colspan: 1, skip: !1 } : {
|
|
494
|
+
rowspan: (o == null ? void 0 : o.rowspan) ?? (i == null ? void 0 : i.rowspan) ?? 1,
|
|
495
|
+
colspan: (i == null ? void 0 : i.colspan) ?? (o == null ? void 0 : o.colspan) ?? 1,
|
|
496
|
+
skip: ((o == null ? void 0 : o.skip) ?? !1) || ((i == null ? void 0 : i.skip) ?? !1)
|
|
438
497
|
};
|
|
439
498
|
}
|
|
440
|
-
function
|
|
441
|
-
const t =
|
|
499
|
+
function Je(e, l) {
|
|
500
|
+
const t = qe.value.get(`${e}-${l.key}`);
|
|
442
501
|
return !!(t && !t.skip && t.colspan > 1);
|
|
443
502
|
}
|
|
444
|
-
function
|
|
445
|
-
if (
|
|
503
|
+
function _t(e, l) {
|
|
504
|
+
if (Je(e, l))
|
|
446
505
|
return { textAlign: "center" };
|
|
447
506
|
}
|
|
448
|
-
const
|
|
507
|
+
const Rt = p(() => {
|
|
449
508
|
var t;
|
|
450
509
|
const e = /* @__PURE__ */ new Map();
|
|
451
|
-
return !((t =
|
|
452
|
-
(
|
|
453
|
-
).forEach((
|
|
454
|
-
const
|
|
455
|
-
if (!
|
|
456
|
-
let
|
|
457
|
-
for (let
|
|
458
|
-
const
|
|
459
|
-
if (
|
|
460
|
-
|
|
510
|
+
return !((t = a.autoMergeColumns) != null && t.length) || !z.value.length || a.autoMergeColumns.filter(
|
|
511
|
+
(n) => b.value.some((s) => s.key === n)
|
|
512
|
+
).forEach((n) => {
|
|
513
|
+
const s = b.value.find((f) => f.key === n);
|
|
514
|
+
if (!s) return;
|
|
515
|
+
let o = 0, i = _(z.value[0].record, s), y = 1;
|
|
516
|
+
for (let f = 1; f <= z.value.length; f++) {
|
|
517
|
+
const v = f < z.value.length ? _(z.value[f].record, s) : void 0;
|
|
518
|
+
if (De(i, v))
|
|
519
|
+
y++;
|
|
461
520
|
else {
|
|
462
|
-
for (let
|
|
463
|
-
const
|
|
464
|
-
e.set(`${
|
|
465
|
-
rowspan:
|
|
521
|
+
for (let r = 0; r < y; r++) {
|
|
522
|
+
const m = o + r;
|
|
523
|
+
e.set(`${m}-${n}`, {
|
|
524
|
+
rowspan: r === 0 ? y : 0,
|
|
466
525
|
colspan: 1,
|
|
467
|
-
skip:
|
|
526
|
+
skip: r !== 0
|
|
468
527
|
});
|
|
469
528
|
}
|
|
470
|
-
|
|
529
|
+
o = f, i = v, y = 1;
|
|
471
530
|
}
|
|
472
531
|
}
|
|
473
532
|
}), e;
|
|
474
|
-
}),
|
|
533
|
+
}), qe = p(() => {
|
|
475
534
|
const e = /* @__PURE__ */ new Map();
|
|
476
|
-
return !
|
|
477
|
-
let
|
|
478
|
-
if (
|
|
479
|
-
|
|
480
|
-
else if (Array.isArray(
|
|
481
|
-
const
|
|
482
|
-
|
|
535
|
+
return !a.autoMergeRows || !z.value.length || z.value.forEach((l, t) => {
|
|
536
|
+
let n;
|
|
537
|
+
if (a.autoMergeRows === !0)
|
|
538
|
+
n = b.value;
|
|
539
|
+
else if (Array.isArray(a.autoMergeRows)) {
|
|
540
|
+
const y = a.autoMergeRows;
|
|
541
|
+
n = b.value.filter((f) => y.includes(f.key));
|
|
483
542
|
} else
|
|
484
543
|
return;
|
|
485
|
-
if (
|
|
486
|
-
let
|
|
487
|
-
for (let
|
|
488
|
-
const
|
|
489
|
-
if (
|
|
490
|
-
|
|
544
|
+
if (n.length < 2) return;
|
|
545
|
+
let s = 0, o = _(l.record, n[0]), i = 1;
|
|
546
|
+
for (let y = 1; y <= n.length; y++) {
|
|
547
|
+
const f = n[y], v = f ? _(l.record, f) : void 0;
|
|
548
|
+
if (De(o, v))
|
|
549
|
+
i++;
|
|
491
550
|
else {
|
|
492
|
-
for (let
|
|
493
|
-
const
|
|
494
|
-
e.set(`${t}-${
|
|
551
|
+
for (let r = 0; r < i; r++) {
|
|
552
|
+
const m = n[s + r].key;
|
|
553
|
+
e.set(`${t}-${m}`, {
|
|
495
554
|
rowspan: 1,
|
|
496
|
-
colspan:
|
|
497
|
-
skip:
|
|
555
|
+
colspan: r === 0 ? i : 0,
|
|
556
|
+
skip: r !== 0
|
|
498
557
|
});
|
|
499
558
|
}
|
|
500
|
-
|
|
559
|
+
s = y, o = v, i = 1;
|
|
501
560
|
}
|
|
502
561
|
}
|
|
503
562
|
}), e;
|
|
504
563
|
});
|
|
505
|
-
function
|
|
506
|
-
if (
|
|
564
|
+
function Dt() {
|
|
565
|
+
if (a.stickyHeader === !1 || a.stickyHeader === void 0 || a.stickyHeader === null || !j.value || !Le.value)
|
|
507
566
|
return;
|
|
508
|
-
const l = j.value.scrollTop, t = typeof
|
|
509
|
-
|
|
567
|
+
const l = j.value.scrollTop, t = typeof a.stickyHeader == "number" ? a.stickyHeader : 0;
|
|
568
|
+
ne.value = l > t;
|
|
510
569
|
}
|
|
511
|
-
function
|
|
512
|
-
if (!
|
|
570
|
+
function _e() {
|
|
571
|
+
if (!a.virtualListProps || !j.value) return;
|
|
513
572
|
const e = j.value;
|
|
514
|
-
|
|
515
|
-
const l = Math.floor(
|
|
516
|
-
|
|
573
|
+
Ke.value = e.scrollTop;
|
|
574
|
+
const l = Math.floor(Ke.value / G.value), t = Math.ceil(pt.value / G.value);
|
|
575
|
+
ae.value = l, Ee.value = Math.min(l + t, M.value.length);
|
|
517
576
|
}
|
|
518
|
-
function
|
|
519
|
-
|
|
577
|
+
function Mt() {
|
|
578
|
+
Dt(), _e();
|
|
520
579
|
}
|
|
521
|
-
function
|
|
522
|
-
|
|
580
|
+
function Lt(e, l) {
|
|
581
|
+
a.draggable && (K.value.isDragging = !0, K.value.dragIndex = e, l.dataTransfer && (l.dataTransfer.effectAllowed = "move", l.dataTransfer.setData("text/plain", String(e))));
|
|
523
582
|
}
|
|
524
|
-
function
|
|
525
|
-
!
|
|
583
|
+
function Tt(e, l) {
|
|
584
|
+
!a.draggable || !K.value.isDragging || (l.preventDefault(), K.value.dropIndex = e);
|
|
526
585
|
}
|
|
527
|
-
function
|
|
528
|
-
if (!
|
|
586
|
+
function Pt(e, l) {
|
|
587
|
+
if (!a.draggable) return;
|
|
529
588
|
l.preventDefault();
|
|
530
|
-
const t = K.value.dragIndex,
|
|
531
|
-
if (t !==
|
|
532
|
-
const
|
|
533
|
-
|
|
589
|
+
const t = K.value.dragIndex, n = e;
|
|
590
|
+
if (t !== n && t >= 0) {
|
|
591
|
+
const s = [...a.data], [o] = s.splice(t, 1);
|
|
592
|
+
s.splice(n, 0, o), S("drag", t, n, s);
|
|
534
593
|
}
|
|
535
594
|
K.value = { isDragging: !1, dragIndex: -1, dropIndex: -1 };
|
|
536
595
|
}
|
|
537
|
-
function
|
|
596
|
+
function zt() {
|
|
538
597
|
K.value = { isDragging: !1, dragIndex: -1, dropIndex: -1 };
|
|
539
598
|
}
|
|
540
|
-
function
|
|
599
|
+
function Et(e, l) {
|
|
541
600
|
if (e.ellipsis && !(typeof e.ellipsis == "object" && e.ellipsis.tooltip === !1))
|
|
542
|
-
return String(
|
|
601
|
+
return String(_(l, e) ?? "");
|
|
543
602
|
}
|
|
544
|
-
function
|
|
603
|
+
function Kt(e) {
|
|
545
604
|
return e.some((l) => l.children && l.children.length > 0);
|
|
546
605
|
}
|
|
547
|
-
function
|
|
606
|
+
function Nt(e) {
|
|
548
607
|
const l = [];
|
|
549
|
-
function t(
|
|
550
|
-
let
|
|
551
|
-
return
|
|
552
|
-
|
|
553
|
-
}),
|
|
608
|
+
function t(o) {
|
|
609
|
+
let i = 0;
|
|
610
|
+
return o.forEach((y) => {
|
|
611
|
+
y.children && y.children.length > 0 && (i = Math.max(i, 1 + t(y.children)));
|
|
612
|
+
}), i;
|
|
554
613
|
}
|
|
555
|
-
const
|
|
556
|
-
function
|
|
557
|
-
l[
|
|
558
|
-
if (
|
|
559
|
-
const
|
|
560
|
-
l[
|
|
614
|
+
const n = t(e);
|
|
615
|
+
function s(o, i) {
|
|
616
|
+
l[i] || (l[i] = []), o.forEach((y) => {
|
|
617
|
+
if (y.children && y.children.length > 0) {
|
|
618
|
+
const f = Qe(y.children);
|
|
619
|
+
l[i].push({ columns: [y], rowSpan: 1, colSpan: f }), s(y.children, i + 1);
|
|
561
620
|
} else
|
|
562
|
-
l[
|
|
621
|
+
l[i].push({ columns: [y], rowSpan: n - i + 1, colSpan: 1 });
|
|
563
622
|
});
|
|
564
623
|
}
|
|
565
|
-
return
|
|
624
|
+
return s(e, 0), l;
|
|
566
625
|
}
|
|
567
|
-
function
|
|
626
|
+
function Qe(e) {
|
|
568
627
|
let l = 0;
|
|
569
628
|
return e.forEach((t) => {
|
|
570
|
-
t.children && t.children.length > 0 ? l +=
|
|
629
|
+
t.children && t.children.length > 0 ? l += Qe(t.children) : l++;
|
|
571
630
|
}), l;
|
|
572
631
|
}
|
|
573
|
-
const
|
|
574
|
-
function
|
|
632
|
+
const At = p(() => Kt(ve.value)), fe = p(() => Nt(ve.value));
|
|
633
|
+
function Bt() {
|
|
575
634
|
var e;
|
|
576
|
-
if (!
|
|
577
|
-
if (
|
|
578
|
-
const l = { [
|
|
579
|
-
return
|
|
635
|
+
if (!a.summary) return [];
|
|
636
|
+
if (a.summary === !0) {
|
|
637
|
+
const l = { [a.rowKey]: "summary" };
|
|
638
|
+
return b.value.forEach((t) => {
|
|
580
639
|
if (t.dataIndex) {
|
|
581
|
-
const
|
|
582
|
-
const
|
|
583
|
-
return
|
|
640
|
+
const n = O.value.reduce((s, o) => {
|
|
641
|
+
const i = Number(_(o, t));
|
|
642
|
+
return s + (isNaN(i) ? 0 : i);
|
|
584
643
|
}, 0);
|
|
585
|
-
l[t.dataIndex] =
|
|
644
|
+
l[t.dataIndex] = n;
|
|
586
645
|
}
|
|
587
|
-
}), l[(e =
|
|
646
|
+
}), l[(e = b.value[0]) == null ? void 0 : e.dataIndex] = a.summaryText, [l];
|
|
588
647
|
}
|
|
589
|
-
return
|
|
648
|
+
return a.summary({ columns: b.value, data: O.value });
|
|
590
649
|
}
|
|
591
|
-
function
|
|
650
|
+
function Ht(e) {
|
|
592
651
|
return !!(e.tooltip || typeof e.ellipsis == "object" && e.ellipsis.tooltip);
|
|
593
652
|
}
|
|
594
|
-
function
|
|
653
|
+
function Ft(e) {
|
|
595
654
|
return typeof e.tooltip == "object" ? e.tooltip.position || "top" : typeof e.ellipsis == "object" && typeof e.ellipsis.tooltip == "object" && e.ellipsis.tooltip.position || "top";
|
|
596
655
|
}
|
|
597
|
-
function
|
|
656
|
+
function Ye(e) {
|
|
598
657
|
var l;
|
|
599
|
-
return (l =
|
|
658
|
+
return (l = a.rowSelection) != null && l.getCheckboxProps ? a.rowSelection.getCheckboxProps(e).disabled ?? !1 : !1;
|
|
600
659
|
}
|
|
601
|
-
return (e, l) => (u(),
|
|
602
|
-
class:
|
|
603
|
-
`x-table--${
|
|
660
|
+
return (e, l) => (u(), d("div", {
|
|
661
|
+
class: D(["x-table", [
|
|
662
|
+
`x-table--${ke.value}`,
|
|
604
663
|
{
|
|
605
|
-
"is-bordered":
|
|
606
|
-
"is-bordered-cell":
|
|
607
|
-
"is-stripe":
|
|
608
|
-
"is-loading":
|
|
609
|
-
"is-hoverable":
|
|
610
|
-
"has-fixed-column":
|
|
611
|
-
"is-sticky-header":
|
|
664
|
+
"is-bordered": ft.value,
|
|
665
|
+
"is-bordered-cell": xe.value,
|
|
666
|
+
"is-stripe": c.stripe,
|
|
667
|
+
"is-loading": F.value,
|
|
668
|
+
"is-hoverable": c.hoverable,
|
|
669
|
+
"has-fixed-column": we.value || xt.value,
|
|
670
|
+
"is-sticky-header": ne.value
|
|
612
671
|
}
|
|
613
672
|
]])
|
|
614
673
|
}, [
|
|
615
|
-
|
|
674
|
+
h("div", {
|
|
616
675
|
ref_key: "tableContainerRef",
|
|
617
676
|
ref: j,
|
|
618
677
|
class: "x-table__container",
|
|
619
|
-
style:
|
|
620
|
-
onScroll:
|
|
678
|
+
style: k(mt.value),
|
|
679
|
+
onScroll: Mt
|
|
621
680
|
}, [
|
|
622
|
-
|
|
623
|
-
style:
|
|
681
|
+
h("table", {
|
|
682
|
+
style: k(bt.value)
|
|
624
683
|
}, [
|
|
625
|
-
|
|
684
|
+
c.showHeader ? (u(), d("thead", {
|
|
626
685
|
key: 0,
|
|
627
686
|
ref_key: "tableHeaderRef",
|
|
628
|
-
ref:
|
|
629
|
-
class:
|
|
630
|
-
style:
|
|
687
|
+
ref: Le,
|
|
688
|
+
class: D({ "is-sticky": ne.value }),
|
|
689
|
+
style: k(ne.value ? { top: c.stickyOffsetTop + "px" } : {})
|
|
631
690
|
}, [
|
|
632
|
-
|
|
633
|
-
|
|
691
|
+
At.value ? (u(!0), d(x, { key: 0 }, A(fe.value, (t, n) => (u(), d("tr", { key: n }, [
|
|
692
|
+
n === 0 && c.draggable ? (u(), d("th", {
|
|
634
693
|
key: 0,
|
|
635
|
-
rowspan:
|
|
694
|
+
rowspan: fe.value.length,
|
|
636
695
|
class: "x-table__drag-col x-table__sticky-helper",
|
|
637
|
-
style:
|
|
638
|
-
}, null, 12,
|
|
639
|
-
|
|
696
|
+
style: k(T("drag", !0))
|
|
697
|
+
}, null, 12, ll)) : g("", !0),
|
|
698
|
+
n === 0 && (c.expandable || c.treeData) ? (u(), d("th", {
|
|
640
699
|
key: 1,
|
|
641
|
-
rowspan:
|
|
700
|
+
rowspan: fe.value.length,
|
|
642
701
|
class: "x-table__expand-col x-table__sticky-helper",
|
|
643
|
-
style:
|
|
702
|
+
style: k(T("expand", !0))
|
|
644
703
|
}, [
|
|
645
|
-
|
|
646
|
-
var
|
|
704
|
+
w(e.$slots, "expand-title", {}, () => {
|
|
705
|
+
var s;
|
|
647
706
|
return [
|
|
648
|
-
|
|
707
|
+
L($((s = c.expandable) == null ? void 0 : s.columnTitle), 1)
|
|
649
708
|
];
|
|
650
709
|
}, !0)
|
|
651
|
-
], 12,
|
|
652
|
-
|
|
710
|
+
], 12, nl)) : g("", !0),
|
|
711
|
+
n === 0 && c.rowSelection ? (u(), d("th", {
|
|
653
712
|
key: 2,
|
|
654
|
-
rowspan:
|
|
713
|
+
rowspan: fe.value.length,
|
|
655
714
|
class: "x-table__selection-col x-table__sticky-helper",
|
|
656
|
-
style:
|
|
715
|
+
style: k(T("selection", !0))
|
|
657
716
|
}, [
|
|
658
|
-
|
|
717
|
+
c.rowSelection.type !== "radio" && c.rowSelection.showCheckedAll !== !1 ? (u(), d("input", {
|
|
659
718
|
key: 0,
|
|
660
719
|
ref_for: !0,
|
|
661
|
-
ref:
|
|
720
|
+
ref: Xe,
|
|
662
721
|
type: "checkbox",
|
|
663
|
-
checked:
|
|
664
|
-
onChange: l[0] || (l[0] = (
|
|
665
|
-
}, null, 40,
|
|
666
|
-
], 12,
|
|
667
|
-
(u(!0),
|
|
668
|
-
key: `${
|
|
669
|
-
class:
|
|
670
|
-
style:
|
|
671
|
-
colspan:
|
|
672
|
-
rowspan:
|
|
673
|
-
onClick: (
|
|
722
|
+
checked: Se.value,
|
|
723
|
+
onChange: l[0] || (l[0] = (s) => We(s.target.checked))
|
|
724
|
+
}, null, 40, sl)) : c.rowSelection.columnTitle ? (u(), d("span", ol, $(c.rowSelection.columnTitle), 1)) : g("", !0)
|
|
725
|
+
], 12, al)) : g("", !0),
|
|
726
|
+
(u(!0), d(x, null, A(t, (s, o) => (u(), d("th", {
|
|
727
|
+
key: `${n}-${o}`,
|
|
728
|
+
class: D(["x-table__cell", [s.columns[0].headerClassName, { "is-fixed-left": s.columns[0].fixed === "left", "is-fixed-right": s.columns[0].fixed === "right", "is-bordered": Ne.value }]]),
|
|
729
|
+
style: k(ue(s.columns[0], !0)),
|
|
730
|
+
colspan: s.colSpan,
|
|
731
|
+
rowspan: s.rowSpan,
|
|
732
|
+
onClick: (i) => S("headerClick", s.columns[0])
|
|
674
733
|
}, [
|
|
675
|
-
|
|
676
|
-
class:
|
|
734
|
+
h("div", {
|
|
735
|
+
class: D(["x-table__header-cell", { "filter-left": c.filterIconAlignLeft }])
|
|
677
736
|
}, [
|
|
678
|
-
|
|
679
|
-
column:
|
|
680
|
-
title:
|
|
737
|
+
w(e.$slots, `header-${s.columns[0].titleSlotName || s.columns[0].key}`, {
|
|
738
|
+
column: s.columns[0],
|
|
739
|
+
title: s.columns[0].title
|
|
681
740
|
}, () => [
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
], 64)) : (u(),
|
|
685
|
-
|
|
741
|
+
s.columns[0].headerCellRender ? (u(), d(x, { key: 0 }, [
|
|
742
|
+
L($(s.columns[0].headerCellRender({ column: s.columns[0], title: s.columns[0].title })), 1)
|
|
743
|
+
], 64)) : (u(), d(x, { key: 1 }, [
|
|
744
|
+
L($(s.columns[0].title), 1)
|
|
686
745
|
], 64))
|
|
687
746
|
], !0),
|
|
688
|
-
|
|
747
|
+
s.columns[0].sorter ? (u(), d("button", {
|
|
689
748
|
key: 0,
|
|
690
749
|
type: "button",
|
|
691
|
-
class:
|
|
692
|
-
"data-order":
|
|
693
|
-
onClick:
|
|
750
|
+
class: D(["x-table__sorter", { "is-active": R.value.key === s.columns[0].key && R.value.order }]),
|
|
751
|
+
"data-order": R.value.key === s.columns[0].key ? R.value.order : null,
|
|
752
|
+
onClick: ye((i) => Ve(s.columns[0]), ["stop"])
|
|
694
753
|
}, [...l[4] || (l[4] = [
|
|
695
|
-
|
|
696
|
-
])], 10,
|
|
697
|
-
|
|
698
|
-
column:
|
|
699
|
-
filterState: E.value[
|
|
700
|
-
setFilter: (
|
|
754
|
+
h("span", { class: "x-table__sort-indicator" }, null, -1)
|
|
755
|
+
])], 10, rl)) : g("", !0),
|
|
756
|
+
w(e.$slots, `filter-${s.columns[0].key}`, {
|
|
757
|
+
column: s.columns[0],
|
|
758
|
+
filterState: E.value[s.columns[0].key],
|
|
759
|
+
setFilter: (i) => de(i, s.columns[0].key)
|
|
701
760
|
}, () => {
|
|
702
|
-
var
|
|
761
|
+
var i;
|
|
703
762
|
return [
|
|
704
|
-
(
|
|
763
|
+
(i = s.columns[0].filters) != null && i.length ? (u(), q(lt, {
|
|
705
764
|
key: 0,
|
|
706
|
-
options:
|
|
707
|
-
value: E.value[
|
|
708
|
-
multiple:
|
|
709
|
-
"column-key":
|
|
710
|
-
"align-left":
|
|
711
|
-
onChange:
|
|
765
|
+
options: s.columns[0].filters,
|
|
766
|
+
value: E.value[s.columns[0].key] || [],
|
|
767
|
+
multiple: s.columns[0].filterMultiple !== !1,
|
|
768
|
+
"column-key": s.columns[0].key,
|
|
769
|
+
"align-left": c.filterIconAlignLeft,
|
|
770
|
+
onChange: de
|
|
712
771
|
}, null, 8, ["options", "value", "multiple", "column-key", "align-left"])) : g("", !0)
|
|
713
772
|
];
|
|
714
773
|
}, !0)
|
|
715
774
|
], 2),
|
|
716
|
-
|
|
775
|
+
s.rowSpan > 1 || !s.columns[0].children ? (u(), d("div", {
|
|
717
776
|
key: 0,
|
|
718
|
-
class:
|
|
719
|
-
onMousedown: (
|
|
720
|
-
}, null, 42,
|
|
721
|
-
], 14,
|
|
722
|
-
]))), 128)) : (u(),
|
|
723
|
-
|
|
777
|
+
class: D(["x-table__resize-handle", { "is-resizing": le.value === s.columns[0].key }]),
|
|
778
|
+
onMousedown: (i) => Ue(s.columns[0].key, i)
|
|
779
|
+
}, null, 42, ul)) : g("", !0)
|
|
780
|
+
], 14, il))), 128))
|
|
781
|
+
]))), 128)) : (u(), d("tr", dl, [
|
|
782
|
+
c.draggable ? (u(), d("th", {
|
|
724
783
|
key: 0,
|
|
725
784
|
class: "x-table__drag-col x-table__sticky-helper",
|
|
726
|
-
style:
|
|
785
|
+
style: k(T("drag", !0))
|
|
727
786
|
}, null, 4)) : g("", !0),
|
|
728
|
-
|
|
787
|
+
c.expandable || c.treeData ? (u(), d("th", {
|
|
729
788
|
key: 1,
|
|
730
789
|
class: "x-table__expand-col x-table__sticky-helper",
|
|
731
|
-
style:
|
|
790
|
+
style: k(T("expand", !0))
|
|
732
791
|
}, [
|
|
733
|
-
|
|
792
|
+
w(e.$slots, "expand-title", {}, () => {
|
|
734
793
|
var t;
|
|
735
794
|
return [
|
|
736
|
-
|
|
795
|
+
L($((t = c.expandable) == null ? void 0 : t.columnTitle), 1)
|
|
737
796
|
];
|
|
738
797
|
}, !0)
|
|
739
798
|
], 4)) : g("", !0),
|
|
740
|
-
|
|
799
|
+
c.rowSelection ? (u(), d("th", {
|
|
741
800
|
key: 2,
|
|
742
801
|
class: "x-table__selection-col x-table__sticky-helper",
|
|
743
|
-
style:
|
|
802
|
+
style: k(T("selection", !0))
|
|
744
803
|
}, [
|
|
745
|
-
|
|
804
|
+
c.rowSelection.type !== "radio" && c.rowSelection.showCheckedAll !== !1 ? (u(), d("input", {
|
|
746
805
|
key: 0,
|
|
747
|
-
ref:
|
|
806
|
+
ref: Xe,
|
|
748
807
|
type: "checkbox",
|
|
749
|
-
checked:
|
|
750
|
-
onChange: l[1] || (l[1] = (t) =>
|
|
751
|
-
}, null, 40,
|
|
808
|
+
checked: Se.value,
|
|
809
|
+
onChange: l[1] || (l[1] = (t) => We(t.target.checked))
|
|
810
|
+
}, null, 40, cl)) : c.rowSelection.columnTitle ? (u(), d("span", fl, $(c.rowSelection.columnTitle), 1)) : g("", !0)
|
|
752
811
|
], 4)) : g("", !0),
|
|
753
|
-
(u(!0),
|
|
812
|
+
(u(!0), d(x, null, A(b.value, (t) => (u(), d("th", {
|
|
754
813
|
key: t.key,
|
|
755
|
-
class:
|
|
756
|
-
style:
|
|
757
|
-
onClick: (
|
|
814
|
+
class: D(["x-table__cell", [t.headerClassName, { "is-fixed-left": t.fixed === "left", "is-fixed-right": t.fixed === "right", "is-bordered": Ne.value }]]),
|
|
815
|
+
style: k(ue(t, !0)),
|
|
816
|
+
onClick: (n) => S("headerClick", t)
|
|
758
817
|
}, [
|
|
759
|
-
|
|
760
|
-
class:
|
|
818
|
+
h("div", {
|
|
819
|
+
class: D(["x-table__header-cell", { "filter-left": c.filterIconAlignLeft }])
|
|
761
820
|
}, [
|
|
762
|
-
|
|
821
|
+
w(e.$slots, `header-${t.titleSlotName || t.key}`, {
|
|
763
822
|
column: t,
|
|
764
823
|
title: t.title
|
|
765
824
|
}, () => [
|
|
766
|
-
t.headerCellRender ? (u(),
|
|
767
|
-
|
|
768
|
-
], 64)) : (u(),
|
|
769
|
-
|
|
825
|
+
t.headerCellRender ? (u(), d(x, { key: 0 }, [
|
|
826
|
+
L($(t.headerCellRender({ column: t, title: t.title })), 1)
|
|
827
|
+
], 64)) : (u(), d(x, { key: 1 }, [
|
|
828
|
+
L($(t.title), 1)
|
|
770
829
|
], 64))
|
|
771
830
|
], !0),
|
|
772
|
-
t.sorter ? (u(),
|
|
831
|
+
t.sorter ? (u(), d("button", {
|
|
773
832
|
key: 0,
|
|
774
833
|
type: "button",
|
|
775
|
-
class:
|
|
776
|
-
"data-order":
|
|
777
|
-
onClick:
|
|
834
|
+
class: D(["x-table__sorter", { "is-active": R.value.key === t.key && R.value.order }]),
|
|
835
|
+
"data-order": R.value.key === t.key ? R.value.order : null,
|
|
836
|
+
onClick: ye((n) => Ve(t), ["stop"])
|
|
778
837
|
}, [...l[5] || (l[5] = [
|
|
779
|
-
|
|
780
|
-
])], 10,
|
|
781
|
-
|
|
838
|
+
h("span", { class: "x-table__sort-indicator" }, null, -1)
|
|
839
|
+
])], 10, pl)) : g("", !0),
|
|
840
|
+
w(e.$slots, `filter-${t.key}`, {
|
|
782
841
|
column: t,
|
|
783
842
|
filterState: E.value[t.key],
|
|
784
|
-
setFilter: (
|
|
843
|
+
setFilter: (n) => de(n, t.key)
|
|
785
844
|
}, () => {
|
|
786
|
-
var
|
|
845
|
+
var n;
|
|
787
846
|
return [
|
|
788
|
-
(
|
|
847
|
+
(n = t.filters) != null && n.length ? (u(), q(lt, {
|
|
789
848
|
key: 0,
|
|
790
849
|
options: t.filters,
|
|
791
850
|
value: E.value[t.key] || [],
|
|
792
851
|
multiple: t.filterMultiple !== !1,
|
|
793
852
|
"column-key": t.key,
|
|
794
|
-
"align-left":
|
|
795
|
-
onChange:
|
|
853
|
+
"align-left": c.filterIconAlignLeft,
|
|
854
|
+
onChange: de
|
|
796
855
|
}, null, 8, ["options", "value", "multiple", "column-key", "align-left"])) : g("", !0)
|
|
797
856
|
];
|
|
798
857
|
}, !0)
|
|
799
858
|
], 2),
|
|
800
|
-
|
|
801
|
-
class:
|
|
802
|
-
onMousedown: (
|
|
803
|
-
}, null, 42,
|
|
804
|
-
], 14,
|
|
859
|
+
h("div", {
|
|
860
|
+
class: D(["x-table__resize-handle", { "is-resizing": le.value === t.key }]),
|
|
861
|
+
onMousedown: (n) => Ue(t.key, n)
|
|
862
|
+
}, null, 42, gl)
|
|
863
|
+
], 14, yl))), 128))
|
|
805
864
|
]))
|
|
806
865
|
], 6)) : g("", !0),
|
|
807
|
-
|
|
808
|
-
|
|
866
|
+
gt.value ? (u(), d("tbody", vl, [
|
|
867
|
+
(u(), d(x, null, A(Bl, (t) => h("tr", {
|
|
868
|
+
key: `skeleton-row-${t}`,
|
|
869
|
+
class: "x-table__row x-table__skeleton-row"
|
|
870
|
+
}, [
|
|
871
|
+
c.draggable ? (u(), d("td", {
|
|
872
|
+
key: 0,
|
|
873
|
+
class: "x-table__drag-col x-table__sticky-helper x-table__skeleton-side",
|
|
874
|
+
style: k(T("drag"))
|
|
875
|
+
}, [
|
|
876
|
+
Q(pe, {
|
|
877
|
+
loading: !0,
|
|
878
|
+
animation: c.loadingAnimation,
|
|
879
|
+
title: !1,
|
|
880
|
+
rows: 1
|
|
881
|
+
}, {
|
|
882
|
+
default: Y(() => [...l[6] || (l[6] = [
|
|
883
|
+
h("div", { class: "x-table__skeleton-shell" }, [
|
|
884
|
+
h("div", {
|
|
885
|
+
class: "x-table__skeleton-block",
|
|
886
|
+
style: { width: "24px" }
|
|
887
|
+
})
|
|
888
|
+
], -1)
|
|
889
|
+
])]),
|
|
890
|
+
_: 1
|
|
891
|
+
}, 8, ["animation"])
|
|
892
|
+
], 4)) : g("", !0),
|
|
893
|
+
c.expandable || c.treeData ? (u(), d("td", {
|
|
894
|
+
key: 1,
|
|
895
|
+
class: "x-table__expand-col x-table__sticky-helper x-table__skeleton-side",
|
|
896
|
+
style: k(T("expand"))
|
|
897
|
+
}, [
|
|
898
|
+
Q(pe, {
|
|
899
|
+
loading: !0,
|
|
900
|
+
animation: c.loadingAnimation,
|
|
901
|
+
title: !1,
|
|
902
|
+
rows: 1
|
|
903
|
+
}, {
|
|
904
|
+
default: Y(() => [...l[7] || (l[7] = [
|
|
905
|
+
h("div", { class: "x-table__skeleton-shell" }, [
|
|
906
|
+
h("div", {
|
|
907
|
+
class: "x-table__skeleton-block",
|
|
908
|
+
style: { width: "24px" }
|
|
909
|
+
})
|
|
910
|
+
], -1)
|
|
911
|
+
])]),
|
|
912
|
+
_: 1
|
|
913
|
+
}, 8, ["animation"])
|
|
914
|
+
], 4)) : g("", !0),
|
|
915
|
+
c.rowSelection ? (u(), d("td", {
|
|
916
|
+
key: 2,
|
|
917
|
+
class: "x-table__selection-col x-table__sticky-helper x-table__skeleton-side",
|
|
918
|
+
style: k(T("selection"))
|
|
919
|
+
}, [
|
|
920
|
+
Q(pe, {
|
|
921
|
+
loading: !0,
|
|
922
|
+
animation: c.loadingAnimation,
|
|
923
|
+
title: !1,
|
|
924
|
+
rows: 1
|
|
925
|
+
}, {
|
|
926
|
+
default: Y(() => [...l[8] || (l[8] = [
|
|
927
|
+
h("div", { class: "x-table__skeleton-shell" }, [
|
|
928
|
+
h("div", {
|
|
929
|
+
class: "x-table__skeleton-block",
|
|
930
|
+
style: { width: "24px" }
|
|
931
|
+
})
|
|
932
|
+
], -1)
|
|
933
|
+
])]),
|
|
934
|
+
_: 1
|
|
935
|
+
}, 8, ["animation"])
|
|
936
|
+
], 4)) : g("", !0),
|
|
937
|
+
(u(!0), d(x, null, A(b.value, (n, s) => (u(), d("td", {
|
|
938
|
+
key: `skeleton-cell-${t}-${n.key}`,
|
|
939
|
+
class: D(["x-table__cell x-table__skeleton-cell", [
|
|
940
|
+
n.className,
|
|
941
|
+
{
|
|
942
|
+
"is-fixed-left": n.fixed === "left",
|
|
943
|
+
"is-fixed-right": n.fixed === "right",
|
|
944
|
+
"is-bordered": xe.value
|
|
945
|
+
}
|
|
946
|
+
]]),
|
|
947
|
+
style: k(ue(n))
|
|
948
|
+
}, [
|
|
949
|
+
Q(pe, {
|
|
950
|
+
loading: !0,
|
|
951
|
+
animation: c.loadingAnimation,
|
|
952
|
+
title: !1,
|
|
953
|
+
rows: 1
|
|
954
|
+
}, {
|
|
955
|
+
default: Y(() => [
|
|
956
|
+
h("div", hl, [
|
|
957
|
+
h("div", {
|
|
958
|
+
class: "x-table__skeleton-block",
|
|
959
|
+
style: k({ width: kt(n, s) })
|
|
960
|
+
}, null, 4)
|
|
961
|
+
])
|
|
962
|
+
]),
|
|
963
|
+
_: 2
|
|
964
|
+
}, 1032, ["animation"])
|
|
965
|
+
], 6))), 128))
|
|
966
|
+
])), 64))
|
|
967
|
+
])) : z.value.length ? (u(), d("tbody", kl, [
|
|
968
|
+
c.virtualListProps && He.value > 0 ? (u(), d("tr", {
|
|
809
969
|
key: 0,
|
|
810
|
-
style:
|
|
970
|
+
style: k({ height: `${He.value}px` })
|
|
811
971
|
}, [
|
|
812
|
-
|
|
813
|
-
colspan:
|
|
972
|
+
h("td", {
|
|
973
|
+
colspan: ie.value,
|
|
814
974
|
style: { padding: 0, border: "none" }
|
|
815
|
-
}, null, 8,
|
|
975
|
+
}, null, 8, bl)
|
|
816
976
|
], 4)) : g("", !0),
|
|
817
|
-
(u(!0),
|
|
818
|
-
key: String(
|
|
977
|
+
(u(!0), d(x, null, A(z.value, ({ record: t, index: n, key: s, level: o, hasChildren: i, loading: y, _virtualIndex: f }, v) => (u(), d(x, {
|
|
978
|
+
key: String(s)
|
|
819
979
|
}, [
|
|
820
|
-
|
|
980
|
+
w(e.$slots, "tr", {
|
|
821
981
|
record: t,
|
|
822
|
-
index:
|
|
982
|
+
index: n
|
|
823
983
|
}, () => [
|
|
824
|
-
|
|
825
|
-
class:
|
|
826
|
-
draggable: !!
|
|
827
|
-
onClick: (
|
|
828
|
-
onDragstart: (
|
|
829
|
-
onDragover: (
|
|
830
|
-
onDrop: (
|
|
831
|
-
onDragend:
|
|
984
|
+
h("tr", {
|
|
985
|
+
class: D(["x-table__row", [St(t, n), { "is-striped": c.stripe && (typeof f == "number" ? f : v) % 2 === 1, "is-dragging": K.value.isDragging && K.value.dragIndex === (typeof f == "number" ? f : v) }]]),
|
|
986
|
+
draggable: !!c.draggable,
|
|
987
|
+
onClick: (r) => S("rowClick", t, n),
|
|
988
|
+
onDragstart: (r) => Lt(typeof f == "number" ? f : v, r),
|
|
989
|
+
onDragover: (r) => Tt(typeof f == "number" ? f : v, r),
|
|
990
|
+
onDrop: (r) => Pt(typeof f == "number" ? f : v, r),
|
|
991
|
+
onDragend: zt
|
|
832
992
|
}, [
|
|
833
|
-
|
|
993
|
+
c.draggable ? (u(), d("td", {
|
|
834
994
|
key: 0,
|
|
835
995
|
class: "x-table__drag-col x-table__sticky-helper",
|
|
836
|
-
style:
|
|
996
|
+
style: k(T("drag"))
|
|
837
997
|
}, [
|
|
838
|
-
|
|
839
|
-
l[
|
|
998
|
+
w(e.$slots, "drag-handle", {}, () => [
|
|
999
|
+
l[9] || (l[9] = h("span", { class: "x-table__drag-icon" }, "⋮⋮", -1))
|
|
840
1000
|
], !0)
|
|
841
1001
|
], 4)) : g("", !0),
|
|
842
|
-
|
|
1002
|
+
c.expandable || c.treeData ? (u(), d("td", {
|
|
843
1003
|
key: 1,
|
|
844
1004
|
class: "x-table__expand-col x-table__sticky-helper",
|
|
845
|
-
style:
|
|
1005
|
+
style: k(T("expand"))
|
|
846
1006
|
}, [
|
|
847
|
-
|
|
1007
|
+
w(e.$slots, "expand-icon", {
|
|
848
1008
|
record: t,
|
|
849
|
-
expanded:
|
|
850
|
-
hasChildren:
|
|
1009
|
+
expanded: J(t, n),
|
|
1010
|
+
hasChildren: i
|
|
851
1011
|
}, () => [
|
|
852
|
-
|
|
1012
|
+
Ie(t) ? (u(), d("button", {
|
|
853
1013
|
key: 0,
|
|
854
1014
|
type: "button",
|
|
855
|
-
class:
|
|
856
|
-
onClick:
|
|
1015
|
+
class: D(["x-table__expand", { "is-loading": y }]),
|
|
1016
|
+
onClick: ye((r) => $t(t, n), ["stop"])
|
|
857
1017
|
}, [
|
|
858
|
-
|
|
859
|
-
|
|
1018
|
+
y ? (u(), d("span", wl, [...l[10] || (l[10] = [
|
|
1019
|
+
h("svg", {
|
|
860
1020
|
viewBox: "0 0 48 48",
|
|
861
1021
|
fill: "none",
|
|
862
1022
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -865,195 +1025,195 @@ const jt = ["rowspan"], Vt = ["rowspan"], Wt = ["rowspan"], Xt = ["checked"], It
|
|
|
865
1025
|
"stroke-linecap": "butt",
|
|
866
1026
|
"stroke-linejoin": "miter"
|
|
867
1027
|
}, [
|
|
868
|
-
|
|
1028
|
+
h("path", { d: "M38.837 18C36.463 12.136 30.715 8 24 8 15.163 8 8 15.163 8 24s7.163 16 16 16c7.455 0 13.72-5.1 15.496-12M40 8v10H30" })
|
|
869
1029
|
], -1)
|
|
870
|
-
])])) : (u(),
|
|
871
|
-
], 10,
|
|
1030
|
+
])])) : (u(), d("span", Sl, $(J(t, n) ? "▾" : "▸"), 1))
|
|
1031
|
+
], 10, xl)) : g("", !0)
|
|
872
1032
|
], !0)
|
|
873
1033
|
], 4)) : g("", !0),
|
|
874
|
-
|
|
1034
|
+
c.rowSelection ? (u(), d("td", {
|
|
875
1035
|
key: 2,
|
|
876
1036
|
class: "x-table__selection-col x-table__sticky-helper",
|
|
877
|
-
style:
|
|
1037
|
+
style: k(T("selection"))
|
|
878
1038
|
}, [
|
|
879
|
-
|
|
1039
|
+
w(e.$slots, "checkbox", {
|
|
880
1040
|
record: t,
|
|
881
|
-
checked: N.value.includes(
|
|
882
|
-
disabled:
|
|
1041
|
+
checked: N.value.includes(s),
|
|
1042
|
+
disabled: Ye(t)
|
|
883
1043
|
}, () => [
|
|
884
|
-
|
|
885
|
-
type:
|
|
886
|
-
checked: N.value.includes(
|
|
887
|
-
disabled:
|
|
888
|
-
onClick: l[2] || (l[2] =
|
|
1044
|
+
h("input", {
|
|
1045
|
+
type: c.rowSelection.type === "radio" ? "radio" : "checkbox",
|
|
1046
|
+
checked: N.value.includes(s),
|
|
1047
|
+
disabled: Ye(t),
|
|
1048
|
+
onClick: l[2] || (l[2] = ye(() => {
|
|
889
1049
|
}, ["stop"])),
|
|
890
|
-
onChange: (
|
|
891
|
-
}, null, 40,
|
|
1050
|
+
onChange: (r) => Ct(t, n, r.target.checked)
|
|
1051
|
+
}, null, 40, Cl)
|
|
892
1052
|
], !0)
|
|
893
1053
|
], 4)) : g("", !0),
|
|
894
|
-
|
|
1054
|
+
w(e.$slots, "td", {
|
|
895
1055
|
record: t,
|
|
896
|
-
index:
|
|
1056
|
+
index: n
|
|
897
1057
|
}, () => [
|
|
898
|
-
(u(!0),
|
|
899
|
-
key:
|
|
1058
|
+
(u(!0), d(x, null, A(b.value, (r, m) => (u(), d(x, {
|
|
1059
|
+
key: r.key
|
|
900
1060
|
}, [
|
|
901
|
-
|
|
1061
|
+
$e(typeof f == "number" ? f : v, m, t, r).skip ? g("", !0) : (u(), d("td", Ut({
|
|
902
1062
|
key: 0,
|
|
903
1063
|
class: ["x-table__cell", [
|
|
904
|
-
|
|
905
|
-
typeof
|
|
1064
|
+
r.className,
|
|
1065
|
+
typeof r.cellClassName == "function" ? r.cellClassName(t) : r.cellClassName,
|
|
906
1066
|
{
|
|
907
|
-
"is-fixed-left":
|
|
908
|
-
"is-fixed-right":
|
|
909
|
-
"is-ellipsis":
|
|
910
|
-
"is-bordered":
|
|
911
|
-
"is-auto-merged-row":
|
|
1067
|
+
"is-fixed-left": r.fixed === "left",
|
|
1068
|
+
"is-fixed-right": r.fixed === "right",
|
|
1069
|
+
"is-ellipsis": r.ellipsis,
|
|
1070
|
+
"is-bordered": xe.value,
|
|
1071
|
+
"is-auto-merged-row": Je(typeof f == "number" ? f : v, r)
|
|
912
1072
|
}
|
|
913
1073
|
]],
|
|
914
1074
|
style: [
|
|
915
|
-
|
|
916
|
-
typeof
|
|
917
|
-
|
|
1075
|
+
ue(r),
|
|
1076
|
+
typeof r.cellStyle == "function" ? r.cellStyle(t) : r.cellStyle,
|
|
1077
|
+
_t(typeof f == "number" ? f : v, r)
|
|
918
1078
|
]
|
|
919
|
-
}, { ref_for: !0 }, { rowspan:
|
|
920
|
-
onClick: (
|
|
1079
|
+
}, { ref_for: !0 }, { rowspan: $e(typeof f == "number" ? f : v, m, t, r).rowspan, colspan: $e(typeof f == "number" ? f : v, m, t, r).colspan }, {
|
|
1080
|
+
onClick: (Ot) => S("cellClick", t, r, n)
|
|
921
1081
|
}), [
|
|
922
|
-
|
|
1082
|
+
c.treeData && m === 0 ? (u(), d("span", {
|
|
923
1083
|
key: 0,
|
|
924
1084
|
class: "x-table__indent",
|
|
925
|
-
style:
|
|
1085
|
+
style: k({ paddingLeft: `${o * c.indentSize}px` })
|
|
926
1086
|
}, null, 4)) : g("", !0),
|
|
927
|
-
|
|
1087
|
+
Ht(r) ? (u(), q(Yt, {
|
|
928
1088
|
key: 1,
|
|
929
|
-
content:
|
|
930
|
-
position:
|
|
1089
|
+
content: Et(r, t),
|
|
1090
|
+
position: Ft(r)
|
|
931
1091
|
}, {
|
|
932
|
-
default:
|
|
933
|
-
|
|
934
|
-
|
|
1092
|
+
default: Y(() => [
|
|
1093
|
+
h("span", _l, [
|
|
1094
|
+
w(e.$slots, r.slotName || `cell-${r.key}`, {
|
|
935
1095
|
record: t,
|
|
936
|
-
column:
|
|
937
|
-
value:
|
|
938
|
-
index:
|
|
1096
|
+
column: r,
|
|
1097
|
+
value: _(t, r),
|
|
1098
|
+
index: n
|
|
939
1099
|
}, () => [
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
], 64)) : (u(),
|
|
943
|
-
|
|
1100
|
+
r.cellRender ? (u(), d(x, { key: 0 }, [
|
|
1101
|
+
L($(r.cellRender({ record: t, column: r, value: _(t, r), index: n })), 1)
|
|
1102
|
+
], 64)) : (u(), d(x, { key: 1 }, [
|
|
1103
|
+
L($(_(t, r)), 1)
|
|
944
1104
|
], 64))
|
|
945
1105
|
], !0)
|
|
946
1106
|
])
|
|
947
1107
|
]),
|
|
948
1108
|
_: 2
|
|
949
|
-
}, 1032, ["content", "position"])) :
|
|
1109
|
+
}, 1032, ["content", "position"])) : w(e.$slots, r.slotName || `cell-${r.key}`, {
|
|
950
1110
|
key: 2,
|
|
951
1111
|
record: t,
|
|
952
|
-
column:
|
|
953
|
-
value:
|
|
954
|
-
index:
|
|
1112
|
+
column: r,
|
|
1113
|
+
value: _(t, r),
|
|
1114
|
+
index: n
|
|
955
1115
|
}, () => [
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
], 64)) : (u(),
|
|
959
|
-
|
|
1116
|
+
r.cellRender ? (u(), d(x, { key: 0 }, [
|
|
1117
|
+
L($(r.cellRender({ record: t, column: r, value: _(t, r), index: n })), 1)
|
|
1118
|
+
], 64)) : (u(), d(x, { key: 1 }, [
|
|
1119
|
+
L($(_(t, r)), 1)
|
|
960
1120
|
], 64))
|
|
961
1121
|
], !0)
|
|
962
|
-
], 16,
|
|
1122
|
+
], 16, $l))
|
|
963
1123
|
], 64))), 128))
|
|
964
1124
|
], !0)
|
|
965
|
-
], 42,
|
|
1125
|
+
], 42, ml)
|
|
966
1126
|
], !0),
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
colspan:
|
|
970
|
-
style:
|
|
1127
|
+
c.expandable && J(t, n) ? (u(), d("tr", Rl, [
|
|
1128
|
+
h("td", {
|
|
1129
|
+
colspan: ie.value,
|
|
1130
|
+
style: k({ paddingLeft: `${(c.expandable.indentSize || 16) + 16}px` })
|
|
971
1131
|
}, [
|
|
972
|
-
|
|
1132
|
+
w(e.$slots, "expand-row", {
|
|
973
1133
|
record: t,
|
|
974
|
-
index:
|
|
1134
|
+
index: n
|
|
975
1135
|
}, () => {
|
|
976
|
-
var
|
|
1136
|
+
var r, m;
|
|
977
1137
|
return [
|
|
978
|
-
|
|
1138
|
+
L($((m = (r = c.expandable) == null ? void 0 : r.expandedRowRender) == null ? void 0 : m.call(r, t, n)), 1)
|
|
979
1139
|
];
|
|
980
1140
|
}, !0)
|
|
981
|
-
], 12,
|
|
1141
|
+
], 12, Dl)
|
|
982
1142
|
])) : g("", !0)
|
|
983
1143
|
], 64))), 128)),
|
|
984
|
-
|
|
1144
|
+
c.virtualListProps && Fe.value > 0 ? (u(), d("tr", {
|
|
985
1145
|
key: 1,
|
|
986
|
-
style:
|
|
1146
|
+
style: k({ height: `${Fe.value}px` })
|
|
987
1147
|
}, [
|
|
988
|
-
|
|
989
|
-
colspan:
|
|
1148
|
+
h("td", {
|
|
1149
|
+
colspan: ie.value,
|
|
990
1150
|
style: { padding: 0, border: "none" }
|
|
991
|
-
}, null, 8,
|
|
1151
|
+
}, null, 8, Ml)
|
|
992
1152
|
], 4)) : g("", !0)
|
|
993
|
-
])) : (u(),
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
colspan:
|
|
1153
|
+
])) : (u(), d("tbody", Ll, [
|
|
1154
|
+
h("tr", null, [
|
|
1155
|
+
h("td", {
|
|
1156
|
+
colspan: ie.value,
|
|
997
1157
|
class: "x-table__empty"
|
|
998
1158
|
}, [
|
|
999
|
-
|
|
1000
|
-
|
|
1159
|
+
w(e.$slots, "empty", {}, () => [
|
|
1160
|
+
Re(Me) ? (u(), q(Jt(Re(Me)), { key: 0 })) : (u(), q(Qt, {
|
|
1001
1161
|
key: 1,
|
|
1002
1162
|
"in-config-provider": "",
|
|
1003
|
-
description:
|
|
1163
|
+
description: rt.value
|
|
1004
1164
|
}, null, 8, ["description"]))
|
|
1005
1165
|
], !0)
|
|
1006
|
-
], 8,
|
|
1166
|
+
], 8, Tl)
|
|
1007
1167
|
])
|
|
1008
1168
|
])),
|
|
1009
|
-
|
|
1010
|
-
(u(!0),
|
|
1011
|
-
key:
|
|
1169
|
+
c.summary ? (u(), d("tfoot", Pl, [
|
|
1170
|
+
(u(!0), d(x, null, A(Bt(), (t, n) => (u(), d("tr", {
|
|
1171
|
+
key: n,
|
|
1012
1172
|
class: "x-table__summary-row"
|
|
1013
1173
|
}, [
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
(u(!0),
|
|
1018
|
-
key:
|
|
1019
|
-
class:
|
|
1174
|
+
c.draggable ? (u(), d("td", zl)) : g("", !0),
|
|
1175
|
+
c.expandable || c.treeData ? (u(), d("td", El)) : g("", !0),
|
|
1176
|
+
c.rowSelection ? (u(), d("td", Kl, $(n === 0 ? it.value : ""), 1)) : g("", !0),
|
|
1177
|
+
(u(!0), d(x, null, A(b.value, (s) => (u(), d("td", {
|
|
1178
|
+
key: s.key,
|
|
1179
|
+
class: D(["x-table__cell", s.className])
|
|
1020
1180
|
}, [
|
|
1021
|
-
|
|
1022
|
-
column:
|
|
1181
|
+
w(e.$slots, "summary-cell", {
|
|
1182
|
+
column: s,
|
|
1023
1183
|
record: t,
|
|
1024
|
-
rowIndex:
|
|
1184
|
+
rowIndex: n
|
|
1025
1185
|
}, () => [
|
|
1026
|
-
|
|
1186
|
+
L($(_(t, s)), 1)
|
|
1027
1187
|
], !0)
|
|
1028
1188
|
], 2))), 128))
|
|
1029
1189
|
]))), 128))
|
|
1030
1190
|
])) : g("", !0)
|
|
1031
1191
|
], 4)
|
|
1032
1192
|
], 36),
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1193
|
+
ht.value ? (u(), d("div", Nl, [
|
|
1194
|
+
w(e.$slots, "loading", {}, () => [
|
|
1195
|
+
L($(Re(he)("table.loadingText", void 0, "加载中...")), 1)
|
|
1036
1196
|
], !0)
|
|
1037
1197
|
])) : g("", !0),
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
current:
|
|
1042
|
-
total:
|
|
1043
|
-
"page-size":
|
|
1044
|
-
"show-total":
|
|
1045
|
-
"show-jumper":
|
|
1046
|
-
"show-page-size":
|
|
1047
|
-
"page-size-options":
|
|
1048
|
-
simple:
|
|
1049
|
-
onChange:
|
|
1050
|
-
onPageSizeChange: l[3] || (l[3] = (t) =>
|
|
1198
|
+
H.value ? (u(), d("div", Al, [
|
|
1199
|
+
w(e.$slots, "pagination-left", {}, void 0, !0),
|
|
1200
|
+
Q(qt, {
|
|
1201
|
+
current: oe.value,
|
|
1202
|
+
total: M.value.length,
|
|
1203
|
+
"page-size": U.value,
|
|
1204
|
+
"show-total": H.value.showTotal,
|
|
1205
|
+
"show-jumper": H.value.showJumper,
|
|
1206
|
+
"show-page-size": H.value.showPageSize,
|
|
1207
|
+
"page-size-options": H.value.pageSizeOptions,
|
|
1208
|
+
simple: H.value.simple,
|
|
1209
|
+
onChange: Ge,
|
|
1210
|
+
onPageSizeChange: l[3] || (l[3] = (t) => Ge(oe.value, t))
|
|
1051
1211
|
}, null, 8, ["current", "total", "page-size", "show-total", "show-jumper", "show-page-size", "page-size-options", "simple"]),
|
|
1052
|
-
|
|
1212
|
+
w(e.$slots, "pagination-right", {}, void 0, !0)
|
|
1053
1213
|
])) : g("", !0)
|
|
1054
1214
|
], 2));
|
|
1055
1215
|
}
|
|
1056
1216
|
});
|
|
1057
1217
|
export {
|
|
1058
|
-
|
|
1218
|
+
Jl as default
|
|
1059
1219
|
};
|