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