@affino/datagrid-vue-app 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DataGrid.d.ts +30 -2
- package/dist/DataGridTableStage.vue.d.ts +8 -0
- package/dist/chunks/{DataGridGanttStage.vue_vue_type_script_setup_true_lang-Dhns9W_V.js → DataGridGanttStage.vue_vue_type_script_setup_true_lang-BuF2sFwp.js} +1 -1
- package/dist/chunks/{DataGridGanttStageEntry-D4NqLvKS.js → DataGridGanttStageEntry-BydDrrtc.js} +1 -1
- package/dist/chunks/{DataGridTableStage.vue_vue_type_script_setup_true_lang-BKBL5xs3.js → DataGridTableStage.vue_vue_type_script_setup_true_lang-DUqp_TKD.js} +2085 -1988
- package/dist/chunks/{useDataGridAppRowModel-CrcgRzkI.js → useDataGridAppRowModel-ut9FcmL0.js} +1192 -1140
- package/dist/config/dataGridFormulaOptions.d.ts +14 -2
- package/dist/config/dataGridLayout.d.ts +7 -0
- package/dist/gantt.js +1 -1
- package/dist/host/DataGridDefaultRenderer.d.ts +28 -0
- package/dist/host/DataGridRuntimeHost.d.ts +10 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +409 -366
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +3 -3
- package/dist/stage/DataGridCellContentRenderer.d.ts +15 -0
- package/dist/stage/DataGridTableStage.vue.d.ts +8 -0
- package/dist/stage/dataGridTableStage.types.d.ts +5 -0
- package/dist/stage/dataGridTableStageBody.types.d.ts +4 -1
- package/dist/stage/dataGridTableStageContext.d.ts +3 -0
- package/dist/stage/useDataGridTableStageRuntime.d.ts +4 -0
- package/package.json +4 -4
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 ue, ref as Y, provide as ye, computed as f, watch as p, onBeforeUnmount as ee, h as Z, mergeProps as we, toRef as oe } from "vue";
|
|
2
|
+
import { useDataGridRuntime as pe } from "@affino/datagrid-vue";
|
|
3
|
+
import { useDataGridAppSelection as Se, useDataGridAppRowSelection as he } from "@affino/datagrid-vue/app";
|
|
4
|
+
import { d as Re, e as be, f as Me, r as Oe, g as Be, u as Ae, D as Ce } from "./chunks/useDataGridAppRowModel-ut9FcmL0.js";
|
|
5
|
+
import { applyGridTheme as xe, resolveGridThemeTokens as Pe, defaultStyleConfig as C, sugarTheme as se, industrialNeutralTheme as ne } from "@affino/datagrid-theme";
|
|
6
|
+
import { d as Ge } from "./chunks/DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-_1TDQseN.js";
|
|
7
|
+
const De = {
|
|
8
|
+
default: C,
|
|
9
|
+
"industrial-neutral": ne,
|
|
10
|
+
industrialNeutral: ne,
|
|
11
|
+
sugar: se
|
|
12
12
|
};
|
|
13
|
-
function
|
|
13
|
+
function Le(e, t) {
|
|
14
14
|
if (!e && !t)
|
|
15
15
|
return;
|
|
16
16
|
const r = {
|
|
17
17
|
...e ?? {}
|
|
18
18
|
};
|
|
19
|
-
for (const [n,
|
|
19
|
+
for (const [n, c] of Object.entries(t ?? {}))
|
|
20
20
|
r[n] = {
|
|
21
21
|
...r[n] ?? {},
|
|
22
|
-
...
|
|
22
|
+
...c
|
|
23
23
|
};
|
|
24
24
|
return r;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function J(e, t) {
|
|
27
27
|
return {
|
|
28
28
|
...e,
|
|
29
29
|
...t,
|
|
@@ -34,34 +34,34 @@ function _(e, t) {
|
|
|
34
34
|
summary: { ...e.summary ?? {}, ...t.summary ?? {} },
|
|
35
35
|
state: { ...e.state ?? {}, ...t.state ?? {} },
|
|
36
36
|
tokens: { ...e.tokens ?? {}, ...t.tokens ?? {} },
|
|
37
|
-
tokenVariants:
|
|
37
|
+
tokenVariants: Le(e.tokenVariants, t.tokenVariants)
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function Ie(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 je(e) {
|
|
44
|
+
return e == null ? C : typeof e == "string" ? e === "sugar" ? J(C, se) : De[e] ?? C : Ie(e) ? J(C, e) : J(C, {
|
|
45
45
|
tokens: e
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
const t =
|
|
50
|
-
return
|
|
48
|
+
function Ke(e) {
|
|
49
|
+
const t = je(e);
|
|
50
|
+
return Pe(t ?? C, {
|
|
51
51
|
document: typeof document > "u" ? void 0 : document
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
function ne(e, t) {
|
|
55
|
-
const r = Le(t);
|
|
56
|
-
return Ae(e, r), r;
|
|
57
|
-
}
|
|
58
54
|
function re(e, t) {
|
|
59
|
-
|
|
55
|
+
const r = Ke(t);
|
|
56
|
+
return xe(e, r), r;
|
|
60
57
|
}
|
|
61
58
|
function le(e, t) {
|
|
59
|
+
return Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : t;
|
|
60
|
+
}
|
|
61
|
+
function ae(e, t) {
|
|
62
62
|
return Number.isFinite(e) ? Math.max(1, Math.trunc(e)) : t;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function Fe(e) {
|
|
65
65
|
if (e !== void 0) {
|
|
66
66
|
if (e == null)
|
|
67
67
|
return null;
|
|
@@ -76,79 +76,101 @@ function je(e) {
|
|
|
76
76
|
return e;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function Te(e, t) {
|
|
80
80
|
return t === !0 || t && typeof t == "object" ? "pagination" : e ?? "virtualization";
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function ze(e, t, r, n) {
|
|
83
83
|
if (t !== "pagination")
|
|
84
84
|
return null;
|
|
85
|
-
const
|
|
85
|
+
const c = 100, a = ae(r, c), y = le(n, 0);
|
|
86
86
|
return e === !0 || e === !1 || e == null ? {
|
|
87
|
-
pageSize:
|
|
88
|
-
currentPage:
|
|
87
|
+
pageSize: a,
|
|
88
|
+
currentPage: y
|
|
89
89
|
} : {
|
|
90
|
-
pageSize:
|
|
91
|
-
currentPage:
|
|
90
|
+
pageSize: ae(r ?? e.pageSize, c),
|
|
91
|
+
currentPage: le(n ?? e.currentPage, 0)
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
const
|
|
95
|
-
function
|
|
94
|
+
const $ = "Advanced filter";
|
|
95
|
+
function We(e) {
|
|
96
96
|
return typeof e == "boolean" ? {
|
|
97
97
|
enabled: e,
|
|
98
|
-
buttonLabel:
|
|
98
|
+
buttonLabel: $
|
|
99
99
|
} : e ? {
|
|
100
100
|
enabled: e.enabled ?? !0,
|
|
101
|
-
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() :
|
|
101
|
+
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() : $
|
|
102
102
|
} : {
|
|
103
103
|
enabled: !1,
|
|
104
|
-
buttonLabel:
|
|
104
|
+
buttonLabel: $
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function ie(e) {
|
|
108
|
+
if (typeof e != "number" || !Number.isFinite(e))
|
|
109
|
+
return null;
|
|
110
|
+
const t = Math.max(0, Math.trunc(e));
|
|
111
|
+
return t > 0 ? t : null;
|
|
112
|
+
}
|
|
113
|
+
function Ve(e, t, r) {
|
|
114
|
+
const n = e === "auto-height" ? "auto-height" : "fill";
|
|
115
|
+
if (n !== "auto-height")
|
|
116
|
+
return {
|
|
117
|
+
layoutMode: n,
|
|
118
|
+
minRows: null,
|
|
119
|
+
maxRows: null
|
|
120
|
+
};
|
|
121
|
+
const c = ie(t);
|
|
122
|
+
let a = ie(r);
|
|
123
|
+
return c !== null && a !== null && a < c && (a = c), {
|
|
124
|
+
layoutMode: n,
|
|
125
|
+
minRows: c,
|
|
126
|
+
maxRows: a
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function He(e) {
|
|
108
130
|
return typeof e == "object" && e !== null;
|
|
109
131
|
}
|
|
110
|
-
function
|
|
111
|
-
const n =
|
|
112
|
-
if (!
|
|
132
|
+
function de(e, t, r) {
|
|
133
|
+
const n = He(e) ? e : null, c = t(n && "state" in n ? n.state : e, r);
|
|
134
|
+
if (!c)
|
|
113
135
|
return null;
|
|
114
|
-
const
|
|
136
|
+
const a = n?.viewMode, y = a === "gantt" ? "gantt" : a === "table" ? "table" : void 0;
|
|
115
137
|
return {
|
|
116
|
-
state:
|
|
117
|
-
...
|
|
138
|
+
state: c,
|
|
139
|
+
...y ? { viewMode: y } : {}
|
|
118
140
|
};
|
|
119
141
|
}
|
|
120
|
-
function
|
|
142
|
+
function Ee(e) {
|
|
121
143
|
return JSON.stringify(e);
|
|
122
144
|
}
|
|
123
|
-
function
|
|
145
|
+
function ke(e, t, r) {
|
|
124
146
|
if (typeof e != "string" || e.trim().length === 0)
|
|
125
147
|
return null;
|
|
126
148
|
try {
|
|
127
|
-
return
|
|
149
|
+
return de(JSON.parse(e), t, r);
|
|
128
150
|
} catch {
|
|
129
151
|
return null;
|
|
130
152
|
}
|
|
131
153
|
}
|
|
132
|
-
function
|
|
154
|
+
function at(e, t, r) {
|
|
133
155
|
if (!e || typeof t != "string" || t.trim().length === 0)
|
|
134
156
|
return !1;
|
|
135
157
|
try {
|
|
136
|
-
return e.setItem(t,
|
|
158
|
+
return e.setItem(t, Ee(r)), !0;
|
|
137
159
|
} catch {
|
|
138
160
|
return !1;
|
|
139
161
|
}
|
|
140
162
|
}
|
|
141
|
-
function
|
|
163
|
+
function it(e, t, r, n) {
|
|
142
164
|
if (!e || typeof t != "string" || t.trim().length === 0)
|
|
143
165
|
return null;
|
|
144
166
|
try {
|
|
145
|
-
const
|
|
146
|
-
return
|
|
167
|
+
const c = e.getItem(t);
|
|
168
|
+
return c ? ke(c, r, n) : null;
|
|
147
169
|
} catch {
|
|
148
170
|
return null;
|
|
149
171
|
}
|
|
150
172
|
}
|
|
151
|
-
function
|
|
173
|
+
function ut(e, t) {
|
|
152
174
|
if (!e || typeof t != "string" || t.trim().length === 0)
|
|
153
175
|
return !1;
|
|
154
176
|
try {
|
|
@@ -157,36 +179,36 @@ function lt(e, t) {
|
|
|
157
179
|
return !1;
|
|
158
180
|
}
|
|
159
181
|
}
|
|
160
|
-
const
|
|
161
|
-
function
|
|
182
|
+
const q = "Columns";
|
|
183
|
+
function Ne(e) {
|
|
162
184
|
return typeof e == "boolean" ? {
|
|
163
185
|
enabled: e,
|
|
164
|
-
buttonLabel:
|
|
186
|
+
buttonLabel: q
|
|
165
187
|
} : e ? {
|
|
166
188
|
enabled: e.enabled ?? !0,
|
|
167
|
-
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() :
|
|
189
|
+
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() : q
|
|
168
190
|
} : {
|
|
169
191
|
enabled: !1,
|
|
170
|
-
buttonLabel:
|
|
192
|
+
buttonLabel: q
|
|
171
193
|
};
|
|
172
194
|
}
|
|
173
|
-
const
|
|
174
|
-
function
|
|
195
|
+
const Q = "Aggregations";
|
|
196
|
+
function Ue(e) {
|
|
175
197
|
return typeof e == "boolean" ? {
|
|
176
198
|
enabled: e,
|
|
177
|
-
buttonLabel:
|
|
199
|
+
buttonLabel: Q
|
|
178
200
|
} : e ? {
|
|
179
201
|
enabled: e.enabled ?? !0,
|
|
180
|
-
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() :
|
|
202
|
+
buttonLabel: typeof e.buttonLabel == "string" && e.buttonLabel.trim().length > 0 ? e.buttonLabel.trim() : Q
|
|
181
203
|
} : {
|
|
182
204
|
enabled: !1,
|
|
183
|
-
buttonLabel:
|
|
205
|
+
buttonLabel: Q
|
|
184
206
|
};
|
|
185
207
|
}
|
|
186
208
|
function T(e, t) {
|
|
187
209
|
return Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : t;
|
|
188
210
|
}
|
|
189
|
-
function
|
|
211
|
+
function _e(e, t) {
|
|
190
212
|
const r = {
|
|
191
213
|
rows: !0,
|
|
192
214
|
columns: !1,
|
|
@@ -204,7 +226,7 @@ function ke(e, t) {
|
|
|
204
226
|
}
|
|
205
227
|
return t === "pagination" && (r.rows = !1), r;
|
|
206
228
|
}
|
|
207
|
-
const
|
|
229
|
+
const Je = ue({
|
|
208
230
|
name: "DataGridRuntimeHost",
|
|
209
231
|
inheritAttrs: !1,
|
|
210
232
|
props: {
|
|
@@ -224,6 +246,10 @@ const Ne = ae({
|
|
|
224
246
|
type: [String, Object],
|
|
225
247
|
default: void 0
|
|
226
248
|
},
|
|
249
|
+
layoutMode: {
|
|
250
|
+
type: String,
|
|
251
|
+
default: "fill"
|
|
252
|
+
},
|
|
227
253
|
plugins: {
|
|
228
254
|
type: Array,
|
|
229
255
|
default: () => []
|
|
@@ -250,303 +276,304 @@ const Ne = ae({
|
|
|
250
276
|
}
|
|
251
277
|
},
|
|
252
278
|
emits: ["cell-change", "selection-change"],
|
|
253
|
-
setup(e, { attrs: t, slots: r, emit: n, expose:
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
let
|
|
257
|
-
const
|
|
258
|
-
rows:
|
|
279
|
+
setup(e, { attrs: t, slots: r, emit: n, expose: c }) {
|
|
280
|
+
const a = Y(null);
|
|
281
|
+
ye(Ge, a);
|
|
282
|
+
let y = null;
|
|
283
|
+
const i = pe({
|
|
284
|
+
rows: f(() => e.rows),
|
|
259
285
|
rowModel: e.rowModel,
|
|
260
|
-
columns:
|
|
286
|
+
columns: f(() => e.columns),
|
|
261
287
|
plugins: e.plugins,
|
|
262
288
|
services: e.services,
|
|
263
289
|
startupOrder: e.startupOrder,
|
|
264
290
|
autoStart: e.autoStart
|
|
265
|
-
}), h =
|
|
266
|
-
api:
|
|
267
|
-
syncBodyRowsInRange:
|
|
268
|
-
rowPartition:
|
|
269
|
-
virtualWindow:
|
|
270
|
-
columnSnapshot:
|
|
291
|
+
}), h = i, b = {
|
|
292
|
+
api: i.api,
|
|
293
|
+
syncBodyRowsInRange: i.syncBodyRowsInRange,
|
|
294
|
+
rowPartition: i.rowPartition,
|
|
295
|
+
virtualWindow: i.virtualWindow,
|
|
296
|
+
columnSnapshot: i.columnSnapshot,
|
|
271
297
|
getBodyRowAtIndex: h.getBodyRowAtIndex,
|
|
272
298
|
resolveBodyRowIndexById: h.resolveBodyRowIndexById
|
|
273
|
-
},
|
|
299
|
+
}, A = () => {
|
|
274
300
|
if (e.renderMode === "pagination") {
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
pageSize: Math.max(1, Math.trunc(
|
|
278
|
-
currentPage: Math.max(0, Math.trunc(
|
|
301
|
+
const v = e.pagination ?? { pageSize: 100, currentPage: 0 };
|
|
302
|
+
i.api.rows.setPagination({
|
|
303
|
+
pageSize: Math.max(1, Math.trunc(v.pageSize)),
|
|
304
|
+
currentPage: Math.max(0, Math.trunc(v.currentPage))
|
|
279
305
|
});
|
|
280
306
|
return;
|
|
281
307
|
}
|
|
282
|
-
|
|
308
|
+
i.api.rows.setPagination(null);
|
|
283
309
|
};
|
|
284
|
-
|
|
310
|
+
p(
|
|
285
311
|
() => e.renderMode,
|
|
286
312
|
() => {
|
|
287
|
-
|
|
313
|
+
A();
|
|
288
314
|
},
|
|
289
315
|
{ immediate: !0 }
|
|
290
|
-
),
|
|
316
|
+
), p(
|
|
291
317
|
() => e.pagination,
|
|
292
318
|
() => {
|
|
293
|
-
|
|
319
|
+
A();
|
|
294
320
|
},
|
|
295
321
|
{ immediate: !0, deep: !0 }
|
|
296
|
-
), typeof document < "u" && (
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
}),
|
|
322
|
+
), typeof document < "u" && (y = new MutationObserver(() => {
|
|
323
|
+
const v = a.value;
|
|
324
|
+
v && re(v, e.theme);
|
|
325
|
+
}), y.observe(document.documentElement, {
|
|
300
326
|
attributes: !0,
|
|
301
327
|
attributeFilter: ["class", "data-theme"]
|
|
302
|
-
})),
|
|
303
|
-
[() => e.theme,
|
|
328
|
+
})), p(
|
|
329
|
+
[() => e.theme, a],
|
|
304
330
|
() => {
|
|
305
|
-
const
|
|
306
|
-
|
|
331
|
+
const v = a.value;
|
|
332
|
+
v && re(v, e.theme);
|
|
307
333
|
},
|
|
308
334
|
{ immediate: !0, deep: !0 }
|
|
309
335
|
);
|
|
310
|
-
const
|
|
311
|
-
n("cell-change",
|
|
312
|
-
}),
|
|
313
|
-
n("selection-change",
|
|
336
|
+
const x = i.api.events.on("rows:changed", (v) => {
|
|
337
|
+
n("cell-change", v);
|
|
338
|
+
}), P = i.api.events.on("selection:changed", (v) => {
|
|
339
|
+
n("selection-change", v);
|
|
314
340
|
});
|
|
315
|
-
|
|
316
|
-
|
|
341
|
+
ee(() => {
|
|
342
|
+
x(), P(), y?.disconnect(), y = null;
|
|
317
343
|
});
|
|
318
|
-
const
|
|
319
|
-
const
|
|
344
|
+
const g = f(() => {
|
|
345
|
+
const v = i.virtualWindow.value;
|
|
320
346
|
return {
|
|
321
|
-
...
|
|
322
|
-
rowTotal:
|
|
323
|
-
colTotal:
|
|
347
|
+
...v ?? {},
|
|
348
|
+
rowTotal: v?.rowTotal ?? i.rowPartition.value.bodyRowCount,
|
|
349
|
+
colTotal: i.columnSnapshot.value.visibleColumns.length
|
|
324
350
|
};
|
|
325
351
|
});
|
|
326
|
-
return
|
|
327
|
-
api:
|
|
328
|
-
core:
|
|
352
|
+
return c({
|
|
353
|
+
api: i.api,
|
|
354
|
+
core: i.core,
|
|
329
355
|
runtime: b,
|
|
330
|
-
rowModel:
|
|
331
|
-
columnModel:
|
|
332
|
-
columnSnapshot:
|
|
333
|
-
rowPartition:
|
|
334
|
-
setRows:
|
|
335
|
-
syncBodyRowsInRange:
|
|
356
|
+
rowModel: i.rowModel,
|
|
357
|
+
columnModel: i.columnModel,
|
|
358
|
+
columnSnapshot: i.columnSnapshot,
|
|
359
|
+
rowPartition: i.rowPartition,
|
|
360
|
+
setRows: i.setRows,
|
|
361
|
+
syncBodyRowsInRange: i.syncBodyRowsInRange,
|
|
336
362
|
getBodyRowAtIndex: h.getBodyRowAtIndex,
|
|
337
363
|
resolveBodyRowIndexById: h.resolveBodyRowIndexById,
|
|
338
|
-
virtualWindow:
|
|
339
|
-
start:
|
|
340
|
-
stop:
|
|
341
|
-
}), () =>
|
|
364
|
+
virtualWindow: i.virtualWindow,
|
|
365
|
+
start: i.start,
|
|
366
|
+
stop: i.stop
|
|
367
|
+
}), () => Z(
|
|
342
368
|
"div",
|
|
343
|
-
|
|
344
|
-
ref:
|
|
345
|
-
class:
|
|
369
|
+
we(t, {
|
|
370
|
+
ref: a,
|
|
371
|
+
class: [
|
|
372
|
+
"affino-datagrid-app-root",
|
|
373
|
+
e.layoutMode === "auto-height" ? "affino-datagrid-app-root--auto-height" : "affino-datagrid-app-root--fill"
|
|
374
|
+
],
|
|
346
375
|
style: {
|
|
347
376
|
display: "flex",
|
|
348
|
-
flex: "1 1 auto",
|
|
349
377
|
width: "100%",
|
|
350
|
-
height: "100%",
|
|
351
378
|
minHeight: "0",
|
|
352
379
|
minWidth: "0"
|
|
353
380
|
}
|
|
354
381
|
}),
|
|
355
382
|
r.default?.({
|
|
356
|
-
api:
|
|
357
|
-
core:
|
|
383
|
+
api: i.api,
|
|
384
|
+
core: i.core,
|
|
358
385
|
runtime: b,
|
|
359
386
|
grid: b,
|
|
360
|
-
rowModel:
|
|
361
|
-
columnModel:
|
|
362
|
-
columnSnapshot:
|
|
363
|
-
rowPartition:
|
|
364
|
-
setRows:
|
|
365
|
-
syncBodyRowsInRange:
|
|
387
|
+
rowModel: i.rowModel,
|
|
388
|
+
columnModel: i.columnModel,
|
|
389
|
+
columnSnapshot: i.columnSnapshot.value,
|
|
390
|
+
rowPartition: i.rowPartition.value,
|
|
391
|
+
setRows: i.setRows,
|
|
392
|
+
syncBodyRowsInRange: i.syncBodyRowsInRange,
|
|
366
393
|
getBodyRowAtIndex: h.getBodyRowAtIndex,
|
|
367
394
|
resolveBodyRowIndexById: h.resolveBodyRowIndexById,
|
|
368
|
-
virtualWindow:
|
|
395
|
+
virtualWindow: g.value
|
|
369
396
|
}) ?? []
|
|
370
397
|
);
|
|
371
398
|
}
|
|
372
399
|
});
|
|
373
|
-
function
|
|
400
|
+
function X(e) {
|
|
374
401
|
return Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : null;
|
|
375
402
|
}
|
|
376
|
-
function
|
|
403
|
+
function B(e) {
|
|
377
404
|
try {
|
|
378
405
|
return JSON.stringify(e);
|
|
379
406
|
} catch {
|
|
380
407
|
return null;
|
|
381
408
|
}
|
|
382
409
|
}
|
|
383
|
-
function
|
|
410
|
+
function $e(e) {
|
|
384
411
|
return e ? {
|
|
385
412
|
fields: [...e.fields],
|
|
386
413
|
expandedByDefault: e.expandedByDefault
|
|
387
414
|
} : null;
|
|
388
415
|
}
|
|
389
|
-
function
|
|
390
|
-
let t = null, r = null, n = !1,
|
|
391
|
-
const
|
|
416
|
+
function qe(e) {
|
|
417
|
+
let t = null, r = null, n = !1, c = null, a = null, y = null, i = null, h = null, b = null, A = null;
|
|
418
|
+
const x = () => {
|
|
392
419
|
t?.(), r?.(), t = null, r = null;
|
|
393
|
-
},
|
|
420
|
+
}, P = () => {
|
|
394
421
|
const o = e.gridRef.value?.api.columns;
|
|
395
422
|
if (!o)
|
|
396
423
|
return null;
|
|
397
|
-
const d = o.getSnapshot(),
|
|
398
|
-
for (const
|
|
399
|
-
|
|
424
|
+
const d = o.getSnapshot(), u = {}, s = {}, R = {};
|
|
425
|
+
for (const S of d.columns)
|
|
426
|
+
u[S.key] = S.visible, s[S.key] = S.width, R[S.key] = S.pin;
|
|
400
427
|
return {
|
|
401
428
|
order: [...d.order],
|
|
402
|
-
visibility:
|
|
429
|
+
visibility: u,
|
|
403
430
|
widths: s,
|
|
404
|
-
pins:
|
|
431
|
+
pins: R
|
|
405
432
|
};
|
|
406
|
-
},
|
|
433
|
+
}, g = () => {
|
|
407
434
|
n || (n = !0, queueMicrotask(() => {
|
|
408
435
|
n = !1;
|
|
409
|
-
const o =
|
|
436
|
+
const o = P(), d = e.gridRef.value?.api;
|
|
410
437
|
if (o) {
|
|
411
|
-
const
|
|
412
|
-
b =
|
|
438
|
+
const u = B(o);
|
|
439
|
+
b = u, u !== y && (y = u, e.emit.columnState(o), e.emit.columnOrder(o.order), e.emit.hiddenColumnKeys(
|
|
413
440
|
Object.entries(o.visibility).filter(([, s]) => !s).map(([s]) => s)
|
|
414
441
|
), e.emit.columnWidths(o.widths), e.emit.columnPins(o.pins));
|
|
415
442
|
}
|
|
416
443
|
if (d) {
|
|
417
|
-
const
|
|
418
|
-
s !== h && (h = s, e.emit.groupBy(
|
|
419
|
-
const
|
|
420
|
-
|
|
444
|
+
const u = $e(d.rows.getSnapshot().groupBy), s = B(u);
|
|
445
|
+
s !== h && (h = s, e.emit.groupBy(u));
|
|
446
|
+
const R = d.state.get(), S = B(R);
|
|
447
|
+
A = S, S !== i && (i = S, e.emit.state(R));
|
|
421
448
|
}
|
|
422
449
|
}));
|
|
423
|
-
},
|
|
450
|
+
}, v = () => {
|
|
424
451
|
const o = e.gridRef.value?.api;
|
|
425
452
|
!o || e.props.sortModel === void 0 && e.props.filterModel === void 0 || o.rows.setSortAndFilterModel({
|
|
426
453
|
sortModel: e.props.sortModel ?? [],
|
|
427
454
|
filterModel: e.props.filterModel ?? null
|
|
428
455
|
});
|
|
429
|
-
},
|
|
456
|
+
}, G = () => {
|
|
430
457
|
const o = e.gridRef.value?.api;
|
|
431
458
|
!o || e.props.groupBy === void 0 || o.rows.setGroupBy(e.props.groupBy ?? null);
|
|
432
|
-
},
|
|
459
|
+
}, D = () => {
|
|
433
460
|
const o = e.gridRef.value?.api;
|
|
434
461
|
!o || e.props.aggregationModel === void 0 || o.rows.setAggregationModel(e.props.aggregationModel ?? null);
|
|
435
|
-
},
|
|
462
|
+
}, M = () => {
|
|
436
463
|
const o = e.gridRef.value?.api;
|
|
437
464
|
!o || e.props.pivotModel === void 0 || o.pivot.setModel(e.props.pivotModel ?? null);
|
|
438
|
-
},
|
|
465
|
+
}, O = () => {
|
|
439
466
|
const o = e.gridRef.value?.api;
|
|
440
467
|
if (!o || 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)
|
|
441
468
|
return;
|
|
442
|
-
const d =
|
|
469
|
+
const d = B({
|
|
443
470
|
columnState: e.props.columnState,
|
|
444
471
|
columnOrder: e.props.columnOrder,
|
|
445
472
|
hiddenColumnKeys: e.props.hiddenColumnKeys,
|
|
446
473
|
columnWidths: e.props.columnWidths,
|
|
447
474
|
columnPins: e.props.columnPins
|
|
448
475
|
});
|
|
449
|
-
if (d !==
|
|
450
|
-
if (e.props.columnState && !e.props.columnOrder && !e.props.hiddenColumnKeys && !e.props.columnWidths && !e.props.columnPins &&
|
|
451
|
-
|
|
476
|
+
if (d !== c) {
|
|
477
|
+
if (e.props.columnState && !e.props.columnOrder && !e.props.hiddenColumnKeys && !e.props.columnWidths && !e.props.columnPins && B(e.props.columnState) === b) {
|
|
478
|
+
c = d;
|
|
452
479
|
return;
|
|
453
480
|
}
|
|
454
481
|
if (e.props.columnState) {
|
|
455
482
|
o.columns.setOrder(e.props.columnState.order);
|
|
456
|
-
for (const [
|
|
457
|
-
o.columns.setVisibility(
|
|
458
|
-
for (const [
|
|
459
|
-
o.columns.setWidth(
|
|
460
|
-
for (const [
|
|
461
|
-
o.columns.setPin(
|
|
483
|
+
for (const [u, s] of Object.entries(e.props.columnState.visibility))
|
|
484
|
+
o.columns.setVisibility(u, s);
|
|
485
|
+
for (const [u, s] of Object.entries(e.props.columnState.widths))
|
|
486
|
+
o.columns.setWidth(u, X(s));
|
|
487
|
+
for (const [u, s] of Object.entries(e.props.columnState.pins))
|
|
488
|
+
o.columns.setPin(u, s);
|
|
462
489
|
}
|
|
463
490
|
if (e.props.columnOrder && o.columns.setOrder(e.props.columnOrder), e.props.hiddenColumnKeys) {
|
|
464
|
-
const
|
|
465
|
-
for (const
|
|
466
|
-
o.columns.setVisibility(
|
|
491
|
+
const u = new Set(e.props.hiddenColumnKeys), s = o.columns.getSnapshot();
|
|
492
|
+
for (const R of s.columns)
|
|
493
|
+
o.columns.setVisibility(R.key, !u.has(R.key));
|
|
467
494
|
}
|
|
468
495
|
if (e.props.columnWidths)
|
|
469
|
-
for (const [
|
|
470
|
-
o.columns.setWidth(
|
|
496
|
+
for (const [u, s] of Object.entries(e.props.columnWidths))
|
|
497
|
+
o.columns.setWidth(u, X(s));
|
|
471
498
|
if (e.props.columnPins)
|
|
472
|
-
for (const [
|
|
473
|
-
o.columns.setPin(
|
|
474
|
-
|
|
499
|
+
for (const [u, s] of Object.entries(e.props.columnPins))
|
|
500
|
+
o.columns.setPin(u, s);
|
|
501
|
+
c = d;
|
|
475
502
|
}
|
|
476
|
-
},
|
|
503
|
+
}, L = () => {
|
|
477
504
|
const o = e.gridRef.value?.api;
|
|
478
505
|
if (!o || e.props.state == null)
|
|
479
506
|
return;
|
|
480
|
-
const d =
|
|
481
|
-
if (d ===
|
|
507
|
+
const d = B(e.props.state);
|
|
508
|
+
if (d === a)
|
|
482
509
|
return;
|
|
483
|
-
if (d ===
|
|
484
|
-
|
|
510
|
+
if (d === A) {
|
|
511
|
+
a = d;
|
|
485
512
|
return;
|
|
486
513
|
}
|
|
487
|
-
const
|
|
488
|
-
|
|
489
|
-
},
|
|
514
|
+
const u = o.state.migrate(e.props.state, { strict: e.props.stateOptions?.strict });
|
|
515
|
+
u && (o.state.set(u, e.props.stateOptions ?? {}), a = d);
|
|
516
|
+
}, I = () => {
|
|
490
517
|
const o = e.gridRef.value?.api;
|
|
491
518
|
o && (o.view.setRowHeightMode(e.props.rowHeightMode), o.view.setBaseRowHeight(Math.max(24, Math.trunc(e.props.baseRowHeight))));
|
|
492
|
-
},
|
|
519
|
+
}, j = () => {
|
|
493
520
|
const o = e.gridRef.value;
|
|
494
|
-
o && (
|
|
495
|
-
|
|
521
|
+
o && (c = null, a = null, x(), t = o.rowModel.subscribe(() => {
|
|
522
|
+
g();
|
|
496
523
|
}), r = o.columnModel.subscribe(() => {
|
|
497
|
-
|
|
498
|
-
}),
|
|
499
|
-
},
|
|
524
|
+
g();
|
|
525
|
+
}), L(), O(), v(), G(), D(), M(), I(), g(), e.emit.ready({ api: o.api }));
|
|
526
|
+
}, W = () => e.gridRef.value?.api.state.get() ?? null, V = (o, d) => e.gridRef.value?.api.state.migrate(o, d) ?? null, H = (o) => {
|
|
500
527
|
const d = e.gridRef.value?.api;
|
|
501
528
|
if (!d)
|
|
502
529
|
return !1;
|
|
503
|
-
|
|
530
|
+
c = B({
|
|
504
531
|
columnState: o,
|
|
505
532
|
columnOrder: null,
|
|
506
533
|
hiddenColumnKeys: null,
|
|
507
534
|
columnWidths: null,
|
|
508
535
|
columnPins: null
|
|
509
536
|
}), d.columns.setOrder(o.order);
|
|
510
|
-
for (const [
|
|
511
|
-
d.columns.setVisibility(
|
|
512
|
-
for (const [
|
|
513
|
-
d.columns.setWidth(
|
|
514
|
-
for (const [
|
|
515
|
-
d.columns.setPin(
|
|
516
|
-
return
|
|
537
|
+
for (const [u, s] of Object.entries(o.visibility))
|
|
538
|
+
d.columns.setVisibility(u, s);
|
|
539
|
+
for (const [u, s] of Object.entries(o.widths))
|
|
540
|
+
d.columns.setWidth(u, X(s));
|
|
541
|
+
for (const [u, s] of Object.entries(o.pins))
|
|
542
|
+
d.columns.setPin(u, s);
|
|
543
|
+
return g(), !0;
|
|
517
544
|
}, E = (o, d) => {
|
|
518
|
-
const
|
|
519
|
-
if (!
|
|
545
|
+
const u = e.gridRef.value?.api;
|
|
546
|
+
if (!u)
|
|
520
547
|
return !1;
|
|
521
|
-
const s =
|
|
522
|
-
return s ? (
|
|
548
|
+
const s = u.state.migrate(o, { strict: d?.strict });
|
|
549
|
+
return s ? (u.state.set(s, d), a = B(o), g(), !0) : !1;
|
|
523
550
|
}, k = () => e.gridRef.value?.api.pivot.exportLayout() ?? null, N = () => e.gridRef.value?.api.pivot.exportInterop() ?? null, U = (o, d) => {
|
|
524
|
-
const
|
|
525
|
-
return
|
|
526
|
-
},
|
|
527
|
-
e.gridRef.value?.api.rows.expandAllGroups(),
|
|
528
|
-
},
|
|
529
|
-
e.gridRef.value?.api.rows.collapseAllGroups(),
|
|
551
|
+
const u = e.gridRef.value?.api;
|
|
552
|
+
return u ? (u.pivot.importLayout(o, d), g(), !0) : !1;
|
|
553
|
+
}, _ = () => {
|
|
554
|
+
e.gridRef.value?.api.rows.expandAllGroups(), g();
|
|
555
|
+
}, F = () => {
|
|
556
|
+
e.gridRef.value?.api.rows.collapseAllGroups(), g();
|
|
530
557
|
};
|
|
531
|
-
|
|
558
|
+
p(
|
|
532
559
|
() => e.gridRef.value,
|
|
533
560
|
() => {
|
|
534
|
-
|
|
561
|
+
j();
|
|
535
562
|
},
|
|
536
563
|
{ immediate: !0 }
|
|
537
|
-
),
|
|
564
|
+
), p(
|
|
538
565
|
() => e.props.columns,
|
|
539
566
|
() => {
|
|
540
|
-
|
|
567
|
+
c = null, a = null, L(), O(), g();
|
|
541
568
|
},
|
|
542
569
|
{ deep: !0 }
|
|
543
|
-
),
|
|
570
|
+
), p(
|
|
544
571
|
() => [e.props.state, e.props.stateOptions],
|
|
545
572
|
() => {
|
|
546
|
-
|
|
573
|
+
L(), O(), v(), G(), D(), M(), I(), g();
|
|
547
574
|
},
|
|
548
575
|
{ deep: !0 }
|
|
549
|
-
),
|
|
576
|
+
), p(
|
|
550
577
|
() => [
|
|
551
578
|
e.props.columnState,
|
|
552
579
|
e.props.columnOrder,
|
|
@@ -555,61 +582,61 @@ function _e(e) {
|
|
|
555
582
|
e.props.columnPins
|
|
556
583
|
],
|
|
557
584
|
() => {
|
|
558
|
-
|
|
585
|
+
O(), g();
|
|
559
586
|
},
|
|
560
587
|
{ deep: !0 }
|
|
561
|
-
),
|
|
588
|
+
), p(
|
|
562
589
|
() => [e.props.sortModel, e.props.filterModel],
|
|
563
590
|
() => {
|
|
564
|
-
|
|
591
|
+
v(), g();
|
|
565
592
|
},
|
|
566
593
|
{ deep: !0 }
|
|
567
|
-
),
|
|
594
|
+
), p(
|
|
568
595
|
() => e.props.groupBy,
|
|
569
596
|
() => {
|
|
570
|
-
|
|
597
|
+
G(), g();
|
|
571
598
|
},
|
|
572
599
|
{ deep: !0 }
|
|
573
|
-
),
|
|
600
|
+
), p(
|
|
574
601
|
() => e.props.aggregationModel,
|
|
575
602
|
() => {
|
|
576
|
-
|
|
603
|
+
D(), g();
|
|
577
604
|
},
|
|
578
605
|
{ deep: !0 }
|
|
579
|
-
),
|
|
606
|
+
), p(
|
|
580
607
|
() => e.props.pivotModel,
|
|
581
608
|
() => {
|
|
582
|
-
|
|
609
|
+
M(), g();
|
|
583
610
|
},
|
|
584
611
|
{ deep: !0 }
|
|
585
|
-
),
|
|
612
|
+
), p(
|
|
586
613
|
() => [e.props.rowHeightMode, e.props.baseRowHeight],
|
|
587
614
|
() => {
|
|
588
|
-
|
|
615
|
+
I(), g();
|
|
589
616
|
}
|
|
590
617
|
);
|
|
591
|
-
const
|
|
592
|
-
|
|
618
|
+
const K = () => {
|
|
619
|
+
x();
|
|
593
620
|
};
|
|
594
|
-
return
|
|
595
|
-
|
|
621
|
+
return ee(() => {
|
|
622
|
+
K();
|
|
596
623
|
}), {
|
|
597
|
-
emitSnapshotUpdates:
|
|
598
|
-
handleGridReady:
|
|
599
|
-
dispose:
|
|
600
|
-
getColumnState:
|
|
601
|
-
getState:
|
|
602
|
-
migrateState:
|
|
624
|
+
emitSnapshotUpdates: g,
|
|
625
|
+
handleGridReady: j,
|
|
626
|
+
dispose: K,
|
|
627
|
+
getColumnState: P,
|
|
628
|
+
getState: W,
|
|
629
|
+
migrateState: V,
|
|
603
630
|
applyColumnState: H,
|
|
604
631
|
applyState: E,
|
|
605
632
|
exportPivotLayout: k,
|
|
606
633
|
exportPivotInterop: N,
|
|
607
634
|
importPivotLayout: U,
|
|
608
|
-
expandAllGroups:
|
|
609
|
-
collapseAllGroups:
|
|
635
|
+
expandAllGroups: _,
|
|
636
|
+
collapseAllGroups: F
|
|
610
637
|
};
|
|
611
638
|
}
|
|
612
|
-
function
|
|
639
|
+
function Qe() {
|
|
613
640
|
return {
|
|
614
641
|
name: "selection",
|
|
615
642
|
getRowSelectionSnapshot: () => null,
|
|
@@ -632,15 +659,15 @@ function Je() {
|
|
|
632
659
|
}
|
|
633
660
|
};
|
|
634
661
|
}
|
|
635
|
-
function
|
|
662
|
+
function z(e, t) {
|
|
636
663
|
const r = t.map((n) => n?.[e]).filter((n) => typeof n == "function");
|
|
637
664
|
if (r.length !== 0)
|
|
638
665
|
return async (n) => {
|
|
639
|
-
for (const
|
|
640
|
-
await
|
|
666
|
+
for (const c of r)
|
|
667
|
+
await c(n);
|
|
641
668
|
};
|
|
642
669
|
}
|
|
643
|
-
function
|
|
670
|
+
function Xe(e) {
|
|
644
671
|
const {
|
|
645
672
|
userSelectionService: t,
|
|
646
673
|
cellSelectionService: r,
|
|
@@ -648,10 +675,10 @@ function $e(e) {
|
|
|
648
675
|
} = e;
|
|
649
676
|
return {
|
|
650
677
|
name: "selection",
|
|
651
|
-
init:
|
|
652
|
-
start:
|
|
653
|
-
stop:
|
|
654
|
-
dispose:
|
|
678
|
+
init: z("init", [t, r, n]),
|
|
679
|
+
start: z("start", [t, r, n]),
|
|
680
|
+
stop: z("stop", [t, r, n]),
|
|
681
|
+
dispose: z("dispose", [t, r, n]),
|
|
655
682
|
getSelectionSnapshot: r.getSelectionSnapshot,
|
|
656
683
|
setSelectionSnapshot: r.setSelectionSnapshot,
|
|
657
684
|
clearSelection: r.clearSelection,
|
|
@@ -668,7 +695,7 @@ function $e(e) {
|
|
|
668
695
|
clearSelectedRows: n.clearSelectedRows
|
|
669
696
|
};
|
|
670
697
|
}
|
|
671
|
-
const
|
|
698
|
+
const Ye = ue({
|
|
672
699
|
name: "DataGrid",
|
|
673
700
|
inheritAttrs: !1,
|
|
674
701
|
props: {
|
|
@@ -828,6 +855,18 @@ const qe = ae({
|
|
|
828
855
|
type: Number,
|
|
829
856
|
default: 31
|
|
830
857
|
},
|
|
858
|
+
layoutMode: {
|
|
859
|
+
type: String,
|
|
860
|
+
default: "fill"
|
|
861
|
+
},
|
|
862
|
+
minRows: {
|
|
863
|
+
type: Number,
|
|
864
|
+
default: void 0
|
|
865
|
+
},
|
|
866
|
+
maxRows: {
|
|
867
|
+
type: Number,
|
|
868
|
+
default: void 0
|
|
869
|
+
},
|
|
831
870
|
rowHover: {
|
|
832
871
|
type: Boolean,
|
|
833
872
|
default: !1
|
|
@@ -863,19 +902,19 @@ const qe = ae({
|
|
|
863
902
|
"update:state",
|
|
864
903
|
"ready"
|
|
865
904
|
],
|
|
866
|
-
setup(e, { attrs: t, slots: r, emit: n, expose:
|
|
867
|
-
const
|
|
905
|
+
setup(e, { attrs: t, slots: r, emit: n, expose: c }) {
|
|
906
|
+
const a = Y(null), y = Y("table"), i = f(() => Te(e.renderMode, e.pagination)), h = f(() => ze(
|
|
868
907
|
e.pagination,
|
|
869
|
-
|
|
908
|
+
i.value,
|
|
870
909
|
e.pageSize,
|
|
871
910
|
e.currentPage
|
|
872
|
-
)), b =
|
|
911
|
+
)), b = f(() => Re(e.columnMenu)), A = f(() => be(e.cellMenu)), x = f(() => Me(e.rowIndexMenu)), P = f(() => Ne(e.columnLayout)), g = f(() => Ue(e.aggregations)), v = f(() => We(e.advancedFilter)), G = f(() => Fe(e.groupBy)), D = f(() => _e(e.virtualization, i.value)), M = f(() => Ve(e.layoutMode, e.minRows, e.maxRows)), O = f(() => Oe({
|
|
873
912
|
columns: e.columns,
|
|
874
913
|
clientRowModelOptions: e.clientRowModelOptions,
|
|
875
914
|
computedFields: e.computedFields,
|
|
876
915
|
formulas: e.formulas,
|
|
877
916
|
formulaFunctions: e.formulaFunctions
|
|
878
|
-
})),
|
|
917
|
+
})), L = f(() => Be(e.columns)), I = {
|
|
879
918
|
get state() {
|
|
880
919
|
return e.state;
|
|
881
920
|
},
|
|
@@ -904,7 +943,7 @@ const qe = ae({
|
|
|
904
943
|
return e.filterModel;
|
|
905
944
|
},
|
|
906
945
|
get groupBy() {
|
|
907
|
-
return
|
|
946
|
+
return G.value;
|
|
908
947
|
},
|
|
909
948
|
get aggregationModel() {
|
|
910
949
|
return e.aggregationModel;
|
|
@@ -921,44 +960,44 @@ const qe = ae({
|
|
|
921
960
|
get columns() {
|
|
922
961
|
return e.columns;
|
|
923
962
|
}
|
|
924
|
-
},
|
|
925
|
-
mode:
|
|
926
|
-
resolveRuntime: () =>
|
|
927
|
-
visibleColumns:
|
|
963
|
+
}, j = f(() => e.pivotModel ? "pivot" : O.value && "initialTreeData" in O.value ? "tree" : "base"), W = f(() => a.value?.api.columns.getSnapshot().visibleColumns ?? []), V = f(() => a.value?.api.rows.getCount() ?? 0), H = {
|
|
964
|
+
mode: f(() => j.value),
|
|
965
|
+
resolveRuntime: () => a.value,
|
|
966
|
+
visibleColumns: W,
|
|
928
967
|
totalRows: V,
|
|
929
|
-
showRowSelection:
|
|
968
|
+
showRowSelection: f(() => e.rowSelection)
|
|
930
969
|
}, {
|
|
931
|
-
selectionSnapshot:
|
|
932
|
-
selectionAnchor:
|
|
933
|
-
syncSelectionSnapshotFromRuntime:
|
|
934
|
-
selectionService:
|
|
935
|
-
selectionAggregatesLabel:
|
|
936
|
-
} =
|
|
937
|
-
rowSelectionSnapshot:
|
|
970
|
+
selectionSnapshot: E,
|
|
971
|
+
selectionAnchor: k,
|
|
972
|
+
syncSelectionSnapshotFromRuntime: N,
|
|
973
|
+
selectionService: U,
|
|
974
|
+
selectionAggregatesLabel: _
|
|
975
|
+
} = Se(H), {
|
|
976
|
+
rowSelectionSnapshot: F,
|
|
938
977
|
syncRowSelectionSnapshotFromRuntime: K,
|
|
939
|
-
reconcileRowSelectionFromRuntime:
|
|
940
|
-
selectionService:
|
|
941
|
-
} =
|
|
942
|
-
resolveRuntime: () =>
|
|
943
|
-
}),
|
|
978
|
+
reconcileRowSelectionFromRuntime: o,
|
|
979
|
+
selectionService: d
|
|
980
|
+
} = he({
|
|
981
|
+
resolveRuntime: () => a.value
|
|
982
|
+
}), u = f(() => e.rowSelection ? d : Qe()), s = f(() => ({
|
|
944
983
|
...e.services ?? {},
|
|
945
|
-
selection:
|
|
984
|
+
selection: Xe({
|
|
946
985
|
userSelectionService: e.services?.selection,
|
|
947
|
-
cellSelectionService:
|
|
948
|
-
rowSelectionService:
|
|
986
|
+
cellSelectionService: U,
|
|
987
|
+
rowSelectionService: u.value
|
|
949
988
|
})
|
|
950
989
|
})), {
|
|
951
|
-
dataGridInstanceKey:
|
|
990
|
+
dataGridInstanceKey: R,
|
|
952
991
|
resolvedRowModel: S
|
|
953
|
-
} =
|
|
954
|
-
rows:
|
|
955
|
-
rowModel:
|
|
992
|
+
} = Ae({
|
|
993
|
+
rows: oe(e, "rows"),
|
|
994
|
+
rowModel: oe(e, "rowModel"),
|
|
956
995
|
clientRowModelOptions: O,
|
|
957
996
|
onOwnedRowModelRecreated: () => {
|
|
958
|
-
|
|
997
|
+
w.dispose();
|
|
959
998
|
}
|
|
960
|
-
}),
|
|
961
|
-
gridRef:
|
|
999
|
+
}), w = qe({
|
|
1000
|
+
gridRef: a,
|
|
962
1001
|
props: I,
|
|
963
1002
|
emit: {
|
|
964
1003
|
columnState: (l) => n("update:columnState", l),
|
|
@@ -973,127 +1012,131 @@ const qe = ae({
|
|
|
973
1012
|
rowModel: S.value
|
|
974
1013
|
})
|
|
975
1014
|
}
|
|
976
|
-
}),
|
|
977
|
-
|
|
978
|
-
},
|
|
1015
|
+
}), ce = (l) => {
|
|
1016
|
+
o(), n("cell-change", l), w.emitSnapshotUpdates();
|
|
1017
|
+
}, me = (l) => {
|
|
979
1018
|
n("selection-change", l);
|
|
980
1019
|
};
|
|
981
|
-
|
|
982
|
-
|
|
1020
|
+
p(
|
|
1021
|
+
F,
|
|
983
1022
|
(l) => {
|
|
984
1023
|
n("row-select", l);
|
|
985
1024
|
},
|
|
986
1025
|
{ deep: !0 }
|
|
987
|
-
),
|
|
1026
|
+
), p(
|
|
988
1027
|
() => e.rowSelection,
|
|
989
1028
|
(l) => {
|
|
990
1029
|
if (l) {
|
|
991
1030
|
K();
|
|
992
1031
|
return;
|
|
993
1032
|
}
|
|
994
|
-
|
|
1033
|
+
d.clearRowSelection?.();
|
|
995
1034
|
},
|
|
996
1035
|
{ immediate: !0 }
|
|
997
|
-
),
|
|
1036
|
+
), p(
|
|
998
1037
|
() => e.viewMode,
|
|
999
1038
|
(l) => {
|
|
1000
|
-
|
|
1039
|
+
y.value = l === "gantt" ? "gantt" : "table";
|
|
1001
1040
|
},
|
|
1002
1041
|
{ immediate: !0 }
|
|
1003
1042
|
);
|
|
1004
|
-
const
|
|
1043
|
+
const te = (l) => {
|
|
1005
1044
|
const m = l === "gantt" ? "gantt" : "table";
|
|
1006
|
-
|
|
1007
|
-
},
|
|
1008
|
-
const l =
|
|
1045
|
+
y.value = m, n("update:viewMode", m);
|
|
1046
|
+
}, fe = () => {
|
|
1047
|
+
const l = w.getState();
|
|
1009
1048
|
return l ? {
|
|
1010
1049
|
state: l,
|
|
1011
|
-
viewMode:
|
|
1050
|
+
viewMode: y.value
|
|
1012
1051
|
} : null;
|
|
1013
|
-
},
|
|
1014
|
-
return
|
|
1015
|
-
|
|
1016
|
-
}),
|
|
1017
|
-
grid:
|
|
1052
|
+
}, ge = (l, m) => de(l, w.migrateState, m), ve = (l, m) => w.applyState(l.state, m) ? (l.viewMode && te(l.viewMode), !0) : !1;
|
|
1053
|
+
return ee(() => {
|
|
1054
|
+
w.dispose();
|
|
1055
|
+
}), c({
|
|
1056
|
+
grid: a,
|
|
1018
1057
|
rowModel: S,
|
|
1019
|
-
getApi: () =>
|
|
1020
|
-
getRuntime: () =>
|
|
1021
|
-
getCore: () =>
|
|
1022
|
-
getColumnState: () =>
|
|
1023
|
-
getColumnSnapshot: () =>
|
|
1024
|
-
getSelectionAggregatesLabel: () =>
|
|
1025
|
-
getSelectionSummary: () =>
|
|
1026
|
-
getView: () =>
|
|
1027
|
-
setView:
|
|
1028
|
-
getSavedView:
|
|
1029
|
-
migrateSavedView:
|
|
1030
|
-
applySavedView:
|
|
1031
|
-
applyColumnState:
|
|
1032
|
-
getState:
|
|
1033
|
-
migrateState:
|
|
1034
|
-
applyState:
|
|
1035
|
-
exportPivotLayout:
|
|
1036
|
-
exportPivotInterop:
|
|
1037
|
-
importPivotLayout:
|
|
1038
|
-
expandAllGroups:
|
|
1039
|
-
collapseAllGroups:
|
|
1040
|
-
insertRowsAt: (l, m) =>
|
|
1041
|
-
insertRowBefore: (l, m) =>
|
|
1042
|
-
insertRowAfter: (l, m) =>
|
|
1043
|
-
insertColumnsAt: (l, m) =>
|
|
1044
|
-
insertColumnBefore: (l, m) =>
|
|
1045
|
-
insertColumnAfter: (l, m) =>
|
|
1058
|
+
getApi: () => a.value?.api ?? null,
|
|
1059
|
+
getRuntime: () => a.value?.runtime ?? null,
|
|
1060
|
+
getCore: () => a.value?.core ?? null,
|
|
1061
|
+
getColumnState: () => w.getColumnState(),
|
|
1062
|
+
getColumnSnapshot: () => a.value?.api.columns.getSnapshot() ?? null,
|
|
1063
|
+
getSelectionAggregatesLabel: () => _.value,
|
|
1064
|
+
getSelectionSummary: () => a.value?.api.selection.summarize() ?? null,
|
|
1065
|
+
getView: () => y.value,
|
|
1066
|
+
setView: te,
|
|
1067
|
+
getSavedView: fe,
|
|
1068
|
+
migrateSavedView: ge,
|
|
1069
|
+
applySavedView: ve,
|
|
1070
|
+
applyColumnState: w.applyColumnState,
|
|
1071
|
+
getState: w.getState,
|
|
1072
|
+
migrateState: w.migrateState,
|
|
1073
|
+
applyState: w.applyState,
|
|
1074
|
+
exportPivotLayout: w.exportPivotLayout,
|
|
1075
|
+
exportPivotInterop: w.exportPivotInterop,
|
|
1076
|
+
importPivotLayout: w.importPivotLayout,
|
|
1077
|
+
expandAllGroups: w.expandAllGroups,
|
|
1078
|
+
collapseAllGroups: w.collapseAllGroups,
|
|
1079
|
+
insertRowsAt: (l, m) => a.value?.api.rows.insertDataAt(l, m) ?? !1,
|
|
1080
|
+
insertRowBefore: (l, m) => a.value?.api.rows.insertDataBefore(l, m) ?? !1,
|
|
1081
|
+
insertRowAfter: (l, m) => a.value?.api.rows.insertDataAfter(l, m) ?? !1,
|
|
1082
|
+
insertColumnsAt: (l, m) => a.value?.api.columns.insertAt(l, m) ?? !1,
|
|
1083
|
+
insertColumnBefore: (l, m) => a.value?.api.columns.insertBefore(l, m) ?? !1,
|
|
1084
|
+
insertColumnAfter: (l, m) => a.value?.api.columns.insertAfter(l, m) ?? !1
|
|
1046
1085
|
}), () => {
|
|
1047
1086
|
const l = {
|
|
1048
|
-
mode:
|
|
1087
|
+
mode: j.value,
|
|
1049
1088
|
rows: e.rows,
|
|
1050
|
-
runtime:
|
|
1051
|
-
runtimeRowModel:
|
|
1052
|
-
selectionSnapshot:
|
|
1053
|
-
selectionAnchor:
|
|
1054
|
-
rowSelectionSnapshot:
|
|
1055
|
-
syncSelectionSnapshotFromRuntime:
|
|
1089
|
+
runtime: a.value?.runtime ?? null,
|
|
1090
|
+
runtimeRowModel: a.value?.rowModel ?? null,
|
|
1091
|
+
selectionSnapshot: E,
|
|
1092
|
+
selectionAnchor: k,
|
|
1093
|
+
rowSelectionSnapshot: F,
|
|
1094
|
+
syncSelectionSnapshotFromRuntime: N,
|
|
1056
1095
|
syncRowSelectionSnapshotFromRuntime: K,
|
|
1057
1096
|
sortModel: e.sortModel,
|
|
1058
1097
|
filterModel: e.filterModel,
|
|
1059
|
-
groupBy:
|
|
1098
|
+
groupBy: G.value,
|
|
1060
1099
|
pivotModel: e.pivotModel,
|
|
1061
|
-
renderMode:
|
|
1062
|
-
virtualization:
|
|
1100
|
+
renderMode: i.value,
|
|
1101
|
+
virtualization: D.value,
|
|
1063
1102
|
columnMenu: b.value,
|
|
1064
|
-
cellMenu:
|
|
1065
|
-
rowIndexMenu:
|
|
1066
|
-
columnLayout:
|
|
1067
|
-
aggregations:
|
|
1068
|
-
advancedFilter:
|
|
1103
|
+
cellMenu: A.value,
|
|
1104
|
+
rowIndexMenu: x.value,
|
|
1105
|
+
columnLayout: P.value,
|
|
1106
|
+
aggregations: g.value,
|
|
1107
|
+
advancedFilter: v.value,
|
|
1069
1108
|
rowHeightMode: e.rowHeightMode,
|
|
1070
1109
|
baseRowHeight: e.baseRowHeight,
|
|
1110
|
+
layoutMode: M.value.layoutMode,
|
|
1111
|
+
minRows: M.value.minRows,
|
|
1112
|
+
maxRows: M.value.maxRows,
|
|
1071
1113
|
rowHover: e.rowHover,
|
|
1072
1114
|
stripedRows: e.stripedRows,
|
|
1073
1115
|
isCellEditable: e.isCellEditable,
|
|
1074
1116
|
showRowIndex: e.showRowIndex,
|
|
1075
1117
|
rowSelection: e.rowSelection,
|
|
1076
|
-
viewMode:
|
|
1118
|
+
viewMode: y.value,
|
|
1077
1119
|
gantt: e.gantt
|
|
1078
1120
|
};
|
|
1079
|
-
return
|
|
1080
|
-
|
|
1121
|
+
return Z(
|
|
1122
|
+
Je,
|
|
1081
1123
|
{
|
|
1082
1124
|
...t,
|
|
1083
|
-
ref:
|
|
1084
|
-
key:
|
|
1125
|
+
ref: a,
|
|
1126
|
+
key: R.value,
|
|
1085
1127
|
rows: e.rows,
|
|
1086
1128
|
rowModel: S.value,
|
|
1087
|
-
columns:
|
|
1129
|
+
columns: L.value,
|
|
1088
1130
|
theme: e.theme,
|
|
1089
|
-
|
|
1131
|
+
layoutMode: M.value.layoutMode,
|
|
1132
|
+
renderMode: i.value,
|
|
1090
1133
|
pagination: h.value,
|
|
1091
1134
|
plugins: e.plugins,
|
|
1092
|
-
services:
|
|
1135
|
+
services: s.value,
|
|
1093
1136
|
startupOrder: e.startupOrder,
|
|
1094
1137
|
autoStart: e.autoStart,
|
|
1095
|
-
onCellChange:
|
|
1096
|
-
onSelectionChange:
|
|
1138
|
+
onCellChange: ce,
|
|
1139
|
+
onSelectionChange: me
|
|
1097
1140
|
},
|
|
1098
1141
|
r.default ? {
|
|
1099
1142
|
default: (m) => r.default?.({
|
|
@@ -1105,7 +1148,7 @@ const qe = ae({
|
|
|
1105
1148
|
}
|
|
1106
1149
|
})
|
|
1107
1150
|
} : {
|
|
1108
|
-
default: (m) =>
|
|
1151
|
+
default: (m) => Z(Ce, {
|
|
1109
1152
|
...l,
|
|
1110
1153
|
runtime: m.runtime,
|
|
1111
1154
|
runtimeRowModel: m.rowModel
|
|
@@ -1114,14 +1157,14 @@ const qe = ae({
|
|
|
1114
1157
|
);
|
|
1115
1158
|
};
|
|
1116
1159
|
}
|
|
1117
|
-
}),
|
|
1160
|
+
}), st = Ye;
|
|
1118
1161
|
export {
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1162
|
+
st as DataGrid,
|
|
1163
|
+
ut as clearDataGridSavedViewInStorage,
|
|
1164
|
+
Ye as default,
|
|
1165
|
+
de as migrateDataGridSavedView,
|
|
1166
|
+
ke as parseDataGridSavedView,
|
|
1167
|
+
it as readDataGridSavedViewFromStorage,
|
|
1168
|
+
Ee as serializeDataGridSavedView,
|
|
1169
|
+
at as writeDataGridSavedViewToStorage
|
|
1127
1170
|
};
|