@affino/datagrid-vue-app 0.1.18 → 0.1.20
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/DataGrid.d.ts +20 -0
- package/dist/DataGridTableStage.vue.d.ts +9 -0
- package/dist/advanced-filter.js +1 -1
- package/dist/advancedFilterDraftClauses.d.ts +6 -0
- package/dist/chunks/{DataGridAdvancedFilterPopover-CabJ-Ztk.js → DataGridAdvancedFilterPopover-CRd9hbEZ.js} +1 -1
- package/dist/chunks/{DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-x-cfVm5j.js → DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-DhdOikY0.js} +10 -8
- package/dist/chunks/{DataGridAggregationsPopover-DfQ3-UV4.js → DataGridAggregationsPopover-Bu7nZX7u.js} +6 -4
- package/dist/chunks/DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-BPU8WkWd.js +373 -0
- package/dist/chunks/DataGridFindReplacePopover-DCuFy-bD.js +4 -0
- package/dist/chunks/DataGridFindReplacePopover.vue_vue_type_script_setup_true_lang-DfHFHhUf.js +171 -0
- package/dist/chunks/DataGridGanttStageEntry-BbSAXYrL.js +8404 -0
- package/dist/chunks/dataGridOverlayThemeVars-vzY74EIz.js +33 -0
- package/dist/chunks/useDataGridAppRowModel-Cq1nWBYl.js +3498 -0
- package/dist/config/dataGridFindReplace.d.ts +9 -0
- package/dist/config/dataGridGridLines.d.ts +16 -0
- package/dist/dataGridGridLines.d.ts +1 -0
- package/dist/find-replace.d.ts +2 -0
- package/dist/find-replace.js +4 -0
- package/dist/gantt.js +1 -1
- package/dist/gestures/dataGridTouchPanGuard.d.ts +13 -0
- package/dist/host/DataGridDefaultRenderer.d.ts +29 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +437 -366
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +19 -17
- package/dist/overlays/DataGridFindReplacePopover.vue.d.ts +74 -0
- package/dist/stage/DataGridTableStage.vue.d.ts +9 -0
- package/dist/stage/dataGridTableStage.types.d.ts +3 -0
- package/dist/stage/useDataGridTableStageCellIo.d.ts +1 -0
- package/dist/stage/useDataGridTableStageHistory.d.ts +3 -1
- package/dist/stage/useDataGridTableStageRuntime.d.ts +17 -2
- package/dist/stage/useDataGridTableStageScrollSync.d.ts +1 -1
- package/dist/useDataGridAppFindReplace.d.ts +54 -0
- package/package.json +7 -3
- package/dist/chunks/DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-_1TDQseN.js +0 -399
- 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
|
|
5
|
-
import { applyGridTheme as
|
|
6
|
-
import { d as
|
|
7
|
-
const
|
|
8
|
-
default:
|
|
9
|
-
"industrial-neutral":
|
|
10
|
-
industrialNeutral:
|
|
11
|
-
sugar:
|
|
1
|
+
import { defineComponent as Oe, ref as Y, provide as Ke, computed as y, watch as w, onBeforeUnmount as fe, h as ce, mergeProps as je, toRef as ge } from "vue";
|
|
2
|
+
import { useDataGridRuntime as Ie } from "@affino/datagrid-vue";
|
|
3
|
+
import { useDataGridAppSelection as Fe, useDataGridAppRowSelection as ze } from "@affino/datagrid-vue/app";
|
|
4
|
+
import { d as Te, e as _e, f as Ve, r as Ee, g as We, u as He, D as ke } from "./chunks/useDataGridAppRowModel-Cq1nWBYl.js";
|
|
5
|
+
import { applyGridTheme as Ue, resolveGridThemeTokens as Ne, defaultStyleConfig as L, sugarTheme as Ae, industrialNeutralTheme as ve } from "@affino/datagrid-theme";
|
|
6
|
+
import { d as qe } from "./chunks/dataGridOverlayThemeVars-vzY74EIz.js";
|
|
7
|
+
const Je = {
|
|
8
|
+
default: L,
|
|
9
|
+
"industrial-neutral": ve,
|
|
10
|
+
industrialNeutral: ve,
|
|
11
|
+
sugar: Ae
|
|
12
12
|
};
|
|
13
|
-
function
|
|
13
|
+
function Ye(e, o) {
|
|
14
14
|
if (!e && !o)
|
|
15
15
|
return;
|
|
16
16
|
const r = {
|
|
17
17
|
...e ?? {}
|
|
18
18
|
};
|
|
19
|
-
for (const [n,
|
|
19
|
+
for (const [n, c] of Object.entries(o ?? {}))
|
|
20
20
|
r[n] = {
|
|
21
21
|
...r[n] ?? {},
|
|
22
|
-
...
|
|
22
|
+
...c
|
|
23
23
|
};
|
|
24
24
|
return r;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function le(e, o) {
|
|
27
27
|
return {
|
|
28
28
|
...e,
|
|
29
29
|
...o,
|
|
@@ -34,34 +34,34 @@ function ne(e, o) {
|
|
|
34
34
|
summary: { ...e.summary ?? {}, ...o.summary ?? {} },
|
|
35
35
|
state: { ...e.state ?? {}, ...o.state ?? {} },
|
|
36
36
|
tokens: { ...e.tokens ?? {}, ...o.tokens ?? {} },
|
|
37
|
-
tokenVariants:
|
|
37
|
+
tokenVariants: Ye(e.tokenVariants, o.tokenVariants)
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function $e(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
|
-
function
|
|
44
|
-
return e == null ?
|
|
43
|
+
function Qe(e) {
|
|
44
|
+
return e == null ? L : typeof e == "string" ? e === "sugar" ? le(L, Ae) : Je[e] ?? L : $e(e) ? le(L, e) : le(L, {
|
|
45
45
|
tokens: e
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
const o =
|
|
50
|
-
return
|
|
48
|
+
function Xe(e) {
|
|
49
|
+
const o = Qe(e);
|
|
50
|
+
return Ne(o ?? L, {
|
|
51
51
|
document: typeof document > "u" ? void 0 : document
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
const r =
|
|
56
|
-
return
|
|
54
|
+
function pe(e, o) {
|
|
55
|
+
const r = Xe(o);
|
|
56
|
+
return Ue(e, r), r;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function we(e, o) {
|
|
59
59
|
return Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : o;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Se(e, o) {
|
|
62
62
|
return Number.isFinite(e) ? Math.max(1, Math.trunc(e)) : o;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function Ze(e) {
|
|
65
65
|
if (e !== void 0) {
|
|
66
66
|
if (e == null)
|
|
67
67
|
return null;
|
|
@@ -76,41 +76,96 @@ function Ue(e) {
|
|
|
76
76
|
return e;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function et(e, o) {
|
|
80
80
|
return o === !0 || o && typeof o == "object" ? "pagination" : e ?? "virtualization";
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function tt(e, o, r, n) {
|
|
83
83
|
if (o !== "pagination")
|
|
84
84
|
return null;
|
|
85
|
-
const
|
|
85
|
+
const c = 100, u = Se(r, c), p = we(n, 0);
|
|
86
86
|
return e === !0 || e === !1 || e == null ? {
|
|
87
87
|
pageSize: u,
|
|
88
|
-
currentPage:
|
|
88
|
+
currentPage: p
|
|
89
89
|
} : {
|
|
90
|
-
pageSize:
|
|
91
|
-
currentPage:
|
|
90
|
+
pageSize: Se(r ?? e.pageSize, c),
|
|
91
|
+
currentPage: we(n ?? e.currentPage, 0)
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
const
|
|
95
|
-
function
|
|
94
|
+
const ae = "Advanced filter";
|
|
95
|
+
function ot(e) {
|
|
96
|
+
return typeof e == "boolean" ? {
|
|
97
|
+
enabled: e,
|
|
98
|
+
buttonLabel: ae
|
|
99
|
+
} : e ? {
|
|
100
|
+
enabled: e.enabled ?? !0,
|
|
101
|
+
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() : ae
|
|
102
|
+
} : {
|
|
103
|
+
enabled: !1,
|
|
104
|
+
buttonLabel: ae
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
const ie = "Find / replace";
|
|
108
|
+
function nt(e) {
|
|
96
109
|
return typeof e == "boolean" ? {
|
|
97
110
|
enabled: e,
|
|
98
|
-
buttonLabel:
|
|
111
|
+
buttonLabel: ie
|
|
99
112
|
} : e ? {
|
|
100
113
|
enabled: e.enabled ?? !0,
|
|
101
|
-
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() :
|
|
114
|
+
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() : ie
|
|
102
115
|
} : {
|
|
103
116
|
enabled: !1,
|
|
104
|
-
buttonLabel:
|
|
117
|
+
buttonLabel: ie
|
|
105
118
|
};
|
|
106
119
|
}
|
|
107
|
-
|
|
120
|
+
const rt = "all", Be = {
|
|
121
|
+
all: "columns",
|
|
122
|
+
rows: "none",
|
|
123
|
+
columns: "columns",
|
|
124
|
+
none: "none"
|
|
125
|
+
};
|
|
126
|
+
function he(e) {
|
|
127
|
+
return e === "rows" || e === "columns" || e === "none" || e === "all" ? e : rt;
|
|
128
|
+
}
|
|
129
|
+
function lt(e, o) {
|
|
130
|
+
return e === "columns" || e === "none" ? e : Be[o];
|
|
131
|
+
}
|
|
132
|
+
function be(e, o) {
|
|
133
|
+
return e !== "none" || o === "columns";
|
|
134
|
+
}
|
|
135
|
+
function Me(e) {
|
|
136
|
+
const o = e.body === "all" || e.body === "rows", r = e.body === "all" || e.body === "columns", n = e.header === "columns";
|
|
137
|
+
return {
|
|
138
|
+
body: e.body,
|
|
139
|
+
header: e.header,
|
|
140
|
+
pinnedSeparators: e.pinnedSeparators,
|
|
141
|
+
bodyRows: o,
|
|
142
|
+
bodyColumns: r,
|
|
143
|
+
headerColumns: n
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function at(e) {
|
|
147
|
+
if (typeof e == "string") {
|
|
148
|
+
const n = he(e), c = Be[n];
|
|
149
|
+
return Me({
|
|
150
|
+
body: n,
|
|
151
|
+
header: c,
|
|
152
|
+
pinnedSeparators: be(n, c)
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
const o = he(e?.body), r = lt(e?.header, o);
|
|
156
|
+
return Me({
|
|
157
|
+
body: o,
|
|
158
|
+
header: r,
|
|
159
|
+
pinnedSeparators: typeof e?.pinnedSeparators == "boolean" ? e.pinnedSeparators : be(o, r)
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
function Re(e) {
|
|
108
163
|
if (typeof e != "number" || !Number.isFinite(e))
|
|
109
164
|
return null;
|
|
110
165
|
const o = Math.max(0, Math.trunc(e));
|
|
111
166
|
return o > 0 ? o : null;
|
|
112
167
|
}
|
|
113
|
-
function
|
|
168
|
+
function it(e, o, r) {
|
|
114
169
|
const n = e === "auto-height" ? "auto-height" : "fill";
|
|
115
170
|
if (n !== "auto-height")
|
|
116
171
|
return {
|
|
@@ -118,71 +173,71 @@ function Qe(e, o, r) {
|
|
|
118
173
|
minRows: null,
|
|
119
174
|
maxRows: null
|
|
120
175
|
};
|
|
121
|
-
const
|
|
122
|
-
let u =
|
|
123
|
-
return
|
|
176
|
+
const c = Re(o);
|
|
177
|
+
let u = Re(r);
|
|
178
|
+
return c !== null && u !== null && u < c && (u = c), {
|
|
124
179
|
layoutMode: n,
|
|
125
|
-
minRows:
|
|
180
|
+
minRows: c,
|
|
126
181
|
maxRows: u
|
|
127
182
|
};
|
|
128
183
|
}
|
|
129
|
-
function
|
|
184
|
+
function ut(e) {
|
|
130
185
|
return {
|
|
131
186
|
...e,
|
|
132
187
|
transaction: null
|
|
133
188
|
};
|
|
134
189
|
}
|
|
135
|
-
function
|
|
190
|
+
function $(e) {
|
|
136
191
|
return {
|
|
137
192
|
...e,
|
|
138
|
-
state:
|
|
193
|
+
state: ut(e.state)
|
|
139
194
|
};
|
|
140
195
|
}
|
|
141
|
-
function
|
|
196
|
+
function st(e) {
|
|
142
197
|
return typeof e == "object" && e !== null;
|
|
143
198
|
}
|
|
144
|
-
function
|
|
145
|
-
const n =
|
|
146
|
-
if (!
|
|
199
|
+
function Ce(e, o, r) {
|
|
200
|
+
const n = st(e) ? e : null, c = o(n && "state" in n ? n.state : e, r);
|
|
201
|
+
if (!c)
|
|
147
202
|
return null;
|
|
148
|
-
const u = n?.viewMode,
|
|
149
|
-
return
|
|
150
|
-
state:
|
|
151
|
-
...
|
|
203
|
+
const u = n?.viewMode, p = u === "gantt" ? "gantt" : u === "table" ? "table" : void 0;
|
|
204
|
+
return $({
|
|
205
|
+
state: c,
|
|
206
|
+
...p ? { viewMode: p } : {}
|
|
152
207
|
});
|
|
153
208
|
}
|
|
154
|
-
function
|
|
155
|
-
return JSON.stringify(
|
|
209
|
+
function dt(e) {
|
|
210
|
+
return JSON.stringify($(e));
|
|
156
211
|
}
|
|
157
|
-
function
|
|
212
|
+
function ct(e, o, r) {
|
|
158
213
|
if (typeof e != "string" || e.trim().length === 0)
|
|
159
214
|
return null;
|
|
160
215
|
try {
|
|
161
|
-
return
|
|
216
|
+
return Ce(JSON.parse(e), o, r);
|
|
162
217
|
} catch {
|
|
163
218
|
return null;
|
|
164
219
|
}
|
|
165
220
|
}
|
|
166
|
-
function
|
|
221
|
+
function Dt(e, o, r) {
|
|
167
222
|
if (!e || typeof o != "string" || o.trim().length === 0)
|
|
168
223
|
return !1;
|
|
169
224
|
try {
|
|
170
|
-
return e.setItem(o,
|
|
225
|
+
return e.setItem(o, dt(r)), !0;
|
|
171
226
|
} catch {
|
|
172
227
|
return !1;
|
|
173
228
|
}
|
|
174
229
|
}
|
|
175
|
-
function
|
|
230
|
+
function Gt(e, o, r, n) {
|
|
176
231
|
if (!e || typeof o != "string" || o.trim().length === 0)
|
|
177
232
|
return null;
|
|
178
233
|
try {
|
|
179
|
-
const
|
|
180
|
-
return
|
|
234
|
+
const c = e.getItem(o);
|
|
235
|
+
return c ? ct(c, r, n) : null;
|
|
181
236
|
} catch {
|
|
182
237
|
return null;
|
|
183
238
|
}
|
|
184
239
|
}
|
|
185
|
-
function
|
|
240
|
+
function Pt(e, o) {
|
|
186
241
|
if (!e || typeof o != "string" || o.trim().length === 0)
|
|
187
242
|
return !1;
|
|
188
243
|
try {
|
|
@@ -191,36 +246,36 @@ function ht(e, o) {
|
|
|
191
246
|
return !1;
|
|
192
247
|
}
|
|
193
248
|
}
|
|
194
|
-
const
|
|
195
|
-
function
|
|
249
|
+
const ue = "Columns";
|
|
250
|
+
function ft(e) {
|
|
196
251
|
return typeof e == "boolean" ? {
|
|
197
252
|
enabled: e,
|
|
198
|
-
buttonLabel:
|
|
253
|
+
buttonLabel: ue
|
|
199
254
|
} : e ? {
|
|
200
255
|
enabled: e.enabled ?? !0,
|
|
201
|
-
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() :
|
|
256
|
+
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() : ue
|
|
202
257
|
} : {
|
|
203
258
|
enabled: !1,
|
|
204
|
-
buttonLabel:
|
|
259
|
+
buttonLabel: ue
|
|
205
260
|
};
|
|
206
261
|
}
|
|
207
|
-
const
|
|
208
|
-
function
|
|
262
|
+
const se = "Aggregations";
|
|
263
|
+
function mt(e) {
|
|
209
264
|
return typeof e == "boolean" ? {
|
|
210
265
|
enabled: e,
|
|
211
|
-
buttonLabel:
|
|
266
|
+
buttonLabel: se
|
|
212
267
|
} : e ? {
|
|
213
268
|
enabled: e.enabled ?? !0,
|
|
214
|
-
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() :
|
|
269
|
+
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() : se
|
|
215
270
|
} : {
|
|
216
271
|
enabled: !1,
|
|
217
|
-
buttonLabel:
|
|
272
|
+
buttonLabel: se
|
|
218
273
|
};
|
|
219
274
|
}
|
|
220
|
-
function
|
|
275
|
+
function q(e, o) {
|
|
221
276
|
return Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : o;
|
|
222
277
|
}
|
|
223
|
-
function
|
|
278
|
+
function yt(e, o) {
|
|
224
279
|
const r = {
|
|
225
280
|
rows: !0,
|
|
226
281
|
columns: !1,
|
|
@@ -233,12 +288,12 @@ function nt(e, o) {
|
|
|
233
288
|
r.rows = !1, r.columns = !1;
|
|
234
289
|
else if (e && typeof e == "object") {
|
|
235
290
|
r.rows = e.rows ?? r.rows, r.columns = e.columns ?? r.columns;
|
|
236
|
-
const n =
|
|
237
|
-
r.rowOverscan =
|
|
291
|
+
const n = q(e.overscan, r.rowOverscan);
|
|
292
|
+
r.rowOverscan = q(e.rowOverscan, n), r.columnOverscan = q(e.columnOverscan, q(e.overscan, r.columnOverscan));
|
|
238
293
|
}
|
|
239
294
|
return o === "pagination" && (r.rows = !1), r;
|
|
240
295
|
}
|
|
241
|
-
const
|
|
296
|
+
const gt = Oe({
|
|
242
297
|
name: "DataGridRuntimeHost",
|
|
243
298
|
inheritAttrs: !1,
|
|
244
299
|
props: {
|
|
@@ -292,26 +347,28 @@ const rt = we({
|
|
|
292
347
|
"selection-change": (e) => !0,
|
|
293
348
|
"row-selection-change": (e) => !0
|
|
294
349
|
},
|
|
295
|
-
setup(e, { attrs: o, slots: r, emit: n, expose:
|
|
296
|
-
const u =
|
|
297
|
-
|
|
298
|
-
let
|
|
299
|
-
const s =
|
|
300
|
-
rows:
|
|
350
|
+
setup(e, { attrs: o, slots: r, emit: n, expose: c }) {
|
|
351
|
+
const u = Y(null);
|
|
352
|
+
Ke(qe, u);
|
|
353
|
+
let p = null;
|
|
354
|
+
const s = Ie({
|
|
355
|
+
rows: y(() => e.rows),
|
|
301
356
|
rowModel: e.rowModel,
|
|
302
|
-
columns:
|
|
357
|
+
columns: y(() => e.columns),
|
|
303
358
|
plugins: e.plugins,
|
|
304
359
|
services: e.services,
|
|
305
360
|
startupOrder: e.startupOrder,
|
|
306
361
|
autoStart: e.autoStart
|
|
307
|
-
}),
|
|
362
|
+
}), S = s, O = {
|
|
308
363
|
api: s.api,
|
|
309
364
|
syncBodyRowsInRange: s.syncBodyRowsInRange,
|
|
365
|
+
setViewportRange: s.setViewportRange,
|
|
366
|
+
setVirtualWindowRange: s.setVirtualWindowRange,
|
|
310
367
|
rowPartition: s.rowPartition,
|
|
311
368
|
virtualWindow: s.virtualWindow,
|
|
312
369
|
columnSnapshot: s.columnSnapshot,
|
|
313
|
-
getBodyRowAtIndex:
|
|
314
|
-
resolveBodyRowIndexById:
|
|
370
|
+
getBodyRowAtIndex: S.getBodyRowAtIndex,
|
|
371
|
+
resolveBodyRowIndexById: S.resolveBodyRowIndexById
|
|
315
372
|
}, B = () => {
|
|
316
373
|
if (e.renderMode === "pagination") {
|
|
317
374
|
const d = e.pagination ?? { pageSize: 100, currentPage: 0 };
|
|
@@ -323,43 +380,43 @@ const rt = we({
|
|
|
323
380
|
}
|
|
324
381
|
s.api.rows.setPagination(null);
|
|
325
382
|
};
|
|
326
|
-
|
|
383
|
+
w(
|
|
327
384
|
() => e.renderMode,
|
|
328
385
|
() => {
|
|
329
386
|
B();
|
|
330
387
|
},
|
|
331
388
|
{ immediate: !0 }
|
|
332
|
-
),
|
|
389
|
+
), w(
|
|
333
390
|
() => e.pagination,
|
|
334
391
|
() => {
|
|
335
392
|
B();
|
|
336
393
|
},
|
|
337
394
|
{ immediate: !0, deep: !0 }
|
|
338
|
-
), typeof document < "u" && (
|
|
395
|
+
), typeof document < "u" && (p = new MutationObserver(() => {
|
|
339
396
|
const d = u.value;
|
|
340
|
-
d &&
|
|
341
|
-
}),
|
|
397
|
+
d && pe(d, e.theme);
|
|
398
|
+
}), p.observe(document.documentElement, {
|
|
342
399
|
attributes: !0,
|
|
343
400
|
attributeFilter: ["class", "data-theme"]
|
|
344
|
-
})),
|
|
401
|
+
})), w(
|
|
345
402
|
[() => e.theme, u],
|
|
346
403
|
() => {
|
|
347
404
|
const d = u.value;
|
|
348
|
-
d &&
|
|
405
|
+
d && pe(d, e.theme);
|
|
349
406
|
},
|
|
350
407
|
{ immediate: !0, deep: !0 }
|
|
351
408
|
);
|
|
352
|
-
const
|
|
409
|
+
const b = s.api.events.on("rows:changed", (d) => {
|
|
353
410
|
n("cell-change", d);
|
|
354
|
-
}),
|
|
411
|
+
}), M = s.api.events.on("selection:changed", (d) => {
|
|
355
412
|
n("selection-change", d);
|
|
356
|
-
}),
|
|
413
|
+
}), D = s.api.events.on("row-selection:changed", (d) => {
|
|
357
414
|
n("row-selection-change", d);
|
|
358
415
|
});
|
|
359
|
-
|
|
360
|
-
|
|
416
|
+
fe(() => {
|
|
417
|
+
b(), M(), D(), p?.disconnect(), p = null;
|
|
361
418
|
});
|
|
362
|
-
const G =
|
|
419
|
+
const G = y(() => {
|
|
363
420
|
const d = s.virtualWindow.value;
|
|
364
421
|
return {
|
|
365
422
|
...d ?? {},
|
|
@@ -367,27 +424,28 @@ const rt = we({
|
|
|
367
424
|
colTotal: s.columnSnapshot.value.visibleColumns.length
|
|
368
425
|
};
|
|
369
426
|
});
|
|
370
|
-
return
|
|
427
|
+
return c({
|
|
371
428
|
api: s.api,
|
|
372
429
|
core: s.core,
|
|
373
|
-
runtime:
|
|
430
|
+
runtime: O,
|
|
374
431
|
rowModel: s.rowModel,
|
|
375
432
|
columnModel: s.columnModel,
|
|
376
433
|
columnSnapshot: s.columnSnapshot,
|
|
377
434
|
rowPartition: s.rowPartition,
|
|
378
435
|
setRows: s.setRows,
|
|
379
436
|
syncBodyRowsInRange: s.syncBodyRowsInRange,
|
|
380
|
-
getBodyRowAtIndex:
|
|
381
|
-
resolveBodyRowIndexById:
|
|
437
|
+
getBodyRowAtIndex: S.getBodyRowAtIndex,
|
|
438
|
+
resolveBodyRowIndexById: S.resolveBodyRowIndexById,
|
|
382
439
|
virtualWindow: s.virtualWindow,
|
|
383
440
|
start: s.start,
|
|
384
441
|
stop: s.stop
|
|
385
|
-
}), () =>
|
|
442
|
+
}), () => ce(
|
|
386
443
|
"div",
|
|
387
|
-
|
|
444
|
+
je(o, {
|
|
388
445
|
ref: u,
|
|
389
446
|
class: [
|
|
390
447
|
"affino-datagrid-app-root",
|
|
448
|
+
e.theme === "sugar" ? "affino-datagrid-app-root--theme-sugar" : null,
|
|
391
449
|
e.layoutMode === "auto-height" ? "affino-datagrid-app-root--auto-height" : "affino-datagrid-app-root--fill"
|
|
392
450
|
],
|
|
393
451
|
style: {
|
|
@@ -400,81 +458,84 @@ const rt = we({
|
|
|
400
458
|
r.default?.({
|
|
401
459
|
api: s.api,
|
|
402
460
|
core: s.core,
|
|
403
|
-
runtime:
|
|
404
|
-
grid:
|
|
461
|
+
runtime: O,
|
|
462
|
+
grid: O,
|
|
405
463
|
rowModel: s.rowModel,
|
|
406
464
|
columnModel: s.columnModel,
|
|
407
465
|
columnSnapshot: s.columnSnapshot.value,
|
|
408
466
|
rowPartition: s.rowPartition.value,
|
|
409
467
|
setRows: s.setRows,
|
|
410
468
|
syncBodyRowsInRange: s.syncBodyRowsInRange,
|
|
411
|
-
getBodyRowAtIndex:
|
|
412
|
-
resolveBodyRowIndexById:
|
|
469
|
+
getBodyRowAtIndex: S.getBodyRowAtIndex,
|
|
470
|
+
resolveBodyRowIndexById: S.resolveBodyRowIndexById,
|
|
413
471
|
virtualWindow: G.value
|
|
414
472
|
}) ?? []
|
|
415
473
|
);
|
|
416
474
|
}
|
|
417
475
|
});
|
|
418
|
-
function
|
|
476
|
+
function de(e) {
|
|
419
477
|
return Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : null;
|
|
420
478
|
}
|
|
421
|
-
function
|
|
479
|
+
function R(e) {
|
|
422
480
|
try {
|
|
423
481
|
return JSON.stringify(e);
|
|
424
482
|
} catch {
|
|
425
483
|
return null;
|
|
426
484
|
}
|
|
427
485
|
}
|
|
428
|
-
function
|
|
486
|
+
function vt(e) {
|
|
429
487
|
return e ? {
|
|
430
488
|
fields: [...e.fields],
|
|
431
489
|
expandedByDefault: e.expandedByDefault
|
|
432
490
|
} : null;
|
|
433
491
|
}
|
|
434
|
-
function
|
|
435
|
-
let o = null, r = null, n = !1,
|
|
436
|
-
const
|
|
492
|
+
function pt(e) {
|
|
493
|
+
let o = null, r = null, n = !1, c = null, u = null, p = null, s = null, S = null, O = null, B = null, b = null, M = null;
|
|
494
|
+
const D = () => {
|
|
437
495
|
o?.(), r?.(), o = null, r = null;
|
|
438
496
|
}, G = () => {
|
|
439
|
-
const t = e.gridRef.value
|
|
497
|
+
const t = e.gridRef.value;
|
|
498
|
+
return !t || t.api.lifecycle.state === "disposed" ? null : t;
|
|
499
|
+
}, d = () => G()?.api ?? null, U = () => {
|
|
500
|
+
const t = d()?.columns;
|
|
440
501
|
if (!t)
|
|
441
502
|
return null;
|
|
442
|
-
const i = t.getSnapshot(), l = {},
|
|
443
|
-
for (const
|
|
444
|
-
l[
|
|
503
|
+
const i = t.getSnapshot(), l = {}, f = {}, g = {};
|
|
504
|
+
for (const h of i.columns)
|
|
505
|
+
l[h.key] = h.visible, f[h.key] = h.width, g[h.key] = h.pin;
|
|
445
506
|
return {
|
|
446
507
|
order: [...i.order],
|
|
447
508
|
visibility: l,
|
|
448
|
-
widths:
|
|
449
|
-
pins:
|
|
509
|
+
widths: f,
|
|
510
|
+
pins: g
|
|
450
511
|
};
|
|
451
|
-
},
|
|
512
|
+
}, v = () => {
|
|
452
513
|
n || (n = !0, queueMicrotask(() => {
|
|
453
514
|
n = !1;
|
|
454
|
-
const t =
|
|
515
|
+
const t = U(), i = d();
|
|
455
516
|
if (t) {
|
|
456
|
-
const l =
|
|
457
|
-
|
|
458
|
-
Object.entries(t.visibility).filter(([,
|
|
517
|
+
const l = R(t);
|
|
518
|
+
O = l, l !== p && (p = l, e.emit.columnState(t), e.emit.columnOrder(t.order), e.emit.hiddenColumnKeys(
|
|
519
|
+
Object.entries(t.visibility).filter(([, f]) => !f).map(([f]) => f)
|
|
459
520
|
), e.emit.columnWidths(t.widths), e.emit.columnPins(t.pins));
|
|
460
521
|
}
|
|
461
522
|
if (i) {
|
|
462
|
-
const l =
|
|
463
|
-
|
|
464
|
-
const
|
|
465
|
-
B =
|
|
523
|
+
const l = vt(i.rows.getSnapshot().groupBy), f = R(l);
|
|
524
|
+
f !== S && (S = f, e.emit.groupBy(l));
|
|
525
|
+
const g = i.state.get(), h = R(g);
|
|
526
|
+
B = h, h !== s && (s = h, e.emit.state(g));
|
|
466
527
|
}
|
|
467
528
|
}));
|
|
468
|
-
},
|
|
469
|
-
const t =
|
|
529
|
+
}, P = () => {
|
|
530
|
+
const t = d();
|
|
470
531
|
!t || e.props.sortModel === void 0 && e.props.filterModel === void 0 || t.rows.setSortAndFilterModel({
|
|
471
532
|
sortModel: e.props.sortModel ?? [],
|
|
472
533
|
filterModel: e.props.filterModel ?? null
|
|
473
534
|
});
|
|
474
|
-
},
|
|
475
|
-
const t =
|
|
535
|
+
}, x = () => {
|
|
536
|
+
const t = d()?.columns;
|
|
476
537
|
return t ? new Set(t.getSnapshot().columns.map((i) => i.key)) : null;
|
|
477
|
-
},
|
|
538
|
+
}, Q = (t) => {
|
|
478
539
|
const i = /* @__PURE__ */ new Set();
|
|
479
540
|
if (!t)
|
|
480
541
|
return i;
|
|
@@ -487,99 +548,99 @@ function at(e) {
|
|
|
487
548
|
for (const l of Object.keys(t.pins ?? {}))
|
|
488
549
|
i.add(l);
|
|
489
550
|
return i;
|
|
490
|
-
},
|
|
491
|
-
const i =
|
|
551
|
+
}, z = (t) => {
|
|
552
|
+
const i = x();
|
|
492
553
|
if (!i)
|
|
493
554
|
return !1;
|
|
494
|
-
const l =
|
|
555
|
+
const l = Q(t);
|
|
495
556
|
if (l.size === 0 || e.props.columns.length > 0)
|
|
496
557
|
return !0;
|
|
497
|
-
for (const
|
|
498
|
-
if (!i.has(
|
|
558
|
+
for (const f of l)
|
|
559
|
+
if (!i.has(f))
|
|
499
560
|
return !1;
|
|
500
561
|
return !0;
|
|
501
|
-
},
|
|
502
|
-
const i =
|
|
562
|
+
}, T = (t) => z(t.columns), _ = (t) => {
|
|
563
|
+
const i = d();
|
|
503
564
|
if (!i)
|
|
504
565
|
return !1;
|
|
505
566
|
i.columns.setOrder(t.order);
|
|
506
|
-
for (const [l,
|
|
507
|
-
i.columns.setVisibility(l,
|
|
508
|
-
for (const [l,
|
|
509
|
-
i.columns.setWidth(l,
|
|
510
|
-
for (const [l,
|
|
511
|
-
i.columns.setPin(l,
|
|
567
|
+
for (const [l, f] of Object.entries(t.visibility))
|
|
568
|
+
i.columns.setVisibility(l, f);
|
|
569
|
+
for (const [l, f] of Object.entries(t.widths))
|
|
570
|
+
i.columns.setWidth(l, de(f));
|
|
571
|
+
for (const [l, f] of Object.entries(t.pins))
|
|
572
|
+
i.columns.setPin(l, f);
|
|
512
573
|
return !0;
|
|
513
574
|
}, K = () => {
|
|
514
|
-
if (
|
|
515
|
-
const t =
|
|
575
|
+
if (M) {
|
|
576
|
+
const t = M, i = d();
|
|
516
577
|
if (i) {
|
|
517
578
|
const l = i.state.migrate(t.state, { strict: t.options?.strict });
|
|
518
|
-
l &&
|
|
579
|
+
l && T(l) && (M = null, i.state.set(l, t.options), u = R(t.state));
|
|
519
580
|
}
|
|
520
581
|
}
|
|
521
|
-
if (
|
|
522
|
-
const t =
|
|
523
|
-
|
|
582
|
+
if (b && z(b.columnState)) {
|
|
583
|
+
const t = b;
|
|
584
|
+
b = null, c = R({
|
|
524
585
|
columnState: t.columnState,
|
|
525
586
|
columnOrder: null,
|
|
526
587
|
hiddenColumnKeys: null,
|
|
527
588
|
columnWidths: null,
|
|
528
589
|
columnPins: null
|
|
529
|
-
}),
|
|
590
|
+
}), _(t.columnState);
|
|
530
591
|
}
|
|
531
|
-
},
|
|
532
|
-
const t =
|
|
592
|
+
}, A = () => {
|
|
593
|
+
const t = d();
|
|
533
594
|
!t || e.props.groupBy === void 0 || t.rows.setGroupBy(e.props.groupBy ?? null);
|
|
534
595
|
}, C = () => {
|
|
535
|
-
const t =
|
|
596
|
+
const t = d();
|
|
536
597
|
!t || e.props.aggregationModel === void 0 || t.rows.setAggregationModel(e.props.aggregationModel ?? null);
|
|
537
598
|
}, V = () => {
|
|
538
|
-
const t =
|
|
599
|
+
const t = d();
|
|
539
600
|
!t || e.props.pivotModel === void 0 || t.pivot.setModel(e.props.pivotModel ?? null);
|
|
540
|
-
},
|
|
541
|
-
const t =
|
|
601
|
+
}, j = () => {
|
|
602
|
+
const t = d();
|
|
542
603
|
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
604
|
return;
|
|
544
|
-
const i =
|
|
605
|
+
const i = R({
|
|
545
606
|
columnState: e.props.columnState,
|
|
546
607
|
columnOrder: e.props.columnOrder,
|
|
547
608
|
hiddenColumnKeys: e.props.hiddenColumnKeys,
|
|
548
609
|
columnWidths: e.props.columnWidths,
|
|
549
610
|
columnPins: e.props.columnPins
|
|
550
611
|
});
|
|
551
|
-
if (i !==
|
|
552
|
-
if (e.props.columnState && !e.props.columnOrder && !e.props.hiddenColumnKeys && !e.props.columnWidths && !e.props.columnPins &&
|
|
553
|
-
|
|
612
|
+
if (i !== c) {
|
|
613
|
+
if (e.props.columnState && !e.props.columnOrder && !e.props.hiddenColumnKeys && !e.props.columnWidths && !e.props.columnPins && R(e.props.columnState) === O) {
|
|
614
|
+
c = i;
|
|
554
615
|
return;
|
|
555
616
|
}
|
|
556
617
|
if (e.props.columnState) {
|
|
557
618
|
t.columns.setOrder(e.props.columnState.order);
|
|
558
|
-
for (const [l,
|
|
559
|
-
t.columns.setVisibility(l,
|
|
560
|
-
for (const [l,
|
|
561
|
-
t.columns.setWidth(l,
|
|
562
|
-
for (const [l,
|
|
563
|
-
t.columns.setPin(l,
|
|
619
|
+
for (const [l, f] of Object.entries(e.props.columnState.visibility))
|
|
620
|
+
t.columns.setVisibility(l, f);
|
|
621
|
+
for (const [l, f] of Object.entries(e.props.columnState.widths))
|
|
622
|
+
t.columns.setWidth(l, de(f));
|
|
623
|
+
for (const [l, f] of Object.entries(e.props.columnState.pins))
|
|
624
|
+
t.columns.setPin(l, f);
|
|
564
625
|
}
|
|
565
626
|
if (e.props.columnOrder && t.columns.setOrder(e.props.columnOrder), e.props.hiddenColumnKeys) {
|
|
566
|
-
const l = new Set(e.props.hiddenColumnKeys),
|
|
567
|
-
for (const
|
|
568
|
-
t.columns.setVisibility(
|
|
627
|
+
const l = new Set(e.props.hiddenColumnKeys), f = t.columns.getSnapshot();
|
|
628
|
+
for (const g of f.columns)
|
|
629
|
+
t.columns.setVisibility(g.key, !l.has(g.key));
|
|
569
630
|
}
|
|
570
631
|
if (e.props.columnWidths)
|
|
571
|
-
for (const [l,
|
|
572
|
-
t.columns.setWidth(l,
|
|
632
|
+
for (const [l, f] of Object.entries(e.props.columnWidths))
|
|
633
|
+
t.columns.setWidth(l, de(f));
|
|
573
634
|
if (e.props.columnPins)
|
|
574
|
-
for (const [l,
|
|
575
|
-
t.columns.setPin(l,
|
|
576
|
-
|
|
635
|
+
for (const [l, f] of Object.entries(e.props.columnPins))
|
|
636
|
+
t.columns.setPin(l, f);
|
|
637
|
+
c = i;
|
|
577
638
|
}
|
|
578
639
|
}, I = () => {
|
|
579
|
-
const t =
|
|
640
|
+
const t = d();
|
|
580
641
|
if (!t || e.props.state == null)
|
|
581
642
|
return;
|
|
582
|
-
const i =
|
|
643
|
+
const i = R(e.props.state);
|
|
583
644
|
if (i === u)
|
|
584
645
|
return;
|
|
585
646
|
if (i === B) {
|
|
@@ -587,56 +648,56 @@ function at(e) {
|
|
|
587
648
|
return;
|
|
588
649
|
}
|
|
589
650
|
const l = t.state.migrate(e.props.state, { strict: e.props.stateOptions?.strict });
|
|
590
|
-
l &&
|
|
591
|
-
}, W = () => {
|
|
592
|
-
const t = e.gridRef.value?.api;
|
|
593
|
-
t && (t.view.setRowHeightMode(e.props.rowHeightMode), t.view.setBaseRowHeight(Math.max(24, Math.trunc(e.props.baseRowHeight))));
|
|
651
|
+
l && T(l) && (t.state.set(l, e.props.stateOptions ?? {}), u = i);
|
|
594
652
|
}, E = () => {
|
|
595
|
-
const t =
|
|
596
|
-
t && (
|
|
597
|
-
|
|
653
|
+
const t = d();
|
|
654
|
+
t && (t.view.setRowHeightMode(e.props.rowHeightMode), t.view.setBaseRowHeight(Math.max(24, Math.trunc(e.props.baseRowHeight))));
|
|
655
|
+
}, N = () => {
|
|
656
|
+
const t = G();
|
|
657
|
+
t && (c = null, u = null, D(), o = t.rowModel.subscribe(() => {
|
|
658
|
+
v();
|
|
598
659
|
}), r = t.columnModel.subscribe(() => {
|
|
599
|
-
|
|
600
|
-
}), I(),
|
|
601
|
-
},
|
|
660
|
+
v();
|
|
661
|
+
}), I(), j(), P(), A(), C(), V(), E(), K(), v(), e.emit.ready({ api: t.api }));
|
|
662
|
+
}, X = () => d()?.state.get() ?? null, Z = (t, i) => d()?.state.migrate(t, i) ?? null, ee = (t) => z(t) ? (c = R({
|
|
602
663
|
columnState: t,
|
|
603
664
|
columnOrder: null,
|
|
604
665
|
hiddenColumnKeys: null,
|
|
605
666
|
columnWidths: null,
|
|
606
667
|
columnPins: null
|
|
607
|
-
}),
|
|
608
|
-
const l =
|
|
668
|
+
}), b = null, _(t) ? (v(), !0) : (b = { columnState: t }, !0)) : (b = { columnState: t }, !0), te = (t, i) => {
|
|
669
|
+
const l = d();
|
|
609
670
|
if (!l)
|
|
610
|
-
return
|
|
611
|
-
const
|
|
612
|
-
return
|
|
613
|
-
},
|
|
614
|
-
const l =
|
|
615
|
-
return l ? (l.pivot.importLayout(t, i),
|
|
616
|
-
},
|
|
617
|
-
|
|
618
|
-
},
|
|
619
|
-
|
|
671
|
+
return M = { state: t, options: i }, !0;
|
|
672
|
+
const f = l.state.migrate(t, { strict: i?.strict });
|
|
673
|
+
return f ? T(f) ? (l.state.set(f, i), u = R(t), M = null, v(), !0) : (M = { state: t, options: i }, !0) : !1;
|
|
674
|
+
}, oe = () => d()?.pivot.exportLayout() ?? null, ne = () => d()?.pivot.exportInterop() ?? null, W = (t, i) => {
|
|
675
|
+
const l = d();
|
|
676
|
+
return l ? (l.pivot.importLayout(t, i), v(), !0) : !1;
|
|
677
|
+
}, H = () => {
|
|
678
|
+
d()?.rows.expandAllGroups(), v();
|
|
679
|
+
}, re = () => {
|
|
680
|
+
d()?.rows.collapseAllGroups(), v();
|
|
620
681
|
};
|
|
621
|
-
|
|
682
|
+
w(
|
|
622
683
|
() => e.gridRef.value,
|
|
623
684
|
() => {
|
|
624
|
-
|
|
685
|
+
N();
|
|
625
686
|
},
|
|
626
687
|
{ immediate: !0 }
|
|
627
|
-
),
|
|
688
|
+
), w(
|
|
628
689
|
() => e.props.columns,
|
|
629
690
|
() => {
|
|
630
|
-
|
|
691
|
+
c = null, u = null, I(), j(), K(), v();
|
|
631
692
|
},
|
|
632
693
|
{ deep: !0 }
|
|
633
|
-
),
|
|
694
|
+
), w(
|
|
634
695
|
() => [e.props.state, e.props.stateOptions],
|
|
635
696
|
() => {
|
|
636
|
-
I(),
|
|
697
|
+
I(), j(), P(), A(), C(), V(), E(), K(), v();
|
|
637
698
|
},
|
|
638
699
|
{ deep: !0 }
|
|
639
|
-
),
|
|
700
|
+
), w(
|
|
640
701
|
() => [
|
|
641
702
|
e.props.columnState,
|
|
642
703
|
e.props.columnOrder,
|
|
@@ -645,61 +706,61 @@ function at(e) {
|
|
|
645
706
|
e.props.columnPins
|
|
646
707
|
],
|
|
647
708
|
() => {
|
|
648
|
-
|
|
709
|
+
j(), K(), v();
|
|
649
710
|
},
|
|
650
711
|
{ deep: !0 }
|
|
651
|
-
),
|
|
712
|
+
), w(
|
|
652
713
|
() => [e.props.sortModel, e.props.filterModel],
|
|
653
714
|
() => {
|
|
654
|
-
|
|
715
|
+
P(), v();
|
|
655
716
|
},
|
|
656
717
|
{ deep: !0 }
|
|
657
|
-
),
|
|
718
|
+
), w(
|
|
658
719
|
() => e.props.groupBy,
|
|
659
720
|
() => {
|
|
660
|
-
|
|
721
|
+
A(), v();
|
|
661
722
|
},
|
|
662
723
|
{ deep: !0 }
|
|
663
|
-
),
|
|
724
|
+
), w(
|
|
664
725
|
() => e.props.aggregationModel,
|
|
665
726
|
() => {
|
|
666
|
-
C(),
|
|
727
|
+
C(), v();
|
|
667
728
|
},
|
|
668
729
|
{ deep: !0 }
|
|
669
|
-
),
|
|
730
|
+
), w(
|
|
670
731
|
() => e.props.pivotModel,
|
|
671
732
|
() => {
|
|
672
|
-
V(),
|
|
733
|
+
V(), v();
|
|
673
734
|
},
|
|
674
735
|
{ deep: !0 }
|
|
675
|
-
),
|
|
736
|
+
), w(
|
|
676
737
|
() => [e.props.rowHeightMode, e.props.baseRowHeight],
|
|
677
738
|
() => {
|
|
678
|
-
|
|
739
|
+
E(), v();
|
|
679
740
|
}
|
|
680
741
|
);
|
|
681
742
|
const k = () => {
|
|
682
|
-
|
|
743
|
+
D();
|
|
683
744
|
};
|
|
684
|
-
return
|
|
745
|
+
return fe(() => {
|
|
685
746
|
k();
|
|
686
747
|
}), {
|
|
687
|
-
emitSnapshotUpdates:
|
|
688
|
-
handleGridReady:
|
|
748
|
+
emitSnapshotUpdates: v,
|
|
749
|
+
handleGridReady: N,
|
|
689
750
|
dispose: k,
|
|
690
|
-
getColumnState:
|
|
691
|
-
getState:
|
|
692
|
-
migrateState:
|
|
693
|
-
applyColumnState:
|
|
694
|
-
applyState:
|
|
695
|
-
exportPivotLayout:
|
|
696
|
-
exportPivotInterop:
|
|
697
|
-
importPivotLayout:
|
|
698
|
-
expandAllGroups:
|
|
699
|
-
collapseAllGroups:
|
|
751
|
+
getColumnState: U,
|
|
752
|
+
getState: X,
|
|
753
|
+
migrateState: Z,
|
|
754
|
+
applyColumnState: ee,
|
|
755
|
+
applyState: te,
|
|
756
|
+
exportPivotLayout: oe,
|
|
757
|
+
exportPivotInterop: ne,
|
|
758
|
+
importPivotLayout: W,
|
|
759
|
+
expandAllGroups: H,
|
|
760
|
+
collapseAllGroups: re
|
|
700
761
|
};
|
|
701
762
|
}
|
|
702
|
-
function
|
|
763
|
+
function wt() {
|
|
703
764
|
return {
|
|
704
765
|
name: "selection",
|
|
705
766
|
getRowSelectionSnapshot: () => null,
|
|
@@ -722,15 +783,15 @@ function it() {
|
|
|
722
783
|
}
|
|
723
784
|
};
|
|
724
785
|
}
|
|
725
|
-
function
|
|
786
|
+
function J(e, o) {
|
|
726
787
|
const r = o.map((n) => n?.[e]).filter((n) => typeof n == "function");
|
|
727
788
|
if (r.length !== 0)
|
|
728
789
|
return async (n) => {
|
|
729
|
-
for (const
|
|
730
|
-
await
|
|
790
|
+
for (const c of r)
|
|
791
|
+
await c(n);
|
|
731
792
|
};
|
|
732
793
|
}
|
|
733
|
-
function
|
|
794
|
+
function St(e) {
|
|
734
795
|
const {
|
|
735
796
|
userSelectionService: o,
|
|
736
797
|
cellSelectionService: r,
|
|
@@ -738,10 +799,10 @@ function ut(e) {
|
|
|
738
799
|
} = e;
|
|
739
800
|
return {
|
|
740
801
|
name: "selection",
|
|
741
|
-
init:
|
|
742
|
-
start:
|
|
743
|
-
stop:
|
|
744
|
-
dispose:
|
|
802
|
+
init: J("init", [o, r, n]),
|
|
803
|
+
start: J("start", [o, r, n]),
|
|
804
|
+
stop: J("stop", [o, r, n]),
|
|
805
|
+
dispose: J("dispose", [o, r, n]),
|
|
745
806
|
getSelectionSnapshot: r.getSelectionSnapshot,
|
|
746
807
|
setSelectionSnapshot: r.setSelectionSnapshot,
|
|
747
808
|
clearSelection: r.clearSelection,
|
|
@@ -758,18 +819,18 @@ function ut(e) {
|
|
|
758
819
|
clearSelectedRows: n.clearSelectedRows
|
|
759
820
|
};
|
|
760
821
|
}
|
|
761
|
-
function
|
|
822
|
+
function ht(e, o) {
|
|
762
823
|
if (e?.focusedRow !== o?.focusedRow)
|
|
763
824
|
return !1;
|
|
764
825
|
const r = e?.selectedRows ?? [], n = o?.selectedRows ?? [];
|
|
765
826
|
if (r.length !== n.length)
|
|
766
827
|
return !1;
|
|
767
|
-
for (let
|
|
768
|
-
if (r[
|
|
828
|
+
for (let c = 0; c < r.length; c += 1)
|
|
829
|
+
if (r[c] !== n[c])
|
|
769
830
|
return !1;
|
|
770
831
|
return !0;
|
|
771
832
|
}
|
|
772
|
-
const
|
|
833
|
+
const bt = Oe({
|
|
773
834
|
name: "DataGrid",
|
|
774
835
|
inheritAttrs: !1,
|
|
775
836
|
props: {
|
|
@@ -845,6 +906,14 @@ const dt = we({
|
|
|
845
906
|
type: [Boolean, Object],
|
|
846
907
|
default: void 0
|
|
847
908
|
},
|
|
909
|
+
findReplace: {
|
|
910
|
+
type: [Boolean, Object],
|
|
911
|
+
default: void 0
|
|
912
|
+
},
|
|
913
|
+
gridLines: {
|
|
914
|
+
type: [String, Object],
|
|
915
|
+
default: void 0
|
|
916
|
+
},
|
|
848
917
|
showRowIndex: {
|
|
849
918
|
type: Boolean,
|
|
850
919
|
default: !0
|
|
@@ -994,19 +1063,19 @@ const dt = we({
|
|
|
994
1063
|
"update:state": (e) => !0,
|
|
995
1064
|
ready: (e) => !0
|
|
996
1065
|
},
|
|
997
|
-
setup(e, { attrs: o, slots: r, emit: n, expose:
|
|
998
|
-
const u =
|
|
1066
|
+
setup(e, { attrs: o, slots: r, emit: n, expose: c }) {
|
|
1067
|
+
const u = Y(null), p = Y(e.viewMode === "gantt" ? "gantt" : "table"), s = Y(e.state ?? null), S = y(() => et(e.renderMode, e.pagination)), O = y(() => tt(
|
|
999
1068
|
e.pagination,
|
|
1000
|
-
|
|
1069
|
+
S.value,
|
|
1001
1070
|
e.pageSize,
|
|
1002
1071
|
e.currentPage
|
|
1003
|
-
)), B =
|
|
1072
|
+
)), B = y(() => Te(e.columnMenu)), b = y(() => _e(e.cellMenu)), M = y(() => Ve(e.rowIndexMenu)), D = y(() => ft(e.columnLayout)), G = y(() => mt(e.aggregations)), d = y(() => ot(e.advancedFilter)), U = y(() => nt(e.findReplace)), v = y(() => at(e.gridLines)), P = y(() => Ze(e.groupBy)), x = y(() => e.state ?? s.value), Q = y(() => e.sortModel !== void 0 ? e.sortModel : x.value?.rows?.snapshot?.sortModel), z = y(() => e.filterModel !== void 0 ? e.filterModel : x.value?.rows?.snapshot?.filterModel ?? null), T = y(() => e.groupBy !== void 0 ? P.value ?? null : x.value?.rows?.snapshot?.groupBy ?? null), _ = y(() => e.pivotModel !== void 0 ? e.pivotModel : x.value?.rows?.snapshot?.pivotModel ?? null), K = y(() => yt(e.virtualization, S.value)), A = y(() => it(e.layoutMode, e.minRows, e.maxRows)), C = y(() => Ee({
|
|
1004
1073
|
columns: e.columns,
|
|
1005
1074
|
clientRowModelOptions: e.clientRowModelOptions,
|
|
1006
1075
|
computedFields: e.computedFields,
|
|
1007
1076
|
formulas: e.formulas,
|
|
1008
1077
|
formulaFunctions: e.formulaFunctions
|
|
1009
|
-
})), V =
|
|
1078
|
+
})), V = y(() => We(e.columns)), j = {
|
|
1010
1079
|
get state() {
|
|
1011
1080
|
return e.state;
|
|
1012
1081
|
},
|
|
@@ -1035,7 +1104,7 @@ const dt = we({
|
|
|
1035
1104
|
return e.filterModel;
|
|
1036
1105
|
},
|
|
1037
1106
|
get groupBy() {
|
|
1038
|
-
return
|
|
1107
|
+
return P.value;
|
|
1039
1108
|
},
|
|
1040
1109
|
get aggregationModel() {
|
|
1041
1110
|
return e.aggregationModel;
|
|
@@ -1052,45 +1121,45 @@ const dt = we({
|
|
|
1052
1121
|
get columns() {
|
|
1053
1122
|
return e.columns;
|
|
1054
1123
|
}
|
|
1055
|
-
}, I =
|
|
1056
|
-
mode:
|
|
1124
|
+
}, I = y(() => _.value ? "pivot" : C.value && "initialTreeData" in C.value ? "tree" : "base"), E = y(() => u.value?.api.columns.getSnapshot().visibleColumns ?? []), N = y(() => u.value?.api.rows.getCount() ?? 0), X = {
|
|
1125
|
+
mode: y(() => I.value),
|
|
1057
1126
|
resolveRuntime: () => u.value,
|
|
1058
|
-
visibleColumns:
|
|
1059
|
-
totalRows:
|
|
1060
|
-
showRowSelection:
|
|
1127
|
+
visibleColumns: E,
|
|
1128
|
+
totalRows: N,
|
|
1129
|
+
showRowSelection: y(() => e.rowSelection)
|
|
1061
1130
|
}, {
|
|
1062
|
-
selectionSnapshot:
|
|
1063
|
-
selectionAnchor:
|
|
1064
|
-
syncSelectionSnapshotFromRuntime:
|
|
1065
|
-
selectionService:
|
|
1066
|
-
selectionAggregatesLabel:
|
|
1067
|
-
} =
|
|
1068
|
-
rowSelectionSnapshot:
|
|
1069
|
-
syncRowSelectionSnapshotFromRuntime:
|
|
1070
|
-
reconcileRowSelectionFromRuntime:
|
|
1131
|
+
selectionSnapshot: Z,
|
|
1132
|
+
selectionAnchor: ee,
|
|
1133
|
+
syncSelectionSnapshotFromRuntime: te,
|
|
1134
|
+
selectionService: oe,
|
|
1135
|
+
selectionAggregatesLabel: ne
|
|
1136
|
+
} = Fe(X), {
|
|
1137
|
+
rowSelectionSnapshot: W,
|
|
1138
|
+
syncRowSelectionSnapshotFromRuntime: H,
|
|
1139
|
+
reconcileRowSelectionFromRuntime: re,
|
|
1071
1140
|
selectionService: k
|
|
1072
|
-
} =
|
|
1141
|
+
} = ze({
|
|
1073
1142
|
resolveRuntime: () => u.value
|
|
1074
|
-
}), t =
|
|
1143
|
+
}), t = y(() => e.rowSelection ? k : wt()), i = y(() => ({
|
|
1075
1144
|
...e.services ?? {},
|
|
1076
|
-
selection:
|
|
1145
|
+
selection: St({
|
|
1077
1146
|
userSelectionService: e.services?.selection,
|
|
1078
|
-
cellSelectionService:
|
|
1147
|
+
cellSelectionService: oe,
|
|
1079
1148
|
rowSelectionService: t.value
|
|
1080
1149
|
})
|
|
1081
1150
|
})), {
|
|
1082
1151
|
dataGridInstanceKey: l,
|
|
1083
|
-
resolvedRowModel:
|
|
1084
|
-
} =
|
|
1085
|
-
rows:
|
|
1086
|
-
rowModel:
|
|
1152
|
+
resolvedRowModel: f
|
|
1153
|
+
} = He({
|
|
1154
|
+
rows: ge(e, "rows"),
|
|
1155
|
+
rowModel: ge(e, "rowModel"),
|
|
1087
1156
|
clientRowModelOptions: C,
|
|
1088
1157
|
onOwnedRowModelRecreated: () => {
|
|
1089
|
-
|
|
1158
|
+
g.dispose();
|
|
1090
1159
|
}
|
|
1091
|
-
}),
|
|
1160
|
+
}), g = pt({
|
|
1092
1161
|
gridRef: u,
|
|
1093
|
-
props:
|
|
1162
|
+
props: j,
|
|
1094
1163
|
emit: {
|
|
1095
1164
|
columnState: (a) => n("update:columnState", a),
|
|
1096
1165
|
columnOrder: (a) => n("update:columnOrder", a),
|
|
@@ -1103,85 +1172,85 @@ const dt = we({
|
|
|
1103
1172
|
},
|
|
1104
1173
|
ready: (a) => n("ready", {
|
|
1105
1174
|
api: a.api,
|
|
1106
|
-
rowModel:
|
|
1175
|
+
rowModel: f.value
|
|
1107
1176
|
})
|
|
1108
1177
|
}
|
|
1109
|
-
}),
|
|
1110
|
-
|
|
1111
|
-
},
|
|
1178
|
+
}), h = (a) => {
|
|
1179
|
+
re(), n("cell-change", a), g.emitSnapshotUpdates();
|
|
1180
|
+
}, Le = (a) => {
|
|
1112
1181
|
n("selection-change", a);
|
|
1113
|
-
},
|
|
1182
|
+
}, De = (a) => {
|
|
1114
1183
|
n("row-selection-change", a);
|
|
1115
|
-
},
|
|
1116
|
-
|
|
1184
|
+
}, me = () => {
|
|
1185
|
+
g.emitSnapshotUpdates();
|
|
1117
1186
|
};
|
|
1118
|
-
|
|
1119
|
-
|
|
1187
|
+
w(
|
|
1188
|
+
W,
|
|
1120
1189
|
(a) => {
|
|
1121
|
-
n("row-select", a), n("update:rowSelectionState", a),
|
|
1190
|
+
n("row-select", a), n("update:rowSelectionState", a), me();
|
|
1122
1191
|
},
|
|
1123
1192
|
{ deep: !0 }
|
|
1124
|
-
),
|
|
1193
|
+
), w(
|
|
1125
1194
|
() => [e.rowSelection, e.rowSelectionState, u.value],
|
|
1126
1195
|
([a, m]) => {
|
|
1127
1196
|
if (a) {
|
|
1128
1197
|
if (m !== void 0) {
|
|
1129
|
-
const
|
|
1130
|
-
|
|
1198
|
+
const F = u.value?.api.rowSelection;
|
|
1199
|
+
ht(W.value, m) || (m ? F?.setSnapshot(m) : F?.clear(), H());
|
|
1131
1200
|
return;
|
|
1132
1201
|
}
|
|
1133
|
-
|
|
1202
|
+
H();
|
|
1134
1203
|
return;
|
|
1135
1204
|
}
|
|
1136
1205
|
k.clearRowSelection?.();
|
|
1137
1206
|
},
|
|
1138
1207
|
{ immediate: !0 }
|
|
1139
|
-
),
|
|
1208
|
+
), w(
|
|
1140
1209
|
() => e.viewMode,
|
|
1141
1210
|
(a) => {
|
|
1142
|
-
|
|
1211
|
+
p.value = a === "gantt" ? "gantt" : "table";
|
|
1143
1212
|
},
|
|
1144
1213
|
{ immediate: !0 }
|
|
1145
1214
|
);
|
|
1146
|
-
const
|
|
1215
|
+
const ye = (a) => {
|
|
1147
1216
|
const m = a === "gantt" ? "gantt" : "table";
|
|
1148
|
-
|
|
1149
|
-
},
|
|
1150
|
-
const a =
|
|
1151
|
-
return a ?
|
|
1217
|
+
p.value = m, n("update:viewMode", m);
|
|
1218
|
+
}, Ge = () => {
|
|
1219
|
+
const a = g.getState();
|
|
1220
|
+
return a ? $({
|
|
1152
1221
|
state: a,
|
|
1153
|
-
viewMode:
|
|
1222
|
+
viewMode: p.value
|
|
1154
1223
|
}) : null;
|
|
1155
|
-
},
|
|
1156
|
-
const
|
|
1157
|
-
return
|
|
1224
|
+
}, Pe = (a, m) => Ce(a, g.migrateState, m), xe = (a, m) => {
|
|
1225
|
+
const F = $(a);
|
|
1226
|
+
return g.applyState(F.state, m) ? (F.viewMode && ye(F.viewMode), !0) : !1;
|
|
1158
1227
|
};
|
|
1159
|
-
return
|
|
1160
|
-
|
|
1161
|
-
}),
|
|
1228
|
+
return fe(() => {
|
|
1229
|
+
g.dispose();
|
|
1230
|
+
}), c({
|
|
1162
1231
|
grid: u,
|
|
1163
|
-
rowModel:
|
|
1232
|
+
rowModel: f,
|
|
1164
1233
|
getApi: () => u.value?.api ?? null,
|
|
1165
1234
|
getRuntime: () => u.value?.runtime ?? null,
|
|
1166
1235
|
getCore: () => u.value?.core ?? null,
|
|
1167
|
-
getColumnState: () =>
|
|
1236
|
+
getColumnState: () => g.getColumnState(),
|
|
1168
1237
|
getColumnSnapshot: () => u.value?.api.columns.getSnapshot() ?? null,
|
|
1169
|
-
getSelectionAggregatesLabel: () =>
|
|
1238
|
+
getSelectionAggregatesLabel: () => ne.value,
|
|
1170
1239
|
getSelectionSummary: () => u.value?.api.selection.summarize() ?? null,
|
|
1171
|
-
getView: () =>
|
|
1172
|
-
setView:
|
|
1173
|
-
getSavedView:
|
|
1174
|
-
migrateSavedView:
|
|
1175
|
-
applySavedView:
|
|
1176
|
-
applyColumnState:
|
|
1177
|
-
getState:
|
|
1178
|
-
migrateState:
|
|
1179
|
-
applyState:
|
|
1180
|
-
exportPivotLayout:
|
|
1181
|
-
exportPivotInterop:
|
|
1182
|
-
importPivotLayout:
|
|
1183
|
-
expandAllGroups:
|
|
1184
|
-
collapseAllGroups:
|
|
1240
|
+
getView: () => p.value,
|
|
1241
|
+
setView: ye,
|
|
1242
|
+
getSavedView: Ge,
|
|
1243
|
+
migrateSavedView: Pe,
|
|
1244
|
+
applySavedView: xe,
|
|
1245
|
+
applyColumnState: g.applyColumnState,
|
|
1246
|
+
getState: g.getState,
|
|
1247
|
+
migrateState: g.migrateState,
|
|
1248
|
+
applyState: g.applyState,
|
|
1249
|
+
exportPivotLayout: g.exportPivotLayout,
|
|
1250
|
+
exportPivotInterop: g.exportPivotInterop,
|
|
1251
|
+
importPivotLayout: g.importPivotLayout,
|
|
1252
|
+
expandAllGroups: g.expandAllGroups,
|
|
1253
|
+
collapseAllGroups: g.collapseAllGroups,
|
|
1185
1254
|
insertRowsAt: (a, m) => u.value?.api.rows.insertDataAt(a, m) ?? !1,
|
|
1186
1255
|
insertRowBefore: (a, m) => u.value?.api.rows.insertDataBefore(a, m) ?? !1,
|
|
1187
1256
|
insertRowAfter: (a, m) => u.value?.api.rows.insertDataAfter(a, m) ?? !1,
|
|
@@ -1194,29 +1263,31 @@ const dt = we({
|
|
|
1194
1263
|
rows: e.rows,
|
|
1195
1264
|
runtime: u.value?.runtime ?? null,
|
|
1196
1265
|
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:
|
|
1207
|
-
renderMode:
|
|
1266
|
+
selectionSnapshot: Z,
|
|
1267
|
+
selectionAnchor: ee,
|
|
1268
|
+
rowSelectionSnapshot: W,
|
|
1269
|
+
syncSelectionSnapshotFromRuntime: te,
|
|
1270
|
+
syncRowSelectionSnapshotFromRuntime: H,
|
|
1271
|
+
flushRowSelectionSnapshotUpdates: me,
|
|
1272
|
+
sortModel: Q.value,
|
|
1273
|
+
filterModel: z.value,
|
|
1274
|
+
groupBy: T.value,
|
|
1275
|
+
pivotModel: _.value,
|
|
1276
|
+
renderMode: S.value,
|
|
1208
1277
|
virtualization: K.value,
|
|
1209
1278
|
columnMenu: B.value,
|
|
1210
|
-
cellMenu:
|
|
1211
|
-
rowIndexMenu:
|
|
1212
|
-
columnLayout:
|
|
1279
|
+
cellMenu: b.value,
|
|
1280
|
+
rowIndexMenu: M.value,
|
|
1281
|
+
columnLayout: D.value,
|
|
1213
1282
|
aggregations: G.value,
|
|
1214
1283
|
advancedFilter: d.value,
|
|
1284
|
+
findReplace: U.value,
|
|
1285
|
+
gridLines: v.value,
|
|
1215
1286
|
rowHeightMode: e.rowHeightMode,
|
|
1216
1287
|
baseRowHeight: e.baseRowHeight,
|
|
1217
|
-
layoutMode:
|
|
1218
|
-
minRows:
|
|
1219
|
-
maxRows:
|
|
1288
|
+
layoutMode: A.value.layoutMode,
|
|
1289
|
+
minRows: A.value.minRows,
|
|
1290
|
+
maxRows: A.value.maxRows,
|
|
1220
1291
|
fillHandle: e.fillHandle,
|
|
1221
1292
|
rangeMove: e.rangeMove,
|
|
1222
1293
|
rowHover: e.rowHover,
|
|
@@ -1224,30 +1295,30 @@ const dt = we({
|
|
|
1224
1295
|
isCellEditable: e.isCellEditable,
|
|
1225
1296
|
showRowIndex: e.showRowIndex,
|
|
1226
1297
|
rowSelection: e.rowSelection,
|
|
1227
|
-
viewMode:
|
|
1298
|
+
viewMode: p.value,
|
|
1228
1299
|
gantt: e.gantt,
|
|
1229
1300
|
toolbarModules: e.toolbarModules
|
|
1230
1301
|
};
|
|
1231
|
-
return
|
|
1232
|
-
|
|
1302
|
+
return ce(
|
|
1303
|
+
gt,
|
|
1233
1304
|
{
|
|
1234
1305
|
...o,
|
|
1235
1306
|
ref: u,
|
|
1236
1307
|
key: l.value,
|
|
1237
1308
|
rows: e.rows,
|
|
1238
|
-
rowModel:
|
|
1309
|
+
rowModel: f.value,
|
|
1239
1310
|
columns: V.value,
|
|
1240
1311
|
theme: e.theme,
|
|
1241
|
-
layoutMode:
|
|
1242
|
-
renderMode:
|
|
1243
|
-
pagination:
|
|
1312
|
+
layoutMode: A.value.layoutMode,
|
|
1313
|
+
renderMode: S.value,
|
|
1314
|
+
pagination: O.value,
|
|
1244
1315
|
plugins: e.plugins,
|
|
1245
1316
|
services: i.value,
|
|
1246
1317
|
startupOrder: e.startupOrder,
|
|
1247
1318
|
autoStart: e.autoStart,
|
|
1248
|
-
onCellChange:
|
|
1249
|
-
onSelectionChange:
|
|
1250
|
-
onRowSelectionChange:
|
|
1319
|
+
onCellChange: h,
|
|
1320
|
+
onSelectionChange: Le,
|
|
1321
|
+
onRowSelectionChange: De
|
|
1251
1322
|
},
|
|
1252
1323
|
r.default ? {
|
|
1253
1324
|
default: (m) => r.default?.({
|
|
@@ -1259,7 +1330,7 @@ const dt = we({
|
|
|
1259
1330
|
}
|
|
1260
1331
|
})
|
|
1261
1332
|
} : {
|
|
1262
|
-
default: (m) =>
|
|
1333
|
+
default: (m) => ce(ke, {
|
|
1263
1334
|
...a,
|
|
1264
1335
|
runtime: m.runtime,
|
|
1265
1336
|
runtimeRowModel: m.rowModel
|
|
@@ -1268,14 +1339,14 @@ const dt = we({
|
|
|
1268
1339
|
);
|
|
1269
1340
|
};
|
|
1270
1341
|
}
|
|
1271
|
-
}),
|
|
1342
|
+
}), xt = bt;
|
|
1272
1343
|
export {
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1344
|
+
xt as DataGrid,
|
|
1345
|
+
Pt as clearDataGridSavedViewInStorage,
|
|
1346
|
+
bt as default,
|
|
1347
|
+
Ce as migrateDataGridSavedView,
|
|
1348
|
+
ct as parseDataGridSavedView,
|
|
1349
|
+
Gt as readDataGridSavedViewFromStorage,
|
|
1350
|
+
dt as serializeDataGridSavedView,
|
|
1351
|
+
Dt as writeDataGridSavedViewToStorage
|
|
1281
1352
|
};
|