@affino/datagrid-vue-app 0.1.13 → 0.1.15

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.
@@ -1,2854 +0,0 @@
1
- import { defineComponent as Fn, h as k, computed as m, unref as c, ref as L, nextTick as Dn, onBeforeUnmount as En, watch as W, defineAsyncComponent as gt, shallowRef as _n } from "vue";
2
- import { resolveDataGridCellClickAction as Gn, invokeDataGridCellInteraction as Pn, toggleDataGridCellValue as Ln, buildDataGridCellRenderModel as Wn, useDataGridContextMenu as Nn, cloneDataGridFilterSnapshot as Kn, createClientRowModel as un } from "@affino/datagrid-vue";
3
- import { useDataGridAppIntentHistory as $n, createDataGridAppRowHeightMetrics as Un, useDataGridAppViewport as qn, useDataGridAppRowSizing as Xn, useDataGridAppCellSelection as Yn, useDataGridAppRowPresentation as Jn, useDataGridAppClipboard as Zn, useDataGridAppActiveCellViewport as Qn, useDataGridAppInlineEditing as el, useDataGridAppInteractionController as tl, useDataGridAppHeaderResize as nl, useDataGridAppRuntimeSync as ll, useDataGridAppViewportLifecycle as ol, useDataGridAppColumnLayoutPanel as rl, useDataGridAppAdvancedFilterBuilder as al } from "@affino/datagrid-vue/app";
4
- import { useDataGridViewportContextMenuRouter as il, useDataGridContextMenuAnchor as sl, useDataGridContextMenuActionRouter as ul } from "@affino/datagrid-vue/advanced";
5
- import { c as cl, _ as dl } from "./DataGridTableStage.vue_vue_type_script_setup_true_lang-Cec3mpHC.js";
6
- const ml = Fn({
7
- name: "DataGridModuleHost",
8
- props: {
9
- modules: {
10
- type: Array,
11
- default: () => []
12
- }
13
- },
14
- setup(e) {
15
- return () => e.modules.length === 0 ? null : k("div", { class: "datagrid-app-toolbar" }, [
16
- k("div", { class: "datagrid-app-toolbar__group" }, e.modules.map((o) => k(o.component, {
17
- key: o.key,
18
- ...o.props ?? {}
19
- })))
20
- ]);
21
- }
22
- }), Z = ["sort", "group", "pin", "filter"], kn = [
23
- "sortAsc",
24
- "sortDesc",
25
- "clearSort",
26
- "toggleGroup",
27
- "pinMenu",
28
- "pinLeft",
29
- "pinRight",
30
- "unpin",
31
- "clearFilter",
32
- "addCurrentSelectionToFilter",
33
- "selectAllValues",
34
- "clearAllValues",
35
- "applyFilter",
36
- "cancelFilter"
37
- ], cn = 120;
38
- function bn(e) {
39
- const o = new Set(Z), r = Array.isArray(e) ? e : Z, l = [];
40
- for (const s of r)
41
- !o.has(s) || l.includes(s) || l.push(s);
42
- return l.length > 0 ? l : [...Z];
43
- }
44
- function fn(e) {
45
- if (!Array.isArray(e))
46
- return [];
47
- const o = new Set(Z), r = [];
48
- for (const l of e)
49
- !o.has(l) || r.includes(l) || r.push(l);
50
- return r;
51
- }
52
- function Hn(e) {
53
- if (!e)
54
- return Object.freeze({});
55
- const o = Object.entries(e).filter(([r, l]) => Z.includes(r) && typeof l == "string").map(([r, l]) => [r, l.trim()]).filter(([, r]) => r.length > 0);
56
- return Object.freeze(Object.fromEntries(o));
57
- }
58
- function Vn(e) {
59
- if (!e)
60
- return Object.freeze({});
61
- const o = Object.entries(e).filter(([r, l]) => Z.includes(r) && typeof l == "string").map(([r, l]) => [r, l.trim()]).filter(([, r]) => r.length > 0);
62
- return Object.freeze(Object.fromEntries(o));
63
- }
64
- function zn(e) {
65
- if (!e)
66
- return Object.freeze({});
67
- const o = Object.entries(e).filter(([r, l]) => kn.includes(r) && !!l).map(([r, l]) => {
68
- const s = l, i = {
69
- ...s.hidden === !0 ? { hidden: !0 } : {},
70
- ...s.disabled === !0 ? { disabled: !0 } : {},
71
- ...typeof s.disabledReason == "string" && s.disabledReason.trim().length > 0 ? { disabledReason: s.disabledReason.trim() } : {},
72
- ...typeof s.label == "string" && s.label.trim().length > 0 ? { label: s.label.trim() } : {}
73
- };
74
- return [r, Object.freeze(i)];
75
- }).filter(([, r]) => Object.keys(r).length > 0);
76
- return Object.freeze(Object.fromEntries(o));
77
- }
78
- function wl(e) {
79
- if (!e)
80
- return {};
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, i = fn(l?.hide), f = fn(l?.disabled), C = Vn(l?.disabledReasons), y = Hn(l?.labels), x = zn(l?.actions);
83
- return [
84
- r,
85
- {
86
- ...s ? { items: s } : {},
87
- ...i.length > 0 ? { hide: i } : {},
88
- ...f.length > 0 ? { disabled: f } : {},
89
- ...Object.keys(C).length > 0 ? { disabledReasons: C } : {},
90
- ...Object.keys(y).length > 0 ? { labels: y } : {},
91
- ...Object.keys(x).length > 0 ? { actions: x } : {}
92
- }
93
- ];
94
- });
95
- return Object.fromEntries(o);
96
- }
97
- function yo(e) {
98
- return typeof e == "boolean" ? {
99
- enabled: e,
100
- maxFilterValues: cn,
101
- items: [...Z],
102
- disabled: [],
103
- disabledReasons: Object.freeze({}),
104
- labels: Object.freeze({}),
105
- actions: Object.freeze({}),
106
- columns: {}
107
- } : e ? {
108
- enabled: e.enabled ?? !0,
109
- maxFilterValues: Number.isFinite(e.maxFilterValues) ? Math.max(20, Math.trunc(e.maxFilterValues)) : cn,
110
- items: bn(e.items),
111
- disabled: fn(e.disabled),
112
- disabledReasons: Vn(e.disabledReasons),
113
- labels: Hn(e.labels),
114
- actions: zn(e.actions),
115
- columns: wl(e.columns)
116
- } : {
117
- enabled: !1,
118
- maxFilterValues: cn,
119
- items: [...Z],
120
- disabled: [],
121
- disabledReasons: Object.freeze({}),
122
- labels: Object.freeze({}),
123
- actions: Object.freeze({}),
124
- columns: {}
125
- };
126
- }
127
- function Tn(e, o) {
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
- }
131
- function fl(e, o) {
132
- const r = Tn(e, o), l = new Set(e.columns[o]?.disabled ?? []), s = new Set(e.disabled);
133
- return r.filter((i) => s.has(i) || l.has(i));
134
- }
135
- function gl(e, o) {
136
- return Object.freeze({
137
- ...e.labels,
138
- ...e.columns[o]?.labels ?? {}
139
- });
140
- }
141
- function Cl(e, o) {
142
- return Object.freeze({
143
- ...e.disabledReasons,
144
- ...e.columns[o]?.disabledReasons ?? {}
145
- });
146
- }
147
- function vl(e, o) {
148
- const r = e.columns[o]?.actions ?? {}, l = kn.map((s) => {
149
- const i = {
150
- ...e.actions[s] ?? {},
151
- ...r[s] ?? {}
152
- };
153
- return [s, Object.freeze(i)];
154
- }).filter(([, s]) => Object.keys(s).length > 0);
155
- return Object.freeze(Object.fromEntries(l));
156
- }
157
- const _ = ["clipboard", "edit"], yn = ["cut", "copy", "paste", "clear"], ve = ["insert", "clipboard", "selection"], jn = [
158
- "insertAbove",
159
- "insertBelow",
160
- "cut",
161
- "copy",
162
- "paste",
163
- "deleteSelected"
164
- ];
165
- function Ct(e, o) {
166
- const r = new Set(o), l = Array.isArray(e) ? e : o, s = [];
167
- for (const i of l)
168
- !r.has(i) || s.includes(i) || s.push(i);
169
- return s.length > 0 ? s : [...o];
170
- }
171
- function ft(e, o) {
172
- if (!Array.isArray(e))
173
- return [];
174
- const r = new Set(o), l = [];
175
- for (const s of e)
176
- !r.has(s) || l.includes(s) || l.push(s);
177
- return l;
178
- }
179
- function he(e, o) {
180
- if (!e)
181
- return Object.freeze({});
182
- const r = Object.entries(e).filter((l) => o.includes(l[0]) && typeof l[1] == "string").map(([l, s]) => [l, s.trim()]).filter(([, l]) => l.length > 0);
183
- return Object.freeze(Object.fromEntries(r));
184
- }
185
- function Rn(e, o) {
186
- if (!e)
187
- return Object.freeze({});
188
- const r = Object.entries(e).filter(([l, s]) => o.includes(l) && !!s).map(([l, s]) => {
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
- };
195
- return [l, Object.freeze(f)];
196
- }).filter(([, l]) => Object.keys(l).length > 0);
197
- return Object.freeze(Object.fromEntries(r));
198
- }
199
- function hl(e) {
200
- if (!e)
201
- return {};
202
- const o = Object.entries(e).filter(([r]) => r.trim().length > 0).map(([r, l]) => {
203
- const s = l?.items ? Ct(l.items, _) : void 0, i = ft(l?.hide, _), f = ft(l?.disabled, _), C = he(l?.disabledReasons, _), y = he(l?.labels, _), x = Rn(l?.actions, yn);
204
- return [
205
- r,
206
- {
207
- ...s ? { items: s } : {},
208
- ...i.length > 0 ? { hide: i } : {},
209
- ...f.length > 0 ? { disabled: f } : {},
210
- ...Object.keys(C).length > 0 ? { disabledReasons: C } : {},
211
- ...Object.keys(y).length > 0 ? { labels: y } : {},
212
- ...Object.keys(x).length > 0 ? { actions: x } : {}
213
- }
214
- ];
215
- });
216
- return Object.freeze(Object.fromEntries(o));
217
- }
218
- function Ro(e) {
219
- return typeof e == "boolean" ? {
220
- enabled: e,
221
- items: [..._],
222
- disabled: [],
223
- disabledReasons: Object.freeze({}),
224
- labels: Object.freeze({}),
225
- actions: Object.freeze({}),
226
- columns: {}
227
- } : e ? {
228
- enabled: e.enabled ?? !0,
229
- items: Ct(e.items, _),
230
- disabled: ft(e.disabled, _),
231
- disabledReasons: he(e.disabledReasons, _),
232
- labels: he(e.labels, _),
233
- actions: Rn(e.actions, yn),
234
- columns: hl(e.columns)
235
- } : {
236
- enabled: !1,
237
- items: [..._],
238
- disabled: [],
239
- disabledReasons: Object.freeze({}),
240
- labels: Object.freeze({}),
241
- actions: Object.freeze({}),
242
- columns: {}
243
- };
244
- }
245
- function wt(e, o) {
246
- const r = e.columns[o], l = r?.items ? Ct(r.items, _) : e.items, s = new Set(r?.hide ?? []), i = l.filter((f) => !s.has(f));
247
- return i.length > 0 ? i : [];
248
- }
249
- function bl(e, o) {
250
- const r = wt(e, o), l = new Set(e.columns[o]?.disabled ?? []), s = new Set(e.disabled);
251
- return r.filter((i) => s.has(i) || l.has(i));
252
- }
253
- function yl(e, o) {
254
- return Object.freeze({
255
- ...e.disabledReasons,
256
- ...e.columns[o]?.disabledReasons ?? {}
257
- });
258
- }
259
- function Rl(e, o) {
260
- const r = e.columns[o]?.actions ?? {}, l = yn.map((s) => {
261
- const i = {
262
- ...e.actions[s] ?? {},
263
- ...r[s] ?? {}
264
- };
265
- return [s, Object.freeze(i)];
266
- }).filter(([, s]) => Object.keys(s).length > 0);
267
- return Object.freeze(Object.fromEntries(l));
268
- }
269
- function So(e) {
270
- return typeof e == "boolean" ? {
271
- enabled: e,
272
- items: [...ve],
273
- disabled: [],
274
- disabledReasons: Object.freeze({}),
275
- labels: Object.freeze({}),
276
- actions: Object.freeze({})
277
- } : e ? {
278
- enabled: e.enabled ?? !0,
279
- items: Ct(e.items, ve),
280
- disabled: ft(e.disabled, ve),
281
- disabledReasons: he(e.disabledReasons, ve),
282
- labels: he(e.labels, ve),
283
- actions: Rn(e.actions, jn)
284
- } : {
285
- enabled: !1,
286
- items: [...ve],
287
- disabled: [],
288
- disabledReasons: Object.freeze({}),
289
- labels: Object.freeze({}),
290
- actions: Object.freeze({})
291
- };
292
- }
293
- function Sl(e) {
294
- return e.items;
295
- }
296
- function Ml(e) {
297
- return e.disabled;
298
- }
299
- function pl(e) {
300
- return e.disabledReasons;
301
- }
302
- function Il(e) {
303
- const o = jn.map((r) => [r, Object.freeze({ ...e.actions[r] ?? {} })]).filter(([, r]) => Object.keys(r).length > 0);
304
- return Object.freeze(Object.fromEntries(o));
305
- }
306
- function Sn(e) {
307
- return (o) => {
308
- e.value = o instanceof HTMLElement ? o : null;
309
- };
310
- }
311
- function xl(e) {
312
- const o = Sn(e.headerViewportRef), r = Sn(e.bodyViewportRef), l = (I) => {
313
- e.editingCellValueRef.value = I;
314
- }, s = m(() => ({
315
- gridContentStyle: c(e.gridContentStyle),
316
- mainTrackStyle: c(e.mainTrackStyle),
317
- indexColumnStyle: c(e.indexColumnStyle),
318
- stageStyle: c(e.stageStyle),
319
- bodyShellStyle: c(e.bodyShellStyle),
320
- columnStyle: c(e.columnStyle)
321
- })), i = m(() => ({
322
- topSpacerHeight: c(e.topSpacerHeight),
323
- bottomSpacerHeight: c(e.bottomSpacerHeight),
324
- viewportRowStart: c(e.viewportRowStart),
325
- columnWindowStart: c(e.columnWindowStart),
326
- leftColumnSpacerWidth: c(e.leftColumnSpacerWidth),
327
- rightColumnSpacerWidth: c(e.rightColumnSpacerWidth),
328
- headerViewportRef: o,
329
- bodyViewportRef: r,
330
- handleHeaderWheel: c(e.handleHeaderWheel),
331
- handleHeaderScroll: c(e.handleHeaderScroll),
332
- handleViewportScroll: c(e.handleViewportScroll),
333
- handleViewportKeydown: c(e.handleViewportKeydown)
334
- })), f = m(() => ({
335
- visibleColumns: c(e.visibleColumns),
336
- renderedColumns: c(e.renderedColumns),
337
- columnFilterTextByKey: c(e.columnFilterTextByKey),
338
- toggleSortForColumn: c(e.toggleSortForColumn),
339
- sortIndicator: c(e.sortIndicator),
340
- setColumnFilterText: c(e.setColumnFilterText),
341
- columnMenuEnabled: c(e.columnMenuEnabled),
342
- columnMenuValueFilterEnabled: c(e.columnMenuValueFilterEnabled),
343
- columnMenuValueFilterRowLimit: c(e.columnMenuValueFilterRowLimit),
344
- columnMenuMaxFilterValues: c(e.columnMenuMaxFilterValues),
345
- resolveColumnMenuItems: c(e.resolveColumnMenuItems),
346
- resolveColumnMenuDisabledItems: c(e.resolveColumnMenuDisabledItems),
347
- resolveColumnMenuDisabledReasons: c(e.resolveColumnMenuDisabledReasons),
348
- resolveColumnMenuLabels: c(e.resolveColumnMenuLabels),
349
- resolveColumnMenuActionOptions: c(e.resolveColumnMenuActionOptions),
350
- isColumnFilterActive: c(e.isColumnFilterActive),
351
- isColumnGrouped: c(e.isColumnGrouped),
352
- resolveColumnGroupOrder: c(e.resolveColumnGroupOrder),
353
- resolveColumnMenuSortDirection: c(e.resolveColumnMenuSortDirection),
354
- resolveColumnMenuSelectedTokens: c(e.resolveColumnMenuSelectedTokens),
355
- applyColumnMenuSort: c(e.applyColumnMenuSort),
356
- applyColumnMenuPin: c(e.applyColumnMenuPin),
357
- applyColumnMenuGroupBy: c(e.applyColumnMenuGroupBy),
358
- applyColumnMenuFilter: c(e.applyColumnMenuFilter),
359
- clearColumnMenuFilter: c(e.clearColumnMenuFilter),
360
- startResize: c(e.startResize),
361
- handleResizeDoubleClick: c(e.handleResizeDoubleClick)
362
- })), C = m(() => ({
363
- displayRows: c(e.displayRows),
364
- pinnedBottomRows: c(e.pinnedBottomRows),
365
- sourceRows: c(e.sourceRows),
366
- showRowIndex: c(e.showRowIndex),
367
- rowHover: c(e.rowHover),
368
- stripedRows: c(e.stripedRows),
369
- rowClass: c(e.rowClass),
370
- isRowAutosizeProbe: c(e.isRowAutosizeProbe),
371
- rowStyle: c(e.rowStyle),
372
- isRowInPendingClipboardCut: c(e.isRowInPendingClipboardCut),
373
- isRowFocused: c(e.isRowFocused),
374
- isRowCheckboxSelected: c(e.isRowCheckboxSelected),
375
- allVisibleRowsSelected: c(e.allVisibleRowsSelected),
376
- someVisibleRowsSelected: c(e.someVisibleRowsSelected),
377
- handleRowClick: c(e.handleRowClick),
378
- handleRowIndexClick: c(e.handleRowIndexClick),
379
- handleRowIndexKeydown: c(e.handleRowIndexKeydown),
380
- handleToggleAllVisibleRows: c(e.handleToggleAllVisibleRows),
381
- toggleGroupRow: c(e.toggleGroupRow),
382
- rowIndexLabel: c(e.rowIndexLabel),
383
- startRowResize: c(e.startRowResize),
384
- autosizeRow: c(e.autosizeRow)
385
- })), y = m(() => ({
386
- selectionRange: c(e.selectionRange),
387
- selectionAnchorCell: c(e.selectionAnchorCell),
388
- fillPreviewRange: c(e.fillPreviewRange),
389
- rangeMovePreviewRange: c(e.rangeMovePreviewRange),
390
- fillHandleEnabled: c(e.fillHandleEnabled),
391
- rangeMoveEnabled: c(e.rangeMoveEnabled),
392
- isFillDragging: c(e.isFillDragging),
393
- isRangeMoving: c(e.isRangeMoving),
394
- fillActionAnchorCell: c(e.fillActionAnchorCell),
395
- fillActionBehavior: c(e.fillActionBehavior),
396
- applyFillActionBehavior: c(e.applyFillActionBehavior),
397
- isFillHandleCell: c(e.isFillHandleCell),
398
- startFillHandleDrag: c(e.startFillHandleDrag),
399
- startFillHandleDoubleClick: c(e.startFillHandleDoubleClick)
400
- })), x = m(() => ({
401
- editingCellValue: e.editingCellValueRef.value,
402
- editingCellInitialFilter: c(e.editingCellInitialFilter),
403
- editingCellOpenOnMount: c(e.editingCellOpenOnMount),
404
- isEditingCell: c(e.isEditingCell),
405
- startInlineEdit: c(e.startInlineEdit),
406
- updateEditingCellValue: l,
407
- handleEditorKeydown: c(e.handleEditorKeydown),
408
- commitInlineEdit: c(e.commitInlineEdit),
409
- cancelInlineEdit: c(e.cancelInlineEdit)
410
- })), b = m(() => ({
411
- cellClass: c(e.cellClass),
412
- cellStyle: c(e.cellStyle),
413
- isCellSelected: c(e.isCellSelected),
414
- isSelectionAnchorCell: c(e.isSelectionAnchorCell),
415
- shouldHighlightSelectedCell: c(e.shouldHighlightSelectedCell),
416
- isCellOnSelectionEdge: c(e.isCellOnSelectionEdge),
417
- isCellInFillPreview: c(e.isCellInFillPreview),
418
- isCellInPendingClipboardRange: c(e.isCellInPendingClipboardRange),
419
- isCellOnPendingClipboardEdge: c(e.isCellOnPendingClipboardEdge),
420
- isCellEditable: c(e.isCellEditable),
421
- readCell: c(e.readCell),
422
- readDisplayCell: c(e.readDisplayCell)
423
- })), S = m(() => ({
424
- handleCellMouseDown: c(e.handleCellMouseDown),
425
- handleCellClick: c(e.handleCellClick),
426
- handleCellKeydown: c(e.handleCellKeydown)
427
- })), M = m(() => ({
428
- mode: c(e.mode),
429
- rowHeightMode: c(e.rowHeightMode),
430
- layoutMode: c(e.layoutMode),
431
- layout: s.value,
432
- viewport: i.value,
433
- columns: f.value,
434
- rows: C.value,
435
- selection: y.value,
436
- editing: x.value,
437
- cells: b.value,
438
- interaction: S.value
439
- })), g = cl({
440
- mode: m(() => c(e.mode)),
441
- rowHeightMode: m(() => c(e.rowHeightMode)),
442
- layoutMode: m(() => c(e.layoutMode)),
443
- layout: s,
444
- viewport: i,
445
- columns: f,
446
- rows: C,
447
- selection: y,
448
- editing: x,
449
- cells: b,
450
- interaction: S
451
- });
452
- return {
453
- tableStageProps: M,
454
- tableStageContext: g,
455
- captureHeaderViewportRef: o,
456
- captureBodyViewportRef: r,
457
- updateEditingCellValue: l
458
- };
459
- }
460
- function Al(e) {
461
- return {
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) => {
465
- if (e.isRowSelectionColumn(f)) {
466
- e.toggleRowCheckboxSelected(s);
467
- return;
468
- }
469
- const y = e.viewportRowStart.value + i, x = e.isCellEditableByKey(s, y, f.key, C), b = Gn({
470
- column: f.column,
471
- row: s.kind !== "group" ? s.data : void 0,
472
- rowId: s.rowId,
473
- editable: x
474
- });
475
- if (b === "invoke") {
476
- Pn({
477
- column: f.column,
478
- row: s.kind !== "group" ? s.data : void 0,
479
- rowId: s.rowId,
480
- editable: x,
481
- trigger: "click"
482
- });
483
- return;
484
- }
485
- if (b !== "toggle" || s.kind === "group" || s.rowId == null)
486
- return;
487
- const S = e.captureHistorySnapshot();
488
- e.runtime.api.rows.applyEdits([
489
- {
490
- rowId: s.rowId,
491
- data: {
492
- [f.key]: Ln({
493
- column: f.column,
494
- row: s.data
495
- })
496
- }
497
- }
498
- ]), e.recordHistoryIntentTransaction({
499
- intent: "edit",
500
- label: `Toggle ${f.key}`,
501
- affectedRange: {
502
- startRow: y,
503
- endRow: y,
504
- startColumn: C,
505
- endColumn: C
506
- }
507
- }, S), e.syncViewport();
508
- }
509
- };
510
- }
511
- const Mn = 140, mt = 108, dn = "__datagrid_row_selection__";
512
- function Ol(e) {
513
- const o = m(() => (e.showRowSelection?.value ?? !0) && e.runtime.api.rowSelection.hasSupport()), r = m(() => o.value ? {
514
- key: dn,
515
- state: {
516
- visible: !0,
517
- pin: "left",
518
- width: mt
519
- },
520
- visible: !0,
521
- pin: "left",
522
- width: mt,
523
- column: {
524
- key: dn,
525
- label: "",
526
- cellType: "checkbox",
527
- cellInteraction: {
528
- click: !0,
529
- keyboard: ["enter", "space"],
530
- role: "checkbox",
531
- label: "Toggle row selection",
532
- checked: ({ rowId: g }) => g != null && e.runtime.api.rowSelection.isSelected(g),
533
- onInvoke: ({ rowId: g }) => {
534
- g == null || !e.runtime.api.rowSelection.hasSupport() || e.runtime.api.rowSelection.setSelected(
535
- g,
536
- !e.runtime.api.rowSelection.isSelected(g)
537
- );
538
- }
539
- },
540
- minWidth: mt,
541
- maxWidth: mt,
542
- capabilities: {
543
- editable: !0,
544
- sortable: !1,
545
- filterable: !1,
546
- groupable: !1,
547
- pivotable: !1,
548
- aggregatable: !1
549
- },
550
- presentation: {
551
- align: "center",
552
- headerAlign: "center"
553
- },
554
- meta: {
555
- isSystem: !0,
556
- rowSelection: !0
557
- }
558
- }
559
- } : null), l = (g) => g === dn, s = (g) => l(g.key), i = m(() => {
560
- const g = r.value, I = e.visibleColumns.value.filter((A) => A.pin === "left"), v = e.visibleColumns.value.filter((A) => A.pin !== "left" && A.pin !== "right"), R = e.visibleColumns.value.filter((A) => A.pin === "right");
561
- return g ? [g, ...I, ...v, ...R] : [...I, ...v, ...R];
562
- }), f = m(() => i.value.filter((g) => g.pin !== "left" && g.pin !== "right")), C = (g) => g.width ?? Mn, y = (g) => {
563
- const I = i.value.find((A) => A.key === g), R = `${I ? C(I) : Mn}px`;
564
- return {
565
- width: R,
566
- minWidth: R,
567
- maxWidth: R
568
- };
569
- }, x = (g) => g.column.capabilities?.editable !== !1, b = (g, I, v) => s(v) ? g.kind !== "group" && g.rowId != null : g.kind === "group" || g.rowId == null || !x(v) ? !1 : e.isCellEditable ? e.isCellEditable({
570
- row: g.data,
571
- rowId: g.rowId,
572
- rowIndex: I,
573
- column: v.column,
574
- columnKey: v.key
575
- }) : !0, S = (g, I) => {
576
- const v = i.value[I];
577
- if (v?.key === g)
578
- return { column: v, columnIndex: I };
579
- const R = i.value.findIndex((A) => A.key === g);
580
- return R < 0 ? null : {
581
- column: i.value[R],
582
- columnIndex: R
583
- };
584
- };
585
- return {
586
- orderedVisibleColumns: i,
587
- centerColumns: f,
588
- resolveColumnWidth: C,
589
- stageColumnStyle: y,
590
- isRowSelectionColumnKey: l,
591
- isRowSelectionColumn: s,
592
- isCellEditable: b,
593
- isCellEditableByKey: (g, I, v, R) => {
594
- const A = S(v, R);
595
- return A ? b(g, I, A.column) : !1;
596
- },
597
- rowSelectionColumn: r
598
- };
599
- }
600
- function Fl(e) {
601
- const o = m(() => {
602
- const l = e.lastAppliedFill.value, s = e.selectionRange.value;
603
- 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 : {
604
- rowIndex: l.previewRange.endRow,
605
- columnIndex: l.previewRange.endColumn
606
- };
607
- }), r = m(() => e.lastAppliedFill.value?.behavior ?? null);
608
- return {
609
- fillActionAnchorCell: o,
610
- fillActionBehavior: r
611
- };
612
- }
613
- function Dl(e) {
614
- const o = e.history ? null : $n({
615
- runtime: e.runtime,
616
- cloneRowData: e.cloneRowData,
617
- syncViewport: e.syncViewport
618
- });
619
- return {
620
- captureHistorySnapshot: () => e.history ? e.history.captureSnapshot() : o?.captureRowsSnapshot() ?? null,
621
- recordHistoryIntentTransaction: (y, x) => {
622
- if (e.history) {
623
- e.history.recordIntentTransaction(y, x);
624
- return;
625
- }
626
- o?.recordIntentTransaction(
627
- y,
628
- x
629
- );
630
- },
631
- canUndoHistory: () => e.history ? e.history.canUndo() : o?.canUndo.value ?? !1,
632
- canRedoHistory: () => e.history ? e.history.canRedo() : o?.canRedo.value ?? !1,
633
- runHistoryAction: (y) => e.history ? e.history.runHistoryAction(y) : o?.runHistoryAction(y) ?? Promise.resolve(null),
634
- disposeIntentHistory: () => {
635
- o?.dispose();
636
- }
637
- };
638
- }
639
- function El(e) {
640
- const o = e.syncRowSelectionSnapshotFromRuntime ?? (() => {
641
- }), r = m(() => new Set(e.rowSelectionSnapshot.value?.selectedRows ?? [])), l = (v) => v.rowId != null && e.rowSelectionSnapshot.value?.focusedRow === v.rowId, s = (v) => v.kind !== "group" && v.rowId != null && r.value.has(v.rowId), i = (v) => s(v), f = (v) => i(v) ? "true" : "false", C = (v) => {
642
- const R = e.rowSelectionColumn.value?.column;
643
- return !R || v.kind === "group" ? "" : Wn({
644
- column: R,
645
- value: i(v)
646
- }).displayValue;
647
- }, y = m(() => {
648
- const v = e.runtime.api.rows.getCount(), R = [];
649
- for (let A = 0; A < v; A += 1) {
650
- const j = e.runtime.api.rows.get(A);
651
- !j || j.kind === "group" || j.rowId == null || R.push(j.rowId);
652
- }
653
- return R;
654
- }), x = m(() => {
655
- const v = y.value;
656
- return v.length > 0 && v.every((R) => r.value.has(R));
657
- }), b = m(() => y.value.some((R) => r.value.has(R))), S = (v) => {
658
- v.rowId == null || !e.runtime.api.rowSelection.hasSupport() || e.runtime.api.rowSelection.setFocusedRow(v.rowId);
659
- };
660
- return {
661
- rowSelectionSet: r,
662
- isRowFocused: l,
663
- isRowCheckboxSelected: s,
664
- readRowSelectionCell: f,
665
- readRowSelectionDisplayCell: C,
666
- areAllVisibleRowsSelected: x,
667
- areSomeVisibleRowsSelected: b,
668
- focusRow: S,
669
- toggleRowCheckboxSelected: (v) => {
670
- v.kind === "group" || v.rowId == null || !e.runtime.api.rowSelection.hasSupport() || (e.runtime.api.rowSelection.setSelected(v.rowId, !r.value.has(v.rowId)), o());
671
- },
672
- toggleVisibleRowsSelected: () => {
673
- if (!e.runtime.api.rowSelection.hasSupport())
674
- return;
675
- const v = y.value;
676
- if (!x.value) {
677
- e.runtime.api.rowSelection.selectRows(v), o();
678
- return;
679
- }
680
- e.runtime.api.rowSelection.deselectRows(v), o();
681
- },
682
- selectRowRange: (v, R, A) => {
683
- S(v);
684
- const j = e.orderedVisibleColumns.value.length - 1;
685
- if (j < 0)
686
- return;
687
- const N = e.viewportRowStart.value + R;
688
- if (!A) {
689
- e.applySelectionRange({
690
- startRow: N,
691
- endRow: N,
692
- startColumn: 0,
693
- endColumn: j
694
- });
695
- return;
696
- }
697
- const ae = e.selectionAnchorCell.value?.rowIndex ?? N;
698
- e.applySelectionRange({
699
- startRow: Math.min(ae, N),
700
- endRow: Math.max(ae, N),
701
- startColumn: 0,
702
- endColumn: j
703
- });
704
- }
705
- };
706
- }
707
- function kl(e) {
708
- return {
709
- handleWindowMouseMove: (i) => {
710
- if (e.isColumnResizing.value) {
711
- e.applyColumnResizeFromPointer(i.clientX);
712
- return;
713
- }
714
- e.handleInteractionWindowMouseMove(i);
715
- },
716
- handleHeaderWheel: (i) => {
717
- const f = e.bodyViewportRef.value;
718
- if (!f)
719
- return;
720
- const C = Math.abs(i.deltaX) > 0 ? i.deltaX : i.shiftKey ? i.deltaY : 0, y = C === 0 ? i.deltaY : 0;
721
- C === 0 && y === 0 || (i.preventDefault(), C !== 0 && (f.scrollLeft += C), y !== 0 && (f.scrollTop += y), e.syncViewport());
722
- },
723
- handleHeaderScroll: (i) => {
724
- const f = i.target, C = e.bodyViewportRef.value;
725
- !f || !C || (C.scrollLeft !== f.scrollLeft && (C.scrollLeft = f.scrollLeft), e.syncViewport());
726
- },
727
- handleWindowMouseUp: () => {
728
- e.stopColumnResize(), e.handleInteractionWindowMouseUp();
729
- }
730
- };
731
- }
732
- function Hl(e) {
733
- 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 = () => {
734
- const i = e.totalRows.value - 1, f = e.orderedVisibleColumns.value.length - 1;
735
- i < 0 || f < 0 || e.applySelectionRange({
736
- startRow: 0,
737
- endRow: i,
738
- startColumn: 0,
739
- endColumn: f
740
- });
741
- };
742
- return {
743
- handleViewportKeydown: (i) => {
744
- (o(i) || r(i)) && i.preventDefault();
745
- const f = e.selectionSnapshot.value?.activeCell;
746
- if (!f) {
747
- r(i) && l();
748
- return;
749
- }
750
- const C = e.runtime.getBodyRowAtIndex(f.rowIndex);
751
- C && e.handleCellKeydown(
752
- i,
753
- C,
754
- f.rowIndex - e.viewportRowStart.value,
755
- f.colIndex
756
- );
757
- }
758
- };
759
- }
760
- function Vl(e) {
761
- const o = m(() => e.interactionSelectionRange.value ?? e.resolveCommittedSelectionRange()), r = () => {
762
- const b = o.value;
763
- return b && b.startRow === b.endRow && b.startColumn === b.endColumn ? {
764
- rowIndex: b.startRow,
765
- columnIndex: b.startColumn
766
- } : e.selectionAnchorCell.value;
767
- }, l = () => o.value, s = () => e.mode.value === "base" && e.isFillDragging.value && !!e.fillPreviewRange.value, i = (b, S, M) => {
768
- const g = e.viewportRowStart.value + S;
769
- return g >= b.startRow && g <= b.endRow && M >= b.startColumn && M <= b.endColumn;
770
- }, f = (b, S) => {
771
- const M = r();
772
- return M ? M.rowIndex === e.viewportRowStart.value + b && M.columnIndex === S : e.isCommittedSelectionAnchorCell(b, S);
773
- };
774
- return {
775
- selectionRange: o,
776
- isSelectionAnchorCell: f,
777
- isCellSelected: (b, S) => {
778
- if (!s())
779
- return e.isCommittedCellSelected(b, S);
780
- const M = l();
781
- return M ? i(M, b, S) : !1;
782
- },
783
- shouldHighlightSelectedCell: (b, S) => {
784
- if (!s())
785
- return e.shouldHighlightCommittedSelectedCell(b, S);
786
- const M = l();
787
- return !M || !i(M, b, S) || M.startRow === M.endRow && M.startColumn === M.endColumn ? !1 : !f(b, S);
788
- },
789
- isCellOnSelectionEdge: (b, S, M) => {
790
- if (!s())
791
- return e.isCommittedCellOnSelectionEdge(b, S, M);
792
- const g = l();
793
- if (!g || !i(g, b, S))
794
- return !1;
795
- const I = e.viewportRowStart.value + b;
796
- switch (M) {
797
- case "top":
798
- return I === g.startRow;
799
- case "right":
800
- return S === g.endColumn;
801
- case "bottom":
802
- return I === g.endRow;
803
- case "left":
804
- return S === g.startColumn;
805
- }
806
- }
807
- };
808
- }
809
- const mn = 140, zl = 72, Tl = 80, jl = 24, Bl = 400;
810
- function _l(e) {
811
- const o = e.syncRowSelectionSnapshotFromRuntime ?? (() => {
812
- }), r = e.rowSelectionSnapshot ?? L(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 ? zl : 0), C = Ol({
813
- runtime: e.runtime,
814
- visibleColumns: e.visibleColumns,
815
- showRowSelection: e.showRowSelection,
816
- isCellEditable: e.isCellEditable
817
- }), {
818
- orderedVisibleColumns: y,
819
- centerColumns: x,
820
- resolveColumnWidth: b,
821
- isRowSelectionColumnKey: S,
822
- isRowSelectionColumn: M,
823
- isCellEditable: g,
824
- isCellEditableByKey: I,
825
- rowSelectionColumn: v
826
- } = C, R = Un({
827
- totalRows: () => s.value,
828
- resolveBaseRowHeight: () => e.normalizedBaseRowHeight.value,
829
- resolveRowHeightOverride: (a) => e.runtime.api.view.getRowHeightOverride(a),
830
- resolveRowHeightVersion: () => e.runtime.api.view.getRowHeightVersion(),
831
- hasRowHeightOverrides: () => e.runtime.api.view.getRowHeightVersion() > 0
832
- }), A = (a) => {
833
- const w = Math.max(0, Math.trunc(a));
834
- if (w <= 0)
835
- return 0;
836
- const h = R.resolveTotalHeight();
837
- return w <= s.value ? R.resolveRowOffset(w) : h + (w - s.value) * e.normalizedBaseRowHeight.value;
838
- }, j = m(() => {
839
- if (e.layoutMode.value !== "auto-height")
840
- return null;
841
- let a = R.resolveTotalHeight();
842
- return e.minRows.value !== null && (a = Math.max(a, A(e.minRows.value))), e.maxRows.value !== null && (a = Math.min(a, A(e.maxRows.value))), Math.max(0, Math.trunc(a));
843
- }), N = m(() => e.layoutMode.value !== "auto-height" ? {} : {
844
- height: "auto"
845
- }), ae = m(() => {
846
- if (e.layoutMode.value !== "auto-height")
847
- return {};
848
- const a = j.value ?? 0;
849
- return {
850
- height: `${a}px`,
851
- maxHeight: `${a}px`
852
- };
853
- });
854
- let Be = () => !1;
855
- const {
856
- headerViewportRef: vt,
857
- bodyViewportRef: K,
858
- displayRows: _e,
859
- pinnedBottomRows: ht,
860
- renderedColumns: bt,
861
- viewportRowStart: H,
862
- viewportColumnStart: yt,
863
- topSpacerHeight: Rt,
864
- bottomSpacerHeight: be,
865
- leftColumnSpacerWidth: St,
866
- rightColumnSpacerWidth: Mt,
867
- gridContentStyle: pt,
868
- mainTrackStyle: It,
869
- indexColumnStyle: xt,
870
- columnStyle: At,
871
- handleViewportScroll: Ot,
872
- syncViewportFromDom: D,
873
- scheduleViewportSync: F,
874
- cancelScheduledViewportSync: ie
875
- } = qn({
876
- runtime: e.runtime,
877
- mode: e.mode,
878
- rowRenderMode: e.rowRenderMode,
879
- rowVirtualizationEnabled: m(() => e.virtualization.value.rows),
880
- columnVirtualizationEnabled: m(() => e.virtualization.value.columns),
881
- totalRows: s,
882
- visibleColumns: x,
883
- sizingColumns: y,
884
- normalizedBaseRowHeight: e.normalizedBaseRowHeight,
885
- resolveColumnWidth: b,
886
- defaultColumnWidth: mn,
887
- indexColumnWidth: 0,
888
- flexFillOffsetWidth: f.value,
889
- rowOverscan: m(() => e.virtualization.value.rowOverscan),
890
- columnOverscan: m(() => e.virtualization.value.columnOverscan),
891
- measureVisibleRowHeights: () => Re(),
892
- resolveRowHeight: R.resolveRowHeight,
893
- resolveRowOffset: R.resolveRowOffset,
894
- resolveRowIndexAtOffset: R.resolveRowIndexAtOffset,
895
- resolveTotalRowHeight: R.resolveTotalHeight
896
- }), se = (a) => At(a), Ge = (a) => {
897
- if (i.value <= 0)
898
- return null;
899
- const w = Math.max(0, Math.min(i.value - 1, Math.trunc(a)));
900
- return e.runtime.api.rows.get(w) ?? null;
901
- }, ye = (a) => {
902
- for (let w = 0; w < i.value; w += 1)
903
- if (e.runtime.api.rows.get(w)?.rowId === a)
904
- return w;
905
- return e.runtime.resolveBodyRowIndexById(a);
906
- }, P = {
907
- ...e.runtime,
908
- getBodyRowAtIndex: Ge,
909
- resolveBodyRowIndexById: ye
910
- }, {
911
- rowStyle: Pe,
912
- isRowAutosizeProbe: Le,
913
- measureVisibleRowHeights: Re,
914
- startRowResize: We,
915
- autosizeRow: Ne,
916
- dispose: Ke
917
- } = Xn({
918
- mode: e.mode,
919
- rowHeightMode: e.rowHeightMode,
920
- normalizedBaseRowHeight: e.normalizedBaseRowHeight,
921
- viewportRowStart: H,
922
- bodyViewportRef: K,
923
- runtime: e.runtime,
924
- minRowHeight: jl,
925
- syncViewport: () => D()
926
- }), Q = Yn({
927
- mode: e.mode,
928
- runtime: P,
929
- totalRows: i,
930
- visibleColumns: y,
931
- viewportRowStart: H,
932
- selectionSnapshot: e.selectionSnapshot,
933
- selectionAnchor: e.selectionAnchor,
934
- isEditingCell: (a, w) => Be(a, w)
935
- }), {
936
- normalizeRowId: Se,
937
- normalizeCellCoord: $e,
938
- resolveSelectionRange: V,
939
- resolveCurrentCellCoord: Ue,
940
- applySelectionRange: ee,
941
- applyCellSelectionByCoord: Me,
942
- setCellSelection: Ft,
943
- clearCellSelection: qe,
944
- isCellSelected: Xe
945
- } = Q, Dt = Q.isSelectionAnchorCell ?? (() => !1), Et = Q.shouldHighlightSelectedCell ?? ((a, w) => Xe(a, w)), kt = Q.isCellOnSelectionEdge ?? (() => !1), ue = m(() => {
946
- const a = e.selectionSnapshot.value;
947
- if (!a || a.ranges.length === 0)
948
- return null;
949
- const w = a.activeRangeIndex ?? 0, h = a.ranges[w]?.anchor ?? a.ranges[0]?.anchor ?? null;
950
- return !h || typeof h.rowIndex != "number" || typeof h.colIndex != "number" || !Number.isFinite(h.rowIndex) || !Number.isFinite(h.colIndex) ? null : {
951
- rowIndex: Math.trunc(h.rowIndex),
952
- columnIndex: Math.trunc(h.colIndex)
953
- };
954
- }), Ye = El({
955
- runtime: e.runtime,
956
- rowSelectionColumn: v,
957
- orderedVisibleColumns: y,
958
- displayRows: _e,
959
- rowSelectionSnapshot: r,
960
- syncRowSelectionSnapshotFromRuntime: o,
961
- viewportRowStart: H,
962
- selectionAnchorCell: ue,
963
- applySelectionRange: ee
964
- }), {
965
- readRowSelectionCell: Ht,
966
- readRowSelectionDisplayCell: Vt,
967
- toggleRowCheckboxSelected: zt
968
- } = Ye, Tt = m(() => {
969
- const a = `${f.value}px`;
970
- return {
971
- ...xt.value,
972
- width: a,
973
- minWidth: a,
974
- maxWidth: a
975
- };
976
- }), pe = Dl({
977
- runtime: e.runtime,
978
- cloneRowData: e.cloneRowData,
979
- syncViewport: () => D(),
980
- history: e.history
981
- }), {
982
- captureHistorySnapshot: q,
983
- recordHistoryIntentTransaction: X,
984
- canUndoHistory: Je,
985
- canRedoHistory: Ze,
986
- runHistoryAction: Ie
987
- } = pe, {
988
- rowIndexLabel: te,
989
- readCell: B,
990
- readDisplayCell: Qe,
991
- rowClass: xe,
992
- toggleGroupRow: et
993
- } = Jn({
994
- mode: e.mode,
995
- runtime: e.runtime,
996
- viewportRowStart: H,
997
- firstColumnKey: e.firstColumnKey
998
- }), Ae = Al({
999
- runtime: e.runtime,
1000
- viewportRowStart: H,
1001
- isRowSelectionColumnKey: S,
1002
- isRowSelectionColumn: M,
1003
- isCellEditableByKey: I,
1004
- readRowSelectionCell: Ht,
1005
- readRowSelectionDisplayCell: Vt,
1006
- readCell: B,
1007
- readDisplayCell: Qe,
1008
- toggleRowCheckboxSelected: zt,
1009
- captureHistorySnapshot: q,
1010
- recordHistoryIntentTransaction: X,
1011
- syncViewport: () => D()
1012
- }), {
1013
- readStageCell: ce
1014
- } = Ae, jt = Zn({
1015
- mode: e.mode,
1016
- runtime: P,
1017
- totalRows: i,
1018
- visibleColumns: y,
1019
- viewportRowStart: H,
1020
- resolveSelectionRange: V,
1021
- resolveCurrentCellCoord: Ue,
1022
- applySelectionRange: ee,
1023
- clearCellSelection: qe,
1024
- captureRowsSnapshot: q,
1025
- recordEditTransaction: (a) => {
1026
- X({
1027
- intent: "edit",
1028
- label: "Cell edit"
1029
- }, a);
1030
- },
1031
- readCell: (a, w) => ce(a, w),
1032
- readClipboardCell: e.readClipboardCell ? (a, w) => e.readClipboardCell?.(a, w) ?? "" : void 0,
1033
- isCellEditable: I,
1034
- syncViewport: () => D(),
1035
- applyClipboardEdits: e.applyClipboardEdits,
1036
- buildFillMatrixFromRange: e.buildFillMatrixFromRange
1037
- }), {
1038
- normalizeClipboardRange: tt,
1039
- applyClipboardEdits: nt,
1040
- rangesEqual: Bt,
1041
- buildFillMatrixFromRange: _t,
1042
- clearPendingClipboardOperation: Gt,
1043
- copySelectedCells: Oe,
1044
- pasteSelectedCells: ne,
1045
- cutSelectedCells: de,
1046
- isCellInPendingClipboardRange: me,
1047
- isCellOnPendingClipboardEdge: we
1048
- } = jt, {
1049
- ensureKeyboardActiveCellVisible: le
1050
- } = Qn({
1051
- bodyViewportRef: K,
1052
- visibleColumns: y,
1053
- resolveColumnWidth: b,
1054
- normalizedBaseRowHeight: e.normalizedBaseRowHeight,
1055
- resolveRowHeight: R.resolveRowHeight,
1056
- resolveRowOffset: R.resolveRowOffset,
1057
- indexColumnWidth: f.value,
1058
- defaultColumnWidth: mn,
1059
- syncViewport: () => D()
1060
- }), {
1061
- editingCell: Fe,
1062
- editingCellValue: Pt,
1063
- editingCellInitialFilter: Lt,
1064
- editingCellOpenOnMount: lt,
1065
- isEditingCell: ot,
1066
- startInlineEdit: De,
1067
- commitInlineEdit: Ee,
1068
- cancelInlineEdit: rt,
1069
- handleEditorKeydown: Wt
1070
- } = el({
1071
- mode: e.mode,
1072
- bodyViewportRef: K,
1073
- visibleColumns: y,
1074
- totalRows: i,
1075
- runtime: P,
1076
- readCell: (a, w) => ce(a, w),
1077
- resolveRowIndexById: ye,
1078
- applyCellSelection: (a) => {
1079
- Me(a, !1);
1080
- },
1081
- ensureActiveCellVisible: (a, w) => {
1082
- le(a, w);
1083
- },
1084
- isCellEditable: I,
1085
- captureRowsSnapshot: q,
1086
- recordEditTransaction: (a) => {
1087
- X({
1088
- intent: "edit",
1089
- label: "Cell edit"
1090
- }, a);
1091
- }
1092
- });
1093
- Be = ot;
1094
- const Nt = m(() => Fe.value), Kt = {
1095
- mode: e.mode,
1096
- enableFillHandle: e.enableFillHandle,
1097
- enableRangeMove: e.enableRangeMove,
1098
- runtime: P,
1099
- totalRows: i,
1100
- visibleColumns: y,
1101
- viewportRowStart: H,
1102
- selectionSnapshot: e.selectionSnapshot,
1103
- bodyViewportRef: K,
1104
- indexColumnWidth: f.value,
1105
- resolveColumnWidth: b,
1106
- resolveRowHeight: R.resolveRowHeight,
1107
- resolveRowIndexAtOffset: R.resolveRowIndexAtOffset,
1108
- normalizeRowId: Se,
1109
- normalizeCellCoord: $e,
1110
- resolveSelectionRange: V,
1111
- applySelectionRange: ee,
1112
- applyCellSelectionByCoord: Me,
1113
- setCellSelection: Ft,
1114
- clearCellSelection: qe,
1115
- readCell: (a, w) => ce(a, w),
1116
- isCellEditable: I,
1117
- cloneRowData: e.cloneRowData,
1118
- resolveRowIndexById: ye,
1119
- captureRowsSnapshot: q,
1120
- recordIntentTransaction: (a, w) => {
1121
- X(a, w);
1122
- },
1123
- clearPendingClipboardOperation: Gt,
1124
- clearExternalPendingClipboardOperation: e.clearExternalPendingClipboardOperation,
1125
- copySelectedCells: Oe,
1126
- pasteSelectedCells: ne,
1127
- cutSelectedCells: de,
1128
- normalizeClipboardRange: tt,
1129
- applyClipboardEdits: nt,
1130
- rangesEqual: Bt,
1131
- buildFillMatrixFromRange: _t,
1132
- applyRangeMove: e.applyRangeMove,
1133
- syncViewport: () => D(),
1134
- editingCell: Nt,
1135
- startInlineEdit: De,
1136
- commitInlineEdit: Ee,
1137
- canUndo: Je,
1138
- canRedo: Ze,
1139
- runHistoryAction: Ie,
1140
- ensureKeyboardActiveCellVisible: le,
1141
- isContextMenuVisible: e.isContextMenuVisible,
1142
- closeContextMenu: e.closeContextMenu,
1143
- openContextMenuFromCurrentCell: e.openContextMenuFromCurrentCell,
1144
- runRowIndexKeyboardAction: e.runRowIndexKeyboardAction
1145
- }, $t = tl(Kt), {
1146
- isPointerSelectingCells: at,
1147
- isFillDragging: oe,
1148
- fillPreviewRange: ke,
1149
- lastAppliedFill: He,
1150
- isRangeMoving: Ut,
1151
- selectionRange: Ve,
1152
- rangeMovePreviewRange: it,
1153
- stopPointerSelection: qt,
1154
- stopFillSelection: Xt,
1155
- startFillHandleDrag: Yt,
1156
- startFillHandleDoubleClick: Jt,
1157
- applyLastFillBehavior: fe,
1158
- handleCellMouseDown: Zt,
1159
- handleCellKeydown: z,
1160
- handleRowIndexKeydown: st,
1161
- handleWindowMouseMove: Qt,
1162
- handleWindowMouseUp: Y,
1163
- isCellInFillPreview: ze,
1164
- isFillHandleCell: en,
1165
- clearSelectedCells: tn,
1166
- dispose: nn
1167
- } = $t, ln = Hl({
1168
- runtime: P,
1169
- selectionSnapshot: e.selectionSnapshot,
1170
- totalRows: i,
1171
- orderedVisibleColumns: y,
1172
- viewportRowStart: H,
1173
- applySelectionRange: ee,
1174
- handleCellKeydown: z
1175
- }), {
1176
- isColumnResizing: ge,
1177
- startResize: on,
1178
- handleResizeDoubleClick: ut,
1179
- applyColumnResizeFromPointer: rn,
1180
- stopColumnResize: Ce,
1181
- dispose: an
1182
- } = nl({
1183
- visibleColumns: y,
1184
- rows: e.rows,
1185
- persistColumnWidth: (a, w) => {
1186
- e.runtime.api.columns.setWidth(a, w);
1187
- },
1188
- defaultColumnWidth: mn,
1189
- minColumnWidth: Tl,
1190
- autoSizeSampleLimit: Bl,
1191
- autoSizeCharWidth: 7.2,
1192
- autoSizeHorizontalPadding: 42,
1193
- autoSizeMaxWidth: 640,
1194
- isFillDragging: () => oe.value,
1195
- stopFillSelection: () => {
1196
- Xt(!1);
1197
- },
1198
- isDragSelecting: () => at.value,
1199
- stopDragSelection: () => {
1200
- qt();
1201
- },
1202
- readCellText: (a, w) => {
1203
- const h = a[w];
1204
- return h == null ? "" : String(h);
1205
- }
1206
- }), ct = Vl({
1207
- mode: e.mode,
1208
- viewportRowStart: H,
1209
- selectionAnchorCell: ue,
1210
- fillPreviewRange: ke,
1211
- isFillDragging: oe,
1212
- interactionSelectionRange: Ve,
1213
- resolveCommittedSelectionRange: V,
1214
- isCommittedSelectionAnchorCell: Dt,
1215
- isCommittedCellSelected: Xe,
1216
- shouldHighlightCommittedSelectedCell: Et,
1217
- isCommittedCellOnSelectionEdge: kt
1218
- }), { selectionRange: dt } = ct, sn = Fl({
1219
- lastAppliedFill: He,
1220
- selectionRange: dt,
1221
- isFillDragging: oe
1222
- }), t = kl({
1223
- bodyViewportRef: K,
1224
- isColumnResizing: ge,
1225
- applyColumnResizeFromPointer: rn,
1226
- stopColumnResize: Ce,
1227
- handleInteractionWindowMouseMove: Qt,
1228
- handleInteractionWindowMouseUp: Y,
1229
- syncViewport: D
1230
- }), n = {
1231
- rowSelection: Ye,
1232
- history: pe,
1233
- cellIo: Ae,
1234
- viewportKeyboard: ln,
1235
- visualSelection: ct,
1236
- fillAction: sn,
1237
- scrollSync: t
1238
- }, {
1239
- tableStageProps: u,
1240
- tableStageContext: d
1241
- } = xl({
1242
- mode: e.mode,
1243
- rowHeightMode: e.rowHeightMode,
1244
- layoutMode: e.layoutMode,
1245
- visibleColumns: y,
1246
- renderedColumns: bt,
1247
- displayRows: _e,
1248
- pinnedBottomRows: ht,
1249
- sourceRows: e.sourceRows ?? e.rows,
1250
- showRowIndex: l,
1251
- rowHover: m(() => e.rowHover?.value === !0),
1252
- stripedRows: m(() => e.stripedRows?.value === !0),
1253
- columnFilterTextByKey: e.columnFilterTextByKey,
1254
- gridContentStyle: pt,
1255
- mainTrackStyle: It,
1256
- indexColumnStyle: Tt,
1257
- stageStyle: N,
1258
- bodyShellStyle: ae,
1259
- topSpacerHeight: Rt,
1260
- bottomSpacerHeight: be,
1261
- viewportRowStart: H,
1262
- columnWindowStart: yt,
1263
- leftColumnSpacerWidth: St,
1264
- rightColumnSpacerWidth: Mt,
1265
- editingCellValueRef: Pt,
1266
- editingCellInitialFilter: Lt,
1267
- editingCellOpenOnMount: lt,
1268
- selectionRange: dt,
1269
- selectionAnchorCell: ue,
1270
- fillPreviewRange: ke,
1271
- rangeMovePreviewRange: it,
1272
- fillHandleEnabled: m(() => e.enableFillHandle.value),
1273
- rangeMoveEnabled: m(() => e.enableRangeMove.value),
1274
- isFillDragging: oe,
1275
- isRangeMoving: Ut,
1276
- headerViewportRef: vt,
1277
- bodyViewportRef: K,
1278
- columnStyle: se,
1279
- toggleSortForColumn: e.toggleSortForColumn,
1280
- sortIndicator: e.sortIndicator,
1281
- setColumnFilterText: e.setColumnFilterText,
1282
- columnMenuEnabled: e.columnMenuEnabled,
1283
- columnMenuValueFilterEnabled: e.columnMenuValueFilterEnabled,
1284
- columnMenuValueFilterRowLimit: e.columnMenuValueFilterRowLimit,
1285
- columnMenuMaxFilterValues: e.columnMenuMaxFilterValues,
1286
- resolveColumnMenuItems: e.resolveColumnMenuItems,
1287
- resolveColumnMenuDisabledItems: e.resolveColumnMenuDisabledItems,
1288
- resolveColumnMenuDisabledReasons: e.resolveColumnMenuDisabledReasons,
1289
- resolveColumnMenuLabels: e.resolveColumnMenuLabels,
1290
- resolveColumnMenuActionOptions: e.resolveColumnMenuActionOptions,
1291
- isColumnFilterActive: e.isColumnFilterActive,
1292
- isColumnGrouped: e.isColumnGrouped,
1293
- resolveColumnGroupOrder: e.resolveColumnGroupOrder,
1294
- resolveColumnMenuSortDirection: e.resolveColumnMenuSortDirection,
1295
- resolveColumnMenuSelectedTokens: e.resolveColumnMenuSelectedTokens,
1296
- applyColumnMenuSort: e.applyColumnMenuSort,
1297
- applyColumnMenuPin: e.applyColumnMenuPin,
1298
- applyColumnMenuGroupBy: e.applyColumnMenuGroupBy,
1299
- applyColumnMenuFilter: e.applyColumnMenuFilter,
1300
- clearColumnMenuFilter: e.clearColumnMenuFilter,
1301
- handleHeaderWheel: n.scrollSync.handleHeaderWheel,
1302
- handleHeaderScroll: n.scrollSync.handleHeaderScroll,
1303
- handleViewportScroll: Ot,
1304
- handleViewportKeydown: n.viewportKeyboard.handleViewportKeydown,
1305
- rowClass: xe,
1306
- isRowAutosizeProbe: Le,
1307
- rowStyle: Pe,
1308
- isRowInPendingClipboardCut: e.isRowInPendingClipboardCut,
1309
- isRowFocused: n.rowSelection.isRowFocused,
1310
- isRowCheckboxSelected: n.rowSelection.isRowCheckboxSelected,
1311
- allVisibleRowsSelected: n.rowSelection.areAllVisibleRowsSelected,
1312
- someVisibleRowsSelected: n.rowSelection.areSomeVisibleRowsSelected,
1313
- handleRowClick: n.rowSelection.focusRow,
1314
- handleRowIndexClick: n.rowSelection.selectRowRange,
1315
- handleRowIndexKeydown: st,
1316
- handleToggleAllVisibleRows: n.rowSelection.toggleVisibleRowsSelected,
1317
- toggleGroupRow: et,
1318
- rowIndexLabel: te,
1319
- startResize: on,
1320
- handleResizeDoubleClick: ut,
1321
- startRowResize: We,
1322
- autosizeRow: Ne,
1323
- isCellSelected: n.visualSelection.isCellSelected,
1324
- isSelectionAnchorCell: n.visualSelection.isSelectionAnchorCell,
1325
- shouldHighlightSelectedCell: n.visualSelection.shouldHighlightSelectedCell,
1326
- isCellOnSelectionEdge: n.visualSelection.isCellOnSelectionEdge,
1327
- isCellInFillPreview: ze,
1328
- isCellInPendingClipboardRange: me,
1329
- isCellOnPendingClipboardEdge: we,
1330
- isEditingCell: ot,
1331
- isCellEditable: (a, w, h, O) => g(a, H.value + w, h),
1332
- handleCellMouseDown: Zt,
1333
- handleCellClick: n.cellIo.handleCellClick,
1334
- handleCellKeydown: z,
1335
- startInlineEdit: De,
1336
- isFillHandleCell: en,
1337
- startFillHandleDrag: Yt,
1338
- startFillHandleDoubleClick: Jt,
1339
- fillActionAnchorCell: n.fillAction.fillActionAnchorCell,
1340
- fillActionBehavior: n.fillAction.fillActionBehavior,
1341
- applyFillActionBehavior: fe,
1342
- handleEditorKeydown: Wt,
1343
- commitInlineEdit: Ee,
1344
- cancelInlineEdit: rt,
1345
- readCell: n.cellIo.readStageCell,
1346
- readDisplayCell: n.cellIo.readStageDisplayCell
1347
- });
1348
- return ll({
1349
- mode: e.mode,
1350
- rows: e.rows,
1351
- runtime: e.runtime,
1352
- totalRows: s,
1353
- rowVersion: e.rowVersion,
1354
- rowHeightMode: e.rowHeightMode,
1355
- normalizedBaseRowHeight: e.normalizedBaseRowHeight,
1356
- syncSelectionSnapshotFromRuntime: e.syncSelectionSnapshotFromRuntime,
1357
- syncRowSelectionSnapshotFromRuntime: o,
1358
- syncViewport: D,
1359
- scheduleViewportSync: F,
1360
- measureVisibleRowHeights: Re,
1361
- applyRowHeightSettings: e.applyRowHeightSettings
1362
- }), ol({
1363
- bodyViewportRef: K,
1364
- syncViewport: D,
1365
- handleWindowMouseMove: n.scrollSync.handleWindowMouseMove,
1366
- handleWindowMouseUp: n.scrollSync.handleWindowMouseUp,
1367
- cancelScheduledViewportSync: ie,
1368
- onAfterMount: () => {
1369
- e.syncSelectionSnapshotFromRuntime(), o(), Dn(() => {
1370
- e.applyRowHeightSettings(), D();
1371
- });
1372
- },
1373
- dispose: [
1374
- Ke,
1375
- an,
1376
- nn,
1377
- n.history.disposeIntentHistory
1378
- ]
1379
- }), {
1380
- tableStageProps: u,
1381
- tableStageContext: d,
1382
- syncViewportFromDom: D,
1383
- copySelectedCells: Oe,
1384
- pasteSelectedCells: ne,
1385
- cutSelectedCells: de,
1386
- clearSelectedCells: tn,
1387
- captureHistorySnapshot: q,
1388
- recordHistoryIntentTransaction: X
1389
- };
1390
- }
1391
- const Gl = gt(() => import("./DataGridColumnLayoutPopover-Qt56b3CA.js")), Pl = gt(() => import("./DataGridAdvancedFilterPopover-Bak_CkaO.js")), Ll = gt(() => import("./DataGridAggregationsPopover-DfQ3-UV4.js")), Wl = gt(() => import("./DataGridGanttStageEntry-DgXw3IJw.js"));
1392
- function Nl(e) {
1393
- return Number.isFinite(e) ? Math.max(24, Math.trunc(e)) : 31;
1394
- }
1395
- function Kl(e) {
1396
- return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/\\/g, "\\\\").replace(/\"/g, '\\"');
1397
- }
1398
- function pn(e) {
1399
- return (e ?? []).map((o) => ({
1400
- key: o.key,
1401
- direction: o.direction
1402
- }));
1403
- }
1404
- function gn() {
1405
- return {
1406
- columnFilters: {},
1407
- advancedFilters: {},
1408
- advancedExpression: null
1409
- };
1410
- }
1411
- function Te(e) {
1412
- return Kn(e ?? gn()) ?? gn();
1413
- }
1414
- function Cn(e) {
1415
- return e.startsWith("string:") ? `string:${e.slice(7).toLowerCase()}` : e;
1416
- }
1417
- function $l(e) {
1418
- const o = {};
1419
- for (const [s, i] of Object.entries(e.columnFilters ?? {})) {
1420
- if (i.kind === "valueSet") {
1421
- const f = Array.from(new Set(
1422
- (i.tokens ?? []).map((C) => Cn(String(C ?? ""))).filter((C) => C.length > 0)
1423
- ));
1424
- if (f.length === 0)
1425
- continue;
1426
- o[s] = {
1427
- kind: "valueSet",
1428
- tokens: f
1429
- };
1430
- continue;
1431
- }
1432
- o[s] = {
1433
- kind: "predicate",
1434
- operator: i.operator,
1435
- value: i.value,
1436
- value2: i.value2,
1437
- caseSensitive: i.caseSensitive
1438
- };
1439
- }
1440
- const r = { ...e.advancedFilters ?? {} }, l = e.advancedExpression ?? null;
1441
- return Object.keys(o).length === 0 && Object.keys(r).length === 0 && !l ? null : {
1442
- columnFilters: o,
1443
- advancedFilters: r,
1444
- advancedExpression: l
1445
- };
1446
- }
1447
- function Ul(e) {
1448
- const o = {}, r = e?.columnFilters ?? {};
1449
- for (const [l, s] of Object.entries(r))
1450
- s?.kind === "predicate" && typeof s.value == "string" && (o[l] = s.value);
1451
- return o;
1452
- }
1453
- function J(e) {
1454
- if (typeof globalThis.structuredClone == "function")
1455
- try {
1456
- return globalThis.structuredClone(e);
1457
- } catch {
1458
- }
1459
- return vn(e, /* @__PURE__ */ new WeakMap());
1460
- }
1461
- function vn(e, o) {
1462
- if (e == null || typeof e != "object")
1463
- return e;
1464
- if (e instanceof Date)
1465
- return new Date(e.getTime());
1466
- if (Array.isArray(e)) {
1467
- if (o.has(e))
1468
- return o.get(e);
1469
- const r = [];
1470
- o.set(e, r);
1471
- for (const l of e)
1472
- r.push(vn(l, o));
1473
- return r;
1474
- }
1475
- if (Bn(e)) {
1476
- if (o.has(e))
1477
- return o.get(e);
1478
- const r = {};
1479
- o.set(e, r);
1480
- for (const [l, s] of Object.entries(e))
1481
- r[l] = vn(s, o);
1482
- return r;
1483
- }
1484
- return e && typeof e == "object" ? { ...e } : e;
1485
- }
1486
- function Bn(e) {
1487
- if (!e || typeof e != "object")
1488
- return !1;
1489
- const o = Object.getPrototypeOf(e);
1490
- return o === Object.prototype || o === null;
1491
- }
1492
- function ql(e) {
1493
- const o = /* @__PURE__ */ new WeakSet();
1494
- try {
1495
- return JSON.stringify(e, (r, l) => {
1496
- if (l == null || typeof l != "object")
1497
- return l;
1498
- if (l instanceof Date)
1499
- return l.toISOString();
1500
- if (Array.isArray(l) || Bn(l))
1501
- return o.has(l) ? void 0 : (o.add(l), l);
1502
- });
1503
- } catch {
1504
- return null;
1505
- }
1506
- }
1507
- function je(e) {
1508
- return e ? {
1509
- columns: e.columns.map((o) => ({ ...o })),
1510
- basis: e.basis === "source" ? "source" : "filtered"
1511
- } : null;
1512
- }
1513
- function Xl(e) {
1514
- return e ? {
1515
- fields: [...e.fields],
1516
- expandedByDefault: e.expandedByDefault
1517
- } : null;
1518
- }
1519
- function U(e) {
1520
- return e == null ? "blank" : e instanceof Date ? e.toISOString() : typeof e == "string" ? `"${e}"` : String(e);
1521
- }
1522
- function re(e) {
1523
- switch (e) {
1524
- case "contains":
1525
- return "contains";
1526
- case "startsWith":
1527
- case "starts-with":
1528
- return "starts with";
1529
- case "endsWith":
1530
- case "ends-with":
1531
- return "ends with";
1532
- case "equals":
1533
- return "=";
1534
- case "notEquals":
1535
- case "not-equals":
1536
- return "!=";
1537
- case "gt":
1538
- return ">";
1539
- case "gte":
1540
- return ">=";
1541
- case "lt":
1542
- return "<";
1543
- case "lte":
1544
- return "<=";
1545
- case "between":
1546
- return "between";
1547
- case "isEmpty":
1548
- case "is-empty":
1549
- return "is empty";
1550
- case "notEmpty":
1551
- case "not-empty":
1552
- return "is not empty";
1553
- case "isNull":
1554
- case "is-null":
1555
- return "is null";
1556
- case "notNull":
1557
- case "not-null":
1558
- return "is not null";
1559
- default:
1560
- return e;
1561
- }
1562
- }
1563
- function Yl(e) {
1564
- const o = String(e ?? "");
1565
- if (o === "null")
1566
- return "(Blanks)";
1567
- const r = o.indexOf(":");
1568
- if (r < 0)
1569
- return o;
1570
- const l = o.slice(0, r), s = o.slice(r + 1);
1571
- return l === "string" || l === "number" || l === "boolean" || l === "bigint" || l === "date" || l === "repr" || l === "json" ? s : o;
1572
- }
1573
- function Jl(e, o) {
1574
- return o.kind === "valueSet" ? o.tokens.length === 1 ? `${e}: ${Yl(o.tokens[0] ?? "")}` : `${e}: ${o.tokens.length} values` : o.operator === "between" ? `${e} between ${U(o.value)} and ${U(o.value2)}` : o.operator === "isEmpty" || o.operator === "notEmpty" || o.operator === "isNull" || o.operator === "notNull" ? `${e} ${re(o.operator)}` : `${e} ${re(o.operator)} ${U(o.value)}`;
1575
- }
1576
- function Zl(e, o) {
1577
- const r = o.clauses.map((l, s) => {
1578
- const i = s === 0 ? "" : `${String(l.join ?? "and").toUpperCase()} `;
1579
- return l.operator === "between" ? `${i}${re(l.operator)} ${U(l.value)} and ${U(l.value2)}` : l.operator === "isEmpty" || l.operator === "notEmpty" || l.operator === "isNull" || l.operator === "notNull" ? `${i}${re(l.operator)}` : `${i}${re(l.operator)} ${U(l.value)}`;
1580
- }).filter((l) => l.length > 0);
1581
- return r.length === 0 ? `${e}: active` : `${e} ${r.join(" ")}`;
1582
- }
1583
- function hn(e, o) {
1584
- if (e.kind === "condition") {
1585
- const r = o(e.key);
1586
- return e.operator === "between" ? `${r} between ${U(e.value)} and ${U(e.value2)}` : e.operator === "isEmpty" || e.operator === "notEmpty" || e.operator === "isNull" || e.operator === "notNull" ? `${r} ${re(e.operator)}` : `${r} ${re(e.operator)} ${U(e.value)}`;
1587
- }
1588
- return e.kind === "not" ? `NOT (${hn(e.child, o)})` : e.children.map((r) => hn(r, o)).filter((r) => r.length > 0).join(` ${e.operator.toUpperCase()} `);
1589
- }
1590
- const Ql = [
1591
- "sum",
1592
- "avg",
1593
- "min",
1594
- "max",
1595
- "count",
1596
- "countNonNull",
1597
- "first",
1598
- "last"
1599
- ], eo = [
1600
- "min",
1601
- "max",
1602
- "count",
1603
- "countNonNull",
1604
- "first",
1605
- "last"
1606
- ], to = [
1607
- "count",
1608
- "countNonNull",
1609
- "first",
1610
- "last"
1611
- ];
1612
- function no(e) {
1613
- return e === "number" || e === "currency" || e === "percent" ? Ql : e === "date" || e === "datetime" ? eo : to;
1614
- }
1615
- const lo = {
1616
- clipboard: ["cut", "copy", "paste"],
1617
- edit: ["clear"]
1618
- }, oo = {
1619
- insert: ["insert-row-above", "insert-row-below"],
1620
- clipboard: ["cut-row", "copy-row", "paste-row"],
1621
- selection: ["delete-selected-rows"]
1622
- }, In = {
1623
- cut: "Cut",
1624
- copy: "Copy",
1625
- paste: "Paste",
1626
- clear: "Clear values",
1627
- "insert-row-above": "Insert above",
1628
- "insert-row-below": "Insert below",
1629
- "copy-row": "Copy row",
1630
- "paste-row": "Paste row",
1631
- "cut-row": "Cut row",
1632
- "delete-selected-rows": "Delete selected rows",
1633
- "sort-asc": "Sort ascending",
1634
- "sort-desc": "Sort descending",
1635
- "sort-clear": "Clear sort",
1636
- filter: "Filter column",
1637
- "auto-size": "Auto size column"
1638
- }, ro = {
1639
- "insert-row-above": "Insert / Ctrl/Cmd+I",
1640
- "copy-row": "Ctrl/Cmd+C",
1641
- "paste-row": "Ctrl/Cmd+V",
1642
- "cut-row": "Ctrl/Cmd+X"
1643
- }, Mo = Fn({
1644
- name: "DataGridDefaultRenderer",
1645
- props: {
1646
- mode: {
1647
- type: String,
1648
- required: !0
1649
- },
1650
- rows: {
1651
- type: Array,
1652
- default: () => []
1653
- },
1654
- runtime: {
1655
- type: Object,
1656
- required: !0
1657
- },
1658
- runtimeRowModel: {
1659
- type: Object,
1660
- required: !0
1661
- },
1662
- selectionSnapshot: {
1663
- type: Object,
1664
- required: !0
1665
- },
1666
- selectionAnchor: {
1667
- type: Object,
1668
- required: !0
1669
- },
1670
- rowSelectionSnapshot: {
1671
- type: Object,
1672
- required: !0
1673
- },
1674
- syncSelectionSnapshotFromRuntime: {
1675
- type: Function,
1676
- required: !0
1677
- },
1678
- syncRowSelectionSnapshotFromRuntime: {
1679
- type: Function,
1680
- default: () => {
1681
- }
1682
- },
1683
- sortModel: {
1684
- type: Array,
1685
- default: void 0
1686
- },
1687
- filterModel: {
1688
- type: Object,
1689
- default: void 0
1690
- },
1691
- groupBy: {
1692
- type: Object,
1693
- default: void 0
1694
- },
1695
- pivotModel: {
1696
- type: Object,
1697
- default: void 0
1698
- },
1699
- renderMode: {
1700
- type: String,
1701
- default: "virtualization"
1702
- },
1703
- virtualization: {
1704
- type: Object,
1705
- required: !0
1706
- },
1707
- columnMenu: {
1708
- type: Object,
1709
- required: !0
1710
- },
1711
- cellMenu: {
1712
- type: Object,
1713
- required: !0
1714
- },
1715
- rowIndexMenu: {
1716
- type: Object,
1717
- required: !0
1718
- },
1719
- columnLayout: {
1720
- type: Object,
1721
- required: !0
1722
- },
1723
- aggregations: {
1724
- type: Object,
1725
- required: !0
1726
- },
1727
- advancedFilter: {
1728
- type: Object,
1729
- required: !0
1730
- },
1731
- rowHeightMode: {
1732
- type: String,
1733
- default: "fixed"
1734
- },
1735
- baseRowHeight: {
1736
- type: Number,
1737
- default: 31
1738
- },
1739
- layoutMode: {
1740
- type: String,
1741
- default: "fill"
1742
- },
1743
- minRows: {
1744
- type: Number,
1745
- default: null
1746
- },
1747
- maxRows: {
1748
- type: Number,
1749
- default: null
1750
- },
1751
- fillHandle: {
1752
- type: Boolean,
1753
- default: !1
1754
- },
1755
- rangeMove: {
1756
- type: Boolean,
1757
- default: !1
1758
- },
1759
- rowHover: {
1760
- type: Boolean,
1761
- default: !1
1762
- },
1763
- stripedRows: {
1764
- type: Boolean,
1765
- default: !1
1766
- },
1767
- showRowIndex: {
1768
- type: Boolean,
1769
- default: !0
1770
- },
1771
- rowSelection: {
1772
- type: Boolean,
1773
- default: !0
1774
- },
1775
- isCellEditable: {
1776
- type: Function,
1777
- default: void 0
1778
- },
1779
- viewMode: {
1780
- type: String,
1781
- default: "table"
1782
- },
1783
- gantt: {
1784
- type: [Boolean, Object],
1785
- default: void 0
1786
- },
1787
- toolbarModules: {
1788
- type: Array,
1789
- default: () => []
1790
- },
1791
- inspectorPanel: {
1792
- type: Object,
1793
- default: null
1794
- }
1795
- },
1796
- setup(e) {
1797
- const o = L(0), r = L(pn(e.sortModel)), l = L(Te(e.filterModel)), s = m(() => Ul(l.value));
1798
- let i = "";
1799
- const f = () => {
1800
- const t = e.runtimeRowModel.getSnapshot();
1801
- return [
1802
- t.kind,
1803
- t.revision ?? "",
1804
- t.rowCount,
1805
- t.loading ? 1 : 0,
1806
- t.projection?.recomputeVersion ?? t.projection?.version ?? ""
1807
- ].join("|");
1808
- };
1809
- i = f();
1810
- const C = e.runtimeRowModel.subscribe(() => {
1811
- const t = f();
1812
- t !== i && (i = t, o.value += 1);
1813
- });
1814
- En(() => {
1815
- C();
1816
- }), W(
1817
- () => e.sortModel,
1818
- (t) => {
1819
- r.value = pn(t);
1820
- },
1821
- { deep: !0 }
1822
- ), W(
1823
- () => e.filterModel,
1824
- (t) => {
1825
- l.value = Te(t);
1826
- },
1827
- { deep: !0 }
1828
- );
1829
- const y = m(() => e.mode), x = m(() => e.rows), b = m(() => (o.value, e.runtime.api.rows.getSnapshot().rowCount)), S = m(() => e.runtime.columnSnapshot.value.visibleColumns), M = m(() => e.runtime.columnSnapshot.value.columns ?? []), g = m(() => S.value.filter((t) => t.visible !== !1).map((t) => ({
1830
- key: t.key,
1831
- label: t.column.label ?? t.key
1832
- }))), I = m(() => M.value.map((t) => ({
1833
- key: t.key,
1834
- label: t.column.label ?? t.key,
1835
- visible: t.visible !== !1
1836
- }))), v = m(() => M.value.filter((t) => t.column.capabilities?.aggregatable === !0).map((t) => ({
1837
- key: t.key,
1838
- label: t.column.label ?? t.key,
1839
- allowedOps: no(t.column.dataType)
1840
- }))), R = L(e.rowHeightMode), A = m(() => Nl(e.baseRowHeight)), j = m(() => S.value[0]?.key ?? "name"), N = m(() => {
1841
- const t = /* @__PURE__ */ new Map();
1842
- for (const n of M.value)
1843
- t.set(n.key, n.column.label ?? n.key);
1844
- return t;
1845
- }), {
1846
- isColumnLayoutPanelOpen: ae,
1847
- columnLayoutPanelItems: Be,
1848
- openColumnLayoutPanel: vt,
1849
- cancelColumnLayoutPanel: K,
1850
- applyColumnLayoutPanel: _e,
1851
- moveColumnUp: ht,
1852
- moveColumnDown: bt,
1853
- updateColumnVisibility: H
1854
- } = rl({
1855
- resolveColumns: () => I.value,
1856
- applyColumnLayout: (t) => {
1857
- e.runtime.api.columns.setOrder(t.order);
1858
- for (const [n, u] of Object.entries(t.visibilityByKey))
1859
- e.runtime.api.columns.setVisibility(n, u);
1860
- }
1861
- }), {
1862
- isAdvancedFilterPanelOpen: yt,
1863
- advancedFilterDraftClauses: Rt,
1864
- appliedAdvancedFilterExpression: be,
1865
- openAdvancedFilterPanel: St,
1866
- addAdvancedFilterClause: Mt,
1867
- removeAdvancedFilterClause: pt,
1868
- updateAdvancedFilterClause: It,
1869
- cancelAdvancedFilterPanel: xt,
1870
- applyAdvancedFilterPanel: At,
1871
- clearAdvancedFilterPanel: Ot
1872
- } = al({
1873
- resolveColumns: () => g.value
1874
- }), D = L(!1), F = L(null), ie = m(() => !!e.groupBy?.fields?.length), se = m(() => (o.value, je(e.runtime.api.rows.getAggregationModel()))), Ge = m(() => (o.value, Xl(e.runtime.api.rows.getSnapshot().groupBy))), ye = m(() => {
1875
- const t = new Map(
1876
- (F.value?.columns ?? []).map((n) => [n.key, n.op])
1877
- );
1878
- return v.value.map((n) => {
1879
- const u = n.allowedOps[0] ?? "count", d = t.get(n.key), a = d && n.allowedOps.includes(d) ? d : u;
1880
- return {
1881
- key: n.key,
1882
- label: n.label,
1883
- enabled: t.has(n.key),
1884
- op: a,
1885
- allowedOps: n.allowedOps
1886
- };
1887
- });
1888
- }), P = m(() => F.value?.basis === "source" ? "source" : "filtered");
1889
- W(
1890
- se,
1891
- (t) => {
1892
- D.value || (F.value = je(t));
1893
- },
1894
- { immediate: !0, deep: !0 }
1895
- ), W(
1896
- () => e.rowHeightMode,
1897
- (t) => {
1898
- R.value = t;
1899
- }
1900
- );
1901
- const Pe = (t) => {
1902
- const n = l.value.columnFilters?.[t];
1903
- return n ? n.kind === "valueSet" ? n.tokens.length > 0 : !0 : !1;
1904
- }, Le = (t) => {
1905
- const n = l.value.columnFilters?.[t];
1906
- return !n || n.kind !== "valueSet" ? [] : n.tokens.map((u) => Cn(String(u ?? "")));
1907
- }, Re = (t) => Tn(e.columnMenu, t), We = (t) => fl(e.columnMenu, t), Ne = (t) => Cl(e.columnMenu, t), Ke = (t) => gl(e.columnMenu, t), Q = (t) => vl(e.columnMenu, t), Se = (t) => {
1908
- const n = Ge.value?.fields.findIndex((u) => u === t) ?? -1;
1909
- return n >= 0 ? n : null;
1910
- }, $e = (t) => Se(t) !== null, V = () => {
1911
- const t = r.value.map((u) => ({
1912
- key: u.key,
1913
- direction: u.direction
1914
- })), n = e.advancedFilter.enabled ? be.value : l.value.advancedExpression ?? null;
1915
- e.runtime.api.rows.setSortAndFilterModel({
1916
- sortModel: t,
1917
- filterModel: $l({
1918
- ...l.value,
1919
- advancedExpression: n
1920
- })
1921
- });
1922
- }, Ue = m(() => e.advancedFilter.enabled ? be.value ?? l.value.advancedExpression ?? null : l.value.advancedExpression ?? null), ee = m(() => {
1923
- const t = (u) => N.value.get(u) ?? u, n = [];
1924
- for (const [u, d] of Object.entries(l.value.columnFilters ?? {}))
1925
- d && n.push(Jl(t(u), d));
1926
- for (const [u, d] of Object.entries(l.value.advancedFilters ?? {}))
1927
- d && n.push(`Advanced: ${Zl(t(u), d)}`);
1928
- return Ue.value && n.push(`Advanced: ${hn(Ue.value, t)}`), Object.freeze(n);
1929
- }), Me = m(() => ee.value.length > 0), Ft = () => {
1930
- l.value = gn(), Ot(), V();
1931
- };
1932
- W(
1933
- be,
1934
- () => {
1935
- e.advancedFilter.enabled && V();
1936
- },
1937
- { deep: !0 }
1938
- );
1939
- const qe = (t, n = !1) => {
1940
- const u = r.value.findIndex((a) => a.key === t), d = u >= 0 ? r.value[u] : null;
1941
- if (!d) {
1942
- const a = { key: t, direction: "asc" };
1943
- r.value = n ? [...r.value, a] : [a], V();
1944
- return;
1945
- }
1946
- if (d.direction === "asc") {
1947
- const a = { key: t, direction: "desc" };
1948
- n ? r.value = r.value.map((w) => w.key === t ? a : w) : r.value = [a], V();
1949
- return;
1950
- }
1951
- r.value = n ? r.value.filter((a) => a.key !== t) : [], V();
1952
- }, Xe = (t) => {
1953
- const n = r.value.findIndex((a) => a.key === t);
1954
- if (n < 0)
1955
- return "";
1956
- const u = r.value[n];
1957
- if (!u)
1958
- return "";
1959
- const d = u.direction === "asc" ? "↑" : "↓";
1960
- return r.value.length > 1 ? `${d}${n + 1}` : d;
1961
- }, Dt = (t, n) => {
1962
- const u = Te(l.value), d = n.trim();
1963
- d ? u.columnFilters[t] = {
1964
- kind: "predicate",
1965
- operator: "contains",
1966
- value: d,
1967
- caseSensitive: !1
1968
- } : delete u.columnFilters[t], l.value = u, V();
1969
- }, Et = () => {
1970
- e.runtime.api.view.setRowHeightMode(R.value), e.runtime.api.view.setBaseRowHeight(A.value);
1971
- }, kt = () => {
1972
- F.value = je(se.value), D.value = !0;
1973
- }, ue = () => {
1974
- F.value = je(se.value), D.value = !1;
1975
- };
1976
- W(
1977
- ie,
1978
- (t) => {
1979
- t || ue();
1980
- },
1981
- { immediate: !0 }
1982
- );
1983
- const Ye = () => {
1984
- F.value = null;
1985
- }, Ht = (t) => {
1986
- F.value = {
1987
- basis: t,
1988
- columns: F.value?.columns ?? []
1989
- };
1990
- }, Vt = (t, n) => {
1991
- const u = v.value.find((h) => h.key === t);
1992
- if (!u)
1993
- return;
1994
- const d = F.value?.columns ?? [];
1995
- if (!n) {
1996
- const h = d.filter((O) => O.key !== t);
1997
- F.value = h.length > 0 ? { basis: P.value, columns: h } : null;
1998
- return;
1999
- }
2000
- const w = d.find((h) => h.key === t) ?? {
2001
- key: t,
2002
- op: u.allowedOps[0] ?? "count"
2003
- };
2004
- F.value = {
2005
- basis: P.value,
2006
- columns: [
2007
- ...d.filter((h) => h.key !== t),
2008
- w
2009
- ]
2010
- };
2011
- }, zt = (t, n) => {
2012
- const u = v.value.find((a) => a.key === t);
2013
- if (!u || !u.allowedOps.includes(n))
2014
- return;
2015
- const d = (F.value?.columns ?? []).map((a) => a.key !== t ? a : {
2016
- ...a,
2017
- op: n
2018
- });
2019
- F.value = {
2020
- basis: P.value,
2021
- columns: d
2022
- };
2023
- }, Tt = () => {
2024
- const t = F.value && F.value.columns.length > 0 ? F.value : null;
2025
- e.runtime.api.rows.setAggregationModel(t), F.value = je(t), D.value = !1;
2026
- }, pe = (t) => r.value.find((n) => n.key === t)?.direction ?? null, q = (t, n) => {
2027
- const u = S.value.find((d) => d.key === t);
2028
- !u || u.column.capabilities?.sortable === !1 || (r.value = n === null ? r.value.filter((d) => d.key !== t) : [{ key: t, direction: n }], V());
2029
- }, X = (t, n) => {
2030
- e.runtime.api.columns.setPin(t, n);
2031
- }, Je = (t, n) => {
2032
- const u = Ge.value, d = n ? Array.from(/* @__PURE__ */ new Set([...u?.fields ?? [], t])) : (u?.fields ?? []).filter((a) => a !== t);
2033
- e.runtime.api.rows.setGroupBy(d.length > 0 ? {
2034
- fields: d,
2035
- expandedByDefault: u?.expandedByDefault ?? !0
2036
- } : null);
2037
- }, Ze = (t, n) => {
2038
- const u = Array.from(new Set(
2039
- n.map((a) => Cn(String(a ?? ""))).filter((a) => a.length > 0)
2040
- ));
2041
- if (u.length === 0) {
2042
- Ie(t);
2043
- return;
2044
- }
2045
- const d = Te(l.value);
2046
- d.columnFilters[t] = {
2047
- kind: "valueSet",
2048
- tokens: u
2049
- }, l.value = d, V();
2050
- }, Ie = (t) => {
2051
- const n = Te(l.value);
2052
- delete n.columnFilters[t], l.value = n, V();
2053
- }, te = L(null), B = L(null);
2054
- let Qe = 0;
2055
- const xe = () => {
2056
- const t = e.selectionSnapshot.value, n = t?.ranges[t.activeRangeIndex] ?? null;
2057
- return n ? {
2058
- startRow: n.startRow,
2059
- endRow: n.endRow,
2060
- startColumn: n.startCol,
2061
- endColumn: n.endCol
2062
- } : null;
2063
- }, et = () => {
2064
- const t = e.selectionSnapshot.value?.activeCell;
2065
- return t ? {
2066
- rowIndex: t.rowIndex,
2067
- columnIndex: t.colIndex
2068
- } : null;
2069
- }, Ae = (t) => t ? t.startRow !== t.endRow || t.startColumn !== t.endColumn : !1, ce = (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) => {
2070
- const u = e.runtime.resolveBodyRowIndexById(t), d = S.value.findIndex((a) => a.key === n);
2071
- return u < 0 || d < 0 ? null : { rowIndex: u, columnIndex: d };
2072
- }, tt = (t) => ({
2073
- ranges: [{
2074
- startRow: t.rowIndex,
2075
- endRow: t.rowIndex,
2076
- startCol: t.columnIndex,
2077
- endCol: t.columnIndex,
2078
- anchor: {
2079
- rowIndex: t.rowIndex,
2080
- colIndex: t.columnIndex,
2081
- rowId: e.runtime.getBodyRowAtIndex(t.rowIndex)?.rowId ?? null
2082
- },
2083
- focus: {
2084
- rowIndex: t.rowIndex,
2085
- colIndex: t.columnIndex,
2086
- rowId: e.runtime.getBodyRowAtIndex(t.rowIndex)?.rowId ?? null
2087
- },
2088
- startRowId: e.runtime.getBodyRowAtIndex(t.rowIndex)?.rowId ?? null,
2089
- endRowId: e.runtime.getBodyRowAtIndex(t.rowIndex)?.rowId ?? null
2090
- }],
2091
- activeRangeIndex: 0,
2092
- activeCell: {
2093
- rowIndex: t.rowIndex,
2094
- colIndex: t.columnIndex,
2095
- rowId: e.runtime.getBodyRowAtIndex(t.rowIndex)?.rowId ?? null
2096
- }
2097
- }), nt = (t) => {
2098
- const n = e.runtime.api.rows.getCount();
2099
- for (let u = 0; u < n; u += 1) {
2100
- const d = e.runtime.api.rows.get(u);
2101
- if (d && String(d.rowId) === t)
2102
- return d;
2103
- }
2104
- return null;
2105
- }, Bt = async (t) => {
2106
- try {
2107
- return globalThis.navigator?.clipboard?.writeText ? (await globalThis.navigator.clipboard.writeText(t), !0) : !1;
2108
- } catch {
2109
- return !1;
2110
- }
2111
- }, _t = async () => {
2112
- try {
2113
- return globalThis.navigator?.clipboard?.readText ? await globalThis.navigator.clipboard.readText() : "";
2114
- } catch {
2115
- return "";
2116
- }
2117
- }, Gt = async () => {
2118
- if (B.value?.rows.length)
2119
- return B.value.rows.map((n) => J(n));
2120
- const t = (await _t()).trim();
2121
- if (!t)
2122
- return null;
2123
- try {
2124
- const n = JSON.parse(t);
2125
- if (Array.isArray(n))
2126
- return n.filter((u) => !!u && typeof u == "object").map((u) => J(u));
2127
- if (n && typeof n == "object")
2128
- return [J(n)];
2129
- } catch {
2130
- return null;
2131
- }
2132
- return null;
2133
- }, Oe = async (t, n, u = []) => {
2134
- const d = t.map((w) => J(w));
2135
- B.value = {
2136
- rows: d,
2137
- operation: n,
2138
- sourceRowIds: u.map((w) => String(w))
2139
- };
2140
- const a = ql(d);
2141
- return a && await Bt(a), !0;
2142
- }, ne = () => e.runtime.api.rows.hasInsertSupport(), de = () => e.runtime.api.rows.hasDataMutationSupport(), me = (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, we = (t) => {
2143
- const n = t;
2144
- return n.rowId != null ? String(n.rowId) : n.id != null ? String(n.id) : null;
2145
- }, le = (t) => {
2146
- for (const n of e.rows) {
2147
- if (!n || typeof n != "object")
2148
- continue;
2149
- const u = n;
2150
- if ((u.rowId != null ? String(u.rowId) : u.rowKey != null ? String(u.rowKey) : null) === t && me(u))
2151
- return u;
2152
- }
2153
- for (const n of e.rows) {
2154
- if (!n || typeof n != "object")
2155
- continue;
2156
- const u = n;
2157
- if (me(u))
2158
- return u;
2159
- }
2160
- return null;
2161
- }, Fe = () => (Qe += 1, `datagrid-row-${Date.now()}-${Qe}`), Pt = (t) => {
2162
- const n = J(t), u = Fe();
2163
- let d = !1;
2164
- return "id" in n && (n.id = u, d = !0), "rowId" in n && (n.rowId = u, d = !0), d || (n.id = u), n;
2165
- }, Lt = (t) => {
2166
- const n = Fe(), u = {};
2167
- for (const [d, a] of Object.entries(t)) {
2168
- if (d === "id" || d === "rowId") {
2169
- u[d] = n;
2170
- continue;
2171
- }
2172
- u[d] = typeof a == "number" ? null : "";
2173
- }
2174
- return !("id" in u) && !("rowId" in u) && (u.id = n), u;
2175
- }, lt = (t, n, u) => {
2176
- const d = Fe(), a = u === "clone" ? J(t) : Object.entries(t).reduce((h, [O, p]) => (h[O] = typeof p == "number" ? null : "", h), {});
2177
- ("id" in a || !("rowId" in a) && !("id" in a)) && (a.id = d), "rowId" in a && (a.rowId = d), "rowKey" in a && (a.rowKey = d);
2178
- const w = typeof n.state == "object" && n.state != null ? n.state : null;
2179
- return {
2180
- kind: n.kind === "group" ? "leaf" : n.kind ?? "leaf",
2181
- rowId: d,
2182
- rowKey: d,
2183
- state: {
2184
- ...w ?? {},
2185
- selected: !1,
2186
- group: !1,
2187
- pinned: "none",
2188
- expanded: !1
2189
- },
2190
- data: a,
2191
- row: J(a)
2192
- };
2193
- }, ot = (t, n = null) => n && me(n) ? lt(t, n, "clone") : Pt(t), De = (t, n = null) => n && me(n) ? lt(t, n, "blank") : Lt(t), Ee = (t) => {
2194
- const u = (e.rowSelectionSnapshot.value?.selectedRows ?? []).map((w) => String(w)).filter((w) => w.length > 0 && nt(w)?.kind !== "group");
2195
- if (u.length > 0)
2196
- return u;
2197
- const d = xe(), a = S.value.length - 1;
2198
- if (d && a >= 0) {
2199
- const w = Math.min(d.startColumn, d.endColumn), h = Math.max(d.startColumn, d.endColumn), O = Math.min(d.startRow, d.endRow), p = Math.max(d.startRow, d.endRow), G = t.length > 0 ? e.runtime.resolveBodyRowIndexById(t) : -1;
2200
- if (w === 0 && h === a && (G < 0 || G >= O && G <= p)) {
2201
- const $ = [];
2202
- for (let T = O; T <= p; T += 1) {
2203
- const E = e.runtime.getBodyRowAtIndex(T);
2204
- !E || E.kind === "group" || E.rowId == null || $.push(String(E.rowId));
2205
- }
2206
- if ($.length > 0)
2207
- return $;
2208
- }
2209
- }
2210
- return t.length > 0 ? [t] : [];
2211
- }, rt = () => {
2212
- const t = [], n = e.runtime.api.rows.getCount();
2213
- for (let u = 0; u < n; u += 1) {
2214
- const d = e.runtime.api.rows.get(u);
2215
- !d || d.kind === "group" || t.push(d.data);
2216
- }
2217
- return t;
2218
- }, Wt = (t) => {
2219
- if (!de() || t.length === 0)
2220
- return !1;
2221
- const n = new Set(t), u = rt().filter((d) => {
2222
- const a = we(d);
2223
- return a == null || !n.has(a);
2224
- });
2225
- 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);
2226
- }, Nt = (t, n) => {
2227
- if (!de() || t.length === 0 || !n)
2228
- return !1;
2229
- const u = rt(), d = new Set(t.map((O) => String(O)));
2230
- if (d.has(String(n)))
2231
- return !1;
2232
- const a = u.filter((O) => {
2233
- const p = we(O);
2234
- return p != null && d.has(p);
2235
- });
2236
- if (a.length === 0)
2237
- return !1;
2238
- const w = u.filter((O) => {
2239
- const p = we(O);
2240
- return p == null || !d.has(p);
2241
- }), h = w.findIndex((O) => we(O) === n);
2242
- return h < 0 ? !1 : (e.runtime.api.rows.replaceData([
2243
- ...w.slice(0, h + 1),
2244
- ...a,
2245
- ...w.slice(h + 1)
2246
- ]), e.runtime.api.rowSelection.hasSupport() && (e.runtime.api.rowSelection.selectRows(t), e.syncRowSelectionSnapshotFromRuntime?.()), !0);
2247
- }, Kt = () => B.value ? (B.value = null, !0) : !1, $t = (t) => {
2248
- if (t.kind === "group")
2249
- return !1;
2250
- const n = B.value;
2251
- return n ? n.sourceRowIds.includes(String(t.rowId)) : !1;
2252
- };
2253
- let at = () => !1, oe = () => {
2254
- }, ke = () => {
2255
- }, He = async (t, n) => !1;
2256
- const Ut = (t, n) => {
2257
- if (n)
2258
- return n;
2259
- const u = In[t], d = ro[t];
2260
- return d ? `${u} (${d})` : u;
2261
- }, {
2262
- tableStageProps: Ve,
2263
- tableStageContext: it,
2264
- copySelectedCells: qt,
2265
- pasteSelectedCells: Xt,
2266
- cutSelectedCells: Yt,
2267
- clearSelectedCells: Jt,
2268
- captureHistorySnapshot: fe,
2269
- recordHistoryIntentTransaction: Zt
2270
- } = _l({
2271
- mode: y,
2272
- layoutMode: m(() => e.layoutMode),
2273
- minRows: m(() => e.minRows),
2274
- maxRows: m(() => e.maxRows),
2275
- enableFillHandle: m(() => e.fillHandle),
2276
- enableRangeMove: m(() => e.rangeMove),
2277
- rows: x,
2278
- sourceRows: x,
2279
- runtime: e.runtime,
2280
- rowVersion: o,
2281
- totalRuntimeRows: b,
2282
- visibleColumns: S,
2283
- rowRenderMode: m(() => e.renderMode),
2284
- rowHeightMode: R,
2285
- normalizedBaseRowHeight: A,
2286
- selectionSnapshot: e.selectionSnapshot,
2287
- selectionAnchor: e.selectionAnchor,
2288
- rowSelectionSnapshot: e.rowSelectionSnapshot,
2289
- rowHover: m(() => e.rowHover),
2290
- stripedRows: m(() => e.stripedRows),
2291
- showRowIndex: m(() => e.showRowIndex),
2292
- showRowSelection: m(() => e.rowSelection),
2293
- isRowInPendingClipboardCut: $t,
2294
- syncSelectionSnapshotFromRuntime: e.syncSelectionSnapshotFromRuntime,
2295
- syncRowSelectionSnapshotFromRuntime: e.syncRowSelectionSnapshotFromRuntime,
2296
- clearExternalPendingClipboardOperation: Kt,
2297
- firstColumnKey: j,
2298
- columnFilterTextByKey: s,
2299
- virtualization: m(() => e.virtualization),
2300
- toggleSortForColumn: qe,
2301
- sortIndicator: Xe,
2302
- setColumnFilterText: Dt,
2303
- columnMenuEnabled: m(() => e.columnMenu.enabled),
2304
- columnMenuMaxFilterValues: m(() => e.columnMenu.maxFilterValues),
2305
- resolveColumnMenuItems: Re,
2306
- resolveColumnMenuDisabledItems: We,
2307
- resolveColumnMenuDisabledReasons: Ne,
2308
- resolveColumnMenuLabels: Ke,
2309
- resolveColumnMenuActionOptions: Q,
2310
- isColumnFilterActive: Pe,
2311
- isColumnGrouped: $e,
2312
- resolveColumnGroupOrder: Se,
2313
- resolveColumnMenuSortDirection: pe,
2314
- resolveColumnMenuSelectedTokens: Le,
2315
- applyColumnMenuSort: q,
2316
- applyColumnMenuPin: X,
2317
- applyColumnMenuGroupBy: Je,
2318
- applyColumnMenuFilter: Ze,
2319
- clearColumnMenuFilter: Ie,
2320
- applyRowHeightSettings: Et,
2321
- cloneRowData: J,
2322
- isCellEditable: e.isCellEditable,
2323
- isContextMenuVisible: () => at(),
2324
- closeContextMenu: () => oe(),
2325
- openContextMenuFromCurrentCell: () => {
2326
- ke();
2327
- },
2328
- runRowIndexKeyboardAction: (t, n) => He(t, n)
2329
- }), {
2330
- contextMenu: z,
2331
- contextMenuRef: st,
2332
- contextMenuStyle: Qt,
2333
- closeContextMenu: Y,
2334
- openContextMenu: ze,
2335
- onContextMenuKeyDown: en
2336
- } = Nn();
2337
- at = () => z.value.visible, oe = Y;
2338
- const tn = il({
2339
- isInteractionBlocked: () => !1,
2340
- isRangeMoveModifierActive: () => !1,
2341
- resolveSelectionRange: xe,
2342
- resolveCellCoordFromDataset: jt,
2343
- applyCellSelection: (t) => {
2344
- e.runtime.api.selection.setSnapshot(tt(t)), e.syncSelectionSnapshotFromRuntime();
2345
- },
2346
- resolveActiveCellCoord: et,
2347
- setActiveCellCoord: (t) => {
2348
- e.runtime.api.selection.setSnapshot(tt(t)), e.syncSelectionSnapshotFromRuntime();
2349
- },
2350
- cellCoordsEqual: (t, n) => t?.rowIndex === n?.rowIndex && t?.columnIndex === n?.columnIndex,
2351
- isMultiCellSelection: Ae,
2352
- isCoordInsideRange: ce,
2353
- openContextMenu: ze,
2354
- closeContextMenu: Y,
2355
- isColumnContextEnabled: (t) => e.cellMenu.enabled ? wt(e.cellMenu, t).length > 0 : !1,
2356
- isRowIndexContextEnabled: () => e.rowIndexMenu.enabled && e.showRowIndex
2357
- }), nn = sl({
2358
- resolveCurrentCellCoord: et,
2359
- resolveViewportElement: () => te.value,
2360
- resolveRowAtIndex: (t) => e.runtime.getBodyRowAtIndex(t) ?? void 0,
2361
- resolveColumnAtIndex: (t) => S.value[t] ?? void 0,
2362
- resolveSelectionRange: xe,
2363
- isMultiCellSelection: (t) => Ae(t),
2364
- isCoordInsideRange: ce,
2365
- openContextMenu: ze,
2366
- isColumnContextEnabled: (t) => e.cellMenu.enabled && wt(e.cellMenu, t.key).length > 0
2367
- });
2368
- ke = () => {
2369
- nn.openContextMenuFromCurrentCell();
2370
- };
2371
- const ln = (t) => {
2372
- if (!e.rowIndexMenu.enabled || !e.showRowIndex || !te.value)
2373
- return !1;
2374
- const n = String(t), u = `.datagrid-stage__row-index-cell[data-row-id="${Kl(n)}"]`, d = te.value.querySelector(u);
2375
- if (!d)
2376
- return !1;
2377
- const a = d.getBoundingClientRect();
2378
- return ze(
2379
- a.left + Math.max(10, Math.min(a.width / 2, Math.max(10, a.width - 10))),
2380
- a.bottom - 4,
2381
- {
2382
- zone: "row-index",
2383
- rowId: n
2384
- }
2385
- ), !0;
2386
- }, ge = (t, n) => {
2387
- Zt({
2388
- intent: "edit",
2389
- label: n
2390
- }, t);
2391
- };
2392
- He = async (t, n) => {
2393
- const u = String(n);
2394
- if (t === "open-row-menu")
2395
- return ln(u);
2396
- const d = nt(u);
2397
- if (!d || d.kind === "group")
2398
- return !1;
2399
- if (t === "insert-row-above") {
2400
- if (!ne())
2401
- return !1;
2402
- const a = fe(), w = e.runtime.api.rows.insertDataBefore(
2403
- n,
2404
- [De(d.data, le(u))]
2405
- );
2406
- return w && ge(a, "Insert row above"), w;
2407
- }
2408
- if (t === "insert-row-below") {
2409
- if (!ne())
2410
- return !1;
2411
- const a = fe(), w = e.runtime.api.rows.insertDataAfter(
2412
- n,
2413
- [De(d.data, le(u))]
2414
- );
2415
- return w && ge(a, "Insert row below"), w;
2416
- }
2417
- if (t === "copy-row")
2418
- return Oe([d.data], "copy", [u]);
2419
- if (t === "cut-row")
2420
- return Oe([d.data], "cut", [u]);
2421
- if (t === "paste-row") {
2422
- if (!ne())
2423
- return !1;
2424
- const a = await Gt();
2425
- if (!a || a.length === 0)
2426
- return !1;
2427
- const w = fe(), h = B.value?.operation === "cut" ? B.value.sourceRowIds : [], O = le(
2428
- h[0] ?? u
2429
- ) ?? le(u), p = h.length > 0 ? Nt(h, u) : e.runtime.api.rows.insertDataAfter(
2430
- n,
2431
- a.map((G) => ot(G, O))
2432
- );
2433
- return p && B.value?.operation === "cut" && (B.value = null), p && ge(
2434
- w,
2435
- h.length > 0 ? h.length > 1 ? `Move ${h.length} rows` : "Move row" : a.length > 1 ? `Paste ${a.length} rows` : "Paste row"
2436
- ), p;
2437
- }
2438
- if (t === "delete-selected-rows") {
2439
- const a = Ee(u);
2440
- if (a.length === 0)
2441
- return !1;
2442
- const w = fe(), h = Wt(a);
2443
- return h && ge(w, a.length > 1 ? `Delete ${a.length} rows` : "Delete row"), h;
2444
- }
2445
- return !1;
2446
- };
2447
- const on = ul({
2448
- resolveContextMenuState: () => ({
2449
- zone: z.value.zone,
2450
- columnKey: z.value.columnKey,
2451
- rowId: z.value.rowId
2452
- }),
2453
- runHeaderContextAction: () => !1,
2454
- runRowIndexContextAction: He,
2455
- copySelection: qt,
2456
- pasteSelection: Xt,
2457
- cutSelection: Yt,
2458
- clearCurrentSelection: Jt,
2459
- closeContextMenu: Y
2460
- }), ut = m(() => {
2461
- if (!z.value.visible)
2462
- return [];
2463
- const t = z.value.zone;
2464
- if (t === "cell" || t === "range") {
2465
- const n = z.value.columnKey ?? "";
2466
- if (!e.cellMenu.enabled || !n)
2467
- return [];
2468
- const u = wt(e.cellMenu, n), d = new Set(bl(e.cellMenu, n)), a = yl(e.cellMenu, n), w = Rl(e.cellMenu, n);
2469
- return u.flatMap((h, O) => {
2470
- const p = lo[h] ?? [];
2471
- return p.flatMap((G) => {
2472
- const T = w[G];
2473
- if (T?.hidden)
2474
- return [];
2475
- const E = d.has(h) || T?.disabled === !0;
2476
- return [{
2477
- id: G,
2478
- label: T?.label ?? In[G],
2479
- disabled: E,
2480
- title: T?.disabledReason ?? a[h],
2481
- separatorBefore: O > 0 && G === p[0]
2482
- }];
2483
- });
2484
- });
2485
- }
2486
- if (t === "row-index") {
2487
- if (!e.rowIndexMenu.enabled)
2488
- return [];
2489
- const n = Sl(e.rowIndexMenu), u = new Set(Ml(e.rowIndexMenu)), d = pl(e.rowIndexMenu), a = Il(e.rowIndexMenu);
2490
- return n.flatMap((w, h) => {
2491
- const O = oo[w] ?? [];
2492
- return O.flatMap((p) => {
2493
- const $ = 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"];
2494
- if ($?.hidden)
2495
- return [];
2496
- let T = u.has(w) || $?.disabled === !0, E = $?.disabledReason ?? d[w];
2497
- return (p === "insert-row-above" || p === "insert-row-below" || p === "paste-row") && !ne() && (T = !0, E = E ?? "Row insertion is not supported by the current row model"), (p === "cut-row" || p === "delete-selected-rows") && !de() && (T = !0, E = E ?? "Row deletion is not supported by the current row model"), p === "delete-selected-rows" && Ee(z.value.rowId ?? "").length === 0 && (T = !0, E = E ?? "No deletable rows are selected"), [{
2498
- id: p,
2499
- label: Ut(p, $?.label),
2500
- disabled: T,
2501
- title: E,
2502
- separatorBefore: h > 0 && p === O[0]
2503
- }];
2504
- });
2505
- });
2506
- }
2507
- return [];
2508
- }), rn = (t) => {
2509
- tn.dispatchViewportContextMenu(t);
2510
- }, Ce = () => {
2511
- te.value?.querySelector(".grid-body-viewport")?.focus({ preventScroll: !0 });
2512
- }, an = () => {
2513
- Dn(() => {
2514
- if (typeof window < "u") {
2515
- window.requestAnimationFrame(() => {
2516
- Ce();
2517
- });
2518
- return;
2519
- }
2520
- Ce();
2521
- });
2522
- }, ct = async (t) => {
2523
- await on.runContextMenuAction(t) && (Ce(), Y(), an());
2524
- };
2525
- W(
2526
- () => z.value.visible,
2527
- (t, n, u) => {
2528
- if (!t || typeof window > "u")
2529
- return;
2530
- const d = (w) => {
2531
- const h = w.target;
2532
- h && st.value?.contains(h) || Y();
2533
- }, a = () => {
2534
- Y();
2535
- };
2536
- window.addEventListener("mousedown", d, !0), window.addEventListener("blur", a), u(() => {
2537
- window.removeEventListener("mousedown", d, !0), window.removeEventListener("blur", a);
2538
- });
2539
- }
2540
- );
2541
- const dt = m(() => ({
2542
- ...Ve.value,
2543
- columns: {
2544
- ...Ve.value.columns,
2545
- columnMenuEnabled: e.columnMenu.enabled,
2546
- columnMenuMaxFilterValues: e.columnMenu.maxFilterValues,
2547
- resolveColumnMenuItems: Re,
2548
- resolveColumnMenuDisabledItems: We,
2549
- resolveColumnMenuDisabledReasons: Ne,
2550
- resolveColumnMenuLabels: Ke,
2551
- resolveColumnMenuActionOptions: Q,
2552
- isColumnFilterActive: Pe,
2553
- isColumnGrouped: $e,
2554
- resolveColumnGroupOrder: Se,
2555
- resolveColumnMenuSortDirection: pe,
2556
- resolveColumnMenuSelectedTokens: Le,
2557
- applyColumnMenuSort: q,
2558
- applyColumnMenuPin: X,
2559
- applyColumnMenuGroupBy: Je,
2560
- applyColumnMenuFilter: Ze,
2561
- clearColumnMenuFilter: Ie
2562
- },
2563
- rows: {
2564
- ...Ve.value.rows,
2565
- sourceRows: e.rows,
2566
- rowHover: e.rowHover,
2567
- stripedRows: e.stripedRows
2568
- }
2569
- })), sn = m(() => {
2570
- const t = [];
2571
- return e.columnLayout.enabled && t.push({
2572
- key: "column-layout",
2573
- component: Gl,
2574
- props: {
2575
- isOpen: ae.value,
2576
- items: Be.value,
2577
- buttonLabel: e.columnLayout.buttonLabel,
2578
- active: !1,
2579
- onOpen: vt,
2580
- onToggleVisibility: H,
2581
- onMoveUp: ht,
2582
- onMoveDown: bt,
2583
- onApply: _e,
2584
- onCancel: K
2585
- }
2586
- }), e.advancedFilter.enabled && t.push({
2587
- key: "advanced-filter",
2588
- component: Pl,
2589
- props: {
2590
- isOpen: yt.value,
2591
- clauses: Rt.value,
2592
- columns: g.value,
2593
- appliedFilterSummaryItems: ee.value,
2594
- hasAnyFilters: Me.value,
2595
- buttonLabel: e.advancedFilter.buttonLabel,
2596
- active: Me.value,
2597
- onOpen: St,
2598
- onAdd: Mt,
2599
- onRemove: pt,
2600
- onUpdateClause: It,
2601
- onApply: At,
2602
- onCancel: xt,
2603
- onResetAll: Ft
2604
- }
2605
- }), e.aggregations.enabled && e.mode !== "pivot" && t.push({
2606
- key: "aggregations",
2607
- component: Ll,
2608
- props: {
2609
- isOpen: D.value,
2610
- basis: P.value,
2611
- items: ye.value,
2612
- buttonLabel: e.aggregations.buttonLabel,
2613
- active: ie.value && (D.value || !!se.value?.columns.length),
2614
- disabled: !ie.value,
2615
- disabledReason: ie.value ? "" : "Aggregations require an active group-by model.",
2616
- onOpen: kt,
2617
- onUpdateBasis: Ht,
2618
- onToggleColumn: Vt,
2619
- onUpdateOp: zt,
2620
- onClear: Ye,
2621
- onApply: Tt,
2622
- onCancel: ue
2623
- }
2624
- }), [...t, ...e.toolbarModules];
2625
- });
2626
- return () => k("div", {
2627
- class: [
2628
- "datagrid-app-layout",
2629
- e.layoutMode === "auto-height" ? "datagrid-app-layout--auto-height" : "datagrid-app-layout--fill"
2630
- ]
2631
- }, [
2632
- k(ml, {
2633
- modules: sn.value
2634
- }),
2635
- k("div", {
2636
- class: [
2637
- "datagrid-app-workspace",
2638
- e.layoutMode === "auto-height" ? "datagrid-app-workspace--auto-height" : "datagrid-app-workspace--fill"
2639
- ]
2640
- }, [
2641
- k("div", {
2642
- class: [
2643
- "datagrid-app-stage",
2644
- e.layoutMode === "auto-height" ? "datagrid-app-stage--auto-height" : "datagrid-app-stage--fill"
2645
- ],
2646
- ref: te
2647
- }, [
2648
- e.viewMode === "gantt" ? k(Wl, {
2649
- stageContext: it,
2650
- runtime: e.runtime,
2651
- gantt: e.gantt,
2652
- baseRowHeight: A.value,
2653
- rowVersion: o.value
2654
- }) : k(dl, {
2655
- ...dt.value,
2656
- stageContext: it,
2657
- onViewportContextMenu: rn
2658
- }),
2659
- z.value.visible && ut.value.length > 0 ? k("div", {
2660
- ref: st,
2661
- class: "datagrid-context-menu",
2662
- style: Qt.value,
2663
- role: "menu",
2664
- tabindex: -1,
2665
- onKeydown: (t) => {
2666
- en(t, {
2667
- onEscape: () => {
2668
- Ce();
2669
- }
2670
- });
2671
- }
2672
- }, ut.value.flatMap((t) => {
2673
- const n = [];
2674
- return t.separatorBefore && n.push(k("div", {
2675
- class: "datagrid-context-menu__separator",
2676
- "aria-hidden": "true"
2677
- })), n.push(k("button", {
2678
- type: "button",
2679
- class: "datagrid-context-menu__item",
2680
- "data-datagrid-menu-action": t.id,
2681
- disabled: t.disabled,
2682
- title: t.title,
2683
- onClick: () => {
2684
- ct(t.id);
2685
- }
2686
- }, t.label)), n;
2687
- })) : null
2688
- ]),
2689
- e.inspectorPanel ? k("aside", {
2690
- class: "datagrid-app-inspector-shell"
2691
- }, [
2692
- k(e.inspectorPanel.component, {
2693
- ...e.inspectorPanel.props ?? {}
2694
- })
2695
- ]) : null
2696
- ])
2697
- ]);
2698
- }
2699
- }), wn = /* @__PURE__ */ new WeakMap(), xn = /* @__PURE__ */ new WeakMap();
2700
- function ao(e) {
2701
- if (!e)
2702
- return;
2703
- const o = wn.get(e);
2704
- if (o)
2705
- return o;
2706
- const r = e.initialTreeData?.expandedByDefault ?? !1;
2707
- if (e.initialTreeData?.expandedByDefault === r)
2708
- return wn.set(e, e), e;
2709
- const l = {
2710
- ...e
2711
- };
2712
- return e.initialTreeData && (l.initialTreeData = {
2713
- ...e.initialTreeData,
2714
- expandedByDefault: r
2715
- }), wn.set(e, l), l;
2716
- }
2717
- function io(e) {
2718
- return !e || e.length === 0 ? [] : e.map((o) => ({ ...o }));
2719
- }
2720
- function so(e) {
2721
- return !e || e.length === 0 ? [] : e.map((o) => ({ ...o }));
2722
- }
2723
- function uo(e) {
2724
- return !e || e.length === 0 ? [] : e.map(({ formula: o, ...r }) => ({ ...r }));
2725
- }
2726
- function co(e) {
2727
- return !e || e.length === 0 ? [] : e.flatMap((o) => {
2728
- const r = typeof o.formula == "string" ? o.formula.trim() : "";
2729
- return r ? [{
2730
- name: o.key,
2731
- formula: r
2732
- }] : [];
2733
- });
2734
- }
2735
- function mo(e, o) {
2736
- const r = /* @__PURE__ */ new Map();
2737
- for (const l of e)
2738
- r.set(l.name, { ...l });
2739
- for (const l of io(o))
2740
- r.set(l.name, l);
2741
- return Array.from(r.values());
2742
- }
2743
- function po(e) {
2744
- return uo(e);
2745
- }
2746
- function Io(e) {
2747
- const o = ao(e.clientRowModelOptions), r = e.enterpriseClientRowModelOptions, l = co(e.columns), s = e.formulas !== void 0, i = e.computedFields !== void 0, f = e.formulaFunctions !== void 0, C = l.length > 0, y = s || C ? mo(l, e.formulas) : void 0, x = i ? so(e.computedFields) : void 0, b = f ? e.formulaFunctions ?? {} : void 0, S = !!(C || s || i || f);
2748
- if (!o && !S)
2749
- return r ? {
2750
- ...r
2751
- } : void 0;
2752
- if (!S) {
2753
- if (o && !r)
2754
- return o;
2755
- if (!o && r)
2756
- return r;
2757
- if (o && r) {
2758
- let M = xn.get(o);
2759
- M || (M = /* @__PURE__ */ new WeakMap(), xn.set(o, M));
2760
- const g = M.get(r);
2761
- if (g)
2762
- return g;
2763
- const I = {
2764
- ...o,
2765
- ...r
2766
- };
2767
- return M.set(
2768
- r,
2769
- I
2770
- ), I;
2771
- }
2772
- }
2773
- return {
2774
- ...o ?? {},
2775
- ...i ? { initialComputedFields: x } : {},
2776
- ...s || C ? { initialFormulaFields: y } : {},
2777
- ...f ? { initialFormulaFunctionRegistry: b } : {},
2778
- ...r?.computeMode ? { computeMode: r.computeMode } : {},
2779
- ...r?.workerPatchDispatchThreshold !== void 0 ? { workerPatchDispatchThreshold: r.workerPatchDispatchThreshold } : {},
2780
- ...r?.formulaColumnCacheMaxColumns !== void 0 ? { formulaColumnCacheMaxColumns: r.formulaColumnCacheMaxColumns } : {}
2781
- };
2782
- }
2783
- function An() {
2784
- const e = globalThis.performance;
2785
- return e && typeof e.now == "function" ? e.now() : Date.now();
2786
- }
2787
- const wo = (e, o) => {
2788
- const r = An();
2789
- return {
2790
- result: o(),
2791
- duration: Math.max(0, An() - r)
2792
- };
2793
- };
2794
- function On(e) {
2795
- return {
2796
- projectionStageTimer: wo,
2797
- ...e ?? {}
2798
- };
2799
- }
2800
- function xo(e) {
2801
- const o = L(0), r = un(), l = _n(
2802
- e.rowModel.value ? null : un({
2803
- rows: e.rows.value,
2804
- ...On(e.clientRowModelOptions.value)
2805
- })
2806
- ), s = (C) => {
2807
- !C || C === e.rowModel.value || "dispose" in C && typeof C.dispose == "function" && C.dispose();
2808
- }, i = () => {
2809
- e.rowModel.value || (s(l.value), l.value = un({
2810
- rows: e.rows.value,
2811
- ...On(e.clientRowModelOptions.value)
2812
- }), o.value += 1, e.onOwnedRowModelRecreated?.());
2813
- }, f = m(() => e.rowModel.value ?? l.value ?? r);
2814
- return W(
2815
- e.rows,
2816
- (C) => {
2817
- l.value && l.value.setRows(C);
2818
- },
2819
- { deep: !1 }
2820
- ), W(
2821
- e.clientRowModelOptions,
2822
- () => {
2823
- i();
2824
- },
2825
- { deep: !0 }
2826
- ), W(
2827
- e.rowModel,
2828
- (C) => {
2829
- if (C) {
2830
- s(l.value), l.value = null, o.value += 1;
2831
- return;
2832
- }
2833
- l.value || i();
2834
- }
2835
- ), En(() => {
2836
- s(l.value), s(r);
2837
- }), {
2838
- dataGridInstanceKey: o,
2839
- resolvedRowModel: f,
2840
- disposeOwnedRowModel: s
2841
- };
2842
- }
2843
- export {
2844
- Mo as D,
2845
- ml as a,
2846
- xl as b,
2847
- _l as c,
2848
- yo as d,
2849
- Ro as e,
2850
- So as f,
2851
- po as g,
2852
- Io as r,
2853
- xo as u
2854
- };