@affino/datagrid-vue-app 0.1.7 → 0.1.8
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 +18 -0
- package/dist/chunks/{DataGridGanttStage.vue_vue_type_script_setup_true_lang-DiaL9sUh.js → DataGridGanttStage.vue_vue_type_script_setup_true_lang-BYUAjngz.js} +1 -1
- package/dist/chunks/{DataGridGanttStageEntry-B8Ghe1BD.js → DataGridGanttStageEntry-CaMj_sad.js} +1 -1
- package/dist/chunks/{DataGridTableStage.vue_vue_type_script_setup_true_lang-Bb5ixAcf.js → DataGridTableStage.vue_vue_type_script_setup_true_lang-l1nn1PNS.js} +126 -122
- package/dist/chunks/{useDataGridAppRowModel-BX3O48Yb.js → useDataGridAppRowModel-D_G_3vas.js} +301 -285
- package/dist/gantt.js +1 -1
- package/dist/host/DataGridDefaultRenderer.d.ts +18 -0
- package/dist/index.js +24 -14
- package/dist/internal.js +3 -3
- package/dist/stage/dataGridTableStage.types.d.ts +2 -0
- package/dist/stage/useDataGridTableStageRuntime.d.ts +2 -0
- package/package.json +3 -3
package/dist/chunks/{useDataGridAppRowModel-BX3O48Yb.js → useDataGridAppRowModel-D_G_3vas.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as Fn, h as k, computed as
|
|
1
|
+
import { defineComponent as Fn, h as k, computed as m, unref as c, ref as P, nextTick as Dn, onBeforeUnmount as En, watch as L, defineAsyncComponent as gt, shallowRef as _n } from "vue";
|
|
2
2
|
import { resolveDataGridCellClickAction as Gn, toggleDataGridCellValue as Pn, buildDataGridCellRenderModel as Ln, useDataGridContextMenu as Wn, cloneDataGridFilterSnapshot as Nn, createClientRowModel as un } from "@affino/datagrid-vue";
|
|
3
3
|
import { useDataGridAppIntentHistory as Kn, createDataGridAppRowHeightMetrics as $n, useDataGridAppViewport as Un, useDataGridAppRowSizing as qn, useDataGridAppCellSelection as Xn, useDataGridAppRowPresentation as Yn, useDataGridAppClipboard as Jn, useDataGridAppActiveCellViewport as Zn, useDataGridAppInlineEditing as Qn, useDataGridAppInteractionController as el, useDataGridAppHeaderResize as tl, useDataGridAppRuntimeSync as nl, useDataGridAppViewportLifecycle as ll, useDataGridAppColumnLayoutPanel as ol, useDataGridAppAdvancedFilterBuilder as rl } from "@affino/datagrid-vue/app";
|
|
4
|
-
import { useDataGridViewportContextMenuRouter as
|
|
5
|
-
import { c as ul, _ as cl } from "./DataGridTableStage.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { useDataGridViewportContextMenuRouter as al, useDataGridContextMenuAnchor as il, useDataGridContextMenuActionRouter as sl } from "@affino/datagrid-vue/advanced";
|
|
5
|
+
import { c as ul, _ as cl } from "./DataGridTableStage.vue_vue_type_script_setup_true_lang-l1nn1PNS.js";
|
|
6
6
|
const dl = Fn({
|
|
7
7
|
name: "DataGridModuleHost",
|
|
8
8
|
props: {
|
|
@@ -65,13 +65,13 @@ function zn(e) {
|
|
|
65
65
|
if (!e)
|
|
66
66
|
return Object.freeze({});
|
|
67
67
|
const o = Object.entries(e).filter(([r, l]) => kn.includes(r) && !!l).map(([r, l]) => {
|
|
68
|
-
const s = l,
|
|
68
|
+
const s = l, i = {
|
|
69
69
|
...s.hidden === !0 ? { hidden: !0 } : {},
|
|
70
70
|
...s.disabled === !0 ? { disabled: !0 } : {},
|
|
71
71
|
...typeof s.disabledReason == "string" && s.disabledReason.trim().length > 0 ? { disabledReason: s.disabledReason.trim() } : {},
|
|
72
72
|
...typeof s.label == "string" && s.label.trim().length > 0 ? { label: s.label.trim() } : {}
|
|
73
73
|
};
|
|
74
|
-
return [r, Object.freeze(
|
|
74
|
+
return [r, Object.freeze(i)];
|
|
75
75
|
}).filter(([, r]) => Object.keys(r).length > 0);
|
|
76
76
|
return Object.freeze(Object.fromEntries(o));
|
|
77
77
|
}
|
|
@@ -79,12 +79,12 @@ function ml(e) {
|
|
|
79
79
|
if (!e)
|
|
80
80
|
return {};
|
|
81
81
|
const o = Object.entries(e).filter(([r]) => r.trim().length > 0).map(([r, l]) => {
|
|
82
|
-
const s = l?.items ? bn(l.items) : void 0,
|
|
82
|
+
const s = l?.items ? bn(l.items) : void 0, i = fn(l?.hide), f = fn(l?.disabled), C = Vn(l?.disabledReasons), y = Hn(l?.labels), A = zn(l?.actions);
|
|
83
83
|
return [
|
|
84
84
|
r,
|
|
85
85
|
{
|
|
86
86
|
...s ? { items: s } : {},
|
|
87
|
-
...
|
|
87
|
+
...i.length > 0 ? { hide: i } : {},
|
|
88
88
|
...f.length > 0 ? { disabled: f } : {},
|
|
89
89
|
...Object.keys(C).length > 0 ? { disabledReasons: C } : {},
|
|
90
90
|
...Object.keys(y).length > 0 ? { labels: y } : {},
|
|
@@ -125,12 +125,12 @@ function bo(e) {
|
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
function Tn(e, o) {
|
|
128
|
-
const r = e.columns[o], l = r?.items ? bn(r.items) : e.items, s = new Set(r?.hide ?? []),
|
|
129
|
-
return
|
|
128
|
+
const r = e.columns[o], l = r?.items ? bn(r.items) : e.items, s = new Set(r?.hide ?? []), i = l.filter((f) => !s.has(f));
|
|
129
|
+
return i.length > 0 ? i : [];
|
|
130
130
|
}
|
|
131
131
|
function wl(e, o) {
|
|
132
132
|
const r = Tn(e, o), l = new Set(e.columns[o]?.disabled ?? []), s = new Set(e.disabled);
|
|
133
|
-
return r.filter((
|
|
133
|
+
return r.filter((i) => s.has(i) || l.has(i));
|
|
134
134
|
}
|
|
135
135
|
function fl(e, o) {
|
|
136
136
|
return Object.freeze({
|
|
@@ -146,11 +146,11 @@ function gl(e, o) {
|
|
|
146
146
|
}
|
|
147
147
|
function Cl(e, o) {
|
|
148
148
|
const r = e.columns[o]?.actions ?? {}, l = kn.map((s) => {
|
|
149
|
-
const
|
|
149
|
+
const i = {
|
|
150
150
|
...e.actions[s] ?? {},
|
|
151
151
|
...r[s] ?? {}
|
|
152
152
|
};
|
|
153
|
-
return [s, Object.freeze(
|
|
153
|
+
return [s, Object.freeze(i)];
|
|
154
154
|
}).filter(([, s]) => Object.keys(s).length > 0);
|
|
155
155
|
return Object.freeze(Object.fromEntries(l));
|
|
156
156
|
}
|
|
@@ -164,8 +164,8 @@ const B = ["clipboard", "edit"], yn = ["cut", "copy", "paste", "clear"], Ce = ["
|
|
|
164
164
|
];
|
|
165
165
|
function Ct(e, o) {
|
|
166
166
|
const r = new Set(o), l = Array.isArray(e) ? e : o, s = [];
|
|
167
|
-
for (const
|
|
168
|
-
!r.has(
|
|
167
|
+
for (const i of l)
|
|
168
|
+
!r.has(i) || s.includes(i) || s.push(i);
|
|
169
169
|
return s.length > 0 ? s : [...o];
|
|
170
170
|
}
|
|
171
171
|
function ft(e, o) {
|
|
@@ -186,11 +186,11 @@ function Rn(e, o) {
|
|
|
186
186
|
if (!e)
|
|
187
187
|
return Object.freeze({});
|
|
188
188
|
const r = Object.entries(e).filter(([l, s]) => o.includes(l) && !!s).map(([l, s]) => {
|
|
189
|
-
const
|
|
190
|
-
...
|
|
191
|
-
...
|
|
192
|
-
...typeof
|
|
193
|
-
...typeof
|
|
189
|
+
const i = s, f = {
|
|
190
|
+
...i.hidden === !0 ? { hidden: !0 } : {},
|
|
191
|
+
...i.disabled === !0 ? { disabled: !0 } : {},
|
|
192
|
+
...typeof i.disabledReason == "string" && i.disabledReason.trim().length > 0 ? { disabledReason: i.disabledReason.trim() } : {},
|
|
193
|
+
...typeof i.label == "string" && i.label.trim().length > 0 ? { label: i.label.trim() } : {}
|
|
194
194
|
};
|
|
195
195
|
return [l, Object.freeze(f)];
|
|
196
196
|
}).filter(([, l]) => Object.keys(l).length > 0);
|
|
@@ -200,12 +200,12 @@ function vl(e) {
|
|
|
200
200
|
if (!e)
|
|
201
201
|
return {};
|
|
202
202
|
const o = Object.entries(e).filter(([r]) => r.trim().length > 0).map(([r, l]) => {
|
|
203
|
-
const s = l?.items ? Ct(l.items, B) : void 0,
|
|
203
|
+
const s = l?.items ? Ct(l.items, B) : void 0, i = ft(l?.hide, B), f = ft(l?.disabled, B), C = ve(l?.disabledReasons, B), y = ve(l?.labels, B), A = Rn(l?.actions, yn);
|
|
204
204
|
return [
|
|
205
205
|
r,
|
|
206
206
|
{
|
|
207
207
|
...s ? { items: s } : {},
|
|
208
|
-
...
|
|
208
|
+
...i.length > 0 ? { hide: i } : {},
|
|
209
209
|
...f.length > 0 ? { disabled: f } : {},
|
|
210
210
|
...Object.keys(C).length > 0 ? { disabledReasons: C } : {},
|
|
211
211
|
...Object.keys(y).length > 0 ? { labels: y } : {},
|
|
@@ -243,12 +243,12 @@ function yo(e) {
|
|
|
243
243
|
};
|
|
244
244
|
}
|
|
245
245
|
function wt(e, o) {
|
|
246
|
-
const r = e.columns[o], l = r?.items ? Ct(r.items, B) : e.items, s = new Set(r?.hide ?? []),
|
|
247
|
-
return
|
|
246
|
+
const r = e.columns[o], l = r?.items ? Ct(r.items, B) : e.items, s = new Set(r?.hide ?? []), i = l.filter((f) => !s.has(f));
|
|
247
|
+
return i.length > 0 ? i : [];
|
|
248
248
|
}
|
|
249
249
|
function hl(e, o) {
|
|
250
250
|
const r = wt(e, o), l = new Set(e.columns[o]?.disabled ?? []), s = new Set(e.disabled);
|
|
251
|
-
return r.filter((
|
|
251
|
+
return r.filter((i) => s.has(i) || l.has(i));
|
|
252
252
|
}
|
|
253
253
|
function bl(e, o) {
|
|
254
254
|
return Object.freeze({
|
|
@@ -258,11 +258,11 @@ function bl(e, o) {
|
|
|
258
258
|
}
|
|
259
259
|
function yl(e, o) {
|
|
260
260
|
const r = e.columns[o]?.actions ?? {}, l = yn.map((s) => {
|
|
261
|
-
const
|
|
261
|
+
const i = {
|
|
262
262
|
...e.actions[s] ?? {},
|
|
263
263
|
...r[s] ?? {}
|
|
264
264
|
};
|
|
265
|
-
return [s, Object.freeze(
|
|
265
|
+
return [s, Object.freeze(i)];
|
|
266
266
|
}).filter(([, s]) => Object.keys(s).length > 0);
|
|
267
267
|
return Object.freeze(Object.fromEntries(l));
|
|
268
268
|
}
|
|
@@ -311,14 +311,14 @@ function Sn(e) {
|
|
|
311
311
|
function Il(e) {
|
|
312
312
|
const o = Sn(e.headerViewportRef), r = Sn(e.bodyViewportRef), l = (g) => {
|
|
313
313
|
e.editingCellValueRef.value = g;
|
|
314
|
-
}, s =
|
|
314
|
+
}, s = m(() => ({
|
|
315
315
|
gridContentStyle: c(e.gridContentStyle),
|
|
316
316
|
mainTrackStyle: c(e.mainTrackStyle),
|
|
317
317
|
indexColumnStyle: c(e.indexColumnStyle),
|
|
318
318
|
stageStyle: c(e.stageStyle),
|
|
319
319
|
bodyShellStyle: c(e.bodyShellStyle),
|
|
320
320
|
columnStyle: c(e.columnStyle)
|
|
321
|
-
})),
|
|
321
|
+
})), i = m(() => ({
|
|
322
322
|
topSpacerHeight: c(e.topSpacerHeight),
|
|
323
323
|
bottomSpacerHeight: c(e.bottomSpacerHeight),
|
|
324
324
|
viewportRowStart: c(e.viewportRowStart),
|
|
@@ -331,7 +331,7 @@ function Il(e) {
|
|
|
331
331
|
handleHeaderScroll: c(e.handleHeaderScroll),
|
|
332
332
|
handleViewportScroll: c(e.handleViewportScroll),
|
|
333
333
|
handleViewportKeydown: c(e.handleViewportKeydown)
|
|
334
|
-
})), f =
|
|
334
|
+
})), f = m(() => ({
|
|
335
335
|
visibleColumns: c(e.visibleColumns),
|
|
336
336
|
renderedColumns: c(e.renderedColumns),
|
|
337
337
|
columnFilterTextByKey: c(e.columnFilterTextByKey),
|
|
@@ -359,7 +359,7 @@ function Il(e) {
|
|
|
359
359
|
clearColumnMenuFilter: c(e.clearColumnMenuFilter),
|
|
360
360
|
startResize: c(e.startResize),
|
|
361
361
|
handleResizeDoubleClick: c(e.handleResizeDoubleClick)
|
|
362
|
-
})), C =
|
|
362
|
+
})), C = m(() => ({
|
|
363
363
|
displayRows: c(e.displayRows),
|
|
364
364
|
pinnedBottomRows: c(e.pinnedBottomRows),
|
|
365
365
|
sourceRows: c(e.sourceRows),
|
|
@@ -382,11 +382,13 @@ function Il(e) {
|
|
|
382
382
|
rowIndexLabel: c(e.rowIndexLabel),
|
|
383
383
|
startRowResize: c(e.startRowResize),
|
|
384
384
|
autosizeRow: c(e.autosizeRow)
|
|
385
|
-
})), y =
|
|
385
|
+
})), y = m(() => ({
|
|
386
386
|
selectionRange: c(e.selectionRange),
|
|
387
387
|
selectionAnchorCell: c(e.selectionAnchorCell),
|
|
388
388
|
fillPreviewRange: c(e.fillPreviewRange),
|
|
389
389
|
rangeMovePreviewRange: c(e.rangeMovePreviewRange),
|
|
390
|
+
fillHandleEnabled: c(e.fillHandleEnabled),
|
|
391
|
+
rangeMoveEnabled: c(e.rangeMoveEnabled),
|
|
390
392
|
isFillDragging: c(e.isFillDragging),
|
|
391
393
|
isRangeMoving: c(e.isRangeMoving),
|
|
392
394
|
fillActionAnchorCell: c(e.fillActionAnchorCell),
|
|
@@ -395,7 +397,7 @@ function Il(e) {
|
|
|
395
397
|
isFillHandleCell: c(e.isFillHandleCell),
|
|
396
398
|
startFillHandleDrag: c(e.startFillHandleDrag),
|
|
397
399
|
startFillHandleDoubleClick: c(e.startFillHandleDoubleClick)
|
|
398
|
-
})), A =
|
|
400
|
+
})), A = m(() => ({
|
|
399
401
|
editingCellValue: e.editingCellValueRef.value,
|
|
400
402
|
editingCellInitialFilter: c(e.editingCellInitialFilter),
|
|
401
403
|
editingCellOpenOnMount: c(e.editingCellOpenOnMount),
|
|
@@ -405,7 +407,7 @@ function Il(e) {
|
|
|
405
407
|
handleEditorKeydown: c(e.handleEditorKeydown),
|
|
406
408
|
commitInlineEdit: c(e.commitInlineEdit),
|
|
407
409
|
cancelInlineEdit: c(e.cancelInlineEdit)
|
|
408
|
-
})), b =
|
|
410
|
+
})), b = m(() => ({
|
|
409
411
|
cellClass: c(e.cellClass),
|
|
410
412
|
cellStyle: c(e.cellStyle),
|
|
411
413
|
isCellSelected: c(e.isCellSelected),
|
|
@@ -418,16 +420,16 @@ function Il(e) {
|
|
|
418
420
|
isCellEditable: c(e.isCellEditable),
|
|
419
421
|
readCell: c(e.readCell),
|
|
420
422
|
readDisplayCell: c(e.readDisplayCell)
|
|
421
|
-
})), R =
|
|
423
|
+
})), R = m(() => ({
|
|
422
424
|
handleCellMouseDown: c(e.handleCellMouseDown),
|
|
423
425
|
handleCellClick: c(e.handleCellClick),
|
|
424
426
|
handleCellKeydown: c(e.handleCellKeydown)
|
|
425
|
-
})), S =
|
|
427
|
+
})), S = m(() => ({
|
|
426
428
|
mode: c(e.mode),
|
|
427
429
|
rowHeightMode: c(e.rowHeightMode),
|
|
428
430
|
layoutMode: c(e.layoutMode),
|
|
429
431
|
layout: s.value,
|
|
430
|
-
viewport:
|
|
432
|
+
viewport: i.value,
|
|
431
433
|
columns: f.value,
|
|
432
434
|
rows: C.value,
|
|
433
435
|
selection: y.value,
|
|
@@ -435,11 +437,11 @@ function Il(e) {
|
|
|
435
437
|
cells: b.value,
|
|
436
438
|
interaction: R.value
|
|
437
439
|
})), h = ul({
|
|
438
|
-
mode:
|
|
439
|
-
rowHeightMode:
|
|
440
|
-
layoutMode:
|
|
440
|
+
mode: m(() => c(e.mode)),
|
|
441
|
+
rowHeightMode: m(() => c(e.rowHeightMode)),
|
|
442
|
+
layoutMode: m(() => c(e.layoutMode)),
|
|
441
443
|
layout: s,
|
|
442
|
-
viewport:
|
|
444
|
+
viewport: i,
|
|
443
445
|
columns: f,
|
|
444
446
|
rows: C,
|
|
445
447
|
selection: y,
|
|
@@ -457,14 +459,14 @@ function Il(e) {
|
|
|
457
459
|
}
|
|
458
460
|
function xl(e) {
|
|
459
461
|
return {
|
|
460
|
-
readStageCell: (s,
|
|
461
|
-
readStageDisplayCell: (s,
|
|
462
|
-
handleCellClick: (s,
|
|
462
|
+
readStageCell: (s, i) => e.isRowSelectionColumnKey(i) ? e.readRowSelectionCell(s) : e.readCell(s, i),
|
|
463
|
+
readStageDisplayCell: (s, i) => e.isRowSelectionColumnKey(i) ? e.readRowSelectionDisplayCell(s) : e.readDisplayCell(s, i),
|
|
464
|
+
handleCellClick: (s, i, f, C) => {
|
|
463
465
|
if (e.isRowSelectionColumn(f)) {
|
|
464
466
|
e.toggleRowCheckboxSelected(s);
|
|
465
467
|
return;
|
|
466
468
|
}
|
|
467
|
-
const y = e.viewportRowStart.value +
|
|
469
|
+
const y = e.viewportRowStart.value + i, A = e.isCellEditableByKey(s, y, f.key, C);
|
|
468
470
|
if (Gn({
|
|
469
471
|
column: f.column,
|
|
470
472
|
row: s.kind !== "group" ? s.data : void 0,
|
|
@@ -497,7 +499,7 @@ function xl(e) {
|
|
|
497
499
|
}
|
|
498
500
|
const Mn = 140, mt = 108, dn = "__datagrid_row_selection__";
|
|
499
501
|
function Al(e) {
|
|
500
|
-
const o =
|
|
502
|
+
const o = m(() => (e.showRowSelection?.value ?? !0) && e.runtime.api.rowSelection.hasSupport()), r = m(() => o.value ? {
|
|
501
503
|
key: dn,
|
|
502
504
|
state: {
|
|
503
505
|
visible: !0,
|
|
@@ -530,11 +532,11 @@ function Al(e) {
|
|
|
530
532
|
rowSelection: !0
|
|
531
533
|
}
|
|
532
534
|
}
|
|
533
|
-
} : null), l = (h) => h === dn, s = (h) => l(h.key),
|
|
535
|
+
} : null), l = (h) => h === dn, s = (h) => l(h.key), i = m(() => {
|
|
534
536
|
const h = r.value, g = e.visibleColumns.value.filter((x) => x.pin === "left"), I = e.visibleColumns.value.filter((x) => x.pin !== "left" && x.pin !== "right"), M = e.visibleColumns.value.filter((x) => x.pin === "right");
|
|
535
537
|
return h ? [h, ...g, ...I, ...M] : [...g, ...I, ...M];
|
|
536
|
-
}), f =
|
|
537
|
-
const g =
|
|
538
|
+
}), f = m(() => i.value.filter((h) => h.pin !== "left" && h.pin !== "right")), C = (h) => h.width ?? Mn, y = (h) => {
|
|
539
|
+
const g = i.value.find((x) => x.key === h), M = `${g ? C(g) : Mn}px`;
|
|
538
540
|
return {
|
|
539
541
|
width: M,
|
|
540
542
|
minWidth: M,
|
|
@@ -547,17 +549,17 @@ function Al(e) {
|
|
|
547
549
|
column: I.column,
|
|
548
550
|
columnKey: I.key
|
|
549
551
|
}) : !0, R = (h, g) => {
|
|
550
|
-
const I =
|
|
552
|
+
const I = i.value[g];
|
|
551
553
|
if (I?.key === h)
|
|
552
554
|
return { column: I, columnIndex: g };
|
|
553
|
-
const M =
|
|
555
|
+
const M = i.value.findIndex((x) => x.key === h);
|
|
554
556
|
return M < 0 ? null : {
|
|
555
|
-
column:
|
|
557
|
+
column: i.value[M],
|
|
556
558
|
columnIndex: M
|
|
557
559
|
};
|
|
558
560
|
};
|
|
559
561
|
return {
|
|
560
|
-
orderedVisibleColumns:
|
|
562
|
+
orderedVisibleColumns: i,
|
|
561
563
|
centerColumns: f,
|
|
562
564
|
resolveColumnWidth: C,
|
|
563
565
|
stageColumnStyle: y,
|
|
@@ -572,13 +574,13 @@ function Al(e) {
|
|
|
572
574
|
};
|
|
573
575
|
}
|
|
574
576
|
function Ol(e) {
|
|
575
|
-
const o =
|
|
577
|
+
const o = m(() => {
|
|
576
578
|
const l = e.lastAppliedFill.value, s = e.selectionRange.value;
|
|
577
579
|
return !l || !s || e.isFillDragging.value || l.allowBehaviorToggle === !1 || l.previewRange.startRow !== s.startRow || l.previewRange.endRow !== s.endRow || l.previewRange.startColumn !== s.startColumn || l.previewRange.endColumn !== s.endColumn ? null : {
|
|
578
580
|
rowIndex: l.previewRange.endRow,
|
|
579
581
|
columnIndex: l.previewRange.endColumn
|
|
580
582
|
};
|
|
581
|
-
}), r =
|
|
583
|
+
}), r = m(() => e.lastAppliedFill.value?.behavior ?? null);
|
|
582
584
|
return {
|
|
583
585
|
fillActionAnchorCell: o,
|
|
584
586
|
fillActionBehavior: r
|
|
@@ -611,30 +613,30 @@ function Fl(e) {
|
|
|
611
613
|
};
|
|
612
614
|
}
|
|
613
615
|
function Dl(e) {
|
|
614
|
-
const o =
|
|
616
|
+
const o = m(() => new Set(e.rowSelectionSnapshot.value?.selectedRows ?? [])), r = (g) => g.rowId != null && e.rowSelectionSnapshot.value?.focusedRow === g.rowId, l = (g) => g.kind !== "group" && g.rowId != null && o.value.has(g.rowId), s = (g) => l(g), i = (g) => s(g) ? "true" : "false", f = (g) => {
|
|
615
617
|
const I = e.rowSelectionColumn.value?.column;
|
|
616
618
|
return !I || g.kind === "group" ? "" : Ln({
|
|
617
619
|
column: I,
|
|
618
620
|
value: s(g)
|
|
619
621
|
}).displayValue;
|
|
620
|
-
}, C =
|
|
622
|
+
}, C = m(() => {
|
|
621
623
|
const g = e.runtime.api.rows.getCount(), I = [];
|
|
622
624
|
for (let M = 0; M < g; M += 1) {
|
|
623
625
|
const x = e.runtime.api.rows.get(M);
|
|
624
626
|
!x || x.kind === "group" || x.rowId == null || I.push(x.rowId);
|
|
625
627
|
}
|
|
626
628
|
return I;
|
|
627
|
-
}), y =
|
|
629
|
+
}), y = m(() => {
|
|
628
630
|
const g = C.value;
|
|
629
631
|
return g.length > 0 && g.every((I) => o.value.has(I));
|
|
630
|
-
}), A =
|
|
632
|
+
}), A = m(() => C.value.some((I) => o.value.has(I))), b = (g) => {
|
|
631
633
|
g.rowId == null || !e.runtime.api.rowSelection.hasSupport() || e.runtime.api.rowSelection.setFocusedRow(g.rowId);
|
|
632
634
|
};
|
|
633
635
|
return {
|
|
634
636
|
rowSelectionSet: o,
|
|
635
637
|
isRowFocused: r,
|
|
636
638
|
isRowCheckboxSelected: l,
|
|
637
|
-
readRowSelectionCell:
|
|
639
|
+
readRowSelectionCell: i,
|
|
638
640
|
readRowSelectionDisplayCell: f,
|
|
639
641
|
areAllVisibleRowsSelected: y,
|
|
640
642
|
areSomeVisibleRowsSelected: A,
|
|
@@ -679,22 +681,22 @@ function Dl(e) {
|
|
|
679
681
|
}
|
|
680
682
|
function El(e) {
|
|
681
683
|
return {
|
|
682
|
-
handleWindowMouseMove: (
|
|
684
|
+
handleWindowMouseMove: (i) => {
|
|
683
685
|
if (e.isColumnResizing.value) {
|
|
684
|
-
e.applyColumnResizeFromPointer(
|
|
686
|
+
e.applyColumnResizeFromPointer(i.clientX);
|
|
685
687
|
return;
|
|
686
688
|
}
|
|
687
|
-
e.handleInteractionWindowMouseMove(
|
|
689
|
+
e.handleInteractionWindowMouseMove(i);
|
|
688
690
|
},
|
|
689
|
-
handleHeaderWheel: (
|
|
691
|
+
handleHeaderWheel: (i) => {
|
|
690
692
|
const f = e.bodyViewportRef.value;
|
|
691
693
|
if (!f)
|
|
692
694
|
return;
|
|
693
|
-
const C = Math.abs(
|
|
694
|
-
C === 0 && y === 0 || (
|
|
695
|
+
const C = Math.abs(i.deltaX) > 0 ? i.deltaX : i.shiftKey ? i.deltaY : 0, y = C === 0 ? i.deltaY : 0;
|
|
696
|
+
C === 0 && y === 0 || (i.preventDefault(), C !== 0 && (f.scrollLeft += C), y !== 0 && (f.scrollTop += y), e.syncViewport());
|
|
695
697
|
},
|
|
696
|
-
handleHeaderScroll: (
|
|
697
|
-
const f =
|
|
698
|
+
handleHeaderScroll: (i) => {
|
|
699
|
+
const f = i.target, C = e.bodyViewportRef.value;
|
|
698
700
|
!f || !C || (C.scrollLeft !== f.scrollLeft && (C.scrollLeft = f.scrollLeft), e.syncViewport());
|
|
699
701
|
},
|
|
700
702
|
handleWindowMouseUp: () => {
|
|
@@ -703,26 +705,26 @@ function El(e) {
|
|
|
703
705
|
};
|
|
704
706
|
}
|
|
705
707
|
function kl(e) {
|
|
706
|
-
const o = (
|
|
707
|
-
const
|
|
708
|
-
|
|
708
|
+
const o = (i) => i.ctrlKey || i.metaKey || i.altKey ? !1 : i.key.startsWith("Arrow") || i.key === "Home" || i.key === "End" || i.key === "PageUp" || i.key === "PageDown" || i.key === "Tab" || i.key === "Enter" || i.key === " " || i.key === "Spacebar" || i.key === "F2" || i.key === "Escape" || i.key.length === 1, r = (i) => (i.ctrlKey || i.metaKey) && !i.altKey && !i.shiftKey && i.key.toLowerCase() === "a", l = () => {
|
|
709
|
+
const i = e.totalRows.value - 1, f = e.orderedVisibleColumns.value.length - 1;
|
|
710
|
+
i < 0 || f < 0 || e.applySelectionRange({
|
|
709
711
|
startRow: 0,
|
|
710
|
-
endRow:
|
|
712
|
+
endRow: i,
|
|
711
713
|
startColumn: 0,
|
|
712
714
|
endColumn: f
|
|
713
715
|
});
|
|
714
716
|
};
|
|
715
717
|
return {
|
|
716
|
-
handleViewportKeydown: (
|
|
717
|
-
(o(
|
|
718
|
+
handleViewportKeydown: (i) => {
|
|
719
|
+
(o(i) || r(i)) && i.preventDefault();
|
|
718
720
|
const f = e.selectionSnapshot.value?.activeCell;
|
|
719
721
|
if (!f) {
|
|
720
|
-
r(
|
|
722
|
+
r(i) && l();
|
|
721
723
|
return;
|
|
722
724
|
}
|
|
723
725
|
const C = e.runtime.getBodyRowAtIndex(f.rowIndex);
|
|
724
726
|
C && e.handleCellKeydown(
|
|
725
|
-
|
|
727
|
+
i,
|
|
726
728
|
C,
|
|
727
729
|
f.rowIndex - e.viewportRowStart.value,
|
|
728
730
|
f.colIndex
|
|
@@ -731,13 +733,13 @@ function kl(e) {
|
|
|
731
733
|
};
|
|
732
734
|
}
|
|
733
735
|
function Hl(e) {
|
|
734
|
-
const o =
|
|
736
|
+
const o = m(() => e.interactionSelectionRange.value ?? e.resolveCommittedSelectionRange()), r = () => {
|
|
735
737
|
const b = o.value;
|
|
736
738
|
return b && b.startRow === b.endRow && b.startColumn === b.endColumn ? {
|
|
737
739
|
rowIndex: b.startRow,
|
|
738
740
|
columnIndex: b.startColumn
|
|
739
741
|
} : e.selectionAnchorCell.value;
|
|
740
|
-
}, l = () => o.value, s = () => e.mode.value === "base" && e.isFillDragging.value && !!e.fillPreviewRange.value,
|
|
742
|
+
}, l = () => o.value, s = () => e.mode.value === "base" && e.isFillDragging.value && !!e.fillPreviewRange.value, i = (b, R, S) => {
|
|
741
743
|
const h = e.viewportRowStart.value + R;
|
|
742
744
|
return h >= b.startRow && h <= b.endRow && S >= b.startColumn && S <= b.endColumn;
|
|
743
745
|
}, f = (b, R) => {
|
|
@@ -751,19 +753,19 @@ function Hl(e) {
|
|
|
751
753
|
if (!s())
|
|
752
754
|
return e.isCommittedCellSelected(b, R);
|
|
753
755
|
const S = l();
|
|
754
|
-
return S ?
|
|
756
|
+
return S ? i(S, b, R) : !1;
|
|
755
757
|
},
|
|
756
758
|
shouldHighlightSelectedCell: (b, R) => {
|
|
757
759
|
if (!s())
|
|
758
760
|
return e.shouldHighlightCommittedSelectedCell(b, R);
|
|
759
761
|
const S = l();
|
|
760
|
-
return !S || !
|
|
762
|
+
return !S || !i(S, b, R) || S.startRow === S.endRow && S.startColumn === S.endColumn ? !1 : !f(b, R);
|
|
761
763
|
},
|
|
762
764
|
isCellOnSelectionEdge: (b, R, S) => {
|
|
763
765
|
if (!s())
|
|
764
766
|
return e.isCommittedCellOnSelectionEdge(b, R, S);
|
|
765
767
|
const h = l();
|
|
766
|
-
if (!h || !
|
|
768
|
+
if (!h || !i(h, b, R))
|
|
767
769
|
return !1;
|
|
768
770
|
const g = e.viewportRowStart.value + b;
|
|
769
771
|
switch (S) {
|
|
@@ -782,7 +784,7 @@ function Hl(e) {
|
|
|
782
784
|
const mn = 140, Vl = 72, zl = 80, Tl = 24, jl = 400;
|
|
783
785
|
function Bl(e) {
|
|
784
786
|
const o = e.syncRowSelectionSnapshotFromRuntime ?? (() => {
|
|
785
|
-
}), r = e.rowSelectionSnapshot ?? P(null), l =
|
|
787
|
+
}), r = e.rowSelectionSnapshot ?? P(null), l = m(() => e.showRowIndex?.value !== !1), s = m(() => e.runtime.rowPartition.value.bodyRowCount), i = m(() => Math.max(0, e.totalRuntimeRows.value)), f = m(() => l.value ? Vl : 0), C = Al({
|
|
786
788
|
runtime: e.runtime,
|
|
787
789
|
visibleColumns: e.visibleColumns,
|
|
788
790
|
showRowSelection: e.showRowSelection,
|
|
@@ -799,29 +801,29 @@ function Bl(e) {
|
|
|
799
801
|
} = C, M = $n({
|
|
800
802
|
totalRows: () => s.value,
|
|
801
803
|
resolveBaseRowHeight: () => e.normalizedBaseRowHeight.value,
|
|
802
|
-
resolveRowHeightOverride: (
|
|
804
|
+
resolveRowHeightOverride: (a) => e.runtime.api.view.getRowHeightOverride(a),
|
|
803
805
|
resolveRowHeightVersion: () => e.runtime.api.view.getRowHeightVersion(),
|
|
804
806
|
hasRowHeightOverrides: () => e.runtime.api.view.getRowHeightVersion() > 0
|
|
805
|
-
}), x = (
|
|
806
|
-
const
|
|
807
|
-
if (
|
|
807
|
+
}), x = (a) => {
|
|
808
|
+
const w = Math.max(0, Math.trunc(a));
|
|
809
|
+
if (w <= 0)
|
|
808
810
|
return 0;
|
|
809
811
|
const v = M.resolveTotalHeight();
|
|
810
|
-
return
|
|
811
|
-
}, W =
|
|
812
|
+
return w <= s.value ? M.resolveRowOffset(w) : v + (w - s.value) * e.normalizedBaseRowHeight.value;
|
|
813
|
+
}, W = m(() => {
|
|
812
814
|
if (e.layoutMode.value !== "auto-height")
|
|
813
815
|
return null;
|
|
814
|
-
let
|
|
815
|
-
return e.minRows.value !== null && (
|
|
816
|
-
}), re =
|
|
816
|
+
let a = M.resolveTotalHeight();
|
|
817
|
+
return e.minRows.value !== null && (a = Math.max(a, x(e.minRows.value))), e.maxRows.value !== null && (a = Math.min(a, x(e.maxRows.value))), Math.max(0, Math.trunc(a));
|
|
818
|
+
}), re = m(() => e.layoutMode.value !== "auto-height" ? {} : {
|
|
817
819
|
height: "auto"
|
|
818
|
-
}), vt =
|
|
820
|
+
}), vt = m(() => {
|
|
819
821
|
if (e.layoutMode.value !== "auto-height")
|
|
820
822
|
return {};
|
|
821
|
-
const
|
|
823
|
+
const a = W.value ?? 0;
|
|
822
824
|
return {
|
|
823
|
-
height: `${
|
|
824
|
-
maxHeight: `${
|
|
825
|
+
height: `${a}px`,
|
|
826
|
+
maxHeight: `${a}px`
|
|
825
827
|
};
|
|
826
828
|
});
|
|
827
829
|
let je = () => !1;
|
|
@@ -844,13 +846,13 @@ function Bl(e) {
|
|
|
844
846
|
handleViewportScroll: Ft,
|
|
845
847
|
syncViewportFromDom: D,
|
|
846
848
|
scheduleViewportSync: F,
|
|
847
|
-
cancelScheduledViewportSync:
|
|
849
|
+
cancelScheduledViewportSync: ae
|
|
848
850
|
} = Un({
|
|
849
851
|
runtime: e.runtime,
|
|
850
852
|
mode: e.mode,
|
|
851
853
|
rowRenderMode: e.rowRenderMode,
|
|
852
|
-
rowVirtualizationEnabled:
|
|
853
|
-
columnVirtualizationEnabled:
|
|
854
|
+
rowVirtualizationEnabled: m(() => e.virtualization.value.rows),
|
|
855
|
+
columnVirtualizationEnabled: m(() => e.virtualization.value.columns),
|
|
854
856
|
totalRows: s,
|
|
855
857
|
visibleColumns: A,
|
|
856
858
|
sizingColumns: y,
|
|
@@ -859,23 +861,23 @@ function Bl(e) {
|
|
|
859
861
|
defaultColumnWidth: mn,
|
|
860
862
|
indexColumnWidth: 0,
|
|
861
863
|
flexFillOffsetWidth: f.value,
|
|
862
|
-
rowOverscan:
|
|
863
|
-
columnOverscan:
|
|
864
|
+
rowOverscan: m(() => e.virtualization.value.rowOverscan),
|
|
865
|
+
columnOverscan: m(() => e.virtualization.value.columnOverscan),
|
|
864
866
|
measureVisibleRowHeights: () => ye(),
|
|
865
867
|
resolveRowHeight: M.resolveRowHeight,
|
|
866
868
|
resolveRowOffset: M.resolveRowOffset,
|
|
867
869
|
resolveRowIndexAtOffset: M.resolveRowIndexAtOffset,
|
|
868
870
|
resolveTotalRowHeight: M.resolveTotalHeight
|
|
869
|
-
}),
|
|
870
|
-
if (
|
|
871
|
+
}), ie = (a) => Ot(a), _e = (a) => {
|
|
872
|
+
if (i.value <= 0)
|
|
871
873
|
return null;
|
|
872
|
-
const
|
|
873
|
-
return e.runtime.api.rows.get(
|
|
874
|
-
}, be = (
|
|
875
|
-
for (let
|
|
876
|
-
if (e.runtime.api.rows.get(
|
|
877
|
-
return
|
|
878
|
-
return e.runtime.resolveBodyRowIndexById(
|
|
874
|
+
const w = Math.max(0, Math.min(i.value - 1, Math.trunc(a)));
|
|
875
|
+
return e.runtime.api.rows.get(w) ?? null;
|
|
876
|
+
}, be = (a) => {
|
|
877
|
+
for (let w = 0; w < i.value; w += 1)
|
|
878
|
+
if (e.runtime.api.rows.get(w)?.rowId === a)
|
|
879
|
+
return w;
|
|
880
|
+
return e.runtime.resolveBodyRowIndexById(a);
|
|
879
881
|
}, G = {
|
|
880
882
|
...e.runtime,
|
|
881
883
|
getBodyRowAtIndex: _e,
|
|
@@ -899,12 +901,12 @@ function Bl(e) {
|
|
|
899
901
|
}), Z = Xn({
|
|
900
902
|
mode: e.mode,
|
|
901
903
|
runtime: G,
|
|
902
|
-
totalRows:
|
|
904
|
+
totalRows: i,
|
|
903
905
|
visibleColumns: y,
|
|
904
906
|
viewportRowStart: H,
|
|
905
907
|
selectionSnapshot: e.selectionSnapshot,
|
|
906
908
|
selectionAnchor: e.selectionAnchor,
|
|
907
|
-
isEditingCell: (
|
|
909
|
+
isEditingCell: (a, w) => je(a, w)
|
|
908
910
|
}), {
|
|
909
911
|
normalizeRowId: Re,
|
|
910
912
|
normalizeCellCoord: Ke,
|
|
@@ -915,11 +917,11 @@ function Bl(e) {
|
|
|
915
917
|
setCellSelection: Dt,
|
|
916
918
|
clearCellSelection: Ue,
|
|
917
919
|
isCellSelected: qe
|
|
918
|
-
} = Z, Et = Z.isSelectionAnchorCell ?? (() => !1), kt = Z.shouldHighlightSelectedCell ?? ((
|
|
919
|
-
const
|
|
920
|
-
if (!
|
|
920
|
+
} = Z, Et = Z.isSelectionAnchorCell ?? (() => !1), kt = Z.shouldHighlightSelectedCell ?? ((a, w) => qe(a, w)), Ht = Z.isCellOnSelectionEdge ?? (() => !1), se = m(() => {
|
|
921
|
+
const a = e.selectionSnapshot.value;
|
|
922
|
+
if (!a || a.ranges.length === 0)
|
|
921
923
|
return null;
|
|
922
|
-
const
|
|
924
|
+
const w = a.activeRangeIndex ?? 0, v = a.ranges[w]?.anchor ?? a.ranges[0]?.anchor ?? null;
|
|
923
925
|
return !v || typeof v.rowIndex != "number" || typeof v.colIndex != "number" || !Number.isFinite(v.rowIndex) || !Number.isFinite(v.colIndex) ? null : {
|
|
924
926
|
rowIndex: Math.trunc(v.rowIndex),
|
|
925
927
|
columnIndex: Math.trunc(v.colIndex)
|
|
@@ -937,13 +939,13 @@ function Bl(e) {
|
|
|
937
939
|
readRowSelectionCell: Vt,
|
|
938
940
|
readRowSelectionDisplayCell: zt,
|
|
939
941
|
toggleRowCheckboxSelected: Ye
|
|
940
|
-
} = Xe, Tt =
|
|
941
|
-
const
|
|
942
|
+
} = Xe, Tt = m(() => {
|
|
943
|
+
const a = `${f.value}px`;
|
|
942
944
|
return {
|
|
943
945
|
...At.value,
|
|
944
|
-
width:
|
|
945
|
-
minWidth:
|
|
946
|
-
maxWidth:
|
|
946
|
+
width: a,
|
|
947
|
+
minWidth: a,
|
|
948
|
+
maxWidth: a
|
|
947
949
|
};
|
|
948
950
|
}), Me = Fl({
|
|
949
951
|
runtime: e.runtime,
|
|
@@ -986,7 +988,7 @@ function Bl(e) {
|
|
|
986
988
|
} = xe, jt = Jn({
|
|
987
989
|
mode: e.mode,
|
|
988
990
|
runtime: G,
|
|
989
|
-
totalRows:
|
|
991
|
+
totalRows: i,
|
|
990
992
|
visibleColumns: y,
|
|
991
993
|
viewportRowStart: H,
|
|
992
994
|
resolveSelectionRange: V,
|
|
@@ -994,14 +996,14 @@ function Bl(e) {
|
|
|
994
996
|
applySelectionRange: Q,
|
|
995
997
|
clearCellSelection: Ue,
|
|
996
998
|
captureRowsSnapshot: U,
|
|
997
|
-
recordEditTransaction: (
|
|
999
|
+
recordEditTransaction: (a) => {
|
|
998
1000
|
q({
|
|
999
1001
|
intent: "edit",
|
|
1000
1002
|
label: "Cell edit"
|
|
1001
|
-
},
|
|
1003
|
+
}, a);
|
|
1002
1004
|
},
|
|
1003
|
-
readCell: (
|
|
1004
|
-
readClipboardCell: e.readClipboardCell ? (
|
|
1005
|
+
readCell: (a, w) => ue(a, w),
|
|
1006
|
+
readClipboardCell: e.readClipboardCell ? (a, w) => e.readClipboardCell?.(a, w) ?? "" : void 0,
|
|
1005
1007
|
isCellEditable: g,
|
|
1006
1008
|
syncViewport: () => D(),
|
|
1007
1009
|
applyClipboardEdits: e.applyClipboardEdits,
|
|
@@ -1043,30 +1045,32 @@ function Bl(e) {
|
|
|
1043
1045
|
mode: e.mode,
|
|
1044
1046
|
bodyViewportRef: N,
|
|
1045
1047
|
visibleColumns: y,
|
|
1046
|
-
totalRows:
|
|
1048
|
+
totalRows: i,
|
|
1047
1049
|
runtime: G,
|
|
1048
|
-
readCell: (
|
|
1050
|
+
readCell: (a, w) => ue(a, w),
|
|
1049
1051
|
resolveRowIndexById: be,
|
|
1050
|
-
applyCellSelection: (
|
|
1051
|
-
Se(
|
|
1052
|
+
applyCellSelection: (a) => {
|
|
1053
|
+
Se(a, !1);
|
|
1052
1054
|
},
|
|
1053
|
-
ensureActiveCellVisible: (
|
|
1054
|
-
ne(
|
|
1055
|
+
ensureActiveCellVisible: (a, w) => {
|
|
1056
|
+
ne(a, w);
|
|
1055
1057
|
},
|
|
1056
1058
|
isCellEditable: g,
|
|
1057
1059
|
captureRowsSnapshot: U,
|
|
1058
|
-
recordEditTransaction: (
|
|
1060
|
+
recordEditTransaction: (a) => {
|
|
1059
1061
|
q({
|
|
1060
1062
|
intent: "edit",
|
|
1061
1063
|
label: "Cell edit"
|
|
1062
|
-
},
|
|
1064
|
+
}, a);
|
|
1063
1065
|
}
|
|
1064
1066
|
});
|
|
1065
1067
|
je = ot;
|
|
1066
|
-
const Nt =
|
|
1068
|
+
const Nt = m(() => Oe.value), Kt = {
|
|
1067
1069
|
mode: e.mode,
|
|
1070
|
+
enableFillHandle: e.enableFillHandle,
|
|
1071
|
+
enableRangeMove: e.enableRangeMove,
|
|
1068
1072
|
runtime: G,
|
|
1069
|
-
totalRows:
|
|
1073
|
+
totalRows: i,
|
|
1070
1074
|
visibleColumns: y,
|
|
1071
1075
|
viewportRowStart: H,
|
|
1072
1076
|
selectionSnapshot: e.selectionSnapshot,
|
|
@@ -1082,13 +1086,13 @@ function Bl(e) {
|
|
|
1082
1086
|
applyCellSelectionByCoord: Se,
|
|
1083
1087
|
setCellSelection: Dt,
|
|
1084
1088
|
clearCellSelection: Ue,
|
|
1085
|
-
readCell: (
|
|
1089
|
+
readCell: (a, w) => ue(a, w),
|
|
1086
1090
|
isCellEditable: g,
|
|
1087
1091
|
cloneRowData: e.cloneRowData,
|
|
1088
1092
|
resolveRowIndexById: be,
|
|
1089
1093
|
captureRowsSnapshot: U,
|
|
1090
|
-
recordIntentTransaction: (
|
|
1091
|
-
q(
|
|
1094
|
+
recordIntentTransaction: (a, w) => {
|
|
1095
|
+
q(a, w);
|
|
1092
1096
|
},
|
|
1093
1097
|
clearPendingClipboardOperation: Gt,
|
|
1094
1098
|
clearExternalPendingClipboardOperation: e.clearExternalPendingClipboardOperation,
|
|
@@ -1112,15 +1116,15 @@ function Bl(e) {
|
|
|
1112
1116
|
closeContextMenu: e.closeContextMenu,
|
|
1113
1117
|
openContextMenuFromCurrentCell: e.openContextMenuFromCurrentCell,
|
|
1114
1118
|
runRowIndexKeyboardAction: e.runRowIndexKeyboardAction,
|
|
1115
|
-
handleToggleCellAction: (
|
|
1119
|
+
handleToggleCellAction: (a, w, v, O) => S(O) ? (Ye(a), !0) : !1
|
|
1116
1120
|
}, $t = el(Kt), {
|
|
1117
|
-
isPointerSelectingCells:
|
|
1121
|
+
isPointerSelectingCells: at,
|
|
1118
1122
|
isFillDragging: le,
|
|
1119
1123
|
fillPreviewRange: Ee,
|
|
1120
1124
|
lastAppliedFill: ke,
|
|
1121
1125
|
isRangeMoving: Ut,
|
|
1122
1126
|
selectionRange: He,
|
|
1123
|
-
rangeMovePreviewRange:
|
|
1127
|
+
rangeMovePreviewRange: it,
|
|
1124
1128
|
stopPointerSelection: qt,
|
|
1125
1129
|
stopFillSelection: Xt,
|
|
1126
1130
|
startFillHandleDrag: Yt,
|
|
@@ -1138,7 +1142,7 @@ function Bl(e) {
|
|
|
1138
1142
|
} = $t, ln = kl({
|
|
1139
1143
|
runtime: G,
|
|
1140
1144
|
selectionSnapshot: e.selectionSnapshot,
|
|
1141
|
-
totalRows:
|
|
1145
|
+
totalRows: i,
|
|
1142
1146
|
orderedVisibleColumns: y,
|
|
1143
1147
|
viewportRowStart: H,
|
|
1144
1148
|
applySelectionRange: Q,
|
|
@@ -1153,8 +1157,8 @@ function Bl(e) {
|
|
|
1153
1157
|
} = tl({
|
|
1154
1158
|
visibleColumns: y,
|
|
1155
1159
|
rows: e.rows,
|
|
1156
|
-
persistColumnWidth: (
|
|
1157
|
-
e.runtime.api.columns.setWidth(
|
|
1160
|
+
persistColumnWidth: (a, w) => {
|
|
1161
|
+
e.runtime.api.columns.setWidth(a, w);
|
|
1158
1162
|
},
|
|
1159
1163
|
defaultColumnWidth: mn,
|
|
1160
1164
|
minColumnWidth: zl,
|
|
@@ -1166,12 +1170,12 @@ function Bl(e) {
|
|
|
1166
1170
|
stopFillSelection: () => {
|
|
1167
1171
|
Xt(!1);
|
|
1168
1172
|
},
|
|
1169
|
-
isDragSelecting: () =>
|
|
1173
|
+
isDragSelecting: () => at.value,
|
|
1170
1174
|
stopDragSelection: () => {
|
|
1171
1175
|
qt();
|
|
1172
1176
|
},
|
|
1173
|
-
readCellText: (
|
|
1174
|
-
const v =
|
|
1177
|
+
readCellText: (a, w) => {
|
|
1178
|
+
const v = a[w];
|
|
1175
1179
|
return v == null ? "" : String(v);
|
|
1176
1180
|
}
|
|
1177
1181
|
}), ct = Hl({
|
|
@@ -1219,8 +1223,8 @@ function Bl(e) {
|
|
|
1219
1223
|
pinnedBottomRows: bt,
|
|
1220
1224
|
sourceRows: e.sourceRows ?? e.rows,
|
|
1221
1225
|
showRowIndex: l,
|
|
1222
|
-
rowHover:
|
|
1223
|
-
stripedRows:
|
|
1226
|
+
rowHover: m(() => e.rowHover?.value === !0),
|
|
1227
|
+
stripedRows: m(() => e.stripedRows?.value === !0),
|
|
1224
1228
|
columnFilterTextByKey: e.columnFilterTextByKey,
|
|
1225
1229
|
gridContentStyle: It,
|
|
1226
1230
|
mainTrackStyle: xt,
|
|
@@ -1239,12 +1243,14 @@ function Bl(e) {
|
|
|
1239
1243
|
selectionRange: dt,
|
|
1240
1244
|
selectionAnchorCell: se,
|
|
1241
1245
|
fillPreviewRange: Ee,
|
|
1242
|
-
rangeMovePreviewRange:
|
|
1246
|
+
rangeMovePreviewRange: it,
|
|
1247
|
+
fillHandleEnabled: m(() => e.enableFillHandle.value),
|
|
1248
|
+
rangeMoveEnabled: m(() => e.enableRangeMove.value),
|
|
1243
1249
|
isFillDragging: le,
|
|
1244
1250
|
isRangeMoving: Ut,
|
|
1245
1251
|
headerViewportRef: ht,
|
|
1246
1252
|
bodyViewportRef: N,
|
|
1247
|
-
columnStyle:
|
|
1253
|
+
columnStyle: ie,
|
|
1248
1254
|
toggleSortForColumn: e.toggleSortForColumn,
|
|
1249
1255
|
sortIndicator: e.sortIndicator,
|
|
1250
1256
|
setColumnFilterText: e.setColumnFilterText,
|
|
@@ -1297,7 +1303,7 @@ function Bl(e) {
|
|
|
1297
1303
|
isCellInPendingClipboardRange: de,
|
|
1298
1304
|
isCellOnPendingClipboardEdge: me,
|
|
1299
1305
|
isEditingCell: ot,
|
|
1300
|
-
isCellEditable: (
|
|
1306
|
+
isCellEditable: (a, w, v, O) => h(a, H.value + w, v),
|
|
1301
1307
|
handleCellMouseDown: Zt,
|
|
1302
1308
|
handleCellClick: n.cellIo.handleCellClick,
|
|
1303
1309
|
handleCellKeydown: z,
|
|
@@ -1333,7 +1339,7 @@ function Bl(e) {
|
|
|
1333
1339
|
syncViewport: D,
|
|
1334
1340
|
handleWindowMouseMove: n.scrollSync.handleWindowMouseMove,
|
|
1335
1341
|
handleWindowMouseUp: n.scrollSync.handleWindowMouseUp,
|
|
1336
|
-
cancelScheduledViewportSync:
|
|
1342
|
+
cancelScheduledViewportSync: ae,
|
|
1337
1343
|
onAfterMount: () => {
|
|
1338
1344
|
e.syncSelectionSnapshotFromRuntime(), o(), Dn(() => {
|
|
1339
1345
|
e.applyRowHeightSettings(), D();
|
|
@@ -1357,7 +1363,7 @@ function Bl(e) {
|
|
|
1357
1363
|
recordHistoryIntentTransaction: q
|
|
1358
1364
|
};
|
|
1359
1365
|
}
|
|
1360
|
-
const _l = gt(() => import("./DataGridColumnLayoutPopover-Qt56b3CA.js")), Gl = gt(() => import("./DataGridAdvancedFilterPopover-Bak_CkaO.js")), Pl = gt(() => import("./DataGridAggregationsPopover-DfQ3-UV4.js")), Ll = gt(() => import("./DataGridGanttStageEntry-
|
|
1366
|
+
const _l = gt(() => import("./DataGridColumnLayoutPopover-Qt56b3CA.js")), Gl = gt(() => import("./DataGridAdvancedFilterPopover-Bak_CkaO.js")), Pl = gt(() => import("./DataGridAggregationsPopover-DfQ3-UV4.js")), Ll = gt(() => import("./DataGridGanttStageEntry-CaMj_sad.js"));
|
|
1361
1367
|
function Wl(e) {
|
|
1362
1368
|
return Number.isFinite(e) ? Math.max(24, Math.trunc(e)) : 31;
|
|
1363
1369
|
}
|
|
@@ -1385,10 +1391,10 @@ function Cn(e) {
|
|
|
1385
1391
|
}
|
|
1386
1392
|
function Kl(e) {
|
|
1387
1393
|
const o = {};
|
|
1388
|
-
for (const [s,
|
|
1389
|
-
if (
|
|
1394
|
+
for (const [s, i] of Object.entries(e.columnFilters ?? {})) {
|
|
1395
|
+
if (i.kind === "valueSet") {
|
|
1390
1396
|
const f = Array.from(new Set(
|
|
1391
|
-
(
|
|
1397
|
+
(i.tokens ?? []).map((C) => Cn(String(C ?? ""))).filter((C) => C.length > 0)
|
|
1392
1398
|
));
|
|
1393
1399
|
if (f.length === 0)
|
|
1394
1400
|
continue;
|
|
@@ -1400,10 +1406,10 @@ function Kl(e) {
|
|
|
1400
1406
|
}
|
|
1401
1407
|
o[s] = {
|
|
1402
1408
|
kind: "predicate",
|
|
1403
|
-
operator:
|
|
1404
|
-
value:
|
|
1405
|
-
value2:
|
|
1406
|
-
caseSensitive:
|
|
1409
|
+
operator: i.operator,
|
|
1410
|
+
value: i.value,
|
|
1411
|
+
value2: i.value2,
|
|
1412
|
+
caseSensitive: i.caseSensitive
|
|
1407
1413
|
};
|
|
1408
1414
|
}
|
|
1409
1415
|
const r = { ...e.advancedFilters ?? {} }, l = e.advancedExpression ?? null;
|
|
@@ -1544,8 +1550,8 @@ function Yl(e, o) {
|
|
|
1544
1550
|
}
|
|
1545
1551
|
function Jl(e, o) {
|
|
1546
1552
|
const r = o.clauses.map((l, s) => {
|
|
1547
|
-
const
|
|
1548
|
-
return l.operator === "between" ? `${
|
|
1553
|
+
const i = s === 0 ? "" : `${String(l.join ?? "and").toUpperCase()} `;
|
|
1554
|
+
return l.operator === "between" ? `${i}${oe(l.operator)} ${$(l.value)} and ${$(l.value2)}` : l.operator === "isEmpty" || l.operator === "notEmpty" || l.operator === "isNull" || l.operator === "notNull" ? `${i}${oe(l.operator)}` : `${i}${oe(l.operator)} ${$(l.value)}`;
|
|
1549
1555
|
}).filter((l) => l.length > 0);
|
|
1550
1556
|
return r.length === 0 ? `${e}: active` : `${e} ${r.join(" ")}`;
|
|
1551
1557
|
}
|
|
@@ -1717,6 +1723,14 @@ const no = {
|
|
|
1717
1723
|
type: Number,
|
|
1718
1724
|
default: null
|
|
1719
1725
|
},
|
|
1726
|
+
fillHandle: {
|
|
1727
|
+
type: Boolean,
|
|
1728
|
+
default: !1
|
|
1729
|
+
},
|
|
1730
|
+
rangeMove: {
|
|
1731
|
+
type: Boolean,
|
|
1732
|
+
default: !1
|
|
1733
|
+
},
|
|
1720
1734
|
rowHover: {
|
|
1721
1735
|
type: Boolean,
|
|
1722
1736
|
default: !1
|
|
@@ -1755,8 +1769,8 @@ const no = {
|
|
|
1755
1769
|
}
|
|
1756
1770
|
},
|
|
1757
1771
|
setup(e) {
|
|
1758
|
-
const o = P(0), r = P(pn(e.sortModel)), l = P(ze(e.filterModel)), s =
|
|
1759
|
-
let
|
|
1772
|
+
const o = P(0), r = P(pn(e.sortModel)), l = P(ze(e.filterModel)), s = m(() => $l(l.value));
|
|
1773
|
+
let i = "";
|
|
1760
1774
|
const f = () => {
|
|
1761
1775
|
const t = e.runtimeRowModel.getSnapshot();
|
|
1762
1776
|
return [
|
|
@@ -1767,10 +1781,10 @@ const no = {
|
|
|
1767
1781
|
t.projection?.recomputeVersion ?? t.projection?.version ?? ""
|
|
1768
1782
|
].join("|");
|
|
1769
1783
|
};
|
|
1770
|
-
|
|
1784
|
+
i = f();
|
|
1771
1785
|
const C = e.runtimeRowModel.subscribe(() => {
|
|
1772
1786
|
const t = f();
|
|
1773
|
-
t !==
|
|
1787
|
+
t !== i && (i = t, o.value += 1);
|
|
1774
1788
|
});
|
|
1775
1789
|
En(() => {
|
|
1776
1790
|
C();
|
|
@@ -1787,18 +1801,18 @@ const no = {
|
|
|
1787
1801
|
},
|
|
1788
1802
|
{ deep: !0 }
|
|
1789
1803
|
);
|
|
1790
|
-
const y =
|
|
1804
|
+
const y = m(() => e.mode), A = m(() => e.rows), b = m(() => (o.value, e.runtime.api.rows.getSnapshot().rowCount)), R = m(() => e.runtime.columnSnapshot.value.visibleColumns), S = m(() => e.runtime.columnSnapshot.value.columns ?? []), h = m(() => R.value.filter((t) => t.visible !== !1).map((t) => ({
|
|
1791
1805
|
key: t.key,
|
|
1792
1806
|
label: t.column.label ?? t.key
|
|
1793
|
-
}))), g =
|
|
1807
|
+
}))), g = m(() => S.value.map((t) => ({
|
|
1794
1808
|
key: t.key,
|
|
1795
1809
|
label: t.column.label ?? t.key,
|
|
1796
1810
|
visible: t.visible !== !1
|
|
1797
|
-
}))), I =
|
|
1811
|
+
}))), I = m(() => S.value.filter((t) => t.column.capabilities?.aggregatable === !0).map((t) => ({
|
|
1798
1812
|
key: t.key,
|
|
1799
1813
|
label: t.column.label ?? t.key,
|
|
1800
1814
|
allowedOps: to(t.column.dataType)
|
|
1801
|
-
}))), M = P(e.rowHeightMode), x =
|
|
1815
|
+
}))), M = P(e.rowHeightMode), x = m(() => Wl(e.baseRowHeight)), W = m(() => R.value[0]?.key ?? "name"), re = m(() => {
|
|
1802
1816
|
const t = /* @__PURE__ */ new Map();
|
|
1803
1817
|
for (const n of S.value)
|
|
1804
1818
|
t.set(n.key, n.column.label ?? n.key);
|
|
@@ -1832,23 +1846,23 @@ const no = {
|
|
|
1832
1846
|
clearAdvancedFilterPanel: Ft
|
|
1833
1847
|
} = rl({
|
|
1834
1848
|
resolveColumns: () => h.value
|
|
1835
|
-
}), D = P(!1), F = P(null),
|
|
1849
|
+
}), D = P(!1), F = P(null), ae = m(() => !!e.groupBy?.fields?.length), ie = m(() => (o.value, Te(e.runtime.api.rows.getAggregationModel()))), _e = m(() => (o.value, ql(e.runtime.api.rows.getSnapshot().groupBy))), be = m(() => {
|
|
1836
1850
|
const t = new Map(
|
|
1837
1851
|
(F.value?.columns ?? []).map((n) => [n.key, n.op])
|
|
1838
1852
|
);
|
|
1839
1853
|
return I.value.map((n) => {
|
|
1840
|
-
const u = n.allowedOps[0] ?? "count", d = t.get(n.key),
|
|
1854
|
+
const u = n.allowedOps[0] ?? "count", d = t.get(n.key), a = d && n.allowedOps.includes(d) ? d : u;
|
|
1841
1855
|
return {
|
|
1842
1856
|
key: n.key,
|
|
1843
1857
|
label: n.label,
|
|
1844
1858
|
enabled: t.has(n.key),
|
|
1845
|
-
op:
|
|
1859
|
+
op: a,
|
|
1846
1860
|
allowedOps: n.allowedOps
|
|
1847
1861
|
};
|
|
1848
1862
|
});
|
|
1849
|
-
}), G =
|
|
1863
|
+
}), G = m(() => F.value?.basis === "source" ? "source" : "filtered");
|
|
1850
1864
|
L(
|
|
1851
|
-
|
|
1865
|
+
ie,
|
|
1852
1866
|
(t) => {
|
|
1853
1867
|
D.value || (F.value = Te(t));
|
|
1854
1868
|
},
|
|
@@ -1880,14 +1894,14 @@ const no = {
|
|
|
1880
1894
|
advancedExpression: n
|
|
1881
1895
|
})
|
|
1882
1896
|
});
|
|
1883
|
-
}, $e =
|
|
1897
|
+
}, $e = m(() => e.advancedFilter.enabled ? he.value ?? l.value.advancedExpression ?? null : l.value.advancedExpression ?? null), Q = m(() => {
|
|
1884
1898
|
const t = (u) => re.value.get(u) ?? u, n = [];
|
|
1885
1899
|
for (const [u, d] of Object.entries(l.value.columnFilters ?? {}))
|
|
1886
1900
|
d && n.push(Yl(t(u), d));
|
|
1887
1901
|
for (const [u, d] of Object.entries(l.value.advancedFilters ?? {}))
|
|
1888
1902
|
d && n.push(`Advanced: ${Jl(t(u), d)}`);
|
|
1889
1903
|
return $e.value && n.push(`Advanced: ${hn($e.value, t)}`), Object.freeze(n);
|
|
1890
|
-
}), Se =
|
|
1904
|
+
}), Se = m(() => Q.value.length > 0), Dt = () => {
|
|
1891
1905
|
l.value = gn(), Ft(), V();
|
|
1892
1906
|
};
|
|
1893
1907
|
L(
|
|
@@ -1898,20 +1912,20 @@ const no = {
|
|
|
1898
1912
|
{ deep: !0 }
|
|
1899
1913
|
);
|
|
1900
1914
|
const Ue = (t, n = !1) => {
|
|
1901
|
-
const u = r.value.findIndex((
|
|
1915
|
+
const u = r.value.findIndex((a) => a.key === t), d = u >= 0 ? r.value[u] : null;
|
|
1902
1916
|
if (!d) {
|
|
1903
|
-
const
|
|
1904
|
-
r.value = n ? [...r.value,
|
|
1917
|
+
const a = { key: t, direction: "asc" };
|
|
1918
|
+
r.value = n ? [...r.value, a] : [a], V();
|
|
1905
1919
|
return;
|
|
1906
1920
|
}
|
|
1907
1921
|
if (d.direction === "asc") {
|
|
1908
|
-
const
|
|
1909
|
-
n ? r.value = r.value.map((
|
|
1922
|
+
const a = { key: t, direction: "desc" };
|
|
1923
|
+
n ? r.value = r.value.map((w) => w.key === t ? a : w) : r.value = [a], V();
|
|
1910
1924
|
return;
|
|
1911
1925
|
}
|
|
1912
|
-
r.value = n ? r.value.filter((
|
|
1926
|
+
r.value = n ? r.value.filter((a) => a.key !== t) : [], V();
|
|
1913
1927
|
}, qe = (t) => {
|
|
1914
|
-
const n = r.value.findIndex((
|
|
1928
|
+
const n = r.value.findIndex((a) => a.key === t);
|
|
1915
1929
|
if (n < 0)
|
|
1916
1930
|
return "";
|
|
1917
1931
|
const u = r.value[n];
|
|
@@ -1930,12 +1944,12 @@ const no = {
|
|
|
1930
1944
|
}, kt = () => {
|
|
1931
1945
|
e.runtime.api.view.setRowHeightMode(M.value), e.runtime.api.view.setBaseRowHeight(x.value);
|
|
1932
1946
|
}, Ht = () => {
|
|
1933
|
-
F.value = Te(
|
|
1947
|
+
F.value = Te(ie.value), D.value = !0;
|
|
1934
1948
|
}, se = () => {
|
|
1935
|
-
F.value = Te(
|
|
1949
|
+
F.value = Te(ie.value), D.value = !1;
|
|
1936
1950
|
};
|
|
1937
1951
|
L(
|
|
1938
|
-
|
|
1952
|
+
ae,
|
|
1939
1953
|
(t) => {
|
|
1940
1954
|
t || se();
|
|
1941
1955
|
},
|
|
@@ -1958,7 +1972,7 @@ const no = {
|
|
|
1958
1972
|
F.value = v.length > 0 ? { basis: G.value, columns: v } : null;
|
|
1959
1973
|
return;
|
|
1960
1974
|
}
|
|
1961
|
-
const
|
|
1975
|
+
const w = d.find((v) => v.key === t) ?? {
|
|
1962
1976
|
key: t,
|
|
1963
1977
|
op: u.allowedOps[0] ?? "count"
|
|
1964
1978
|
};
|
|
@@ -1966,15 +1980,15 @@ const no = {
|
|
|
1966
1980
|
basis: G.value,
|
|
1967
1981
|
columns: [
|
|
1968
1982
|
...d.filter((v) => v.key !== t),
|
|
1969
|
-
|
|
1983
|
+
w
|
|
1970
1984
|
]
|
|
1971
1985
|
};
|
|
1972
1986
|
}, Ye = (t, n) => {
|
|
1973
|
-
const u = I.value.find((
|
|
1987
|
+
const u = I.value.find((a) => a.key === t);
|
|
1974
1988
|
if (!u || !u.allowedOps.includes(n))
|
|
1975
1989
|
return;
|
|
1976
|
-
const d = (F.value?.columns ?? []).map((
|
|
1977
|
-
...
|
|
1990
|
+
const d = (F.value?.columns ?? []).map((a) => a.key !== t ? a : {
|
|
1991
|
+
...a,
|
|
1978
1992
|
op: n
|
|
1979
1993
|
});
|
|
1980
1994
|
F.value = {
|
|
@@ -1990,14 +2004,14 @@ const no = {
|
|
|
1990
2004
|
}, q = (t, n) => {
|
|
1991
2005
|
e.runtime.api.columns.setPin(t, n);
|
|
1992
2006
|
}, Je = (t, n) => {
|
|
1993
|
-
const u = _e.value, d = n ? Array.from(/* @__PURE__ */ new Set([...u?.fields ?? [], t])) : (u?.fields ?? []).filter((
|
|
2007
|
+
const u = _e.value, d = n ? Array.from(/* @__PURE__ */ new Set([...u?.fields ?? [], t])) : (u?.fields ?? []).filter((a) => a !== t);
|
|
1994
2008
|
e.runtime.api.rows.setGroupBy(d.length > 0 ? {
|
|
1995
2009
|
fields: d,
|
|
1996
2010
|
expandedByDefault: u?.expandedByDefault ?? !0
|
|
1997
2011
|
} : null);
|
|
1998
2012
|
}, Ze = (t, n) => {
|
|
1999
2013
|
const u = Array.from(new Set(
|
|
2000
|
-
n.map((
|
|
2014
|
+
n.map((a) => Cn(String(a ?? ""))).filter((a) => a.length > 0)
|
|
2001
2015
|
));
|
|
2002
2016
|
if (u.length === 0) {
|
|
2003
2017
|
pe(t);
|
|
@@ -2028,7 +2042,7 @@ const no = {
|
|
|
2028
2042
|
columnIndex: t.colIndex
|
|
2029
2043
|
} : null;
|
|
2030
2044
|
}, xe = (t) => t ? t.startRow !== t.endRow || t.startColumn !== t.endColumn : !1, ue = (t, n) => t.rowIndex >= Math.min(n.startRow, n.endRow) && t.rowIndex <= Math.max(n.startRow, n.endRow) && t.columnIndex >= Math.min(n.startColumn, n.endColumn) && t.columnIndex <= Math.max(n.startColumn, n.endColumn), jt = (t, n) => {
|
|
2031
|
-
const u = e.runtime.resolveBodyRowIndexById(t), d = R.value.findIndex((
|
|
2045
|
+
const u = e.runtime.resolveBodyRowIndexById(t), d = R.value.findIndex((a) => a.key === n);
|
|
2032
2046
|
return u < 0 || d < 0 ? null : { rowIndex: u, columnIndex: d };
|
|
2033
2047
|
}, tt = (t) => ({
|
|
2034
2048
|
ranges: [{
|
|
@@ -2092,14 +2106,14 @@ const no = {
|
|
|
2092
2106
|
}
|
|
2093
2107
|
return null;
|
|
2094
2108
|
}, Ae = async (t, n, u = []) => {
|
|
2095
|
-
const d = t.map((
|
|
2109
|
+
const d = t.map((w) => Y(w));
|
|
2096
2110
|
j.value = {
|
|
2097
2111
|
rows: d,
|
|
2098
2112
|
operation: n,
|
|
2099
|
-
sourceRowIds: u.map((
|
|
2113
|
+
sourceRowIds: u.map((w) => String(w))
|
|
2100
2114
|
};
|
|
2101
|
-
const
|
|
2102
|
-
return
|
|
2115
|
+
const a = Ul(d);
|
|
2116
|
+
return a && await Bt(a), !0;
|
|
2103
2117
|
}, te = () => e.runtime.api.rows.hasInsertSupport(), ce = () => e.runtime.api.rows.hasDataMutationSupport(), de = (t) => !t || typeof t != "object" ? !1 : "data" in t || "row" in t || "kind" in t || "state" in t || "sourceIndex" in t || "originalIndex" in t || "displayIndex" in t, me = (t) => {
|
|
2104
2118
|
const n = t;
|
|
2105
2119
|
return n.rowId != null ? String(n.rowId) : n.id != null ? String(n.id) : null;
|
|
@@ -2125,40 +2139,40 @@ const no = {
|
|
|
2125
2139
|
return "id" in n && (n.id = u, d = !0), "rowId" in n && (n.rowId = u, d = !0), d || (n.id = u), n;
|
|
2126
2140
|
}, Lt = (t) => {
|
|
2127
2141
|
const n = Oe(), u = {};
|
|
2128
|
-
for (const [d,
|
|
2142
|
+
for (const [d, a] of Object.entries(t)) {
|
|
2129
2143
|
if (d === "id" || d === "rowId") {
|
|
2130
2144
|
u[d] = n;
|
|
2131
2145
|
continue;
|
|
2132
2146
|
}
|
|
2133
|
-
u[d] = typeof
|
|
2147
|
+
u[d] = typeof a == "number" ? null : "";
|
|
2134
2148
|
}
|
|
2135
2149
|
return !("id" in u) && !("rowId" in u) && (u.id = n), u;
|
|
2136
2150
|
}, lt = (t, n, u) => {
|
|
2137
|
-
const d = Oe(),
|
|
2138
|
-
("id" in
|
|
2139
|
-
const
|
|
2151
|
+
const d = Oe(), a = u === "clone" ? Y(t) : Object.entries(t).reduce((v, [O, p]) => (v[O] = typeof p == "number" ? null : "", v), {});
|
|
2152
|
+
("id" in a || !("rowId" in a) && !("id" in a)) && (a.id = d), "rowId" in a && (a.rowId = d), "rowKey" in a && (a.rowKey = d);
|
|
2153
|
+
const w = typeof n.state == "object" && n.state != null ? n.state : null;
|
|
2140
2154
|
return {
|
|
2141
2155
|
kind: n.kind === "group" ? "leaf" : n.kind ?? "leaf",
|
|
2142
2156
|
rowId: d,
|
|
2143
2157
|
rowKey: d,
|
|
2144
2158
|
state: {
|
|
2145
|
-
...
|
|
2159
|
+
...w ?? {},
|
|
2146
2160
|
selected: !1,
|
|
2147
2161
|
group: !1,
|
|
2148
2162
|
pinned: "none",
|
|
2149
2163
|
expanded: !1
|
|
2150
2164
|
},
|
|
2151
|
-
data:
|
|
2152
|
-
row: Y(
|
|
2165
|
+
data: a,
|
|
2166
|
+
row: Y(a)
|
|
2153
2167
|
};
|
|
2154
2168
|
}, ot = (t, n = null) => n && de(n) ? lt(t, n, "clone") : Pt(t), Fe = (t, n = null) => n && de(n) ? lt(t, n, "blank") : Lt(t), De = (t) => {
|
|
2155
|
-
const u = (e.rowSelectionSnapshot.value?.selectedRows ?? []).map((
|
|
2169
|
+
const u = (e.rowSelectionSnapshot.value?.selectedRows ?? []).map((w) => String(w)).filter((w) => w.length > 0 && nt(w)?.kind !== "group");
|
|
2156
2170
|
if (u.length > 0)
|
|
2157
2171
|
return u;
|
|
2158
|
-
const d = Ie(),
|
|
2159
|
-
if (d &&
|
|
2160
|
-
const
|
|
2161
|
-
if (
|
|
2172
|
+
const d = Ie(), a = R.value.length - 1;
|
|
2173
|
+
if (d && a >= 0) {
|
|
2174
|
+
const w = Math.min(d.startColumn, d.endColumn), v = Math.max(d.startColumn, d.endColumn), O = Math.min(d.startRow, d.endRow), p = Math.max(d.startRow, d.endRow), _ = t.length > 0 ? e.runtime.resolveBodyRowIndexById(t) : -1;
|
|
2175
|
+
if (w === 0 && v === a && (_ < 0 || _ >= O && _ <= p)) {
|
|
2162
2176
|
const K = [];
|
|
2163
2177
|
for (let T = O; T <= p; T += 1) {
|
|
2164
2178
|
const E = e.runtime.getBodyRowAtIndex(T);
|
|
@@ -2180,8 +2194,8 @@ const no = {
|
|
|
2180
2194
|
if (!ce() || t.length === 0)
|
|
2181
2195
|
return !1;
|
|
2182
2196
|
const n = new Set(t), u = rt().filter((d) => {
|
|
2183
|
-
const
|
|
2184
|
-
return
|
|
2197
|
+
const a = me(d);
|
|
2198
|
+
return a == null || !n.has(a);
|
|
2185
2199
|
});
|
|
2186
2200
|
return u.length === e.runtime.api.rows.getCount() ? !1 : (e.runtime.api.rows.replaceData(u), e.runtime.api.rowSelection.hasSupport() && (e.runtime.api.rowSelection.clearSelectedRows(), e.syncRowSelectionSnapshotFromRuntime?.()), !0);
|
|
2187
2201
|
}, Nt = (t, n) => {
|
|
@@ -2190,20 +2204,20 @@ const no = {
|
|
|
2190
2204
|
const u = rt(), d = new Set(t.map((O) => String(O)));
|
|
2191
2205
|
if (d.has(String(n)))
|
|
2192
2206
|
return !1;
|
|
2193
|
-
const
|
|
2207
|
+
const a = u.filter((O) => {
|
|
2194
2208
|
const p = me(O);
|
|
2195
2209
|
return p != null && d.has(p);
|
|
2196
2210
|
});
|
|
2197
|
-
if (
|
|
2211
|
+
if (a.length === 0)
|
|
2198
2212
|
return !1;
|
|
2199
|
-
const
|
|
2213
|
+
const w = u.filter((O) => {
|
|
2200
2214
|
const p = me(O);
|
|
2201
2215
|
return p == null || !d.has(p);
|
|
2202
|
-
}), v =
|
|
2216
|
+
}), v = w.findIndex((O) => me(O) === n);
|
|
2203
2217
|
return v < 0 ? !1 : (e.runtime.api.rows.replaceData([
|
|
2204
|
-
...
|
|
2205
|
-
...
|
|
2206
|
-
...
|
|
2218
|
+
...w.slice(0, v + 1),
|
|
2219
|
+
...a,
|
|
2220
|
+
...w.slice(v + 1)
|
|
2207
2221
|
]), e.runtime.api.rowSelection.hasSupport() && (e.runtime.api.rowSelection.selectRows(t), e.syncRowSelectionSnapshotFromRuntime?.()), !0);
|
|
2208
2222
|
}, Kt = () => j.value ? (j.value = null, !0) : !1, $t = (t) => {
|
|
2209
2223
|
if (t.kind === "group")
|
|
@@ -2211,7 +2225,7 @@ const no = {
|
|
|
2211
2225
|
const n = j.value;
|
|
2212
2226
|
return n ? n.sourceRowIds.includes(String(t.rowId)) : !1;
|
|
2213
2227
|
};
|
|
2214
|
-
let
|
|
2228
|
+
let at = () => !1, le = () => {
|
|
2215
2229
|
}, Ee = () => {
|
|
2216
2230
|
}, ke = async (t, n) => !1;
|
|
2217
2231
|
const Ut = (t, n) => {
|
|
@@ -2221,7 +2235,7 @@ const no = {
|
|
|
2221
2235
|
return d ? `${u} (${d})` : u;
|
|
2222
2236
|
}, {
|
|
2223
2237
|
tableStageProps: He,
|
|
2224
|
-
tableStageContext:
|
|
2238
|
+
tableStageContext: it,
|
|
2225
2239
|
copySelectedCells: qt,
|
|
2226
2240
|
pasteSelectedCells: Xt,
|
|
2227
2241
|
cutSelectedCells: Yt,
|
|
@@ -2230,37 +2244,39 @@ const no = {
|
|
|
2230
2244
|
recordHistoryIntentTransaction: Zt
|
|
2231
2245
|
} = Bl({
|
|
2232
2246
|
mode: y,
|
|
2233
|
-
layoutMode:
|
|
2234
|
-
minRows:
|
|
2235
|
-
maxRows:
|
|
2247
|
+
layoutMode: m(() => e.layoutMode),
|
|
2248
|
+
minRows: m(() => e.minRows),
|
|
2249
|
+
maxRows: m(() => e.maxRows),
|
|
2250
|
+
enableFillHandle: m(() => e.fillHandle),
|
|
2251
|
+
enableRangeMove: m(() => e.rangeMove),
|
|
2236
2252
|
rows: A,
|
|
2237
2253
|
sourceRows: A,
|
|
2238
2254
|
runtime: e.runtime,
|
|
2239
2255
|
rowVersion: o,
|
|
2240
2256
|
totalRuntimeRows: b,
|
|
2241
2257
|
visibleColumns: R,
|
|
2242
|
-
rowRenderMode:
|
|
2258
|
+
rowRenderMode: m(() => e.renderMode),
|
|
2243
2259
|
rowHeightMode: M,
|
|
2244
2260
|
normalizedBaseRowHeight: x,
|
|
2245
2261
|
selectionSnapshot: e.selectionSnapshot,
|
|
2246
2262
|
selectionAnchor: e.selectionAnchor,
|
|
2247
2263
|
rowSelectionSnapshot: e.rowSelectionSnapshot,
|
|
2248
|
-
rowHover:
|
|
2249
|
-
stripedRows:
|
|
2250
|
-
showRowIndex:
|
|
2251
|
-
showRowSelection:
|
|
2264
|
+
rowHover: m(() => e.rowHover),
|
|
2265
|
+
stripedRows: m(() => e.stripedRows),
|
|
2266
|
+
showRowIndex: m(() => e.showRowIndex),
|
|
2267
|
+
showRowSelection: m(() => e.rowSelection),
|
|
2252
2268
|
isRowInPendingClipboardCut: $t,
|
|
2253
2269
|
syncSelectionSnapshotFromRuntime: e.syncSelectionSnapshotFromRuntime,
|
|
2254
2270
|
syncRowSelectionSnapshotFromRuntime: e.syncRowSelectionSnapshotFromRuntime,
|
|
2255
2271
|
clearExternalPendingClipboardOperation: Kt,
|
|
2256
2272
|
firstColumnKey: W,
|
|
2257
2273
|
columnFilterTextByKey: s,
|
|
2258
|
-
virtualization:
|
|
2274
|
+
virtualization: m(() => e.virtualization),
|
|
2259
2275
|
toggleSortForColumn: Ue,
|
|
2260
2276
|
sortIndicator: qe,
|
|
2261
2277
|
setColumnFilterText: Et,
|
|
2262
|
-
columnMenuEnabled:
|
|
2263
|
-
columnMenuMaxFilterValues:
|
|
2278
|
+
columnMenuEnabled: m(() => e.columnMenu.enabled),
|
|
2279
|
+
columnMenuMaxFilterValues: m(() => e.columnMenu.maxFilterValues),
|
|
2264
2280
|
resolveColumnMenuItems: ye,
|
|
2265
2281
|
resolveColumnMenuDisabledItems: Le,
|
|
2266
2282
|
resolveColumnMenuDisabledReasons: We,
|
|
@@ -2279,7 +2295,7 @@ const no = {
|
|
|
2279
2295
|
applyRowHeightSettings: kt,
|
|
2280
2296
|
cloneRowData: Y,
|
|
2281
2297
|
isCellEditable: e.isCellEditable,
|
|
2282
|
-
isContextMenuVisible: () =>
|
|
2298
|
+
isContextMenuVisible: () => at(),
|
|
2283
2299
|
closeContextMenu: () => le(),
|
|
2284
2300
|
openContextMenuFromCurrentCell: () => {
|
|
2285
2301
|
Ee();
|
|
@@ -2293,8 +2309,8 @@ const no = {
|
|
|
2293
2309
|
openContextMenu: Ve,
|
|
2294
2310
|
onContextMenuKeyDown: en
|
|
2295
2311
|
} = Wn();
|
|
2296
|
-
|
|
2297
|
-
const tn =
|
|
2312
|
+
at = () => z.value.visible, le = X;
|
|
2313
|
+
const tn = al({
|
|
2298
2314
|
isInteractionBlocked: () => !1,
|
|
2299
2315
|
isRangeMoveModifierActive: () => !1,
|
|
2300
2316
|
resolveSelectionRange: Ie,
|
|
@@ -2313,7 +2329,7 @@ const no = {
|
|
|
2313
2329
|
closeContextMenu: X,
|
|
2314
2330
|
isColumnContextEnabled: (t) => e.cellMenu.enabled ? wt(e.cellMenu, t).length > 0 : !1,
|
|
2315
2331
|
isRowIndexContextEnabled: () => e.rowIndexMenu.enabled && e.showRowIndex
|
|
2316
|
-
}), nn =
|
|
2332
|
+
}), nn = il({
|
|
2317
2333
|
resolveCurrentCellCoord: et,
|
|
2318
2334
|
resolveViewportElement: () => ee.value,
|
|
2319
2335
|
resolveRowAtIndex: (t) => e.runtime.getBodyRowAtIndex(t) ?? void 0,
|
|
@@ -2333,10 +2349,10 @@ const no = {
|
|
|
2333
2349
|
const n = String(t), u = `.datagrid-stage__row-index-cell[data-row-id="${Nl(n)}"]`, d = ee.value.querySelector(u);
|
|
2334
2350
|
if (!d)
|
|
2335
2351
|
return !1;
|
|
2336
|
-
const
|
|
2352
|
+
const a = d.getBoundingClientRect();
|
|
2337
2353
|
return Ve(
|
|
2338
|
-
|
|
2339
|
-
|
|
2354
|
+
a.left + Math.max(10, Math.min(a.width / 2, Math.max(10, a.width - 10))),
|
|
2355
|
+
a.bottom - 4,
|
|
2340
2356
|
{
|
|
2341
2357
|
zone: "row-index",
|
|
2342
2358
|
rowId: n
|
|
@@ -2358,20 +2374,20 @@ const no = {
|
|
|
2358
2374
|
if (t === "insert-row-above") {
|
|
2359
2375
|
if (!te())
|
|
2360
2376
|
return !1;
|
|
2361
|
-
const
|
|
2377
|
+
const a = we(), w = e.runtime.api.rows.insertDataBefore(
|
|
2362
2378
|
n,
|
|
2363
2379
|
[Fe(d.data, ne(u))]
|
|
2364
2380
|
);
|
|
2365
|
-
return
|
|
2381
|
+
return w && fe(a, "Insert row above"), w;
|
|
2366
2382
|
}
|
|
2367
2383
|
if (t === "insert-row-below") {
|
|
2368
2384
|
if (!te())
|
|
2369
2385
|
return !1;
|
|
2370
|
-
const
|
|
2386
|
+
const a = we(), w = e.runtime.api.rows.insertDataAfter(
|
|
2371
2387
|
n,
|
|
2372
2388
|
[Fe(d.data, ne(u))]
|
|
2373
2389
|
);
|
|
2374
|
-
return
|
|
2390
|
+
return w && fe(a, "Insert row below"), w;
|
|
2375
2391
|
}
|
|
2376
2392
|
if (t === "copy-row")
|
|
2377
2393
|
return Ae([d.data], "copy", [u]);
|
|
@@ -2380,26 +2396,26 @@ const no = {
|
|
|
2380
2396
|
if (t === "paste-row") {
|
|
2381
2397
|
if (!te())
|
|
2382
2398
|
return !1;
|
|
2383
|
-
const
|
|
2384
|
-
if (!
|
|
2399
|
+
const a = await Gt();
|
|
2400
|
+
if (!a || a.length === 0)
|
|
2385
2401
|
return !1;
|
|
2386
|
-
const
|
|
2402
|
+
const w = we(), v = j.value?.operation === "cut" ? j.value.sourceRowIds : [], O = ne(
|
|
2387
2403
|
v[0] ?? u
|
|
2388
2404
|
) ?? ne(u), p = v.length > 0 ? Nt(v, u) : e.runtime.api.rows.insertDataAfter(
|
|
2389
2405
|
n,
|
|
2390
|
-
|
|
2406
|
+
a.map((_) => ot(_, O))
|
|
2391
2407
|
);
|
|
2392
2408
|
return p && j.value?.operation === "cut" && (j.value = null), p && fe(
|
|
2393
|
-
|
|
2394
|
-
v.length > 0 ? v.length > 1 ? `Move ${v.length} rows` : "Move row" :
|
|
2409
|
+
w,
|
|
2410
|
+
v.length > 0 ? v.length > 1 ? `Move ${v.length} rows` : "Move row" : a.length > 1 ? `Paste ${a.length} rows` : "Paste row"
|
|
2395
2411
|
), p;
|
|
2396
2412
|
}
|
|
2397
2413
|
if (t === "delete-selected-rows") {
|
|
2398
|
-
const
|
|
2399
|
-
if (
|
|
2414
|
+
const a = De(u);
|
|
2415
|
+
if (a.length === 0)
|
|
2400
2416
|
return !1;
|
|
2401
|
-
const
|
|
2402
|
-
return v && fe(
|
|
2417
|
+
const w = we(), v = Wt(a);
|
|
2418
|
+
return v && fe(w, a.length > 1 ? `Delete ${a.length} rows` : "Delete row"), v;
|
|
2403
2419
|
}
|
|
2404
2420
|
return !1;
|
|
2405
2421
|
};
|
|
@@ -2416,7 +2432,7 @@ const no = {
|
|
|
2416
2432
|
cutSelection: Yt,
|
|
2417
2433
|
clearCurrentSelection: Jt,
|
|
2418
2434
|
closeContextMenu: X
|
|
2419
|
-
}), ut =
|
|
2435
|
+
}), ut = m(() => {
|
|
2420
2436
|
if (!z.value.visible)
|
|
2421
2437
|
return [];
|
|
2422
2438
|
const t = z.value.zone;
|
|
@@ -2424,11 +2440,11 @@ const no = {
|
|
|
2424
2440
|
const n = z.value.columnKey ?? "";
|
|
2425
2441
|
if (!e.cellMenu.enabled || !n)
|
|
2426
2442
|
return [];
|
|
2427
|
-
const u = wt(e.cellMenu, n), d = new Set(hl(e.cellMenu, n)),
|
|
2443
|
+
const u = wt(e.cellMenu, n), d = new Set(hl(e.cellMenu, n)), a = bl(e.cellMenu, n), w = yl(e.cellMenu, n);
|
|
2428
2444
|
return u.flatMap((v, O) => {
|
|
2429
2445
|
const p = no[v] ?? [];
|
|
2430
2446
|
return p.flatMap((_) => {
|
|
2431
|
-
const T =
|
|
2447
|
+
const T = w[_];
|
|
2432
2448
|
if (T?.hidden)
|
|
2433
2449
|
return [];
|
|
2434
2450
|
const E = d.has(v) || T?.disabled === !0;
|
|
@@ -2436,7 +2452,7 @@ const no = {
|
|
|
2436
2452
|
id: _,
|
|
2437
2453
|
label: T?.label ?? In[_],
|
|
2438
2454
|
disabled: E,
|
|
2439
|
-
title: T?.disabledReason ??
|
|
2455
|
+
title: T?.disabledReason ?? a[v],
|
|
2440
2456
|
separatorBefore: O > 0 && _ === p[0]
|
|
2441
2457
|
}];
|
|
2442
2458
|
});
|
|
@@ -2445,14 +2461,14 @@ const no = {
|
|
|
2445
2461
|
if (t === "row-index") {
|
|
2446
2462
|
if (!e.rowIndexMenu.enabled)
|
|
2447
2463
|
return [];
|
|
2448
|
-
const n = Rl(e.rowIndexMenu), u = new Set(Sl(e.rowIndexMenu)), d = Ml(e.rowIndexMenu),
|
|
2449
|
-
return n.flatMap((
|
|
2450
|
-
const O = lo[
|
|
2464
|
+
const n = Rl(e.rowIndexMenu), u = new Set(Sl(e.rowIndexMenu)), d = Ml(e.rowIndexMenu), a = pl(e.rowIndexMenu);
|
|
2465
|
+
return n.flatMap((w, v) => {
|
|
2466
|
+
const O = lo[w] ?? [];
|
|
2451
2467
|
return O.flatMap((p) => {
|
|
2452
|
-
const K =
|
|
2468
|
+
const K = a[p === "insert-row-above" ? "insertAbove" : p === "insert-row-below" ? "insertBelow" : p === "copy-row" ? "copy" : p === "paste-row" ? "paste" : p === "delete-selected-rows" ? "deleteSelected" : "cut"];
|
|
2453
2469
|
if (K?.hidden)
|
|
2454
2470
|
return [];
|
|
2455
|
-
let T = u.has(
|
|
2471
|
+
let T = u.has(w) || K?.disabled === !0, E = K?.disabledReason ?? d[w];
|
|
2456
2472
|
return (p === "insert-row-above" || p === "insert-row-below" || p === "paste-row") && !te() && (T = !0, E = E ?? "Row insertion is not supported by the current row model"), (p === "cut-row" || p === "delete-selected-rows") && !ce() && (T = !0, E = E ?? "Row deletion is not supported by the current row model"), p === "delete-selected-rows" && De(z.value.rowId ?? "").length === 0 && (T = !0, E = E ?? "No deletable rows are selected"), [{
|
|
2457
2473
|
id: p,
|
|
2458
2474
|
label: Ut(p, K?.label),
|
|
@@ -2486,18 +2502,18 @@ const no = {
|
|
|
2486
2502
|
(t, n, u) => {
|
|
2487
2503
|
if (!t || typeof window > "u")
|
|
2488
2504
|
return;
|
|
2489
|
-
const d = (
|
|
2490
|
-
const v =
|
|
2505
|
+
const d = (w) => {
|
|
2506
|
+
const v = w.target;
|
|
2491
2507
|
v && st.value?.contains(v) || X();
|
|
2492
|
-
},
|
|
2508
|
+
}, a = () => {
|
|
2493
2509
|
X();
|
|
2494
2510
|
};
|
|
2495
|
-
window.addEventListener("mousedown", d, !0), window.addEventListener("blur",
|
|
2496
|
-
window.removeEventListener("mousedown", d, !0), window.removeEventListener("blur",
|
|
2511
|
+
window.addEventListener("mousedown", d, !0), window.addEventListener("blur", a), u(() => {
|
|
2512
|
+
window.removeEventListener("mousedown", d, !0), window.removeEventListener("blur", a);
|
|
2497
2513
|
});
|
|
2498
2514
|
}
|
|
2499
2515
|
);
|
|
2500
|
-
const dt =
|
|
2516
|
+
const dt = m(() => ({
|
|
2501
2517
|
...He.value,
|
|
2502
2518
|
columns: {
|
|
2503
2519
|
...He.value.columns,
|
|
@@ -2525,7 +2541,7 @@ const no = {
|
|
|
2525
2541
|
rowHover: e.rowHover,
|
|
2526
2542
|
stripedRows: e.stripedRows
|
|
2527
2543
|
}
|
|
2528
|
-
})), sn =
|
|
2544
|
+
})), sn = m(() => {
|
|
2529
2545
|
const t = [];
|
|
2530
2546
|
return e.columnLayout.enabled && t.push({
|
|
2531
2547
|
key: "column-layout",
|
|
@@ -2569,9 +2585,9 @@ const no = {
|
|
|
2569
2585
|
basis: G.value,
|
|
2570
2586
|
items: be.value,
|
|
2571
2587
|
buttonLabel: e.aggregations.buttonLabel,
|
|
2572
|
-
active:
|
|
2573
|
-
disabled: !
|
|
2574
|
-
disabledReason:
|
|
2588
|
+
active: ae.value && (D.value || !!ie.value?.columns.length),
|
|
2589
|
+
disabled: !ae.value,
|
|
2590
|
+
disabledReason: ae.value ? "" : "Aggregations require an active group-by model.",
|
|
2575
2591
|
onOpen: Ht,
|
|
2576
2592
|
onUpdateBasis: Vt,
|
|
2577
2593
|
onToggleColumn: zt,
|
|
@@ -2605,14 +2621,14 @@ const no = {
|
|
|
2605
2621
|
ref: ee
|
|
2606
2622
|
}, [
|
|
2607
2623
|
e.viewMode === "gantt" ? k(Ll, {
|
|
2608
|
-
stageContext:
|
|
2624
|
+
stageContext: it,
|
|
2609
2625
|
runtime: e.runtime,
|
|
2610
2626
|
gantt: e.gantt,
|
|
2611
2627
|
baseRowHeight: x.value,
|
|
2612
2628
|
rowVersion: o.value
|
|
2613
2629
|
}) : k(cl, {
|
|
2614
2630
|
...dt.value,
|
|
2615
|
-
stageContext:
|
|
2631
|
+
stageContext: it,
|
|
2616
2632
|
onViewportContextMenu: rn
|
|
2617
2633
|
}),
|
|
2618
2634
|
z.value.visible && ut.value.length > 0 ? k("div", {
|
|
@@ -2673,10 +2689,10 @@ function ro(e) {
|
|
|
2673
2689
|
expandedByDefault: r
|
|
2674
2690
|
}), wn.set(e, l), l;
|
|
2675
2691
|
}
|
|
2676
|
-
function
|
|
2692
|
+
function ao(e) {
|
|
2677
2693
|
return !e || e.length === 0 ? [] : e.map((o) => ({ ...o }));
|
|
2678
2694
|
}
|
|
2679
|
-
function
|
|
2695
|
+
function io(e) {
|
|
2680
2696
|
return !e || e.length === 0 ? [] : e.map((o) => ({ ...o }));
|
|
2681
2697
|
}
|
|
2682
2698
|
function so(e) {
|
|
@@ -2695,7 +2711,7 @@ function co(e, o) {
|
|
|
2695
2711
|
const r = /* @__PURE__ */ new Map();
|
|
2696
2712
|
for (const l of e)
|
|
2697
2713
|
r.set(l.name, { ...l });
|
|
2698
|
-
for (const l of
|
|
2714
|
+
for (const l of ao(o))
|
|
2699
2715
|
r.set(l.name, l);
|
|
2700
2716
|
return Array.from(r.values());
|
|
2701
2717
|
}
|
|
@@ -2703,7 +2719,7 @@ function Mo(e) {
|
|
|
2703
2719
|
return so(e);
|
|
2704
2720
|
}
|
|
2705
2721
|
function po(e) {
|
|
2706
|
-
const o = ro(e.clientRowModelOptions), r = e.enterpriseClientRowModelOptions, l = uo(e.columns), s = e.formulas !== void 0,
|
|
2722
|
+
const o = ro(e.clientRowModelOptions), r = e.enterpriseClientRowModelOptions, l = uo(e.columns), s = e.formulas !== void 0, i = e.computedFields !== void 0, f = e.formulaFunctions !== void 0, C = l.length > 0, y = s || C ? co(l, e.formulas) : void 0, A = i ? io(e.computedFields) : void 0, b = f ? e.formulaFunctions ?? {} : void 0, R = !!(C || s || i || f);
|
|
2707
2723
|
if (!o && !R)
|
|
2708
2724
|
return r ? {
|
|
2709
2725
|
...r
|
|
@@ -2731,7 +2747,7 @@ function po(e) {
|
|
|
2731
2747
|
}
|
|
2732
2748
|
return {
|
|
2733
2749
|
...o ?? {},
|
|
2734
|
-
...
|
|
2750
|
+
...i ? { initialComputedFields: A } : {},
|
|
2735
2751
|
...s || C ? { initialFormulaFields: y } : {},
|
|
2736
2752
|
...f ? { initialFormulaFunctionRegistry: b } : {},
|
|
2737
2753
|
...r?.computeMode ? { computeMode: r.computeMode } : {},
|
|
@@ -2764,12 +2780,12 @@ function Io(e) {
|
|
|
2764
2780
|
})
|
|
2765
2781
|
), s = (C) => {
|
|
2766
2782
|
!C || C === e.rowModel.value || "dispose" in C && typeof C.dispose == "function" && C.dispose();
|
|
2767
|
-
},
|
|
2783
|
+
}, i = () => {
|
|
2768
2784
|
e.rowModel.value || (s(l.value), l.value = un({
|
|
2769
2785
|
rows: e.rows.value,
|
|
2770
2786
|
...On(e.clientRowModelOptions.value)
|
|
2771
2787
|
}), o.value += 1, e.onOwnedRowModelRecreated?.());
|
|
2772
|
-
}, f =
|
|
2788
|
+
}, f = m(() => e.rowModel.value ?? l.value ?? r);
|
|
2773
2789
|
return L(
|
|
2774
2790
|
e.rows,
|
|
2775
2791
|
(C) => {
|
|
@@ -2779,7 +2795,7 @@ function Io(e) {
|
|
|
2779
2795
|
), L(
|
|
2780
2796
|
e.clientRowModelOptions,
|
|
2781
2797
|
() => {
|
|
2782
|
-
|
|
2798
|
+
i();
|
|
2783
2799
|
},
|
|
2784
2800
|
{ deep: !0 }
|
|
2785
2801
|
), L(
|
|
@@ -2789,7 +2805,7 @@ function Io(e) {
|
|
|
2789
2805
|
s(l.value), l.value = null, o.value += 1;
|
|
2790
2806
|
return;
|
|
2791
2807
|
}
|
|
2792
|
-
l.value ||
|
|
2808
|
+
l.value || i();
|
|
2793
2809
|
}
|
|
2794
2810
|
), En(() => {
|
|
2795
2811
|
s(l.value), s(r);
|