@affino/datagrid-vue-app 0.1.18 → 0.1.19
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 +40 -0
- package/dist/advancedFilterDraftClauses.d.ts +6 -0
- package/dist/chunks/{DataGridAggregationsPopover-DfQ3-UV4.js → DataGridAggregationsPopover-Cul0w-Zw.js} +2 -1
- package/dist/chunks/DataGridGanttStageEntry-3ZJORlma.js +8148 -0
- package/dist/chunks/useDataGridAppRowModel-pcd72QS1.js +3072 -0
- package/dist/gantt.js +1 -1
- package/dist/gestures/dataGridTouchPanGuard.d.ts +13 -0
- package/dist/host/DataGridDefaultRenderer.d.ts +11 -1
- package/dist/index.js +369 -364
- package/dist/internal.js +2 -2
- package/dist/stage/useDataGridTableStageRuntime.d.ts +12 -1
- package/dist/stage/useDataGridTableStageScrollSync.d.ts +1 -1
- package/package.json +8 -4
- package/dist/chunks/DataGridGanttStageEntry-CS2wpBnj.js +0 -7815
- package/dist/chunks/useDataGridAppRowModel-RrE_k6tK.js +0 -3008
package/dist/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useDataGridRuntime as
|
|
3
|
-
import { useDataGridAppSelection as
|
|
4
|
-
import { d as De, e as Ke, f as Le, r as Ie, g as je, u as Fe, D as ze } from "./chunks/useDataGridAppRowModel-
|
|
5
|
-
import { applyGridTheme as
|
|
1
|
+
import { defineComponent as he, ref as $, provide as Be, computed as g, watch as p, onBeforeUnmount as ce, h as de, mergeProps as Ce, toRef as ge } from "vue";
|
|
2
|
+
import { useDataGridRuntime as Ge } from "@affino/datagrid-vue";
|
|
3
|
+
import { useDataGridAppSelection as Pe, useDataGridAppRowSelection as xe } from "@affino/datagrid-vue/app";
|
|
4
|
+
import { d as De, e as Ke, f as Le, r as Ie, g as je, u as Fe, D as ze } from "./chunks/useDataGridAppRowModel-pcd72QS1.js";
|
|
5
|
+
import { applyGridTheme as Ve, resolveGridThemeTokens as Te, defaultStyleConfig as G, sugarTheme as Me, industrialNeutralTheme as ye } from "@affino/datagrid-theme";
|
|
6
6
|
import { d as We } from "./chunks/DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-_1TDQseN.js";
|
|
7
7
|
const He = {
|
|
8
|
-
default:
|
|
9
|
-
"industrial-neutral":
|
|
10
|
-
industrialNeutral:
|
|
11
|
-
sugar:
|
|
8
|
+
default: G,
|
|
9
|
+
"industrial-neutral": ye,
|
|
10
|
+
industrialNeutral: ye,
|
|
11
|
+
sugar: Me
|
|
12
12
|
};
|
|
13
13
|
function _e(e, o) {
|
|
14
14
|
if (!e && !o)
|
|
15
15
|
return;
|
|
16
|
-
const
|
|
16
|
+
const l = {
|
|
17
17
|
...e ?? {}
|
|
18
18
|
};
|
|
19
|
-
for (const [
|
|
20
|
-
r
|
|
21
|
-
...r
|
|
19
|
+
for (const [r, f] of Object.entries(o ?? {}))
|
|
20
|
+
l[r] = {
|
|
21
|
+
...l[r] ?? {},
|
|
22
22
|
...f
|
|
23
23
|
};
|
|
24
|
-
return
|
|
24
|
+
return l;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function le(e, o) {
|
|
27
27
|
return {
|
|
28
28
|
...e,
|
|
29
29
|
...o,
|
|
@@ -41,24 +41,24 @@ function ke(e) {
|
|
|
41
41
|
return !e || typeof e != "object" ? !1 : "tokens" in e || "tokenVariants" in e || "activeTokenVariant" in e || "defaultTokenVariant" in e || "inheritThemeFromDocument" in e || "documentDarkClass" in e || "grid" in e || "header" in e || "body" in e || "group" in e || "summary" in e || "state" in e;
|
|
42
42
|
}
|
|
43
43
|
function Ee(e) {
|
|
44
|
-
return e == null ?
|
|
44
|
+
return e == null ? G : typeof e == "string" ? e === "sugar" ? le(G, Me) : He[e] ?? G : ke(e) ? le(G, e) : le(G, {
|
|
45
45
|
tokens: e
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
function Ne(e) {
|
|
49
49
|
const o = Ee(e);
|
|
50
|
-
return
|
|
50
|
+
return Te(o ?? G, {
|
|
51
51
|
document: typeof document > "u" ? void 0 : document
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
function ge(e, o) {
|
|
55
|
-
const r = Ne(o);
|
|
56
|
-
return Te(e, r), r;
|
|
57
|
-
}
|
|
58
54
|
function ve(e, o) {
|
|
55
|
+
const l = Ne(o);
|
|
56
|
+
return Ve(e, l), l;
|
|
57
|
+
}
|
|
58
|
+
function pe(e, o) {
|
|
59
59
|
return Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : o;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function we(e, o) {
|
|
62
62
|
return Number.isFinite(e) ? Math.max(1, Math.trunc(e)) : o;
|
|
63
63
|
}
|
|
64
64
|
function Ue(e) {
|
|
@@ -70,7 +70,7 @@ function Ue(e) {
|
|
|
70
70
|
return o ? { fields: [o], expandedByDefault: !0 } : null;
|
|
71
71
|
}
|
|
72
72
|
if (Array.isArray(e)) {
|
|
73
|
-
const o = e.map((
|
|
73
|
+
const o = e.map((l) => l.trim()).filter((l) => l.length > 0);
|
|
74
74
|
return o.length > 0 ? { fields: [...o], expandedByDefault: !0 } : null;
|
|
75
75
|
}
|
|
76
76
|
return e;
|
|
@@ -79,49 +79,49 @@ function Ue(e) {
|
|
|
79
79
|
function qe(e, o) {
|
|
80
80
|
return o === !0 || o && typeof o == "object" ? "pagination" : e ?? "virtualization";
|
|
81
81
|
}
|
|
82
|
-
function Je(e, o,
|
|
82
|
+
function Je(e, o, l, r) {
|
|
83
83
|
if (o !== "pagination")
|
|
84
84
|
return null;
|
|
85
|
-
const f = 100, u =
|
|
85
|
+
const f = 100, u = we(l, f), v = pe(r, 0);
|
|
86
86
|
return e === !0 || e === !1 || e == null ? {
|
|
87
87
|
pageSize: u,
|
|
88
|
-
currentPage:
|
|
88
|
+
currentPage: v
|
|
89
89
|
} : {
|
|
90
|
-
pageSize:
|
|
91
|
-
currentPage:
|
|
90
|
+
pageSize: we(l ?? e.pageSize, f),
|
|
91
|
+
currentPage: pe(r ?? e.currentPage, 0)
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
const
|
|
94
|
+
const ae = "Advanced filter";
|
|
95
95
|
function $e(e) {
|
|
96
96
|
return typeof e == "boolean" ? {
|
|
97
97
|
enabled: e,
|
|
98
|
-
buttonLabel:
|
|
98
|
+
buttonLabel: ae
|
|
99
99
|
} : e ? {
|
|
100
100
|
enabled: e.enabled ?? !0,
|
|
101
|
-
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() :
|
|
101
|
+
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() : ae
|
|
102
102
|
} : {
|
|
103
103
|
enabled: !1,
|
|
104
|
-
buttonLabel:
|
|
104
|
+
buttonLabel: ae
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function Se(e) {
|
|
108
108
|
if (typeof e != "number" || !Number.isFinite(e))
|
|
109
109
|
return null;
|
|
110
110
|
const o = Math.max(0, Math.trunc(e));
|
|
111
111
|
return o > 0 ? o : null;
|
|
112
112
|
}
|
|
113
|
-
function Qe(e, o,
|
|
114
|
-
const
|
|
115
|
-
if (
|
|
113
|
+
function Qe(e, o, l) {
|
|
114
|
+
const r = e === "auto-height" ? "auto-height" : "fill";
|
|
115
|
+
if (r !== "auto-height")
|
|
116
116
|
return {
|
|
117
|
-
layoutMode:
|
|
117
|
+
layoutMode: r,
|
|
118
118
|
minRows: null,
|
|
119
119
|
maxRows: null
|
|
120
120
|
};
|
|
121
|
-
const f =
|
|
122
|
-
let u =
|
|
121
|
+
const f = Se(o);
|
|
122
|
+
let u = Se(l);
|
|
123
123
|
return f !== null && u !== null && u < f && (u = f), {
|
|
124
|
-
layoutMode:
|
|
124
|
+
layoutMode: r,
|
|
125
125
|
minRows: f,
|
|
126
126
|
maxRows: u
|
|
127
127
|
};
|
|
@@ -132,7 +132,7 @@ function Xe(e) {
|
|
|
132
132
|
transaction: null
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function Q(e) {
|
|
136
136
|
return {
|
|
137
137
|
...e,
|
|
138
138
|
state: Xe(e.state)
|
|
@@ -141,43 +141,43 @@ function J(e) {
|
|
|
141
141
|
function Ye(e) {
|
|
142
142
|
return typeof e == "object" && e !== null;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
const
|
|
144
|
+
function be(e, o, l) {
|
|
145
|
+
const r = Ye(e) ? e : null, f = o(r && "state" in r ? r.state : e, l);
|
|
146
146
|
if (!f)
|
|
147
147
|
return null;
|
|
148
|
-
const u =
|
|
149
|
-
return
|
|
148
|
+
const u = r?.viewMode, v = u === "gantt" ? "gantt" : u === "table" ? "table" : void 0;
|
|
149
|
+
return Q({
|
|
150
150
|
state: f,
|
|
151
|
-
...
|
|
151
|
+
...v ? { viewMode: v } : {}
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
154
|
function Ze(e) {
|
|
155
|
-
return JSON.stringify(
|
|
155
|
+
return JSON.stringify(Q(e));
|
|
156
156
|
}
|
|
157
|
-
function et(e, o,
|
|
157
|
+
function et(e, o, l) {
|
|
158
158
|
if (typeof e != "string" || e.trim().length === 0)
|
|
159
159
|
return null;
|
|
160
160
|
try {
|
|
161
|
-
return
|
|
161
|
+
return be(JSON.parse(e), o, l);
|
|
162
162
|
} catch {
|
|
163
163
|
return null;
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
function wt(e, o,
|
|
166
|
+
function wt(e, o, l) {
|
|
167
167
|
if (!e || typeof o != "string" || o.trim().length === 0)
|
|
168
168
|
return !1;
|
|
169
169
|
try {
|
|
170
|
-
return e.setItem(o, Ze(
|
|
170
|
+
return e.setItem(o, Ze(l)), !0;
|
|
171
171
|
} catch {
|
|
172
172
|
return !1;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
function St(e, o,
|
|
175
|
+
function St(e, o, l, r) {
|
|
176
176
|
if (!e || typeof o != "string" || o.trim().length === 0)
|
|
177
177
|
return null;
|
|
178
178
|
try {
|
|
179
179
|
const f = e.getItem(o);
|
|
180
|
-
return f ? et(f,
|
|
180
|
+
return f ? et(f, l, r) : null;
|
|
181
181
|
} catch {
|
|
182
182
|
return null;
|
|
183
183
|
}
|
|
@@ -191,54 +191,54 @@ function ht(e, o) {
|
|
|
191
191
|
return !1;
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
const
|
|
194
|
+
const ie = "Columns";
|
|
195
195
|
function tt(e) {
|
|
196
196
|
return typeof e == "boolean" ? {
|
|
197
197
|
enabled: e,
|
|
198
|
-
buttonLabel:
|
|
198
|
+
buttonLabel: ie
|
|
199
199
|
} : e ? {
|
|
200
200
|
enabled: e.enabled ?? !0,
|
|
201
|
-
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() :
|
|
201
|
+
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() : ie
|
|
202
202
|
} : {
|
|
203
203
|
enabled: !1,
|
|
204
|
-
buttonLabel:
|
|
204
|
+
buttonLabel: ie
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
|
-
const
|
|
207
|
+
const ue = "Aggregations";
|
|
208
208
|
function ot(e) {
|
|
209
209
|
return typeof e == "boolean" ? {
|
|
210
210
|
enabled: e,
|
|
211
|
-
buttonLabel:
|
|
211
|
+
buttonLabel: ue
|
|
212
212
|
} : e ? {
|
|
213
213
|
enabled: e.enabled ?? !0,
|
|
214
|
-
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() :
|
|
214
|
+
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() : ue
|
|
215
215
|
} : {
|
|
216
216
|
enabled: !1,
|
|
217
|
-
buttonLabel:
|
|
217
|
+
buttonLabel: ue
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function q(e, o) {
|
|
221
221
|
return Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : o;
|
|
222
222
|
}
|
|
223
223
|
function nt(e, o) {
|
|
224
|
-
const
|
|
224
|
+
const l = {
|
|
225
225
|
rows: !0,
|
|
226
226
|
columns: !1,
|
|
227
227
|
rowOverscan: 8,
|
|
228
228
|
columnOverscan: 2
|
|
229
229
|
};
|
|
230
230
|
if (e === !0)
|
|
231
|
-
|
|
231
|
+
l.columns = !0;
|
|
232
232
|
else if (e === !1)
|
|
233
|
-
|
|
233
|
+
l.rows = !1, l.columns = !1;
|
|
234
234
|
else if (e && typeof e == "object") {
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
|
|
235
|
+
l.rows = e.rows ?? l.rows, l.columns = e.columns ?? l.columns;
|
|
236
|
+
const r = q(e.overscan, l.rowOverscan);
|
|
237
|
+
l.rowOverscan = q(e.rowOverscan, r), l.columnOverscan = q(e.columnOverscan, q(e.overscan, l.columnOverscan));
|
|
238
238
|
}
|
|
239
|
-
return o === "pagination" && (
|
|
239
|
+
return o === "pagination" && (l.rows = !1), l;
|
|
240
240
|
}
|
|
241
|
-
const rt =
|
|
241
|
+
const rt = he({
|
|
242
242
|
name: "DataGridRuntimeHost",
|
|
243
243
|
inheritAttrs: !1,
|
|
244
244
|
props: {
|
|
@@ -292,11 +292,11 @@ const rt = we({
|
|
|
292
292
|
"selection-change": (e) => !0,
|
|
293
293
|
"row-selection-change": (e) => !0
|
|
294
294
|
},
|
|
295
|
-
setup(e, { attrs: o, slots:
|
|
296
|
-
const u =
|
|
297
|
-
|
|
298
|
-
let
|
|
299
|
-
const s =
|
|
295
|
+
setup(e, { attrs: o, slots: l, emit: r, expose: f }) {
|
|
296
|
+
const u = $(null);
|
|
297
|
+
Be(We, u);
|
|
298
|
+
let v = null;
|
|
299
|
+
const s = Ge({
|
|
300
300
|
rows: g(() => e.rows),
|
|
301
301
|
rowModel: e.rowModel,
|
|
302
302
|
columns: g(() => e.columns),
|
|
@@ -304,9 +304,11 @@ const rt = we({
|
|
|
304
304
|
services: e.services,
|
|
305
305
|
startupOrder: e.startupOrder,
|
|
306
306
|
autoStart: e.autoStart
|
|
307
|
-
}), w = s,
|
|
307
|
+
}), w = s, O = {
|
|
308
308
|
api: s.api,
|
|
309
309
|
syncBodyRowsInRange: s.syncBodyRowsInRange,
|
|
310
|
+
setViewportRange: s.setViewportRange,
|
|
311
|
+
setVirtualWindowRange: s.setVirtualWindowRange,
|
|
310
312
|
rowPartition: s.rowPartition,
|
|
311
313
|
virtualWindow: s.virtualWindow,
|
|
312
314
|
columnSnapshot: s.columnSnapshot,
|
|
@@ -335,31 +337,31 @@ const rt = we({
|
|
|
335
337
|
B();
|
|
336
338
|
},
|
|
337
339
|
{ immediate: !0, deep: !0 }
|
|
338
|
-
), typeof document < "u" && (
|
|
340
|
+
), typeof document < "u" && (v = new MutationObserver(() => {
|
|
339
341
|
const d = u.value;
|
|
340
|
-
d &&
|
|
341
|
-
}),
|
|
342
|
+
d && ve(d, e.theme);
|
|
343
|
+
}), v.observe(document.documentElement, {
|
|
342
344
|
attributes: !0,
|
|
343
345
|
attributeFilter: ["class", "data-theme"]
|
|
344
346
|
})), p(
|
|
345
347
|
[() => e.theme, u],
|
|
346
348
|
() => {
|
|
347
349
|
const d = u.value;
|
|
348
|
-
d &&
|
|
350
|
+
d && ve(d, e.theme);
|
|
349
351
|
},
|
|
350
352
|
{ immediate: !0, deep: !0 }
|
|
351
353
|
);
|
|
352
354
|
const h = s.api.events.on("rows:changed", (d) => {
|
|
353
|
-
|
|
354
|
-
}),
|
|
355
|
-
|
|
355
|
+
r("cell-change", d);
|
|
356
|
+
}), M = s.api.events.on("selection:changed", (d) => {
|
|
357
|
+
r("selection-change", d);
|
|
356
358
|
}), P = s.api.events.on("row-selection:changed", (d) => {
|
|
357
|
-
|
|
359
|
+
r("row-selection-change", d);
|
|
358
360
|
});
|
|
359
|
-
|
|
360
|
-
h(),
|
|
361
|
+
ce(() => {
|
|
362
|
+
h(), M(), P(), v?.disconnect(), v = null;
|
|
361
363
|
});
|
|
362
|
-
const
|
|
364
|
+
const x = g(() => {
|
|
363
365
|
const d = s.virtualWindow.value;
|
|
364
366
|
return {
|
|
365
367
|
...d ?? {},
|
|
@@ -370,7 +372,7 @@ const rt = we({
|
|
|
370
372
|
return f({
|
|
371
373
|
api: s.api,
|
|
372
374
|
core: s.core,
|
|
373
|
-
runtime:
|
|
375
|
+
runtime: O,
|
|
374
376
|
rowModel: s.rowModel,
|
|
375
377
|
columnModel: s.columnModel,
|
|
376
378
|
columnSnapshot: s.columnSnapshot,
|
|
@@ -382,9 +384,9 @@ const rt = we({
|
|
|
382
384
|
virtualWindow: s.virtualWindow,
|
|
383
385
|
start: s.start,
|
|
384
386
|
stop: s.stop
|
|
385
|
-
}), () =>
|
|
387
|
+
}), () => de(
|
|
386
388
|
"div",
|
|
387
|
-
|
|
389
|
+
Ce(o, {
|
|
388
390
|
ref: u,
|
|
389
391
|
class: [
|
|
390
392
|
"affino-datagrid-app-root",
|
|
@@ -397,11 +399,11 @@ const rt = we({
|
|
|
397
399
|
minWidth: "0"
|
|
398
400
|
}
|
|
399
401
|
}),
|
|
400
|
-
|
|
402
|
+
l.default?.({
|
|
401
403
|
api: s.api,
|
|
402
404
|
core: s.core,
|
|
403
|
-
runtime:
|
|
404
|
-
grid:
|
|
405
|
+
runtime: O,
|
|
406
|
+
grid: O,
|
|
405
407
|
rowModel: s.rowModel,
|
|
406
408
|
columnModel: s.columnModel,
|
|
407
409
|
columnSnapshot: s.columnSnapshot.value,
|
|
@@ -410,15 +412,15 @@ const rt = we({
|
|
|
410
412
|
syncBodyRowsInRange: s.syncBodyRowsInRange,
|
|
411
413
|
getBodyRowAtIndex: w.getBodyRowAtIndex,
|
|
412
414
|
resolveBodyRowIndexById: w.resolveBodyRowIndexById,
|
|
413
|
-
virtualWindow:
|
|
415
|
+
virtualWindow: x.value
|
|
414
416
|
}) ?? []
|
|
415
417
|
);
|
|
416
418
|
}
|
|
417
419
|
});
|
|
418
|
-
function
|
|
420
|
+
function se(e) {
|
|
419
421
|
return Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : null;
|
|
420
422
|
}
|
|
421
|
-
function
|
|
423
|
+
function R(e) {
|
|
422
424
|
try {
|
|
423
425
|
return JSON.stringify(e);
|
|
424
426
|
} catch {
|
|
@@ -432,116 +434,119 @@ function lt(e) {
|
|
|
432
434
|
} : null;
|
|
433
435
|
}
|
|
434
436
|
function at(e) {
|
|
435
|
-
let o = null,
|
|
437
|
+
let o = null, l = null, r = !1, f = null, u = null, v = null, s = null, w = null, O = null, B = null, h = null, M = null;
|
|
436
438
|
const P = () => {
|
|
437
|
-
o?.(),
|
|
438
|
-
},
|
|
439
|
-
const t = e.gridRef.value
|
|
439
|
+
o?.(), l?.(), o = null, l = null;
|
|
440
|
+
}, x = () => {
|
|
441
|
+
const t = e.gridRef.value;
|
|
442
|
+
return !t || t.api.lifecycle.state === "disposed" ? null : t;
|
|
443
|
+
}, d = () => x()?.api ?? null, j = () => {
|
|
444
|
+
const t = d()?.columns;
|
|
440
445
|
if (!t)
|
|
441
446
|
return null;
|
|
442
|
-
const i = t.getSnapshot(),
|
|
447
|
+
const i = t.getSnapshot(), n = {}, c = {}, b = {};
|
|
443
448
|
for (const S of i.columns)
|
|
444
|
-
|
|
449
|
+
n[S.key] = S.visible, c[S.key] = S.width, b[S.key] = S.pin;
|
|
445
450
|
return {
|
|
446
451
|
order: [...i.order],
|
|
447
|
-
visibility:
|
|
452
|
+
visibility: n,
|
|
448
453
|
widths: c,
|
|
449
|
-
pins:
|
|
454
|
+
pins: b
|
|
450
455
|
};
|
|
451
|
-
},
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
const t =
|
|
456
|
+
}, y = () => {
|
|
457
|
+
r || (r = !0, queueMicrotask(() => {
|
|
458
|
+
r = !1;
|
|
459
|
+
const t = j(), i = d();
|
|
455
460
|
if (t) {
|
|
456
|
-
const
|
|
457
|
-
|
|
461
|
+
const n = R(t);
|
|
462
|
+
O = n, n !== v && (v = n, e.emit.columnState(t), e.emit.columnOrder(t.order), e.emit.hiddenColumnKeys(
|
|
458
463
|
Object.entries(t.visibility).filter(([, c]) => !c).map(([c]) => c)
|
|
459
464
|
), e.emit.columnWidths(t.widths), e.emit.columnPins(t.pins));
|
|
460
465
|
}
|
|
461
466
|
if (i) {
|
|
462
|
-
const
|
|
463
|
-
c !== w && (w = c, e.emit.groupBy(
|
|
464
|
-
const
|
|
465
|
-
B = S, S !== s && (s = S, e.emit.state(
|
|
467
|
+
const n = lt(i.rows.getSnapshot().groupBy), c = R(n);
|
|
468
|
+
c !== w && (w = c, e.emit.groupBy(n));
|
|
469
|
+
const b = i.state.get(), S = R(b);
|
|
470
|
+
B = S, S !== s && (s = S, e.emit.state(b));
|
|
466
471
|
}
|
|
467
472
|
}));
|
|
468
|
-
},
|
|
469
|
-
const t =
|
|
473
|
+
}, F = () => {
|
|
474
|
+
const t = d();
|
|
470
475
|
!t || e.props.sortModel === void 0 && e.props.filterModel === void 0 || t.rows.setSortAndFilterModel({
|
|
471
476
|
sortModel: e.props.sortModel ?? [],
|
|
472
477
|
filterModel: e.props.filterModel ?? null
|
|
473
478
|
});
|
|
474
|
-
},
|
|
475
|
-
const t =
|
|
479
|
+
}, X = () => {
|
|
480
|
+
const t = d()?.columns;
|
|
476
481
|
return t ? new Set(t.getSnapshot().columns.map((i) => i.key)) : null;
|
|
477
|
-
},
|
|
482
|
+
}, Y = (t) => {
|
|
478
483
|
const i = /* @__PURE__ */ new Set();
|
|
479
484
|
if (!t)
|
|
480
485
|
return i;
|
|
481
|
-
for (const
|
|
482
|
-
i.add(
|
|
483
|
-
for (const
|
|
484
|
-
i.add(
|
|
485
|
-
for (const
|
|
486
|
-
i.add(
|
|
487
|
-
for (const
|
|
488
|
-
i.add(
|
|
486
|
+
for (const n of t.order)
|
|
487
|
+
i.add(n);
|
|
488
|
+
for (const n of Object.keys(t.visibility ?? {}))
|
|
489
|
+
i.add(n);
|
|
490
|
+
for (const n of Object.keys(t.widths ?? {}))
|
|
491
|
+
i.add(n);
|
|
492
|
+
for (const n of Object.keys(t.pins ?? {}))
|
|
493
|
+
i.add(n);
|
|
489
494
|
return i;
|
|
490
|
-
},
|
|
491
|
-
const i =
|
|
495
|
+
}, D = (t) => {
|
|
496
|
+
const i = X();
|
|
492
497
|
if (!i)
|
|
493
498
|
return !1;
|
|
494
|
-
const
|
|
495
|
-
if (
|
|
499
|
+
const n = Y(t);
|
|
500
|
+
if (n.size === 0 || e.props.columns.length > 0)
|
|
496
501
|
return !0;
|
|
497
|
-
for (const c of
|
|
502
|
+
for (const c of n)
|
|
498
503
|
if (!i.has(c))
|
|
499
504
|
return !1;
|
|
500
505
|
return !0;
|
|
501
|
-
}, z = (t) =>
|
|
502
|
-
const i =
|
|
506
|
+
}, z = (t) => D(t.columns), C = (t) => {
|
|
507
|
+
const i = d();
|
|
503
508
|
if (!i)
|
|
504
509
|
return !1;
|
|
505
510
|
i.columns.setOrder(t.order);
|
|
506
|
-
for (const [
|
|
507
|
-
i.columns.setVisibility(
|
|
508
|
-
for (const [
|
|
509
|
-
i.columns.setWidth(
|
|
510
|
-
for (const [
|
|
511
|
-
i.columns.setPin(
|
|
511
|
+
for (const [n, c] of Object.entries(t.visibility))
|
|
512
|
+
i.columns.setVisibility(n, c);
|
|
513
|
+
for (const [n, c] of Object.entries(t.widths))
|
|
514
|
+
i.columns.setWidth(n, se(c));
|
|
515
|
+
for (const [n, c] of Object.entries(t.pins))
|
|
516
|
+
i.columns.setPin(n, c);
|
|
512
517
|
return !0;
|
|
513
|
-
},
|
|
514
|
-
if (
|
|
515
|
-
const t =
|
|
518
|
+
}, A = () => {
|
|
519
|
+
if (M) {
|
|
520
|
+
const t = M, i = d();
|
|
516
521
|
if (i) {
|
|
517
|
-
const
|
|
518
|
-
|
|
522
|
+
const n = i.state.migrate(t.state, { strict: t.options?.strict });
|
|
523
|
+
n && z(n) && (M = null, i.state.set(n, t.options), u = R(t.state));
|
|
519
524
|
}
|
|
520
525
|
}
|
|
521
|
-
if (h &&
|
|
526
|
+
if (h && D(h.columnState)) {
|
|
522
527
|
const t = h;
|
|
523
|
-
h = null, f =
|
|
528
|
+
h = null, f = R({
|
|
524
529
|
columnState: t.columnState,
|
|
525
530
|
columnOrder: null,
|
|
526
531
|
hiddenColumnKeys: null,
|
|
527
532
|
columnWidths: null,
|
|
528
533
|
columnPins: null
|
|
529
|
-
}),
|
|
534
|
+
}), C(t.columnState);
|
|
530
535
|
}
|
|
531
|
-
},
|
|
532
|
-
const t =
|
|
536
|
+
}, V = () => {
|
|
537
|
+
const t = d();
|
|
533
538
|
!t || e.props.groupBy === void 0 || t.rows.setGroupBy(e.props.groupBy ?? null);
|
|
534
|
-
},
|
|
535
|
-
const t =
|
|
539
|
+
}, T = () => {
|
|
540
|
+
const t = d();
|
|
536
541
|
!t || e.props.aggregationModel === void 0 || t.rows.setAggregationModel(e.props.aggregationModel ?? null);
|
|
537
|
-
},
|
|
538
|
-
const t =
|
|
542
|
+
}, K = () => {
|
|
543
|
+
const t = d();
|
|
539
544
|
!t || e.props.pivotModel === void 0 || t.pivot.setModel(e.props.pivotModel ?? null);
|
|
540
545
|
}, L = () => {
|
|
541
|
-
const t =
|
|
546
|
+
const t = d();
|
|
542
547
|
if (!t || e.props.columnState === void 0 && e.props.columnOrder === void 0 && e.props.hiddenColumnKeys === void 0 && e.props.columnWidths === void 0 && e.props.columnPins === void 0)
|
|
543
548
|
return;
|
|
544
|
-
const i =
|
|
549
|
+
const i = R({
|
|
545
550
|
columnState: e.props.columnState,
|
|
546
551
|
columnOrder: e.props.columnOrder,
|
|
547
552
|
hiddenColumnKeys: e.props.hiddenColumnKeys,
|
|
@@ -549,74 +554,74 @@ function at(e) {
|
|
|
549
554
|
columnPins: e.props.columnPins
|
|
550
555
|
});
|
|
551
556
|
if (i !== f) {
|
|
552
|
-
if (e.props.columnState && !e.props.columnOrder && !e.props.hiddenColumnKeys && !e.props.columnWidths && !e.props.columnPins &&
|
|
557
|
+
if (e.props.columnState && !e.props.columnOrder && !e.props.hiddenColumnKeys && !e.props.columnWidths && !e.props.columnPins && R(e.props.columnState) === O) {
|
|
553
558
|
f = i;
|
|
554
559
|
return;
|
|
555
560
|
}
|
|
556
561
|
if (e.props.columnState) {
|
|
557
562
|
t.columns.setOrder(e.props.columnState.order);
|
|
558
|
-
for (const [
|
|
559
|
-
t.columns.setVisibility(
|
|
560
|
-
for (const [
|
|
561
|
-
t.columns.setWidth(
|
|
562
|
-
for (const [
|
|
563
|
-
t.columns.setPin(
|
|
563
|
+
for (const [n, c] of Object.entries(e.props.columnState.visibility))
|
|
564
|
+
t.columns.setVisibility(n, c);
|
|
565
|
+
for (const [n, c] of Object.entries(e.props.columnState.widths))
|
|
566
|
+
t.columns.setWidth(n, se(c));
|
|
567
|
+
for (const [n, c] of Object.entries(e.props.columnState.pins))
|
|
568
|
+
t.columns.setPin(n, c);
|
|
564
569
|
}
|
|
565
570
|
if (e.props.columnOrder && t.columns.setOrder(e.props.columnOrder), e.props.hiddenColumnKeys) {
|
|
566
|
-
const
|
|
567
|
-
for (const
|
|
568
|
-
t.columns.setVisibility(
|
|
571
|
+
const n = new Set(e.props.hiddenColumnKeys), c = t.columns.getSnapshot();
|
|
572
|
+
for (const b of c.columns)
|
|
573
|
+
t.columns.setVisibility(b.key, !n.has(b.key));
|
|
569
574
|
}
|
|
570
575
|
if (e.props.columnWidths)
|
|
571
|
-
for (const [
|
|
572
|
-
t.columns.setWidth(
|
|
576
|
+
for (const [n, c] of Object.entries(e.props.columnWidths))
|
|
577
|
+
t.columns.setWidth(n, se(c));
|
|
573
578
|
if (e.props.columnPins)
|
|
574
|
-
for (const [
|
|
575
|
-
t.columns.setPin(
|
|
579
|
+
for (const [n, c] of Object.entries(e.props.columnPins))
|
|
580
|
+
t.columns.setPin(n, c);
|
|
576
581
|
f = i;
|
|
577
582
|
}
|
|
578
|
-
},
|
|
579
|
-
const t =
|
|
583
|
+
}, W = () => {
|
|
584
|
+
const t = d();
|
|
580
585
|
if (!t || e.props.state == null)
|
|
581
586
|
return;
|
|
582
|
-
const i =
|
|
587
|
+
const i = R(e.props.state);
|
|
583
588
|
if (i === u)
|
|
584
589
|
return;
|
|
585
590
|
if (i === B) {
|
|
586
591
|
u = i;
|
|
587
592
|
return;
|
|
588
593
|
}
|
|
589
|
-
const
|
|
590
|
-
|
|
591
|
-
},
|
|
592
|
-
const t =
|
|
594
|
+
const n = t.state.migrate(e.props.state, { strict: e.props.stateOptions?.strict });
|
|
595
|
+
n && z(n) && (t.state.set(n, e.props.stateOptions ?? {}), u = i);
|
|
596
|
+
}, H = () => {
|
|
597
|
+
const t = d();
|
|
593
598
|
t && (t.view.setRowHeightMode(e.props.rowHeightMode), t.view.setBaseRowHeight(Math.max(24, Math.trunc(e.props.baseRowHeight))));
|
|
594
599
|
}, E = () => {
|
|
595
|
-
const t =
|
|
600
|
+
const t = x();
|
|
596
601
|
t && (f = null, u = null, P(), o = t.rowModel.subscribe(() => {
|
|
597
|
-
|
|
598
|
-
}),
|
|
599
|
-
|
|
600
|
-
}),
|
|
601
|
-
},
|
|
602
|
+
y();
|
|
603
|
+
}), l = t.columnModel.subscribe(() => {
|
|
604
|
+
y();
|
|
605
|
+
}), W(), L(), F(), V(), T(), K(), H(), A(), y(), e.emit.ready({ api: t.api }));
|
|
606
|
+
}, Z = () => d()?.state.get() ?? null, ee = (t, i) => d()?.state.migrate(t, i) ?? null, te = (t) => D(t) ? (f = R({
|
|
602
607
|
columnState: t,
|
|
603
608
|
columnOrder: null,
|
|
604
609
|
hiddenColumnKeys: null,
|
|
605
610
|
columnWidths: null,
|
|
606
611
|
columnPins: null
|
|
607
|
-
}), h = null,
|
|
608
|
-
const
|
|
609
|
-
if (!
|
|
610
|
-
return
|
|
611
|
-
const c =
|
|
612
|
-
return c ? z(c) ? (
|
|
613
|
-
},
|
|
614
|
-
const
|
|
615
|
-
return
|
|
616
|
-
},
|
|
617
|
-
|
|
618
|
-
},
|
|
619
|
-
|
|
612
|
+
}), h = null, C(t) ? (y(), !0) : (h = { columnState: t }, !0)) : (h = { columnState: t }, !0), oe = (t, i) => {
|
|
613
|
+
const n = d();
|
|
614
|
+
if (!n)
|
|
615
|
+
return M = { state: t, options: i }, !0;
|
|
616
|
+
const c = n.state.migrate(t, { strict: i?.strict });
|
|
617
|
+
return c ? z(c) ? (n.state.set(c, i), u = R(t), M = null, y(), !0) : (M = { state: t, options: i }, !0) : !1;
|
|
618
|
+
}, _ = () => d()?.pivot.exportLayout() ?? null, k = () => d()?.pivot.exportInterop() ?? null, ne = (t, i) => {
|
|
619
|
+
const n = d();
|
|
620
|
+
return n ? (n.pivot.importLayout(t, i), y(), !0) : !1;
|
|
621
|
+
}, N = () => {
|
|
622
|
+
d()?.rows.expandAllGroups(), y();
|
|
623
|
+
}, re = () => {
|
|
624
|
+
d()?.rows.collapseAllGroups(), y();
|
|
620
625
|
};
|
|
621
626
|
p(
|
|
622
627
|
() => e.gridRef.value,
|
|
@@ -627,13 +632,13 @@ function at(e) {
|
|
|
627
632
|
), p(
|
|
628
633
|
() => e.props.columns,
|
|
629
634
|
() => {
|
|
630
|
-
f = null, u = null,
|
|
635
|
+
f = null, u = null, W(), L(), A(), y();
|
|
631
636
|
},
|
|
632
637
|
{ deep: !0 }
|
|
633
638
|
), p(
|
|
634
639
|
() => [e.props.state, e.props.stateOptions],
|
|
635
640
|
() => {
|
|
636
|
-
|
|
641
|
+
W(), L(), F(), V(), T(), K(), H(), A(), y();
|
|
637
642
|
},
|
|
638
643
|
{ deep: !0 }
|
|
639
644
|
), p(
|
|
@@ -645,58 +650,58 @@ function at(e) {
|
|
|
645
650
|
e.props.columnPins
|
|
646
651
|
],
|
|
647
652
|
() => {
|
|
648
|
-
L(),
|
|
653
|
+
L(), A(), y();
|
|
649
654
|
},
|
|
650
655
|
{ deep: !0 }
|
|
651
656
|
), p(
|
|
652
657
|
() => [e.props.sortModel, e.props.filterModel],
|
|
653
658
|
() => {
|
|
654
|
-
|
|
659
|
+
F(), y();
|
|
655
660
|
},
|
|
656
661
|
{ deep: !0 }
|
|
657
662
|
), p(
|
|
658
663
|
() => e.props.groupBy,
|
|
659
664
|
() => {
|
|
660
|
-
|
|
665
|
+
V(), y();
|
|
661
666
|
},
|
|
662
667
|
{ deep: !0 }
|
|
663
668
|
), p(
|
|
664
669
|
() => e.props.aggregationModel,
|
|
665
670
|
() => {
|
|
666
|
-
|
|
671
|
+
T(), y();
|
|
667
672
|
},
|
|
668
673
|
{ deep: !0 }
|
|
669
674
|
), p(
|
|
670
675
|
() => e.props.pivotModel,
|
|
671
676
|
() => {
|
|
672
|
-
|
|
677
|
+
K(), y();
|
|
673
678
|
},
|
|
674
679
|
{ deep: !0 }
|
|
675
680
|
), p(
|
|
676
681
|
() => [e.props.rowHeightMode, e.props.baseRowHeight],
|
|
677
682
|
() => {
|
|
678
|
-
|
|
683
|
+
H(), y();
|
|
679
684
|
}
|
|
680
685
|
);
|
|
681
|
-
const
|
|
686
|
+
const U = () => {
|
|
682
687
|
P();
|
|
683
688
|
};
|
|
684
|
-
return
|
|
685
|
-
|
|
689
|
+
return ce(() => {
|
|
690
|
+
U();
|
|
686
691
|
}), {
|
|
687
|
-
emitSnapshotUpdates:
|
|
692
|
+
emitSnapshotUpdates: y,
|
|
688
693
|
handleGridReady: E,
|
|
689
|
-
dispose:
|
|
690
|
-
getColumnState:
|
|
691
|
-
getState:
|
|
692
|
-
migrateState:
|
|
693
|
-
applyColumnState:
|
|
694
|
-
applyState:
|
|
695
|
-
exportPivotLayout:
|
|
696
|
-
exportPivotInterop:
|
|
697
|
-
importPivotLayout:
|
|
698
|
-
expandAllGroups:
|
|
699
|
-
collapseAllGroups:
|
|
694
|
+
dispose: U,
|
|
695
|
+
getColumnState: j,
|
|
696
|
+
getState: Z,
|
|
697
|
+
migrateState: ee,
|
|
698
|
+
applyColumnState: te,
|
|
699
|
+
applyState: oe,
|
|
700
|
+
exportPivotLayout: _,
|
|
701
|
+
exportPivotInterop: k,
|
|
702
|
+
importPivotLayout: ne,
|
|
703
|
+
expandAllGroups: N,
|
|
704
|
+
collapseAllGroups: re
|
|
700
705
|
};
|
|
701
706
|
}
|
|
702
707
|
function it() {
|
|
@@ -722,54 +727,54 @@ function it() {
|
|
|
722
727
|
}
|
|
723
728
|
};
|
|
724
729
|
}
|
|
725
|
-
function
|
|
726
|
-
const
|
|
727
|
-
if (
|
|
728
|
-
return async (
|
|
729
|
-
for (const f of
|
|
730
|
-
await f(
|
|
730
|
+
function J(e, o) {
|
|
731
|
+
const l = o.map((r) => r?.[e]).filter((r) => typeof r == "function");
|
|
732
|
+
if (l.length !== 0)
|
|
733
|
+
return async (r) => {
|
|
734
|
+
for (const f of l)
|
|
735
|
+
await f(r);
|
|
731
736
|
};
|
|
732
737
|
}
|
|
733
738
|
function ut(e) {
|
|
734
739
|
const {
|
|
735
740
|
userSelectionService: o,
|
|
736
|
-
cellSelectionService:
|
|
737
|
-
rowSelectionService:
|
|
741
|
+
cellSelectionService: l,
|
|
742
|
+
rowSelectionService: r
|
|
738
743
|
} = e;
|
|
739
744
|
return {
|
|
740
745
|
name: "selection",
|
|
741
|
-
init:
|
|
742
|
-
start:
|
|
743
|
-
stop:
|
|
744
|
-
dispose:
|
|
745
|
-
getSelectionSnapshot:
|
|
746
|
-
setSelectionSnapshot:
|
|
747
|
-
clearSelection:
|
|
748
|
-
getRowSelectionSnapshot:
|
|
749
|
-
setRowSelectionSnapshot:
|
|
750
|
-
clearRowSelection:
|
|
751
|
-
getFocusedRow:
|
|
752
|
-
setFocusedRow:
|
|
753
|
-
getSelectedRows:
|
|
754
|
-
isRowSelected:
|
|
755
|
-
setRowSelected:
|
|
756
|
-
selectRows:
|
|
757
|
-
deselectRows:
|
|
758
|
-
clearSelectedRows:
|
|
746
|
+
init: J("init", [o, l, r]),
|
|
747
|
+
start: J("start", [o, l, r]),
|
|
748
|
+
stop: J("stop", [o, l, r]),
|
|
749
|
+
dispose: J("dispose", [o, l, r]),
|
|
750
|
+
getSelectionSnapshot: l.getSelectionSnapshot,
|
|
751
|
+
setSelectionSnapshot: l.setSelectionSnapshot,
|
|
752
|
+
clearSelection: l.clearSelection,
|
|
753
|
+
getRowSelectionSnapshot: r.getRowSelectionSnapshot,
|
|
754
|
+
setRowSelectionSnapshot: r.setRowSelectionSnapshot,
|
|
755
|
+
clearRowSelection: r.clearRowSelection,
|
|
756
|
+
getFocusedRow: r.getFocusedRow,
|
|
757
|
+
setFocusedRow: r.setFocusedRow,
|
|
758
|
+
getSelectedRows: r.getSelectedRows,
|
|
759
|
+
isRowSelected: r.isRowSelected,
|
|
760
|
+
setRowSelected: r.setRowSelected,
|
|
761
|
+
selectRows: r.selectRows,
|
|
762
|
+
deselectRows: r.deselectRows,
|
|
763
|
+
clearSelectedRows: r.clearSelectedRows
|
|
759
764
|
};
|
|
760
765
|
}
|
|
761
766
|
function st(e, o) {
|
|
762
767
|
if (e?.focusedRow !== o?.focusedRow)
|
|
763
768
|
return !1;
|
|
764
|
-
const
|
|
765
|
-
if (
|
|
769
|
+
const l = e?.selectedRows ?? [], r = o?.selectedRows ?? [];
|
|
770
|
+
if (l.length !== r.length)
|
|
766
771
|
return !1;
|
|
767
|
-
for (let f = 0; f <
|
|
768
|
-
if (
|
|
772
|
+
for (let f = 0; f < l.length; f += 1)
|
|
773
|
+
if (l[f] !== r[f])
|
|
769
774
|
return !1;
|
|
770
775
|
return !0;
|
|
771
776
|
}
|
|
772
|
-
const dt =
|
|
777
|
+
const dt = he({
|
|
773
778
|
name: "DataGrid",
|
|
774
779
|
inheritAttrs: !1,
|
|
775
780
|
props: {
|
|
@@ -994,19 +999,19 @@ const dt = we({
|
|
|
994
999
|
"update:state": (e) => !0,
|
|
995
1000
|
ready: (e) => !0
|
|
996
1001
|
},
|
|
997
|
-
setup(e, { attrs: o, slots:
|
|
998
|
-
const u =
|
|
1002
|
+
setup(e, { attrs: o, slots: l, emit: r, expose: f }) {
|
|
1003
|
+
const u = $(null), v = $(e.viewMode === "gantt" ? "gantt" : "table"), s = $(e.state ?? null), w = g(() => qe(e.renderMode, e.pagination)), O = g(() => Je(
|
|
999
1004
|
e.pagination,
|
|
1000
1005
|
w.value,
|
|
1001
1006
|
e.pageSize,
|
|
1002
1007
|
e.currentPage
|
|
1003
|
-
)), B = g(() => De(e.columnMenu)), h = g(() => Ke(e.cellMenu)),
|
|
1008
|
+
)), B = g(() => De(e.columnMenu)), h = g(() => Ke(e.cellMenu)), M = g(() => Le(e.rowIndexMenu)), P = g(() => tt(e.columnLayout)), x = g(() => ot(e.aggregations)), d = g(() => $e(e.advancedFilter)), j = g(() => Ue(e.groupBy)), y = g(() => e.state ?? s.value), F = g(() => e.sortModel !== void 0 ? e.sortModel : y.value?.rows?.snapshot?.sortModel), X = g(() => e.filterModel !== void 0 ? e.filterModel : y.value?.rows?.snapshot?.filterModel ?? null), Y = g(() => e.groupBy !== void 0 ? j.value ?? null : y.value?.rows?.snapshot?.groupBy ?? null), D = g(() => e.pivotModel !== void 0 ? e.pivotModel : y.value?.rows?.snapshot?.pivotModel ?? null), z = g(() => nt(e.virtualization, w.value)), C = g(() => Qe(e.layoutMode, e.minRows, e.maxRows)), A = g(() => Ie({
|
|
1004
1009
|
columns: e.columns,
|
|
1005
1010
|
clientRowModelOptions: e.clientRowModelOptions,
|
|
1006
1011
|
computedFields: e.computedFields,
|
|
1007
1012
|
formulas: e.formulas,
|
|
1008
1013
|
formulaFunctions: e.formulaFunctions
|
|
1009
|
-
})), V = g(() => je(e.columns)),
|
|
1014
|
+
})), V = g(() => je(e.columns)), T = {
|
|
1010
1015
|
get state() {
|
|
1011
1016
|
return e.state;
|
|
1012
1017
|
},
|
|
@@ -1035,7 +1040,7 @@ const dt = we({
|
|
|
1035
1040
|
return e.filterModel;
|
|
1036
1041
|
},
|
|
1037
1042
|
get groupBy() {
|
|
1038
|
-
return
|
|
1043
|
+
return j.value;
|
|
1039
1044
|
},
|
|
1040
1045
|
get aggregationModel() {
|
|
1041
1046
|
return e.aggregationModel;
|
|
@@ -1052,73 +1057,73 @@ const dt = we({
|
|
|
1052
1057
|
get columns() {
|
|
1053
1058
|
return e.columns;
|
|
1054
1059
|
}
|
|
1055
|
-
},
|
|
1056
|
-
mode: g(() =>
|
|
1060
|
+
}, K = g(() => D.value ? "pivot" : A.value && "initialTreeData" in A.value ? "tree" : "base"), L = g(() => u.value?.api.columns.getSnapshot().visibleColumns ?? []), W = g(() => u.value?.api.rows.getCount() ?? 0), H = {
|
|
1061
|
+
mode: g(() => K.value),
|
|
1057
1062
|
resolveRuntime: () => u.value,
|
|
1058
|
-
visibleColumns:
|
|
1059
|
-
totalRows:
|
|
1063
|
+
visibleColumns: L,
|
|
1064
|
+
totalRows: W,
|
|
1060
1065
|
showRowSelection: g(() => e.rowSelection)
|
|
1061
1066
|
}, {
|
|
1062
|
-
selectionSnapshot:
|
|
1063
|
-
selectionAnchor:
|
|
1064
|
-
syncSelectionSnapshotFromRuntime:
|
|
1065
|
-
selectionService:
|
|
1066
|
-
selectionAggregatesLabel:
|
|
1067
|
-
} =
|
|
1068
|
-
rowSelectionSnapshot:
|
|
1069
|
-
syncRowSelectionSnapshotFromRuntime:
|
|
1070
|
-
reconcileRowSelectionFromRuntime:
|
|
1071
|
-
selectionService:
|
|
1067
|
+
selectionSnapshot: E,
|
|
1068
|
+
selectionAnchor: Z,
|
|
1069
|
+
syncSelectionSnapshotFromRuntime: ee,
|
|
1070
|
+
selectionService: te,
|
|
1071
|
+
selectionAggregatesLabel: oe
|
|
1072
|
+
} = Pe(H), {
|
|
1073
|
+
rowSelectionSnapshot: _,
|
|
1074
|
+
syncRowSelectionSnapshotFromRuntime: k,
|
|
1075
|
+
reconcileRowSelectionFromRuntime: ne,
|
|
1076
|
+
selectionService: N
|
|
1072
1077
|
} = xe({
|
|
1073
1078
|
resolveRuntime: () => u.value
|
|
1074
|
-
}),
|
|
1079
|
+
}), re = g(() => e.rowSelection ? N : it()), U = g(() => ({
|
|
1075
1080
|
...e.services ?? {},
|
|
1076
1081
|
selection: ut({
|
|
1077
1082
|
userSelectionService: e.services?.selection,
|
|
1078
|
-
cellSelectionService:
|
|
1079
|
-
rowSelectionService:
|
|
1083
|
+
cellSelectionService: te,
|
|
1084
|
+
rowSelectionService: re.value
|
|
1080
1085
|
})
|
|
1081
1086
|
})), {
|
|
1082
|
-
dataGridInstanceKey:
|
|
1083
|
-
resolvedRowModel:
|
|
1087
|
+
dataGridInstanceKey: t,
|
|
1088
|
+
resolvedRowModel: i
|
|
1084
1089
|
} = Fe({
|
|
1085
|
-
rows:
|
|
1086
|
-
rowModel:
|
|
1087
|
-
clientRowModelOptions:
|
|
1090
|
+
rows: ge(e, "rows"),
|
|
1091
|
+
rowModel: ge(e, "rowModel"),
|
|
1092
|
+
clientRowModelOptions: A,
|
|
1088
1093
|
onOwnedRowModelRecreated: () => {
|
|
1089
|
-
|
|
1094
|
+
n.dispose();
|
|
1090
1095
|
}
|
|
1091
|
-
}),
|
|
1096
|
+
}), n = at({
|
|
1092
1097
|
gridRef: u,
|
|
1093
|
-
props:
|
|
1098
|
+
props: T,
|
|
1094
1099
|
emit: {
|
|
1095
|
-
columnState: (a) =>
|
|
1096
|
-
columnOrder: (a) =>
|
|
1097
|
-
hiddenColumnKeys: (a) =>
|
|
1098
|
-
columnWidths: (a) =>
|
|
1099
|
-
columnPins: (a) =>
|
|
1100
|
-
groupBy: (a) =>
|
|
1100
|
+
columnState: (a) => r("update:columnState", a),
|
|
1101
|
+
columnOrder: (a) => r("update:columnOrder", a),
|
|
1102
|
+
hiddenColumnKeys: (a) => r("update:hiddenColumnKeys", a),
|
|
1103
|
+
columnWidths: (a) => r("update:columnWidths", a),
|
|
1104
|
+
columnPins: (a) => r("update:columnPins", a),
|
|
1105
|
+
groupBy: (a) => r("update:groupBy", a),
|
|
1101
1106
|
state: (a) => {
|
|
1102
|
-
s.value = a,
|
|
1107
|
+
s.value = a, r("update:state", a);
|
|
1103
1108
|
},
|
|
1104
|
-
ready: (a) =>
|
|
1109
|
+
ready: (a) => r("ready", {
|
|
1105
1110
|
api: a.api,
|
|
1106
|
-
rowModel:
|
|
1111
|
+
rowModel: i.value
|
|
1107
1112
|
})
|
|
1108
1113
|
}
|
|
1109
|
-
}),
|
|
1110
|
-
|
|
1111
|
-
},
|
|
1112
|
-
|
|
1113
|
-
},
|
|
1114
|
-
|
|
1115
|
-
},
|
|
1116
|
-
|
|
1114
|
+
}), c = (a) => {
|
|
1115
|
+
ne(), r("cell-change", a), n.emitSnapshotUpdates();
|
|
1116
|
+
}, b = (a) => {
|
|
1117
|
+
r("selection-change", a);
|
|
1118
|
+
}, S = (a) => {
|
|
1119
|
+
r("row-selection-change", a);
|
|
1120
|
+
}, fe = () => {
|
|
1121
|
+
n.emitSnapshotUpdates();
|
|
1117
1122
|
};
|
|
1118
1123
|
p(
|
|
1119
|
-
|
|
1124
|
+
_,
|
|
1120
1125
|
(a) => {
|
|
1121
|
-
|
|
1126
|
+
r("row-select", a), r("update:rowSelectionState", a), fe();
|
|
1122
1127
|
},
|
|
1123
1128
|
{ deep: !0 }
|
|
1124
1129
|
), p(
|
|
@@ -1126,62 +1131,62 @@ const dt = we({
|
|
|
1126
1131
|
([a, m]) => {
|
|
1127
1132
|
if (a) {
|
|
1128
1133
|
if (m !== void 0) {
|
|
1129
|
-
const
|
|
1130
|
-
st(
|
|
1134
|
+
const I = u.value?.api.rowSelection;
|
|
1135
|
+
st(_.value, m) || (m ? I?.setSnapshot(m) : I?.clear(), k());
|
|
1131
1136
|
return;
|
|
1132
1137
|
}
|
|
1133
|
-
|
|
1138
|
+
k();
|
|
1134
1139
|
return;
|
|
1135
1140
|
}
|
|
1136
|
-
|
|
1141
|
+
N.clearRowSelection?.();
|
|
1137
1142
|
},
|
|
1138
1143
|
{ immediate: !0 }
|
|
1139
1144
|
), p(
|
|
1140
1145
|
() => e.viewMode,
|
|
1141
1146
|
(a) => {
|
|
1142
|
-
|
|
1147
|
+
v.value = a === "gantt" ? "gantt" : "table";
|
|
1143
1148
|
},
|
|
1144
1149
|
{ immediate: !0 }
|
|
1145
1150
|
);
|
|
1146
|
-
const
|
|
1151
|
+
const me = (a) => {
|
|
1147
1152
|
const m = a === "gantt" ? "gantt" : "table";
|
|
1148
|
-
|
|
1149
|
-
},
|
|
1150
|
-
const a =
|
|
1151
|
-
return a ?
|
|
1153
|
+
v.value = m, r("update:viewMode", m);
|
|
1154
|
+
}, Re = () => {
|
|
1155
|
+
const a = n.getState();
|
|
1156
|
+
return a ? Q({
|
|
1152
1157
|
state: a,
|
|
1153
|
-
viewMode:
|
|
1158
|
+
viewMode: v.value
|
|
1154
1159
|
}) : null;
|
|
1155
|
-
}, Oe = (a, m) =>
|
|
1156
|
-
const
|
|
1157
|
-
return
|
|
1160
|
+
}, Oe = (a, m) => be(a, n.migrateState, m), Ae = (a, m) => {
|
|
1161
|
+
const I = Q(a);
|
|
1162
|
+
return n.applyState(I.state, m) ? (I.viewMode && me(I.viewMode), !0) : !1;
|
|
1158
1163
|
};
|
|
1159
|
-
return
|
|
1160
|
-
|
|
1164
|
+
return ce(() => {
|
|
1165
|
+
n.dispose();
|
|
1161
1166
|
}), f({
|
|
1162
1167
|
grid: u,
|
|
1163
|
-
rowModel:
|
|
1168
|
+
rowModel: i,
|
|
1164
1169
|
getApi: () => u.value?.api ?? null,
|
|
1165
1170
|
getRuntime: () => u.value?.runtime ?? null,
|
|
1166
1171
|
getCore: () => u.value?.core ?? null,
|
|
1167
|
-
getColumnState: () =>
|
|
1172
|
+
getColumnState: () => n.getColumnState(),
|
|
1168
1173
|
getColumnSnapshot: () => u.value?.api.columns.getSnapshot() ?? null,
|
|
1169
|
-
getSelectionAggregatesLabel: () =>
|
|
1174
|
+
getSelectionAggregatesLabel: () => oe.value,
|
|
1170
1175
|
getSelectionSummary: () => u.value?.api.selection.summarize() ?? null,
|
|
1171
|
-
getView: () =>
|
|
1172
|
-
setView:
|
|
1173
|
-
getSavedView:
|
|
1176
|
+
getView: () => v.value,
|
|
1177
|
+
setView: me,
|
|
1178
|
+
getSavedView: Re,
|
|
1174
1179
|
migrateSavedView: Oe,
|
|
1175
|
-
applySavedView:
|
|
1176
|
-
applyColumnState:
|
|
1177
|
-
getState:
|
|
1178
|
-
migrateState:
|
|
1179
|
-
applyState:
|
|
1180
|
-
exportPivotLayout:
|
|
1181
|
-
exportPivotInterop:
|
|
1182
|
-
importPivotLayout:
|
|
1183
|
-
expandAllGroups:
|
|
1184
|
-
collapseAllGroups:
|
|
1180
|
+
applySavedView: Ae,
|
|
1181
|
+
applyColumnState: n.applyColumnState,
|
|
1182
|
+
getState: n.getState,
|
|
1183
|
+
migrateState: n.migrateState,
|
|
1184
|
+
applyState: n.applyState,
|
|
1185
|
+
exportPivotLayout: n.exportPivotLayout,
|
|
1186
|
+
exportPivotInterop: n.exportPivotInterop,
|
|
1187
|
+
importPivotLayout: n.importPivotLayout,
|
|
1188
|
+
expandAllGroups: n.expandAllGroups,
|
|
1189
|
+
collapseAllGroups: n.collapseAllGroups,
|
|
1185
1190
|
insertRowsAt: (a, m) => u.value?.api.rows.insertDataAt(a, m) ?? !1,
|
|
1186
1191
|
insertRowBefore: (a, m) => u.value?.api.rows.insertDataBefore(a, m) ?? !1,
|
|
1187
1192
|
insertRowAfter: (a, m) => u.value?.api.rows.insertDataAfter(a, m) ?? !1,
|
|
@@ -1190,33 +1195,33 @@ const dt = we({
|
|
|
1190
1195
|
insertColumnAfter: (a, m) => u.value?.api.columns.insertAfter(a, m) ?? !1
|
|
1191
1196
|
}), () => {
|
|
1192
1197
|
const a = {
|
|
1193
|
-
mode:
|
|
1198
|
+
mode: K.value,
|
|
1194
1199
|
rows: e.rows,
|
|
1195
1200
|
runtime: u.value?.runtime ?? null,
|
|
1196
1201
|
runtimeRowModel: u.value?.rowModel ?? null,
|
|
1197
|
-
selectionSnapshot:
|
|
1198
|
-
selectionAnchor:
|
|
1199
|
-
rowSelectionSnapshot:
|
|
1200
|
-
syncSelectionSnapshotFromRuntime:
|
|
1201
|
-
syncRowSelectionSnapshotFromRuntime:
|
|
1202
|
-
flushRowSelectionSnapshotUpdates:
|
|
1203
|
-
sortModel:
|
|
1204
|
-
filterModel:
|
|
1205
|
-
groupBy:
|
|
1206
|
-
pivotModel:
|
|
1202
|
+
selectionSnapshot: E,
|
|
1203
|
+
selectionAnchor: Z,
|
|
1204
|
+
rowSelectionSnapshot: _,
|
|
1205
|
+
syncSelectionSnapshotFromRuntime: ee,
|
|
1206
|
+
syncRowSelectionSnapshotFromRuntime: k,
|
|
1207
|
+
flushRowSelectionSnapshotUpdates: fe,
|
|
1208
|
+
sortModel: F.value,
|
|
1209
|
+
filterModel: X.value,
|
|
1210
|
+
groupBy: Y.value,
|
|
1211
|
+
pivotModel: D.value,
|
|
1207
1212
|
renderMode: w.value,
|
|
1208
|
-
virtualization:
|
|
1213
|
+
virtualization: z.value,
|
|
1209
1214
|
columnMenu: B.value,
|
|
1210
1215
|
cellMenu: h.value,
|
|
1211
|
-
rowIndexMenu:
|
|
1216
|
+
rowIndexMenu: M.value,
|
|
1212
1217
|
columnLayout: P.value,
|
|
1213
|
-
aggregations:
|
|
1218
|
+
aggregations: x.value,
|
|
1214
1219
|
advancedFilter: d.value,
|
|
1215
1220
|
rowHeightMode: e.rowHeightMode,
|
|
1216
1221
|
baseRowHeight: e.baseRowHeight,
|
|
1217
|
-
layoutMode:
|
|
1218
|
-
minRows:
|
|
1219
|
-
maxRows:
|
|
1222
|
+
layoutMode: C.value.layoutMode,
|
|
1223
|
+
minRows: C.value.minRows,
|
|
1224
|
+
maxRows: C.value.maxRows,
|
|
1220
1225
|
fillHandle: e.fillHandle,
|
|
1221
1226
|
rangeMove: e.rangeMove,
|
|
1222
1227
|
rowHover: e.rowHover,
|
|
@@ -1224,33 +1229,33 @@ const dt = we({
|
|
|
1224
1229
|
isCellEditable: e.isCellEditable,
|
|
1225
1230
|
showRowIndex: e.showRowIndex,
|
|
1226
1231
|
rowSelection: e.rowSelection,
|
|
1227
|
-
viewMode:
|
|
1232
|
+
viewMode: v.value,
|
|
1228
1233
|
gantt: e.gantt,
|
|
1229
1234
|
toolbarModules: e.toolbarModules
|
|
1230
1235
|
};
|
|
1231
|
-
return
|
|
1236
|
+
return de(
|
|
1232
1237
|
rt,
|
|
1233
1238
|
{
|
|
1234
1239
|
...o,
|
|
1235
1240
|
ref: u,
|
|
1236
|
-
key:
|
|
1241
|
+
key: t.value,
|
|
1237
1242
|
rows: e.rows,
|
|
1238
|
-
rowModel:
|
|
1243
|
+
rowModel: i.value,
|
|
1239
1244
|
columns: V.value,
|
|
1240
1245
|
theme: e.theme,
|
|
1241
|
-
layoutMode:
|
|
1246
|
+
layoutMode: C.value.layoutMode,
|
|
1242
1247
|
renderMode: w.value,
|
|
1243
|
-
pagination:
|
|
1248
|
+
pagination: O.value,
|
|
1244
1249
|
plugins: e.plugins,
|
|
1245
|
-
services:
|
|
1250
|
+
services: U.value,
|
|
1246
1251
|
startupOrder: e.startupOrder,
|
|
1247
1252
|
autoStart: e.autoStart,
|
|
1248
|
-
onCellChange:
|
|
1249
|
-
onSelectionChange:
|
|
1250
|
-
onRowSelectionChange:
|
|
1253
|
+
onCellChange: c,
|
|
1254
|
+
onSelectionChange: b,
|
|
1255
|
+
onRowSelectionChange: S
|
|
1251
1256
|
},
|
|
1252
|
-
|
|
1253
|
-
default: (m) =>
|
|
1257
|
+
l.default ? {
|
|
1258
|
+
default: (m) => l.default?.({
|
|
1254
1259
|
...m,
|
|
1255
1260
|
defaultRendererProps: {
|
|
1256
1261
|
...a,
|
|
@@ -1259,7 +1264,7 @@ const dt = we({
|
|
|
1259
1264
|
}
|
|
1260
1265
|
})
|
|
1261
1266
|
} : {
|
|
1262
|
-
default: (m) =>
|
|
1267
|
+
default: (m) => de(ze, {
|
|
1263
1268
|
...a,
|
|
1264
1269
|
runtime: m.runtime,
|
|
1265
1270
|
runtimeRowModel: m.rowModel
|
|
@@ -1268,12 +1273,12 @@ const dt = we({
|
|
|
1268
1273
|
);
|
|
1269
1274
|
};
|
|
1270
1275
|
}
|
|
1271
|
-
}),
|
|
1276
|
+
}), Mt = dt;
|
|
1272
1277
|
export {
|
|
1273
|
-
|
|
1278
|
+
Mt as DataGrid,
|
|
1274
1279
|
ht as clearDataGridSavedViewInStorage,
|
|
1275
1280
|
dt as default,
|
|
1276
|
-
|
|
1281
|
+
be as migrateDataGridSavedView,
|
|
1277
1282
|
et as parseDataGridSavedView,
|
|
1278
1283
|
St as readDataGridSavedViewFromStorage,
|
|
1279
1284
|
Ze as serializeDataGridSavedView,
|