@rowsncolumns/spreadsheet 10.19.3 → 10.19.5

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 (137) hide show
  1. package/dist/cjs/api/entry-selections.d.ts +91 -0
  2. package/dist/cjs/api/entry-selections.d.ts.map +1 -0
  3. package/dist/cjs/api/entry-selections.js +132 -0
  4. package/dist/cjs/atoms/cell-input-context.atom.d.ts.map +1 -1
  5. package/dist/cjs/atoms/entry-selections.atom.d.ts +11 -0
  6. package/dist/cjs/atoms/entry-selections.atom.d.ts.map +1 -0
  7. package/dist/cjs/atoms/entry-selections.atom.js +11 -0
  8. package/dist/cjs/components/advanced-filter-dialog/index.d.ts.map +1 -1
  9. package/dist/cjs/components/advanced-filter-dialog/index.js +6 -6
  10. package/dist/cjs/components/calculation-options-dialog/index.d.ts.map +1 -1
  11. package/dist/cjs/components/calculation-options-dialog/index.js +3 -3
  12. package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
  13. package/dist/cjs/components/canvas-grid/index.js +243 -75
  14. package/dist/cjs/components/canvas-grid/typings.d.ts +12 -0
  15. package/dist/cjs/components/canvas-grid/typings.d.ts.map +1 -1
  16. package/dist/cjs/components/cell-input/formula-bar-cell-input.d.ts.map +1 -1
  17. package/dist/cjs/components/cell-input/formula-bar-cell-input.js +8 -2
  18. package/dist/cjs/components/consolidate-dialog/index.d.ts.map +1 -1
  19. package/dist/cjs/components/consolidate-dialog/index.js +12 -8
  20. package/dist/cjs/components/data-table-dialog/index.d.ts.map +1 -1
  21. package/dist/cjs/components/data-table-dialog/index.js +2 -2
  22. package/dist/cjs/components/evaluate-formula-dialog/index.d.ts.map +1 -1
  23. package/dist/cjs/components/evaluate-formula-dialog/index.js +9 -3
  24. package/dist/cjs/components/fill-series-dialog/index.d.ts.map +1 -1
  25. package/dist/cjs/components/fill-series-dialog/index.js +22 -6
  26. package/dist/cjs/components/forecast-sheet-dialog/index.d.ts.map +1 -1
  27. package/dist/cjs/components/forecast-sheet-dialog/index.js +4 -4
  28. package/dist/cjs/components/go-to-dialog/index.d.ts.map +1 -1
  29. package/dist/cjs/components/go-to-dialog/index.js +19 -6
  30. package/dist/cjs/components/goal-seek-dialog/index.d.ts.map +1 -1
  31. package/dist/cjs/components/goal-seek-dialog/index.js +5 -5
  32. package/dist/cjs/components/insert-cells-dialog/index.d.ts.map +1 -1
  33. package/dist/cjs/components/insert-cells-dialog/index.js +9 -9
  34. package/dist/cjs/components/move-chart-dialog/index.d.ts.map +1 -1
  35. package/dist/cjs/components/move-chart-dialog/index.js +4 -2
  36. package/dist/cjs/components/outline-settings-dialog/index.d.ts.map +1 -1
  37. package/dist/cjs/components/outline-settings-dialog/index.js +7 -5
  38. package/dist/cjs/components/paste-special-dialog/index.d.ts.map +1 -1
  39. package/dist/cjs/components/paste-special-dialog/index.js +22 -20
  40. package/dist/cjs/components/protect-sheet-dialog/index.d.ts.map +1 -1
  41. package/dist/cjs/components/protect-sheet-dialog/index.js +4 -3
  42. package/dist/cjs/components/remove-duplicates-dialog/index.d.ts.map +1 -1
  43. package/dist/cjs/components/remove-duplicates-dialog/index.js +5 -3
  44. package/dist/cjs/components/scenario-manager-dialog/index.d.ts.map +1 -1
  45. package/dist/cjs/components/scenario-manager-dialog/index.js +16 -11
  46. package/dist/cjs/components/solver-dialog/index.d.ts.map +1 -1
  47. package/dist/cjs/components/solver-dialog/index.js +12 -10
  48. package/dist/cjs/components/sort-range-dialog/index.d.ts.map +1 -1
  49. package/dist/cjs/components/sort-range-dialog/index.js +13 -9
  50. package/dist/cjs/components/sparkline-dialog/index.d.ts.map +1 -1
  51. package/dist/cjs/components/sparkline-dialog/index.js +4 -2
  52. package/dist/cjs/components/subtotal-dialog/index.d.ts.map +1 -1
  53. package/dist/cjs/components/subtotal-dialog/index.js +6 -5
  54. package/dist/cjs/components/text-to-columns-dialog/index.d.ts.map +1 -1
  55. package/dist/cjs/components/text-to-columns-dialog/index.js +5 -4
  56. package/dist/cjs/hooks/use-editable.d.ts +10 -3
  57. package/dist/cjs/hooks/use-editable.d.ts.map +1 -1
  58. package/dist/cjs/hooks/use-editable.js +72 -8
  59. package/dist/cjs/hooks/use-editor-change.d.ts +7 -3
  60. package/dist/cjs/hooks/use-editor-change.d.ts.map +1 -1
  61. package/dist/cjs/hooks/use-editor-change.js +12 -14
  62. package/dist/cjs/hooks/use-editor-submit.d.ts +10 -3
  63. package/dist/cjs/hooks/use-editor-submit.d.ts.map +1 -1
  64. package/dist/cjs/hooks/use-editor-submit.js +19 -6
  65. package/dist/cjs/hooks/use-selection.d.ts.map +1 -1
  66. package/dist/cjs/hooks/use-selection.js +2 -2
  67. package/dist/cjs/release-date.js +1 -1
  68. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  69. package/dist/esm/api/entry-selections.d.ts +91 -0
  70. package/dist/esm/api/entry-selections.d.ts.map +1 -0
  71. package/dist/esm/api/entry-selections.js +98 -0
  72. package/dist/esm/atoms/cell-input-context.atom.d.ts.map +1 -1
  73. package/dist/esm/atoms/entry-selections.atom.d.ts +11 -0
  74. package/dist/esm/atoms/entry-selections.atom.d.ts.map +1 -0
  75. package/dist/esm/atoms/entry-selections.atom.js +8 -0
  76. package/dist/esm/components/advanced-filter-dialog/index.d.ts.map +1 -1
  77. package/dist/esm/components/advanced-filter-dialog/index.js +7 -7
  78. package/dist/esm/components/calculation-options-dialog/index.d.ts.map +1 -1
  79. package/dist/esm/components/calculation-options-dialog/index.js +4 -4
  80. package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
  81. package/dist/esm/components/canvas-grid/index.js +208 -42
  82. package/dist/esm/components/canvas-grid/typings.d.ts +12 -0
  83. package/dist/esm/components/canvas-grid/typings.d.ts.map +1 -1
  84. package/dist/esm/components/cell-input/formula-bar-cell-input.d.ts.map +1 -1
  85. package/dist/esm/components/cell-input/formula-bar-cell-input.js +9 -3
  86. package/dist/esm/components/consolidate-dialog/index.d.ts.map +1 -1
  87. package/dist/esm/components/consolidate-dialog/index.js +13 -9
  88. package/dist/esm/components/data-table-dialog/index.d.ts.map +1 -1
  89. package/dist/esm/components/data-table-dialog/index.js +3 -3
  90. package/dist/esm/components/evaluate-formula-dialog/index.d.ts.map +1 -1
  91. package/dist/esm/components/evaluate-formula-dialog/index.js +7 -3
  92. package/dist/esm/components/fill-series-dialog/index.d.ts.map +1 -1
  93. package/dist/esm/components/fill-series-dialog/index.js +23 -7
  94. package/dist/esm/components/forecast-sheet-dialog/index.d.ts.map +1 -1
  95. package/dist/esm/components/forecast-sheet-dialog/index.js +5 -5
  96. package/dist/esm/components/go-to-dialog/index.d.ts.map +1 -1
  97. package/dist/esm/components/go-to-dialog/index.js +20 -7
  98. package/dist/esm/components/goal-seek-dialog/index.d.ts.map +1 -1
  99. package/dist/esm/components/goal-seek-dialog/index.js +6 -6
  100. package/dist/esm/components/insert-cells-dialog/index.d.ts.map +1 -1
  101. package/dist/esm/components/insert-cells-dialog/index.js +10 -10
  102. package/dist/esm/components/move-chart-dialog/index.d.ts.map +1 -1
  103. package/dist/esm/components/move-chart-dialog/index.js +5 -3
  104. package/dist/esm/components/outline-settings-dialog/index.d.ts.map +1 -1
  105. package/dist/esm/components/outline-settings-dialog/index.js +8 -6
  106. package/dist/esm/components/paste-special-dialog/index.d.ts.map +1 -1
  107. package/dist/esm/components/paste-special-dialog/index.js +23 -21
  108. package/dist/esm/components/protect-sheet-dialog/index.d.ts.map +1 -1
  109. package/dist/esm/components/protect-sheet-dialog/index.js +5 -4
  110. package/dist/esm/components/remove-duplicates-dialog/index.d.ts.map +1 -1
  111. package/dist/esm/components/remove-duplicates-dialog/index.js +6 -4
  112. package/dist/esm/components/scenario-manager-dialog/index.d.ts.map +1 -1
  113. package/dist/esm/components/scenario-manager-dialog/index.js +17 -12
  114. package/dist/esm/components/solver-dialog/index.d.ts.map +1 -1
  115. package/dist/esm/components/solver-dialog/index.js +13 -11
  116. package/dist/esm/components/sort-range-dialog/index.d.ts.map +1 -1
  117. package/dist/esm/components/sort-range-dialog/index.js +14 -10
  118. package/dist/esm/components/sparkline-dialog/index.d.ts.map +1 -1
  119. package/dist/esm/components/sparkline-dialog/index.js +5 -3
  120. package/dist/esm/components/subtotal-dialog/index.d.ts.map +1 -1
  121. package/dist/esm/components/subtotal-dialog/index.js +7 -6
  122. package/dist/esm/components/text-to-columns-dialog/index.d.ts.map +1 -1
  123. package/dist/esm/components/text-to-columns-dialog/index.js +6 -5
  124. package/dist/esm/hooks/use-editable.d.ts +10 -3
  125. package/dist/esm/hooks/use-editable.d.ts.map +1 -1
  126. package/dist/esm/hooks/use-editable.js +69 -5
  127. package/dist/esm/hooks/use-editor-change.d.ts +7 -3
  128. package/dist/esm/hooks/use-editor-change.d.ts.map +1 -1
  129. package/dist/esm/hooks/use-editor-change.js +10 -12
  130. package/dist/esm/hooks/use-editor-submit.d.ts +10 -3
  131. package/dist/esm/hooks/use-editor-submit.d.ts.map +1 -1
  132. package/dist/esm/hooks/use-editor-submit.js +19 -4
  133. package/dist/esm/hooks/use-selection.d.ts.map +1 -1
  134. package/dist/esm/hooks/use-selection.js +2 -2
  135. package/dist/esm/release-date.js +1 -1
  136. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  137. package/package.json +3 -3
@@ -0,0 +1,91 @@
1
+ import type { SelectionArea } from "@rowsncolumns/grid";
2
+ import type { SelectionAttributes } from "../components/canvas-grid/typings";
3
+ /**
4
+ * A range picked for a formula (pointer or arrow keys) lives in the sheet's
5
+ * own selection until the entry ends: appended after it, or in its place (a
6
+ * heading click, Shift+Arrow as the first pick, a pick that replaces a typed
7
+ * reference, a table's edge). The entry itself acts on what the sheet has
8
+ * selected WITHOUT those ranges: the commit key moves the active cell inside
9
+ * it, Ctrl+Enter fills it, and the sheet gets it back when the entry ends.
10
+ *
11
+ * The host owns the selection. So what is kept here is only ever what the
12
+ * host last gave the grid for a sheet, with the entry's own picks taken out.
13
+ * A selection the host sets while the entry is open (a collaborator's row or
14
+ * column edit moves it) replaces what was kept: nothing the entry writes may
15
+ * land outside what the host has selected now.
16
+ */
17
+ type Selections = SelectionArea<SelectionAttributes>[];
18
+ /** What one sheet has selected, as far as the open cell entry is concerned. */
19
+ export type EntrySheetSelections = {
20
+ /** What the host last gave the grid for the sheet, without the entry's picks. */
21
+ own: Selections;
22
+ /**
23
+ * The sheet's selection as a gesture on the grid last wrote it for the
24
+ * entry, picked ranges included. Absent while nothing is picked on the
25
+ * sheet.
26
+ */
27
+ written?: Selections;
28
+ /** How many of `written`'s leading selections are the sheet's own; the rest are picks. */
29
+ ownCount: number;
30
+ /** The selection the host last handed the grid for the sheet. */
31
+ seen: Selections;
32
+ };
33
+ export type EntryCell = {
34
+ sheetId: number;
35
+ rowIndex: number;
36
+ columnIndex: number;
37
+ };
38
+ /**
39
+ * Stands for the entry of a range input beside the grid (`FormulaInput`),
40
+ * which is typed in no cell: its picks leave the selections when it gives up
41
+ * formula mode. No cell has these coordinates.
42
+ */
43
+ export declare const RANGE_INPUT_ENTRY: EntryCell;
44
+ export type EntrySelections = {
45
+ /** The cell the entry is typed in: another cell is another entry. */
46
+ cell: EntryCell;
47
+ sheets: ReadonlyMap<number, EntrySheetSelections>;
48
+ };
49
+ export declare const isSameEntryCell: (a: EntryCell | undefined, b: EntryCell | undefined) => boolean;
50
+ /** How many leading selections of `a` and `b` cover the same ranges. */
51
+ export declare const leadingSameRanges: (a: Selections, b: Selections) => number;
52
+ /**
53
+ * Whether two selections cover the same ranges in the same order. A host may
54
+ * hand back other objects than the grid wrote, or a new array on every render,
55
+ * so identity says nothing about who chose a selection.
56
+ */
57
+ export declare const sameRanges: (a: Selections, b: Selections) => boolean;
58
+ /** A sheet nothing is picked on, holding what the host gave for it. */
59
+ export declare const entrySheetSelections: (own: Selections, seen?: Selections) => EntrySheetSelections;
60
+ /**
61
+ * A gesture on the grid wrote `next` for the sheet while the entry takes
62
+ * picks. `current` is what the host has for the sheet now; it is what the
63
+ * sheet's own selection is when this is its first pick.
64
+ *
65
+ * The sheet's own selections are the leading ones a pick left as they were.
66
+ * An appended pick leaves them all; a pick that takes the selection's place
67
+ * leaves none, and from then on none of what is written is the sheet's own.
68
+ */
69
+ export declare const afterPick: (sheet: EntrySheetSelections | undefined, current: Selections, next: Selections) => EntrySheetSelections;
70
+ /**
71
+ * The host handed the grid `given` for the sheet. Returns the same object when
72
+ * it is nothing new.
73
+ *
74
+ * It is the host's own choice only when it is neither what the grid last
75
+ * wrote nor what the host had handed over before: a host that applies a write
76
+ * a tick later, or builds a new array on every render, shows the old selection
77
+ * once more before the grid's write comes back.
78
+ *
79
+ * The host's choice replaces what was kept. When it has as many selections as
80
+ * the grid wrote, they are the same ones moved (a row or a column inserted or
81
+ * deleted above them), so the sheet's own are still the leading ones and the
82
+ * picks the rest. Otherwise the host chose something else altogether, and the
83
+ * sheet has that selected with nothing picked on it.
84
+ */
85
+ export declare const afterHostGave: (sheet: EntrySheetSelections, given: Selections) => EntrySheetSelections;
86
+ /** Whether a range picked for the entry is in any sheet's selection. */
87
+ export declare const hasEntryPicks: (state: EntrySelections) => boolean;
88
+ /** The sheet once its picks are out of its selection again. */
89
+ export declare const afterPutBack: (sheet: EntrySheetSelections) => EntrySheetSelections;
90
+ export {};
91
+ //# sourceMappingURL=entry-selections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-selections.d.ts","sourceRoot":"","sources":["../../../api/entry-selections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE7E;;;;;;;;;;;;;GAaG;AAEH,KAAK,UAAU,GAAG,aAAa,CAAC,mBAAmB,CAAC,EAAE,CAAC;AAEvD,+EAA+E;AAC/E,MAAM,MAAM,oBAAoB,GAAG;IACjC,iFAAiF;IACjF,GAAG,EAAE,UAAU,CAAC;IAChB;;;;OAIG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,0FAA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
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.afterPutBack = exports.hasEntryPicks = exports.afterHostGave = exports.afterPick = exports.entrySheetSelections = exports.sameRanges = exports.leadingSameRanges = exports.isSameEntryCell = exports.RANGE_INPUT_ENTRY = void 0;
4
+ var tslib_1 = require("tslib");
5
+ /**
6
+ * Stands for the entry of a range input beside the grid (`FormulaInput`),
7
+ * which is typed in no cell: its picks leave the selections when it gives up
8
+ * formula mode. No cell has these coordinates.
9
+ */
10
+ exports.RANGE_INPUT_ENTRY = {
11
+ sheetId: -1,
12
+ rowIndex: -1,
13
+ columnIndex: -1,
14
+ };
15
+ var isSameEntryCell = function (a, b) {
16
+ return a !== undefined &&
17
+ b !== undefined &&
18
+ a.sheetId === b.sheetId &&
19
+ a.rowIndex === b.rowIndex &&
20
+ a.columnIndex === b.columnIndex;
21
+ };
22
+ exports.isSameEntryCell = isSameEntryCell;
23
+ var isSameRange = function (a, b) {
24
+ return a.range.startRowIndex === b.range.startRowIndex &&
25
+ a.range.endRowIndex === b.range.endRowIndex &&
26
+ a.range.startColumnIndex === b.range.startColumnIndex &&
27
+ a.range.endColumnIndex === b.range.endColumnIndex;
28
+ };
29
+ /** How many leading selections of `a` and `b` cover the same ranges. */
30
+ var leadingSameRanges = function (a, b) {
31
+ var count = 0;
32
+ while (count < a.length &&
33
+ count < b.length &&
34
+ isSameRange(a[count], b[count])) {
35
+ count++;
36
+ }
37
+ return count;
38
+ };
39
+ exports.leadingSameRanges = leadingSameRanges;
40
+ /**
41
+ * Whether two selections cover the same ranges in the same order. A host may
42
+ * hand back other objects than the grid wrote, or a new array on every render,
43
+ * so identity says nothing about who chose a selection.
44
+ */
45
+ var sameRanges = function (a, b) {
46
+ return a === b || (a.length === b.length && (0, exports.leadingSameRanges)(a, b) === a.length);
47
+ };
48
+ exports.sameRanges = sameRanges;
49
+ /** A sheet nothing is picked on, holding what the host gave for it. */
50
+ var entrySheetSelections = function (own, seen) {
51
+ if (seen === void 0) { seen = own; }
52
+ return ({ own: own, ownCount: own.length, seen: seen });
53
+ };
54
+ exports.entrySheetSelections = entrySheetSelections;
55
+ /**
56
+ * A gesture on the grid wrote `next` for the sheet while the entry takes
57
+ * picks. `current` is what the host has for the sheet now; it is what the
58
+ * sheet's own selection is when this is its first pick.
59
+ *
60
+ * The sheet's own selections are the leading ones a pick left as they were.
61
+ * An appended pick leaves them all; a pick that takes the selection's place
62
+ * leaves none, and from then on none of what is written is the sheet's own.
63
+ */
64
+ var afterPick = function (sheet, current, next) {
65
+ var _a;
66
+ var known = sheet !== null && sheet !== void 0 ? sheet : (0, exports.entrySheetSelections)(current);
67
+ return {
68
+ own: known.own,
69
+ written: next,
70
+ ownCount: Math.min(known.ownCount, (0, exports.leadingSameRanges)((_a = known.written) !== null && _a !== void 0 ? _a : known.own, next)),
71
+ seen: known.seen,
72
+ };
73
+ };
74
+ exports.afterPick = afterPick;
75
+ /**
76
+ * The host handed the grid `given` for the sheet. Returns the same object when
77
+ * it is nothing new.
78
+ *
79
+ * It is the host's own choice only when it is neither what the grid last
80
+ * wrote nor what the host had handed over before: a host that applies a write
81
+ * a tick later, or builds a new array on every render, shows the old selection
82
+ * once more before the grid's write comes back.
83
+ *
84
+ * The host's choice replaces what was kept. When it has as many selections as
85
+ * the grid wrote, they are the same ones moved (a row or a column inserted or
86
+ * deleted above them), so the sheet's own are still the leading ones and the
87
+ * picks the rest. Otherwise the host chose something else altogether, and the
88
+ * sheet has that selected with nothing picked on it.
89
+ */
90
+ var afterHostGave = function (sheet, given) {
91
+ var _a;
92
+ if ((0, exports.sameRanges)(given, sheet.seen)) {
93
+ return sheet;
94
+ }
95
+ if ((0, exports.sameRanges)(given, (_a = sheet.written) !== null && _a !== void 0 ? _a : sheet.own)) {
96
+ return tslib_1.__assign(tslib_1.__assign({}, sheet), { seen: given });
97
+ }
98
+ if (sheet.written && given.length === sheet.written.length) {
99
+ return {
100
+ own: given.slice(0, sheet.ownCount),
101
+ written: given,
102
+ ownCount: sheet.ownCount,
103
+ seen: given,
104
+ };
105
+ }
106
+ return (0, exports.entrySheetSelections)(given);
107
+ };
108
+ exports.afterHostGave = afterHostGave;
109
+ /** Whether a range picked for the entry is in any sheet's selection. */
110
+ var hasEntryPicks = function (state) {
111
+ var e_1, _a;
112
+ try {
113
+ for (var _b = tslib_1.__values(state.sheets.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
114
+ var sheet = _c.value;
115
+ if (sheet.written) {
116
+ return true;
117
+ }
118
+ }
119
+ }
120
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
121
+ finally {
122
+ try {
123
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
124
+ }
125
+ finally { if (e_1) throw e_1.error; }
126
+ }
127
+ return false;
128
+ };
129
+ exports.hasEntryPicks = hasEntryPicks;
130
+ /** The sheet once its picks are out of its selection again. */
131
+ var afterPutBack = function (sheet) { return (0, exports.entrySheetSelections)(sheet.own, sheet.seen); };
132
+ exports.afterPutBack = afterPutBack;
@@ -1 +1 @@
1
- {"version":3,"file":"cell-input-context.atom.d.ts","sourceRoot":"","sources":["../../../atoms/cell-input-context.atom.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,mBAAmB;;;;oBAC4m8F,CAAC;qBAAwB,CAAC;;;;;;;;;;;CADvl8F,CAAC"}
1
+ {"version":3,"file":"cell-input-context.atom.d.ts","sourceRoot":"","sources":["../../../atoms/cell-input-context.atom.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,mBAAmB;;;;oBACi09F,CAAC;qBAAwB,CAAC;;;;;;;;;;;CAD5y9F,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { EntrySelections } from "../api/entry-selections";
2
+ /**
3
+ * What each sheet has selected, as far as the cell entry now open is
4
+ * concerned (`api/entry-selections.ts`). It lives beside the editing cell so
5
+ * that it outlives a grid that remounts in the middle of an entry, as the
6
+ * editing cell does. Not part of the package's exports.
7
+ */
8
+ export declare const entrySelectionsAtom: import("jotai").PrimitiveAtom<EntrySelections | undefined> & {
9
+ init: EntrySelections | undefined;
10
+ };
11
+ //# sourceMappingURL=entry-selections.atom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-selections.atom.d.ts","sourceRoot":"","sources":["../../../atoms/entry-selections.atom.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;CAA+C,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.entrySelectionsAtom = void 0;
4
+ var jotai_1 = require("jotai");
5
+ /**
6
+ * What each sheet has selected, as far as the cell entry now open is
7
+ * concerned (`api/entry-selections.ts`). It lives beside the editing cell so
8
+ * that it outlives a grid that remounts in the middle of an entry, as the
9
+ * editing cell does. Not part of the package's exports.
10
+ */
11
+ exports.entrySelectionsAtom = (0, jotai_1.atom)(undefined);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/advanced-filter-dialog/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAMtE,OAAO,KAAK,EAAwB,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE/E,MAAM,MAAM,yBAAyB,GAAG;IACtC,2BAA2B;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,oFAAoF;IACpF,gBAAgB,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,OAAO,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,CAAC;CAC/C,CAAC;AAQF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,gFACqB,yBAAyB,uBAsK9E,CAAC;AAIF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;;CAcpC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/advanced-filter-dialog/index.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAMtE,OAAO,KAAK,EAAwB,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE/E,MAAM,MAAM,yBAAyB,GAAG;IACtC,2BAA2B;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,oFAAoF;IACpF,gBAAgB,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,OAAO,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,CAAC;CAC/C,CAAC;AAQF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,gFACqB,yBAAyB,uBAsK9E,CAAC;AAIF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;;CAcpC,CAAC"}
@@ -82,31 +82,31 @@ exports.AdvancedFilterDialog = (0, react_1.memo)(function (_a) {
82
82
  react_1.default.createElement("div", { className: "flex flex-col gap-1", role: "radiogroup", "aria-label": "Action" },
83
83
  react_1.default.createElement("label", { className: "flex items-center gap-1" },
84
84
  react_1.default.createElement("input", { type: "radio", name: "advanced-filter-action", value: "filter", checked: action === "filter", onChange: function () { return setAction("filter"); } }),
85
- "Filter the list, in-place"),
85
+ react_1.default.createElement(ui_1.AccessKeyLabel, { accessKey: "f" }, "Filter the list, in-place")),
86
86
  react_1.default.createElement("label", { className: "flex items-center gap-1" },
87
87
  react_1.default.createElement("input", { type: "radio", name: "advanced-filter-action", value: "copy", checked: action === "copy", onChange: function () { return setAction("copy"); } }),
88
- "Copy to another location")),
88
+ react_1.default.createElement(ui_1.AccessKeyLabel, { accessKey: "o" }, "Copy to another location"))),
89
89
  react_1.default.createElement("label", { className: "flex flex-col gap-1 text-xs font-medium" },
90
- "List range:",
90
+ react_1.default.createElement(ui_1.AccessKeyLabel, { accessKey: "l" }, "List range:"),
91
91
  react_1.default.createElement(ui_1.Input, { value: listRange, "aria-label": "List range", onChange: function (e) {
92
92
  setListRange(e.target.value);
93
93
  setError(undefined);
94
94
  } })),
95
95
  react_1.default.createElement("label", { className: "flex flex-col gap-1 text-xs font-medium" },
96
- "Criteria range:",
96
+ react_1.default.createElement(ui_1.AccessKeyLabel, { accessKey: "c" }, "Criteria range:"),
97
97
  react_1.default.createElement(ui_1.Input, { autoFocus: true, value: criteriaRange, "aria-label": "Criteria range", placeholder: "e.g. E1:F3", onChange: function (e) {
98
98
  setCriteriaRange(e.target.value);
99
99
  setError(undefined);
100
100
  } })),
101
101
  action === "copy" ? (react_1.default.createElement("label", { className: "flex flex-col gap-1 text-xs font-medium" },
102
- "Copy to:",
102
+ react_1.default.createElement(ui_1.AccessKeyLabel, { accessKey: "t" }, "Copy to:"),
103
103
  react_1.default.createElement(ui_1.Input, { value: copyTo, "aria-label": "Copy to", placeholder: "e.g. H1", onChange: function (e) {
104
104
  setCopyTo(e.target.value);
105
105
  setError(undefined);
106
106
  } }))) : null,
107
107
  react_1.default.createElement("label", { className: "flex items-center gap-1" },
108
108
  react_1.default.createElement("input", { type: "checkbox", name: "uniqueOnly", checked: uniqueOnly, onChange: function (e) { return setUniqueOnly(e.target.checked); } }),
109
- "Unique records only"),
109
+ react_1.default.createElement(ui_1.AccessKeyLabel, { accessKey: "r" }, "Unique records only")),
110
110
  error ? (react_1.default.createElement("div", { role: "alert", className: "text-xs text-rnc-destructive" }, error)) : null,
111
111
  react_1.default.createElement(ui_1.Separator, null),
112
112
  react_1.default.createElement("div", { className: "flex justify-end gap-2" },
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/calculation-options-dialog/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAE9C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAE/D,0EAA0E;AAC1E,eAAO,MAAM,6BAA6B,EAAE,QAA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OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,2BAA2B,GAAG,IAAI,CAAC;CACnD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,sEACO,6BAA6B,uBAoFxE,CAAC"}
@@ -54,12 +54,12 @@ exports.CalculationOptionsDialog = (0, react_1.memo)(function (_a) {
54
54
  } },
55
55
  react_1.default.createElement("label", { className: "flex items-center gap-2 text-xs font-medium" },
56
56
  react_1.default.createElement("input", { type: "checkbox", checked: enabled, onChange: function (e) { return setEnabled(e.target.checked); } }),
57
- "Enable iterative calculation"),
57
+ react_1.default.createElement(ui_1.AccessKeyLabel, { accessKey: "i" }, "Enable iterative calculation")),
58
58
  react_1.default.createElement("label", { className: "flex flex-col gap-1 text-xs font-medium" },
59
- "Maximum iterations:",
59
+ react_1.default.createElement(ui_1.AccessKeyLabel, { accessKey: "x" }, "Maximum iterations:"),
60
60
  react_1.default.createElement(ui_1.Input, { type: "number", min: 1, max: 32767, step: 1, value: maxIterations, disabled: !enabled, onChange: function (e) { return setMaxIterations(e.target.value); } })),
61
61
  react_1.default.createElement("label", { className: "flex flex-col gap-1 text-xs font-medium" },
62
- "Maximum change:",
62
+ react_1.default.createElement(ui_1.AccessKeyLabel, { accessKey: "c" }, "Maximum change:"),
63
63
  react_1.default.createElement(ui_1.Input, { type: "number", min: 0, step: "any", value: maxChange, disabled: !enabled, onChange: function (e) { return setMaxChange(e.target.value); } })),
64
64
  react_1.default.createElement(ui_1.Separator, null),
65
65
  react_1.default.createElement("div", { className: "flex justify-end gap-2" },
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/canvas-grid/index.tsx"],"names":[],"mappings":"AAqEA,OAAO,KASN,MAAM,OAAO,CAAC;AAuRf,OAAO,KAAK,EAGV,QAAQ,EAcT,MAAM,aAAa,CAAC;AA0DrB,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EAEhB,MAAM,WAAW,CAAC;AAi0QnB,eAAO,MAAM,UAAU,EAA4C,CACjE,CAAC,SAAS,QAAQ,CAAC,GAAG,CAAC,EAEvB,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GACvB,wBAAwB,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAAE,KAChE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/canvas-grid/index.tsx"],"names":[],"mappings":"AAqEA,OAAO,KASN,MAAM,OAAO,CAAC;AAoSf,OAAO,KAAK,EAGV,QAAQ,EAcT,MAAM,aAAa,CAAC;AA0DrB,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EAEhB,MAAM,WAAW,CAAC;AAw/QnB,eAAO,MAAM,UAAU,EAA4C,CACjE,CAAC,SAAS,QAAQ,CAAC,GAAG,CAAC,EAEvB,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GACvB,wBAAwB,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAAE,KAChE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC"}