@ishibashi0112/spreadsheet-grid-core 1.10.0 → 1.12.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.
Files changed (157) hide show
  1. package/dist/controllers/changeHighlightController.cjs +1 -1
  2. package/dist/controllers/changeHighlightController.js +69 -71
  3. package/dist/controllers/changeTracker.cjs +1 -1
  4. package/dist/controllers/changeTracker.js +229 -228
  5. package/dist/controllers/clipboardController.cjs +4 -2
  6. package/dist/controllers/clipboardController.d.ts +8 -0
  7. package/dist/controllers/clipboardController.js +286 -160
  8. package/dist/controllers/dateTimeEditorController.cjs +1 -0
  9. package/dist/controllers/dateTimeEditorController.d.ts +62 -0
  10. package/dist/controllers/dateTimeEditorController.js +201 -0
  11. package/dist/controllers/editController.cjs +1 -1
  12. package/dist/controllers/editController.js +206 -191
  13. package/dist/controllers/fillHandleController.cjs +1 -1
  14. package/dist/controllers/fillHandleController.js +151 -150
  15. package/dist/controllers/findController.cjs +1 -1
  16. package/dist/controllers/findController.d.ts +18 -0
  17. package/dist/controllers/findController.js +150 -92
  18. package/dist/controllers/findReplaceController.cjs +1 -0
  19. package/dist/controllers/findReplaceController.d.ts +61 -0
  20. package/dist/controllers/findReplaceController.js +324 -0
  21. package/dist/controllers/keyboardController.cjs +1 -1
  22. package/dist/controllers/keyboardController.d.ts +1 -0
  23. package/dist/controllers/keyboardController.js +150 -145
  24. package/dist/controllers/multiSelectEditorController.cjs +1 -0
  25. package/dist/controllers/multiSelectEditorController.d.ts +54 -0
  26. package/dist/controllers/multiSelectEditorController.js +200 -0
  27. package/dist/controllers/pointerInteractionsController.cjs +1 -1
  28. package/dist/controllers/pointerInteractionsController.js +155 -154
  29. package/dist/controllers/selectOptionsCollector.cjs +1 -1
  30. package/dist/controllers/selectOptionsCollector.d.ts +2 -1
  31. package/dist/controllers/selectOptionsCollector.js +53 -52
  32. package/dist/controllers/tooltipController.cjs +1 -1
  33. package/dist/controllers/tooltipController.js +6 -1
  34. package/dist/engine/cellCommands.cjs +1 -1
  35. package/dist/engine/cellCommands.js +65 -64
  36. package/dist/engine/createGridEngine.cjs +1 -1
  37. package/dist/engine/createGridEngine.d.ts +2 -0
  38. package/dist/engine/createGridEngine.js +52 -51
  39. package/dist/engine/excelShortcutCommands.cjs +1 -1
  40. package/dist/engine/excelShortcutCommands.js +148 -123
  41. package/dist/engine/exportCommands.cjs +2 -2
  42. package/dist/engine/exportCommands.js +13 -11
  43. package/dist/engine/features.cjs +1 -1
  44. package/dist/engine/features.d.ts +5 -0
  45. package/dist/engine/features.js +39 -15
  46. package/dist/engine/fullFeatures.cjs +1 -1
  47. package/dist/engine/fullFeatures.js +29 -27
  48. package/dist/engine/gridApi.cjs +2 -2
  49. package/dist/engine/gridApi.d.ts +6 -1
  50. package/dist/engine/gridApi.js +29 -3
  51. package/dist/engine/newRowController.cjs +1 -1
  52. package/dist/engine/newRowController.js +69 -68
  53. package/dist/index.cjs +1 -1
  54. package/dist/index.d.ts +1 -1
  55. package/dist/index.js +4 -4
  56. package/dist/locales/en.cjs +1 -1
  57. package/dist/locales/en.js +31 -0
  58. package/dist/logic/cellText.cjs +1 -0
  59. package/dist/logic/cellText.d.ts +3 -0
  60. package/dist/logic/cellText.js +11 -0
  61. package/dist/logic/cellValueTransfer.cjs +1 -0
  62. package/dist/logic/cellValueTransfer.d.ts +8 -0
  63. package/dist/logic/cellValueTransfer.js +11 -0
  64. package/dist/logic/changeTracking.cjs +1 -1
  65. package/dist/logic/changeTracking.js +88 -85
  66. package/dist/logic/clearCells.cjs +1 -1
  67. package/dist/logic/clearCells.js +1 -1
  68. package/dist/logic/clipboardHtml.cjs +1 -0
  69. package/dist/logic/clipboardHtml.d.ts +40 -0
  70. package/dist/logic/clipboardHtml.js +168 -0
  71. package/dist/logic/columnAutosize.cjs +1 -1
  72. package/dist/logic/columnAutosize.js +133 -115
  73. package/dist/logic/columnEditor.cjs +1 -0
  74. package/dist/logic/columnEditor.d.ts +26 -0
  75. package/dist/logic/columnEditor.js +15 -0
  76. package/dist/logic/dateTimeEditor.cjs +1 -0
  77. package/dist/logic/dateTimeEditor.d.ts +54 -0
  78. package/dist/logic/dateTimeEditor.js +100 -0
  79. package/dist/logic/dateTimeValues.cjs +1 -0
  80. package/dist/logic/dateTimeValues.d.ts +19 -0
  81. package/dist/logic/dateTimeValues.js +42 -0
  82. package/dist/logic/editorValues.cjs +1 -1
  83. package/dist/logic/editorValues.d.ts +4 -4
  84. package/dist/logic/editorValues.js +60 -49
  85. package/dist/logic/exportCsv.cjs +2 -2
  86. package/dist/logic/exportCsv.d.ts +2 -1
  87. package/dist/logic/exportCsv.js +17 -17
  88. package/dist/logic/exportData.cjs +1 -1
  89. package/dist/logic/exportData.d.ts +2 -1
  90. package/dist/logic/exportData.js +26 -26
  91. package/dist/logic/featureWarnings.cjs +1 -1
  92. package/dist/logic/featureWarnings.js +19 -10
  93. package/dist/logic/fillHandle.cjs +1 -1
  94. package/dist/logic/fillHandle.js +147 -100
  95. package/dist/logic/fillSeries.cjs +1 -1
  96. package/dist/logic/fillSeries.d.ts +2 -0
  97. package/dist/logic/fillSeries.js +104 -64
  98. package/dist/logic/filterSummary.cjs +1 -1
  99. package/dist/logic/filterSummary.js +38 -37
  100. package/dist/logic/filtering.cjs +1 -1
  101. package/dist/logic/filtering.js +160 -118
  102. package/dist/logic/find.cjs +1 -1
  103. package/dist/logic/find.d.ts +6 -2
  104. package/dist/logic/find.js +66 -26
  105. package/dist/logic/findReplace.cjs +1 -0
  106. package/dist/logic/findReplace.d.ts +35 -0
  107. package/dist/logic/findReplace.js +84 -0
  108. package/dist/logic/gridAsk.cjs +3 -3
  109. package/dist/logic/gridAsk.js +216 -211
  110. package/dist/logic/grouping.cjs +1 -1
  111. package/dist/logic/grouping.js +34 -38
  112. package/dist/logic/imeInput.cjs +1 -1
  113. package/dist/logic/imeInput.d.ts +1 -1
  114. package/dist/logic/imeInput.js +21 -20
  115. package/dist/logic/inferFilterType.cjs +1 -1
  116. package/dist/logic/inferFilterType.js +1 -1
  117. package/dist/logic/localeText.cjs +1 -1
  118. package/dist/logic/localeText.d.ts +3 -0
  119. package/dist/logic/localeText.js +3 -0
  120. package/dist/logic/localeTextFeatures.cjs +1 -1
  121. package/dist/logic/localeTextFeatures.d.ts +34 -0
  122. package/dist/logic/localeTextFeatures.js +38 -7
  123. package/dist/logic/multiSelect.cjs +1 -0
  124. package/dist/logic/multiSelect.d.ts +55 -0
  125. package/dist/logic/multiSelect.js +150 -0
  126. package/dist/logic/newRow.cjs +1 -1
  127. package/dist/logic/newRow.js +12 -11
  128. package/dist/logic/rowDragTarget.cjs +1 -1
  129. package/dist/logic/rowDragTarget.js +21 -23
  130. package/dist/logic/selectEditorState.cjs +1 -1
  131. package/dist/logic/selectEditorState.d.ts +1 -0
  132. package/dist/logic/selectEditorState.js +1 -1
  133. package/dist/logic/selectFillRow.cjs +1 -1
  134. package/dist/logic/selectFillRow.js +19 -18
  135. package/dist/logic/selectLabels.cjs +1 -1
  136. package/dist/logic/selectLabels.d.ts +4 -2
  137. package/dist/logic/selectLabels.js +36 -32
  138. package/dist/logic/selectOptions.cjs +1 -1
  139. package/dist/logic/selectOptions.d.ts +3 -2
  140. package/dist/logic/selectOptions.js +37 -16
  141. package/dist/logic/selectionAggregates.cjs +1 -1
  142. package/dist/logic/selectionAggregates.js +1 -1
  143. package/dist/logic/selectionOverlayGeometry.cjs +1 -1
  144. package/dist/logic/selectionOverlayGeometry.d.ts +14 -0
  145. package/dist/logic/selectionOverlayGeometry.js +36 -4
  146. package/dist/logic/sorting.cjs +1 -1
  147. package/dist/logic/sorting.js +108 -102
  148. package/dist/logic/validation.cjs +1 -1
  149. package/dist/logic/validation.d.ts +1 -1
  150. package/dist/logic/validation.js +28 -21
  151. package/dist/model/gridTypes.core.d.ts +211 -11
  152. package/dist/utils/clipboard.cjs +5 -4
  153. package/dist/utils/clipboard.d.ts +12 -3
  154. package/dist/utils/clipboard.js +51 -36
  155. package/dist/utils/editorVisibleBounds.cjs +1 -1
  156. package/dist/utils/editorVisibleBounds.js +1 -1
  157. package/package.json +1 -1
@@ -1,50 +1,51 @@
1
1
  import { gridActions as e } from "../model/gridActions.js";
2
2
  import { isViewCellEditable as t } from "../utils/permissions.js";
3
- import { getActiveElement as n } from "../utils/shadowDom.js";
4
- import { createValueStore as r } from "../logic/valueStore.js";
5
- import { getSelectableRowCount as i } from "../logic/newRow.js";
6
- import { computeNextScrollPosition as a, hasPointerLeftActivationRadius as o, resolveAutoScrollAxisDirection as s, resolveScrollContentBox as c, resolveTopAutoScrollStart as l } from "../logic/autoScrollGeometry.js";
7
- import { resolveElementScale as u } from "../logic/elementScale.js";
8
- import { beginEscapeCancelableDrag as d } from "./escapeClaimController.js";
9
- import { createPopoverWindowBindings as f, isInsideGridRoot as p, restoreGridFocus as m } from "./popoverSupport.js";
10
- import { applyFillEditsToRows as h, buildFillEdits as g, isSameFillRange as _, previewFillValue as ee, resolveFillColumnBounds as v, resolveFillDoubleClickTarget as te, resolveFillSource as y, resolveFillTarget as b, unionFillRange as x } from "../logic/fillHandle.js";
3
+ import { formatCellText as n } from "../logic/cellText.js";
4
+ import { getActiveElement as r } from "../utils/shadowDom.js";
5
+ import { createValueStore as i } from "../logic/valueStore.js";
6
+ import { getSelectableRowCount as a } from "../logic/newRow.js";
7
+ import { computeNextScrollPosition as o, hasPointerLeftActivationRadius as s, resolveAutoScrollAxisDirection as c, resolveScrollContentBox as l, resolveTopAutoScrollStart as u } from "../logic/autoScrollGeometry.js";
8
+ import { resolveElementScale as d } from "../logic/elementScale.js";
9
+ import { beginEscapeCancelableDrag as f } from "./escapeClaimController.js";
10
+ import { createPopoverWindowBindings as p, isInsideGridRoot as m, restoreGridFocus as h } from "./popoverSupport.js";
11
+ import { applyFillEditsToRows as g, buildFillEdits as _, isSameFillRange as v, previewFillValue as ee, resolveFillColumnBounds as y, resolveFillDoubleClickTarget as b, resolveFillSource as x, resolveFillTarget as te, unionFillRange as S } from "../logic/fillHandle.js";
11
12
  //#region src/controllers/fillHandleController.ts
12
- var S = 168, C = 84, w = 106, ne = () => typeof matchMedia == "function" && matchMedia("(pointer: coarse)").matches ? w : C, T = 8, E = { status: "idle" }, D = (e, t, n) => {
13
+ var C = 168, w = 84, T = 106, E = () => typeof matchMedia == "function" && matchMedia("(pointer: coarse)").matches ? T : w, D = 8, O = { status: "idle" }, ne = (e, t, r) => {
13
14
  if (e.valueFormatter) try {
14
15
  return e.valueFormatter({
15
- value: n,
16
+ value: r,
16
17
  row: t,
17
18
  column: e
18
19
  });
19
20
  } catch {
20
- return String(n ?? "");
21
+ return String(r ?? "");
21
22
  }
22
- return String(n ?? "");
23
- }, O = (e, t) => e === t || e.length === t.length && e.every((e, n) => e.key === t[n].key), k = 500, A = 6, j = 2, re = (e) => {
23
+ return n(e, r, t);
24
+ }, re = (e, t) => e === t || e.length === t.length && e.every((e, n) => e.key === t[n].key), k = 500, A = 6, j = 2, M = (e) => {
24
25
  let t = e.currentTarget;
25
26
  if (!(t instanceof Element)) return !0;
26
27
  let n = t.getBoundingClientRect();
27
28
  return e.clientX >= n.left - j && e.clientX <= n.right + j && e.clientY >= n.top - j && e.clientY <= n.bottom + j;
28
- }, 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 = () => {
29
- let C = null, w = r(E), j = r(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({
29
+ }, N = (e, t) => e === t || e !== void 0 && t !== void 0 && e.length === t.length && e.every((e, n) => Object.is(e, t[n])), P = (e, t) => Object.is(e, t) || e instanceof Date && t instanceof Date && e.getTime() === t.getTime(), F = (e, t) => e.length === t.length && e.every((e, n) => e.viewIndex === t[n].viewIndex && e.column.key === t[n].column.key && P(e.value, t[n].value)), I = () => {
30
+ let n = null, w = i(O), T = i(null), j = { current: null }, P = { current: null }, I = null, L = null, R = null, z = (e) => e ? "toggled" : "auto", B = (e) => (n, r, i, a) => t({
30
31
  readOnly: e.readOnly,
31
32
  canEditCell: e.canEditCell
32
33
  }, e.rowModel, n, r, i, a), V = () => {
33
- if (R === null || C === null) return;
34
+ if (R === null || n === null) return;
34
35
  let e = w.getSnapshot();
35
- if (e.status === "dragging" && e.toggled === R.toggled && (e.target === R.target || e.target !== null && R.target !== null && e.target.direction === R.target.direction && _(e.target.range, R.target.range))) return;
36
+ if (e.status === "dragging" && e.toggled === R.toggled && (e.target === R.target || e.target !== null && R.target !== null && e.target.direction === R.target.direction && v(e.target.range, R.target.range))) return;
36
37
  let t = null;
37
38
  if (R.target !== null) {
38
39
  let e = ee({
39
- rowModel: C.rowModel,
40
- columns: C.columns,
40
+ rowModel: n.rowModel,
41
+ columns: n.columns,
41
42
  source: R.source,
42
43
  target: R.target,
43
44
  request: z(R.toggled),
44
- canWriteCell: B(C),
45
- getFillValue: C.getFillValue
45
+ canWriteCell: B(n),
46
+ getFillValue: n.getFillValue
46
47
  });
47
- t = e && D(e.column, e.row, e.value) || null;
48
+ t = e && ne(e.column, e.row, e.value) || null;
48
49
  }
49
50
  w.setSnapshot({
50
51
  status: "dragging",
@@ -54,37 +55,37 @@ var S = 168, C = 84, w = 106, ne = () => typeof matchMedia == "function" && matc
54
55
  previewText: t
55
56
  });
56
57
  }, H = () => {
57
- if (R === null || C === null) return;
58
- let e = v(C.columns), t = C.hitTest(R.pointer.x, R.pointer.y);
59
- e === null || t === null || (R.target = b(R.source, t, i(C.rowModel), e), V());
58
+ if (R === null || n === null) return;
59
+ let e = y(n.columns), t = n.hitTest(R.pointer.x, R.pointer.y);
60
+ e === null || t === null || (R.target = te(R.source, t, a(n.rowModel), e), V());
60
61
  }, U = () => {
61
- if (R === null || C === null) return;
62
+ if (R === null || n === null) return;
62
63
  let e = R;
63
64
  e.rafId = requestAnimationFrame(U);
64
- let t = C.scrollContainerRef.current;
65
+ let t = n.scrollContainerRef.current;
65
66
  if (!t) return;
66
67
  if (!e.armed) {
67
- if (!o(e.origin, e.pointer, 6)) return;
68
+ if (!s(e.origin, e.pointer, 6)) return;
68
69
  e.armed = !0;
69
70
  }
70
- let n = t.getBoundingClientRect(), r = u(t, n), i = c({
71
- rectLeft: n.left,
72
- rectTop: n.top,
71
+ let r = t.getBoundingClientRect(), i = d(t, r), a = l({
72
+ rectLeft: r.left,
73
+ rectTop: r.top,
73
74
  clientLeft: t.clientLeft,
74
75
  clientTop: t.clientTop,
75
76
  clientWidth: t.clientWidth,
76
77
  clientHeight: t.clientHeight,
77
- scale: r
78
- }), d = a(t.scrollTop, s(e.pointer.y, l(i.top, (C.stickyTopHeight ?? 0) * r.y, 24), i.bottom - (C.footerHeight ?? 0), 24), 18, t.scrollHeight - t.clientHeight), f = a(t.scrollLeft, s(e.pointer.x, i.left, i.right, 24), 18, t.scrollWidth - t.clientWidth);
79
- (d !== t.scrollTop || f !== t.scrollLeft) && (t.scrollTo({
80
- top: d,
81
- left: f,
78
+ scale: i
79
+ }), f = o(t.scrollTop, c(e.pointer.y, u(a.top, (n.stickyTopHeight ?? 0) * i.y, 24), a.bottom - (n.footerHeight ?? 0), 24), 18, t.scrollHeight - t.clientHeight), p = o(t.scrollLeft, c(e.pointer.x, a.left, a.right, 24), 18, t.scrollWidth - t.clientWidth);
80
+ (f !== t.scrollTop || p !== t.scrollLeft) && (t.scrollTo({
81
+ top: f,
82
+ left: p,
82
83
  behavior: "auto"
83
84
  }), H());
84
85
  }, W = (e, t) => {
85
86
  let n = R;
86
87
  if (n !== null) {
87
- if (R = null, n.cleanup(), n.rafId !== null && cancelAnimationFrame(n.rafId), j.setSnapshot(null), w.setSnapshot(E), e && n.target !== null) {
88
+ if (R = null, n.cleanup(), n.rafId !== null && cancelAnimationFrame(n.rafId), T.setSnapshot(null), w.setSnapshot(O), e && n.target !== null) {
88
89
  L = null, q(n.source, n.target, z(n.toggled), n.activeCell);
89
90
  return;
90
91
  }
@@ -94,16 +95,16 @@ var S = 168, C = 84, w = 106, ne = () => typeof matchMedia == "function" && matc
94
95
  y: n.origin.y
95
96
  } : null;
96
97
  }
97
- }, G = (t, n) => {
98
- if (C === null) return;
99
- let { dispatch: r } = C;
100
- r(e.startSelection({
98
+ }, G = (t, r) => {
99
+ if (n === null) return;
100
+ let { dispatch: i } = n;
101
+ i(e.startSelection({
101
102
  row: t.startRow,
102
103
  col: t.startCol
103
- })), r(e.updateSelection({
104
+ })), i(e.updateSelection({
104
105
  row: t.endRow,
105
106
  col: t.endCol
106
- })), r(e.endSelection()), r(e.activateCell(n ?? {
107
+ })), i(e.endSelection()), i(e.activateCell(r ?? {
107
108
  row: t.startRow,
108
109
  col: t.startCol
109
110
  }));
@@ -111,57 +112,57 @@ var S = 168, C = 84, w = 106, ne = () => typeof matchMedia == "function" && matc
111
112
  let n = [];
112
113
  for (let r = t.startRow; r <= t.endRow; r += 1) n.push(e.getRowKey(r));
113
114
  return n;
114
- }, q = (e, t, n, r) => {
115
- if (C === null || !C.enabled) return;
116
- let i = C, a = g({
117
- rowModel: i.rowModel,
118
- columns: i.columns,
115
+ }, q = (e, t, r, i) => {
116
+ if (n === null || !n.enabled) return;
117
+ let a = n, o = _({
118
+ rowModel: a.rowModel,
119
+ columns: a.columns,
119
120
  source: e,
120
121
  target: t,
121
- request: n,
122
- canWriteCell: B(i),
123
- getFillValue: i.getFillValue
122
+ request: r,
123
+ canWriteCell: B(a),
124
+ getFillValue: a.getFillValue
124
125
  });
125
- if (a.edits.length === 0) return;
126
- let o = x(e, t), s = null, c = [], l = null;
127
- if (i.isServerSide) {
128
- if (!i.applyServerSideCellEdits) return;
129
- l = K(i.rowModel, o), i.applyServerSideCellEdits(a.edits);
126
+ if (o.edits.length === 0) return;
127
+ let s = S(e, t), c = null, l = [], u = null;
128
+ if (a.isServerSide) {
129
+ if (!a.applyServerSideCellEdits) return;
130
+ u = K(a.rowModel, s), a.applyServerSideCellEdits(o.edits);
130
131
  } else {
131
- if (!i.applyRowsChange) return;
132
- let e = h(i.rows, i.rowModel, a.edits);
133
- if (e === i.rows) return;
134
- s = i.rows, c.push(e), i.applyRowsChange(e);
132
+ if (!a.applyRowsChange) return;
133
+ let e = g(a.rows, a.rowModel, o.edits);
134
+ if (e === a.rows) return;
135
+ c = a.rows, l.push(e), a.applyRowsChange(e);
135
136
  }
136
137
  I = {
137
138
  source: e,
138
139
  target: t,
139
- range: o,
140
+ range: s,
140
141
  previousSource: e,
141
142
  selectionConfirmed: !1,
142
- columns: i.columns,
143
- viewKey: i.viewKey,
144
- request: n,
145
- edits: a.edits,
146
- baseRows: s,
147
- baseRowModel: i.isServerSide ? null : i.rowModel,
148
- emittedRows: c,
149
- rowKeys: l
150
- }, G(o, r), w.setSnapshot({
143
+ columns: a.columns,
144
+ viewKey: a.viewKey,
145
+ request: r,
146
+ edits: o.edits,
147
+ baseRows: c,
148
+ baseRowModel: a.isServerSide ? null : a.rowModel,
149
+ emittedRows: l,
150
+ rowKeys: u
151
+ }, G(s, i), w.setSnapshot({
151
152
  status: "filled",
152
- range: o,
153
- kind: a.kind,
154
- seriesAvailable: a.seriesAvailable,
153
+ range: s,
154
+ kind: o.kind,
155
+ seriesAvailable: o.seriesAvailable,
155
156
  menu: null
156
157
  });
157
- }, J = f({
158
+ }, J = p({
158
159
  onScroll: (e) => {
159
- e.target instanceof Node && N.current?.contains(e.target) || X(!1);
160
+ e.target instanceof Node && j.current?.contains(e.target) || X(!1);
160
161
  },
161
162
  onResize: () => X(!1),
162
- isInside: (e) => N.current?.contains(e) === !0 || F.current?.contains(e) === !0,
163
- onOutsidePointerDown: (e) => X(C !== null && p(C.gridRootRef, e)),
164
- getGridRoot: () => C?.gridRootRef.current ?? null,
163
+ isInside: (e) => j.current?.contains(e) === !0 || P.current?.contains(e) === !0,
164
+ onOutsidePointerDown: (e) => X(n !== null && m(n.gridRootRef, e)),
165
+ getGridRoot: () => n?.gridRootRef.current ?? null,
165
166
  onGridHidden: () => X(!1),
166
167
  onKeyDown: (e) => {
167
168
  e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), X(!0));
@@ -173,10 +174,10 @@ var S = 168, C = 84, w = 106, ne = () => typeof matchMedia == "function" && matc
173
174
  menu: e
174
175
  });
175
176
  }, X = (e) => {
176
- J.detach(), Y(null), e && C !== null && m(C.gridRootRef);
177
+ J.detach(), Y(null), e && n !== null && h(n.gridRootRef);
177
178
  }, Z = () => {
178
- let e = typeof document < "u" && N.current?.contains(n(N.current)) === !0;
179
- I = null, J.detach(), w.getSnapshot().status === "filled" && w.setSnapshot(E), e && C !== null && m(C.gridRootRef);
179
+ let e = typeof document < "u" && j.current?.contains(r(j.current)) === !0;
180
+ I = null, J.detach(), w.getSnapshot().status === "filled" && w.setSnapshot(O), e && n !== null && h(n.gridRootRef);
180
181
  }, ie = (e) => {
181
182
  let t = w.getSnapshot();
182
183
  if (t.status !== "filled") return;
@@ -184,10 +185,10 @@ var S = 168, C = 84, w = 106, ne = () => typeof matchMedia == "function" && matc
184
185
  X(!0);
185
186
  return;
186
187
  }
187
- let n = Math.min(e.left, window.innerWidth - S - T);
188
- n = Math.max(T, n);
189
- let r = e.bottom + 4, i = ne();
190
- r + i > window.innerHeight - T && (r = Math.max(T, e.top - 4 - i)), Y({
188
+ let n = Math.min(e.left, window.innerWidth - C - D);
189
+ n = Math.max(D, n);
190
+ let r = e.bottom + 4, i = E();
191
+ r + i > window.innerHeight - D && (r = Math.max(D, e.top - 4 - i)), Y({
191
192
  top: r,
192
193
  left: n
193
194
  }), J.attach();
@@ -197,59 +198,59 @@ var S = 168, C = 84, w = 106, ne = () => typeof matchMedia == "function" && matc
197
198
  for (let r = 0; r < n.length; r += 1) if (e.getRowKey(t.range.startRow + r) !== n[r]) return !1;
198
199
  return !0;
199
200
  }, oe = (e) => {
200
- let n = w.getSnapshot(), r = I;
201
- if (X(!0), C === null || r === null || n.status !== "filled" || r.request === e) return;
202
- let i = C;
203
- if (i.isServerSide) {
204
- if (!i.applyServerSideCellEdits || !ae(i.rowModel, r)) {
201
+ let r = w.getSnapshot(), i = I;
202
+ if (X(!0), n === null || i === null || r.status !== "filled" || i.request === e) return;
203
+ let a = n;
204
+ if (a.isServerSide) {
205
+ if (!a.applyServerSideCellEdits || !ae(a.rowModel, i)) {
205
206
  Z();
206
207
  return;
207
208
  }
208
- let t = g({
209
- rowModel: i.rowModel,
210
- columns: r.columns,
211
- source: r.source,
212
- target: r.target,
209
+ let t = _({
210
+ rowModel: a.rowModel,
211
+ columns: i.columns,
212
+ source: i.source,
213
+ target: i.target,
213
214
  request: e,
214
- canWriteCell: B(i),
215
- getFillValue: i.getFillValue
215
+ canWriteCell: B(a),
216
+ getFillValue: a.getFillValue
216
217
  });
217
- r.request = e, t.edits.length > 0 && !P(t.edits, r.edits) && i.applyServerSideCellEdits(t.edits), r.edits = t.edits, w.setSnapshot({
218
- ...n,
218
+ i.request = e, t.edits.length > 0 && !F(t.edits, i.edits) && a.applyServerSideCellEdits(t.edits), i.edits = t.edits, w.setSnapshot({
219
+ ...r,
219
220
  kind: t.kind,
220
221
  menu: null
221
222
  });
222
223
  return;
223
224
  }
224
- if (!i.amendRowsChange || r.baseRows === null || r.baseRowModel === null) {
225
+ if (!a.amendRowsChange || i.baseRows === null || i.baseRowModel === null) {
225
226
  Z();
226
227
  return;
227
228
  }
228
- let a = r.baseRowModel, o = g({
229
- rowModel: a,
230
- columns: r.columns,
231
- source: r.source,
232
- target: r.target,
229
+ let o = i.baseRowModel, s = _({
230
+ rowModel: o,
231
+ columns: i.columns,
232
+ source: i.source,
233
+ target: i.target,
233
234
  request: e,
234
- canWriteCell: (e, n, r, o) => t({
235
- readOnly: i.readOnly,
236
- canEditCell: i.canEditCell
237
- }, a, e, n, r, o),
238
- getFillValue: i.getFillValue
235
+ canWriteCell: (e, n, r, i) => t({
236
+ readOnly: a.readOnly,
237
+ canEditCell: a.canEditCell
238
+ }, o, e, n, r, i),
239
+ getFillValue: a.getFillValue
239
240
  });
240
- if (r.request = e, !P(o.edits, r.edits)) {
241
- let e = h(r.baseRows, a, o.edits);
242
- r.emittedRows.push(e), r.edits = o.edits, i.amendRowsChange(e);
241
+ if (i.request = e, !F(s.edits, i.edits)) {
242
+ let e = g(i.baseRows, o, s.edits);
243
+ i.emittedRows.push(e), i.edits = s.edits, a.amendRowsChange(e);
243
244
  }
244
245
  w.setSnapshot({
245
- ...n,
246
- kind: o.kind,
246
+ ...r,
247
+ kind: s.kind,
247
248
  menu: null
248
249
  });
249
250
  }, Q = (e, t) => {
250
251
  if (e?.type !== "cell") return !1;
251
252
  let { start: n, end: r } = e.range;
252
- return _(t, {
253
+ return v(t, {
253
254
  startRow: Math.min(n.row, r.row),
254
255
  endRow: Math.max(n.row, r.row),
255
256
  startCol: Math.min(n.col, r.col),
@@ -258,7 +259,7 @@ var S = 168, C = 84, w = 106, ne = () => typeof matchMedia == "function" && matc
258
259
  }, se = (e) => {
259
260
  let t = I;
260
261
  if (t !== null) {
261
- if (!e.enabled || e.editing || !O(e.columns, t.columns) || !M(e.viewKey, t.viewKey)) {
262
+ if (!e.enabled || e.editing || !re(e.columns, t.columns) || !N(e.viewKey, t.viewKey)) {
262
263
  Z();
263
264
  return;
264
265
  }
@@ -273,27 +274,27 @@ var S = 168, C = 84, w = 106, ne = () => typeof matchMedia == "function" && matc
273
274
  !t.selectionConfirmed && Q(e.selection, t.previousSource) || Z();
274
275
  }
275
276
  }, ce = (e) => {
276
- if (C === null || e.button !== 0 || (e.preventDefault(), R !== null || !C.enabled || C.editing)) return;
277
- let t = y(C.selection, C.activeCell, i(C.rowModel), C.columns.length);
277
+ if (n === null || e.button !== 0 || (e.preventDefault(), R !== null || !n.enabled || n.editing)) return;
278
+ let t = x(n.selection, n.activeCell, a(n.rowModel), n.columns.length);
278
279
  if (t === null) return;
279
- let n = L;
280
+ let r = L;
280
281
  L = null;
281
- let r = re(e);
282
- if (n !== null && r && e.timeStamp - n.time <= k && Math.abs(e.clientX - n.x) <= A && Math.abs(e.clientY - n.y) <= A) {
283
- C.gridRootRef.current?.focus({ preventScroll: !0 }), $();
282
+ let i = M(e);
283
+ if (r !== null && i && e.timeStamp - r.time <= k && Math.abs(e.clientX - r.x) <= A && Math.abs(e.clientY - r.y) <= A) {
284
+ n.gridRootRef.current?.focus({ preventScroll: !0 }), $();
284
285
  return;
285
286
  }
286
- Z(), C.gridRootRef.current?.focus({ preventScroll: !0 });
287
- let a = e.pointerId, o = (e) => {
288
- R === null || e.pointerId !== a || (R.pointer = {
287
+ Z(), n.gridRootRef.current?.focus({ preventScroll: !0 });
288
+ let o = e.pointerId, s = (e) => {
289
+ R === null || e.pointerId !== o || (R.pointer = {
289
290
  x: e.clientX,
290
291
  y: e.clientY
291
- }, R.toggled = e.ctrlKey || e.metaKey, j.setSnapshot(R.pointer), H());
292
- }, s = (e) => {
293
- R === null || e.pointerId !== a || (R.toggled = e.ctrlKey || e.metaKey, W(!0, e.timeStamp));
292
+ }, R.toggled = e.ctrlKey || e.metaKey, T.setSnapshot(R.pointer), H());
294
293
  }, c = (e) => {
295
- e.pointerId === a && W(!1);
294
+ R === null || e.pointerId !== o || (R.toggled = e.ctrlKey || e.metaKey, W(!0, e.timeStamp));
296
295
  }, l = (e) => {
296
+ e.pointerId === o && W(!1);
297
+ }, u = (e) => {
297
298
  if (R === null) return;
298
299
  if (e.preventDefault(), e.stopPropagation(), e.type === "keydown" && e.key === "Escape") {
299
300
  W(!1);
@@ -301,53 +302,53 @@ var S = 168, C = 84, w = 106, ne = () => typeof matchMedia == "function" && matc
301
302
  }
302
303
  let t = e.ctrlKey || e.metaKey;
303
304
  t !== R.toggled && (R.toggled = t, V());
304
- }, u = () => W(!1);
305
- window.addEventListener("pointermove", o), window.addEventListener("pointerup", s), window.addEventListener("pointercancel", c), window.addEventListener("keydown", l, !0), window.addEventListener("keyup", l, !0), window.addEventListener("blur", u);
306
- let f = d(), p = {
305
+ }, d = () => W(!1);
306
+ window.addEventListener("pointermove", s), window.addEventListener("pointerup", c), window.addEventListener("pointercancel", l), window.addEventListener("keydown", u, !0), window.addEventListener("keyup", u, !0), window.addEventListener("blur", d);
307
+ let p = f(), m = {
307
308
  x: e.clientX,
308
309
  y: e.clientY
309
310
  };
310
311
  R = {
311
- pointerId: a,
312
+ pointerId: o,
312
313
  source: t,
313
- activeCell: C.activeCell,
314
- origin: p,
315
- onSquare: r,
316
- pointer: p,
314
+ activeCell: n.activeCell,
315
+ origin: m,
316
+ onSquare: i,
317
+ pointer: m,
317
318
  toggled: e.ctrlKey || e.metaKey,
318
319
  target: null,
319
320
  armed: !1,
320
321
  rafId: null,
321
322
  cleanup: () => {
322
- window.removeEventListener("pointermove", o), window.removeEventListener("pointerup", s), window.removeEventListener("pointercancel", c), window.removeEventListener("keydown", l, !0), window.removeEventListener("keyup", l, !0), window.removeEventListener("blur", u), f();
323
+ window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", c), window.removeEventListener("pointercancel", l), window.removeEventListener("keydown", u, !0), window.removeEventListener("keyup", u, !0), window.removeEventListener("blur", d), p();
323
324
  }
324
- }, j.setSnapshot(p), V(), R.rafId = requestAnimationFrame(U);
325
+ }, T.setSnapshot(m), V(), R.rafId = requestAnimationFrame(U);
325
326
  }, $ = () => {
326
- if (C === null || R !== null || !C.enabled || C.editing) return;
327
- let e = y(C.selection, C.activeCell, i(C.rowModel), C.columns.length);
327
+ if (n === null || R !== null || !n.enabled || n.editing) return;
328
+ let e = x(n.selection, n.activeCell, a(n.rowModel), n.columns.length);
328
329
  if (e === null) return;
329
- let t = te(e, C.rowModel, C.columns);
330
- t !== null && (Z(), q(e, t, "auto", C.activeCell));
330
+ let t = b(e, n.rowModel, n.columns);
331
+ t !== null && (Z(), q(e, t, "auto", n.activeCell));
331
332
  };
332
333
  return {
333
334
  update: (e) => {
334
- C = e, R !== null && (!e.enabled || e.editing) && W(!1), se(e);
335
+ n = e, R !== null && (!e.enabled || e.editing) && W(!1), se(e);
335
336
  },
336
337
  subscribe: w.subscribe,
337
338
  getSnapshot: w.getSnapshot,
338
- subscribePointer: j.subscribe,
339
- getPointerSnapshot: j.getSnapshot,
339
+ subscribePointer: T.subscribe,
340
+ getPointerSnapshot: T.getSnapshot,
340
341
  handlePointerDown: ce,
341
342
  handleDoubleClick: $,
342
343
  toggleMenu: ie,
343
344
  closeMenu: () => X(!0),
344
345
  chooseKind: oe,
345
- menuPanel: N,
346
- chipElement: F,
346
+ menuPanel: j,
347
+ chipElement: P,
347
348
  dispose: () => {
348
349
  W(!1), J.detach(), I = null;
349
350
  }
350
351
  };
351
352
  };
352
353
  //#endregion
353
- export { F as createFillHandleController };
354
+ export { I as createFillHandleController };
@@ -1 +1 @@
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,p=null,m=t.createValueStore({open:!1,query:``,matches:[],index:o,currentIndex:null,scanning:!1,truncated:!1}),h=e=>{m.setSnapshot({...m.getSnapshot(),...e})},g=null,_=()=>{let e=m.getSnapshot(),t={query:e.query,matchCount:e.matches.length,currentIndex:e.currentIndex,open:e.open,truncated:e.truncated};g!==null&&g.query===t.query&&g.matchCount===t.matchCount&&g.currentIndex===t.currentIndex&&g.open===t.open&&g.truncated===t.truncated||(g=t,i?.onChange?.(t))},v=e=>{let t=m.getSnapshot();if(t.currentIndex===null)return;let n=t.matches[t.currentIndex];n&&i?.onNavigate(n.rowIndex,n.colIndex,e)},y=()=>{l+=1,p=null,u=null,d=!1,h({matches:[],index:o,currentIndex:null,scanning:!1,truncated:!1})},b=(t,o=!1)=>{let g=i,x=m.getSnapshot();if(!g||!x.open||x.query.length===0){y(),_();return}l+=1;let S=l,{rowModel:C,columns:w,caseSensitive:T}=g,E=g.conditionalFormat!==!1,D=x.query,O=p!==null&&p.query===D&&p.caseSensitive===T;p={rowModel:C,columns:w,query:D,caseSensitive:T,conditionalFormatShown:E},(o||u===null||u.columns!==w||u.query!==D||u.caseSensitive!==T||u.conditionalFormatShown!==E)&&(u={columns:w,query:D,caseSensitive:T,conditionalFormatShown:E,byRow:new WeakMap});let k=u.byRow,A=0,j=t||d;d=j;let M=x.currentIndex===null?null:x.matches[x.currentIndex]??null,N=[],P=!1,F=C.getRowCount(),I=F>a,L=(t,n)=>{let i=[];return w.forEach((a,o)=>{if(e.isSyntheticColumnKey(a.key)||!r.isFindableColumn(a,E))return;let s=r.resolveFindCellText(a,t,!E||a.conditionalFormat?.chips===void 0?void 0:{rowIndex:n,sourceRowIndex:C.getSourceIndex(n)??n,rowKey:C.getRowKey(n)??n,colIndex:o});for(let e of r.findRangesInText(s,D,T))i.push({colIndex:o,columnKey:String(a.key),start:e.start,length:e.length})}),i.length===0?s:i};!O&&!x.scanning&&h({scanning:!0}),n.runChunked(F,e=>{if(P)return;let t=C.getRow(e);if(t===void 0)return;let n=C.getTreeRow?.(e)?.aggregates,r;I&&typeof t==`object`&&t?(r=k.get(t),r===void 0?(r=L(t,e),k.set(t,r)):A+=1):r=L(t,e);for(let t of r)if(!(n!==void 0&&t.columnKey in n)){if(N.length>=1e4){P=!0;return}N.push({rowIndex:e,colIndex:t.colIndex,columnKey:t.columnKey,start:t.start,length:t.length})}},{isCancelled:()=>l!==S}).then(e=>{if(!e||l!==S||(d=!1,o&&P===m.getSnapshot().truncated&&c(m.getSnapshot().matches,N)))return;let t=r.resolveCurrentAfterRescan(N,M);h({matches:N,index:r.buildFindIndex(N,i?.toViewRow),currentIndex:t,scanning:!1,truncated:P}),f=i?.toViewRow,_(),j&&v(`query`),!o&&A>0&&b(!1,!0)})},x=()=>{let e=m.getSnapshot();return!i||!e.open||e.query.length===0?!1:p===null||p.rowModel!==i.rowModel||p.columns!==i.columns||p.query!==e.query||p.caseSensitive!==i.caseSensitive||p.conditionalFormatShown!==(i.conditionalFormat!==!1)};return{update:e=>{let t=i;if(i=e,!e.enabled){m.getSnapshot().open&&(h({open:!1,query:``}),y(),_());return}if(t!==e&&x()){b(!1);return}let n=m.getSnapshot();e.toViewRow!==f&&!n.scanning&&(f=e.toViewRow,n.matches.length>0&&h({index:r.buildFindIndex(n.matches,e.toViewRow)}))},open:e=>{if(!i?.enabled)return;let t=m.getSnapshot(),n=e??t.query;h({open:!0,query:n}),n!==t.query||!t.open?b(!0):_()},close:()=>{m.getSnapshot().open&&(h({open:!1,query:``}),y(),_())},setQuery:e=>{let t=m.getSnapshot();!t.open||e===t.query||(h({query:e}),b(!0))},next:()=>{let e=m.getSnapshot(),t=r.stepFindIndex(e.currentIndex,e.matches.length,1);h({currentIndex:t}),_(),v(`step`)},prev:()=>{let e=m.getSnapshot(),t=r.stepFindIndex(e.currentIndex,e.matches.length,-1);h({currentIndex:t}),_(),v(`step`)},subscribe:m.subscribe,getSnapshot:m.getSnapshot,dispose:()=>{l+=1,i=null}}};exports.FIND_HIT_CACHE_ROW_THRESHOLD=a,exports.MAX_FIND_MATCHES=i,exports.createFindController=l;
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=(e,t,n)=>t>=e.startRow&&t<=e.endRow&&n>=e.startCol&&n<=e.endCol&&(e.rows===void 0||e.rows.has(t)),a=e=>{if(e.rows===void 0)return[{startRow:e.startRow,endRow:e.endRow}];let t=[...e.rows].sort((e,t)=>e-t),n=[];for(let e of t){let t=n[n.length-1];t&&e===t.endRow+1?t.endRow=e:n.push({startRow:e,endRow:e})}return n},o=(e,t,n)=>{if(e.length===0)return null;let r=e.findIndex(e=>e.rowIndex>t||e.rowIndex===t&&e.colIndex>n);return r<0?0:r},s=(e,t,n)=>{if(e.length===0)return null;if(n.rowKey===void 0)return o(e,n.rowIndex,n.colIndex);let r=e.findIndex(e=>e.columnKey===n.columnKey&&t.getRowKey(e.rowIndex)===n.rowKey);if(r>=0)return r;let i=e.findIndex(e=>e.rowIndex>n.rowIndex||e.rowIndex===n.rowIndex&&e.colIndex>=n.colIndex);return i<0?0:i},c=1e4,l=5e4,u=new Map,d=[],f=(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}),p=()=>{let a=null,c=0,p=null,m=!1,h=!1,g=null,_,v=null,y=t.createValueStore({open:!1,query:``,matches:[],index:u,currentIndex:null,scanning:!1,truncated:!1,focusRequest:0}),b=e=>{y.setSnapshot({...y.getSnapshot(),...e})},x=null,S=()=>{let e=y.getSnapshot(),t={query:e.query,matchCount:e.matches.length,currentIndex:e.currentIndex,open:e.open,truncated:e.truncated};x!==null&&x.query===t.query&&x.matchCount===t.matchCount&&x.currentIndex===t.currentIndex&&x.open===t.open&&x.truncated===t.truncated||(x=t,a?.onChange?.(t))},C=e=>{let t=y.getSnapshot();if(t.currentIndex===null)return;let n=t.matches[t.currentIndex];n&&a?.onNavigate(n.rowIndex,n.colIndex,e)},w=()=>{c+=1,v=null,p=null,m=!1,h=!1,g=null,b({matches:[],index:u,currentIndex:null,scanning:!1,truncated:!1})},T=(t,o=!1)=>{let u=a,x=y.getSnapshot();if(!u||!x.open||x.query.length===0){w(),S();return}c+=1;let E=c,{rowModel:D,columns:O,caseSensitive:k}=u,A=u.conditionalFormat!==!1,j=u.multiSelectSeparator,M=u.scope??null,N=u.toViewRow,P=x.query,F=v!==null&&v.query===P&&v.caseSensitive===k;v={rowModel:D,columns:O,query:P,caseSensitive:k,conditionalFormatShown:A,separator:j,scope:M},(o||p===null||p.columns!==O||p.query!==P||p.caseSensitive!==k||p.conditionalFormatShown!==A||p.separator!==j)&&(p={columns:O,query:P,caseSensitive:k,conditionalFormatShown:A,separator:j,byRow:new WeakMap});let I=p.byRow,L=0,R=t||m;m=R;let z=x.currentIndex===null?null:x.matches[x.currentIndex]??null,B=[],V=!1,H=D.getRowCount(),U=H>l,W=(t,n)=>{let i=[];return O.forEach((a,o)=>{if(e.isSyntheticColumnKey(a.key)||!r.isFindableColumn(a,A,t))return;let s=r.resolveFindCellText(a,t,!A||a.conditionalFormat?.chips===void 0?void 0:{rowIndex:n,sourceRowIndex:D.getSourceIndex(n)??n,rowKey:D.getRowKey(n)??n,colIndex:o},j);for(let e of r.findRangesInCell(a,t,s,P,k,j))i.push({colIndex:o,columnKey:String(a.key),start:e.start,length:e.length})}),i.length===0?d:i};!F&&!x.scanning&&b({scanning:!0}),n.runChunked(H,e=>{if(V)return;let t=D.getRow(e);if(t===void 0)return;let n=D.getTreeRow?.(e)?.aggregates,r;U&&typeof t==`object`&&t?(r=I.get(t),r===void 0?(r=W(t,e),I.set(t,r)):L+=1):r=W(t,e);let a=M===null?e:N?N(e):e;for(let t of r)if(!(n!==void 0&&t.columnKey in n)&&!(M!==null&&!i(M,a,t.colIndex))){if(B.length>=1e4){V=!0;return}B.push({rowIndex:e,colIndex:t.colIndex,columnKey:t.columnKey,start:t.start,length:t.length})}},{isCancelled:()=>c!==E}).then(e=>{if(!e||c!==E)return;m=!1;let t=h;if(h=!1,o&&V===y.getSnapshot().truncated&&f(y.getSnapshot().matches,B))return;let n=g;g=null;let i=n===null?r.resolveCurrentAfterRescan(B,z):s(B,D,n);b({matches:B,index:r.buildFindIndex(B,a?.toViewRow),currentIndex:i,scanning:!1,truncated:V}),_=a?.toViewRow,S(),R?C(`query`):(n!==null||t)&&C(`step`),!o&&L>0&&T(!1,!0)})},E=()=>{let e=y.getSnapshot();return!a||!e.open||e.query.length===0?!1:v===null||v.rowModel!==a.rowModel||v.columns!==a.columns||v.query!==e.query||v.caseSensitive!==a.caseSensitive||v.conditionalFormatShown!==(a.conditionalFormat!==!1)||v.separator!==a.multiSelectSeparator||v.scope!==(a.scope??null)};return{update:e=>{let t=a;if(a=e,!e.enabled){y.getSnapshot().open&&(b({open:!1,query:``}),w(),S());return}if(t!==e&&E()){T(!1);return}let n=y.getSnapshot();e.toViewRow!==_&&!n.scanning&&(_=e.toViewRow,n.matches.length>0&&b({index:r.buildFindIndex(n.matches,e.toViewRow)}))},open:e=>{if(!a?.enabled)return;let t=y.getSnapshot(),n=e??t.query;b({open:!0,query:n,focusRequest:t.focusRequest+1}),n!==t.query||!t.open?T(!0):S()},close:()=>{y.getSnapshot().open&&(b({open:!1,query:``}),w(),S())},setQuery:e=>{let t=y.getSnapshot();!t.open||e===t.query||(g=null,b({query:e}),T(!0))},next:()=>{let e=y.getSnapshot(),t=r.stepFindIndex(e.currentIndex,e.matches.length,1);b({currentIndex:t}),S(),C(`step`)},prev:()=>{let e=y.getSnapshot(),t=r.stepFindIndex(e.currentIndex,e.matches.length,-1);b({currentIndex:t}),S(),C(`step`)},continueAfter:(e,t,n)=>{if(n){let n=y.getSnapshot(),r=o(n.matches,e,t),i=r===null?void 0:n.matches[r];g=i===void 0||!a?{rowIndex:e,colIndex:t,rowKey:void 0,columnKey:``}:{rowIndex:i.rowIndex,colIndex:i.colIndex,rowKey:a.rowModel.getRowKey(i.rowIndex),columnKey:i.columnKey};return}let r=y.getSnapshot();b({currentIndex:o(r.matches,e,t)}),S(),C(`step`)},navigateAfterRescan:()=>{h=!0},subscribe:y.subscribe,getSnapshot:y.getSnapshot,dispose:()=>{c+=1,a=null}}};exports.FIND_HIT_CACHE_ROW_THRESHOLD=l,exports.MAX_FIND_MATCHES=c,exports.createFindController=p,exports.findScopeRowRuns=a,exports.firstFindMatchAfter=o,exports.isInFindScope=i;
@@ -17,7 +17,21 @@ export type FindArgs<T> = {
17
17
  onChange?: (params: FindChangeParams) => void;
18
18
  conditionalFormat?: boolean | undefined;
19
19
  toViewRow?: ((rowIndex: number) => number) | undefined;
20
+ multiSelectSeparator?: string | undefined;
21
+ scope?: FindScope | null | undefined;
20
22
  };
23
+ export type FindScope = {
24
+ startRow: number;
25
+ endRow: number;
26
+ startCol: number;
27
+ endCol: number;
28
+ rows?: ReadonlySet<number> | undefined;
29
+ };
30
+ export declare const isInFindScope: (scope: FindScope, viewRow: number, colIndex: number) => boolean;
31
+ export declare const findScopeRowRuns: (scope: FindScope) => Array<{
32
+ startRow: number;
33
+ endRow: number;
34
+ }>;
21
35
  export type FindSnapshot = {
22
36
  open: boolean;
23
37
  query: string;
@@ -26,6 +40,7 @@ export type FindSnapshot = {
26
40
  currentIndex: number | null;
27
41
  scanning: boolean;
28
42
  truncated: boolean;
43
+ focusRequest: number;
29
44
  };
30
45
  export type FindController<T> = {
31
46
  update: (args: FindArgs<T>) => void;
@@ -34,10 +49,13 @@ export type FindController<T> = {
34
49
  setQuery: (query: string) => void;
35
50
  next: () => void;
36
51
  prev: () => void;
52
+ continueAfter: (rowIndex: number, colIndex: number, afterRescan: boolean) => void;
53
+ navigateAfterRescan: () => void;
37
54
  subscribe: (listener: () => void) => () => void;
38
55
  getSnapshot: () => FindSnapshot;
39
56
  dispose: () => void;
40
57
  };
58
+ export declare const firstFindMatchAfter: (matches: readonly FindMatch[], rowIndex: number, colIndex: number) => number | null;
41
59
  export declare const MAX_FIND_MATCHES = 10000;
42
60
  export declare const FIND_HIT_CACHE_ROW_THRESHOLD = 50000;
43
61
  export declare const createFindController: <T>() => FindController<T>;