@dazhicheng/ui 1.6.1 → 1.6.3
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/tt-table/src/Table.vue.js +177 -175
- package/dist/components/tt-table/src/hooks/useRowIdentity.d.ts +1 -0
- package/dist/components/tt-table/src/hooks/useRowIdentity.js +66 -53
- package/dist/components/tt-table/src/hooks/useRowSelection.d.ts +3 -1
- package/dist/components/tt-table/src/hooks/useRowSelection.js +66 -65
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { TtErrorTooltip as
|
|
3
|
-
import { useLoading as
|
|
1
|
+
import { defineComponent as It, mergeModels as he, useModel as Vt, useAttrs as Et, useSlots as _t, getCurrentInstance as zt, ref as q, shallowReactive as Dt, onScopeDispose as ye, computed as m, provide as be, unref as e, toRaw as Se, nextTick as J, onMounted as Kt, createElementBlock as g, openBlock as c, normalizeClass as z, createVNode as D, mergeProps as Q, toHandlers as Mt, createSlots as At, withCtx as n, renderSlot as d, createBlock as X, createCommentVNode as K, normalizeStyle as y, createElementVNode as f, normalizeProps as P, guardReactiveProps as M, Fragment as Ft, toDisplayString as Y, renderList as Z, createTextVNode as we, toValue as Lt } from "vue";
|
|
2
|
+
import { TtErrorTooltip as Nt } from "../../tt-form-item-error-tooltip/index.js";
|
|
3
|
+
import { useLoading as Ot } from "../../../hooks/useLoading.js";
|
|
4
4
|
import "../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
|
|
5
|
-
import { useDesign as
|
|
5
|
+
import { useDesign as Ht } from "../../../packages/hooks/src/useDesign.js";
|
|
6
6
|
import "axios";
|
|
7
|
-
import { ElScrollbar as
|
|
7
|
+
import { ElScrollbar as Ce } from "element-plus";
|
|
8
8
|
import "dayjs";
|
|
9
9
|
import "numeral";
|
|
10
|
-
import { extractResourceFromApi as
|
|
10
|
+
import { extractResourceFromApi as Bt, generateTestId as xe } from "../../../packages/utils/src/testid-helper.js";
|
|
11
11
|
import "xe-utils";
|
|
12
12
|
import "dayjs/plugin/utc";
|
|
13
13
|
import "dayjs/plugin/timezone";
|
|
@@ -18,173 +18,175 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-
|
|
|
18
18
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
19
19
|
import { omit as $e } from "lodash-es";
|
|
20
20
|
import "vue-router";
|
|
21
|
-
import { useStore as
|
|
22
|
-
import { VxePager as
|
|
23
|
-
import { VxeGrid as
|
|
24
|
-
import { tableProps as
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import { TtImage as
|
|
29
|
-
import { RowContext as
|
|
30
|
-
import { basicTableEmits as
|
|
31
|
-
import { useColumns as
|
|
32
|
-
import { useGridProps as
|
|
33
|
-
import { useKeyboardNav as
|
|
34
|
-
import { usePagination as
|
|
35
|
-
import { useQuery as
|
|
36
|
-
import { useRowIdentity as
|
|
37
|
-
import { useRowSelection as
|
|
38
|
-
import { useSideSlot as
|
|
39
|
-
import { useSyncProps as
|
|
40
|
-
import { createTableContext as
|
|
41
|
-
import { useTableData as
|
|
42
|
-
import { useTableFooter as
|
|
43
|
-
import { useTableMethods as
|
|
44
|
-
import { tableOtherProps as
|
|
45
|
-
import { forwardedEventEntries as
|
|
46
|
-
import { TableApi as
|
|
47
|
-
const Co = ["data-testid"],
|
|
21
|
+
import { useStore as Gt } from "@tanstack/vue-store";
|
|
22
|
+
import { VxePager as jt } from "vxe-pc-ui";
|
|
23
|
+
import { VxeGrid as Wt } from "vxe-table";
|
|
24
|
+
import { tableProps as Ut } from "vxe-table/es/table/src/props";
|
|
25
|
+
import qt from "../../../assets/svg/paixu-jiangxu.svg.js";
|
|
26
|
+
import Jt from "../../../assets/svg/paixu-moren.svg.js";
|
|
27
|
+
import Qt from "../../../assets/svg/paixu-shengxu.svg.js";
|
|
28
|
+
import { TtImage as Xt } from "../../tt-image/index.js";
|
|
29
|
+
import { RowContext as Yt } from "./components/RowContext.js";
|
|
30
|
+
import { basicTableEmits as Zt } from "./emits.js";
|
|
31
|
+
import { useColumns as eo } from "./hooks/useColumns.js";
|
|
32
|
+
import { useGridProps as to } from "./hooks/useGridProps.js";
|
|
33
|
+
import { useKeyboardNav as oo } from "./hooks/useKeyboardNav.js";
|
|
34
|
+
import { usePagination as ro } from "./hooks/usePagination.js";
|
|
35
|
+
import { useQuery as so } from "./hooks/useQuery.js";
|
|
36
|
+
import { useRowIdentity as lo } from "./hooks/useRowIdentity.js";
|
|
37
|
+
import { useRowSelection as ao } from "./hooks/useRowSelection.js";
|
|
38
|
+
import { useSideSlot as no } from "./hooks/useSideSlot.js";
|
|
39
|
+
import { useSyncProps as io } from "./hooks/useSyncProps.js";
|
|
40
|
+
import { createTableContext as co } from "./hooks/useTableContext.js";
|
|
41
|
+
import { useTableData as po } from "./hooks/useTableData.js";
|
|
42
|
+
import { useTableFooter as mo } from "./hooks/useTableFooter.js";
|
|
43
|
+
import { useTableMethods as uo } from "./hooks/useTableMethods.js";
|
|
44
|
+
import { tableOtherProps as go, tableProps as fo } from "./props.js";
|
|
45
|
+
import { forwardedEventEntries as ho, isDisplayOnlyEvent as yo, isRowDataMutationEvent as bo, getMutationCommitSource as So } from "./table-mutation-events.js";
|
|
46
|
+
import { TableApi as wo } from "./utils/table-api.js";
|
|
47
|
+
const Co = ["data-testid"], xo = ["src"], $o = ["src"], To = ["src"], Ro = {
|
|
48
48
|
style: {
|
|
49
49
|
color: "#009ffa"
|
|
50
50
|
}
|
|
51
|
-
}, Ro = {
|
|
52
|
-
key: 0
|
|
53
51
|
}, ko = {
|
|
52
|
+
key: 0
|
|
53
|
+
}, Po = {
|
|
54
54
|
key: 1
|
|
55
|
-
},
|
|
55
|
+
}, wr = /* @__PURE__ */ It({
|
|
56
56
|
name: "TtTable",
|
|
57
57
|
__name: "Table",
|
|
58
58
|
props: /* @__PURE__ */ he({
|
|
59
|
-
...
|
|
60
|
-
...
|
|
61
|
-
...
|
|
59
|
+
...Ut,
|
|
60
|
+
...fo,
|
|
61
|
+
...go
|
|
62
62
|
}, {
|
|
63
63
|
modelValue: {},
|
|
64
64
|
modelModifiers: {}
|
|
65
65
|
}),
|
|
66
|
-
emits: /* @__PURE__ */ he(["register", "fetch-success", "fetch-error", "selection-change", ...
|
|
66
|
+
emits: /* @__PURE__ */ he(["register", "fetch-success", "fetch-error", "selection-change", ...Zt], ["update:modelValue"]),
|
|
67
67
|
setup(ee, {
|
|
68
68
|
expose: Te,
|
|
69
69
|
emit: Re
|
|
70
70
|
}) {
|
|
71
71
|
var ue, ge;
|
|
72
|
-
const h = ee, ke =
|
|
72
|
+
const h = ee, ke = Vt(ee, "modelValue"), i = Re, te = Et(), A = _t(), C = zt(), {
|
|
73
73
|
prefixCls: b
|
|
74
|
-
} =
|
|
74
|
+
} = Ht("table"), Pe = Object.hasOwn(((ue = C == null ? void 0 : C.vnode) == null ? void 0 : ue.props) || {}, "data"), v = q(null), p = q(), F = q({});
|
|
75
75
|
let s = h.tableApi;
|
|
76
|
-
s || (s = new
|
|
77
|
-
const I =
|
|
76
|
+
s || (s = new wo($e(h, ["modelValue"])), s.useStore = (t) => Gt(s.store, t));
|
|
77
|
+
const I = Dt({});
|
|
78
78
|
function oe() {
|
|
79
79
|
Object.assign(I, Se(s.store.state) || {});
|
|
80
80
|
}
|
|
81
81
|
oe(), ye(s.store.subscribe(oe));
|
|
82
|
-
const l = m(() => I), ve = Pe ? () =>
|
|
82
|
+
const l = m(() => I), ve = Pe ? () => Lt(h.data) : () => I.data, Ie = () => I.api;
|
|
83
83
|
be(`${b}-props`, l);
|
|
84
|
-
const L = m(() => h.testId || (h.api ?
|
|
84
|
+
const L = m(() => h.testId || (h.api ? Bt(h.api) : "table")), Ve = m(() => xe(e(L), "table")), Ee = m(() => xe(e(L), "table-toolbar"));
|
|
85
85
|
be("tableIdContext", L);
|
|
86
86
|
const {
|
|
87
87
|
getLoading: x,
|
|
88
88
|
setLoading: re
|
|
89
|
-
} =
|
|
89
|
+
} = Ot(m(() => e(l).loading || !1)), {
|
|
90
90
|
pagination: $,
|
|
91
91
|
paginationInfo: S,
|
|
92
92
|
getPagination: _e,
|
|
93
93
|
setPagination: N,
|
|
94
94
|
onPageChange: ze
|
|
95
|
-
} =
|
|
95
|
+
} = ro(l, i), {
|
|
96
96
|
getRowKey: De,
|
|
97
|
+
getRowKeys: Ke,
|
|
97
98
|
prepareRows: O,
|
|
98
99
|
toVxeRowConfig: Me
|
|
99
|
-
} =
|
|
100
|
+
} = lo(l), {
|
|
100
101
|
selectedKeys: H,
|
|
101
102
|
selectedRows: B,
|
|
102
|
-
selectedKeyList:
|
|
103
|
-
getSelectRowKeys:
|
|
104
|
-
getSelectRows:
|
|
105
|
-
syncSelection:
|
|
106
|
-
setSelectedRowKeys:
|
|
103
|
+
selectedKeyList: Ae,
|
|
104
|
+
getSelectRowKeys: Fe,
|
|
105
|
+
getSelectRows: Le,
|
|
106
|
+
syncSelection: Ne,
|
|
107
|
+
setSelectedRowKeys: Oe,
|
|
107
108
|
clearSelectedRowKeys: se,
|
|
108
|
-
resetSelectionAfterFetch:
|
|
109
|
-
onCheckboxChange:
|
|
110
|
-
onCheckboxAll:
|
|
111
|
-
onCheckboxRangeChange:
|
|
112
|
-
onRadioChange:
|
|
113
|
-
onCellAreaSelectionEnd:
|
|
114
|
-
} =
|
|
115
|
-
getRowKey: De
|
|
109
|
+
resetSelectionAfterFetch: He,
|
|
110
|
+
onCheckboxChange: Be,
|
|
111
|
+
onCheckboxAll: Ge,
|
|
112
|
+
onCheckboxRangeChange: je,
|
|
113
|
+
onRadioChange: We,
|
|
114
|
+
onCellAreaSelectionEnd: Ue
|
|
115
|
+
} = ao(l, p, i, {
|
|
116
|
+
getRowKey: De,
|
|
117
|
+
getRowKeys: Ke
|
|
116
118
|
}), {
|
|
117
119
|
rows: V,
|
|
118
|
-
applyRows:
|
|
119
|
-
getDataSource:
|
|
120
|
-
runDataOperation:
|
|
120
|
+
applyRows: qe,
|
|
121
|
+
getDataSource: Je,
|
|
122
|
+
runDataOperation: Qe,
|
|
121
123
|
scheduleRowsCommit: G,
|
|
122
|
-
cancelRowsCommit:
|
|
123
|
-
onDataChange:
|
|
124
|
-
createTableInstanceFacade:
|
|
125
|
-
isActive:
|
|
126
|
-
} =
|
|
124
|
+
cancelRowsCommit: Xe,
|
|
125
|
+
onDataChange: Ye,
|
|
126
|
+
createTableInstanceFacade: Ze,
|
|
127
|
+
isActive: et
|
|
128
|
+
} = po(l, p, ke, i, {
|
|
127
129
|
data: ve,
|
|
128
130
|
api: Ie,
|
|
129
131
|
prepareRows: O,
|
|
130
|
-
onSelectionMutated:
|
|
132
|
+
onSelectionMutated: Ne
|
|
131
133
|
}), {
|
|
132
|
-
refresh:
|
|
133
|
-
syncScroll:
|
|
134
|
+
refresh: tt,
|
|
135
|
+
syncScroll: ot,
|
|
134
136
|
rowNodes: le,
|
|
135
137
|
headerHeight: ae,
|
|
136
138
|
bodyHeight: E,
|
|
137
|
-
bodyWrapperHeight:
|
|
139
|
+
bodyWrapperHeight: w,
|
|
138
140
|
bodyOffsetTop: ne,
|
|
139
141
|
bodyScrollHeight: ie,
|
|
140
|
-
leftScrollbarRef:
|
|
141
|
-
rightScrollbarRef:
|
|
142
|
-
} =
|
|
143
|
-
reload:
|
|
142
|
+
leftScrollbarRef: rt,
|
|
143
|
+
rightScrollbarRef: st
|
|
144
|
+
} = no(l, p, V), {
|
|
145
|
+
reload: lt,
|
|
144
146
|
reloadFilter: de,
|
|
145
147
|
isLoaded: ce
|
|
146
|
-
} =
|
|
148
|
+
} = so(l, {
|
|
147
149
|
grid: p,
|
|
148
150
|
pagination: $,
|
|
149
151
|
paginationInfo: S,
|
|
150
152
|
setPagination: N,
|
|
151
153
|
setLoading: re,
|
|
152
|
-
resetSelectionAfterFetch:
|
|
154
|
+
resetSelectionAfterFetch: He,
|
|
153
155
|
rows: V,
|
|
154
|
-
applyRows:
|
|
156
|
+
applyRows: qe
|
|
155
157
|
}, i), {
|
|
156
|
-
gridColumns:
|
|
157
|
-
hasExpandColumn:
|
|
158
|
-
sortIconSlots:
|
|
159
|
-
validSlots:
|
|
160
|
-
setTableColumns:
|
|
161
|
-
getTableColumns:
|
|
162
|
-
onColumnDragend:
|
|
163
|
-
} =
|
|
164
|
-
footerSummaryMethod:
|
|
165
|
-
} =
|
|
158
|
+
gridColumns: at,
|
|
159
|
+
hasExpandColumn: nt,
|
|
160
|
+
sortIconSlots: it,
|
|
161
|
+
validSlots: dt,
|
|
162
|
+
setTableColumns: ct,
|
|
163
|
+
getTableColumns: pt,
|
|
164
|
+
onColumnDragend: mt
|
|
165
|
+
} = eo(l, p, i), {
|
|
166
|
+
footerSummaryMethod: ut
|
|
167
|
+
} = mo(at), {
|
|
166
168
|
bindValues: j,
|
|
167
|
-
gridProps:
|
|
168
|
-
} =
|
|
169
|
+
gridProps: gt
|
|
170
|
+
} = to(l, {
|
|
169
171
|
attrs: te,
|
|
170
172
|
slots: A
|
|
171
173
|
}, {
|
|
172
|
-
hasExpandColumn:
|
|
173
|
-
footerSummaryMethod:
|
|
174
|
+
hasExpandColumn: nt,
|
|
175
|
+
footerSummaryMethod: ut,
|
|
174
176
|
onTreeLoadResolved: G,
|
|
175
177
|
prepareRows: O,
|
|
176
178
|
toVxeRowConfig: Me
|
|
177
179
|
}), {
|
|
178
180
|
onTableKeydown: pe
|
|
179
|
-
} =
|
|
180
|
-
runDataOperation:
|
|
181
|
+
} = oo(v), ft = m(U), ht = uo(l, p, s, {
|
|
182
|
+
runDataOperation: Qe,
|
|
181
183
|
clearSelectedRowKeys: se,
|
|
182
184
|
getTableInstance: U,
|
|
183
|
-
isActive:
|
|
185
|
+
isActive: et,
|
|
184
186
|
prepareRows: O
|
|
185
187
|
});
|
|
186
|
-
|
|
187
|
-
const
|
|
188
|
+
io(h, s.setState, ["tableApi", "formApi", "modelValue"]);
|
|
189
|
+
const yt = m(() => ({
|
|
188
190
|
...e(l).emptyImageStyle
|
|
189
191
|
})), W = m(() => {
|
|
190
192
|
const {
|
|
@@ -194,27 +196,27 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
|
|
|
194
196
|
} = e(l);
|
|
195
197
|
return e(ce) || !t ? o : r;
|
|
196
198
|
}), u = {};
|
|
197
|
-
|
|
199
|
+
ho.forEach(([t, o]) => {
|
|
198
200
|
u[o] = (...r) => {
|
|
199
|
-
t === "data-change" &&
|
|
201
|
+
t === "data-change" && Ye(), yo(t) && Xe(), bo(t, r, () => e(B)) && G(So(t)), i(t, ...r);
|
|
200
202
|
};
|
|
201
203
|
});
|
|
202
|
-
const
|
|
204
|
+
const bt = m(() => ({
|
|
203
205
|
...u,
|
|
204
206
|
headerCellClick: Ct,
|
|
205
|
-
sortChange:
|
|
206
|
-
radioChange:
|
|
207
|
-
checkboxChange:
|
|
208
|
-
checkboxAll:
|
|
209
|
-
checkboxRangeChange:
|
|
210
|
-
cellAreaSelectionEnd:
|
|
211
|
-
columnDragend:
|
|
212
|
-
scroll:
|
|
213
|
-
scrollBoundary:
|
|
214
|
-
toggleRowExpand:
|
|
215
|
-
editClosed:
|
|
207
|
+
sortChange: xt,
|
|
208
|
+
radioChange: We,
|
|
209
|
+
checkboxChange: Be,
|
|
210
|
+
checkboxAll: Ge,
|
|
211
|
+
checkboxRangeChange: je,
|
|
212
|
+
cellAreaSelectionEnd: Ue,
|
|
213
|
+
columnDragend: mt,
|
|
214
|
+
scroll: $t,
|
|
215
|
+
scrollBoundary: Tt,
|
|
216
|
+
toggleRowExpand: Rt,
|
|
217
|
+
editClosed: kt
|
|
216
218
|
}));
|
|
217
|
-
async function
|
|
219
|
+
async function St(t) {
|
|
218
220
|
s.setState(t);
|
|
219
221
|
}
|
|
220
222
|
function me() {
|
|
@@ -223,7 +225,7 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
|
|
|
223
225
|
return (t = e(p)) == null ? void 0 : t.recalculate(!0);
|
|
224
226
|
});
|
|
225
227
|
}
|
|
226
|
-
function
|
|
228
|
+
function wt(t, o) {
|
|
227
229
|
if (t) {
|
|
228
230
|
F.value[o] = t;
|
|
229
231
|
return;
|
|
@@ -244,14 +246,14 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
|
|
|
244
246
|
...$e(r, ["order"])
|
|
245
247
|
});
|
|
246
248
|
}
|
|
247
|
-
function
|
|
249
|
+
function xt(t) {
|
|
248
250
|
var o;
|
|
249
251
|
(o = u.sortChange) == null || o.call(u, t), de("sort");
|
|
250
252
|
}
|
|
251
|
-
function xt(t) {
|
|
252
|
-
i("scroll", t), ((t == null ? void 0 : t.type) === "body" || (t == null ? void 0 : t.type) === "table") && tt(t == null ? void 0 : t.scrollTop);
|
|
253
|
-
}
|
|
254
253
|
function $t(t) {
|
|
254
|
+
i("scroll", t), ((t == null ? void 0 : t.type) === "body" || (t == null ? void 0 : t.type) === "table") && ot(t == null ? void 0 : t.scrollTop);
|
|
255
|
+
}
|
|
256
|
+
function Tt(t) {
|
|
255
257
|
i("scroll-boundary", t);
|
|
256
258
|
const {
|
|
257
259
|
isScrollFetch: o
|
|
@@ -265,52 +267,52 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
|
|
|
265
267
|
currentPage: r + 1
|
|
266
268
|
});
|
|
267
269
|
}
|
|
268
|
-
function Tt(t) {
|
|
269
|
-
i("toggle-row-expand", t), et(!1);
|
|
270
|
-
}
|
|
271
270
|
function Rt(t) {
|
|
271
|
+
i("toggle-row-expand", t), tt(!1);
|
|
272
|
+
}
|
|
273
|
+
function kt(t) {
|
|
272
274
|
G(), i("edit-closed", t);
|
|
273
275
|
}
|
|
274
276
|
function U() {
|
|
275
|
-
return
|
|
277
|
+
return Ze(e(p));
|
|
276
278
|
}
|
|
277
|
-
function
|
|
279
|
+
function Pt(t) {
|
|
278
280
|
return Object.keys(t).filter((o) => o !== "empty");
|
|
279
281
|
}
|
|
280
282
|
const _ = {
|
|
281
|
-
reload:
|
|
282
|
-
setProps:
|
|
283
|
-
setTableColumns:
|
|
283
|
+
reload: lt,
|
|
284
|
+
setProps: St,
|
|
285
|
+
setTableColumns: ct,
|
|
284
286
|
setPagination: N,
|
|
285
287
|
setLoading: re,
|
|
286
288
|
redoHeight: me,
|
|
287
|
-
getDataSource:
|
|
289
|
+
getDataSource: Je,
|
|
288
290
|
getPagination: _e,
|
|
289
|
-
getSelectRowKeys:
|
|
290
|
-
getSelectRows:
|
|
291
|
+
getSelectRowKeys: Fe,
|
|
292
|
+
getSelectRows: Le,
|
|
291
293
|
getTableInstance: U,
|
|
292
294
|
getLoading: x,
|
|
293
|
-
getTableColumns:
|
|
294
|
-
setSelectedRowKeys:
|
|
295
|
+
getTableColumns: pt,
|
|
296
|
+
setSelectedRowKeys: Oe,
|
|
295
297
|
clearSelectedRowKeys: se,
|
|
296
298
|
selectedKeys: H,
|
|
297
299
|
selectedRows: B,
|
|
298
|
-
...
|
|
300
|
+
...ht
|
|
299
301
|
};
|
|
300
|
-
return
|
|
302
|
+
return co({
|
|
301
303
|
..._,
|
|
302
304
|
wrapRef: v,
|
|
303
305
|
getBindValues: j
|
|
304
306
|
}), Te({
|
|
305
307
|
..._,
|
|
306
|
-
xGrid:
|
|
308
|
+
xGrid: ft
|
|
307
309
|
}), (ge = s.bindState) == null || ge.call(s, {
|
|
308
310
|
loading: x,
|
|
309
311
|
selectedKeys: H,
|
|
310
312
|
selectedRows: B
|
|
311
|
-
}),
|
|
313
|
+
}), C && i("register", _, `${C.uid}`), J(() => {
|
|
312
314
|
e(l).autoHeight && me();
|
|
313
|
-
}),
|
|
315
|
+
}), Kt(() => {
|
|
314
316
|
var t;
|
|
315
317
|
(t = s.mount) == null || t.call(s, e(p), _), J(() => {
|
|
316
318
|
var o, r;
|
|
@@ -326,34 +328,34 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
|
|
|
326
328
|
"data-testid": Ve.value,
|
|
327
329
|
onKeydownCapture: o[3] || (o[3] = //@ts-ignore
|
|
328
330
|
(...r) => e(pe) && e(pe)(...r))
|
|
329
|
-
}, [D(e(
|
|
331
|
+
}, [D(e(Wt), Q({
|
|
330
332
|
ref_key: "xGrid",
|
|
331
333
|
ref: p
|
|
332
|
-
}, e(
|
|
334
|
+
}, e(gt), Mt(bt.value), {
|
|
333
335
|
onFilterChange: o[2] || (o[2] = (r) => e(de)())
|
|
334
|
-
}),
|
|
335
|
-
empty: n(() => [d(t.$slots, "empty", P(
|
|
336
|
+
}), At({
|
|
337
|
+
empty: n(() => [d(t.$slots, "empty", P(M({
|
|
336
338
|
isLoaded: e(ce),
|
|
337
339
|
loading: e(x),
|
|
338
340
|
emptyTip: W.value
|
|
339
341
|
})), () => [f("div", {
|
|
340
342
|
class: z(`${e(b)}-empty-image`)
|
|
341
|
-
}, [e(x) ? (c(), g("span",
|
|
343
|
+
}, [e(x) ? (c(), g("span", Po, Y(l.value.emptyText || ""), 1)) : (c(), g(Ft, {
|
|
342
344
|
key: 0
|
|
343
|
-
}, [D(e(
|
|
344
|
-
style: y(
|
|
345
|
+
}, [D(e(Xt), {
|
|
346
|
+
style: y(yt.value),
|
|
345
347
|
status: l.value.emptyImageStatus
|
|
346
|
-
}, null, 8, ["style", "status"]), W.value ? (c(), g("span",
|
|
347
|
-
left: n(() => [d(t.$slots, "left", {}, () => [e(
|
|
348
|
+
}, null, 8, ["style", "status"]), W.value ? (c(), g("span", ko, Y(W.value), 1)) : K("", !0)], 64))], 2)])]),
|
|
349
|
+
left: n(() => [d(t.$slots, "left", {}, () => [e(w) ? (c(), X(e(Ce), {
|
|
348
350
|
key: 0,
|
|
349
351
|
ref_key: "leftScrollbarRef",
|
|
350
|
-
ref:
|
|
352
|
+
ref: rt,
|
|
351
353
|
"wrap-class": "overflow-hidden",
|
|
352
354
|
class: "tt-table-left-right-scroll",
|
|
353
|
-
height: `${e(
|
|
355
|
+
height: `${e(w)}px`,
|
|
354
356
|
style: y({
|
|
355
357
|
width: `${l.value.leftSlotWidth}px`,
|
|
356
|
-
height: `${e(
|
|
358
|
+
height: `${e(w)}px`,
|
|
357
359
|
marginTop: `${e(ae)}px`
|
|
358
360
|
})
|
|
359
361
|
}, {
|
|
@@ -369,23 +371,23 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
|
|
|
369
371
|
height: `${e(E)}px`,
|
|
370
372
|
marginTop: `${e(ne)}px`
|
|
371
373
|
})
|
|
372
|
-
}, [d(t.$slots, "tableLeft", P(
|
|
374
|
+
}, [d(t.$slots, "tableLeft", P(M({
|
|
373
375
|
rowNodes: e(le),
|
|
374
376
|
height: e(E)
|
|
375
377
|
})))], 4)]),
|
|
376
378
|
_: 3
|
|
377
|
-
}, 8, ["height", "style"])) :
|
|
378
|
-
right: n(() => [d(t.$slots, "right", {}, () => [e(
|
|
379
|
+
}, 8, ["height", "style"])) : K("", !0)])]),
|
|
380
|
+
right: n(() => [d(t.$slots, "right", {}, () => [e(w) ? (c(), X(e(Ce), {
|
|
379
381
|
key: 0,
|
|
380
382
|
ref_key: "rightScrollbarRef",
|
|
381
|
-
ref:
|
|
383
|
+
ref: st,
|
|
382
384
|
"wrap-class": "overflow-hidden",
|
|
383
385
|
class: "tt-table-left-right-scroll",
|
|
384
386
|
always: "",
|
|
385
|
-
height: `${e(
|
|
387
|
+
height: `${e(w)}px`,
|
|
386
388
|
style: y({
|
|
387
389
|
width: `${l.value.rightSlotWidth}px`,
|
|
388
|
-
height: `${e(
|
|
390
|
+
height: `${e(w)}px`,
|
|
389
391
|
marginTop: `${e(ae)}px`
|
|
390
392
|
})
|
|
391
393
|
}, {
|
|
@@ -401,14 +403,14 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
|
|
|
401
403
|
height: `${e(E)}px`,
|
|
402
404
|
marginTop: `${e(ne)}px`
|
|
403
405
|
})
|
|
404
|
-
}, [d(t.$slots, "tableRight", P(
|
|
406
|
+
}, [d(t.$slots, "tableRight", P(M({
|
|
405
407
|
rowNodes: e(le),
|
|
406
408
|
height: e(E)
|
|
407
409
|
})))], 4)]),
|
|
408
410
|
_: 3
|
|
409
|
-
}, 8, ["height", "style"])) :
|
|
411
|
+
}, 8, ["height", "style"])) : K("", !0)])]),
|
|
410
412
|
_: 2
|
|
411
|
-
}, [Z(e(
|
|
413
|
+
}, [Z(e(it), (r) => ({
|
|
412
414
|
name: r,
|
|
413
415
|
fn: n(({
|
|
414
416
|
column: a
|
|
@@ -419,17 +421,17 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
|
|
|
419
421
|
}])
|
|
420
422
|
}, [a.order === "asc" ? (c(), g("img", {
|
|
421
423
|
key: 0,
|
|
422
|
-
src: e(
|
|
423
|
-
}, null, 8,
|
|
424
|
+
src: e(Qt)
|
|
425
|
+
}, null, 8, xo)) : a.order === "desc" ? (c(), g("img", {
|
|
424
426
|
key: 1,
|
|
425
|
-
src: e(Ut)
|
|
426
|
-
}, null, 8, xo)) : (c(), g("img", {
|
|
427
|
-
key: 2,
|
|
428
427
|
src: e(qt)
|
|
429
|
-
}, null, 8, $o))
|
|
430
|
-
|
|
428
|
+
}, null, 8, $o)) : (c(), g("img", {
|
|
429
|
+
key: 2,
|
|
430
|
+
src: e(Jt)
|
|
431
|
+
}, null, 8, To))], 2)])
|
|
432
|
+
})), Z(Pt(t.$slots), (r) => ({
|
|
431
433
|
name: r,
|
|
432
|
-
fn: n((a) => [r.includes("action") ? (c(), X(e(
|
|
434
|
+
fn: n((a) => [r.includes("action") ? (c(), X(e(Yt), {
|
|
433
435
|
key: 0,
|
|
434
436
|
"row-index": a.$rowIndex
|
|
435
437
|
}, {
|
|
@@ -444,7 +446,7 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
|
|
|
444
446
|
name: "top",
|
|
445
447
|
fn: n(() => [f("div", {
|
|
446
448
|
class: z(`${e(b)}-top-alert`)
|
|
447
|
-
}, [o[4] || (o[4] =
|
|
449
|
+
}, [o[4] || (o[4] = we(" 已选中 ", -1)), f("span", Ro, Y(e(Ae).length), 1), o[5] || (o[5] = we(" 条 ", -1)), d(t.$slots, "top_title")], 2)]),
|
|
448
450
|
key: "0"
|
|
449
451
|
} : void 0, e(A).toolbar_buttons ? {
|
|
450
452
|
name: "toolbar_buttons",
|
|
@@ -454,7 +456,7 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
|
|
|
454
456
|
name: "toolbar_tools",
|
|
455
457
|
fn: n(() => [d(t.$slots, "toolbar_tools")]),
|
|
456
458
|
key: "2"
|
|
457
|
-
} : void 0, Z(e(
|
|
459
|
+
} : void 0, Z(e(dt), (r) => ({
|
|
458
460
|
name: r,
|
|
459
461
|
fn: n(({
|
|
460
462
|
content: a,
|
|
@@ -464,18 +466,18 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
|
|
|
464
466
|
fixed: fe
|
|
465
467
|
}) => [!fe || fe === k.fixed ? (c(), g("div", {
|
|
466
468
|
key: 0,
|
|
467
|
-
ref: (
|
|
469
|
+
ref: (vt) => wt(vt, `valid_${T}_${R}`),
|
|
468
470
|
class: "h-full w-full"
|
|
469
|
-
}, [D(e(
|
|
471
|
+
}, [D(e(Nt), {
|
|
470
472
|
placement: l.value.toolTipErrorPlacement,
|
|
471
473
|
"err-msg": a,
|
|
472
474
|
"ref-dom": F.value[`valid_${T}_${R}`]
|
|
473
|
-
}, null, 8, ["placement", "err-msg", "ref-dom"])], 512)) :
|
|
475
|
+
}, null, 8, ["placement", "err-msg", "ref-dom"])], 512)) : K("", !0)])
|
|
474
476
|
})), e(j).showPager ? {
|
|
475
477
|
name: "pager",
|
|
476
478
|
fn: n(() => {
|
|
477
479
|
var r, a, T, R;
|
|
478
|
-
return [D(e(
|
|
480
|
+
return [D(e(jt), {
|
|
479
481
|
"current-page": e($).currentPage,
|
|
480
482
|
"onUpdate:currentPage": o[0] || (o[0] = (k) => e($).currentPage = k),
|
|
481
483
|
"page-size": e($).pageSize,
|
|
@@ -487,7 +489,7 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
|
|
|
487
489
|
"class-name": `${e(b)}-vxe-pager`,
|
|
488
490
|
onPageChange: e(ze)
|
|
489
491
|
}, {
|
|
490
|
-
left: n(() => [d(t.$slots, "pager_left", P(
|
|
492
|
+
left: n(() => [d(t.$slots, "pager_left", P(M({
|
|
491
493
|
selectedKeys: e(H)
|
|
492
494
|
}))), d(t.$slots, "buttom_left")]),
|
|
493
495
|
_: 3
|
|
@@ -498,5 +500,5 @@ const Co = ["data-testid"], wo = ["src"], xo = ["src"], $o = ["src"], To = {
|
|
|
498
500
|
}
|
|
499
501
|
});
|
|
500
502
|
export {
|
|
501
|
-
|
|
503
|
+
wr as default
|
|
502
504
|
};
|
|
@@ -16,6 +16,7 @@ type RowConfig = VxeTablePropTypes.RowConfig<Recordable>;
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function useRowIdentity(propsRef: ComputedRef<TtTableProps>): {
|
|
18
18
|
getRowKey: (row: Recordable) => RowKey | undefined;
|
|
19
|
+
getRowKeys: (rows: Recordable[]) => (RowKey | undefined)[];
|
|
19
20
|
prepareRows: (records: Recordable | Recordable[]) => void;
|
|
20
21
|
toVxeRowConfig: (rowConfig?: RowConfig) => RowConfig;
|
|
21
22
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "axios";
|
|
2
2
|
import "element-plus";
|
|
3
|
-
import { isObject as
|
|
4
|
-
import { getCurrentInstance as
|
|
3
|
+
import { isObject as _, isFunction as E, isArray as C, isNumber as W, isString as $ } from "../../../../packages/utils/src/is.js";
|
|
4
|
+
import { getCurrentInstance as q, unref as s, toRaw as P } from "vue";
|
|
5
5
|
import "dayjs";
|
|
6
6
|
import "numeral";
|
|
7
7
|
import "xe-utils";
|
|
@@ -12,86 +12,99 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/ae
|
|
|
12
12
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
13
13
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
14
14
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
15
|
-
import { get as
|
|
16
|
-
const
|
|
17
|
-
function c(
|
|
18
|
-
return
|
|
15
|
+
import { get as S } from "lodash-es";
|
|
16
|
+
const l = "__tt_table_internal_row_key__";
|
|
17
|
+
function c(r) {
|
|
18
|
+
return W(r) ? !0 : $(r) && !!r;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function A(r) {
|
|
21
|
+
return r.includes(".") || r.includes("[");
|
|
22
|
+
}
|
|
23
|
+
function O(r, d) {
|
|
24
|
+
return A(d) ? S(r, d) : r[d];
|
|
25
|
+
}
|
|
26
|
+
function ne(r) {
|
|
21
27
|
var v;
|
|
22
|
-
const
|
|
23
|
-
let
|
|
28
|
+
const d = ((v = q()) == null ? void 0 : v.uid) || 0;
|
|
29
|
+
let w = 0;
|
|
24
30
|
const K = /* @__PURE__ */ new WeakSet();
|
|
25
|
-
function
|
|
26
|
-
return
|
|
31
|
+
function f() {
|
|
32
|
+
return s(r).tableRowId || "id";
|
|
27
33
|
}
|
|
28
|
-
function p(e) {
|
|
29
|
-
const
|
|
30
|
-
return c(
|
|
34
|
+
function p(e, t = f()) {
|
|
35
|
+
const n = O(e, t);
|
|
36
|
+
return c(n) ? n : void 0;
|
|
31
37
|
}
|
|
32
38
|
function g(e) {
|
|
33
|
-
const t = Reflect.get(e,
|
|
39
|
+
const t = Reflect.get(e, l);
|
|
34
40
|
return c(t) ? t : void 0;
|
|
35
41
|
}
|
|
36
|
-
function
|
|
37
|
-
return
|
|
42
|
+
function j() {
|
|
43
|
+
return w += 1, `tt_row_${d}_${w}`;
|
|
38
44
|
}
|
|
39
|
-
function
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
45
|
+
function I(e, t) {
|
|
46
|
+
const n = P(e), i = Object.getOwnPropertyDescriptor(n, l), o = i && c(i.value) ? i.value : t;
|
|
47
|
+
if (i && !i.enumerable && c(i.value)) return o;
|
|
42
48
|
try {
|
|
43
|
-
Object.defineProperty(
|
|
49
|
+
Object.defineProperty(n, l, {
|
|
44
50
|
configurable: !0,
|
|
45
51
|
enumerable: !1,
|
|
46
|
-
value:
|
|
52
|
+
value: o,
|
|
47
53
|
writable: !0
|
|
48
54
|
});
|
|
49
55
|
} catch {
|
|
50
|
-
K.has(
|
|
56
|
+
K.has(n) || K.add(n);
|
|
51
57
|
}
|
|
52
|
-
return
|
|
58
|
+
return o;
|
|
53
59
|
}
|
|
54
|
-
function
|
|
55
|
-
var
|
|
60
|
+
function m({ row: e }) {
|
|
61
|
+
var y;
|
|
56
62
|
const t = g(e);
|
|
57
63
|
if (c(t)) return t;
|
|
58
|
-
const
|
|
59
|
-
return
|
|
64
|
+
const n = (y = s(r).rowConfig) == null ? void 0 : y.createKeyMethod, i = E(n) ? n({ row: e, keyField: f() }) : void 0, o = p(e), u = c(i) ? i : c(o) ? o : j();
|
|
65
|
+
return I(e, u);
|
|
60
66
|
}
|
|
61
|
-
function
|
|
67
|
+
function M(e = {}) {
|
|
62
68
|
return e.keyField ? e : {
|
|
63
69
|
...e,
|
|
64
|
-
keyField:
|
|
65
|
-
createKeyMethod:
|
|
70
|
+
keyField: l,
|
|
71
|
+
createKeyMethod: m
|
|
66
72
|
};
|
|
67
73
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (
|
|
72
|
-
|
|
73
|
-
if (r) {
|
|
74
|
-
const u = l(e, r);
|
|
74
|
+
function R(e, t, n) {
|
|
75
|
+
const i = p(e, t);
|
|
76
|
+
if (c(i)) return i;
|
|
77
|
+
if (n) {
|
|
78
|
+
const u = O(e, n);
|
|
75
79
|
return c(u) ? u : void 0;
|
|
76
80
|
}
|
|
77
|
-
const
|
|
78
|
-
return c(
|
|
81
|
+
const o = g(e);
|
|
82
|
+
return c(o) ? o : m({ row: e });
|
|
83
|
+
}
|
|
84
|
+
function x(e) {
|
|
85
|
+
var t;
|
|
86
|
+
return R(e, f(), (t = s(r).rowConfig) == null ? void 0 : t.keyField);
|
|
87
|
+
}
|
|
88
|
+
function B(e) {
|
|
89
|
+
var i;
|
|
90
|
+
const t = f(), n = (i = s(r).rowConfig) == null ? void 0 : i.keyField;
|
|
91
|
+
return e.map((o) => R(o, t, n));
|
|
79
92
|
}
|
|
80
|
-
function
|
|
81
|
-
var u,
|
|
82
|
-
if ((u =
|
|
83
|
-
const t =
|
|
84
|
-
function
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
93
|
+
function D(e) {
|
|
94
|
+
var u, y, F;
|
|
95
|
+
if ((u = s(r).rowConfig) != null && u.keyField) return;
|
|
96
|
+
const t = C(e) ? e : [e], n = /* @__PURE__ */ new WeakSet(), i = ((y = s(r).treeConfig) == null ? void 0 : y.childrenField) || ((F = s(r).treeConfig) == null ? void 0 : F.children) || "children";
|
|
97
|
+
function o(a) {
|
|
98
|
+
const k = P(a);
|
|
99
|
+
if (n.has(k)) return;
|
|
100
|
+
n.add(k), m({ row: a });
|
|
101
|
+
const b = S(a, i);
|
|
102
|
+
C(b) && b.forEach((h) => _(h) && o(h));
|
|
90
103
|
}
|
|
91
|
-
t.forEach((
|
|
104
|
+
t.forEach((a) => _(a) && o(a));
|
|
92
105
|
}
|
|
93
|
-
return { getRowKey:
|
|
106
|
+
return { getRowKey: x, getRowKeys: B, prepareRows: D, toVxeRowConfig: M };
|
|
94
107
|
}
|
|
95
108
|
export {
|
|
96
|
-
|
|
109
|
+
ne as useRowIdentity
|
|
97
110
|
};
|
|
@@ -15,6 +15,8 @@ type SelectionEmit = {
|
|
|
15
15
|
type RowSelectionIdentity = {
|
|
16
16
|
/** 获取业务兼容的行主键。 */
|
|
17
17
|
getRowKey: (row: Recordable) => number | string | undefined;
|
|
18
|
+
/** 批量获取行主键,配置只解析一次。 */
|
|
19
|
+
getRowKeys: (rows: Recordable[]) => Array<number | string | undefined>;
|
|
18
20
|
};
|
|
19
21
|
/**
|
|
20
22
|
* 行选择状态(复选框、单选框、区域选择)
|
|
@@ -25,7 +27,7 @@ type RowSelectionIdentity = {
|
|
|
25
27
|
*/
|
|
26
28
|
export declare function useRowSelection(propsRef: ComputedRef<TtTableProps>, grid: Ref<undefined | VxeGridInstance<Recordable>>, emit: SelectionEmit, identity: RowSelectionIdentity): {
|
|
27
29
|
selectedKeys: Ref<any, any>;
|
|
28
|
-
selectedRows:
|
|
30
|
+
selectedRows: import('vue').ShallowRef<any, any>;
|
|
29
31
|
selectedKeyList: ComputedRef<(string | number)[]>;
|
|
30
32
|
getSelectRowKeys: () => any;
|
|
31
33
|
getSelectRows: () => TtSelectRowsType;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { GlobalConfig as
|
|
1
|
+
import { GlobalConfig as _ } from "../../../../hooks/useSetup.js";
|
|
2
2
|
import "axios";
|
|
3
3
|
import "element-plus";
|
|
4
|
-
import { isArray as
|
|
5
|
-
import { ref as
|
|
4
|
+
import { isArray as S } from "../../../../packages/utils/src/is.js";
|
|
5
|
+
import { ref as $, shallowRef as j, computed as q, unref as t, toValue as z, nextTick as H } from "vue";
|
|
6
6
|
import "dayjs";
|
|
7
7
|
import "numeral";
|
|
8
8
|
import "xe-utils";
|
|
@@ -14,96 +14,97 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/en
|
|
|
14
14
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
15
15
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
16
16
|
import "lodash-es";
|
|
17
|
-
function
|
|
18
|
-
const { getRowKey:
|
|
19
|
-
const { showCheckbox: e, showRadio: o } = t(
|
|
20
|
-
return e ?
|
|
17
|
+
function re(f, s, i, A) {
|
|
18
|
+
const { getRowKey: K, getRowKeys: b } = A, l = $([]), k = j([]), B = q(() => {
|
|
19
|
+
const { showCheckbox: e, showRadio: o } = t(f), n = z(l);
|
|
20
|
+
return e ? n || [] : o ? n ? [n] : [] : [];
|
|
21
21
|
});
|
|
22
22
|
function x() {
|
|
23
|
-
return t(
|
|
23
|
+
return t(l);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
var
|
|
27
|
-
const { showCheckbox: e, showRadio: o, reserveSelection:
|
|
25
|
+
function y() {
|
|
26
|
+
var c, r, a;
|
|
27
|
+
const { showCheckbox: e, showRadio: o, reserveSelection: n } = t(f);
|
|
28
28
|
if (e) {
|
|
29
|
-
const
|
|
30
|
-
if (!
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
const u = ((c = t(s)) == null ? void 0 : c.getCheckboxRecords(!0)) || [];
|
|
30
|
+
if (!n) return u;
|
|
31
|
+
const C = ((r = t(s)) == null ? void 0 : r.getCheckboxReserveRecords(!0)) || [];
|
|
32
|
+
if (!C.length) return u;
|
|
33
|
+
const w = /* @__PURE__ */ new Map(), m = b(u), g = b(C);
|
|
34
|
+
return u.forEach((R, v) => w.set(m[v], R)), C.forEach((R, v) => {
|
|
35
|
+
w.has(g[v]) || w.set(g[v], R);
|
|
36
|
+
}), [...w.values()];
|
|
36
37
|
}
|
|
37
|
-
return o ? (
|
|
38
|
+
return o ? (a = t(s)) == null ? void 0 : a.getRadioRecord(!0) : [];
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
+
function E() {
|
|
40
41
|
var e;
|
|
41
|
-
return ((e = t(
|
|
42
|
+
return ((e = t(s)) == null ? void 0 : e.getTableData().fullData) || [];
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
-
const o =
|
|
45
|
-
k.value = o,
|
|
44
|
+
function h(e) {
|
|
45
|
+
const o = y();
|
|
46
|
+
k.value = o, l.value = S(o) ? b(o) : o ? K(o) : void 0, i("selection-change", { keys: x(), rows: o, data: e });
|
|
46
47
|
}
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
},
|
|
48
|
+
const T = (e) => {
|
|
49
|
+
h(e), i("checkbox-change", e);
|
|
50
|
+
}, D = (e) => {
|
|
51
|
+
h(e), i("checkbox-all", e);
|
|
52
|
+
}, d = (e) => {
|
|
52
53
|
var o;
|
|
53
|
-
i("checkbox-range-change", e), ((o = e.records) == null ? void 0 : o.length) !== 1 &&
|
|
54
|
+
i("checkbox-range-change", e), ((o = e.records) == null ? void 0 : o.length) !== 1 && h(e);
|
|
54
55
|
};
|
|
55
|
-
function
|
|
56
|
-
k.value = e.row,
|
|
56
|
+
function P(e) {
|
|
57
|
+
k.value = e.row, l.value = e.row ? K(e.row) : void 0, i("radio-change", e), i("selection-change", { keys: x(), rows: y(), data: e });
|
|
57
58
|
}
|
|
58
|
-
async function
|
|
59
|
-
const { rows: o, cols:
|
|
59
|
+
async function F(e) {
|
|
60
|
+
const { rows: o, cols: n } = e;
|
|
60
61
|
if (o.length === 1) return;
|
|
61
|
-
const
|
|
62
|
-
!
|
|
62
|
+
const c = t(s);
|
|
63
|
+
!c || !n.some((r) => r.type === "checkbox") || (await c.setCheckboxRow(o, !c.isCheckedByCheckboxRow(o[0])), h(e));
|
|
63
64
|
}
|
|
64
|
-
const
|
|
65
|
-
var
|
|
66
|
-
const { checkboxConfig: o, showCheckbox:
|
|
67
|
-
o != null && o.range &&
|
|
65
|
+
const G = (e) => {
|
|
66
|
+
var c;
|
|
67
|
+
const { checkboxConfig: o, showCheckbox: n } = t(f);
|
|
68
|
+
o != null && o.range && n ? d({ records: e.rows }) : (c = _.table) != null && c.isAreaCheckboxSelection && F(e), i("cell-area-selection-end", e);
|
|
68
69
|
};
|
|
69
|
-
async function
|
|
70
|
-
var
|
|
71
|
-
const { showCheckbox:
|
|
72
|
-
...
|
|
73
|
-
...
|
|
74
|
-
]), C =
|
|
75
|
-
|
|
70
|
+
async function L(e, o = []) {
|
|
71
|
+
var g, R;
|
|
72
|
+
const { showCheckbox: n, showRadio: c } = t(f), r = S(e) ? e : e ? [e] : [], a = /* @__PURE__ */ new Set([
|
|
73
|
+
...b(r),
|
|
74
|
+
...S(o) ? o : o == null ? [] : [o]
|
|
75
|
+
]), u = E(), C = b(u), w = u.filter((v, V) => a.has(C[V])), m = w.length ? w : r;
|
|
76
|
+
n && await ((g = t(s)) == null ? void 0 : g.setCheckboxRow(m, !0)), c && await ((R = t(s)) == null ? void 0 : R.setRadioRow(m[0])), await H(), h();
|
|
76
77
|
}
|
|
77
78
|
function p() {
|
|
78
|
-
var
|
|
79
|
-
const { showCheckbox: e, showRadio: o, reserveSelection:
|
|
80
|
-
!e && !o || (e && (
|
|
79
|
+
var c, r, a;
|
|
80
|
+
const { showCheckbox: e, showRadio: o, reserveSelection: n } = t(f);
|
|
81
|
+
!e && !o || (e && (l.value = [], k.value = [], (c = t(s)) == null || c.clearCheckboxRow(), n && ((r = t(s)) == null || r.clearCheckboxReserve())), o && (l.value = void 0, k.value = void 0, (a = t(s)) == null || a.clearRadioRow()), i("selection-change", { keys: x(), rows: y() }));
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
-
const { showCheckbox: e, reserveSelection: o } = t(
|
|
83
|
+
function M() {
|
|
84
|
+
const { showCheckbox: e, reserveSelection: o } = t(f);
|
|
84
85
|
if (!e || !o) {
|
|
85
86
|
p();
|
|
86
87
|
return;
|
|
87
88
|
}
|
|
88
|
-
|
|
89
|
+
h();
|
|
89
90
|
}
|
|
90
91
|
return {
|
|
91
|
-
selectedKeys:
|
|
92
|
+
selectedKeys: l,
|
|
92
93
|
selectedRows: k,
|
|
93
|
-
selectedKeyList:
|
|
94
|
+
selectedKeyList: B,
|
|
94
95
|
getSelectRowKeys: x,
|
|
95
|
-
getSelectRows:
|
|
96
|
-
syncSelection:
|
|
97
|
-
setSelectedRowKeys:
|
|
96
|
+
getSelectRows: y,
|
|
97
|
+
syncSelection: h,
|
|
98
|
+
setSelectedRowKeys: L,
|
|
98
99
|
clearSelectedRowKeys: p,
|
|
99
|
-
resetSelectionAfterFetch:
|
|
100
|
-
onCheckboxChange:
|
|
101
|
-
onCheckboxAll:
|
|
102
|
-
onCheckboxRangeChange:
|
|
103
|
-
onRadioChange:
|
|
104
|
-
onCellAreaSelectionEnd:
|
|
100
|
+
resetSelectionAfterFetch: M,
|
|
101
|
+
onCheckboxChange: T,
|
|
102
|
+
onCheckboxAll: D,
|
|
103
|
+
onCheckboxRangeChange: d,
|
|
104
|
+
onRadioChange: P,
|
|
105
|
+
onCellAreaSelectionEnd: G
|
|
105
106
|
};
|
|
106
107
|
}
|
|
107
108
|
export {
|
|
108
|
-
|
|
109
|
+
re as useRowSelection
|
|
109
110
|
};
|