@affino/datagrid-vue-app 0.1.63 → 0.4.0
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 +25 -7
- package/dist/DataGrid.d.ts +1 -3
- package/dist/advanced-filter.js +1 -1
- package/dist/aggregations.js +1 -1
- package/dist/chunks/{DataGridAdvancedFilterPopover-BmEL_QzN.js → DataGridAdvancedFilterPopover-p_hnZLCA.js} +1 -1
- package/dist/chunks/{DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-BkrpyjJb.js → DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-AVmOe3Bv.js} +1 -1
- package/dist/chunks/{DataGridAggregationsPopover-D-HP10PE.js → DataGridAggregationsPopover-Bzbn6Nuy.js} +1 -1
- package/dist/chunks/{DataGridAggregationsPopover.vue_vue_type_script_setup_true_lang-VYIMuuIQ.js → DataGridAggregationsPopover.vue_vue_type_script_setup_true_lang-TgxL5evy.js} +1 -1
- package/dist/chunks/DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-CpC_nuMk.js +419 -0
- package/dist/chunks/DataGridGanttStageEntry-Cypf1c3l.js +12522 -0
- package/dist/chunks/useDataGridAppRowModel-b5bfkfo3.js +5574 -0
- package/dist/gantt.js +1 -1
- package/dist/host/DataGridDefaultRenderer.d.ts +1 -1
- package/dist/index.js +694 -674
- package/dist/internal.js +3 -3
- package/dist/overlays/DataGridCellComboboxEditor.vue.d.ts +1 -0
- package/dist/perf/dataGridPerfTrace.d.ts +7 -0
- package/dist/stage/DataGridTableStageCenterPane.vue.d.ts +18 -0
- package/dist/stage/DataGridTableStagePinnedPane.vue.d.ts +10 -1
- package/dist/stage/dataGridMouseEventGuards.d.ts +8 -0
- package/dist/stage/dataGridTableStage.types.d.ts +5 -1
- package/dist/stage/dataGridTableStageA11y.d.ts +4 -0
- package/dist/stage/dataGridTableStageBody.types.d.ts +6 -0
- package/dist/stage/useDataGridStageCellRendering.d.ts +1 -1
- package/dist/stage/useDataGridStageCellState.d.ts +2 -0
- package/dist/stage/useDataGridStageChromeCanvas.d.ts +1 -0
- package/dist/stage/useDataGridStageFocusRuntime.d.ts +1 -0
- package/dist/stage/useDataGridStageOverlays.d.ts +1 -0
- package/dist/stage/useDataGridStagePanes.grouped.d.ts +6 -0
- package/dist/stage/useDataGridStageRenderApis.d.ts +6 -0
- package/dist/stage/useDataGridStageRenderApis.grouped.d.ts +6 -0
- package/dist/stage/useDataGridStageRowIndex.d.ts +1 -0
- package/dist/stage/useDataGridStageViewportRuntime.d.ts +4 -0
- package/dist/stage/useDataGridTableStageHistory.d.ts +3 -0
- package/dist/stage/useDataGridTableStageRuntime.d.ts +3 -0
- package/dist/stage/useDataGridTableStageScrollSync.d.ts +8 -0
- package/package.json +7 -7
- package/dist/chunks/DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-Dt_KqrSU.js +0 -405
- package/dist/chunks/DataGridGanttStageEntry-D6OYD0Gx.js +0 -11781
- package/dist/chunks/useDataGridAppRowModel-9ZIepsHi.js +0 -5281
package/dist/index.js
CHANGED
|
@@ -1,70 +1,64 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as nt, ref as V, provide as Dt, computed as y, watch as C, onBeforeUnmount as Be, h as xe, mergeProps as Ft, nextTick as Ve, unref as Ue, toRef as _e, onMounted as Bt } from "vue";
|
|
2
2
|
import { useDataGridRuntime as Gt, cloneDataGridFilterSnapshot as jt } from "@affino/datagrid-vue";
|
|
3
|
-
import { useDataGridAppSelection as
|
|
4
|
-
import { r as
|
|
5
|
-
import { a as mo, m as yo, o as vo } from "./chunks/useDataGridAppRowModel-
|
|
3
|
+
import { useDataGridAppSelection as Lt, useDataGridAppRowSelection as Et } from "@affino/datagrid-vue/app";
|
|
4
|
+
import { r as Kt, g as zt, h as Ht, i as Tt, j as kt, b as Vt, n as be, k as Ut, d as _t, c as Wt, l as Nt, u as qt, D as $t } from "./chunks/useDataGridAppRowModel-b5bfkfo3.js";
|
|
5
|
+
import { a as mo, m as yo, o as vo } from "./chunks/useDataGridAppRowModel-b5bfkfo3.js";
|
|
6
6
|
import { r as Jt } from "./chunks/dataGridAdvancedFilter-xnME5bRa.js";
|
|
7
|
-
import { r as
|
|
8
|
-
import { applyGridTheme as
|
|
9
|
-
import { d as
|
|
10
|
-
function
|
|
7
|
+
import { r as Zt } from "./chunks/DataGridGanttStageEntry-Cypf1c3l.js";
|
|
8
|
+
import { applyGridTheme as Yt, resolveGridThemeTokens as Qt, defaultStyleConfig as ee, sugarTheme as ot, industrialNeutralTheme as We } from "@affino/datagrid-theme";
|
|
9
|
+
import { d as Xt } from "./chunks/dataGridOverlayThemeVars-vzY74EIz.js";
|
|
10
|
+
function Qn() {
|
|
11
11
|
return (e) => e;
|
|
12
12
|
}
|
|
13
13
|
const en = {
|
|
14
|
-
default:
|
|
15
|
-
"industrial-neutral":
|
|
16
|
-
industrialNeutral:
|
|
17
|
-
sugar:
|
|
14
|
+
default: ee,
|
|
15
|
+
"industrial-neutral": We,
|
|
16
|
+
industrialNeutral: We,
|
|
17
|
+
sugar: ot
|
|
18
18
|
};
|
|
19
19
|
function tn(e, t) {
|
|
20
20
|
if (!e && !t)
|
|
21
21
|
return;
|
|
22
|
-
const
|
|
22
|
+
const l = {
|
|
23
23
|
...e ?? {}
|
|
24
24
|
};
|
|
25
25
|
for (const [o, d] of Object.entries(t ?? {}))
|
|
26
|
-
|
|
27
|
-
...
|
|
26
|
+
l[o] = {
|
|
27
|
+
...l[o] ?? {},
|
|
28
28
|
...d
|
|
29
29
|
};
|
|
30
|
-
return
|
|
30
|
+
return l;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function Re(e, t) {
|
|
33
33
|
return {
|
|
34
34
|
...e,
|
|
35
35
|
...t,
|
|
36
|
-
grid: { ...e.grid ?? {}, ...t.grid ?? {} },
|
|
37
|
-
header: { ...e.header ?? {}, ...t.header ?? {} },
|
|
38
|
-
body: { ...e.body ?? {}, ...t.body ?? {} },
|
|
39
|
-
group: { ...e.group ?? {}, ...t.group ?? {} },
|
|
40
|
-
summary: { ...e.summary ?? {}, ...t.summary ?? {} },
|
|
41
|
-
state: { ...e.state ?? {}, ...t.state ?? {} },
|
|
42
36
|
tokens: { ...e.tokens ?? {}, ...t.tokens ?? {} },
|
|
43
37
|
tokenVariants: tn(e.tokenVariants, t.tokenVariants)
|
|
44
38
|
};
|
|
45
39
|
}
|
|
46
40
|
function nn(e) {
|
|
47
|
-
return !e || typeof e != "object" ? !1 : "tokens" in e || "tokenVariants" in e || "activeTokenVariant" in e || "defaultTokenVariant" in e || "inheritThemeFromDocument" in e || "documentDarkClass" in e
|
|
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;
|
|
48
42
|
}
|
|
49
43
|
function on(e) {
|
|
50
|
-
return e == null ?
|
|
44
|
+
return e == null ? ee : typeof e == "string" ? e === "sugar" ? Re(ee, ot) : en[e] ?? ee : nn(e) ? Re(ee, e) : Re(ee, {
|
|
51
45
|
tokens: e
|
|
52
46
|
});
|
|
53
47
|
}
|
|
54
48
|
function rn(e) {
|
|
55
49
|
const t = on(e);
|
|
56
|
-
return
|
|
50
|
+
return Qt(t ?? ee, {
|
|
57
51
|
document: typeof document > "u" ? void 0 : document
|
|
58
52
|
});
|
|
59
53
|
}
|
|
60
|
-
function
|
|
61
|
-
const
|
|
62
|
-
return
|
|
54
|
+
function Ne(e, t) {
|
|
55
|
+
const l = rn(t);
|
|
56
|
+
return Yt(e, l), l;
|
|
63
57
|
}
|
|
64
|
-
function
|
|
58
|
+
function qe(e, t) {
|
|
65
59
|
return Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : t;
|
|
66
60
|
}
|
|
67
|
-
function
|
|
61
|
+
function $e(e, t) {
|
|
68
62
|
return Number.isFinite(e) ? Math.max(1, Math.trunc(e)) : t;
|
|
69
63
|
}
|
|
70
64
|
function ln(e) {
|
|
@@ -76,7 +70,7 @@ function ln(e) {
|
|
|
76
70
|
return t ? { fields: [t], expandedByDefault: !0 } : null;
|
|
77
71
|
}
|
|
78
72
|
if (Array.isArray(e)) {
|
|
79
|
-
const t = e.map((
|
|
73
|
+
const t = e.map((l) => l.trim()).filter((l) => l.length > 0);
|
|
80
74
|
return t.length > 0 ? { fields: [...t], expandedByDefault: !0 } : null;
|
|
81
75
|
}
|
|
82
76
|
return e;
|
|
@@ -85,16 +79,16 @@ function ln(e) {
|
|
|
85
79
|
function an(e, t) {
|
|
86
80
|
return t === !0 || t && typeof t == "object" ? "pagination" : e ?? "virtualization";
|
|
87
81
|
}
|
|
88
|
-
function un(e, t,
|
|
82
|
+
function un(e, t, l, o) {
|
|
89
83
|
if (t !== "pagination")
|
|
90
84
|
return null;
|
|
91
|
-
const d = 100,
|
|
85
|
+
const d = 100, i = $e(l, d), w = qe(o, 0);
|
|
92
86
|
return e === !0 || e === !1 || e == null ? {
|
|
93
|
-
pageSize:
|
|
94
|
-
currentPage:
|
|
87
|
+
pageSize: i,
|
|
88
|
+
currentPage: w
|
|
95
89
|
} : {
|
|
96
|
-
pageSize:
|
|
97
|
-
currentPage:
|
|
90
|
+
pageSize: $e(l ?? e.pageSize, d),
|
|
91
|
+
currentPage: qe(o ?? e.currentPage, 0)
|
|
98
92
|
};
|
|
99
93
|
}
|
|
100
94
|
function sn(e) {
|
|
@@ -103,12 +97,12 @@ function sn(e) {
|
|
|
103
97
|
function dn(e) {
|
|
104
98
|
if (!e)
|
|
105
99
|
return null;
|
|
106
|
-
const t = typeof e == "string" ? { key: e } : e,
|
|
107
|
-
if (!
|
|
100
|
+
const t = typeof e == "string" ? { key: e } : e, l = t.key.trim();
|
|
101
|
+
if (!l)
|
|
108
102
|
return null;
|
|
109
103
|
const o = t.includeViewportPosition !== !1, d = t.restoreOnReady !== !1;
|
|
110
104
|
return {
|
|
111
|
-
key:
|
|
105
|
+
key: l,
|
|
112
106
|
storage: t.storage ?? "local",
|
|
113
107
|
includeViewportPosition: o,
|
|
114
108
|
restoreOnReady: d,
|
|
@@ -120,36 +114,36 @@ function dn(e) {
|
|
|
120
114
|
}
|
|
121
115
|
};
|
|
122
116
|
}
|
|
123
|
-
function
|
|
117
|
+
function Je(e) {
|
|
124
118
|
return typeof e == "object" && e !== null ? e : typeof window > "u" ? null : e === "session" ? window.sessionStorage : window.localStorage;
|
|
125
119
|
}
|
|
126
|
-
const
|
|
120
|
+
const Pe = "Search rows", Ie = "contains", De = "input", Fe = 300;
|
|
127
121
|
function cn(e) {
|
|
128
|
-
return typeof e == "string" && e.trim().length > 0 ? e.trim() :
|
|
122
|
+
return typeof e == "string" && e.trim().length > 0 ? e.trim() : Pe;
|
|
129
123
|
}
|
|
130
124
|
function fn(e) {
|
|
131
|
-
return e === "tokens" ? "tokens" :
|
|
125
|
+
return e === "tokens" ? "tokens" : Ie;
|
|
132
126
|
}
|
|
133
127
|
function mn(e) {
|
|
134
|
-
return e === "debounce" || e === "manual" ? e :
|
|
128
|
+
return e === "debounce" || e === "manual" ? e : De;
|
|
135
129
|
}
|
|
136
130
|
function yn(e) {
|
|
137
|
-
return typeof e != "number" || !Number.isFinite(e) ?
|
|
131
|
+
return typeof e != "number" || !Number.isFinite(e) ? Fe : Math.max(0, Math.trunc(e));
|
|
138
132
|
}
|
|
139
133
|
function vn(e) {
|
|
140
134
|
if (!Array.isArray(e))
|
|
141
135
|
return null;
|
|
142
|
-
const t = e.map((
|
|
136
|
+
const t = e.map((l) => l.trim()).filter((l, o, d) => l.length > 0 && d.indexOf(l) === o);
|
|
143
137
|
return t.length > 0 ? Object.freeze(t) : null;
|
|
144
138
|
}
|
|
145
139
|
function pn(e) {
|
|
146
140
|
return Object.freeze(typeof e == "boolean" ? {
|
|
147
141
|
enabled: e,
|
|
148
|
-
placeholder:
|
|
142
|
+
placeholder: Pe,
|
|
149
143
|
columns: null,
|
|
150
|
-
mode:
|
|
151
|
-
applyMode:
|
|
152
|
-
debounceMs:
|
|
144
|
+
mode: Ie,
|
|
145
|
+
applyMode: De,
|
|
146
|
+
debounceMs: Fe
|
|
153
147
|
} : e ? {
|
|
154
148
|
enabled: !0,
|
|
155
149
|
placeholder: cn(e.placeholder),
|
|
@@ -159,75 +153,75 @@ function pn(e) {
|
|
|
159
153
|
debounceMs: yn(e.debounceMs)
|
|
160
154
|
} : {
|
|
161
155
|
enabled: !1,
|
|
162
|
-
placeholder:
|
|
156
|
+
placeholder: Pe,
|
|
163
157
|
columns: null,
|
|
164
|
-
mode:
|
|
165
|
-
applyMode:
|
|
166
|
-
debounceMs:
|
|
158
|
+
mode: Ie,
|
|
159
|
+
applyMode: De,
|
|
160
|
+
debounceMs: Fe
|
|
167
161
|
});
|
|
168
162
|
}
|
|
169
|
-
const
|
|
170
|
-
function
|
|
163
|
+
const Me = "Find / replace";
|
|
164
|
+
function wn(e) {
|
|
171
165
|
return typeof e == "boolean" ? {
|
|
172
166
|
enabled: e,
|
|
173
|
-
buttonLabel:
|
|
167
|
+
buttonLabel: Me
|
|
174
168
|
} : e ? {
|
|
175
169
|
enabled: e.enabled ?? !0,
|
|
176
|
-
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() :
|
|
170
|
+
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() : Me
|
|
177
171
|
} : {
|
|
178
172
|
enabled: !1,
|
|
179
|
-
buttonLabel:
|
|
173
|
+
buttonLabel: Me
|
|
180
174
|
};
|
|
181
175
|
}
|
|
182
|
-
const
|
|
176
|
+
const gn = "all", rt = {
|
|
183
177
|
all: "columns",
|
|
184
178
|
rows: "none",
|
|
185
179
|
columns: "columns",
|
|
186
180
|
none: "none"
|
|
187
181
|
};
|
|
188
|
-
function
|
|
189
|
-
return e === "rows" || e === "columns" || e === "none" || e === "all" ? e :
|
|
182
|
+
function Ze(e) {
|
|
183
|
+
return e === "rows" || e === "columns" || e === "none" || e === "all" ? e : gn;
|
|
190
184
|
}
|
|
191
185
|
function Sn(e, t) {
|
|
192
|
-
return e === "columns" || e === "none" ? e :
|
|
186
|
+
return e === "columns" || e === "none" ? e : rt[t];
|
|
193
187
|
}
|
|
194
|
-
function
|
|
188
|
+
function Ye(e, t) {
|
|
195
189
|
return e !== "none" || t === "columns";
|
|
196
190
|
}
|
|
197
|
-
function
|
|
198
|
-
const t = e.body === "all" || e.body === "rows",
|
|
191
|
+
function Qe(e) {
|
|
192
|
+
const t = e.body === "all" || e.body === "rows", l = e.body === "all" || e.body === "columns", o = e.header === "columns";
|
|
199
193
|
return {
|
|
200
194
|
body: e.body,
|
|
201
195
|
header: e.header,
|
|
202
196
|
pinnedSeparators: e.pinnedSeparators,
|
|
203
197
|
bodyRows: t,
|
|
204
|
-
bodyColumns:
|
|
198
|
+
bodyColumns: l,
|
|
205
199
|
headerColumns: o
|
|
206
200
|
};
|
|
207
201
|
}
|
|
208
202
|
function hn(e) {
|
|
209
203
|
if (typeof e == "string") {
|
|
210
|
-
const o =
|
|
211
|
-
return
|
|
204
|
+
const o = Ze(e), d = rt[o];
|
|
205
|
+
return Qe({
|
|
212
206
|
body: o,
|
|
213
207
|
header: d,
|
|
214
|
-
pinnedSeparators:
|
|
208
|
+
pinnedSeparators: Ye(o, d)
|
|
215
209
|
});
|
|
216
210
|
}
|
|
217
|
-
const t =
|
|
218
|
-
return
|
|
211
|
+
const t = Ze(e?.body), l = Sn(e?.header, t);
|
|
212
|
+
return Qe({
|
|
219
213
|
body: t,
|
|
220
|
-
header:
|
|
221
|
-
pinnedSeparators: typeof e?.pinnedSeparators == "boolean" ? e.pinnedSeparators :
|
|
214
|
+
header: l,
|
|
215
|
+
pinnedSeparators: typeof e?.pinnedSeparators == "boolean" ? e.pinnedSeparators : Ye(t, l)
|
|
222
216
|
});
|
|
223
217
|
}
|
|
224
|
-
function
|
|
218
|
+
function Xe(e) {
|
|
225
219
|
if (typeof e != "number" || !Number.isFinite(e))
|
|
226
220
|
return null;
|
|
227
221
|
const t = Math.max(0, Math.trunc(e));
|
|
228
222
|
return t > 0 ? t : null;
|
|
229
223
|
}
|
|
230
|
-
function bn(e, t,
|
|
224
|
+
function bn(e, t, l) {
|
|
231
225
|
const o = e === "auto-height" ? "auto-height" : "fill";
|
|
232
226
|
if (o !== "auto-height")
|
|
233
227
|
return {
|
|
@@ -235,12 +229,12 @@ function bn(e, t, r) {
|
|
|
235
229
|
minRows: null,
|
|
236
230
|
maxRows: null
|
|
237
231
|
};
|
|
238
|
-
const d =
|
|
239
|
-
let
|
|
240
|
-
return d !== null &&
|
|
232
|
+
const d = Xe(t);
|
|
233
|
+
let i = Xe(l);
|
|
234
|
+
return d !== null && i !== null && i < d && (i = d), {
|
|
241
235
|
layoutMode: o,
|
|
242
236
|
minRows: d,
|
|
243
|
-
maxRows:
|
|
237
|
+
maxRows: i
|
|
244
238
|
};
|
|
245
239
|
}
|
|
246
240
|
function Rn(e) {
|
|
@@ -249,7 +243,7 @@ function Rn(e) {
|
|
|
249
243
|
transaction: null
|
|
250
244
|
};
|
|
251
245
|
}
|
|
252
|
-
function
|
|
246
|
+
function me(e) {
|
|
253
247
|
return {
|
|
254
248
|
...e,
|
|
255
249
|
state: Rn(e.state)
|
|
@@ -258,43 +252,43 @@ function de(e) {
|
|
|
258
252
|
function Mn(e) {
|
|
259
253
|
return typeof e == "object" && e !== null;
|
|
260
254
|
}
|
|
261
|
-
function
|
|
262
|
-
const o = Mn(e) ? e : null, d = t(o && "state" in o ? o.state : e,
|
|
255
|
+
function lt(e, t, l) {
|
|
256
|
+
const o = Mn(e) ? e : null, d = t(o && "state" in o ? o.state : e, l);
|
|
263
257
|
if (!d)
|
|
264
258
|
return null;
|
|
265
|
-
const
|
|
266
|
-
return
|
|
259
|
+
const i = o?.viewMode, w = i === "gantt" ? "gantt" : i === "table" ? "table" : void 0;
|
|
260
|
+
return me({
|
|
267
261
|
state: d,
|
|
268
|
-
...
|
|
262
|
+
...w ? { viewMode: w } : {}
|
|
269
263
|
});
|
|
270
264
|
}
|
|
271
|
-
function
|
|
272
|
-
return JSON.stringify(
|
|
265
|
+
function On(e) {
|
|
266
|
+
return JSON.stringify(me(e));
|
|
273
267
|
}
|
|
274
|
-
function
|
|
268
|
+
function Cn(e, t, l) {
|
|
275
269
|
if (typeof e != "string" || e.trim().length === 0)
|
|
276
270
|
return null;
|
|
277
271
|
try {
|
|
278
|
-
return
|
|
272
|
+
return lt(JSON.parse(e), t, l);
|
|
279
273
|
} catch {
|
|
280
274
|
return null;
|
|
281
275
|
}
|
|
282
276
|
}
|
|
283
|
-
function
|
|
277
|
+
function Xn(e, t, l) {
|
|
284
278
|
if (!e || typeof t != "string" || t.trim().length === 0)
|
|
285
279
|
return !1;
|
|
286
280
|
try {
|
|
287
|
-
return e.setItem(t,
|
|
281
|
+
return e.setItem(t, On(l)), !0;
|
|
288
282
|
} catch {
|
|
289
283
|
return !1;
|
|
290
284
|
}
|
|
291
285
|
}
|
|
292
|
-
function eo(e, t,
|
|
286
|
+
function eo(e, t, l, o) {
|
|
293
287
|
if (!e || typeof t != "string" || t.trim().length === 0)
|
|
294
288
|
return null;
|
|
295
289
|
try {
|
|
296
290
|
const d = e.getItem(t);
|
|
297
|
-
return d ?
|
|
291
|
+
return d ? Cn(d, l, o) : null;
|
|
298
292
|
} catch {
|
|
299
293
|
return null;
|
|
300
294
|
}
|
|
@@ -308,41 +302,41 @@ function to(e, t) {
|
|
|
308
302
|
return !1;
|
|
309
303
|
}
|
|
310
304
|
}
|
|
311
|
-
const
|
|
305
|
+
const Oe = "Aggregations";
|
|
312
306
|
function An(e) {
|
|
313
307
|
return typeof e == "boolean" ? {
|
|
314
308
|
enabled: e,
|
|
315
|
-
buttonLabel:
|
|
309
|
+
buttonLabel: Oe
|
|
316
310
|
} : e ? {
|
|
317
311
|
enabled: e.enabled ?? !0,
|
|
318
|
-
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() :
|
|
312
|
+
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() : Oe
|
|
319
313
|
} : {
|
|
320
314
|
enabled: !1,
|
|
321
|
-
buttonLabel:
|
|
315
|
+
buttonLabel: Oe
|
|
322
316
|
};
|
|
323
317
|
}
|
|
324
|
-
function
|
|
318
|
+
function de(e, t) {
|
|
325
319
|
return Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : t;
|
|
326
320
|
}
|
|
327
|
-
function
|
|
328
|
-
const
|
|
321
|
+
function xn(e, t) {
|
|
322
|
+
const l = {
|
|
329
323
|
rows: !0,
|
|
330
324
|
columns: !1,
|
|
331
325
|
rowOverscan: 8,
|
|
332
326
|
columnOverscan: 2
|
|
333
327
|
};
|
|
334
328
|
if (e === !0)
|
|
335
|
-
|
|
329
|
+
l.columns = !0;
|
|
336
330
|
else if (e === !1)
|
|
337
|
-
|
|
331
|
+
l.rows = !1, l.columns = !1;
|
|
338
332
|
else if (e && typeof e == "object") {
|
|
339
|
-
|
|
340
|
-
const o =
|
|
341
|
-
|
|
333
|
+
l.rows = e.rows ?? l.rows, l.columns = e.columns ?? l.columns;
|
|
334
|
+
const o = de(e.overscan, l.rowOverscan);
|
|
335
|
+
l.rowOverscan = de(e.rowOverscan, o), l.columnOverscan = de(e.columnOverscan, de(e.overscan, l.columnOverscan));
|
|
342
336
|
}
|
|
343
|
-
return t === "pagination" && (
|
|
337
|
+
return t === "pagination" && (l.rows = !1), l;
|
|
344
338
|
}
|
|
345
|
-
function
|
|
339
|
+
function ce(e) {
|
|
346
340
|
if (e == null)
|
|
347
341
|
return e;
|
|
348
342
|
const t = globalThis.structuredClone;
|
|
@@ -357,17 +351,17 @@ function ue(e) {
|
|
|
357
351
|
return e;
|
|
358
352
|
}
|
|
359
353
|
}
|
|
360
|
-
function
|
|
354
|
+
function et(e) {
|
|
361
355
|
if (e == null || e.trim().length === 0)
|
|
362
356
|
return null;
|
|
363
357
|
const t = Number(e);
|
|
364
358
|
return Number.isFinite(t) ? Math.max(0, Math.trunc(t)) : null;
|
|
365
359
|
}
|
|
366
|
-
function
|
|
360
|
+
function Ce(e) {
|
|
367
361
|
const t = globalThis.CSS?.escape;
|
|
368
362
|
return typeof t == "function" ? t(e) : e.replace(/["\\]/g, "\\$&");
|
|
369
363
|
}
|
|
370
|
-
const
|
|
364
|
+
const Pn = nt({
|
|
371
365
|
name: "DataGridRuntimeHost",
|
|
372
366
|
inheritAttrs: !1,
|
|
373
367
|
props: {
|
|
@@ -421,19 +415,19 @@ const xn = et({
|
|
|
421
415
|
"selection-change": (e) => !0,
|
|
422
416
|
"row-selection-change": (e) => !0
|
|
423
417
|
},
|
|
424
|
-
setup(e, { attrs: t, slots:
|
|
425
|
-
const
|
|
426
|
-
Dt(
|
|
427
|
-
let
|
|
418
|
+
setup(e, { attrs: t, slots: l, emit: o, expose: d }) {
|
|
419
|
+
const i = V(null);
|
|
420
|
+
Dt(Xt, i);
|
|
421
|
+
let w = null;
|
|
428
422
|
const s = Gt({
|
|
429
|
-
rows:
|
|
423
|
+
rows: y(() => e.rows),
|
|
430
424
|
rowModel: e.rowModel,
|
|
431
|
-
columns:
|
|
425
|
+
columns: y(() => e.columns),
|
|
432
426
|
plugins: e.plugins,
|
|
433
427
|
services: e.services,
|
|
434
428
|
startupOrder: e.startupOrder,
|
|
435
429
|
autoStart: e.autoStart
|
|
436
|
-
}),
|
|
430
|
+
}), A = s, P = {
|
|
437
431
|
api: s.api,
|
|
438
432
|
syncBodyRowsInRange: s.syncBodyRowsInRange,
|
|
439
433
|
setViewportRange: s.setViewportRange,
|
|
@@ -442,19 +436,19 @@ const xn = et({
|
|
|
442
436
|
rowPartition: s.rowPartition,
|
|
443
437
|
virtualWindow: s.virtualWindow,
|
|
444
438
|
columnSnapshot: s.columnSnapshot,
|
|
445
|
-
getBodyRowAtIndex:
|
|
446
|
-
resolveBodyRowIndexById:
|
|
439
|
+
getBodyRowAtIndex: A.getBodyRowAtIndex,
|
|
440
|
+
resolveBodyRowIndexById: A.resolveBodyRowIndexById,
|
|
447
441
|
getViewportPosition: s.getViewportPosition,
|
|
448
442
|
setViewportPosition: s.setViewportPosition,
|
|
449
443
|
scrollToRow: s.scrollToRow,
|
|
450
444
|
scrollToColumn: s.scrollToColumn,
|
|
451
445
|
scrollToCell: s.scrollToCell
|
|
452
|
-
},
|
|
446
|
+
}, k = () => {
|
|
453
447
|
if (e.renderMode === "pagination") {
|
|
454
|
-
const
|
|
448
|
+
const u = e.pagination ?? { pageSize: 100, currentPage: 0 };
|
|
455
449
|
s.api.rows.setPagination({
|
|
456
|
-
pageSize: Math.max(1, Math.trunc(
|
|
457
|
-
currentPage: Math.max(0, Math.trunc(
|
|
450
|
+
pageSize: Math.max(1, Math.trunc(u.pageSize)),
|
|
451
|
+
currentPage: Math.max(0, Math.trunc(u.currentPage))
|
|
458
452
|
});
|
|
459
453
|
return;
|
|
460
454
|
}
|
|
@@ -463,114 +457,114 @@ const xn = et({
|
|
|
463
457
|
C(
|
|
464
458
|
() => e.renderMode,
|
|
465
459
|
() => {
|
|
466
|
-
|
|
460
|
+
k();
|
|
467
461
|
},
|
|
468
462
|
{ immediate: !0 }
|
|
469
463
|
), C(
|
|
470
464
|
() => e.pagination,
|
|
471
465
|
() => {
|
|
472
|
-
|
|
466
|
+
k();
|
|
473
467
|
},
|
|
474
468
|
{ immediate: !0, deep: !0 }
|
|
475
|
-
), typeof document < "u" && (
|
|
476
|
-
const
|
|
477
|
-
|
|
478
|
-
}),
|
|
469
|
+
), typeof document < "u" && (w = new MutationObserver(() => {
|
|
470
|
+
const u = i.value;
|
|
471
|
+
u && Ne(u, e.theme);
|
|
472
|
+
}), w.observe(document.documentElement, {
|
|
479
473
|
attributes: !0,
|
|
480
474
|
attributeFilter: ["class", "data-theme"]
|
|
481
475
|
})), C(
|
|
482
|
-
[() => e.theme,
|
|
476
|
+
[() => e.theme, i],
|
|
483
477
|
() => {
|
|
484
|
-
const
|
|
485
|
-
|
|
478
|
+
const u = i.value;
|
|
479
|
+
u && Ne(u, e.theme);
|
|
486
480
|
},
|
|
487
481
|
{ immediate: !0, deep: !0 }
|
|
488
482
|
);
|
|
489
|
-
const
|
|
490
|
-
o("cell-change",
|
|
491
|
-
}),
|
|
492
|
-
o("selection-change",
|
|
493
|
-
}),
|
|
494
|
-
o("row-selection-change",
|
|
483
|
+
const F = s.api.events.on("rows:changed", (u) => {
|
|
484
|
+
o("cell-change", u);
|
|
485
|
+
}), I = s.api.events.on("selection:changed", (u) => {
|
|
486
|
+
o("selection-change", u);
|
|
487
|
+
}), E = s.api.events.on("row-selection:changed", (u) => {
|
|
488
|
+
o("row-selection-change", u);
|
|
495
489
|
});
|
|
496
|
-
|
|
497
|
-
|
|
490
|
+
Be(() => {
|
|
491
|
+
F(), I(), E(), w?.disconnect(), w = null;
|
|
498
492
|
});
|
|
499
|
-
const
|
|
500
|
-
const
|
|
493
|
+
const J = y(() => {
|
|
494
|
+
const u = s.virtualWindow.value;
|
|
501
495
|
return {
|
|
502
|
-
...
|
|
503
|
-
rowTotal:
|
|
496
|
+
...u ?? {},
|
|
497
|
+
rowTotal: u?.rowTotal ?? s.rowPartition.value.bodyRowCount,
|
|
504
498
|
colTotal: s.columnSnapshot.value.visibleColumns.length
|
|
505
499
|
};
|
|
506
|
-
}),
|
|
500
|
+
}), g = () => {
|
|
507
501
|
if (typeof document > "u")
|
|
508
502
|
return null;
|
|
509
|
-
const
|
|
510
|
-
return !
|
|
511
|
-
},
|
|
512
|
-
const S = s.api.selection.getSnapshot(), p = S?.activeCell ?? null,
|
|
503
|
+
const u = i.value, S = document.activeElement;
|
|
504
|
+
return !u || !(S instanceof HTMLElement) || !u.contains(S) ? null : S.closest(".grid-cell[data-row-index], .grid-cell[data-row-id]");
|
|
505
|
+
}, Z = (u) => u == null ? null : s.columnSnapshot.value.visibleColumns[u]?.key ?? null, h = (u = {}) => {
|
|
506
|
+
const S = s.api.selection.getSnapshot(), p = S?.activeCell ?? null, M = g(), O = et(M?.getAttribute("data-row-index") ?? null), B = et(M?.getAttribute("data-column-index") ?? null), x = M?.getAttribute("data-column-key") ?? null, G = M?.getAttribute("data-row-id") ?? null, j = O ?? p?.rowIndex ?? null, z = p != null && (O == null && G == null || p.rowIndex === O || p.rowId != null && String(p.rowId) === G), _ = z ? p?.colIndex ?? B : B ?? p?.colIndex ?? null, W = z ? p?.rowId ?? G : G ?? p?.rowId ?? null, Y = typeof W == "string" || typeof W == "number" ? W : null, Q = x ?? Z(_), N = Y != null || j != null || Q != null || _ != null, ne = u.includeSelection !== !1, oe = u.includeRowSelection !== !1;
|
|
513
507
|
return !N && !S && !s.api.rowSelection.getSnapshot() ? null : {
|
|
514
508
|
version: 1,
|
|
515
|
-
rowId:
|
|
516
|
-
rowIndex:
|
|
517
|
-
columnKey:
|
|
509
|
+
rowId: Y,
|
|
510
|
+
rowIndex: j,
|
|
511
|
+
columnKey: Q,
|
|
518
512
|
columnIndex: _,
|
|
519
|
-
selection:
|
|
520
|
-
rowSelection:
|
|
513
|
+
selection: ne ? ce(S) : null,
|
|
514
|
+
rowSelection: oe ? ce(s.api.rowSelection.getSnapshot()) : null
|
|
521
515
|
};
|
|
522
|
-
},
|
|
523
|
-
const p =
|
|
516
|
+
}, K = (u, S) => {
|
|
517
|
+
const p = i.value;
|
|
524
518
|
if (!p)
|
|
525
519
|
return !1;
|
|
526
|
-
const
|
|
527
|
-
if (
|
|
528
|
-
`.grid-cell[data-row-index="${
|
|
529
|
-
),
|
|
530
|
-
`.grid-cell[data-row-id="${
|
|
531
|
-
),
|
|
520
|
+
const M = [];
|
|
521
|
+
if (u.rowIndex != null && u.columnKey && M.push(
|
|
522
|
+
`.grid-cell[data-row-index="${u.rowIndex}"][data-column-key="${Ce(u.columnKey)}"]`
|
|
523
|
+
), u.rowIndex != null && u.columnIndex != null && M.push(`.grid-cell[data-row-index="${u.rowIndex}"][data-column-index="${u.columnIndex}"]`), u.rowId != null && u.columnKey && M.push(
|
|
524
|
+
`.grid-cell[data-row-id="${Ce(String(u.rowId))}"][data-column-key="${Ce(u.columnKey)}"]`
|
|
525
|
+
), M.length === 0)
|
|
532
526
|
return !1;
|
|
533
|
-
let
|
|
534
|
-
for (const
|
|
535
|
-
if (
|
|
527
|
+
let O = null;
|
|
528
|
+
for (const B of M)
|
|
529
|
+
if (O = p.querySelector(B), O)
|
|
536
530
|
break;
|
|
537
|
-
if (!
|
|
531
|
+
if (!O)
|
|
538
532
|
return !1;
|
|
539
533
|
try {
|
|
540
|
-
|
|
534
|
+
O.focus({ preventScroll: S.preventScroll !== !1 });
|
|
541
535
|
} catch {
|
|
542
|
-
|
|
536
|
+
O.focus();
|
|
543
537
|
}
|
|
544
|
-
return typeof document > "u" || document.activeElement ===
|
|
545
|
-
},
|
|
546
|
-
if (!
|
|
538
|
+
return typeof document > "u" || document.activeElement === O;
|
|
539
|
+
}, te = async (u, S = {}) => {
|
|
540
|
+
if (!u)
|
|
547
541
|
return !1;
|
|
548
|
-
if (S.applySelection !== !1 &&
|
|
542
|
+
if (S.applySelection !== !1 && u.selection && s.api.selection.setSnapshot(ce(u.selection)), S.applyRowSelection !== !1 && u.rowSelection && s.api.rowSelection.setSnapshot(ce(u.rowSelection)), S.focus === !1)
|
|
549
543
|
return !0;
|
|
550
|
-
const p = typeof
|
|
551
|
-
...
|
|
552
|
-
rowIndex:
|
|
553
|
-
columnIndex:
|
|
544
|
+
const p = typeof u.rowId == "string" || typeof u.rowId == "number" ? u.rowId : null, M = p != null ? A.resolveBodyRowIndexById(p) : -1, O = M >= 0 ? M : u.rowIndex, B = u.columnKey ? s.columnSnapshot.value.visibleColumns.findIndex((j) => j.key === u.columnKey) : -1, x = {
|
|
545
|
+
...u,
|
|
546
|
+
rowIndex: O != null && O >= 0 ? O : u.rowIndex,
|
|
547
|
+
columnIndex: B >= 0 ? B : u.columnIndex
|
|
554
548
|
};
|
|
555
|
-
if (
|
|
549
|
+
if (x.rowIndex == null || x.columnKey == null && x.columnIndex == null)
|
|
556
550
|
return !1;
|
|
557
551
|
S.scrollIntoView !== !1 && s.scrollToCell({
|
|
558
552
|
rowId: p,
|
|
559
|
-
rowIndex:
|
|
560
|
-
columnKey:
|
|
561
|
-
columnIndex:
|
|
553
|
+
rowIndex: x.rowIndex,
|
|
554
|
+
columnKey: x.columnKey,
|
|
555
|
+
columnIndex: x.columnIndex,
|
|
562
556
|
align: "nearest"
|
|
563
557
|
});
|
|
564
|
-
const
|
|
565
|
-
for (let
|
|
566
|
-
if (await
|
|
558
|
+
const G = Math.max(0, Math.trunc(S.retries ?? 3));
|
|
559
|
+
for (let j = 0; j <= G; j += 1) {
|
|
560
|
+
if (await Ve(), K(x, S))
|
|
567
561
|
return !0;
|
|
568
|
-
typeof window < "u" && await new Promise((
|
|
562
|
+
typeof window < "u" && await new Promise((z) => window.requestAnimationFrame(() => z()));
|
|
569
563
|
}
|
|
570
564
|
return !1;
|
|
571
565
|
}, U = () => {
|
|
572
|
-
const
|
|
573
|
-
const p =
|
|
566
|
+
const u = () => {
|
|
567
|
+
const p = i.value?.querySelector(".grid-body-viewport");
|
|
574
568
|
if (!p)
|
|
575
569
|
return !1;
|
|
576
570
|
try {
|
|
@@ -580,8 +574,8 @@ const xn = et({
|
|
|
580
574
|
}
|
|
581
575
|
return typeof document < "u" && document.activeElement === p;
|
|
582
576
|
}, S = (p) => {
|
|
583
|
-
|
|
584
|
-
if (!(
|
|
577
|
+
Ve(() => {
|
|
578
|
+
if (!(u() || p >= 3)) {
|
|
585
579
|
if (typeof window < "u") {
|
|
586
580
|
window.requestAnimationFrame(() => {
|
|
587
581
|
S(p + 1);
|
|
@@ -604,18 +598,18 @@ const xn = et({
|
|
|
604
598
|
rowPartition: s.rowPartition,
|
|
605
599
|
setRows: s.setRows,
|
|
606
600
|
syncBodyRowsInRange: s.syncBodyRowsInRange,
|
|
607
|
-
getBodyRowAtIndex:
|
|
608
|
-
resolveBodyRowIndexById:
|
|
601
|
+
getBodyRowAtIndex: A.getBodyRowAtIndex,
|
|
602
|
+
resolveBodyRowIndexById: A.resolveBodyRowIndexById,
|
|
609
603
|
virtualWindow: s.virtualWindow,
|
|
610
604
|
captureFocusAnchor: h,
|
|
611
|
-
restoreFocusAnchor:
|
|
605
|
+
restoreFocusAnchor: te,
|
|
612
606
|
restoreFocus: U,
|
|
613
607
|
start: s.start,
|
|
614
608
|
stop: s.stop
|
|
615
|
-
}), () =>
|
|
609
|
+
}), () => xe(
|
|
616
610
|
"div",
|
|
617
611
|
Ft(t, {
|
|
618
|
-
ref:
|
|
612
|
+
ref: i,
|
|
619
613
|
class: [
|
|
620
614
|
"affino-datagrid-app-root",
|
|
621
615
|
e.theme === "sugar" ? "affino-datagrid-app-root--theme-sugar" : null,
|
|
@@ -628,7 +622,7 @@ const xn = et({
|
|
|
628
622
|
minWidth: "0"
|
|
629
623
|
}
|
|
630
624
|
}),
|
|
631
|
-
|
|
625
|
+
l.default?.({
|
|
632
626
|
api: s.api,
|
|
633
627
|
core: s.core,
|
|
634
628
|
runtime: P,
|
|
@@ -639,17 +633,17 @@ const xn = et({
|
|
|
639
633
|
rowPartition: s.rowPartition.value,
|
|
640
634
|
setRows: s.setRows,
|
|
641
635
|
syncBodyRowsInRange: s.syncBodyRowsInRange,
|
|
642
|
-
getBodyRowAtIndex:
|
|
643
|
-
resolveBodyRowIndexById:
|
|
644
|
-
virtualWindow:
|
|
636
|
+
getBodyRowAtIndex: A.getBodyRowAtIndex,
|
|
637
|
+
resolveBodyRowIndexById: A.resolveBodyRowIndexById,
|
|
638
|
+
virtualWindow: J.value
|
|
645
639
|
}) ?? []
|
|
646
640
|
);
|
|
647
641
|
}
|
|
648
642
|
});
|
|
649
|
-
function
|
|
643
|
+
function Ae(e) {
|
|
650
644
|
return Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : null;
|
|
651
645
|
}
|
|
652
|
-
function
|
|
646
|
+
function T(e) {
|
|
653
647
|
try {
|
|
654
648
|
return JSON.stringify(e);
|
|
655
649
|
} catch {
|
|
@@ -663,194 +657,218 @@ function In(e) {
|
|
|
663
657
|
} : null;
|
|
664
658
|
}
|
|
665
659
|
function Dn(e) {
|
|
666
|
-
let t = null,
|
|
667
|
-
const
|
|
668
|
-
t?.(),
|
|
669
|
-
},
|
|
670
|
-
const
|
|
671
|
-
return !
|
|
672
|
-
},
|
|
673
|
-
const
|
|
674
|
-
if (!
|
|
660
|
+
let t = null, l = null, o = !1, d = null, i = null, w = null, s = null, A = null, P = null, k = null, F = null, I = null;
|
|
661
|
+
const E = () => {
|
|
662
|
+
t?.(), l?.(), t = null, l = null;
|
|
663
|
+
}, J = () => {
|
|
664
|
+
const r = e.gridRef.value;
|
|
665
|
+
return !r || r.api.lifecycle.state === "disposed" ? null : r;
|
|
666
|
+
}, g = () => J()?.api ?? null, Z = () => {
|
|
667
|
+
const r = g()?.columns;
|
|
668
|
+
if (!r)
|
|
675
669
|
return null;
|
|
676
|
-
const
|
|
677
|
-
for (const
|
|
678
|
-
|
|
670
|
+
const m = r.getSnapshot(), f = {}, c = {}, b = {};
|
|
671
|
+
for (const q of m.columns)
|
|
672
|
+
f[q.key] = q.visible, c[q.key] = q.width, b[q.key] = q.pin;
|
|
673
|
+
const H = m.zoneOrder;
|
|
679
674
|
return {
|
|
680
|
-
order: [...
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
675
|
+
order: [...m.order],
|
|
676
|
+
...H ? {
|
|
677
|
+
zoneOrder: {
|
|
678
|
+
pinnedLeft: [...H.pinnedLeft ?? []],
|
|
679
|
+
center: [...H.center ?? []],
|
|
680
|
+
pinnedRight: [...H.pinnedRight ?? []]
|
|
681
|
+
}
|
|
682
|
+
} : {},
|
|
683
|
+
visibility: f,
|
|
684
|
+
widths: c,
|
|
685
|
+
pins: b
|
|
684
686
|
};
|
|
685
687
|
}, h = () => {
|
|
686
688
|
o || (o = !0, queueMicrotask(() => {
|
|
687
689
|
o = !1;
|
|
688
|
-
const
|
|
689
|
-
if (
|
|
690
|
-
const
|
|
691
|
-
P =
|
|
692
|
-
Object.entries(
|
|
693
|
-
), e.emit.columnWidths(
|
|
690
|
+
const r = Z(), m = g();
|
|
691
|
+
if (r) {
|
|
692
|
+
const f = T(r);
|
|
693
|
+
P = f, f !== w && (w = f, e.emit.columnState(r), e.emit.columnOrder(r.order), e.emit.hiddenColumnKeys(
|
|
694
|
+
Object.entries(r.visibility).filter(([, c]) => !c).map(([c]) => c)
|
|
695
|
+
), e.emit.columnWidths(r.widths), e.emit.columnPins(r.pins));
|
|
694
696
|
}
|
|
695
|
-
if (
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
const
|
|
699
|
-
|
|
697
|
+
if (m) {
|
|
698
|
+
const f = In(m.rows.getSnapshot().groupBy), c = T(f);
|
|
699
|
+
c !== A && (A = c, e.emit.groupBy(f));
|
|
700
|
+
const b = m.state.get(), H = T(b);
|
|
701
|
+
k = H, H !== s && (s = H, e.emit.state(b));
|
|
700
702
|
}
|
|
701
703
|
}));
|
|
702
|
-
},
|
|
703
|
-
const
|
|
704
|
-
!
|
|
704
|
+
}, K = () => {
|
|
705
|
+
const r = g();
|
|
706
|
+
!r || e.props.sortModel === void 0 && e.props.filterModel === void 0 || r.rows.setSortAndFilterModel({
|
|
705
707
|
sortModel: e.props.sortModel ?? [],
|
|
706
708
|
filterModel: e.props.filterModel ?? null
|
|
707
709
|
});
|
|
708
|
-
},
|
|
709
|
-
const
|
|
710
|
-
return
|
|
711
|
-
}, U = (
|
|
712
|
-
const f = /* @__PURE__ */ new Set();
|
|
713
|
-
if (!
|
|
710
|
+
}, te = () => {
|
|
711
|
+
const r = g()?.columns;
|
|
712
|
+
return r ? new Set(r.getSnapshot().columns.map((m) => m.key)) : null;
|
|
713
|
+
}, U = (r) => {
|
|
714
|
+
const m = r, f = /* @__PURE__ */ new Set();
|
|
715
|
+
if (!r)
|
|
714
716
|
return f;
|
|
715
|
-
for (const c of
|
|
717
|
+
for (const c of r.order)
|
|
716
718
|
f.add(c);
|
|
717
|
-
for (const c of Object.keys(
|
|
719
|
+
for (const c of Object.keys(r.visibility ?? {}))
|
|
718
720
|
f.add(c);
|
|
719
|
-
for (const c of Object.keys(
|
|
721
|
+
for (const c of Object.keys(r.widths ?? {}))
|
|
720
722
|
f.add(c);
|
|
721
|
-
for (const c of Object.keys(
|
|
723
|
+
for (const c of Object.keys(r.pins ?? {}))
|
|
724
|
+
f.add(c);
|
|
725
|
+
for (const c of m?.zoneOrder?.pinnedLeft ?? [])
|
|
726
|
+
f.add(c);
|
|
727
|
+
for (const c of m?.zoneOrder?.center ?? [])
|
|
728
|
+
f.add(c);
|
|
729
|
+
for (const c of m?.zoneOrder?.pinnedRight ?? [])
|
|
722
730
|
f.add(c);
|
|
723
731
|
return f;
|
|
724
|
-
},
|
|
725
|
-
const
|
|
726
|
-
if (!
|
|
732
|
+
}, u = (r) => {
|
|
733
|
+
const m = te();
|
|
734
|
+
if (!m)
|
|
727
735
|
return !1;
|
|
728
|
-
const
|
|
729
|
-
if (
|
|
736
|
+
const f = U(r);
|
|
737
|
+
if (f.size === 0)
|
|
730
738
|
return !0;
|
|
731
|
-
for (const
|
|
732
|
-
if (!
|
|
739
|
+
for (const c of f)
|
|
740
|
+
if (!m.has(c))
|
|
733
741
|
return !1;
|
|
734
742
|
return !0;
|
|
735
|
-
}, S = (
|
|
736
|
-
const
|
|
737
|
-
if (!
|
|
743
|
+
}, S = (r) => u(r.columns), p = (r) => {
|
|
744
|
+
const m = g();
|
|
745
|
+
if (!m)
|
|
738
746
|
return !1;
|
|
739
|
-
|
|
740
|
-
for (const [c,
|
|
741
|
-
|
|
742
|
-
for (const [c,
|
|
743
|
-
|
|
744
|
-
for (const [c,
|
|
745
|
-
|
|
747
|
+
m.columns.setOrder(r.order);
|
|
748
|
+
for (const [c, b] of Object.entries(r.visibility))
|
|
749
|
+
m.columns.setVisibility(c, b);
|
|
750
|
+
for (const [c, b] of Object.entries(r.widths))
|
|
751
|
+
m.columns.setWidth(c, Ae(b));
|
|
752
|
+
for (const [c, b] of Object.entries(r.pins))
|
|
753
|
+
m.columns.setPin(c, b);
|
|
754
|
+
const f = r.zoneOrder;
|
|
755
|
+
if (f) {
|
|
756
|
+
const c = m.columns;
|
|
757
|
+
c.setZoneOrder?.("pinnedLeft", f.pinnedLeft ?? []), c.setZoneOrder?.("center", f.center ?? []), c.setZoneOrder?.("pinnedRight", f.pinnedRight ?? []);
|
|
758
|
+
}
|
|
746
759
|
return !0;
|
|
747
|
-
},
|
|
748
|
-
if (
|
|
749
|
-
const
|
|
750
|
-
if (
|
|
751
|
-
const
|
|
752
|
-
|
|
760
|
+
}, M = () => {
|
|
761
|
+
if (I) {
|
|
762
|
+
const r = I, m = g();
|
|
763
|
+
if (m) {
|
|
764
|
+
const f = m.state.migrate(r.state, { strict: r.options?.strict });
|
|
765
|
+
f && S(f) && (I = null, m.state.set(f, r.options), i = T(r.state));
|
|
753
766
|
}
|
|
754
767
|
}
|
|
755
|
-
if (
|
|
756
|
-
const
|
|
757
|
-
|
|
758
|
-
columnState:
|
|
768
|
+
if (F && u(F.columnState)) {
|
|
769
|
+
const r = F;
|
|
770
|
+
F = null, d = T({
|
|
771
|
+
columnState: r.columnState,
|
|
759
772
|
columnOrder: null,
|
|
760
773
|
hiddenColumnKeys: null,
|
|
761
774
|
columnWidths: null,
|
|
762
775
|
columnPins: null
|
|
763
|
-
}), p(
|
|
776
|
+
}), p(r.columnState);
|
|
764
777
|
}
|
|
765
|
-
},
|
|
766
|
-
const
|
|
767
|
-
!
|
|
768
|
-
}, F = () => {
|
|
769
|
-
const l = w();
|
|
770
|
-
!l || e.props.aggregationModel === void 0 || l.rows.setAggregationModel(e.props.aggregationModel ?? null);
|
|
771
|
-
}, A = () => {
|
|
772
|
-
const l = w();
|
|
773
|
-
!l || e.props.pivotModel === void 0 || l.pivot.setModel(e.props.pivotModel ?? null);
|
|
778
|
+
}, O = () => {
|
|
779
|
+
const r = g();
|
|
780
|
+
!r || e.props.groupBy === void 0 || r.rows.setGroupBy(e.props.groupBy ?? null);
|
|
774
781
|
}, B = () => {
|
|
775
|
-
const
|
|
776
|
-
|
|
782
|
+
const r = g();
|
|
783
|
+
!r || e.props.aggregationModel === void 0 || r.rows.setAggregationModel(e.props.aggregationModel ?? null);
|
|
784
|
+
}, x = () => {
|
|
785
|
+
const r = g();
|
|
786
|
+
!r || e.props.pivotModel === void 0 || r.pivot.setModel(e.props.pivotModel ?? null);
|
|
787
|
+
}, G = () => {
|
|
788
|
+
const r = g();
|
|
789
|
+
if (!r || 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)
|
|
777
790
|
return;
|
|
778
|
-
const
|
|
791
|
+
const m = T({
|
|
779
792
|
columnState: e.props.columnState,
|
|
780
793
|
columnOrder: e.props.columnOrder,
|
|
781
794
|
hiddenColumnKeys: e.props.hiddenColumnKeys,
|
|
782
795
|
columnWidths: e.props.columnWidths,
|
|
783
796
|
columnPins: e.props.columnPins
|
|
784
797
|
});
|
|
785
|
-
if (
|
|
786
|
-
if (e.props.columnState && !e.props.columnOrder && !e.props.hiddenColumnKeys && !e.props.columnWidths && !e.props.columnPins &&
|
|
787
|
-
d =
|
|
798
|
+
if (m !== d) {
|
|
799
|
+
if (e.props.columnState && !e.props.columnOrder && !e.props.hiddenColumnKeys && !e.props.columnWidths && !e.props.columnPins && T(e.props.columnState) === P) {
|
|
800
|
+
d = m;
|
|
788
801
|
return;
|
|
789
802
|
}
|
|
790
803
|
if (e.props.columnState) {
|
|
791
|
-
|
|
792
|
-
for (const [c,
|
|
793
|
-
|
|
794
|
-
for (const [c,
|
|
795
|
-
|
|
796
|
-
for (const [c,
|
|
797
|
-
|
|
804
|
+
r.columns.setOrder(e.props.columnState.order);
|
|
805
|
+
for (const [c, b] of Object.entries(e.props.columnState.visibility))
|
|
806
|
+
r.columns.setVisibility(c, b);
|
|
807
|
+
for (const [c, b] of Object.entries(e.props.columnState.widths))
|
|
808
|
+
r.columns.setWidth(c, Ae(b));
|
|
809
|
+
for (const [c, b] of Object.entries(e.props.columnState.pins))
|
|
810
|
+
r.columns.setPin(c, b);
|
|
811
|
+
const f = e.props.columnState.zoneOrder;
|
|
812
|
+
if (f) {
|
|
813
|
+
const c = r.columns;
|
|
814
|
+
c.setZoneOrder?.("pinnedLeft", f.pinnedLeft ?? []), c.setZoneOrder?.("center", f.center ?? []), c.setZoneOrder?.("pinnedRight", f.pinnedRight ?? []);
|
|
815
|
+
}
|
|
798
816
|
}
|
|
799
|
-
if (e.props.columnOrder &&
|
|
800
|
-
const
|
|
801
|
-
for (const
|
|
802
|
-
|
|
817
|
+
if (e.props.columnOrder && r.columns.setOrder(e.props.columnOrder), e.props.hiddenColumnKeys) {
|
|
818
|
+
const f = new Set(e.props.hiddenColumnKeys), c = r.columns.getSnapshot();
|
|
819
|
+
for (const b of c.columns)
|
|
820
|
+
r.columns.setVisibility(b.key, !f.has(b.key));
|
|
803
821
|
}
|
|
804
822
|
if (e.props.columnWidths)
|
|
805
|
-
for (const [
|
|
806
|
-
|
|
823
|
+
for (const [f, c] of Object.entries(e.props.columnWidths))
|
|
824
|
+
r.columns.setWidth(f, Ae(c));
|
|
807
825
|
if (e.props.columnPins)
|
|
808
|
-
for (const [
|
|
809
|
-
|
|
810
|
-
d =
|
|
826
|
+
for (const [f, c] of Object.entries(e.props.columnPins))
|
|
827
|
+
r.columns.setPin(f, c);
|
|
828
|
+
d = m;
|
|
811
829
|
}
|
|
812
|
-
},
|
|
813
|
-
const
|
|
814
|
-
if (!
|
|
830
|
+
}, j = () => {
|
|
831
|
+
const r = g();
|
|
832
|
+
if (!r || e.props.state == null)
|
|
815
833
|
return;
|
|
816
|
-
const
|
|
817
|
-
if (
|
|
834
|
+
const m = T(e.props.state);
|
|
835
|
+
if (m === i)
|
|
818
836
|
return;
|
|
819
|
-
if (
|
|
820
|
-
|
|
837
|
+
if (m === k) {
|
|
838
|
+
i = m;
|
|
821
839
|
return;
|
|
822
840
|
}
|
|
823
|
-
const
|
|
824
|
-
|
|
825
|
-
},
|
|
826
|
-
const
|
|
827
|
-
|
|
841
|
+
const f = r.state.migrate(e.props.state, { strict: e.props.stateOptions?.strict });
|
|
842
|
+
f && S(f) && (r.state.set(f, e.props.stateOptions ?? {}), i = m);
|
|
843
|
+
}, z = () => {
|
|
844
|
+
const r = g();
|
|
845
|
+
r && (r.view.setRowHeightMode(e.props.rowHeightMode), r.view.setBaseRowHeight(Math.max(24, Math.trunc(e.props.baseRowHeight))));
|
|
828
846
|
}, _ = () => {
|
|
829
|
-
const
|
|
830
|
-
|
|
847
|
+
const r = J();
|
|
848
|
+
r && (d = null, i = null, E(), t = r.rowModel.subscribe(() => {
|
|
831
849
|
h();
|
|
832
|
-
}),
|
|
850
|
+
}), l = r.columnModel.subscribe(() => {
|
|
833
851
|
h();
|
|
834
|
-
}),
|
|
835
|
-
}, W = () =>
|
|
836
|
-
columnState:
|
|
852
|
+
}), j(), G(), K(), O(), B(), x(), z(), M(), h(), e.emit.ready({ api: r.api }));
|
|
853
|
+
}, W = () => g()?.state.get() ?? null, Y = (r, m) => g()?.state.migrate(r, m) ?? null, Q = (r) => u(r) ? (d = T({
|
|
854
|
+
columnState: r,
|
|
837
855
|
columnOrder: null,
|
|
838
856
|
hiddenColumnKeys: null,
|
|
839
857
|
columnWidths: null,
|
|
840
858
|
columnPins: null
|
|
841
|
-
}),
|
|
842
|
-
const
|
|
843
|
-
if (!
|
|
844
|
-
return
|
|
845
|
-
const
|
|
846
|
-
return
|
|
847
|
-
},
|
|
848
|
-
const
|
|
849
|
-
return
|
|
850
|
-
},
|
|
851
|
-
|
|
852
|
-
},
|
|
853
|
-
|
|
859
|
+
}), F = null, p(r) ? (h(), !0) : (F = { columnState: r }, !0)) : (F = { columnState: r }, !0), N = (r, m) => {
|
|
860
|
+
const f = g();
|
|
861
|
+
if (!f)
|
|
862
|
+
return I = { state: r, options: m }, !0;
|
|
863
|
+
const c = f.state.migrate(r, { strict: m?.strict });
|
|
864
|
+
return c ? S(c) ? (f.state.set(c, m), i = T(r), I = null, h(), !0) : (I = { state: r, options: m }, !0) : !1;
|
|
865
|
+
}, ne = () => g()?.pivot.exportLayout() ?? null, oe = () => g()?.pivot.exportInterop() ?? null, ye = (r, m) => {
|
|
866
|
+
const f = g();
|
|
867
|
+
return f ? (f.pivot.importLayout(r, m), h(), !0) : !1;
|
|
868
|
+
}, ae = () => {
|
|
869
|
+
g()?.rows.expandAllGroups(), h();
|
|
870
|
+
}, ve = () => {
|
|
871
|
+
g()?.rows.collapseAllGroups(), h();
|
|
854
872
|
};
|
|
855
873
|
C(
|
|
856
874
|
() => e.gridRef.value,
|
|
@@ -861,13 +879,13 @@ function Dn(e) {
|
|
|
861
879
|
), C(
|
|
862
880
|
() => e.props.columns,
|
|
863
881
|
() => {
|
|
864
|
-
d = null,
|
|
882
|
+
d = null, i = null, j(), G(), M(), h();
|
|
865
883
|
},
|
|
866
884
|
{ deep: !0 }
|
|
867
885
|
), C(
|
|
868
886
|
() => [e.props.state, e.props.stateOptions],
|
|
869
887
|
() => {
|
|
870
|
-
|
|
888
|
+
j(), G(), K(), O(), B(), x(), z(), M(), h();
|
|
871
889
|
},
|
|
872
890
|
{ deep: !0 }
|
|
873
891
|
), C(
|
|
@@ -879,58 +897,58 @@ function Dn(e) {
|
|
|
879
897
|
e.props.columnPins
|
|
880
898
|
],
|
|
881
899
|
() => {
|
|
882
|
-
|
|
900
|
+
G(), M(), h();
|
|
883
901
|
},
|
|
884
902
|
{ deep: !0 }
|
|
885
903
|
), C(
|
|
886
904
|
() => [e.props.sortModel, e.props.filterModel],
|
|
887
905
|
() => {
|
|
888
|
-
|
|
906
|
+
K(), h();
|
|
889
907
|
},
|
|
890
908
|
{ deep: !0 }
|
|
891
909
|
), C(
|
|
892
910
|
() => e.props.groupBy,
|
|
893
911
|
() => {
|
|
894
|
-
|
|
912
|
+
O(), h();
|
|
895
913
|
},
|
|
896
914
|
{ deep: !0 }
|
|
897
915
|
), C(
|
|
898
916
|
() => e.props.aggregationModel,
|
|
899
917
|
() => {
|
|
900
|
-
|
|
918
|
+
B(), h();
|
|
901
919
|
},
|
|
902
920
|
{ deep: !0 }
|
|
903
921
|
), C(
|
|
904
922
|
() => e.props.pivotModel,
|
|
905
923
|
() => {
|
|
906
|
-
|
|
924
|
+
x(), h();
|
|
907
925
|
},
|
|
908
926
|
{ deep: !0 }
|
|
909
927
|
), C(
|
|
910
928
|
() => [e.props.rowHeightMode, e.props.baseRowHeight],
|
|
911
929
|
() => {
|
|
912
|
-
|
|
930
|
+
z(), h();
|
|
913
931
|
}
|
|
914
932
|
);
|
|
915
|
-
const
|
|
916
|
-
|
|
933
|
+
const X = () => {
|
|
934
|
+
E();
|
|
917
935
|
};
|
|
918
|
-
return
|
|
919
|
-
|
|
936
|
+
return Be(() => {
|
|
937
|
+
X();
|
|
920
938
|
}), {
|
|
921
939
|
emitSnapshotUpdates: h,
|
|
922
940
|
handleGridReady: _,
|
|
923
|
-
dispose:
|
|
924
|
-
getColumnState:
|
|
941
|
+
dispose: X,
|
|
942
|
+
getColumnState: Z,
|
|
925
943
|
getState: W,
|
|
926
|
-
migrateState:
|
|
927
|
-
applyColumnState:
|
|
944
|
+
migrateState: Y,
|
|
945
|
+
applyColumnState: Q,
|
|
928
946
|
applyState: N,
|
|
929
|
-
exportPivotLayout:
|
|
930
|
-
exportPivotInterop:
|
|
931
|
-
importPivotLayout:
|
|
932
|
-
expandAllGroups:
|
|
933
|
-
collapseAllGroups:
|
|
947
|
+
exportPivotLayout: ne,
|
|
948
|
+
exportPivotInterop: oe,
|
|
949
|
+
importPivotLayout: ye,
|
|
950
|
+
expandAllGroups: ae,
|
|
951
|
+
collapseAllGroups: ve
|
|
934
952
|
};
|
|
935
953
|
}
|
|
936
954
|
function Fn(e) {
|
|
@@ -952,7 +970,7 @@ function jn() {
|
|
|
952
970
|
runHistoryAction: async () => null
|
|
953
971
|
};
|
|
954
972
|
}
|
|
955
|
-
function
|
|
973
|
+
function Ln(e) {
|
|
956
974
|
if (e === !1)
|
|
957
975
|
return {
|
|
958
976
|
enabled: !1,
|
|
@@ -986,20 +1004,20 @@ function ro() {
|
|
|
986
1004
|
function lo() {
|
|
987
1005
|
return (e) => e;
|
|
988
1006
|
}
|
|
989
|
-
function
|
|
1007
|
+
function io() {
|
|
990
1008
|
return (e) => e;
|
|
991
1009
|
}
|
|
992
|
-
function
|
|
1010
|
+
function En(e, t) {
|
|
993
1011
|
if (!t || typeof e != "object" || e === null)
|
|
994
1012
|
return;
|
|
995
|
-
const
|
|
1013
|
+
const l = t.split(".").filter(Boolean);
|
|
996
1014
|
let o = e;
|
|
997
|
-
for (const d of
|
|
1015
|
+
for (const d of l) {
|
|
998
1016
|
if (Array.isArray(o)) {
|
|
999
|
-
const
|
|
1000
|
-
if (!Number.isInteger(
|
|
1017
|
+
const i = Number(d);
|
|
1018
|
+
if (!Number.isInteger(i) || i < 0 || i >= o.length)
|
|
1001
1019
|
return;
|
|
1002
|
-
o = o[
|
|
1020
|
+
o = o[i];
|
|
1003
1021
|
continue;
|
|
1004
1022
|
}
|
|
1005
1023
|
if (typeof o != "object" || o === null || !(d in o))
|
|
@@ -1008,35 +1026,35 @@ function Kn(e, t) {
|
|
|
1008
1026
|
}
|
|
1009
1027
|
return o;
|
|
1010
1028
|
}
|
|
1011
|
-
function
|
|
1012
|
-
const
|
|
1029
|
+
function Kn(e, t) {
|
|
1030
|
+
const l = /* @__PURE__ */ new Map();
|
|
1013
1031
|
for (const o of e ?? []) {
|
|
1014
1032
|
const d = String(o.key ?? "").trim();
|
|
1015
|
-
d &&
|
|
1033
|
+
d && l.set(d, o);
|
|
1016
1034
|
}
|
|
1017
|
-
if (!(
|
|
1035
|
+
if (!(l.size === 0 && typeof t != "function"))
|
|
1018
1036
|
return (o, d) => {
|
|
1019
1037
|
if (typeof t == "function") {
|
|
1020
1038
|
const P = t(o, d);
|
|
1021
1039
|
if (typeof P < "u")
|
|
1022
1040
|
return P;
|
|
1023
1041
|
}
|
|
1024
|
-
const
|
|
1025
|
-
if (!
|
|
1042
|
+
const i = l.get(String(d ?? "").trim());
|
|
1043
|
+
if (!i)
|
|
1026
1044
|
return;
|
|
1027
|
-
const
|
|
1028
|
-
if (typeof
|
|
1029
|
-
return
|
|
1030
|
-
if (typeof
|
|
1031
|
-
return
|
|
1032
|
-
const s = typeof
|
|
1045
|
+
const w = o.data;
|
|
1046
|
+
if (typeof i.valueGetter == "function")
|
|
1047
|
+
return i.valueGetter(w);
|
|
1048
|
+
if (typeof i.accessor == "function")
|
|
1049
|
+
return i.accessor(w);
|
|
1050
|
+
const s = typeof i.field == "string" ? i.field.trim() : "";
|
|
1033
1051
|
if (!s)
|
|
1034
1052
|
return;
|
|
1035
|
-
const
|
|
1036
|
-
return typeof
|
|
1053
|
+
const A = w[s];
|
|
1054
|
+
return typeof A < "u" ? A : En(w, s);
|
|
1037
1055
|
};
|
|
1038
1056
|
}
|
|
1039
|
-
function
|
|
1057
|
+
function zn() {
|
|
1040
1058
|
return {
|
|
1041
1059
|
name: "selection",
|
|
1042
1060
|
getRowSelectionSnapshot: () => null,
|
|
@@ -1059,29 +1077,29 @@ function Hn() {
|
|
|
1059
1077
|
}
|
|
1060
1078
|
};
|
|
1061
1079
|
}
|
|
1062
|
-
function
|
|
1063
|
-
const
|
|
1064
|
-
if (
|
|
1080
|
+
function fe(e, t) {
|
|
1081
|
+
const l = t.map((o) => o?.[e]).filter((o) => typeof o == "function");
|
|
1082
|
+
if (l.length !== 0)
|
|
1065
1083
|
return async (o) => {
|
|
1066
|
-
for (const d of
|
|
1084
|
+
for (const d of l)
|
|
1067
1085
|
await d(o);
|
|
1068
1086
|
};
|
|
1069
1087
|
}
|
|
1070
|
-
function
|
|
1088
|
+
function Hn(e) {
|
|
1071
1089
|
const {
|
|
1072
1090
|
userSelectionService: t,
|
|
1073
|
-
cellSelectionService:
|
|
1091
|
+
cellSelectionService: l,
|
|
1074
1092
|
rowSelectionService: o
|
|
1075
1093
|
} = e;
|
|
1076
1094
|
return {
|
|
1077
1095
|
name: "selection",
|
|
1078
|
-
init:
|
|
1079
|
-
start:
|
|
1080
|
-
stop:
|
|
1081
|
-
dispose:
|
|
1082
|
-
getSelectionSnapshot:
|
|
1083
|
-
setSelectionSnapshot:
|
|
1084
|
-
clearSelection:
|
|
1096
|
+
init: fe("init", [t, l, o]),
|
|
1097
|
+
start: fe("start", [t, l, o]),
|
|
1098
|
+
stop: fe("stop", [t, l, o]),
|
|
1099
|
+
dispose: fe("dispose", [t, l, o]),
|
|
1100
|
+
getSelectionSnapshot: l.getSelectionSnapshot,
|
|
1101
|
+
setSelectionSnapshot: l.setSelectionSnapshot,
|
|
1102
|
+
clearSelection: l.clearSelection,
|
|
1085
1103
|
getRowSelectionSnapshot: o.getRowSelectionSnapshot,
|
|
1086
1104
|
setRowSelectionSnapshot: o.setRowSelectionSnapshot,
|
|
1087
1105
|
clearRowSelection: o.clearRowSelection,
|
|
@@ -1095,38 +1113,38 @@ function Tn(e) {
|
|
|
1095
1113
|
clearSelectedRows: o.clearSelectedRows
|
|
1096
1114
|
};
|
|
1097
1115
|
}
|
|
1098
|
-
function
|
|
1116
|
+
function tt(e) {
|
|
1099
1117
|
const t = e?.dataSource;
|
|
1100
1118
|
if (!t || typeof t != "object")
|
|
1101
1119
|
return null;
|
|
1102
|
-
const
|
|
1103
|
-
return typeof
|
|
1120
|
+
const l = t;
|
|
1121
|
+
return typeof l.undoHistoryStack == "function" && typeof l.redoHistoryStack == "function" ? l : null;
|
|
1104
1122
|
}
|
|
1105
|
-
function
|
|
1123
|
+
function Tn(e, t) {
|
|
1106
1124
|
if (e?.focusedRow !== t?.focusedRow || (e?.mode ?? "explicit") !== (t?.mode ?? "explicit"))
|
|
1107
1125
|
return !1;
|
|
1108
|
-
const
|
|
1109
|
-
if (
|
|
1126
|
+
const l = e?.selectedRows ?? [], o = t?.selectedRows ?? [];
|
|
1127
|
+
if (l.length !== o.length)
|
|
1110
1128
|
return !1;
|
|
1111
|
-
for (let
|
|
1112
|
-
if (
|
|
1129
|
+
for (let w = 0; w < l.length; w += 1)
|
|
1130
|
+
if (l[w] !== o[w])
|
|
1113
1131
|
return !1;
|
|
1114
|
-
const d = e?.excludedRows ?? [],
|
|
1115
|
-
if (d.length !==
|
|
1132
|
+
const d = e?.excludedRows ?? [], i = t?.excludedRows ?? [];
|
|
1133
|
+
if (d.length !== i.length)
|
|
1116
1134
|
return !1;
|
|
1117
|
-
for (let
|
|
1118
|
-
if (d[
|
|
1135
|
+
for (let w = 0; w < d.length; w += 1)
|
|
1136
|
+
if (d[w] !== i[w])
|
|
1119
1137
|
return !1;
|
|
1120
1138
|
return !0;
|
|
1121
1139
|
}
|
|
1122
|
-
function
|
|
1140
|
+
function kn(e, t) {
|
|
1123
1141
|
if (e === t)
|
|
1124
1142
|
return !0;
|
|
1125
|
-
const
|
|
1126
|
-
if (
|
|
1143
|
+
const l = Object.entries(e ?? {}), o = Object.entries(t ?? {});
|
|
1144
|
+
if (l.length !== o.length)
|
|
1127
1145
|
return !1;
|
|
1128
|
-
for (const [d,
|
|
1129
|
-
if (!Object.is(
|
|
1146
|
+
for (const [d, i] of l)
|
|
1147
|
+
if (!Object.is(i, t?.[d]))
|
|
1130
1148
|
return !1;
|
|
1131
1149
|
return !0;
|
|
1132
1150
|
}
|
|
@@ -1135,9 +1153,9 @@ function Vn(e, t) {
|
|
|
1135
1153
|
return !0;
|
|
1136
1154
|
if (e.length !== t.length)
|
|
1137
1155
|
return !1;
|
|
1138
|
-
for (let
|
|
1139
|
-
const o = e[
|
|
1140
|
-
if (!o || !d || o.key !== d.key || o.component !== d.component || !
|
|
1156
|
+
for (let l = 0; l < e.length; l += 1) {
|
|
1157
|
+
const o = e[l], d = t[l];
|
|
1158
|
+
if (!o || !d || o.key !== d.key || o.component !== d.component || !kn(o.props, d.props))
|
|
1141
1159
|
return !1;
|
|
1142
1160
|
}
|
|
1143
1161
|
return !0;
|
|
@@ -1427,7 +1445,7 @@ const Un = {
|
|
|
1427
1445
|
type: Function,
|
|
1428
1446
|
default: void 0
|
|
1429
1447
|
}
|
|
1430
|
-
},
|
|
1448
|
+
}, it = nt({
|
|
1431
1449
|
name: "DataGrid",
|
|
1432
1450
|
inheritAttrs: !1,
|
|
1433
1451
|
props: Un,
|
|
@@ -1436,7 +1454,6 @@ const Un = {
|
|
|
1436
1454
|
"cell-edit": (e) => !0,
|
|
1437
1455
|
"selection-change": (e) => !0,
|
|
1438
1456
|
"row-selection-change": (e) => !0,
|
|
1439
|
-
"row-select": (e) => !0,
|
|
1440
1457
|
"update:rowSelectionState": (e) => !0,
|
|
1441
1458
|
"update:columnState": (e) => !0,
|
|
1442
1459
|
"update:columnOrder": (e) => !0,
|
|
@@ -1449,36 +1466,36 @@ const Un = {
|
|
|
1449
1466
|
"toolbar-modules-change": (e) => !0,
|
|
1450
1467
|
ready: (e) => !0
|
|
1451
1468
|
},
|
|
1452
|
-
setup(e, { attrs: t, slots:
|
|
1453
|
-
const
|
|
1454
|
-
let
|
|
1455
|
-
const
|
|
1469
|
+
setup(e, { attrs: t, slots: l, emit: o, expose: d }) {
|
|
1470
|
+
const i = V(null), w = jn(), s = V(null), A = V(null), P = V([]);
|
|
1471
|
+
let k = null, F = !1, I = null, E = !1, J = !1;
|
|
1472
|
+
const g = V(e.viewMode === "gantt" ? "gantt" : "table"), Z = V(e.state ?? null), h = y(() => dn(e.statePersistence)), K = y(() => Ln(e.history)), te = y(() => Kt(e.chrome)), U = y(() => an(e.renderMode, e.pagination)), u = y(() => un(
|
|
1456
1473
|
e.pagination,
|
|
1457
1474
|
U.value,
|
|
1458
1475
|
e.pageSize,
|
|
1459
1476
|
e.currentPage
|
|
1460
|
-
)), S =
|
|
1477
|
+
)), S = y(() => zt(e.columnMenu)), p = y(() => Ht(e.cellMenu)), M = y(() => Tt(e.rowIndexMenu)), O = y(() => kt(e.columnLayout)), B = y(() => Vt(e.columnReorder)), x = y(() => An(e.aggregations)), G = y(() => Jt(e.advancedFilter)), j = y(() => pn(e.quickFilter)), z = y(() => wn(e.findReplace)), _ = y(() => hn(e.gridLines)), W = y(() => ln(e.groupBy)), Y = y(() => e.state ? be(e.state, e.columns) : e.state), Q = y(() => Ut(e.filterModel ?? null, e.columns)), N = y(() => e.state ? Y.value : Z.value), ne = y(() => e.sortModel !== void 0 ? e.sortModel : N.value?.rows?.snapshot?.sortModel), oe = y(() => e.filterModel !== void 0 ? Q.value : jt(N.value?.rows?.snapshot?.filterModel ?? null)), ye = y(() => e.groupBy !== void 0 ? W.value ?? null : N.value?.rows?.snapshot?.groupBy ?? null), ae = y(() => e.pivotModel !== void 0 ? e.pivotModel : N.value?.rows?.snapshot?.pivotModel ?? null), ve = y(() => xn(e.virtualization, U.value)), X = y(() => bn(e.layoutMode, e.minRows, e.maxRows)), r = y(() => Zt(e.placeholderRows)), m = y(() => _t(e.rowReorder)), f = y(() => {
|
|
1461
1478
|
const n = e.clientRowModelOptions?.readFilterCell;
|
|
1462
|
-
return
|
|
1479
|
+
return Kn(
|
|
1463
1480
|
e.columns,
|
|
1464
1481
|
e.readFilterCell ?? n
|
|
1465
1482
|
);
|
|
1466
|
-
}),
|
|
1483
|
+
}), c = y(() => {
|
|
1467
1484
|
const n = e.readFilterCellStyle ?? e.clientRowModelOptions?.readFilterCellStyle;
|
|
1468
|
-
return !
|
|
1485
|
+
return !f.value && !n ? e.clientRowModelOptions : {
|
|
1469
1486
|
...e.clientRowModelOptions ?? {},
|
|
1470
|
-
readFilterCell:
|
|
1487
|
+
readFilterCell: f.value,
|
|
1471
1488
|
readFilterCellStyle: n
|
|
1472
1489
|
};
|
|
1473
|
-
}),
|
|
1490
|
+
}), b = y(() => Wt({
|
|
1474
1491
|
columns: e.columns,
|
|
1475
|
-
clientRowModelOptions:
|
|
1492
|
+
clientRowModelOptions: c.value,
|
|
1476
1493
|
computedFields: e.computedFields,
|
|
1477
1494
|
formulas: e.formulas,
|
|
1478
1495
|
formulaFunctions: e.formulaFunctions
|
|
1479
|
-
})),
|
|
1496
|
+
})), H = y(() => Nt(e.columns)), q = {
|
|
1480
1497
|
get state() {
|
|
1481
|
-
return
|
|
1498
|
+
return Y.value;
|
|
1482
1499
|
},
|
|
1483
1500
|
get stateOptions() {
|
|
1484
1501
|
return e.stateOptions;
|
|
@@ -1502,7 +1519,7 @@ const Un = {
|
|
|
1502
1519
|
return e.sortModel;
|
|
1503
1520
|
},
|
|
1504
1521
|
get filterModel() {
|
|
1505
|
-
return e.filterModel === void 0 ? void 0 :
|
|
1522
|
+
return e.filterModel === void 0 ? void 0 : Q.value;
|
|
1506
1523
|
},
|
|
1507
1524
|
get groupBy() {
|
|
1508
1525
|
return W.value;
|
|
@@ -1522,62 +1539,65 @@ const Un = {
|
|
|
1522
1539
|
get columns() {
|
|
1523
1540
|
return e.columns;
|
|
1524
1541
|
}
|
|
1525
|
-
},
|
|
1526
|
-
const n =
|
|
1542
|
+
}, Ge = y(() => ae.value ? "pivot" : b.value && "initialTreeData" in b.value ? "tree" : "base"), at = y(() => i.value?.api.columns.getSnapshot().visibleColumns ?? []), ut = y(() => {
|
|
1543
|
+
const n = i.value?.runtime;
|
|
1527
1544
|
if (!n)
|
|
1528
1545
|
return 0;
|
|
1529
|
-
const
|
|
1530
|
-
return Math.max(0,
|
|
1531
|
-
}),
|
|
1532
|
-
const
|
|
1533
|
-
if (!
|
|
1546
|
+
const a = Ue(n.rowPartition);
|
|
1547
|
+
return Math.max(0, a.pinnedTopRows.length + a.bodyRowCount + a.pinnedBottomRows.length);
|
|
1548
|
+
}), st = (n) => {
|
|
1549
|
+
const a = i.value?.runtime;
|
|
1550
|
+
if (!a)
|
|
1534
1551
|
return null;
|
|
1535
|
-
const v =
|
|
1536
|
-
if (n <
|
|
1537
|
-
return
|
|
1538
|
-
const
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1552
|
+
const v = Ue(a.rowPartition), D = v.pinnedTopRows.length;
|
|
1553
|
+
if (n < D)
|
|
1554
|
+
return v.pinnedTopRows[n] ?? null;
|
|
1555
|
+
const $ = v.bodyRowCount, le = n - D;
|
|
1556
|
+
if (le < $)
|
|
1557
|
+
return a.getBodyRowAtIndex(le);
|
|
1558
|
+
const ie = le - $;
|
|
1559
|
+
return v.pinnedBottomRows[ie] ?? null;
|
|
1560
|
+
}, dt = {
|
|
1561
|
+
mode: y(() => Ge.value),
|
|
1562
|
+
resolveRuntime: () => i.value,
|
|
1543
1563
|
visibleColumns: at,
|
|
1544
|
-
totalRows:
|
|
1545
|
-
showRowSelection:
|
|
1564
|
+
totalRows: ut,
|
|
1565
|
+
showRowSelection: y(() => e.rowSelection),
|
|
1546
1566
|
readSelectionCell: e.readSelectionCell,
|
|
1547
|
-
resolveSelectionRowAtIndex:
|
|
1567
|
+
resolveSelectionRowAtIndex: st
|
|
1548
1568
|
}, {
|
|
1549
|
-
selectionSnapshot:
|
|
1550
|
-
selectionAnchor:
|
|
1551
|
-
syncSelectionSnapshotFromRuntime:
|
|
1552
|
-
selectionService:
|
|
1553
|
-
selectionAggregatesLabel:
|
|
1554
|
-
} =
|
|
1555
|
-
rowSelectionSnapshot:
|
|
1556
|
-
syncRowSelectionSnapshotFromRuntime:
|
|
1557
|
-
reconcileRowSelectionFromRuntime:
|
|
1558
|
-
selectionService:
|
|
1559
|
-
} =
|
|
1560
|
-
resolveRuntime: () =>
|
|
1561
|
-
}),
|
|
1569
|
+
selectionSnapshot: ct,
|
|
1570
|
+
selectionAnchor: ft,
|
|
1571
|
+
syncSelectionSnapshotFromRuntime: mt,
|
|
1572
|
+
selectionService: yt,
|
|
1573
|
+
selectionAggregatesLabel: vt
|
|
1574
|
+
} = Lt(dt), {
|
|
1575
|
+
rowSelectionSnapshot: pe,
|
|
1576
|
+
syncRowSelectionSnapshotFromRuntime: we,
|
|
1577
|
+
reconcileRowSelectionFromRuntime: pt,
|
|
1578
|
+
selectionService: je
|
|
1579
|
+
} = Et({
|
|
1580
|
+
resolveRuntime: () => i.value
|
|
1581
|
+
}), wt = y(() => e.rowSelection ? je : zn()), gt = y(() => ({
|
|
1562
1582
|
...e.services ?? {},
|
|
1563
|
-
selection:
|
|
1583
|
+
selection: Hn({
|
|
1564
1584
|
userSelectionService: e.services?.selection,
|
|
1565
|
-
cellSelectionService:
|
|
1566
|
-
rowSelectionService:
|
|
1585
|
+
cellSelectionService: yt,
|
|
1586
|
+
rowSelectionService: wt.value
|
|
1567
1587
|
})
|
|
1568
1588
|
})), {
|
|
1569
|
-
dataGridInstanceKey:
|
|
1570
|
-
resolvedRowModel:
|
|
1589
|
+
dataGridInstanceKey: St,
|
|
1590
|
+
resolvedRowModel: re
|
|
1571
1591
|
} = qt({
|
|
1572
|
-
rows:
|
|
1573
|
-
rowModel:
|
|
1574
|
-
clientRowModelOptions:
|
|
1592
|
+
rows: _e(e, "rows"),
|
|
1593
|
+
rowModel: _e(e, "rowModel"),
|
|
1594
|
+
clientRowModelOptions: b,
|
|
1575
1595
|
onOwnedRowModelRecreated: () => {
|
|
1576
|
-
|
|
1596
|
+
R.dispose();
|
|
1577
1597
|
}
|
|
1578
|
-
}),
|
|
1579
|
-
gridRef:
|
|
1580
|
-
props:
|
|
1598
|
+
}), R = Dn({
|
|
1599
|
+
gridRef: i,
|
|
1600
|
+
props: q,
|
|
1581
1601
|
emit: {
|
|
1582
1602
|
columnState: (n) => o("update:columnState", n),
|
|
1583
1603
|
columnOrder: (n) => o("update:columnOrder", n),
|
|
@@ -1586,287 +1606,287 @@ const Un = {
|
|
|
1586
1606
|
columnPins: (n) => o("update:columnPins", n),
|
|
1587
1607
|
groupBy: (n) => o("update:groupBy", n),
|
|
1588
1608
|
state: (n) => {
|
|
1589
|
-
|
|
1609
|
+
Z.value = n, o("update:state", n), Le();
|
|
1590
1610
|
},
|
|
1591
1611
|
ready: (n) => {
|
|
1592
|
-
|
|
1612
|
+
J = !0, Ee(), o("ready", {
|
|
1593
1613
|
api: n.api,
|
|
1594
|
-
rowModel:
|
|
1614
|
+
rowModel: re.value
|
|
1595
1615
|
});
|
|
1596
1616
|
}
|
|
1597
1617
|
}
|
|
1598
1618
|
});
|
|
1599
|
-
function
|
|
1600
|
-
|
|
1619
|
+
function ge() {
|
|
1620
|
+
I != null && (globalThis.clearTimeout(I), I = null);
|
|
1601
1621
|
}
|
|
1602
|
-
function
|
|
1622
|
+
function ue() {
|
|
1603
1623
|
const n = h.value;
|
|
1604
|
-
if (!n || !
|
|
1624
|
+
if (!n || !E)
|
|
1605
1625
|
return;
|
|
1606
|
-
const
|
|
1607
|
-
if (!
|
|
1626
|
+
const a = Je(n.storage);
|
|
1627
|
+
if (!a)
|
|
1608
1628
|
return;
|
|
1609
|
-
const
|
|
1610
|
-
if (
|
|
1629
|
+
const D = i.value?.api?.state.get(n.getOptions) ?? R.getState();
|
|
1630
|
+
if (D)
|
|
1611
1631
|
try {
|
|
1612
|
-
|
|
1632
|
+
a.setItem(n.key, JSON.stringify(D));
|
|
1613
1633
|
} catch {
|
|
1614
1634
|
}
|
|
1615
1635
|
}
|
|
1616
|
-
function
|
|
1636
|
+
function Le() {
|
|
1617
1637
|
const n = h.value;
|
|
1618
|
-
!n || !
|
|
1619
|
-
|
|
1638
|
+
!n || !E || (ge(), I = globalThis.setTimeout(() => {
|
|
1639
|
+
I = null, ue();
|
|
1620
1640
|
}, n.debounceMs));
|
|
1621
1641
|
}
|
|
1622
|
-
function
|
|
1642
|
+
function Ee() {
|
|
1623
1643
|
const n = h.value;
|
|
1624
|
-
if (!n ||
|
|
1644
|
+
if (!n || E || !J)
|
|
1625
1645
|
return;
|
|
1626
1646
|
if (!n.restoreOnReady) {
|
|
1627
|
-
|
|
1647
|
+
E = !0;
|
|
1628
1648
|
return;
|
|
1629
1649
|
}
|
|
1630
|
-
|
|
1631
|
-
const
|
|
1632
|
-
if (!
|
|
1650
|
+
E = !0;
|
|
1651
|
+
const a = Je(n.storage);
|
|
1652
|
+
if (!a)
|
|
1633
1653
|
return;
|
|
1634
1654
|
let v;
|
|
1635
1655
|
try {
|
|
1636
|
-
const
|
|
1637
|
-
if (
|
|
1656
|
+
const $ = a.getItem(n.key);
|
|
1657
|
+
if (!$)
|
|
1638
1658
|
return;
|
|
1639
|
-
v = JSON.parse(
|
|
1659
|
+
v = JSON.parse($);
|
|
1640
1660
|
} catch {
|
|
1641
1661
|
return;
|
|
1642
1662
|
}
|
|
1643
|
-
const
|
|
1644
|
-
|
|
1663
|
+
const D = R.migrateState(v);
|
|
1664
|
+
D && R.applyState(D, n.setOptions);
|
|
1645
1665
|
}
|
|
1646
|
-
function
|
|
1647
|
-
|
|
1666
|
+
function ht() {
|
|
1667
|
+
Le();
|
|
1648
1668
|
}
|
|
1649
|
-
function
|
|
1650
|
-
|
|
1669
|
+
function se() {
|
|
1670
|
+
ue();
|
|
1651
1671
|
}
|
|
1652
|
-
function
|
|
1653
|
-
typeof document < "u" && document.visibilityState === "hidden" &&
|
|
1672
|
+
function Ke() {
|
|
1673
|
+
typeof document < "u" && document.visibilityState === "hidden" && ue();
|
|
1654
1674
|
}
|
|
1655
|
-
const
|
|
1656
|
-
|
|
1657
|
-
},
|
|
1675
|
+
const bt = (n) => {
|
|
1676
|
+
pt(), o("cell-change", n), R.emitSnapshotUpdates();
|
|
1677
|
+
}, Se = (n) => {
|
|
1658
1678
|
o("cell-edit", n);
|
|
1659
|
-
}, bt = (n) => {
|
|
1660
|
-
o("selection-change", n), b.emitSnapshotUpdates();
|
|
1661
1679
|
}, Rt = (n) => {
|
|
1680
|
+
o("selection-change", n), R.emitSnapshotUpdates();
|
|
1681
|
+
}, Mt = (n) => {
|
|
1662
1682
|
o("row-selection-change", n);
|
|
1663
|
-
},
|
|
1664
|
-
|
|
1683
|
+
}, ze = () => {
|
|
1684
|
+
R.emitSnapshotUpdates();
|
|
1665
1685
|
};
|
|
1666
1686
|
C(
|
|
1667
|
-
|
|
1687
|
+
pe,
|
|
1668
1688
|
(n) => {
|
|
1669
|
-
o("
|
|
1689
|
+
o("update:rowSelectionState", n), ze();
|
|
1670
1690
|
},
|
|
1671
1691
|
{ deep: !0 }
|
|
1672
1692
|
), C(
|
|
1673
|
-
() => [e.rowSelection, e.rowSelectionState,
|
|
1674
|
-
([n,
|
|
1693
|
+
() => [e.rowSelection, e.rowSelectionState, i.value],
|
|
1694
|
+
([n, a]) => {
|
|
1675
1695
|
if (n) {
|
|
1676
|
-
if (
|
|
1677
|
-
const v =
|
|
1678
|
-
|
|
1696
|
+
if (a !== void 0) {
|
|
1697
|
+
const v = i.value?.api.rowSelection;
|
|
1698
|
+
Tn(pe.value, a) || (a ? v?.setSnapshot(a) : v?.clear(), we());
|
|
1679
1699
|
return;
|
|
1680
1700
|
}
|
|
1681
|
-
|
|
1701
|
+
we();
|
|
1682
1702
|
return;
|
|
1683
1703
|
}
|
|
1684
|
-
|
|
1704
|
+
je.clearRowSelection?.();
|
|
1685
1705
|
},
|
|
1686
1706
|
{ immediate: !0 }
|
|
1687
1707
|
), C(
|
|
1688
1708
|
() => e.viewMode,
|
|
1689
1709
|
(n) => {
|
|
1690
|
-
|
|
1710
|
+
g.value = n === "gantt" ? "gantt" : "table";
|
|
1691
1711
|
},
|
|
1692
1712
|
{ immediate: !0 }
|
|
1693
1713
|
);
|
|
1694
|
-
const
|
|
1695
|
-
const
|
|
1696
|
-
|
|
1697
|
-
},
|
|
1714
|
+
const He = (n) => {
|
|
1715
|
+
const a = n === "gantt" ? "gantt" : "table";
|
|
1716
|
+
g.value = a, o("update:viewMode", a);
|
|
1717
|
+
}, Ot = (n) => {
|
|
1698
1718
|
s.value = n;
|
|
1699
|
-
},
|
|
1700
|
-
|
|
1719
|
+
}, Te = (n) => {
|
|
1720
|
+
A.value = n;
|
|
1701
1721
|
}, Ct = (n) => {
|
|
1702
|
-
Vn(P.value, n) || (P.value = n,
|
|
1703
|
-
|
|
1704
|
-
const
|
|
1705
|
-
|
|
1722
|
+
Vn(P.value, n) || (P.value = n, k = n, !F && (F = !0, Promise.resolve().then(() => {
|
|
1723
|
+
F = !1;
|
|
1724
|
+
const a = k;
|
|
1725
|
+
k = null, a && o("toolbar-modules-change", a);
|
|
1706
1726
|
})));
|
|
1707
|
-
},
|
|
1727
|
+
}, L = V({
|
|
1708
1728
|
canUndo: !1,
|
|
1709
1729
|
canRedo: !1
|
|
1710
1730
|
});
|
|
1711
1731
|
C(
|
|
1712
|
-
|
|
1713
|
-
(n,
|
|
1714
|
-
const
|
|
1715
|
-
if (
|
|
1732
|
+
re,
|
|
1733
|
+
(n, a, v) => {
|
|
1734
|
+
const D = tt(n);
|
|
1735
|
+
if (L.value = D?.getCachedHistoryStatus?.() ?? {
|
|
1716
1736
|
canUndo: !1,
|
|
1717
1737
|
canRedo: !1
|
|
1718
|
-
}, !
|
|
1738
|
+
}, !D)
|
|
1719
1739
|
return;
|
|
1720
|
-
let
|
|
1721
|
-
const
|
|
1722
|
-
|
|
1740
|
+
let $ = !0;
|
|
1741
|
+
const le = D.subscribeHistoryStatus?.((ie) => {
|
|
1742
|
+
L.value = ie;
|
|
1723
1743
|
});
|
|
1724
|
-
|
|
1725
|
-
|
|
1744
|
+
D.getHistoryStatus?.().then((ie) => {
|
|
1745
|
+
$ && (L.value = ie);
|
|
1726
1746
|
}).catch(() => {
|
|
1727
1747
|
}), v(() => {
|
|
1728
|
-
|
|
1748
|
+
$ = !1, le?.();
|
|
1729
1749
|
});
|
|
1730
1750
|
},
|
|
1731
1751
|
{ immediate: !0 }
|
|
1732
1752
|
);
|
|
1733
|
-
const
|
|
1734
|
-
const n =
|
|
1735
|
-
return !
|
|
1736
|
-
canUndo: () => (
|
|
1737
|
-
canRedo: () => (
|
|
1738
|
-
runHistoryAction: async (
|
|
1739
|
-
if (
|
|
1753
|
+
const At = y(() => {
|
|
1754
|
+
const n = tt(re.value);
|
|
1755
|
+
return !K.value.enabled || K.value.adapter || !n ? w : {
|
|
1756
|
+
canUndo: () => (L.value, L.value.canUndo === !0),
|
|
1757
|
+
canRedo: () => (L.value, L.value.canRedo === !0),
|
|
1758
|
+
runHistoryAction: async (a) => {
|
|
1759
|
+
if (L.value, a === "undo" && L.value.canUndo !== !0 || a === "redo" && L.value.canRedo !== !0)
|
|
1740
1760
|
return null;
|
|
1741
|
-
const v =
|
|
1742
|
-
return v && (
|
|
1743
|
-
...
|
|
1761
|
+
const v = a === "undo" ? await n.undoHistoryStack?.() : await n.redoHistoryStack?.();
|
|
1762
|
+
return v && (L.value = {
|
|
1763
|
+
...L.value,
|
|
1744
1764
|
...typeof v.canUndo == "boolean" ? { canUndo: v.canUndo } : {},
|
|
1745
1765
|
...typeof v.canRedo == "boolean" ? { canRedo: v.canRedo } : {},
|
|
1746
1766
|
...typeof v.latestUndoOperationId < "u" ? { latestUndoOperationId: v.latestUndoOperationId } : {},
|
|
1747
1767
|
...typeof v.latestRedoOperationId < "u" ? { latestRedoOperationId: v.latestRedoOperationId } : {},
|
|
1748
1768
|
...typeof v.datasetVersion < "u" ? { datasetVersion: v.datasetVersion } : {}
|
|
1749
|
-
}), typeof v?.operationId == "string" && v.operationId.length > 0 ? v.operationId :
|
|
1769
|
+
}), typeof v?.operationId == "string" && v.operationId.length > 0 ? v.operationId : a === "undo" ? v?.latestRedoOperationId ?? null : v?.latestUndoOperationId ?? null;
|
|
1750
1770
|
}
|
|
1751
1771
|
};
|
|
1752
|
-
}),
|
|
1753
|
-
const n =
|
|
1754
|
-
return !
|
|
1772
|
+
}), he = y(() => {
|
|
1773
|
+
const n = K.value.adapter;
|
|
1774
|
+
return !K.value.enabled || !n ? At.value : {
|
|
1755
1775
|
canUndo: () => n.canUndo(),
|
|
1756
1776
|
canRedo: () => n.canRedo(),
|
|
1757
|
-
runHistoryAction: (
|
|
1777
|
+
runHistoryAction: (a) => n.runHistoryAction(a)
|
|
1758
1778
|
};
|
|
1759
|
-
}),
|
|
1760
|
-
canUndo: () => (s.value ??
|
|
1761
|
-
canRedo: () => (s.value ??
|
|
1762
|
-
runHistoryAction: (n) => (s.value ??
|
|
1763
|
-
},
|
|
1764
|
-
const n =
|
|
1765
|
-
return n ?
|
|
1779
|
+
}), ke = {
|
|
1780
|
+
canUndo: () => (s.value ?? he.value).canUndo(),
|
|
1781
|
+
canRedo: () => (s.value ?? he.value).canRedo(),
|
|
1782
|
+
runHistoryAction: (n) => (s.value ?? he.value).runHistoryAction(n)
|
|
1783
|
+
}, xt = () => {
|
|
1784
|
+
const n = R.getState();
|
|
1785
|
+
return n ? me({
|
|
1766
1786
|
state: n,
|
|
1767
|
-
viewMode:
|
|
1787
|
+
viewMode: g.value
|
|
1768
1788
|
}) : null;
|
|
1769
|
-
}, Pt = (n,
|
|
1770
|
-
const v =
|
|
1771
|
-
return
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
) ? (v.viewMode &&
|
|
1789
|
+
}, Pt = (n, a) => lt(n, R.migrateState, a), It = (n, a) => {
|
|
1790
|
+
const v = me(n);
|
|
1791
|
+
return R.applyState(
|
|
1792
|
+
be(v.state, e.columns),
|
|
1793
|
+
a
|
|
1794
|
+
) ? (v.viewMode && He(v.viewMode), !0) : !1;
|
|
1775
1795
|
};
|
|
1776
1796
|
return C(
|
|
1777
1797
|
h,
|
|
1778
1798
|
() => {
|
|
1779
|
-
|
|
1799
|
+
ge(), E = !1, Ee();
|
|
1780
1800
|
},
|
|
1781
1801
|
{ deep: !0 }
|
|
1782
1802
|
), Bt(() => {
|
|
1783
|
-
typeof window < "u" && (window.addEventListener("pagehide",
|
|
1784
|
-
}),
|
|
1785
|
-
|
|
1803
|
+
typeof window < "u" && (window.addEventListener("pagehide", se), window.addEventListener("beforeunload", se)), typeof document < "u" && document.addEventListener("visibilitychange", Ke);
|
|
1804
|
+
}), Be(() => {
|
|
1805
|
+
ue(), ge(), typeof window < "u" && (window.removeEventListener("pagehide", se), window.removeEventListener("beforeunload", se)), typeof document < "u" && document.removeEventListener("visibilitychange", Ke), R.dispose(), Te(null);
|
|
1786
1806
|
}), d({
|
|
1787
|
-
grid:
|
|
1788
|
-
rowModel:
|
|
1789
|
-
history:
|
|
1790
|
-
getHistory: () =>
|
|
1807
|
+
grid: i,
|
|
1808
|
+
rowModel: re,
|
|
1809
|
+
history: ke,
|
|
1810
|
+
getHistory: () => ke,
|
|
1791
1811
|
toolbarModules: P,
|
|
1792
1812
|
getToolbarModules: () => P.value,
|
|
1793
|
-
getApi: () =>
|
|
1794
|
-
getRuntime: () =>
|
|
1795
|
-
getCore: () =>
|
|
1796
|
-
captureFocusAnchor: (n) =>
|
|
1797
|
-
restoreFocusAnchor: (n,
|
|
1813
|
+
getApi: () => i.value?.api ?? null,
|
|
1814
|
+
getRuntime: () => i.value?.runtime ?? null,
|
|
1815
|
+
getCore: () => i.value?.core ?? null,
|
|
1816
|
+
captureFocusAnchor: (n) => i.value?.captureFocusAnchor(n) ?? null,
|
|
1817
|
+
restoreFocusAnchor: (n, a) => i.value?.restoreFocusAnchor(n, a) ?? Promise.resolve(!1),
|
|
1798
1818
|
restoreFocus: () => {
|
|
1799
|
-
|
|
1819
|
+
i.value?.restoreFocus();
|
|
1800
1820
|
},
|
|
1801
|
-
getColumnState: () =>
|
|
1802
|
-
getColumnSnapshot: () =>
|
|
1803
|
-
getSelectionAggregatesLabel: () =>
|
|
1804
|
-
runStructuralRowAction: (n,
|
|
1821
|
+
getColumnState: () => R.getColumnState(),
|
|
1822
|
+
getColumnSnapshot: () => i.value?.api.columns.getSnapshot() ?? null,
|
|
1823
|
+
getSelectionAggregatesLabel: () => vt.value,
|
|
1824
|
+
runStructuralRowAction: (n, a) => A.value?.(n, a) ?? Promise.resolve(!1),
|
|
1805
1825
|
getSelectionSummary: () => {
|
|
1806
|
-
const n =
|
|
1826
|
+
const n = i.value?.api.selection.summarize;
|
|
1807
1827
|
if (!n)
|
|
1808
1828
|
return null;
|
|
1809
|
-
const
|
|
1829
|
+
const a = {
|
|
1810
1830
|
readSelectionCell: e.readSelectionCell
|
|
1811
1831
|
};
|
|
1812
|
-
return n(
|
|
1832
|
+
return n(a);
|
|
1813
1833
|
},
|
|
1814
|
-
getView: () =>
|
|
1815
|
-
setView:
|
|
1816
|
-
getSavedView:
|
|
1834
|
+
getView: () => g.value,
|
|
1835
|
+
setView: He,
|
|
1836
|
+
getSavedView: xt,
|
|
1817
1837
|
migrateSavedView: Pt,
|
|
1818
|
-
applySavedView:
|
|
1819
|
-
applyColumnState:
|
|
1820
|
-
getState:
|
|
1821
|
-
migrateState:
|
|
1822
|
-
applyState: (n,
|
|
1823
|
-
exportPivotLayout:
|
|
1824
|
-
exportPivotInterop:
|
|
1825
|
-
importPivotLayout:
|
|
1826
|
-
expandAllGroups:
|
|
1827
|
-
collapseAllGroups:
|
|
1828
|
-
insertRowsAt: (n,
|
|
1829
|
-
insertRowBefore: (n,
|
|
1830
|
-
insertRowAfter: (n,
|
|
1831
|
-
insertColumnsAt: (n,
|
|
1832
|
-
insertColumnBefore: (n,
|
|
1833
|
-
insertColumnAfter: (n,
|
|
1838
|
+
applySavedView: It,
|
|
1839
|
+
applyColumnState: R.applyColumnState,
|
|
1840
|
+
getState: R.getState,
|
|
1841
|
+
migrateState: R.migrateState,
|
|
1842
|
+
applyState: (n, a) => n ? R.applyState(be(n, e.columns), a) : !1,
|
|
1843
|
+
exportPivotLayout: R.exportPivotLayout,
|
|
1844
|
+
exportPivotInterop: R.exportPivotInterop,
|
|
1845
|
+
importPivotLayout: R.importPivotLayout,
|
|
1846
|
+
expandAllGroups: R.expandAllGroups,
|
|
1847
|
+
collapseAllGroups: R.collapseAllGroups,
|
|
1848
|
+
insertRowsAt: (n, a) => i.value?.api.rows.insertDataAt(n, a) ?? !1,
|
|
1849
|
+
insertRowBefore: (n, a) => i.value?.api.rows.insertDataBefore(n, a) ?? !1,
|
|
1850
|
+
insertRowAfter: (n, a) => i.value?.api.rows.insertDataAfter(n, a) ?? !1,
|
|
1851
|
+
insertColumnsAt: (n, a) => i.value?.api.columns.insertAt(n, a) ?? !1,
|
|
1852
|
+
insertColumnBefore: (n, a) => i.value?.api.columns.insertBefore(n, a) ?? !1,
|
|
1853
|
+
insertColumnAfter: (n, a) => i.value?.api.columns.insertAfter(n, a) ?? !1
|
|
1834
1854
|
}), () => {
|
|
1835
1855
|
const n = {
|
|
1836
|
-
mode:
|
|
1856
|
+
mode: Ge.value,
|
|
1837
1857
|
rows: e.rows,
|
|
1838
|
-
runtime:
|
|
1839
|
-
runtimeRowModel:
|
|
1840
|
-
selectionSnapshot:
|
|
1841
|
-
selectionAnchor:
|
|
1842
|
-
rowSelectionSnapshot:
|
|
1843
|
-
syncSelectionSnapshotFromRuntime:
|
|
1844
|
-
syncRowSelectionSnapshotFromRuntime:
|
|
1845
|
-
flushRowSelectionSnapshotUpdates:
|
|
1846
|
-
sortModel:
|
|
1847
|
-
filterModel:
|
|
1858
|
+
runtime: i.value?.runtime ?? null,
|
|
1859
|
+
runtimeRowModel: i.value?.rowModel ?? null,
|
|
1860
|
+
selectionSnapshot: ct,
|
|
1861
|
+
selectionAnchor: ft,
|
|
1862
|
+
rowSelectionSnapshot: pe,
|
|
1863
|
+
syncSelectionSnapshotFromRuntime: mt,
|
|
1864
|
+
syncRowSelectionSnapshotFromRuntime: we,
|
|
1865
|
+
flushRowSelectionSnapshotUpdates: ze,
|
|
1866
|
+
sortModel: ne.value,
|
|
1867
|
+
filterModel: oe.value,
|
|
1848
1868
|
filterModelNormalized: !0,
|
|
1849
1869
|
appColumns: e.columns,
|
|
1850
|
-
groupBy:
|
|
1851
|
-
pivotModel:
|
|
1870
|
+
groupBy: ye.value,
|
|
1871
|
+
pivotModel: ae.value,
|
|
1852
1872
|
renderMode: U.value,
|
|
1853
|
-
virtualization:
|
|
1873
|
+
virtualization: ve.value,
|
|
1854
1874
|
columnMenu: S.value,
|
|
1855
1875
|
cellMenu: p.value,
|
|
1856
|
-
rowIndexMenu:
|
|
1857
|
-
columnLayout:
|
|
1858
|
-
columnReorder:
|
|
1859
|
-
aggregations:
|
|
1860
|
-
advancedFilter:
|
|
1861
|
-
quickFilter:
|
|
1862
|
-
findReplace:
|
|
1876
|
+
rowIndexMenu: M.value,
|
|
1877
|
+
columnLayout: O.value,
|
|
1878
|
+
columnReorder: B.value,
|
|
1879
|
+
aggregations: x.value,
|
|
1880
|
+
advancedFilter: G.value,
|
|
1881
|
+
quickFilter: j.value,
|
|
1882
|
+
findReplace: z.value,
|
|
1863
1883
|
gridLines: _.value,
|
|
1864
1884
|
rowHeightMode: e.rowHeightMode,
|
|
1865
1885
|
baseRowHeight: e.baseRowHeight,
|
|
1866
|
-
layoutMode:
|
|
1867
|
-
minRows:
|
|
1868
|
-
maxRows:
|
|
1869
|
-
placeholderRows:
|
|
1886
|
+
layoutMode: X.value.layoutMode,
|
|
1887
|
+
minRows: X.value.minRows,
|
|
1888
|
+
maxRows: X.value.maxRows,
|
|
1889
|
+
placeholderRows: r.value,
|
|
1870
1890
|
fillHandle: e.fillHandle,
|
|
1871
1891
|
rangeMove: e.rangeMove,
|
|
1872
1892
|
rowHover: e.rowHover,
|
|
@@ -1877,49 +1897,49 @@ const Un = {
|
|
|
1877
1897
|
isCellEditable: e.isCellEditable,
|
|
1878
1898
|
showRowIndex: e.showRowIndex,
|
|
1879
1899
|
rowSelection: e.rowSelection,
|
|
1880
|
-
rowReorder:
|
|
1881
|
-
viewMode:
|
|
1900
|
+
rowReorder: m.value,
|
|
1901
|
+
viewMode: g.value,
|
|
1882
1902
|
gantt: e.gantt,
|
|
1883
|
-
history:
|
|
1884
|
-
chrome:
|
|
1885
|
-
registerHistoryController:
|
|
1886
|
-
registerStructuralRowActionRunner:
|
|
1903
|
+
history: K.value,
|
|
1904
|
+
chrome: te.value,
|
|
1905
|
+
registerHistoryController: Ot,
|
|
1906
|
+
registerStructuralRowActionRunner: Te,
|
|
1887
1907
|
reportToolbarModules: Ct,
|
|
1888
1908
|
toolbarModules: e.toolbarModules,
|
|
1889
1909
|
customOverlays: e.customOverlays,
|
|
1890
1910
|
runStructuralRowAction: e.runStructuralRowAction
|
|
1891
1911
|
};
|
|
1892
|
-
return
|
|
1893
|
-
|
|
1912
|
+
return xe(
|
|
1913
|
+
Pn,
|
|
1894
1914
|
{
|
|
1895
1915
|
...t,
|
|
1896
|
-
ref:
|
|
1897
|
-
key:
|
|
1916
|
+
ref: i,
|
|
1917
|
+
key: St.value,
|
|
1898
1918
|
rows: e.rows,
|
|
1899
|
-
onScrollCapture:
|
|
1900
|
-
rowModel:
|
|
1901
|
-
columns:
|
|
1919
|
+
onScrollCapture: ht,
|
|
1920
|
+
rowModel: re.value,
|
|
1921
|
+
columns: H.value,
|
|
1902
1922
|
theme: e.theme,
|
|
1903
|
-
layoutMode:
|
|
1923
|
+
layoutMode: X.value.layoutMode,
|
|
1904
1924
|
renderMode: U.value,
|
|
1905
|
-
pagination:
|
|
1925
|
+
pagination: u.value,
|
|
1906
1926
|
plugins: e.plugins,
|
|
1907
1927
|
services: gt.value,
|
|
1908
1928
|
startupOrder: e.startupOrder,
|
|
1909
1929
|
autoStart: e.autoStart,
|
|
1910
|
-
onCellChange:
|
|
1911
|
-
onCellEdit:
|
|
1912
|
-
onSelectionChange:
|
|
1913
|
-
onRowSelectionChange:
|
|
1930
|
+
onCellChange: bt,
|
|
1931
|
+
onCellEdit: Se,
|
|
1932
|
+
onSelectionChange: Rt,
|
|
1933
|
+
onRowSelectionChange: Mt
|
|
1914
1934
|
},
|
|
1915
|
-
|
|
1916
|
-
default: (
|
|
1917
|
-
...
|
|
1935
|
+
l.default ? {
|
|
1936
|
+
default: (a) => l.default?.({
|
|
1937
|
+
...a,
|
|
1918
1938
|
defaultRendererProps: {
|
|
1919
1939
|
...n,
|
|
1920
|
-
runtime:
|
|
1921
|
-
runtimeRowModel:
|
|
1922
|
-
onCellEdit:
|
|
1940
|
+
runtime: a.runtime,
|
|
1941
|
+
runtimeRowModel: a.rowModel,
|
|
1942
|
+
onCellEdit: Se,
|
|
1923
1943
|
reportFillWarning: e.reportFillWarning,
|
|
1924
1944
|
reportCenterPaneDiagnostics: e.reportCenterPaneDiagnostics,
|
|
1925
1945
|
reportFillPlumbingState: e.reportFillPlumbingState,
|
|
@@ -1927,11 +1947,11 @@ const Un = {
|
|
|
1927
1947
|
}
|
|
1928
1948
|
})
|
|
1929
1949
|
} : {
|
|
1930
|
-
default: (
|
|
1950
|
+
default: (a) => xe($t, {
|
|
1931
1951
|
...n,
|
|
1932
|
-
runtime:
|
|
1933
|
-
runtimeRowModel:
|
|
1934
|
-
onCellEdit:
|
|
1952
|
+
runtime: a.runtime,
|
|
1953
|
+
runtimeRowModel: a.rowModel,
|
|
1954
|
+
onCellEdit: Se,
|
|
1935
1955
|
reportFillWarning: e.reportFillWarning,
|
|
1936
1956
|
reportCenterPaneDiagnostics: e.reportCenterPaneDiagnostics,
|
|
1937
1957
|
reportFillPlumbingState: e.reportFillPlumbingState,
|
|
@@ -1942,33 +1962,33 @@ const Un = {
|
|
|
1942
1962
|
};
|
|
1943
1963
|
}
|
|
1944
1964
|
});
|
|
1945
|
-
function
|
|
1965
|
+
function ao() {
|
|
1946
1966
|
return V(null);
|
|
1947
1967
|
}
|
|
1948
1968
|
function uo() {
|
|
1949
|
-
return
|
|
1969
|
+
return it;
|
|
1950
1970
|
}
|
|
1951
|
-
const so =
|
|
1971
|
+
const so = it;
|
|
1952
1972
|
export {
|
|
1953
1973
|
so as DataGrid,
|
|
1954
1974
|
mo as DataGridModuleHost,
|
|
1955
1975
|
to as clearDataGridSavedViewInStorage,
|
|
1956
|
-
|
|
1976
|
+
it as default,
|
|
1957
1977
|
lo as defineDataGridCellClassResolver,
|
|
1958
|
-
|
|
1978
|
+
io as defineDataGridCellStyleResolver,
|
|
1959
1979
|
yo as defineDataGridColumnMenu,
|
|
1960
1980
|
vo as defineDataGridColumns,
|
|
1961
1981
|
uo as defineDataGridComponent,
|
|
1962
1982
|
oo as defineDataGridFilterCellReader,
|
|
1963
1983
|
ro as defineDataGridFilterCellStyleReader,
|
|
1964
1984
|
no as defineDataGridSelectionCellReader,
|
|
1965
|
-
|
|
1966
|
-
|
|
1985
|
+
Qn as defineDataGridStructuralRowActionHandler,
|
|
1986
|
+
lt as migrateDataGridSavedView,
|
|
1967
1987
|
Ut as normalizeDataGridAppFilterModel,
|
|
1968
|
-
|
|
1969
|
-
|
|
1988
|
+
be as normalizeDataGridAppUnifiedStateFilters,
|
|
1989
|
+
Cn as parseDataGridSavedView,
|
|
1970
1990
|
eo as readDataGridSavedViewFromStorage,
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1991
|
+
On as serializeDataGridSavedView,
|
|
1992
|
+
ao as useDataGridRef,
|
|
1993
|
+
Xn as writeDataGridSavedViewToStorage
|
|
1974
1994
|
};
|