@ishibashi0112/spreadsheet-grid-core 1.0.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controllers/activeRowFollowController.cjs +1 -0
- package/dist/controllers/activeRowFollowController.d.ts +18 -0
- package/dist/controllers/activeRowFollowController.js +68 -0
- package/dist/controllers/autoHeightMeasurer.cjs +1 -1
- package/dist/controllers/autoHeightMeasurer.js +17 -17
- package/dist/controllers/clipboardController.cjs +1 -1
- package/dist/controllers/clipboardController.d.ts +4 -0
- package/dist/controllers/clipboardController.js +82 -54
- package/dist/controllers/columnAutosizeRunner.cjs +1 -1
- package/dist/controllers/columnAutosizeRunner.d.ts +1 -0
- package/dist/controllers/columnAutosizeRunner.js +17 -16
- package/dist/controllers/columnHeaderDragController.cjs +1 -1
- package/dist/controllers/columnHeaderDragController.js +169 -168
- package/dist/controllers/columnMenuController.cjs +1 -1
- package/dist/controllers/columnMenuController.js +71 -69
- package/dist/controllers/contextMenuController.cjs +1 -1
- package/dist/controllers/contextMenuController.d.ts +5 -1
- package/dist/controllers/contextMenuController.js +62 -40
- package/dist/controllers/editController.cjs +1 -1
- package/dist/controllers/editController.d.ts +1 -0
- package/dist/controllers/editController.js +106 -99
- package/dist/controllers/fillHandleController.cjs +1 -1
- package/dist/controllers/fillHandleController.d.ts +1 -0
- package/dist/controllers/fillHandleController.js +157 -157
- package/dist/controllers/filterPopoverController.cjs +1 -1
- package/dist/controllers/filterPopoverController.js +6 -6
- package/dist/controllers/findController.cjs +1 -1
- package/dist/controllers/findController.d.ts +1 -0
- package/dist/controllers/findController.js +16 -15
- package/dist/controllers/historyController.cjs +1 -1
- package/dist/controllers/historyController.d.ts +6 -0
- package/dist/controllers/historyController.js +79 -37
- package/dist/controllers/imeInputController.cjs +1 -1
- package/dist/controllers/imeInputController.js +65 -54
- package/dist/controllers/keyboardController.cjs +1 -1
- package/dist/controllers/keyboardController.d.ts +1 -0
- package/dist/controllers/keyboardController.js +46 -42
- package/dist/controllers/pointerInteractionsController.cjs +1 -1
- package/dist/controllers/pointerInteractionsController.d.ts +1 -0
- package/dist/controllers/pointerInteractionsController.js +172 -172
- package/dist/controllers/popoverSupport.cjs +1 -1
- package/dist/controllers/popoverSupport.d.ts +1 -0
- package/dist/controllers/popoverSupport.js +9 -4
- package/dist/controllers/rowDragController.cjs +1 -1
- package/dist/controllers/rowDragController.d.ts +2 -0
- package/dist/controllers/rowDragController.js +160 -146
- package/dist/controllers/scrollSyncController.cjs +1 -1
- package/dist/controllers/scrollSyncController.js +45 -43
- package/dist/controllers/serverSideRowModel.cjs +1 -1
- package/dist/controllers/serverSideRowModel.js +19 -19
- package/dist/controllers/toolPanelController.cjs +1 -1
- package/dist/controllers/toolPanelController.js +26 -14
- package/dist/controllers/tooltipController.cjs +1 -1
- package/dist/controllers/tooltipController.js +74 -72
- package/dist/controllers/viewportSyncController.cjs +1 -1
- package/dist/controllers/viewportSyncController.d.ts +4 -1
- package/dist/controllers/viewportSyncController.js +66 -28
- package/dist/engine/columnCommands.cjs +1 -1
- package/dist/engine/columnCommands.js +113 -113
- package/dist/engine/createGridEngine.cjs +3 -3
- package/dist/engine/createGridEngine.d.ts +2 -0
- package/dist/engine/createGridEngine.js +72 -70
- package/dist/engine/exportCommands.cjs +1 -1
- package/dist/engine/exportCommands.js +18 -9
- package/dist/engine/fullFeatures.cjs +1 -1
- package/dist/engine/fullFeatures.js +6 -6
- package/dist/engine/gridApi.cjs +6 -6
- package/dist/engine/gridApi.d.ts +8 -2
- package/dist/engine/gridApi.js +197 -187
- package/dist/engine/notifiers.cjs +1 -1
- package/dist/engine/notifiers.d.ts +4 -0
- package/dist/engine/notifiers.js +7 -7
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +7 -6
- package/dist/locales/en.cjs +1 -1
- package/dist/locales/en.js +5 -0
- package/dist/logic/autoScrollGeometry.cjs +1 -1
- package/dist/logic/autoScrollGeometry.d.ts +2 -0
- package/dist/logic/autoScrollGeometry.js +3 -3
- package/dist/logic/editorValues.cjs +1 -1
- package/dist/logic/editorValues.js +37 -34
- package/dist/logic/exportCsv.cjs +3 -3
- package/dist/logic/exportCsv.d.ts +4 -1
- package/dist/logic/exportCsv.js +22 -20
- package/dist/logic/exportData.cjs +1 -1
- package/dist/logic/exportData.d.ts +4 -1
- package/dist/logic/exportData.js +40 -36
- package/dist/logic/filtering.cjs +1 -1
- package/dist/logic/filtering.d.ts +2 -1
- package/dist/logic/filtering.js +16 -3
- package/dist/logic/geometry.cjs +1 -1
- package/dist/logic/geometry.d.ts +2 -0
- package/dist/logic/geometry.js +41 -20
- package/dist/logic/gridState.cjs +1 -1
- package/dist/logic/gridState.d.ts +3 -2
- package/dist/logic/gridState.js +32 -23
- package/dist/logic/groupExport.cjs +1 -1
- package/dist/logic/groupExport.js +28 -27
- package/dist/logic/grouping.cjs +1 -1
- package/dist/logic/grouping.d.ts +1 -0
- package/dist/logic/grouping.js +52 -41
- package/dist/logic/historyRebase.cjs +1 -0
- package/dist/logic/historyRebase.d.ts +5 -0
- package/dist/logic/historyRebase.js +36 -0
- package/dist/logic/imeInput.cjs +1 -1
- package/dist/logic/imeInput.js +6 -4
- package/dist/logic/localeTextFeatures.cjs +1 -1
- package/dist/logic/localeTextFeatures.d.ts +8 -0
- package/dist/logic/localeTextFeatures.js +11 -5
- package/dist/logic/localeTextPopups.cjs +1 -1
- package/dist/logic/localeTextPopups.d.ts +1 -0
- package/dist/logic/localeTextPopups.js +1 -0
- package/dist/logic/pasteFill.cjs +1 -0
- package/dist/logic/pasteFill.d.ts +2 -0
- package/dist/logic/pasteFill.js +25 -0
- package/dist/logic/selectEditorState.cjs +1 -1
- package/dist/logic/selectEditorState.d.ts +4 -1
- package/dist/logic/selectEditorState.js +14 -14
- package/dist/logic/selectLabels.cjs +1 -0
- package/dist/logic/selectLabels.d.ts +3 -0
- package/dist/logic/selectLabels.js +41 -0
- package/dist/logic/selectionAggregates.cjs +1 -1
- package/dist/logic/selectionAggregates.js +2 -3
- package/dist/logic/validation.cjs +1 -1
- package/dist/logic/validation.d.ts +1 -1
- package/dist/logic/validation.js +21 -21
- package/dist/logic/valueParsers.cjs +1 -0
- package/dist/logic/valueParsers.d.ts +14 -0
- package/dist/logic/valueParsers.js +23 -0
- package/dist/model/gridActions.cjs +1 -1
- package/dist/model/gridActions.d.ts +13 -0
- package/dist/model/gridActions.js +11 -0
- package/dist/model/gridReducer.cjs +1 -1
- package/dist/model/gridReducer.js +128 -65
- package/dist/model/gridTypes.core.d.ts +345 -43
- package/dist/utils/clipboard.cjs +4 -4
- package/dist/utils/clipboard.d.ts +14 -2
- package/dist/utils/clipboard.js +101 -49
- package/dist/utils/gridVisibleBand.cjs +1 -0
- package/dist/utils/gridVisibleBand.d.ts +4 -0
- package/dist/utils/gridVisibleBand.js +24 -0
- package/dist/utils/popupContainer.cjs +1 -0
- package/dist/utils/popupContainer.d.ts +8 -0
- package/dist/utils/popupContainer.js +60 -0
- package/dist/utils/scrollBottom.cjs +1 -0
- package/dist/utils/scrollBottom.d.ts +1 -0
- package/dist/utils/scrollBottom.js +4 -0
- package/dist/utils/topAlignedInput.cjs +1 -0
- package/dist/utils/topAlignedInput.d.ts +3 -0
- package/dist/utils/topAlignedInput.js +23 -0
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { gridActions as e } from "../model/gridActions.js";
|
|
2
2
|
import { isViewCellEditable as t } from "../utils/permissions.js";
|
|
3
|
-
import {
|
|
4
|
-
import { computeNextScrollPosition as r, hasPointerLeftActivationRadius as i, resolveAutoScrollAxisDirection as a, resolveScrollContentBox as o } from "../logic/autoScrollGeometry.js";
|
|
5
|
-
import { resolveElementScale as
|
|
6
|
-
import { beginEscapeCancelableDrag as
|
|
7
|
-
import { createPopoverWindowBindings as
|
|
8
|
-
import { applyFillEditsToRows as
|
|
3
|
+
import { createValueStore as n } from "../logic/valueStore.js";
|
|
4
|
+
import { computeNextScrollPosition as r, hasPointerLeftActivationRadius as i, resolveAutoScrollAxisDirection as a, resolveScrollContentBox as o, resolveTopAutoScrollStart as s } from "../logic/autoScrollGeometry.js";
|
|
5
|
+
import { resolveElementScale as c } from "../logic/elementScale.js";
|
|
6
|
+
import { beginEscapeCancelableDrag as l } from "./escapeClaimController.js";
|
|
7
|
+
import { createPopoverWindowBindings as u, isInsideGridRoot as d, restoreGridFocus as f } from "./popoverSupport.js";
|
|
8
|
+
import { applyFillEditsToRows as p, buildFillEdits as m, isSameFillRange as h, previewFillValue as g, resolveFillColumnBounds as _, resolveFillDoubleClickTarget as v, resolveFillSource as y, resolveFillTarget as b, unionFillRange as x } from "../logic/fillHandle.js";
|
|
9
9
|
//#region src/controllers/fillHandleController.ts
|
|
10
|
-
var
|
|
10
|
+
var S = 168, C = 84, w = 106, T = () => typeof matchMedia == "function" && matchMedia("(pointer: coarse)").matches ? w : C, E = 8, D = { status: "idle" }, O = (e, t, n) => {
|
|
11
11
|
if (e.valueFormatter) try {
|
|
12
12
|
return e.valueFormatter({
|
|
13
13
|
value: n,
|
|
@@ -18,120 +18,120 @@ var x = 168, S = 84, C = 8, w = { status: "idle" }, T = (e, t, n) => {
|
|
|
18
18
|
return String(n ?? "");
|
|
19
19
|
}
|
|
20
20
|
return String(n ?? "");
|
|
21
|
-
}, ee = (e, t) => e === t || e.length === t.length && e.every((e, n) => e.key === t[n].key),
|
|
21
|
+
}, ee = (e, t) => e === t || e.length === t.length && e.every((e, n) => e.key === t[n].key), te = 500, k = 6, A = 2, j = (e) => {
|
|
22
22
|
let t = e.currentTarget;
|
|
23
23
|
if (!(t instanceof Element)) return !0;
|
|
24
24
|
let n = t.getBoundingClientRect();
|
|
25
|
-
return e.clientX >= n.left -
|
|
26
|
-
},
|
|
27
|
-
let
|
|
25
|
+
return e.clientX >= n.left - A && e.clientX <= n.right + A && e.clientY >= n.top - A && e.clientY <= n.bottom + A;
|
|
26
|
+
}, M = (e, t) => e === t || e !== void 0 && t !== void 0 && e.length === t.length && e.every((e, n) => Object.is(e, t[n])), N = (e, t) => Object.is(e, t) || e instanceof Date && t instanceof Date && e.getTime() === t.getTime(), P = (e, t) => e.length === t.length && e.every((e, n) => e.viewIndex === t[n].viewIndex && e.column.key === t[n].column.key && N(e.value, t[n].value)), F = () => {
|
|
27
|
+
let C = null, w = n(D), A = n(null), N = { current: null }, F = { current: null }, I = null, L = null, R = null, z = (e) => e ? "toggled" : "auto", B = (e) => (n, r, i, a) => t({
|
|
28
28
|
readOnly: e.readOnly,
|
|
29
29
|
canEditCell: e.canEditCell
|
|
30
|
-
}, e.rowModel, n, r, i, a),
|
|
31
|
-
if (
|
|
32
|
-
let e =
|
|
33
|
-
if (e.status === "dragging" && e.toggled ===
|
|
30
|
+
}, e.rowModel, n, r, i, a), V = () => {
|
|
31
|
+
if (R === null || C === null) return;
|
|
32
|
+
let e = w.getSnapshot();
|
|
33
|
+
if (e.status === "dragging" && e.toggled === R.toggled && (e.target === R.target || e.target !== null && R.target !== null && e.target.direction === R.target.direction && h(e.target.range, R.target.range))) return;
|
|
34
34
|
let t = null;
|
|
35
|
-
if (
|
|
36
|
-
let e =
|
|
37
|
-
rowModel:
|
|
38
|
-
columns:
|
|
39
|
-
source:
|
|
40
|
-
target:
|
|
41
|
-
request: R
|
|
42
|
-
canWriteCell:
|
|
43
|
-
getFillValue:
|
|
35
|
+
if (R.target !== null) {
|
|
36
|
+
let e = g({
|
|
37
|
+
rowModel: C.rowModel,
|
|
38
|
+
columns: C.columns,
|
|
39
|
+
source: R.source,
|
|
40
|
+
target: R.target,
|
|
41
|
+
request: z(R.toggled),
|
|
42
|
+
canWriteCell: B(C),
|
|
43
|
+
getFillValue: C.getFillValue
|
|
44
44
|
});
|
|
45
|
-
t = e &&
|
|
45
|
+
t = e && O(e.column, e.row, e.value) || null;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
w.setSnapshot({
|
|
48
48
|
status: "dragging",
|
|
49
|
-
source:
|
|
50
|
-
target:
|
|
51
|
-
toggled:
|
|
49
|
+
source: R.source,
|
|
50
|
+
target: R.target,
|
|
51
|
+
toggled: R.toggled,
|
|
52
52
|
previewText: t
|
|
53
53
|
});
|
|
54
|
-
}, V = () => {
|
|
55
|
-
if (L === null || O === null) return;
|
|
56
|
-
let e = g(O.columns), t = O.hitTest(L.pointer.x, L.pointer.y);
|
|
57
|
-
e === null || t === null || (L.target = y(L.source, t, O.rowModel.getRowCount(), e), B());
|
|
58
54
|
}, H = () => {
|
|
59
|
-
if (
|
|
60
|
-
let e =
|
|
61
|
-
e.
|
|
62
|
-
|
|
55
|
+
if (R === null || C === null) return;
|
|
56
|
+
let e = _(C.columns), t = C.hitTest(R.pointer.x, R.pointer.y);
|
|
57
|
+
e === null || t === null || (R.target = b(R.source, t, C.rowModel.getRowCount(), e), V());
|
|
58
|
+
}, U = () => {
|
|
59
|
+
if (R === null || C === null) return;
|
|
60
|
+
let e = R;
|
|
61
|
+
e.rafId = requestAnimationFrame(U);
|
|
62
|
+
let t = C.scrollContainerRef.current;
|
|
63
63
|
if (!t) return;
|
|
64
64
|
if (!e.armed) {
|
|
65
65
|
if (!i(e.origin, e.pointer, 6)) return;
|
|
66
66
|
e.armed = !0;
|
|
67
67
|
}
|
|
68
|
-
let n = t.getBoundingClientRect(), c = o({
|
|
68
|
+
let n = t.getBoundingClientRect(), l = c(t, n), u = o({
|
|
69
69
|
rectLeft: n.left,
|
|
70
70
|
rectTop: n.top,
|
|
71
71
|
clientLeft: t.clientLeft,
|
|
72
72
|
clientTop: t.clientTop,
|
|
73
73
|
clientWidth: t.clientWidth,
|
|
74
74
|
clientHeight: t.clientHeight,
|
|
75
|
-
scale:
|
|
76
|
-
}),
|
|
77
|
-
(
|
|
78
|
-
top:
|
|
79
|
-
left:
|
|
75
|
+
scale: l
|
|
76
|
+
}), d = r(t.scrollTop, a(e.pointer.y, s(u.top, (C.stickyTopHeight ?? 0) * l.y, 24), u.bottom - (C.footerHeight ?? 0), 24), 18, t.scrollHeight - t.clientHeight), f = r(t.scrollLeft, a(e.pointer.x, u.left, u.right, 24), 18, t.scrollWidth - t.clientWidth);
|
|
77
|
+
(d !== t.scrollTop || f !== t.scrollLeft) && (t.scrollTo({
|
|
78
|
+
top: d,
|
|
79
|
+
left: f,
|
|
80
80
|
behavior: "auto"
|
|
81
|
-
}),
|
|
82
|
-
},
|
|
83
|
-
let n =
|
|
81
|
+
}), H());
|
|
82
|
+
}, W = (e, t) => {
|
|
83
|
+
let n = R;
|
|
84
84
|
if (n !== null) {
|
|
85
|
-
if (
|
|
86
|
-
|
|
85
|
+
if (R = null, n.cleanup(), n.rafId !== null && cancelAnimationFrame(n.rafId), A.setSnapshot(null), w.setSnapshot(D), e && n.target !== null) {
|
|
86
|
+
L = null, q(n.source, n.target, z(n.toggled), n.activeCell);
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
L = e && t !== void 0 && n.onSquare ? {
|
|
90
90
|
time: t,
|
|
91
91
|
x: n.origin.x,
|
|
92
92
|
y: n.origin.y
|
|
93
93
|
} : null;
|
|
94
94
|
}
|
|
95
|
-
},
|
|
96
|
-
if (
|
|
97
|
-
let { dispatch: r } =
|
|
98
|
-
r(
|
|
99
|
-
row:
|
|
100
|
-
col:
|
|
101
|
-
})), r(
|
|
102
|
-
row:
|
|
103
|
-
col:
|
|
104
|
-
})), r(
|
|
105
|
-
row:
|
|
106
|
-
col:
|
|
95
|
+
}, G = (t, n) => {
|
|
96
|
+
if (C === null) return;
|
|
97
|
+
let { dispatch: r } = C;
|
|
98
|
+
r(e.startSelection({
|
|
99
|
+
row: t.startRow,
|
|
100
|
+
col: t.startCol
|
|
101
|
+
})), r(e.updateSelection({
|
|
102
|
+
row: t.endRow,
|
|
103
|
+
col: t.endCol
|
|
104
|
+
})), r(e.endSelection()), r(e.activateCell(n ?? {
|
|
105
|
+
row: t.startRow,
|
|
106
|
+
col: t.startCol
|
|
107
107
|
}));
|
|
108
|
-
},
|
|
108
|
+
}, K = (e, t) => {
|
|
109
109
|
let n = [];
|
|
110
110
|
for (let r = t.startRow; r <= t.endRow; r += 1) n.push(e.getRowKey(r));
|
|
111
111
|
return n;
|
|
112
|
-
},
|
|
113
|
-
if (
|
|
114
|
-
let i =
|
|
112
|
+
}, q = (e, t, n, r) => {
|
|
113
|
+
if (C === null || !C.enabled) return;
|
|
114
|
+
let i = C, a = m({
|
|
115
115
|
rowModel: i.rowModel,
|
|
116
116
|
columns: i.columns,
|
|
117
117
|
source: e,
|
|
118
118
|
target: t,
|
|
119
119
|
request: n,
|
|
120
|
-
canWriteCell:
|
|
120
|
+
canWriteCell: B(i),
|
|
121
121
|
getFillValue: i.getFillValue
|
|
122
122
|
});
|
|
123
123
|
if (a.edits.length === 0) return;
|
|
124
|
-
let o =
|
|
124
|
+
let o = x(e, t), s = null, c = [], l = null;
|
|
125
125
|
if (i.isServerSide) {
|
|
126
126
|
if (!i.applyServerSideCellEdits) return;
|
|
127
|
-
l =
|
|
127
|
+
l = K(i.rowModel, o), i.applyServerSideCellEdits(a.edits);
|
|
128
128
|
} else {
|
|
129
129
|
if (!i.applyRowsChange) return;
|
|
130
|
-
let e =
|
|
130
|
+
let e = p(i.rows, i.rowModel, a.edits);
|
|
131
131
|
if (e === i.rows) return;
|
|
132
132
|
s = i.rows, c.push(e), i.applyRowsChange(e);
|
|
133
133
|
}
|
|
134
|
-
|
|
134
|
+
I = {
|
|
135
135
|
source: e,
|
|
136
136
|
target: t,
|
|
137
137
|
range: o,
|
|
@@ -145,74 +145,74 @@ var x = 168, S = 84, C = 8, w = { status: "idle" }, T = (e, t, n) => {
|
|
|
145
145
|
baseRowModel: i.isServerSide ? null : i.rowModel,
|
|
146
146
|
emittedRows: c,
|
|
147
147
|
rowKeys: l
|
|
148
|
-
},
|
|
148
|
+
}, G(o, r), w.setSnapshot({
|
|
149
149
|
status: "filled",
|
|
150
150
|
range: o,
|
|
151
151
|
kind: a.kind,
|
|
152
152
|
seriesAvailable: a.seriesAvailable,
|
|
153
153
|
menu: null
|
|
154
154
|
});
|
|
155
|
-
},
|
|
155
|
+
}, J = u({
|
|
156
156
|
onScroll: (e) => {
|
|
157
|
-
e.target instanceof Node && N.current?.contains(e.target) ||
|
|
157
|
+
e.target instanceof Node && N.current?.contains(e.target) || X(!1);
|
|
158
158
|
},
|
|
159
|
-
onResize: () =>
|
|
160
|
-
isInside: (e) => N.current?.contains(e) === !0 ||
|
|
161
|
-
onOutsidePointerDown: (e) =>
|
|
162
|
-
getGridRoot: () =>
|
|
163
|
-
onGridHidden: () =>
|
|
159
|
+
onResize: () => X(!1),
|
|
160
|
+
isInside: (e) => N.current?.contains(e) === !0 || F.current?.contains(e) === !0,
|
|
161
|
+
onOutsidePointerDown: (e) => X(C !== null && d(C.gridRootRef, e)),
|
|
162
|
+
getGridRoot: () => C?.gridRootRef.current ?? null,
|
|
163
|
+
onGridHidden: () => X(!1),
|
|
164
164
|
onKeyDown: (e) => {
|
|
165
|
-
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(),
|
|
165
|
+
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), X(!0));
|
|
166
166
|
}
|
|
167
|
-
}),
|
|
168
|
-
let t =
|
|
169
|
-
t.status !== "filled" || t.menu === e ||
|
|
167
|
+
}), Y = (e) => {
|
|
168
|
+
let t = w.getSnapshot();
|
|
169
|
+
t.status !== "filled" || t.menu === e || w.setSnapshot({
|
|
170
170
|
...t,
|
|
171
171
|
menu: e
|
|
172
172
|
});
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
},
|
|
173
|
+
}, X = (e) => {
|
|
174
|
+
J.detach(), Y(null), e && C !== null && f(C.gridRootRef);
|
|
175
|
+
}, Z = () => {
|
|
176
176
|
let e = typeof document < "u" && N.current?.contains(document.activeElement) === !0;
|
|
177
|
-
|
|
178
|
-
},
|
|
179
|
-
let t =
|
|
177
|
+
I = null, J.detach(), w.getSnapshot().status === "filled" && w.setSnapshot(D), e && C !== null && f(C.gridRootRef);
|
|
178
|
+
}, ne = (e) => {
|
|
179
|
+
let t = w.getSnapshot();
|
|
180
180
|
if (t.status !== "filled") return;
|
|
181
181
|
if (t.menu !== null) {
|
|
182
|
-
|
|
182
|
+
X(!0);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
let n = Math.min(e.left, window.innerWidth -
|
|
186
|
-
n = Math.max(
|
|
187
|
-
let r = e.bottom + 4;
|
|
188
|
-
r +
|
|
185
|
+
let n = Math.min(e.left, window.innerWidth - S - E);
|
|
186
|
+
n = Math.max(E, n);
|
|
187
|
+
let r = e.bottom + 4, i = T();
|
|
188
|
+
r + i > window.innerHeight - E && (r = Math.max(E, e.top - 4 - i)), Y({
|
|
189
189
|
top: r,
|
|
190
190
|
left: n
|
|
191
|
-
}),
|
|
192
|
-
},
|
|
191
|
+
}), J.attach();
|
|
192
|
+
}, re = (e, t) => {
|
|
193
193
|
let n = t.rowKeys;
|
|
194
194
|
if (n === null) return !1;
|
|
195
195
|
for (let r = 0; r < n.length; r += 1) if (e.getRowKey(t.range.startRow + r) !== n[r]) return !1;
|
|
196
196
|
return !0;
|
|
197
|
-
},
|
|
198
|
-
let n =
|
|
199
|
-
if (
|
|
200
|
-
let i =
|
|
197
|
+
}, ie = (e) => {
|
|
198
|
+
let n = w.getSnapshot(), r = I;
|
|
199
|
+
if (X(!0), C === null || r === null || n.status !== "filled" || r.request === e) return;
|
|
200
|
+
let i = C;
|
|
201
201
|
if (i.isServerSide) {
|
|
202
|
-
if (!i.applyServerSideCellEdits || !
|
|
203
|
-
|
|
202
|
+
if (!i.applyServerSideCellEdits || !re(i.rowModel, r)) {
|
|
203
|
+
Z();
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
|
-
let t =
|
|
206
|
+
let t = m({
|
|
207
207
|
rowModel: i.rowModel,
|
|
208
208
|
columns: r.columns,
|
|
209
209
|
source: r.source,
|
|
210
210
|
target: r.target,
|
|
211
211
|
request: e,
|
|
212
|
-
canWriteCell:
|
|
212
|
+
canWriteCell: B(i),
|
|
213
213
|
getFillValue: i.getFillValue
|
|
214
214
|
});
|
|
215
|
-
r.request = e, t.edits.length > 0 && !
|
|
215
|
+
r.request = e, t.edits.length > 0 && !P(t.edits, r.edits) && i.applyServerSideCellEdits(t.edits), r.edits = t.edits, w.setSnapshot({
|
|
216
216
|
...n,
|
|
217
217
|
kind: t.kind,
|
|
218
218
|
menu: null
|
|
@@ -220,10 +220,10 @@ var x = 168, S = 84, C = 8, w = { status: "idle" }, T = (e, t, n) => {
|
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
222
|
if (!i.amendRowsChange || r.baseRows === null || r.baseRowModel === null) {
|
|
223
|
-
|
|
223
|
+
Z();
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
|
-
let a = r.baseRowModel, o =
|
|
226
|
+
let a = r.baseRowModel, o = m({
|
|
227
227
|
rowModel: a,
|
|
228
228
|
columns: r.columns,
|
|
229
229
|
source: r.source,
|
|
@@ -235,11 +235,11 @@ var x = 168, S = 84, C = 8, w = { status: "idle" }, T = (e, t, n) => {
|
|
|
235
235
|
}, a, e, n, r, o),
|
|
236
236
|
getFillValue: i.getFillValue
|
|
237
237
|
});
|
|
238
|
-
if (r.request = e, !
|
|
239
|
-
let e =
|
|
238
|
+
if (r.request = e, !P(o.edits, r.edits)) {
|
|
239
|
+
let e = p(r.baseRows, a, o.edits);
|
|
240
240
|
r.emittedRows.push(e), r.edits = o.edits, i.amendRowsChange(e);
|
|
241
241
|
}
|
|
242
|
-
|
|
242
|
+
w.setSnapshot({
|
|
243
243
|
...n,
|
|
244
244
|
kind: o.kind,
|
|
245
245
|
menu: null
|
|
@@ -247,68 +247,68 @@ var x = 168, S = 84, C = 8, w = { status: "idle" }, T = (e, t, n) => {
|
|
|
247
247
|
}, Q = (e, t) => {
|
|
248
248
|
if (e?.type !== "cell") return !1;
|
|
249
249
|
let { start: n, end: r } = e.range;
|
|
250
|
-
return
|
|
250
|
+
return h(t, {
|
|
251
251
|
startRow: Math.min(n.row, r.row),
|
|
252
252
|
endRow: Math.max(n.row, r.row),
|
|
253
253
|
startCol: Math.min(n.col, r.col),
|
|
254
254
|
endCol: Math.max(n.col, r.col)
|
|
255
255
|
});
|
|
256
|
-
},
|
|
257
|
-
let t =
|
|
256
|
+
}, ae = (e) => {
|
|
257
|
+
let t = I;
|
|
258
258
|
if (t !== null) {
|
|
259
|
-
if (!e.enabled || e.editing || !ee(e.columns, t.columns) || !
|
|
260
|
-
|
|
259
|
+
if (!e.enabled || e.editing || !ee(e.columns, t.columns) || !M(e.viewKey, t.viewKey)) {
|
|
260
|
+
Z();
|
|
261
261
|
return;
|
|
262
262
|
}
|
|
263
263
|
if (!e.isServerSide && e.rows !== t.baseRows && !t.emittedRows.includes(e.rows)) {
|
|
264
|
-
|
|
264
|
+
Z();
|
|
265
265
|
return;
|
|
266
266
|
}
|
|
267
267
|
if (Q(e.selection, t.range)) {
|
|
268
268
|
t.selectionConfirmed = !0;
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
|
-
!t.selectionConfirmed && Q(e.selection, t.previousSource) ||
|
|
271
|
+
!t.selectionConfirmed && Q(e.selection, t.previousSource) || Z();
|
|
272
272
|
}
|
|
273
|
-
},
|
|
274
|
-
if (
|
|
275
|
-
let t =
|
|
273
|
+
}, oe = (e) => {
|
|
274
|
+
if (C === null || e.button !== 0 || (e.preventDefault(), R !== null || !C.enabled || C.editing)) return;
|
|
275
|
+
let t = y(C.selection, C.activeCell, C.rowModel.getRowCount(), C.columns.length);
|
|
276
276
|
if (t === null) return;
|
|
277
|
-
let n =
|
|
278
|
-
|
|
279
|
-
let r =
|
|
280
|
-
if (n !== null && r && e.timeStamp - n.time <=
|
|
281
|
-
|
|
277
|
+
let n = L;
|
|
278
|
+
L = null;
|
|
279
|
+
let r = j(e);
|
|
280
|
+
if (n !== null && r && e.timeStamp - n.time <= te && Math.abs(e.clientX - n.x) <= k && Math.abs(e.clientY - n.y) <= k) {
|
|
281
|
+
C.gridRootRef.current?.focus({ preventScroll: !0 }), $();
|
|
282
282
|
return;
|
|
283
283
|
}
|
|
284
|
-
|
|
284
|
+
Z(), C.gridRootRef.current?.focus({ preventScroll: !0 });
|
|
285
285
|
let i = e.pointerId, a = (e) => {
|
|
286
|
-
|
|
286
|
+
R === null || e.pointerId !== i || (R.pointer = {
|
|
287
287
|
x: e.clientX,
|
|
288
288
|
y: e.clientY
|
|
289
|
-
},
|
|
289
|
+
}, R.toggled = e.ctrlKey || e.metaKey, A.setSnapshot(R.pointer), H());
|
|
290
290
|
}, o = (e) => {
|
|
291
|
-
|
|
291
|
+
R === null || e.pointerId !== i || (R.toggled = e.ctrlKey || e.metaKey, W(!0, e.timeStamp));
|
|
292
292
|
}, s = (e) => {
|
|
293
|
-
e.pointerId === i &&
|
|
294
|
-
},
|
|
295
|
-
if (
|
|
293
|
+
e.pointerId === i && W(!1);
|
|
294
|
+
}, c = (e) => {
|
|
295
|
+
if (R === null) return;
|
|
296
296
|
if (e.preventDefault(), e.stopPropagation(), e.type === "keydown" && e.key === "Escape") {
|
|
297
|
-
|
|
297
|
+
W(!1);
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
300
|
let t = e.ctrlKey || e.metaKey;
|
|
301
|
-
t !==
|
|
302
|
-
}, u = () =>
|
|
303
|
-
window.addEventListener("pointermove", a), window.addEventListener("pointerup", o), window.addEventListener("pointercancel", s), window.addEventListener("keydown",
|
|
304
|
-
let d =
|
|
301
|
+
t !== R.toggled && (R.toggled = t, V());
|
|
302
|
+
}, u = () => W(!1);
|
|
303
|
+
window.addEventListener("pointermove", a), window.addEventListener("pointerup", o), window.addEventListener("pointercancel", s), window.addEventListener("keydown", c, !0), window.addEventListener("keyup", c, !0), window.addEventListener("blur", u);
|
|
304
|
+
let d = l(), f = {
|
|
305
305
|
x: e.clientX,
|
|
306
306
|
y: e.clientY
|
|
307
307
|
};
|
|
308
|
-
|
|
308
|
+
R = {
|
|
309
309
|
pointerId: i,
|
|
310
310
|
source: t,
|
|
311
|
-
activeCell:
|
|
311
|
+
activeCell: C.activeCell,
|
|
312
312
|
origin: f,
|
|
313
313
|
onSquare: r,
|
|
314
314
|
pointer: f,
|
|
@@ -317,35 +317,35 @@ var x = 168, S = 84, C = 8, w = { status: "idle" }, T = (e, t, n) => {
|
|
|
317
317
|
armed: !1,
|
|
318
318
|
rafId: null,
|
|
319
319
|
cleanup: () => {
|
|
320
|
-
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o), window.removeEventListener("pointercancel", s), window.removeEventListener("keydown",
|
|
320
|
+
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o), window.removeEventListener("pointercancel", s), window.removeEventListener("keydown", c, !0), window.removeEventListener("keyup", c, !0), window.removeEventListener("blur", u), d();
|
|
321
321
|
}
|
|
322
|
-
},
|
|
322
|
+
}, A.setSnapshot(f), V(), R.rafId = requestAnimationFrame(U);
|
|
323
323
|
}, $ = () => {
|
|
324
|
-
if (
|
|
325
|
-
let e =
|
|
324
|
+
if (C === null || R !== null || !C.enabled || C.editing) return;
|
|
325
|
+
let e = y(C.selection, C.activeCell, C.rowModel.getRowCount(), C.columns.length);
|
|
326
326
|
if (e === null) return;
|
|
327
|
-
let t =
|
|
328
|
-
t !== null && (
|
|
327
|
+
let t = v(e, C.rowModel, C.columns);
|
|
328
|
+
t !== null && (Z(), q(e, t, "auto", C.activeCell));
|
|
329
329
|
};
|
|
330
330
|
return {
|
|
331
331
|
update: (e) => {
|
|
332
|
-
|
|
332
|
+
C = e, R !== null && (!e.enabled || e.editing) && W(!1), ae(e);
|
|
333
333
|
},
|
|
334
|
-
subscribe:
|
|
335
|
-
getSnapshot:
|
|
336
|
-
subscribePointer:
|
|
337
|
-
getPointerSnapshot:
|
|
338
|
-
handlePointerDown:
|
|
334
|
+
subscribe: w.subscribe,
|
|
335
|
+
getSnapshot: w.getSnapshot,
|
|
336
|
+
subscribePointer: A.subscribe,
|
|
337
|
+
getPointerSnapshot: A.getSnapshot,
|
|
338
|
+
handlePointerDown: oe,
|
|
339
339
|
handleDoubleClick: $,
|
|
340
|
-
toggleMenu:
|
|
341
|
-
closeMenu: () =>
|
|
342
|
-
chooseKind:
|
|
340
|
+
toggleMenu: ne,
|
|
341
|
+
closeMenu: () => X(!0),
|
|
342
|
+
chooseKind: ie,
|
|
343
343
|
menuPanel: N,
|
|
344
|
-
chipElement:
|
|
344
|
+
chipElement: F,
|
|
345
345
|
dispose: () => {
|
|
346
|
-
|
|
346
|
+
W(!1), J.detach(), I = null;
|
|
347
347
|
}
|
|
348
348
|
};
|
|
349
349
|
};
|
|
350
350
|
//#endregion
|
|
351
|
-
export {
|
|
351
|
+
export { F as createFillHandleController };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/detailRow.cjs"),t=require("../logic/valueStore.cjs"),n=require("./popoverSupport.cjs"),r=require("../logic/filtering.cjs"),i=require("../logic/numberFilterCondition.cjs"),a=require("../logic/textFilterCondition.cjs"),o=require("../logic/dateFilterCondition.cjs"),s=require("../logic/filterPopoverLayout.cjs"),c=require("../logic/filterPopoverOutsideClick.cjs");var l=240,u=8,d=8,f=230,p=340,m=480,h=(e,t)=>{if(!t)return null;let n=e.find(e=>e.key===t.columnKey)??null;return!n||n.filterType===t.filterType?n:{...n,filterType:t.filterType}},g=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(pointer: coarse)`).matches,_=()=>{let _=null,v=t.createValueStore({state:null,layout:null}),y={current:null},b={current:null},x={current:null},S=null,C=null,w=null,T=null,E=null,D=null,O=null,k=null,A=e=>{let t=v.getSnapshot(),n=t.layout;n===e||n!==null&&e!==null&&n.top===e.top&&n.left===e.left&&n.width===e.width&&n.maxHeight===e.maxHeight||v.setSnapshot({...t,layout:e})},j=()=>_===null?null:h(_.visibleColumns,v.getSnapshot().state),M=t=>{let n=_?.gridRootRef.current??null;if(!n)return null;let r=_?.resolveAnchorColumnKey?.(t)??t,i=n.querySelectorAll(`[data-ssg-col-key]`);return Array.from(i).find(t=>t.dataset.ssgColKey===r&&!e.isInsideDetailCardOf(n,t))??null},N=()=>{let e=v.getSnapshot().state;if(!e||!S){A(null);return}if(!S.isConnected){let t=M(e.columnKey);if(t===null)return;S=t}let t=S.getBoundingClientRect(),n=j()?.filterType,r=n===`numberSet`||n===`textSet`||n===`dateSet`?m:n===`set`?p:f,{top:i,left:a,maxHeight:o}=s.computeFilterPopoverPlacement({anchorTop:t.top,anchorBottom:t.bottom,anchorRight:t.right,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,popupWidth:l,popupHeight:C??r,offsetY:d,viewportMargin:u});A({top:i,left:a,width:l,maxHeight:o})},P=()=>{E!==null&&(cancelAnimationFrame(E),E=null),D!==null&&(cancelAnimationFrame(D),D=null)},F=()=>{w?.disconnect(),w=null,T=null},I=e=>{v.setSnapshot({state:null,layout:null}),S=null,b.current=null,x.current=null,C=null,R.detach(),F(),P(),O=null,_!==null&&e&&n.restoreGridFocus(_.gridRootRef)},L=()=>I(!0),R=n.createPopoverWindowBindings({onResize:N,onScroll:N,isInside:e=>!c.isFilterPopoverOutsideTarget(e,y.current),onOutsidePointerDown:e=>I(_!==null&&n.isInsideGridRoot(_.gridRootRef,e)),getGridRoot:()=>_?.gridRootRef.current??null,onGridHidden:()=>I(!1),onKeyDown:e=>{e.key!==`Escape`||y.current!==null||(e.preventDefault(),L())}}),z=e=>{if(_===null||!_.enableColumnFilter)return;let{gridRootRef:t,resolveColumnFilterType:s,columnFilterValues:c}=_;n.blurForPopover(t.current),S=M(e.key);let l=e.filterType===`auto`&&s?s(e):e.filterType??`text`,u=c[e.key],d=l===`number`?i.numberFilterValueToConditionDraft(r.isNumberColumnFilterValue(u)?u:void 0):l===`numberSet`?i.parsedNumberFilterToConditionDraft(r.isNumberSetColumnFilterValue(u)?u.condition:void 0):null,f=l===`textSet`?a.parsedTextFilterToConditionDraft(r.isTextSetColumnFilterValue(u)?u.condition:void 0):null,p=l===`dateSet`?o.parsedDateFilterToConditionDraft(r.isDateSetColumnFilterValue(u)?u.condition:void 0):null;v.setSnapshot({...v.getSnapshot(),state:{columnKey:e.key,filterType:l,draftValue:r.columnFilterValueToDraftText(u),numberDraft:d,textDraft:f,dateDraft:p}}),N(),R.attach()},B=e=>{let t=v.getSnapshot();t.state&&v.setSnapshot({...t,state:{...t.state,...e}})},V=()=>{let e=y.current;if(!(v.getSnapshot().layout!==null&&e!==null)||typeof ResizeObserver>`u`){F();return}T!==e&&(F(),w=new ResizeObserver(()=>{let e=y.current?.getBoundingClientRect().height??null;e===null||e===C||(C=e,N())}),w.observe(e),T=e)},H=()=>{let{state:e,layout:t}=v.getSnapshot(),n=j();if(!e||!n||!t){P(),O=null;return}if(y.current===null){P(),O=null;return}let r=k!==_?.visibleColumns,i=`${e.columnKey}|${e.filterType}|${t.top}|${t.left}|${t.width}`;if(!r&&O===i)return;O=i,k=_?.visibleColumns??null,P();let a=n.filterType??`text`;E=requestAnimationFrame(()=>{E=null,D=requestAnimationFrame(()=>{if(D=null,a===`select`){x.current?.focus();return}if(g()){y.current?.focus({preventScroll:!0});return}let e=b.current;if(e&&(e.focus(),e.type===`text`)){let t=e.value.length;e.setSelectionRange(t,t)}})})};return{update:e=>{_=e,V(),H()},subscribe:v.subscribe,getSnapshot:v.getSnapshot,panelRef:y,textInputRef:b,selectRef:x,open:z,close:L,updateDraft:e=>B({draftValue:e}),updateNumberDraft:e=>B({numberDraft:e}),updateTextDraft:e=>B({textDraft:e}),updateDateDraft:e=>B({dateDraft:e}),dispose:()=>{R.detach(),F(),P()}}};exports.createFilterPopoverController=_,exports.resolveOpenedFilterColumn=h;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { isInsideDetailCardOf as e } from "../logic/detailRow.js";
|
|
2
|
+
import { createValueStore as t } from "../logic/valueStore.js";
|
|
3
3
|
import { blurForPopover as n, createPopoverWindowBindings as r, isInsideGridRoot as i, restoreGridFocus as a } from "./popoverSupport.js";
|
|
4
4
|
import { columnFilterValueToDraftText as o, isDateSetColumnFilterValue as s, isNumberColumnFilterValue as c, isNumberSetColumnFilterValue as l, isTextSetColumnFilterValue as u } from "../logic/filtering.js";
|
|
5
5
|
import { numberFilterValueToConditionDraft as d, parsedNumberFilterToConditionDraft as f } from "../logic/numberFilterCondition.js";
|
|
@@ -16,7 +16,7 @@ var _ = 240, v = 8, y = 8, b = 230, x = 340, S = 480, C = (e, t) => {
|
|
|
16
16
|
filterType: t.filterType
|
|
17
17
|
};
|
|
18
18
|
}, w = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(pointer: coarse)").matches, T = () => {
|
|
19
|
-
let T = null, E =
|
|
19
|
+
let T = null, E = t({
|
|
20
20
|
state: null,
|
|
21
21
|
layout: null
|
|
22
22
|
}), D = { current: null }, O = { current: null }, k = { current: null }, A = null, j = null, M = null, N = null, P = null, F = null, I = null, L = null, R = (e) => {
|
|
@@ -25,11 +25,11 @@ var _ = 240, v = 8, y = 8, b = 230, x = 340, S = 480, C = (e, t) => {
|
|
|
25
25
|
...t,
|
|
26
26
|
layout: e
|
|
27
27
|
});
|
|
28
|
-
}, z = () => T === null ? null : C(T.visibleColumns, E.getSnapshot().state), B = (
|
|
28
|
+
}, z = () => T === null ? null : C(T.visibleColumns, E.getSnapshot().state), B = (t) => {
|
|
29
29
|
let n = T?.gridRootRef.current ?? null;
|
|
30
30
|
if (!n) return null;
|
|
31
|
-
let r = T?.resolveAnchorColumnKey?.(
|
|
32
|
-
return Array.from(i).find((
|
|
31
|
+
let r = T?.resolveAnchorColumnKey?.(t) ?? t, i = n.querySelectorAll("[data-ssg-col-key]");
|
|
32
|
+
return Array.from(i).find((t) => t.dataset.ssgColKey === r && !e(n, t)) ?? null;
|
|
33
33
|
}, V = () => {
|
|
34
34
|
let e = E.getSnapshot().state;
|
|
35
35
|
if (!e || !A) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/detailRow.cjs"),t=require("../logic/valueStore.cjs"),n=require("../logic/chunkedLoop.cjs"),r=require("../logic/find.cjs");var i=1e4,a=5e4,o=new Map,s=[],c=(e,t)=>e.length===t.length&&e.every((e,n)=>{let r=t[n];return e.rowIndex===r.rowIndex&&e.colIndex===r.colIndex&&e.columnKey===r.columnKey&&e.start===r.start&&e.length===r.length}),l=()=>{let i=null,l=0,u=null,d=!1,f=null,p=t.createValueStore({open:!1,query:``,matches:[],index:o,currentIndex:null,scanning:!1,truncated:!1}),m=e=>{p.setSnapshot({...p.getSnapshot(),...e})},h=null,g=()=>{let e=p.getSnapshot(),t={query:e.query,matchCount:e.matches.length,currentIndex:e.currentIndex,open:e.open,truncated:e.truncated};h!==null&&h.query===t.query&&h.matchCount===t.matchCount&&h.currentIndex===t.currentIndex&&h.open===t.open&&h.truncated===t.truncated||(h=t,i?.onChange?.(t))},_=()=>{let e=p.getSnapshot();if(e.currentIndex===null)return;let t=e.matches[e.currentIndex];t&&i?.onNavigate(t.rowIndex,t.colIndex)},v=()=>{l+=1,f=null,u=null,d=!1,m({matches:[],index:o,currentIndex:null,scanning:!1,truncated:!1})},y=(t,o=!1)=>{let h=i,b=p.getSnapshot();if(!h||!b.open||b.query.length===0){v(),g();return}l+=1;let x=l,{rowModel:S,columns:C,caseSensitive:w}=h,T=h.conditionalFormat!==!1,E=b.query,D=f!==null&&f.query===E&&f.caseSensitive===w;f={rowModel:S,columns:C,query:E,caseSensitive:w,conditionalFormatShown:T},(o||u===null||u.columns!==C||u.query!==E||u.caseSensitive!==w||u.conditionalFormatShown!==T)&&(u={columns:C,query:E,caseSensitive:w,conditionalFormatShown:T,byRow:new WeakMap});let O=u.byRow,k=0,A=t||d;d=A;let j=b.currentIndex===null?null:b.matches[b.currentIndex]??null,M=[],N=!1,P=S.getRowCount(),F=P>a,I=(t,n)=>{let i=[];return C.forEach((a,o)=>{if(e.isSyntheticColumnKey(a.key)||!r.isFindableColumn(a,T))return;let s=r.resolveFindCellText(a,t,!T||a.conditionalFormat?.chips===void 0?void 0:{rowIndex:n,sourceRowIndex:S.getSourceIndex(n)??n,rowKey:S.getRowKey(n)??n,colIndex:o});for(let e of r.findRangesInText(s,E,w))i.push({colIndex:o,columnKey:String(a.key),start:e.start,length:e.length})}),i.length===0?s:i};!D&&!b.scanning&&m({scanning:!0}),n.runChunked(P,e=>{if(N)return;let t=S.getRow(e);if(t===void 0)return;let n;F&&typeof t==`object`&&t?(n=O.get(t),n===void 0?(n=I(t,e),O.set(t,n)):k+=1):n=I(t,e);for(let t of n){if(M.length>=1e4){N=!0;return}M.push({rowIndex:e,colIndex:t.colIndex,columnKey:t.columnKey,start:t.start,length:t.length})}},{isCancelled:()=>l!==x}).then(e=>{if(!e||l!==x||(d=!1,o&&N===p.getSnapshot().truncated&&c(p.getSnapshot().matches,M)))return;let t=r.resolveCurrentAfterRescan(M,j);m({matches:M,index:r.buildFindIndex(M),currentIndex:t,scanning:!1,truncated:N}),g(),A&&_(),!o&&k>0&&y(!1,!0)})},b=()=>{let e=p.getSnapshot();return!i||!e.open||e.query.length===0?!1:f===null||f.rowModel!==i.rowModel||f.columns!==i.columns||f.query!==e.query||f.caseSensitive!==i.caseSensitive||f.conditionalFormatShown!==(i.conditionalFormat!==!1)};return{update:e=>{let t=i;if(i=e,!e.enabled){p.getSnapshot().open&&(m({open:!1,query:``}),v(),g());return}t!==e&&b()&&y(!1)},open:e=>{if(!i?.enabled)return;let t=p.getSnapshot(),n=e??t.query;m({open:!0,query:n}),n!==t.query||!t.open?y(!0):g()},close:()=>{p.getSnapshot().open&&(m({open:!1,query:``}),v(),g())},setQuery:e=>{let t=p.getSnapshot();!t.open||e===t.query||(m({query:e}),y(!0))},next:()=>{let e=p.getSnapshot(),t=r.stepFindIndex(e.currentIndex,e.matches.length,1);m({currentIndex:t}),g(),_()},prev:()=>{let e=p.getSnapshot(),t=r.stepFindIndex(e.currentIndex,e.matches.length,-1);m({currentIndex:t}),g(),_()},subscribe:p.subscribe,getSnapshot:p.getSnapshot,dispose:()=>{l+=1,i=null}}};exports.FIND_HIT_CACHE_ROW_THRESHOLD=a,exports.MAX_FIND_MATCHES=i,exports.createFindController=l;
|