@ishibashi0112/spreadsheet-grid-core 1.5.1 → 1.6.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 (57) hide show
  1. package/dist/controllers/columnHeaderDragController.cjs +1 -1
  2. package/dist/controllers/columnHeaderDragController.d.ts +11 -0
  3. package/dist/controllers/columnHeaderDragController.js +259 -210
  4. package/dist/controllers/pointerInteractionsController.cjs +1 -1
  5. package/dist/controllers/pointerInteractionsController.d.ts +1 -0
  6. package/dist/controllers/pointerInteractionsController.js +85 -38
  7. package/dist/engine/columnCommands.cjs +1 -1
  8. package/dist/engine/columnCommands.d.ts +4 -0
  9. package/dist/engine/columnCommands.js +47 -16
  10. package/dist/engine/columnLayout.cjs +1 -1
  11. package/dist/engine/columnLayout.d.ts +7 -1
  12. package/dist/engine/columnLayout.js +25 -22
  13. package/dist/engine/createGridEngine.cjs +1 -1
  14. package/dist/engine/createGridEngine.d.ts +2 -1
  15. package/dist/engine/createGridEngine.js +46 -36
  16. package/dist/engine/exportCommands.cjs +2 -2
  17. package/dist/engine/exportCommands.js +50 -38
  18. package/dist/engine/gridApi.cjs +2 -1
  19. package/dist/engine/gridApi.d.ts +2 -0
  20. package/dist/engine/gridApi.js +17 -7
  21. package/dist/engine/notifiers.cjs +1 -1
  22. package/dist/engine/notifiers.d.ts +13 -1
  23. package/dist/engine/notifiers.js +39 -19
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.js +4 -4
  27. package/dist/locales/en.cjs +1 -1
  28. package/dist/locales/en.js +5 -0
  29. package/dist/logic/columnGroupCells.cjs +1 -0
  30. package/dist/logic/columnGroupCells.d.ts +54 -0
  31. package/dist/logic/columnGroupCells.js +53 -0
  32. package/dist/logic/columnGroups.cjs +1 -0
  33. package/dist/logic/columnGroups.d.ts +46 -0
  34. package/dist/logic/columnGroups.js +335 -0
  35. package/dist/logic/domGuards.cjs +1 -1
  36. package/dist/logic/domGuards.d.ts +1 -1
  37. package/dist/logic/domGuards.js +5 -5
  38. package/dist/logic/exportCsv.cjs +2 -2
  39. package/dist/logic/exportCsv.d.ts +2 -1
  40. package/dist/logic/exportCsv.js +16 -13
  41. package/dist/logic/gridState.cjs +1 -1
  42. package/dist/logic/gridState.d.ts +8 -1
  43. package/dist/logic/gridState.js +14 -8
  44. package/dist/logic/localeTextFeatures.cjs +1 -1
  45. package/dist/logic/localeTextFeatures.d.ts +5 -0
  46. package/dist/logic/localeTextFeatures.js +10 -6
  47. package/dist/logic/localeTextPopups.cjs +1 -1
  48. package/dist/logic/localeTextPopups.d.ts +2 -0
  49. package/dist/logic/localeTextPopups.js +2 -0
  50. package/dist/model/gridActions.cjs +1 -1
  51. package/dist/model/gridActions.d.ts +10 -0
  52. package/dist/model/gridActions.js +9 -0
  53. package/dist/model/gridReducer.cjs +1 -1
  54. package/dist/model/gridReducer.js +29 -2
  55. package/dist/model/gridTypes.core.d.ts +149 -0
  56. package/dist/model/gridTypes.unbound.d.ts +2 -0
  57. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
- import { buildGridState as e, cloneFilterState as t, cloneSortState as n, decideStateChangeEmit as r, extractColumnState as i, isSameFilterState as a, isSameSortState as o } from "../logic/gridState.js";
2
- import { isSameGridCellRef as s, resolveGridCellRef as c } from "../logic/cellRef.js";
1
+ import { buildGridState as e, cloneFilterState as t, cloneSortState as n, decideStateChangeEmit as r, extractColumnState as i, isSameFilterState as a, isSameSortState as o, resolveClosedColumnGroupsForState as s } from "../logic/gridState.js";
2
+ import { isSameGridCellRef as c, resolveGridCellRef as l } from "../logic/cellRef.js";
3
3
  //#region src/engine/notifiers.ts
4
- var l = () => {
4
+ var u = () => {
5
5
  let e = null, t = null;
6
6
  return {
7
7
  update: (t) => {
@@ -13,7 +13,7 @@ var l = () => {
13
13
  i !== r && (t = i, e.isHoverControlled || e.setHoveredRowIndex(i), e.onHoveredRowChange?.(i, { source: "pointer" }));
14
14
  }
15
15
  };
16
- }, u = () => {
16
+ }, d = () => {
17
17
  let e = null;
18
18
  return { update: ({ expandedKeys: t, onChange: n }) => {
19
19
  if (e === null) {
@@ -22,15 +22,35 @@ var l = () => {
22
22
  }
23
23
  Object.is(e, t) || (e = t, n?.(Array.from(t)));
24
24
  } };
25
- }, d = () => {
26
- let s = null, c = null, l = (e, t) => Object.is(e.columnWidths, t.columnWidths) && Object.is(e.filters, t.filters) && Object.is(e.sort, t.sort) && Object.is(e.dragState, t.dragState) && Object.is(e.columns, t.columns) && Object.is(e.collapsedGroupKeys, t.collapsedGroupKeys) && e.includeGroupingInState === t.includeGroupingInState;
27
- return { update: (u) => {
28
- let d = s, f = d === null || !l(d, u);
29
- if (s = u, !f || (d !== null && (u.onFiltersChange && !Object.is(d.filters, u.filters) && !a(d.filters, u.filters) && u.onFiltersChange(t(u.filters)), u.onSortChange && !Object.is(d.sort, u.sort) && !o(d.sort, u.sort) && u.onSortChange(n(u.sort))), !u.onStateChange)) return;
30
- let p = u.includeGroupingInState === !0, m = e(u.columnWidths, u.filters, u.sort, i(u.columns, p), void 0, p ? u.collapsedGroupKeys ?? [] : void 0), h = r(c, m, u.dragState !== null);
31
- c = h.nextLast, h.emit && u.onStateChange(m);
32
- } };
33
25
  }, f = () => {
26
+ let c = null, l = null, u = (e, t) => Object.is(e.columnWidths, t.columnWidths) && Object.is(e.filters, t.filters) && Object.is(e.sort, t.sort) && Object.is(e.dragState, t.dragState) && Object.is(e.columns, t.columns) && Object.is(e.collapsedGroupKeys, t.collapsedGroupKeys) && e.includeGroupingInState === t.includeGroupingInState && Object.is(e.closedColumnGroupKeys, t.closedColumnGroupKeys) && Object.is(e.columnGroupTree, t.columnGroupTree);
27
+ return { update: (d) => {
28
+ let f = c, p = f === null || !u(f, d);
29
+ if (c = d, !p || (f !== null && (d.onFiltersChange && !Object.is(f.filters, d.filters) && !a(f.filters, d.filters) && d.onFiltersChange(t(d.filters)), d.onSortChange && !Object.is(f.sort, d.sort) && !o(f.sort, d.sort) && d.onSortChange(n(d.sort))), !d.onStateChange)) return;
30
+ let m = d.includeGroupingInState === !0, h = e(d.columnWidths, d.filters, d.sort, i(d.columns, m), void 0, m ? d.collapsedGroupKeys ?? [] : void 0, s(d.columnGroupTree, d.closedColumnGroupKeys)), g = r(l, h, d.dragState !== null);
31
+ l = g.nextLast, g.emit && d.onStateChange(h);
32
+ } };
33
+ }, p = () => {
34
+ let e = null, t = !1;
35
+ return { update: (n) => {
36
+ let r = n.closedColumnGroupKeys;
37
+ if (t && Object.is(r, e)) return;
38
+ let i = e, a = !t;
39
+ t = !0, e = r;
40
+ let o = n.columnGroupTree;
41
+ if (a || !n.onColumnGroupOpenChange || !o) return;
42
+ let c = s(o, r) ?? [];
43
+ o.groups.forEach((e) => {
44
+ if (!e.collapsible) return;
45
+ let t = !(i?.has(e.key) ?? !1), a = !(r?.has(e.key) ?? !1);
46
+ t !== a && n.onColumnGroupOpenChange?.({
47
+ groupKey: e.key,
48
+ open: a,
49
+ closedGroups: [...c]
50
+ });
51
+ });
52
+ } };
53
+ }, m = () => {
34
54
  let e = null;
35
55
  return {
36
56
  update: (t) => {
@@ -39,7 +59,7 @@ var l = () => {
39
59
  handleCellClick: (t, n) => {
40
60
  let r = e?.onCellClick;
41
61
  if (e === null || !r) return;
42
- let i = c(e.rowModel, e.orderedColumns, t);
62
+ let i = l(e.rowModel, e.orderedColumns, t);
43
63
  i !== null && r({
44
64
  ...i,
45
65
  event: n
@@ -48,7 +68,7 @@ var l = () => {
48
68
  notifyCellDoubleClick: (t, n) => {
49
69
  let r = e?.onCellDoubleClick;
50
70
  if (e === null || !r) return !1;
51
- let i = c(e.rowModel, e.orderedColumns, t);
71
+ let i = l(e.rowModel, e.orderedColumns, t);
52
72
  if (i === null) return !1;
53
73
  let a = !1;
54
74
  return r({
@@ -60,13 +80,13 @@ var l = () => {
60
80
  }), a;
61
81
  }
62
82
  };
63
- }, p = (e, t) => {
83
+ }, h = (e, t) => {
64
84
  let { activeCell: n, editingCell: r, rowModel: i, orderedColumns: a } = e;
65
85
  if (t === null || n === null || r == null || n.row !== r.row || n.col !== r.col || !a.some((e) => e.key === t.columnKey) || n.row < i.getRowCount() && Object.is(i.getRowKey(n.row), t.rowKey)) return !1;
66
86
  let o = i.getRowCount();
67
87
  for (let e = 0; e < o; e += 1) if (i.getRow(e) !== void 0 && Object.is(i.getRowKey(e), t.rowKey)) return !0;
68
88
  return !1;
69
- }, m = (e, t) => e === null || t === null ? e === t : Object.is(e.rowKey, t.rowKey) && e.columnKey === t.columnKey, h = () => {
89
+ }, g = (e, t) => e === null || t === null ? e === t : Object.is(e.rowKey, t.rowKey) && e.columnKey === t.columnKey, _ = () => {
70
90
  let e = null, t = null;
71
91
  return { update: (n) => {
72
92
  let r = e;
@@ -74,10 +94,10 @@ var l = () => {
74
94
  activeCell: n.activeCell,
75
95
  rowModel: n.rowModel,
76
96
  orderedColumns: n.orderedColumns
77
- }, r !== null && Object.is(r.activeCell, n.activeCell) && (p(n, t) || n.isRowFollowPending?.() === !0))) return;
78
- let i = n.activeCell === null ? null : c(n.rowModel, n.orderedColumns, n.activeCell), a = r !== null && !(n.followsRow === !0 ? m(t, i) : s(t, i));
97
+ }, r !== null && Object.is(r.activeCell, n.activeCell) && (h(n, t) || n.isRowFollowPending?.() === !0))) return;
98
+ let i = n.activeCell === null ? null : l(n.rowModel, n.orderedColumns, n.activeCell), a = r !== null && !(n.followsRow === !0 ? g(t, i) : c(t, i));
79
99
  t = i, a && n.onActiveCellChange?.(i);
80
100
  } };
81
101
  };
82
102
  //#endregion
83
- export { h as createActiveCellNotifier, f as createCellEventNotifier, u as createDetailKeysNotifier, l as createHoverRowNotifier, d as createStateChangeNotifier };
103
+ export { _ as createActiveCellNotifier, m as createCellEventNotifier, p as createColumnGroupOpenNotifier, d as createDetailKeysNotifier, u as createHoverRowNotifier, f as createStateChangeNotifier };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./model/gridActions.cjs"),t=require("./logic/localeTextFilters.cjs"),n=require("./logic/localeText.cjs"),r=require("./logic/gridState.cjs"),i=require("./model/gridStore.cjs"),a=require("./engine/createGridEngine.cjs"),o=require("./engine/fullFeatures.cjs"),s=require("./logic/valueFormatters.cjs"),c=require("./logic/valueParsers.cjs"),l=require("./logic/gridAskLocaleText.cjs"),u=require("./logic/gridAsk.cjs"),d=require("./logic/localeTextFeatures.cjs"),f=require("./logic/localeTextPopups.cjs"),p=require("./locales/en.cjs");exports.DEFAULT_AGGREGATES_LOCALE_TEXT=d.DEFAULT_AGGREGATES_LOCALE_TEXT,exports.DEFAULT_COLUMN_MENU_LOCALE_TEXT=d.DEFAULT_COLUMN_MENU_LOCALE_TEXT,exports.DEFAULT_CONTEXT_MENU_LOCALE_TEXT=d.DEFAULT_CONTEXT_MENU_LOCALE_TEXT,exports.DEFAULT_FILL_HANDLE_LOCALE_TEXT=d.DEFAULT_FILL_HANDLE_LOCALE_TEXT,exports.DEFAULT_FILTERING_LOCALE_TEXT=d.DEFAULT_FILTERING_LOCALE_TEXT,exports.DEFAULT_FIND_LOCALE_TEXT=d.DEFAULT_FIND_LOCALE_TEXT,exports.DEFAULT_GRID_ASK_LOCALE_TEXT=l.DEFAULT_GRID_ASK_LOCALE_TEXT,exports.DEFAULT_GRID_LOCALE_TEXT=n.DEFAULT_GRID_LOCALE_TEXT,exports.DEFAULT_GROUPING_LOCALE_TEXT=d.DEFAULT_GROUPING_LOCALE_TEXT,exports.DEFAULT_PINNED_ROWS_LOCALE_TEXT=d.DEFAULT_PINNED_ROWS_LOCALE_TEXT,exports.DEFAULT_POPUP_LOCALE_TEXT=f.DEFAULT_POPUP_LOCALE_TEXT,exports.DEFAULT_ROW_DRAG_LOCALE_TEXT=d.DEFAULT_ROW_DRAG_LOCALE_TEXT,exports.DEFAULT_SCROLL_HINT_LOCALE_TEXT=d.DEFAULT_SCROLL_HINT_LOCALE_TEXT,exports.DEFAULT_SERVER_SIDE_LOCALE_TEXT=d.DEFAULT_SERVER_SIDE_LOCALE_TEXT,exports.createGridAskRequest=u.createGridAskRequest,exports.createGridEngine=a.createGridEngine,exports.createGridStore=i.createGridStore,exports.describeGridAskView=u.describeGridAskView,exports.formatLocaleText=t.formatLocaleText,exports.fullCoreFeatures=o.fullCoreFeatures,exports.gridActions=e.gridActions,exports.gridAskLocaleTextEn=p.gridAskLocaleTextEn,exports.gridAskSystemPrompt=u.gridAskSystemPrompt,exports.isGridAskColumnsChanged=u.isGridAskColumnsChanged,exports.isSameGridAskView=u.isSameGridAskView,exports.localeTextEn=p.localeTextEn,exports.numberFormatter=s.numberFormatter,exports.numberParser=c.numberParser,exports.readGridAskAnswer=u.readGridAskAnswer,exports.removeGridAskItem=u.removeGridAskItem,exports.restoreColumnsFromState=r.restoreColumnsFromState;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./model/gridActions.cjs"),t=require("./logic/localeTextFilters.cjs"),n=require("./logic/localeText.cjs"),r=require("./logic/gridState.cjs"),i=require("./model/gridStore.cjs"),a=require("./engine/createGridEngine.cjs"),o=require("./engine/fullFeatures.cjs"),s=require("./logic/valueFormatters.cjs"),c=require("./logic/valueParsers.cjs"),l=require("./logic/gridAskLocaleText.cjs"),u=require("./logic/gridAsk.cjs"),d=require("./logic/localeTextFeatures.cjs"),f=require("./logic/localeTextPopups.cjs"),p=require("./locales/en.cjs");exports.DEFAULT_AGGREGATES_LOCALE_TEXT=d.DEFAULT_AGGREGATES_LOCALE_TEXT,exports.DEFAULT_COLUMN_GROUPS_LOCALE_TEXT=d.DEFAULT_COLUMN_GROUPS_LOCALE_TEXT,exports.DEFAULT_COLUMN_MENU_LOCALE_TEXT=d.DEFAULT_COLUMN_MENU_LOCALE_TEXT,exports.DEFAULT_CONTEXT_MENU_LOCALE_TEXT=d.DEFAULT_CONTEXT_MENU_LOCALE_TEXT,exports.DEFAULT_FILL_HANDLE_LOCALE_TEXT=d.DEFAULT_FILL_HANDLE_LOCALE_TEXT,exports.DEFAULT_FILTERING_LOCALE_TEXT=d.DEFAULT_FILTERING_LOCALE_TEXT,exports.DEFAULT_FIND_LOCALE_TEXT=d.DEFAULT_FIND_LOCALE_TEXT,exports.DEFAULT_GRID_ASK_LOCALE_TEXT=l.DEFAULT_GRID_ASK_LOCALE_TEXT,exports.DEFAULT_GRID_LOCALE_TEXT=n.DEFAULT_GRID_LOCALE_TEXT,exports.DEFAULT_GROUPING_LOCALE_TEXT=d.DEFAULT_GROUPING_LOCALE_TEXT,exports.DEFAULT_PINNED_ROWS_LOCALE_TEXT=d.DEFAULT_PINNED_ROWS_LOCALE_TEXT,exports.DEFAULT_POPUP_LOCALE_TEXT=f.DEFAULT_POPUP_LOCALE_TEXT,exports.DEFAULT_ROW_DRAG_LOCALE_TEXT=d.DEFAULT_ROW_DRAG_LOCALE_TEXT,exports.DEFAULT_SCROLL_HINT_LOCALE_TEXT=d.DEFAULT_SCROLL_HINT_LOCALE_TEXT,exports.DEFAULT_SERVER_SIDE_LOCALE_TEXT=d.DEFAULT_SERVER_SIDE_LOCALE_TEXT,exports.createGridAskRequest=u.createGridAskRequest,exports.createGridEngine=a.createGridEngine,exports.createGridStore=i.createGridStore,exports.describeGridAskView=u.describeGridAskView,exports.formatLocaleText=t.formatLocaleText,exports.fullCoreFeatures=o.fullCoreFeatures,exports.gridActions=e.gridActions,exports.gridAskLocaleTextEn=p.gridAskLocaleTextEn,exports.gridAskSystemPrompt=u.gridAskSystemPrompt,exports.isGridAskColumnsChanged=u.isGridAskColumnsChanged,exports.isSameGridAskView=u.isSameGridAskView,exports.localeTextEn=p.localeTextEn,exports.numberFormatter=s.numberFormatter,exports.numberParser=c.numberParser,exports.readGridAskAnswer=u.readGridAskAnswer,exports.removeGridAskItem=u.removeGridAskItem,exports.restoreColumnsFromState=r.restoreColumnsFromState;
package/dist/index.d.ts CHANGED
@@ -15,7 +15,7 @@ export { createGridAskRequest, describeGridAskView, gridAskSystemPrompt, isGridA
15
15
  export type { GridAskAnswer, GridAskFilter, GridAskItem, GridAskOp, GridAskOptions, GridAskRequest, GridAskResult, GridAskSort, } from './logic/gridAsk.js';
16
16
  export { DEFAULT_GRID_LOCALE_TEXT, formatLocaleText } from './logic/localeText.js';
17
17
  export { DEFAULT_POPUP_LOCALE_TEXT } from './logic/localeTextPopups.js';
18
- export { DEFAULT_AGGREGATES_LOCALE_TEXT, DEFAULT_COLUMN_MENU_LOCALE_TEXT, DEFAULT_CONTEXT_MENU_LOCALE_TEXT, DEFAULT_FILL_HANDLE_LOCALE_TEXT, DEFAULT_FILTERING_LOCALE_TEXT, DEFAULT_FIND_LOCALE_TEXT, DEFAULT_GROUPING_LOCALE_TEXT, DEFAULT_PINNED_ROWS_LOCALE_TEXT, DEFAULT_ROW_DRAG_LOCALE_TEXT, DEFAULT_SCROLL_HINT_LOCALE_TEXT, DEFAULT_SERVER_SIDE_LOCALE_TEXT, } from './logic/localeTextFeatures.js';
18
+ export { DEFAULT_AGGREGATES_LOCALE_TEXT, DEFAULT_COLUMN_GROUPS_LOCALE_TEXT, DEFAULT_COLUMN_MENU_LOCALE_TEXT, DEFAULT_CONTEXT_MENU_LOCALE_TEXT, DEFAULT_FILL_HANDLE_LOCALE_TEXT, DEFAULT_FILTERING_LOCALE_TEXT, DEFAULT_FIND_LOCALE_TEXT, DEFAULT_GROUPING_LOCALE_TEXT, DEFAULT_PINNED_ROWS_LOCALE_TEXT, DEFAULT_ROW_DRAG_LOCALE_TEXT, DEFAULT_SCROLL_HINT_LOCALE_TEXT, DEFAULT_SERVER_SIDE_LOCALE_TEXT, } from './logic/localeTextFeatures.js';
19
19
  export { DEFAULT_GRID_ASK_LOCALE_TEXT } from './logic/gridAskLocaleText.js';
20
20
  export type { GridAskLocaleText } from './logic/gridAskLocaleText.js';
21
21
  export { gridAskLocaleTextEn, localeTextEn } from './locales/en.js';
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import { numberFormatter as s } from "./logic/valueFormatters.js";
9
9
  import { numberParser as c } from "./logic/valueParsers.js";
10
10
  import { DEFAULT_GRID_ASK_LOCALE_TEXT as l } from "./logic/gridAskLocaleText.js";
11
11
  import { createGridAskRequest as u, describeGridAskView as d, gridAskSystemPrompt as f, isGridAskColumnsChanged as p, isSameGridAskView as m, readGridAskAnswer as h, removeGridAskItem as g } from "./logic/gridAsk.js";
12
- import { DEFAULT_AGGREGATES_LOCALE_TEXT as _, DEFAULT_COLUMN_MENU_LOCALE_TEXT as v, DEFAULT_CONTEXT_MENU_LOCALE_TEXT as y, DEFAULT_FILL_HANDLE_LOCALE_TEXT as b, DEFAULT_FILTERING_LOCALE_TEXT as x, DEFAULT_FIND_LOCALE_TEXT as S, DEFAULT_GROUPING_LOCALE_TEXT as C, DEFAULT_PINNED_ROWS_LOCALE_TEXT as w, DEFAULT_ROW_DRAG_LOCALE_TEXT as T, DEFAULT_SCROLL_HINT_LOCALE_TEXT as E, DEFAULT_SERVER_SIDE_LOCALE_TEXT as D } from "./logic/localeTextFeatures.js";
13
- import { DEFAULT_POPUP_LOCALE_TEXT as O } from "./logic/localeTextPopups.js";
14
- import { gridAskLocaleTextEn as k, localeTextEn as A } from "./locales/en.js";
15
- export { _ as DEFAULT_AGGREGATES_LOCALE_TEXT, v as DEFAULT_COLUMN_MENU_LOCALE_TEXT, y as DEFAULT_CONTEXT_MENU_LOCALE_TEXT, b as DEFAULT_FILL_HANDLE_LOCALE_TEXT, x as DEFAULT_FILTERING_LOCALE_TEXT, S as DEFAULT_FIND_LOCALE_TEXT, l as DEFAULT_GRID_ASK_LOCALE_TEXT, n as DEFAULT_GRID_LOCALE_TEXT, C as DEFAULT_GROUPING_LOCALE_TEXT, w as DEFAULT_PINNED_ROWS_LOCALE_TEXT, O as DEFAULT_POPUP_LOCALE_TEXT, T as DEFAULT_ROW_DRAG_LOCALE_TEXT, E as DEFAULT_SCROLL_HINT_LOCALE_TEXT, D as DEFAULT_SERVER_SIDE_LOCALE_TEXT, u as createGridAskRequest, a as createGridEngine, i as createGridStore, d as describeGridAskView, t as formatLocaleText, o as fullCoreFeatures, e as gridActions, k as gridAskLocaleTextEn, f as gridAskSystemPrompt, p as isGridAskColumnsChanged, m as isSameGridAskView, A as localeTextEn, s as numberFormatter, c as numberParser, h as readGridAskAnswer, g as removeGridAskItem, r as restoreColumnsFromState };
12
+ import { DEFAULT_AGGREGATES_LOCALE_TEXT as _, DEFAULT_COLUMN_GROUPS_LOCALE_TEXT as v, DEFAULT_COLUMN_MENU_LOCALE_TEXT as y, DEFAULT_CONTEXT_MENU_LOCALE_TEXT as b, DEFAULT_FILL_HANDLE_LOCALE_TEXT as x, DEFAULT_FILTERING_LOCALE_TEXT as S, DEFAULT_FIND_LOCALE_TEXT as C, DEFAULT_GROUPING_LOCALE_TEXT as w, DEFAULT_PINNED_ROWS_LOCALE_TEXT as T, DEFAULT_ROW_DRAG_LOCALE_TEXT as E, DEFAULT_SCROLL_HINT_LOCALE_TEXT as D, DEFAULT_SERVER_SIDE_LOCALE_TEXT as O } from "./logic/localeTextFeatures.js";
13
+ import { DEFAULT_POPUP_LOCALE_TEXT as k } from "./logic/localeTextPopups.js";
14
+ import { gridAskLocaleTextEn as A, localeTextEn as j } from "./locales/en.js";
15
+ export { _ as DEFAULT_AGGREGATES_LOCALE_TEXT, v as DEFAULT_COLUMN_GROUPS_LOCALE_TEXT, y as DEFAULT_COLUMN_MENU_LOCALE_TEXT, b as DEFAULT_CONTEXT_MENU_LOCALE_TEXT, x as DEFAULT_FILL_HANDLE_LOCALE_TEXT, S as DEFAULT_FILTERING_LOCALE_TEXT, C as DEFAULT_FIND_LOCALE_TEXT, l as DEFAULT_GRID_ASK_LOCALE_TEXT, n as DEFAULT_GRID_LOCALE_TEXT, w as DEFAULT_GROUPING_LOCALE_TEXT, T as DEFAULT_PINNED_ROWS_LOCALE_TEXT, k as DEFAULT_POPUP_LOCALE_TEXT, E as DEFAULT_ROW_DRAG_LOCALE_TEXT, D as DEFAULT_SCROLL_HINT_LOCALE_TEXT, O as DEFAULT_SERVER_SIDE_LOCALE_TEXT, u as createGridAskRequest, a as createGridEngine, i as createGridStore, d as describeGridAskView, t as formatLocaleText, o as fullCoreFeatures, e as gridActions, A as gridAskLocaleTextEn, f as gridAskSystemPrompt, p as isGridAskColumnsChanged, m as isSameGridAskView, j as localeTextEn, s as numberFormatter, c as numberParser, h as readGridAskAnswer, g as removeGridAskItem, r as restoreColumnsFromState };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],t={blank:`(Blank)`,filterNone:`No filter`,filterCustom:`Custom filter`,filterExcluded:({count:e})=>e===1?`Excluding 1 value`:`Excluding ${e} values`,filterExcludedValues:`Excluding {values}`,filterSelected:`{count} selected`,filterMatches:`Is "{value}"`,filterBoth:`{condition} and {set}`,conditionGreaterThanOrEqual:`≥ {value}`,conditionGreaterThan:`> {value}`,conditionLessThanOrEqual:`≤ {value}`,conditionLessThan:`< {value}`,conditionEquals:`= {value}`,conditionNotEquals:`≠ {value}`,conditionRange:`{min} – {max}`,conditionOnOrAfter:`On or after {value}`,conditionOnOrBefore:`On or before {value}`,conditionContains:`Contains "{value}"`,conditionStartsWith:`Starts with "{value}"`,conditionEndsWith:`Ends with "{value}"`,conditionBlank:`(Blank)`,conditionNotBlank:`(Not blank)`,datePresetToday:`Today`,datePresetThisMonth:`This month`,datePresetLast30Days:`Last 30 days`},n={rowCount:`Rows {shown} of {total}`,columnCount:`Columns {shown} of {total}`,filterSummary:`Filter: {value}`,filterGlobal:`"{text}"`,filterColumns:({count:e})=>e===1?`1 column`:`${e} columns`,sortSummary:`Sort: {value}`,sortEntry:`{column} ({direction})`,sortAscending:`ascending`,sortDescending:`descending`,activeCell:`Cell {cell}`,selection:`Range {range}`,selectionSize:({cells:e,rows:t})=>`${e} ${e===1?`cell`:`cells`} / ${t} ${t===1?`row`:`rows`}`,selectedColumns:({count:e})=>e===1?`1 column`:`${e} columns`,detailColumnName:`Details`,rowDragColumnName:`Move`,aggregateAverage:`Average`,aggregateCount:`Count`,aggregateSum:`Sum`,aggregateComputing:`Calculating… {percent}%`,aggregatePartial:`Loaded rows only`,none:`—`,listSeparator:`, `,globalFilterPlaceholder:`Filter all columns`,globalFilterLabel:`Search the whole table`,clearGlobalFilter:`Clear filter`,toggleFilterPanel:`Show or hide the filter panel`,clear:`Clear`,clearAll:`Clear all`,close:`Close`,apply:`Apply`,retry:`Retry`,noOptions:`No options`,noRows:`No rows to show`,noMatchingRows:`No matching rows`,selectAllRows:`Select all rows`,selectRow:`Select row {row}`,sortedAscending:`Sorted ascending`,sortedDescending:`Sorted descending`,sortPriority:` (priority {priority})`,columnFiltered:`Filtered`,dragColumn:`Drag to move the column`,columnMenu:`Column menu`,columnMenuFor:`Column menu for {column}`,showDetails:`Show details for row {row}`,hideDetails:`Hide details for row {row}`,expandGroup:`Expand {group}`,collapseGroup:`Collapse {group}`,groupRowCount:({count:e})=>e===`1`?`(1 row)`:`(${e} rows)`,editCell:`Edit {column}`,cellInput:`Cell input`,sizingColumns:`Sizing columns…`,applyingFilter:`Filtering {percent}%`,dragRow:`Drag to move the row`,dragRowDisabled:`Rows can't be moved while the table is sorted or filtered`,dragRowLabel:`Row {row}`,pinnedTopRow:`Pinned to top {row}`,pinnedBottomRow:`Pinned to bottom {row}`,contextMenuCell:`Cell menu`,contextMenuRow:`Row menu`,scrollHintRow:`Row {row}`,scrollHintJump:`Go to row {row}`,scrollHintJumpSeparator:`·`,scrollHintTenThousands:`{full}`,menuFilter:`Filter…`,menuSortAscending:`Sort ascending`,menuSortDescending:`Sort descending`,menuManageSort:`Manage sorting…`,menuManageFilters:`Manage filters…`,menuGroupBy:`Group by this column`,menuUngroup:`Ungroup`,menuPin:`Pin column`,menuPinNone:`No pin`,menuPinLeft:`Pin left`,menuPinRight:`Pin right`,menuPinUnavailable:`Pinning can't be changed in this grid.`,menuAutosize:`Autosize this column`,menuAutosizeAll:`Autosize all columns`,menuColumns:`Choose columns`,menuResetColumns:`Reset columns`,resetColumnsHint:`Restores the width, pinning, visibility, order and grouping of all columns.`,menuResetUnavailable:`Columns can't be reset in this grid.`,toolPanelFilters:`Filters`,toolPanelSort:`Sort`,toolPanelColumns:`Columns`,toolPanelLabel:`Tool panel`,columnsPinnedLeft:`Pinned left`,columnsUnpinned:`Not pinned`,columnsPinnedRight:`Pinned right`,columnsHideAll:`Hide all columns (the first one stays)`,columnsShowAll:`Show all columns`,columnsDragToReorder:`Drag to reorder`,columnsDragWithinSection:`Drag to reorder (within the same section)`,columnsReorderUnavailable:`Columns can't be reordered in this grid.`,columnsReorderWhileSearching:`Columns can't be reordered while searching.`,columnsGroupedHint:`This column is grouped. Its values appear in the group column.`,groupedColumnTitle:`{column} (grouped)`,columnsSearchPlaceholder:`Search…`,columnsNoMatches:`No matching columns`,columnsReset:`Reset all columns`,columnsUnavailable:`Showing, hiding and resetting columns isn't available in this grid.`,globalFilterTitle:`Global filter`,globalFilterRows:`Rows containing "{text}"`,clearGlobalFilterTitle:`Clear the global filter`,noColumnFilters:`No column filters`,addFilterLabel:`Choose a column to filter`,addFilter:`+ Add filter…`,addFilterNone:`+ No columns to add`,sortPanelEmpty:`No sorting`,sortPanelDrag:`Drag to change the priority`,sortPanelDisabled:`Sorting is turned off`,sortPanelNeedsTwo:`Add a second level to reorder`,sortPanelAscending:`Ascending`,sortPanelAscendingShort:`Asc`,sortPanelDescending:`Descending`,sortPanelDescendingShort:`Desc`,sortPanelRemove:`Remove this level`,sortPanelAllUsed:`All columns are already used`,sortPanelAddHint:`Add a sort level`,sortPanelAdd:`+ Add level`,sortPanelClearHint:`Remove all sorting`,sortPanelReadOnly:`Sorting is turned off, so it can't be changed`,filterHiddenColumn:` (hidden)`,filterGroupedColumn:` (grouped)`,filterJumpUnavailable:`This column is hidden, so its filter can't be opened here. You can still clear it with ×.`,filterEditUnderGroup:`Opens under the group column header`,filterJump:`Go to this column to edit`,filterEditFor:`Edit the filter on {column}`,filterClear:`Clear this column's filter`,filterClearFor:`Clear the filter on {column}`,filterCurrentNone:`(none)`,filterCurrentExcluded:({count:e})=>e===1?`Excluding 1 value`:`Excluding ${e} values`,filterCurrentSelected:`{count} selected`,operatorEquals:`Equals`,operatorNotEquals:`Does not equal`,operatorGreaterThanOrEqual:`Greater than or equal to`,operatorGreaterThan:`Greater than`,operatorLessThanOrEqual:`Less than or equal to`,operatorLessThan:`Less than`,operatorBetween:`Between`,operatorContains:`Contains`,operatorStartsWith:`Starts with`,operatorEndsWith:`Ends with`,operatorOnOrAfter:`On or after`,operatorOnOrBefore:`On or before`,operatorBlank:`Blank`,operatorNotBlank:`Not blank`,filterTitle:`Filter: {column}`,filterCollecting:`Collecting values… {percent}%`,filterOptionsLoading:`Loading values…`,filterOptionsLoadingShort:`Loading…`,filterOptionsFailed:`Couldn't load the values`,filterOptionsFailedShort:`Failed`,filterOptionsTruncated:`(first values only)`,filterSearchPlaceholder:`Search (Enter to apply)`,filterSelectAll:`(Select all)`,filterSelectAllResults:`(Select all results)`,filterNoOptionsSource:`No values. With serverSide, give the column filterOptions or another source of values.`,filterNoMatches:`No matching values`,filterSelectedCount:`Selected {selected} of {total}`,filterShownCount:` ({count} shown)`,filterMatchCount:({count:e})=>e===1?`1 match`:`${e} matches`,filterTotalCount:`{count} total`,filterOptionCount:`Values: {count}`,filterAll:`(All)`,filterConditionSection:`Condition`,filterValuesSection:`Values`,filterOperator:`Operator`,filterValue:`Value`,filterValuePlaceholder:`Value`,filterMin:`Min`,filterMax:`Max`,filterRangeSeparator:`–`,filterNoValue:`This operator doesn't take a value`,filterDate:`Date`,filterStartDate:`Start date`,filterEndDate:`End date`,filterTextPlaceholder:`Contains…`,filterTextHint:`Matches text anywhere in the value`,filterCurrentValue:`Current: {value}`,treeExpand:`Expand`,treeCollapse:`Collapse`,dateTreeYear:`{year}`,dateTreeMonth:({month:t})=>e[t-1]??String(t),dateTreeDay:`{day}`,calendarWeekdays:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],calendarMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],calendarTitle:({year:t,month:n})=>`${e[n-1]??n} ${t}`,calendarYear:`{year}`,calendarOpen:`Open calendar`,calendarClose:`Close calendar`,calendarPrevious:`Previous`,calendarNext:`Next`,calendarChangeView:`Change view`,calendarBack:`← Back`,calendarToday:`Today`,findLabel:`Find in cells`,findPlaceholder:`Find`,findInput:`Search text`,findSearching:`Searching…`,findNoResults:`No results`,findPrevious:`Previous match`,findPreviousHint:`Previous (Shift+Enter)`,findNext:`Next match`,findNextHint:`Next (Enter)`,findClose:`Close find`,findCloseHint:`Close (Esc)`,fillOptions:`Auto Fill Options`,fillOptionsCurrent:`Auto Fill Options ({kind})`,fillSeries:`Fill Series`,fillCopy:`Copy Cells`,invalidValue:`Invalid value`,enterNumber:`Enter a number`,enterInteger:`Enter a whole number`,enterMin:`Enter {min} or more`,enterMax:`Enter {max} or less`,enterRange:`Enter a number from {min} to {max}`,enterDate:`Enter a date (e.g. 2026-03-15)`,saveFailedCell:`Couldn't save. The value was restored.`,loadFailed:({count:e})=>`Couldn't load rows (${e} ${e===1?`block`:`blocks`})`,dismissLoadError:`Dismiss the error`,saveFailed:({count:e})=>`Couldn't save changes (${e} ${e===1?`row`:`rows`}). The values were restored.`,dismissSaveError:`Dismiss the save error`,totalRowLabel:`Total`,totalAverage:`Avg`,totalMin:`Min`,totalMax:`Max`,totalCount:`Count`,exportSubtotal:`{label} subtotal`},r={placeholder:`Filter or sort in plain words (e.g. this month, largest amount first)`,label:`Filter in plain words`,submit:`Ask`,stop:`Stop`,examples:`Try:`,thinking:`Thinking…`,escHint:`Press Esc to stop`,retry:`Try again`,appliedTitle:`Applied`,undo:`Undo`,close:`Close`,removeItem:`Remove {label} {text}`,allRemoved:`All conditions have been removed.`,unchanged:`Nothing to change.`,undone:`Undone.`,droppedTitle:`Couldn't use`,fromAi:`From the AI: {text}`,askFailed:`Couldn't reach the AI. Try again.`,noGrid:`The grid wasn't found. Try again once it's on the page.`,changedNotice:`The grid's conditions have changed, so they can't be changed from here. Use the grid's filters and sorting.`,itemSort:`Sort`,itemSortEntry:`{column} {direction}`,ascending:`ascending`,descending:`descending`,itemSearch:`Search`,itemHidden:`Hidden`,quote:`"{text}"`,quoteSeparator:`, `,emptyText:`(empty)`,unnamed:`(no name)`,andMore:`{items} and {count} more`,moreReasons:`{count} more`,columnReason:`{column}: {reason}`,readError:`Couldn't read the AI's answer. Try wording it differently.`,shapeError:`The AI's answer wasn't an instruction for the grid. Try wording it differently.`,filtersLocked:`Column filters are locked`,noSuchColumn:`There is no column {column}`,notFilterable:`This column can't be filtered`,noOperator:`The condition has no type`,operatorUnavailable:`{operator} can't be used on this column`,oneCondition:`Only one condition per column`,oneSelection:`Only one value choice per column`,unreadableFilters:`Unreadable conditions ({count}) can't be used`,noNumberRange:`The range needs two numbers`,notNumber:`{value} is not a number`,noText:`No text to look for`,textTooLong:`Text to look for can be up to {limit} characters`,unknownPeriod:`{value} is not an available period`,noDateRange:`The range needs two dates`,notDate:`{value} is not a date`,noValues:`No values to choose`,noSelectableValues:`None of the values can be chosen`,tooManyValues:`Up to {limit} values can be chosen ({count} not used)`,notInOptions:`Not in the list: {values}`,notAnOption:`{value} is not in the list`,cannotFilterBy:`Can't filter by {value}`,valueTooLong:`Values over {limit} characters can't be used`,valuesTooLong:`Values over {limit} characters ({count}) can't be used`,unreadableValues:`Unreadable values ({count}) can't be used`,sortLocked:`Sorting is locked`,sortNoSuchColumn:`Sort: there is no column {column}`,sortBadDirection:`Sort: {direction} can't be used for {column}`,sortUnreadable:`Couldn't read the sort order`,searchUnreadable:`Couldn't read the search text`,searchLocked:`The search text is locked`,searchTooLong:`The search text can be up to {limit} characters`,columnsLocked:`Column visibility is locked`,unreadableColumns:`Unreadable column changes ({count}) can't be used`,cannotHideAll:`All columns can't be hidden`,operatorLabels:{"=":`equals`,"!=":`does not equal`,">":`greater than`,">=":`at least`,"<":`less than`,"<=":`at most`,between:`between`,contains:`contains`,equals:`equals`,startsWith:`starts with`,endsWith:`ends with`,onOrAfter:`on or after`,onOrBefore:`on or before`,notEquals:`does not equal`,preset:`today, this month, …`,blank:`blank`,notBlank:`not blank`,in:`one of`,notIn:`none of`,clear:`clear`}},i=e=>({...t,...e}),a=i(n),o=i(r);exports.gridAskLocaleTextEn=o,exports.localeTextEn=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],t={blank:`(Blank)`,filterNone:`No filter`,filterCustom:`Custom filter`,filterExcluded:({count:e})=>e===1?`Excluding 1 value`:`Excluding ${e} values`,filterExcludedValues:`Excluding {values}`,filterSelected:`{count} selected`,filterMatches:`Is "{value}"`,filterBoth:`{condition} and {set}`,conditionGreaterThanOrEqual:`≥ {value}`,conditionGreaterThan:`> {value}`,conditionLessThanOrEqual:`≤ {value}`,conditionLessThan:`< {value}`,conditionEquals:`= {value}`,conditionNotEquals:`≠ {value}`,conditionRange:`{min} – {max}`,conditionOnOrAfter:`On or after {value}`,conditionOnOrBefore:`On or before {value}`,conditionContains:`Contains "{value}"`,conditionStartsWith:`Starts with "{value}"`,conditionEndsWith:`Ends with "{value}"`,conditionBlank:`(Blank)`,conditionNotBlank:`(Not blank)`,datePresetToday:`Today`,datePresetThisMonth:`This month`,datePresetLast30Days:`Last 30 days`},n={rowCount:`Rows {shown} of {total}`,columnCount:`Columns {shown} of {total}`,filterSummary:`Filter: {value}`,filterGlobal:`"{text}"`,filterColumns:({count:e})=>e===1?`1 column`:`${e} columns`,sortSummary:`Sort: {value}`,sortEntry:`{column} ({direction})`,sortAscending:`ascending`,sortDescending:`descending`,activeCell:`Cell {cell}`,selection:`Range {range}`,selectionSize:({cells:e,rows:t})=>`${e} ${e===1?`cell`:`cells`} / ${t} ${t===1?`row`:`rows`}`,selectedColumns:({count:e})=>e===1?`1 column`:`${e} columns`,detailColumnName:`Details`,rowDragColumnName:`Move`,aggregateAverage:`Average`,aggregateCount:`Count`,aggregateSum:`Sum`,aggregateComputing:`Calculating… {percent}%`,aggregatePartial:`Loaded rows only`,none:`—`,listSeparator:`, `,globalFilterPlaceholder:`Filter all columns`,globalFilterLabel:`Search the whole table`,clearGlobalFilter:`Clear filter`,toggleFilterPanel:`Show or hide the filter panel`,clear:`Clear`,clearAll:`Clear all`,close:`Close`,apply:`Apply`,retry:`Retry`,noOptions:`No options`,noRows:`No rows to show`,noMatchingRows:`No matching rows`,selectAllRows:`Select all rows`,selectRow:`Select row {row}`,sortedAscending:`Sorted ascending`,sortedDescending:`Sorted descending`,sortPriority:` (priority {priority})`,columnFiltered:`Filtered`,dragColumn:`Drag to move the column`,columnMenu:`Column menu`,columnMenuFor:`Column menu for {column}`,showDetails:`Show details for row {row}`,hideDetails:`Hide details for row {row}`,expandGroup:`Expand {group}`,collapseGroup:`Collapse {group}`,groupRowCount:({count:e})=>e===`1`?`(1 row)`:`(${e} rows)`,editCell:`Edit {column}`,cellInput:`Cell input`,sizingColumns:`Sizing columns…`,applyingFilter:`Filtering {percent}%`,dragRow:`Drag to move the row`,dragRowDisabled:`Rows can't be moved while the table is sorted or filtered`,dragRowLabel:`Row {row}`,pinnedTopRow:`Pinned to top {row}`,pinnedBottomRow:`Pinned to bottom {row}`,expandColumnGroup:`Expand {group}`,collapseColumnGroup:`Collapse {group}`,dragColumnGroup:`Drag to move {group}`,contextMenuCell:`Cell menu`,contextMenuRow:`Row menu`,scrollHintRow:`Row {row}`,scrollHintJump:`Go to row {row}`,scrollHintJumpSeparator:`·`,scrollHintTenThousands:`{full}`,menuFilter:`Filter…`,menuSortAscending:`Sort ascending`,menuSortDescending:`Sort descending`,menuManageSort:`Manage sorting…`,menuManageFilters:`Manage filters…`,menuGroupBy:`Group by this column`,menuUngroup:`Ungroup`,menuPin:`Pin column`,menuPinNone:`No pin`,menuPinLeft:`Pin left`,menuPinRight:`Pin right`,menuPinUnavailable:`Pinning can't be changed in this grid.`,menuAutosize:`Autosize this column`,menuAutosizeAll:`Autosize all columns`,menuColumns:`Choose columns`,menuResetColumns:`Reset columns`,resetColumnsHint:`Restores the width, pinning, visibility, order and grouping of all columns.`,menuResetUnavailable:`Columns can't be reset in this grid.`,toolPanelFilters:`Filters`,toolPanelSort:`Sort`,toolPanelColumns:`Columns`,toolPanelLabel:`Tool panel`,columnsPinnedLeft:`Pinned left`,columnsUnpinned:`Not pinned`,columnsPinnedRight:`Pinned right`,columnsHideAll:`Hide all columns (the first one stays)`,columnsShowAll:`Show all columns`,columnsDragToReorder:`Drag to reorder`,columnsDragWithinSection:`Drag to reorder (within the same section)`,columnsReorderUnavailable:`Columns can't be reordered in this grid.`,columnsReorderWhileSearching:`Columns can't be reordered while searching.`,columnsGroupedHint:`This column is grouped. Its values appear in the group column.`,columnsToggleGroup:`Show or hide the columns in {group}`,columnsDragWithinGroup:`Drag to reorder (within the same group)`,groupedColumnTitle:`{column} (grouped)`,columnsSearchPlaceholder:`Search…`,columnsNoMatches:`No matching columns`,columnsReset:`Reset all columns`,columnsUnavailable:`Showing, hiding and resetting columns isn't available in this grid.`,globalFilterTitle:`Global filter`,globalFilterRows:`Rows containing "{text}"`,clearGlobalFilterTitle:`Clear the global filter`,noColumnFilters:`No column filters`,addFilterLabel:`Choose a column to filter`,addFilter:`+ Add filter…`,addFilterNone:`+ No columns to add`,sortPanelEmpty:`No sorting`,sortPanelDrag:`Drag to change the priority`,sortPanelDisabled:`Sorting is turned off`,sortPanelNeedsTwo:`Add a second level to reorder`,sortPanelAscending:`Ascending`,sortPanelAscendingShort:`Asc`,sortPanelDescending:`Descending`,sortPanelDescendingShort:`Desc`,sortPanelRemove:`Remove this level`,sortPanelAllUsed:`All columns are already used`,sortPanelAddHint:`Add a sort level`,sortPanelAdd:`+ Add level`,sortPanelClearHint:`Remove all sorting`,sortPanelReadOnly:`Sorting is turned off, so it can't be changed`,filterHiddenColumn:` (hidden)`,filterGroupedColumn:` (grouped)`,filterJumpUnavailable:`This column is hidden, so its filter can't be opened here. You can still clear it with ×.`,filterEditUnderGroup:`Opens under the group column header`,filterJump:`Go to this column to edit`,filterEditFor:`Edit the filter on {column}`,filterClear:`Clear this column's filter`,filterClearFor:`Clear the filter on {column}`,filterCurrentNone:`(none)`,filterCurrentExcluded:({count:e})=>e===1?`Excluding 1 value`:`Excluding ${e} values`,filterCurrentSelected:`{count} selected`,operatorEquals:`Equals`,operatorNotEquals:`Does not equal`,operatorGreaterThanOrEqual:`Greater than or equal to`,operatorGreaterThan:`Greater than`,operatorLessThanOrEqual:`Less than or equal to`,operatorLessThan:`Less than`,operatorBetween:`Between`,operatorContains:`Contains`,operatorStartsWith:`Starts with`,operatorEndsWith:`Ends with`,operatorOnOrAfter:`On or after`,operatorOnOrBefore:`On or before`,operatorBlank:`Blank`,operatorNotBlank:`Not blank`,filterTitle:`Filter: {column}`,filterCollecting:`Collecting values… {percent}%`,filterOptionsLoading:`Loading values…`,filterOptionsLoadingShort:`Loading…`,filterOptionsFailed:`Couldn't load the values`,filterOptionsFailedShort:`Failed`,filterOptionsTruncated:`(first values only)`,filterSearchPlaceholder:`Search (Enter to apply)`,filterSelectAll:`(Select all)`,filterSelectAllResults:`(Select all results)`,filterNoOptionsSource:`No values. With serverSide, give the column filterOptions or another source of values.`,filterNoMatches:`No matching values`,filterSelectedCount:`Selected {selected} of {total}`,filterShownCount:` ({count} shown)`,filterMatchCount:({count:e})=>e===1?`1 match`:`${e} matches`,filterTotalCount:`{count} total`,filterOptionCount:`Values: {count}`,filterAll:`(All)`,filterConditionSection:`Condition`,filterValuesSection:`Values`,filterOperator:`Operator`,filterValue:`Value`,filterValuePlaceholder:`Value`,filterMin:`Min`,filterMax:`Max`,filterRangeSeparator:`–`,filterNoValue:`This operator doesn't take a value`,filterDate:`Date`,filterStartDate:`Start date`,filterEndDate:`End date`,filterTextPlaceholder:`Contains…`,filterTextHint:`Matches text anywhere in the value`,filterCurrentValue:`Current: {value}`,treeExpand:`Expand`,treeCollapse:`Collapse`,dateTreeYear:`{year}`,dateTreeMonth:({month:t})=>e[t-1]??String(t),dateTreeDay:`{day}`,calendarWeekdays:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],calendarMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],calendarTitle:({year:t,month:n})=>`${e[n-1]??n} ${t}`,calendarYear:`{year}`,calendarOpen:`Open calendar`,calendarClose:`Close calendar`,calendarPrevious:`Previous`,calendarNext:`Next`,calendarChangeView:`Change view`,calendarBack:`← Back`,calendarToday:`Today`,findLabel:`Find in cells`,findPlaceholder:`Find`,findInput:`Search text`,findSearching:`Searching…`,findNoResults:`No results`,findPrevious:`Previous match`,findPreviousHint:`Previous (Shift+Enter)`,findNext:`Next match`,findNextHint:`Next (Enter)`,findClose:`Close find`,findCloseHint:`Close (Esc)`,fillOptions:`Auto Fill Options`,fillOptionsCurrent:`Auto Fill Options ({kind})`,fillSeries:`Fill Series`,fillCopy:`Copy Cells`,invalidValue:`Invalid value`,enterNumber:`Enter a number`,enterInteger:`Enter a whole number`,enterMin:`Enter {min} or more`,enterMax:`Enter {max} or less`,enterRange:`Enter a number from {min} to {max}`,enterDate:`Enter a date (e.g. 2026-03-15)`,saveFailedCell:`Couldn't save. The value was restored.`,loadFailed:({count:e})=>`Couldn't load rows (${e} ${e===1?`block`:`blocks`})`,dismissLoadError:`Dismiss the error`,saveFailed:({count:e})=>`Couldn't save changes (${e} ${e===1?`row`:`rows`}). The values were restored.`,dismissSaveError:`Dismiss the save error`,totalRowLabel:`Total`,totalAverage:`Avg`,totalMin:`Min`,totalMax:`Max`,totalCount:`Count`,exportSubtotal:`{label} subtotal`},r={placeholder:`Filter or sort in plain words (e.g. this month, largest amount first)`,label:`Filter in plain words`,submit:`Ask`,stop:`Stop`,examples:`Try:`,thinking:`Thinking…`,escHint:`Press Esc to stop`,retry:`Try again`,appliedTitle:`Applied`,undo:`Undo`,close:`Close`,removeItem:`Remove {label} {text}`,allRemoved:`All conditions have been removed.`,unchanged:`Nothing to change.`,undone:`Undone.`,droppedTitle:`Couldn't use`,fromAi:`From the AI: {text}`,askFailed:`Couldn't reach the AI. Try again.`,noGrid:`The grid wasn't found. Try again once it's on the page.`,changedNotice:`The grid's conditions have changed, so they can't be changed from here. Use the grid's filters and sorting.`,itemSort:`Sort`,itemSortEntry:`{column} {direction}`,ascending:`ascending`,descending:`descending`,itemSearch:`Search`,itemHidden:`Hidden`,quote:`"{text}"`,quoteSeparator:`, `,emptyText:`(empty)`,unnamed:`(no name)`,andMore:`{items} and {count} more`,moreReasons:`{count} more`,columnReason:`{column}: {reason}`,readError:`Couldn't read the AI's answer. Try wording it differently.`,shapeError:`The AI's answer wasn't an instruction for the grid. Try wording it differently.`,filtersLocked:`Column filters are locked`,noSuchColumn:`There is no column {column}`,notFilterable:`This column can't be filtered`,noOperator:`The condition has no type`,operatorUnavailable:`{operator} can't be used on this column`,oneCondition:`Only one condition per column`,oneSelection:`Only one value choice per column`,unreadableFilters:`Unreadable conditions ({count}) can't be used`,noNumberRange:`The range needs two numbers`,notNumber:`{value} is not a number`,noText:`No text to look for`,textTooLong:`Text to look for can be up to {limit} characters`,unknownPeriod:`{value} is not an available period`,noDateRange:`The range needs two dates`,notDate:`{value} is not a date`,noValues:`No values to choose`,noSelectableValues:`None of the values can be chosen`,tooManyValues:`Up to {limit} values can be chosen ({count} not used)`,notInOptions:`Not in the list: {values}`,notAnOption:`{value} is not in the list`,cannotFilterBy:`Can't filter by {value}`,valueTooLong:`Values over {limit} characters can't be used`,valuesTooLong:`Values over {limit} characters ({count}) can't be used`,unreadableValues:`Unreadable values ({count}) can't be used`,sortLocked:`Sorting is locked`,sortNoSuchColumn:`Sort: there is no column {column}`,sortBadDirection:`Sort: {direction} can't be used for {column}`,sortUnreadable:`Couldn't read the sort order`,searchUnreadable:`Couldn't read the search text`,searchLocked:`The search text is locked`,searchTooLong:`The search text can be up to {limit} characters`,columnsLocked:`Column visibility is locked`,unreadableColumns:`Unreadable column changes ({count}) can't be used`,cannotHideAll:`All columns can't be hidden`,operatorLabels:{"=":`equals`,"!=":`does not equal`,">":`greater than`,">=":`at least`,"<":`less than`,"<=":`at most`,between:`between`,contains:`contains`,equals:`equals`,startsWith:`starts with`,endsWith:`ends with`,onOrAfter:`on or after`,onOrBefore:`on or before`,notEquals:`does not equal`,preset:`today, this month, …`,blank:`blank`,notBlank:`not blank`,in:`one of`,notIn:`none of`,clear:`clear`}},i=e=>({...t,...e}),a=i(n),o=i(r);exports.gridAskLocaleTextEn=o,exports.localeTextEn=a;
@@ -96,6 +96,9 @@ var e = [
96
96
  dragRowLabel: "Row {row}",
97
97
  pinnedTopRow: "Pinned to top {row}",
98
98
  pinnedBottomRow: "Pinned to bottom {row}",
99
+ expandColumnGroup: "Expand {group}",
100
+ collapseColumnGroup: "Collapse {group}",
101
+ dragColumnGroup: "Drag to move {group}",
99
102
  contextMenuCell: "Cell menu",
100
103
  contextMenuRow: "Row menu",
101
104
  scrollHintRow: "Row {row}",
@@ -134,6 +137,8 @@ var e = [
134
137
  columnsReorderUnavailable: "Columns can't be reordered in this grid.",
135
138
  columnsReorderWhileSearching: "Columns can't be reordered while searching.",
136
139
  columnsGroupedHint: "This column is grouped. Its values appear in the group column.",
140
+ columnsToggleGroup: "Show or hide the columns in {group}",
141
+ columnsDragWithinGroup: "Drag to reorder (within the same group)",
137
142
  groupedColumnTitle: "{column} (grouped)",
138
143
  columnsSearchPlaceholder: "Search…",
139
144
  columnsNoMatches: "No matching columns",
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=(e,t)=>!e.collapsible||!(t?.has(e.key)??!1),t=(e,t)=>e===null?0:e.depth-(e.pathByColumn.get(t)?.length??0),n=(e,t)=>{if(e===null||t.length===0)return[];let n=[];for(let r=0;r<e.depth;r+=1){let i=null,a=e=>{if(i===null)return;let a=t[i.startIndex],o=t[e];a&&o&&n.push({id:`${i.group.key}\u001f${a.column.key}`,group:i.group,level:r,startIndex:i.startIndex,endIndex:e,start:a.paneLocalStart,size:o.paneLocalStart+o.paneLocalSize-a.paneLocalStart,firstColIndex:a.logicalIndex,lastColIndex:o.logicalIndex,columnKeys:i.keys}),i=null};t.forEach((t,n)=>{let o=e.pathByColumn.get(t.column.key)?.[r]??null;if(i!==null&&i.group===o){i.keys.push(t.column.key);return}a(n-1),o!==null&&(i={group:o,startIndex:n,keys:[t.column.key]})}),a(t.length-1)}return n},r=(e,t)=>{if(e===null)return[];let r=t.map((e,t)=>({column:{key:e},logicalIndex:t,paneLocalStart:t,paneLocalSize:1})),i=Array.from({length:e.depth},()=>[]);for(let t of n(e,r))i[t.level]?.push({key:t.group.key,title:t.group.title,start:t.startIndex,span:t.endIndex-t.startIndex+1});return i};exports.buildColumnGroupExportRows=r,exports.columnHeaderSpanRows=t,exports.isColumnGroupOpen=e,exports.resolveColumnGroupCells=n;
@@ -0,0 +1,54 @@
1
+ import type { GridColumnGroup } from '../model/gridTypes.unbound.js';
2
+ export type ColumnGroupNode = {
3
+ key: string;
4
+ title: string;
5
+ level: number;
6
+ parent: ColumnGroupNode | null;
7
+ definition: GridColumnGroup;
8
+ leafKeys: readonly string[];
9
+ collapsible: boolean;
10
+ keepKeys: readonly string[] | null;
11
+ };
12
+ export type ColumnGroupTree = {
13
+ depth: number;
14
+ groups: ReadonlyMap<string, ColumnGroupNode>;
15
+ pathByColumn: ReadonlyMap<string, readonly ColumnGroupNode[]>;
16
+ hasCollapsible: boolean;
17
+ };
18
+ export type ColumnGroupResizeStart = {
19
+ columnKey: string;
20
+ startWidth: number;
21
+ minWidth: number;
22
+ maxWidth: number;
23
+ resolveWidths: (nextTotal: number) => Record<string, number>;
24
+ };
25
+ export declare const isColumnGroupOpen: (group: ColumnGroupNode, closedKeys: ReadonlySet<string> | null | undefined) => boolean;
26
+ export declare const columnHeaderSpanRows: (tree: ColumnGroupTree | null, columnKey: string) => number;
27
+ export type ColumnGroupPaneEntry = {
28
+ column: {
29
+ key: string;
30
+ };
31
+ logicalIndex: number;
32
+ paneLocalStart: number;
33
+ paneLocalSize: number;
34
+ };
35
+ export type ColumnGroupCell = {
36
+ id: string;
37
+ group: ColumnGroupNode;
38
+ level: number;
39
+ startIndex: number;
40
+ endIndex: number;
41
+ start: number;
42
+ size: number;
43
+ firstColIndex: number;
44
+ lastColIndex: number;
45
+ columnKeys: readonly string[];
46
+ };
47
+ export declare const resolveColumnGroupCells: (tree: ColumnGroupTree | null, entries: readonly ColumnGroupPaneEntry[]) => ColumnGroupCell[];
48
+ export type ColumnGroupExportCell = {
49
+ key: string;
50
+ title: string;
51
+ start: number;
52
+ span: number;
53
+ };
54
+ export declare const buildColumnGroupExportRows: (tree: ColumnGroupTree | null, columnKeys: readonly string[]) => ColumnGroupExportCell[][];
@@ -0,0 +1,53 @@
1
+ //#region src/logic/columnGroupCells.ts
2
+ var e = (e, t) => !e.collapsible || !(t?.has(e.key) ?? !1), t = (e, t) => e === null ? 0 : e.depth - (e.pathByColumn.get(t)?.length ?? 0), n = (e, t) => {
3
+ if (e === null || t.length === 0) return [];
4
+ let n = [];
5
+ for (let r = 0; r < e.depth; r += 1) {
6
+ let i = null, a = (e) => {
7
+ if (i === null) return;
8
+ let a = t[i.startIndex], o = t[e];
9
+ a && o && n.push({
10
+ id: `${i.group.key}\u001f${a.column.key}`,
11
+ group: i.group,
12
+ level: r,
13
+ startIndex: i.startIndex,
14
+ endIndex: e,
15
+ start: a.paneLocalStart,
16
+ size: o.paneLocalStart + o.paneLocalSize - a.paneLocalStart,
17
+ firstColIndex: a.logicalIndex,
18
+ lastColIndex: o.logicalIndex,
19
+ columnKeys: i.keys
20
+ }), i = null;
21
+ };
22
+ t.forEach((t, n) => {
23
+ let o = e.pathByColumn.get(t.column.key)?.[r] ?? null;
24
+ if (i !== null && i.group === o) {
25
+ i.keys.push(t.column.key);
26
+ return;
27
+ }
28
+ a(n - 1), o !== null && (i = {
29
+ group: o,
30
+ startIndex: n,
31
+ keys: [t.column.key]
32
+ });
33
+ }), a(t.length - 1);
34
+ }
35
+ return n;
36
+ }, r = (e, t) => {
37
+ if (e === null) return [];
38
+ let r = t.map((e, t) => ({
39
+ column: { key: e },
40
+ logicalIndex: t,
41
+ paneLocalStart: t,
42
+ paneLocalSize: 1
43
+ })), i = Array.from({ length: e.depth }, () => []);
44
+ for (let t of n(e, r)) i[t.level]?.push({
45
+ key: t.group.key,
46
+ title: t.group.title,
47
+ start: t.startIndex,
48
+ span: t.endIndex - t.startIndex + 1
49
+ });
50
+ return i;
51
+ };
52
+ //#endregion
53
+ export { r as buildColumnGroupExportRows, t as columnHeaderSpanRows, e as isColumnGroupOpen, n as resolveColumnGroupCells };
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./geometry.cjs"),t=require("./columnGroupCells.cjs");var n=null,r=(e,t)=>{n??=new Set,!n.has(e)&&(n.add(e),console.warn(`[spreadsheet-grid] ${e}\n[spreadsheet-grid] ${t}`))},i=(e,t)=>{if(!e||e.length===0)return null;let n=new Map,i=new Map,a=0,o=!1,s=(e,c,l)=>{if(n.has(e.key))return process.env.NODE_ENV!==`production`&&r(`columnGroups: グループの key \`${e.key}\` が 2 回あります。後のものを使いません。`,`columnGroups: the group key \`${e.key}\` appears twice. The later one is ignored.`),[];let u=e.collapsible!==void 0&&e.collapsible!==!1,d=typeof e.collapsible==`object`&&e.collapsible!==null&&e.collapsible.keep?[...e.collapsible.keep]:null,f=[],p={key:e.key,title:e.title,level:c===null?0:c.level+1,parent:c,definition:e,leafKeys:f,collapsible:u,keepKeys:d};n.set(e.key,p);let m=[...l,p];for(let n of e.children)if(typeof n==`string`){if(t&&!t.has(n))continue;if(i.has(n)){process.env.NODE_ENV!==`production`&&r(`columnGroups: 列 \`${n}\` が 2 つのグループに入っています。先のグループだけに入れます。`,`columnGroups: the column \`${n}\` is in two groups. It stays in the first one.`);continue}i.set(n,m),f.push(n),a=Math.max(a,m.length)}else f.push(...s(n,p,m));return f.length===0?(n.delete(e.key),[]):(u&&(f.length<2||d!==null&&f.every(e=>d.includes(e)))&&(p.collapsible=!1),p.collapsible&&(o=!0),f)};for(let t of e)s(t,null,[]);return a===0?null:{depth:a,groups:n,pathByColumn:i,hasCollapsible:o}},a=(e,t)=>{if(process.env.NODE_ENV===`production`||!e||e.length===0)return;let n=new Set(t.map(e=>e.key)),i=[],a=e=>{for(let t of e.children)typeof t==`string`?!n.has(t)&&!i.includes(t)&&i.push(t):a(t)};if(e.forEach(a),i.length===0)return;let o=i.map(e=>`\`${e}\``).join(`, `);r(`columnGroups: 列定義(columns)に無い列 ${o} があります(無視します。書き間違いでないか確かめてください)。`,`columnGroups: ${o} ${i.length===1?`is`:`are`} not in the columns (ignored; check for typos).`)},o=(e,t,n)=>{let r=new Set(e.leafKeys),i=(e.keepKeys??[]).filter(e=>r.has(e)&&t(e));if(i.length>0)return new Set(i);let a=null,o=1/0;for(let r of e.leafKeys){let e=n.get(r);e!==void 0&&e<o&&t(r)&&(a=r,o=e)}return a===null?new Set:new Set([a])},s=(e,t,n)=>{if(e===null||!e.hasCollapsible||!t||t.size===0)return null;let r=new Map,i=new Set;n.forEach((e,t)=>{let a=e.pinned===`left`?0:e.pinned===`right`?2:1;r.set(e.key,a*n.length+t),e.visible!==!1&&i.add(e.key)});let a=e=>i.has(e),s=new Map,c=new Set;for(let[n,i]of e.pathByColumn){let e=i.find(e=>e.collapsible&&t.has(e.key));if(e===void 0)continue;let l=s.get(e);l===void 0&&(l=o(e,a,r),s.set(e,l)),l.has(n)||c.add(n)}return c.size>0?c:null},c=(e,t,n,r)=>{let{activeCell:i,selection:a,editingCell:o,dragState:s}=t;if(r.length===0||i===null&&a===null&&o===null&&s===null)return t;let c=new Map(r.map((e,t)=>[e,t])),l=new Map(n.map((e,t)=>[e,t])),u=r.length-1,d=r=>{let i=n[r];if(i===void 0)return Math.min(r,u);let a=c.get(i);if(a!==void 0)return a;let o=e.pathByColumn.get(i)?.find(e=>e.collapsible&&t.closedColumnGroupKeys?.has(e.key)),s=-1,d=1/0;for(let e of o?.leafKeys??[]){let t=c.get(e);if(t===void 0)continue;let n=l.get(e),i=n===void 0?2**53-1:Math.abs(n-r);i<d&&(s=t,d=i)}if(s>=0)return s;for(let e=r+1;e<n.length;e+=1){let t=c.get(n[e]??``);if(t!==void 0)return t}for(let e=r-1;e>=0;--e){let t=c.get(n[e]??``);if(t!==void 0)return t}return Math.min(r,u)},f=(e,t)=>{let r=Math.min(e,t),i=Math.max(e,t),a=1/0,o=-1;for(let e=r;e<=i;e+=1){let t=c.get(n[e]??``);t!==void 0&&(t<a&&(a=t),t>o&&(o=t))}if(o<0){let e=d(r),t=d(i);a=Math.min(e,t),o=Math.max(e,t)}return e<=t?[a,o]:[o,a]},p=a?.type===`cell`?[Math.min(a.range.start.col,a.range.end.col),Math.max(a.range.start.col,a.range.end.col)]:a?.type===`col`?[Math.min(a.startCol,a.endCol),Math.max(a.startCol,a.endCol)]:null,m=e=>{let t=n[e];if(p===null||t===void 0||c.has(t)||e<p[0]||e>p[1])return d(e);for(let t=1;t<=p[1]-p[0];t+=1)for(let r of[e-t,e+t]){if(r<p[0]||r>p[1])continue;let e=c.get(n[r]??``);if(e!==void 0)return e}return d(e)},h=!1,g=(e,t=d)=>{let n=t(e.col);return n===e.col?e:(h=!0,{...e,col:n})},_=i===null?null:g(i,m),v=o===null?void 0:n[o.col],y=o===null||v===void 0||!c.has(v)?o:g(o),b=a;if(a?.type===`cell`){let[e,t]=f(a.range.start.col,a.range.end.col);(e!==a.range.start.col||t!==a.range.end.col)&&(h=!0,b={type:`cell`,range:{start:{...a.range.start,col:e},end:{...a.range.end,col:t}}})}else if(a?.type===`col`){let[e,t]=f(a.startCol,a.endCol);(e!==a.startCol||t!==a.endCol)&&(h=!0,b={type:`col`,startCol:e,endCol:t})}let x=s;if(s?.type===`selection`&&s.selectionKind===`cell`){let e=g(s.anchor);e!==s.anchor&&(x={...s,anchor:e})}else if(s?.type===`selection`&&s.selectionKind===`col`){let e=d(s.anchorCol);e!==s.anchorCol&&(h=!0,x={...s,anchorCol:e})}return h?{...t,activeCell:_,editingCell:y,selection:b,dragState:x}:t},l=(e,t)=>({keys:new Set([t]),ancestors:e.pathByColumn.get(t)??[]}),u=(t,n,r,i)=>{let a=t.groups.get(n);if(!a)return null;let o=new Set(a.leafKeys),s=new Set;for(let t of r)o.has(t.key)&&e.getColumnPane(t)===i&&s.add(t.key);if(s.size===0)return null;let c=[];for(let e=a;e!==null;e=e.parent)c.unshift(e);return{keys:s,ancestors:c}},d=(e,t,n,r,i)=>{let a=n[r-1],o=n[r],s=a===void 0?[]:e.pathByColumn.get(a)??[],c=o===void 0?[]:e.pathByColumn.get(o)??[];for(let e=0;e<Math.min(s.length,c.length);e+=1){let n=s[e]?.key;if(n===void 0||n!==c[e]?.key)break;if(t.ancestors[e]?.key!==n)return!1}for(let e of i)if(s[e.level]?.key!==e.key&&c[e.level]?.key!==e.key)return!1;return!0},f=(e,t,n,r,i,a,o=n)=>{let s=o.filter(e=>!t.keys.has(e)),c=new Map(s.map((e,t)=>[e,t])),l=t.ancestors.filter(e=>e.leafKeys.some(e=>c.has(e))),u=r=>{let i=-1;for(let e=r-1;e>=0;--e){let t=c.get(n[e]??``);if(t!==void 0){i=t;break}}let a=s.length;for(let e=r;e<n.length;e+=1){let t=c.get(n[e]??``);if(t!==void 0){a=t;break}}for(let n=a;n>i;--n)if(d(e,t,s,n,l))return s[n]??null},f=Math.max(0,i),p=Math.min(n.length,a),m=Math.min(Math.max(r,f),p);for(let e=0;e<=p-f;e+=1){let t=m-e;if(t>=f){let e=u(t);if(e!==void 0)return{slot:t,anchorKey:e}}let n=m+e;if(e>0&&n<=p){let e=u(n);if(e!==void 0)return{slot:n,anchorKey:e}}}return null},p=(t,n,r,i)=>{let a={left:[],center:[],right:[]},o=[];for(let r of t)n.has(r.key)?o.push(r.key):a[e.getColumnPane(r)].push(r.key);if(o.length===0)return null;let s=a[r],c=i===null?-1:s.indexOf(i);s.splice(c<0?s.length:c,0,...o);let l=[...a.left,...a.center,...a.right];return t.every(t=>!n.has(t.key)||e.getColumnPane(t)===r)&&l.length===t.length&&l.every((e,n)=>t[n]?.key===e)?null:l},m=(e,t,n)=>Math.min(Math.max(e,t),n),h=(e,t,n)=>{let r={},i=t>0?n/t:1,a=0;for(let t of e){let e=m(Math.round(t.startWidth*i),t.minWidth,t.maxWidth);r[t.key]=e,a+=e}let o=Math.round(n)-a;for(let t=0;t<2&&o!==0;t+=1)for(let t=e.length-1;t>=0&&o!==0;--t){let n=e[t];if(!n)continue;let i=r[n.key]??0,a=m(i+o,n.minWidth,n.maxWidth);o-=a-i,r[n.key]=a}return r},g=e=>{let t=e[e.length-1];if(t===void 0)return null;let n=0,r=0,i=0;for(let t of e)n+=t.startWidth,r+=t.minWidth,i+=t.maxWidth;return{columnKey:t.key,startWidth:n,minWidth:r,maxWidth:i,resolveWidths:t=>h(e,n,t)}},_=(t,n)=>(r,i,a)=>{let o=n.filter(t=>e.getColumnPane(t)===i).map(e=>e.key);return f(t,l(t,r),o,a,0,o.length)?.slot??o.indexOf(r)},v=(e,t,n)=>{let r=e?.pathByColumn.get(n),i=t.find(e=>e.key===n);if(!r||!i||i.pinned===`left`||i.pinned===`right`)return t;let a=t.filter(e=>e!==i),o=new Map;a.forEach((e,t)=>{e.pinned!==`left`&&e.pinned!==`right`&&o.set(e.key,t)});for(let e=r.length-1;e>=0;--e){let s=r[e]?.leafKeys??[],c=s.indexOf(n),l=-1;for(let e=c+1;e<s.length&&l<0;e+=1)l=o.get(s[e]??``)??-1;for(let e=c-1;e>=0&&l<0;--e){let t=o.get(s[e]??``);t!==void 0&&(l=t+1)}if(l>=0){let e=a.slice();return e.splice(l,0,i),e.every((e,n)=>e===t[n])?t:e}}return t},y=(e,t,n)=>{let r=[];for(let i of e?.pathByColumn.get(n)??[]){if(!i.collapsible)continue;let e=t?.has(i.key)!==!0;if(r.push({key:i.key,title:i.title,open:e}),!e)break}return r},b=` › `,x=(e,t)=>{if(!e)return null;let n=new Map;for(let e of t){let t=e.title||e.key,r=n.get(t);r?r.push(e.key):n.set(t,[e.key])}let r=null;for(let[t,i]of n){if(i.length<2)continue;let n=i.map(t=>(e.pathByColumn.get(t)??[]).map(e=>e.title||e.key)),a=(e,n)=>[...e.slice(Math.max(0,e.length-n)),t].join(b);i.forEach((e,t)=>{let i=n[t]??[];if(i.length===0)return;let o=a(i,i.length);for(let e=1;e<i.length;e+=1){let r=a(i,e);if(!n.some((n,i)=>i!==t&&a(n,e)===r)){o=r;break}}(r??=new Map).set(e,o)})}return r};exports.COLUMN_GROUP_PATH_SEPARATOR=b,exports.buildColumnGroupExportRows=t.buildColumnGroupExportRows,exports.buildColumnGroupTree=i,exports.columnHeaderSpanRows=t.columnHeaderSpanRows,exports.computeColumnBlockReorderedKeys=p,exports.createColumnChooserDropClamp=_,exports.createColumnGroupResize=g,exports.followColumnKeysAfterColumnGroupChange=c,exports.isColumnGroupOpen=t.isColumnGroupOpen,exports.placeUnpinnedColumnInGroup=v,exports.resolveCollapsedColumnKeys=s,exports.resolveColumnDragItem=l,exports.resolveColumnGroupCells=t.resolveColumnGroupCells,exports.resolveColumnGroupDistinctTitles=x,exports.resolveColumnGroupDragItem=u,exports.resolveColumnGroupDropPlacement=f,exports.resolveColumnGroupMemberWidths=h,exports.resolveColumnMenuGroupToggles=y,exports.warnUnknownColumnGroupKeys=a;
@@ -0,0 +1,46 @@
1
+ import type { GridColumn, GridColumnGroup, GridUiState } from '../model/gridTypes.unbound.js';
2
+ import { type ColumnPane } from './geometry.js';
3
+ import type { ColumnGroupNode, ColumnGroupResizeStart, ColumnGroupTree } from './columnGroupCells.js';
4
+ export { buildColumnGroupExportRows, columnHeaderSpanRows, isColumnGroupOpen, resolveColumnGroupCells, type ColumnGroupCell, type ColumnGroupExportCell, type ColumnGroupNode, type ColumnGroupPaneEntry, type ColumnGroupResizeStart, type ColumnGroupTree, } from './columnGroupCells.js';
5
+ export declare const buildColumnGroupTree: (definitions: readonly GridColumnGroup[] | null | undefined, knownColumnKeys?: ReadonlySet<string> | null | undefined) => ColumnGroupTree | null;
6
+ export declare const warnUnknownColumnGroupKeys: (definitions: readonly GridColumnGroup[] | null | undefined, columns: readonly {
7
+ key: string;
8
+ }[]) => void;
9
+ export declare const resolveCollapsedColumnKeys: (tree: ColumnGroupTree | null, closedKeys: ReadonlySet<string> | null | undefined, columns: readonly Pick<GridColumn<unknown>, "key" | "visible" | "pinned">[]) => ReadonlySet<string> | null;
10
+ export declare const followColumnKeysAfterColumnGroupChange: (tree: ColumnGroupTree, state: GridUiState, prevKeys: readonly string[], nextKeys: readonly string[]) => GridUiState;
11
+ export type ColumnGroupDragItem = {
12
+ keys: ReadonlySet<string>;
13
+ ancestors: readonly ColumnGroupNode[];
14
+ };
15
+ export declare const resolveColumnDragItem: (tree: ColumnGroupTree, columnKey: string) => ColumnGroupDragItem;
16
+ export declare const resolveColumnGroupDragItem: <T>(tree: ColumnGroupTree, groupKey: string, columns: readonly GridColumn<T>[], pane: ColumnPane) => ColumnGroupDragItem | null;
17
+ export type ColumnGroupDropPlacement = {
18
+ slot: number;
19
+ anchorKey: string | null;
20
+ };
21
+ export declare const resolveColumnGroupDropPlacement: (tree: ColumnGroupTree, item: ColumnGroupDragItem, entryKeys: readonly string[], slot: number, min: number, max: number, paneKeys?: readonly string[]) => ColumnGroupDropPlacement | null;
22
+ export declare const computeColumnBlockReorderedKeys: <T>(columns: readonly GridColumn<T>[], movingKeys: ReadonlySet<string>, targetPane: ColumnPane, anchorKey: string | null) => string[] | null;
23
+ export type ColumnResizeMember = {
24
+ key: string;
25
+ startWidth: number;
26
+ minWidth: number;
27
+ maxWidth: number;
28
+ };
29
+ export declare const resolveColumnGroupMemberWidths: (members: readonly ColumnResizeMember[], total: number, nextTotal: number) => Record<string, number>;
30
+ export declare const createColumnGroupResize: (members: readonly ColumnResizeMember[]) => ColumnGroupResizeStart | null;
31
+ export declare const createColumnChooserDropClamp: <T>(tree: ColumnGroupTree, columns: readonly GridColumn<T>[]) => (columnKey: string, pane: ColumnPane, index: number) => number;
32
+ export declare const placeUnpinnedColumnInGroup: <C extends {
33
+ key: string;
34
+ pinned?: unknown;
35
+ }>(tree: ColumnGroupTree | null, columns: C[], columnKey: string) => C[];
36
+ export type ColumnMenuGroupToggle = {
37
+ key: string;
38
+ title: string;
39
+ open: boolean;
40
+ };
41
+ export declare const resolveColumnMenuGroupToggles: (tree: ColumnGroupTree | null, closedKeys: ReadonlySet<string> | undefined, columnKey: string) => ColumnMenuGroupToggle[];
42
+ export declare const COLUMN_GROUP_PATH_SEPARATOR = " \u203A ";
43
+ export declare const resolveColumnGroupDistinctTitles: (tree: ColumnGroupTree | null, columns: readonly {
44
+ key: string;
45
+ title?: string | undefined;
46
+ }[]) => ReadonlyMap<string, string> | null;