@rowsncolumns/spreadsheet 10.19.1 → 10.19.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/fill-series.d.ts +30 -8
- package/dist/cjs/api/fill-series.d.ts.map +1 -1
- package/dist/cjs/api/fill-series.js +136 -24
- package/dist/cjs/atoms/frozen-area-sent.atom.d.ts +13 -2
- package/dist/cjs/atoms/frozen-area-sent.atom.d.ts.map +1 -1
- package/dist/cjs/atoms/frozen-area-sent.atom.js +21 -2
- package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/cjs/components/canvas-grid/index.js +148 -67
- package/dist/cjs/components/fill-series-dialog/index.d.ts +3 -3
- package/dist/cjs/components/fill-series-dialog/index.d.ts.map +1 -1
- package/dist/cjs/components/fill-series-dialog/index.js +15 -10
- package/dist/cjs/hooks/use-editable.d.ts +8 -1
- package/dist/cjs/hooks/use-editable.d.ts.map +1 -1
- package/dist/cjs/hooks/use-editable.js +12 -10
- package/dist/cjs/release-date.js +1 -1
- package/dist/esm/api/fill-series.d.ts +30 -8
- package/dist/esm/api/fill-series.d.ts.map +1 -1
- package/dist/esm/api/fill-series.js +133 -23
- package/dist/esm/atoms/frozen-area-sent.atom.d.ts +13 -2
- package/dist/esm/atoms/frozen-area-sent.atom.d.ts.map +1 -1
- package/dist/esm/atoms/frozen-area-sent.atom.js +24 -2
- package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/esm/components/canvas-grid/index.js +112 -36
- package/dist/esm/components/fill-series-dialog/index.d.ts +3 -3
- package/dist/esm/components/fill-series-dialog/index.d.ts.map +1 -1
- package/dist/esm/components/fill-series-dialog/index.js +15 -10
- package/dist/esm/hooks/use-editable.d.ts +8 -1
- package/dist/esm/hooks/use-editable.d.ts.map +1 -1
- package/dist/esm/hooks/use-editable.js +7 -5
- package/dist/esm/release-date.js +1 -1
- package/package.json +1 -1
|
@@ -134,6 +134,13 @@ export type UseEditableOptions<T extends CellData> = {
|
|
|
134
134
|
* Currently selected cells, injected by useSelection
|
|
135
135
|
*/
|
|
136
136
|
selections: SelectionArea[];
|
|
137
|
+
/**
|
|
138
|
+
* The selections a commit key moves the active cell inside
|
|
139
|
+
* (`getNextFocusableCell`). `selections` when omitted. While a formula is
|
|
140
|
+
* taking picks, `selections` holds the range being picked, and the move
|
|
141
|
+
* belongs inside what was selected before it.
|
|
142
|
+
*/
|
|
143
|
+
navigationSelections?: SelectionArea[];
|
|
137
144
|
/**
|
|
138
145
|
* Active selected cell. This can change, if the user is in formula mode
|
|
139
146
|
*/
|
|
@@ -405,7 +412,7 @@ export declare const areTextFormatRunsEqual: (a: TextFormatRun[] | undefined | n
|
|
|
405
412
|
*
|
|
406
413
|
* Moves to incorrect cell
|
|
407
414
|
*/
|
|
408
|
-
export declare const useEditable: <T extends CellData>({ getEditor, getValue, getTextFormatRuns, onChange, onSubmit, onCancel, onBlur, onDelete, sheetId, selections, activeCell, canEdit, canView, frozenRows, frozenColumns, hideOnBlur, isHiddenRow, isHiddenColumn, rowCount, columnCount, selectionTopBound, selectionBottomBound, selectionLeftBound, selectionRightBound, enableEditOnEnterKey, keymap, clearSelections, onRequestCut, shouldHandleKeyDown, sticky, editorBorderColor, editorBorderOutlineColor, onBeforeEdit, onKeyDown, onEditorKeyDown, getCellOffsetFromCoords, getCellCoordsFromOffset, getCellBounds, focus, getActualCellCoords, scrollToCell, onChangeBatch, containerWidth, containerHeight, getScrollPosition, getColumnOffset, getEditorAlignment, getSheetRowCount, getSheetColumnCount, getBooleanValue, getDataValidation, setActiveCell, onCopy, onPaste, onCut, tables, onInsertTableRow, }: UseEditableOptions<T>) => {
|
|
415
|
+
export declare const useEditable: <T extends CellData>({ getEditor, getValue, getTextFormatRuns, onChange, onSubmit, onCancel, onBlur, onDelete, sheetId, selections, navigationSelections, activeCell, canEdit, canView, frozenRows, frozenColumns, hideOnBlur, isHiddenRow, isHiddenColumn, rowCount, columnCount, selectionTopBound, selectionBottomBound, selectionLeftBound, selectionRightBound, enableEditOnEnterKey, keymap, clearSelections, onRequestCut, shouldHandleKeyDown, sticky, editorBorderColor, editorBorderOutlineColor, onBeforeEdit, onKeyDown, onEditorKeyDown, getCellOffsetFromCoords, getCellCoordsFromOffset, getCellBounds, focus, getActualCellCoords, scrollToCell, onChangeBatch, containerWidth, containerHeight, getScrollPosition, getColumnOffset, getEditorAlignment, getSheetRowCount, getSheetColumnCount, getBooleanValue, getDataValidation, setActiveCell, onCopy, onPaste, onCut, tables, onInsertTableRow, }: UseEditableOptions<T>) => {
|
|
409
416
|
editorComponent: React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
|
|
410
417
|
onDoubleClick: (e: React.MouseEvent<HTMLElement>) => void;
|
|
411
418
|
getNextFocusableCell: (sheetId: number, currentCell: CellInterface, direction?: Direction, restrictWithinSelection?: boolean) => CellInterface | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-editable.d.ts","sourceRoot":"","sources":["../../../hooks/use-editable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,aAAa,EACb,YAAY,EACZ,SAAS,EACT,UAAU,EACV,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACd,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEL,SAAS,EAIV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiB/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAIzE,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG7D;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,wDAAwD;IACxD,SAAS,CAAC,E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AC,WAAW,CAAC;oCA6SpB,MAAM,eACF,aAAa,cACf,SAAS,wCAEnB,aAAa,GAAG,IAAI;;;4BAxdZ,MAAM,QACT,aAAa,iBACJ,MAAM,YACX,mBAAmB;wBAy5BpB,MAAM,QACT,aAAa,iBACJ,MAAM,YACX,mBAAmB;+BApJnB,MAAM,kBACA,aAAa,EAAE,GAAG,SAAS,WAClC,MAAM,cACH,aAAa;;;6BAtKf,MAAM,kBACA,aAAa,EAAE,GAAG,SAAS,GAAG,IAAI,WACzC,MAAM,cACH,aAAa,kBACT,aAAa,GAAG,IAAI,GAAG,SAAS,uCAEtC,mBAAmB;uBA0D1B,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC;uBA0B1B,mBAAmB,KAAG,OAAO;qBA0BrC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC;mBAndtE,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC;CAyrB1C,CAAC"}
|
|
@@ -161,15 +161,15 @@ var MEDIA_KEYS = new Set([
|
|
|
161
161
|
*/
|
|
162
162
|
var useEditable = function (_a) {
|
|
163
163
|
var _b, _c;
|
|
164
|
-
var _d = _a.getEditor, getEditor = _d === void 0 ? exports.getDefaultEditor : _d, getValue = _a.getValue, getTextFormatRuns = _a.getTextFormatRuns, onChange = _a.onChange, onSubmit = _a.onSubmit, onCancel = _a.onCancel, onBlur = _a.onBlur, onDelete = _a.onDelete, sheetId = _a.sheetId, _e = _a.selections, selections = _e === void 0 ? config_1.DEFAULT_ARRAY : _e, activeCell = _a.activeCell,
|
|
164
|
+
var _d = _a.getEditor, getEditor = _d === void 0 ? exports.getDefaultEditor : _d, getValue = _a.getValue, getTextFormatRuns = _a.getTextFormatRuns, onChange = _a.onChange, onSubmit = _a.onSubmit, onCancel = _a.onCancel, onBlur = _a.onBlur, onDelete = _a.onDelete, sheetId = _a.sheetId, _e = _a.selections, selections = _e === void 0 ? config_1.DEFAULT_ARRAY : _e, _f = _a.navigationSelections, navigationSelections = _f === void 0 ? selections : _f, activeCell = _a.activeCell, _g = _a.canEdit, canEdit = _g === void 0 ? defaultCanEdit : _g, _h = _a.canView, canView = _h === void 0 ? defaultCanView : _h, _j = _a.frozenRows, frozenRows = _j === void 0 ? 0 : _j, _k = _a.frozenColumns, frozenColumns = _k === void 0 ? 0 : _k, _l = _a.hideOnBlur, hideOnBlur = _l === void 0 ? true : _l, _m = _a.isHiddenRow, isHiddenRow = _m === void 0 ? defaultIsHidden : _m, _o = _a.isHiddenColumn, isHiddenColumn = _o === void 0 ? defaultIsHidden : _o, rowCount = _a.rowCount, columnCount = _a.columnCount, _p = _a.selectionTopBound, selectionTopBound = _p === void 0 ? 0 : _p, _q = _a.selectionBottomBound, selectionBottomBound = _q === void 0 ? rowCount : _q, _r = _a.selectionLeftBound, selectionLeftBound = _r === void 0 ? 0 : _r, _s = _a.selectionRightBound, selectionRightBound = _s === void 0 ? columnCount : _s, _t = _a.enableEditOnEnterKey, enableEditOnEnterKey = _t === void 0 ? true : _t, _u = _a.keymap, keymap = _u === void 0 ? "sheets" : _u, clearSelections = _a.clearSelections, onRequestCut = _a.onRequestCut, shouldHandleKeyDown = _a.shouldHandleKeyDown, sticky = _a.sticky, editorBorderColor = _a.editorBorderColor, editorBorderOutlineColor = _a.editorBorderOutlineColor, onBeforeEdit = _a.onBeforeEdit, onKeyDown = _a.onKeyDown, onEditorKeyDown = _a.onEditorKeyDown, getCellOffsetFromCoords = _a.getCellOffsetFromCoords, getCellCoordsFromOffset = _a.getCellCoordsFromOffset, getCellBounds = _a.getCellBounds, focus = _a.focus, getActualCellCoords = _a.getActualCellCoords, scrollToCell = _a.scrollToCell, onChangeBatch = _a.onChangeBatch, _v = _a.containerWidth, containerWidth = _v === void 0 ? 0 : _v, _w = _a.containerHeight, containerHeight = _w === void 0 ? 0 : _w, getScrollPosition = _a.getScrollPosition, getColumnOffset = _a.getColumnOffset, getEditorAlignment = _a.getEditorAlignment, getSheetRowCount = _a.getSheetRowCount, getSheetColumnCount = _a.getSheetColumnCount, getBooleanValue = _a.getBooleanValue, getDataValidation = _a.getDataValidation, setActiveCell = _a.setActiveCell, onCopy = _a.onCopy, onPaste = _a.onPaste, onCut = _a.onCut, tables = _a.tables, onInsertTableRow = _a.onInsertTableRow;
|
|
165
165
|
var editingCellCoordinate = (0, atoms_1.useEditingCellCoordinate)();
|
|
166
|
-
var
|
|
167
|
-
var
|
|
168
|
-
var
|
|
166
|
+
var _x = tslib_1.__read((0, atoms_1.useEditorVisibility)(), 2), isEditorShown = _x[0], setShowEditor = _x[1];
|
|
167
|
+
var _y = tslib_1.__read((0, atoms_1.useCellEditorValue)(), 2), value = _y[0], setValue = _y[1];
|
|
168
|
+
var _z = tslib_1.__read((0, atoms_1.useCellEditorTextFormatRuns)(), 2), textFormatRuns = _z[0], setTextFormatRuns = _z[1];
|
|
169
169
|
var currentActiveCellRef = (0, react_1.useRef)(null);
|
|
170
170
|
var initialActiveCell = (0, react_1.useRef)(undefined);
|
|
171
|
-
var
|
|
172
|
-
var
|
|
171
|
+
var _0 = tslib_1.__read((0, react_1.useState)(true), 2), autoFocus = _0[0], setAutoFocus = _0[1];
|
|
172
|
+
var _1 = tslib_1.__read((0, react_1.useState)(false), 2), isScrolling = _1[0], setIsScrolling = _1[1];
|
|
173
173
|
var isDirtyRef = (0, react_1.useRef)(false);
|
|
174
174
|
var isEnteringNewValue = (0, react_1.useRef)(false);
|
|
175
175
|
var currentValueRef = (0, react_1.useRef)(value);
|
|
@@ -658,7 +658,7 @@ var useEditable = function (_a) {
|
|
|
658
658
|
if (!bounds)
|
|
659
659
|
return null;
|
|
660
660
|
/* Inside a table, Tab / Shift+Tab wrap within the table (Excel) unless a selection cycles */
|
|
661
|
-
var table = restrictWithinSelection &&
|
|
661
|
+
var table = restrictWithinSelection && navigationSelections.length
|
|
662
662
|
? undefined
|
|
663
663
|
: (0, table_1.findActiveTableWithinCell)(sheetId, currentCell, tables);
|
|
664
664
|
var tableTarget = table
|
|
@@ -722,8 +722,10 @@ var useEditable = function (_a) {
|
|
|
722
722
|
setInitialActiveCell(null);
|
|
723
723
|
}
|
|
724
724
|
/* If user has selected some cells and active cell is within this selection */
|
|
725
|
-
if (restrictWithinSelection &&
|
|
726
|
-
|
|
725
|
+
if (restrictWithinSelection &&
|
|
726
|
+
navigationSelections.length &&
|
|
727
|
+
currentCell) {
|
|
728
|
+
var range = navigationSelections[navigationSelections.length - 1].range;
|
|
727
729
|
var activeCellBounds = getCellBounds(currentCell);
|
|
728
730
|
var nextCell = (0, grid_2.findNextCellWithinBounds)(activeCellBounds, range, direction);
|
|
729
731
|
if (nextCell)
|
|
@@ -731,7 +733,7 @@ var useEditable = function (_a) {
|
|
|
731
733
|
}
|
|
732
734
|
return nextActiveCell;
|
|
733
735
|
}, [
|
|
734
|
-
|
|
736
|
+
navigationSelections,
|
|
735
737
|
isHiddenRow,
|
|
736
738
|
isHiddenColumn,
|
|
737
739
|
selectionBottomBound,
|
package/dist/cjs/release-date.js
CHANGED
|
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.releaseDate = void 0;
|
|
5
5
|
exports.releaseDate =
|
|
6
6
|
// @ts-ignore
|
|
7
|
-
(_a = new Date("2026-11-
|
|
7
|
+
(_a = new Date("2026-11-22")) !== null && _a !== void 0 ? _a : new Date("2025-06-18");
|
|
@@ -27,20 +27,36 @@ export declare const seedRangeForSeriesSpec: (target: GridRange, spec: FillSerie
|
|
|
27
27
|
/**
|
|
28
28
|
* How many series values fit before `stop` is passed, starting from the seed's
|
|
29
29
|
* last value. `undefined` when the spec has no usable stop (no stop, zero step,
|
|
30
|
-
* a
|
|
31
|
-
*
|
|
30
|
+
* a trend, AutoFill, a Growth that shrinks toward zero and never reaches a stop
|
|
31
|
+
* on the other side, …): a seed-only selection is then not filled at all. A Date
|
|
32
|
+
* series counts on the calendar: a 1904 workbook's serials (`date1904`) are
|
|
33
|
+
* moved onto the 1900 system first, as the engine does with the seed and stop.
|
|
32
34
|
*/
|
|
33
|
-
export declare const seriesCountToStop: (last: number, spec: FillSeriesSpec
|
|
35
|
+
export declare const seriesCountToStop: (last: number, spec: FillSeriesSpec, options?: {
|
|
36
|
+
date1904?: boolean;
|
|
37
|
+
}) => number | undefined;
|
|
34
38
|
export type FillRangeForSeriesSpecArgs = {
|
|
35
39
|
/** The range the user selected (seed + cells to fill). */
|
|
36
40
|
target: GridRange;
|
|
37
41
|
/** From {@link seedRangeForSeriesSpec}. */
|
|
38
42
|
seed: GridRange;
|
|
39
43
|
spec: FillSeriesSpec;
|
|
40
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* The value a seed cell starts the series from, or `undefined` when the engine would not run its
|
|
46
|
+
* line as this series (not a number, a formula, or, for a Date series, not a date). A seed-only
|
|
47
|
+
* selection with any such line fills nothing: the engine would fill that line with its regular
|
|
48
|
+
* generator over the whole range, ignoring the stop.
|
|
49
|
+
*/
|
|
41
50
|
getSeedValue(rowIndex: number, columnIndex: number): number | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Bounds of the fill: the last row index is `rowCount - 1` and the last column index
|
|
53
|
+
* `columnCount - 1`. A host whose rows / columns start at index 1 passes its sheet's last index
|
|
54
|
+
* + 1 (CanvasGrid passes the sheet maximum, 1,048,576 rows × 16,384 columns, not its drawn extent).
|
|
55
|
+
*/
|
|
42
56
|
rowCount: number;
|
|
43
57
|
columnCount: number;
|
|
58
|
+
/** The workbook counts dates in the 1904 system (a Date series' stop is one of its serials). */
|
|
59
|
+
date1904?: boolean;
|
|
44
60
|
};
|
|
45
61
|
/**
|
|
46
62
|
* The range a Series-dialog fill covers (seed + cells to fill). A selection
|
|
@@ -48,9 +64,15 @@ export type FillRangeForSeriesSpecArgs = {
|
|
|
48
64
|
* is nothing beyond the seed and no stop): the engines apply the `stop` value
|
|
49
65
|
* per fill line — every column (Series in Columns) / row (Rows) ends at the
|
|
50
66
|
* last value within its own stop and the remaining selected cells stay
|
|
51
|
-
* untouched, exactly as Excel leaves them.
|
|
52
|
-
*
|
|
53
|
-
* Excel
|
|
67
|
+
* untouched, exactly as Excel leaves them. A seed-only selection (one cell, or
|
|
68
|
+
* one line across the axis) is extended along the axis to the LONGEST of its
|
|
69
|
+
* lines' series — Excel runs every line from its own seed until its next value
|
|
70
|
+
* would pass the stop (A1:C1 = 8, 1, 5, Columns, Stop 10 fills A to 10, B to 10
|
|
71
|
+
* and C to 10: rows 2–3, 2–10 and 2–6) — and the engine's stop ends each
|
|
72
|
+
* shorter line inside that range. When any line is one the engine will not run
|
|
73
|
+
* as the series (`getSeedValue` answers `undefined`: text, empty, a formula, a
|
|
74
|
+
* plain number under Date), nothing is filled: the engine would copy or clear
|
|
75
|
+
* that line down the whole range.
|
|
54
76
|
*/
|
|
55
|
-
export declare const fillRangeForSeriesSpec: ({ target, seed, spec, getSeedValue, rowCount, columnCount, }: FillRangeForSeriesSpecArgs) => GridRange | undefined;
|
|
77
|
+
export declare const fillRangeForSeriesSpec: ({ target, seed, spec, getSeedValue, rowCount, columnCount, date1904, }: FillRangeForSeriesSpecArgs) => GridRange | undefined;
|
|
56
78
|
//# sourceMappingURL=fill-series.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fill-series.d.ts","sourceRoot":"","sources":["../../../api/fill-series.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAkC/C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,GAC/B,MAAM,MAAM,EACZ,UAAS;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,KACpD,MAAM,GAAG,SA8CX,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,QAAQ,SAAS,EACjB,MAAM,cAAc,KACnB,SAGyD,CAAC;
|
|
1
|
+
{"version":3,"file":"fill-series.d.ts","sourceRoot":"","sources":["../../../api/fill-series.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAkC/C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,GAC/B,MAAM,MAAM,EACZ,UAAS;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,KACpD,MAAM,GAAG,SA8CX,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,QAAQ,SAAS,EACjB,MAAM,cAAc,KACnB,SAGyD,CAAC;AAyF7D;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAC5B,MAAM,MAAM,EACZ,MAAM,cAAc,EACpB,UAAS;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,KACnC,MAAM,GAAG,SA0CX,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,0DAA0D;IAC1D,MAAM,EAAE,SAAS,CAAC;IAClB,2CAA2C;IAC3C,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,cAAc,CAAC;IACrB;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACxE;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,gGAAgG;IAChG,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sBAAsB,GAAI,wEAQpC,0BAA0B,KAAG,SAAS,GAAG,SAgC3C,CAAC"}
|
|
@@ -95,15 +95,95 @@ export const parseSeriesStopValue = (text, options = {}) => {
|
|
|
95
95
|
export const seedRangeForSeriesSpec = (target, spec) => spec.in === "columns"
|
|
96
96
|
? { ...target, endRowIndex: target.startRowIndex }
|
|
97
97
|
: { ...target, endColumnIndex: target.startColumnIndex };
|
|
98
|
+
/**
|
|
99
|
+
* Days from 1970-01-01 to serial 0 of the 1900 system (1899-12-30). The calendar below is the
|
|
100
|
+
* engine's (`civil_from_days` / `days_from_civil`, proleptic Gregorian), in integer arithmetic so a
|
|
101
|
+
* Stop far outside `Date`'s range still counts.
|
|
102
|
+
*/
|
|
103
|
+
const SERIAL_EPOCH_CIVIL_DAYS = -25_569;
|
|
104
|
+
const serialToYmd = (serial) => {
|
|
105
|
+
const z = serial + SERIAL_EPOCH_CIVIL_DAYS + 719_468;
|
|
106
|
+
const era = Math.floor(z / 146_097);
|
|
107
|
+
const doe = z - era * 146_097;
|
|
108
|
+
const yoe = Math.floor((doe - Math.floor(doe / 1460) + Math.floor(doe / 36_524) - Math.floor(doe / 146_096)) / 365);
|
|
109
|
+
const doy = doe - (365 * yoe + Math.floor(yoe / 4) - Math.floor(yoe / 100));
|
|
110
|
+
const mp = Math.floor((5 * doy + 2) / 153);
|
|
111
|
+
const day = doy - Math.floor((153 * mp + 2) / 5) + 1;
|
|
112
|
+
const month = mp < 10 ? mp + 3 : mp - 9;
|
|
113
|
+
return [yoe + era * 400 + (month <= 2 ? 1 : 0), month, day];
|
|
114
|
+
};
|
|
115
|
+
const ymdToSerial = (year, month, day) => {
|
|
116
|
+
const y = month <= 2 ? year - 1 : year;
|
|
117
|
+
const era = Math.floor(y / 400);
|
|
118
|
+
const yoe = y - era * 400;
|
|
119
|
+
const doy = Math.floor((153 * (month > 2 ? month - 3 : month + 9) + 2) / 5) + day - 1;
|
|
120
|
+
const doe = yoe * 365 + Math.floor(yoe / 4) - Math.floor(yoe / 100) + doy;
|
|
121
|
+
return era * 146_097 + doe - 719_468 - SERIAL_EPOCH_CIVIL_DAYS;
|
|
122
|
+
};
|
|
123
|
+
const daysInMonth = (year, month) => month === 2
|
|
124
|
+
? (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0
|
|
125
|
+
? 29
|
|
126
|
+
: 28
|
|
127
|
+
: [4, 6, 9, 11].includes(month)
|
|
128
|
+
? 30
|
|
129
|
+
: 31;
|
|
130
|
+
/** `serial` + `months` months, the day of month clamped to the target month's length (Jan 31 + 1 → Feb 28). */
|
|
131
|
+
const addMonthsClamped = (serial, months) => {
|
|
132
|
+
const [year, month, day] = serialToYmd(serial);
|
|
133
|
+
const total = year * 12 + (month - 1) + months;
|
|
134
|
+
const targetYear = Math.floor(total / 12);
|
|
135
|
+
const targetMonth = total - targetYear * 12 + 1;
|
|
136
|
+
return ymdToSerial(targetYear, targetMonth, Math.min(day, daysInMonth(targetYear, targetMonth)));
|
|
137
|
+
};
|
|
138
|
+
/** Weekdays (Mon–Fri) among serials up to `day`, from a fixed origin: serial 0 is a Saturday. */
|
|
139
|
+
const weekdaysThrough = (day) => {
|
|
140
|
+
const weeks = Math.floor(day / 7);
|
|
141
|
+
return weeks * 5 + Math.max(0, day - weeks * 7 - 1);
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* How many values a Date series in `unit`s of `step` (a whole, non-zero number) takes from the day
|
|
145
|
+
* `lastDay` before passing `stopDay` — the engine's calendar: each weekday step skips Saturdays and
|
|
146
|
+
* Sundays (from a weekend seed the first value is the Monday), and the k-th month / year value is the
|
|
147
|
+
* seed's day of month moved k steps and clamped to that month (1/31 → 2/28 → 3/31).
|
|
148
|
+
*/
|
|
149
|
+
const dateCountToStop = (lastDay, stopDay, step, unit) => {
|
|
150
|
+
const ascending = step > 0;
|
|
151
|
+
if (ascending ? stopDay <= lastDay : stopDay >= lastDay)
|
|
152
|
+
return 0;
|
|
153
|
+
const size = Math.abs(step);
|
|
154
|
+
if (unit === "day")
|
|
155
|
+
return Math.floor(Math.abs(stopDay - lastDay) / size);
|
|
156
|
+
if (unit === "weekday") {
|
|
157
|
+
// The k-th value is the (k × step)-th weekday after the seed.
|
|
158
|
+
const weekdays = ascending
|
|
159
|
+
? weekdaysThrough(stopDay) - weekdaysThrough(lastDay)
|
|
160
|
+
: weekdaysThrough(lastDay - 1) - weekdaysThrough(stopDay - 1);
|
|
161
|
+
return Math.floor(weekdays / size);
|
|
162
|
+
}
|
|
163
|
+
const monthsPerStep = unit === "year" ? 12 * step : step;
|
|
164
|
+
const [lastYear, lastMonth] = serialToYmd(lastDay);
|
|
165
|
+
const [stopYear, stopMonth] = serialToYmd(stopDay);
|
|
166
|
+
const months = Math.abs(stopYear * 12 + stopMonth - (lastYear * 12 + lastMonth));
|
|
167
|
+
const count = Math.floor(months / Math.abs(monthsPerStep));
|
|
168
|
+
// The value landing in the Stop's own month may still pass it by its day of month.
|
|
169
|
+
const value = addMonthsClamped(lastDay, monthsPerStep * count);
|
|
170
|
+
return count > 0 && (ascending ? value > stopDay : value < stopDay) ? count - 1 : count;
|
|
171
|
+
};
|
|
98
172
|
/**
|
|
99
173
|
* How many series values fit before `stop` is passed, starting from the seed's
|
|
100
174
|
* last value. `undefined` when the spec has no usable stop (no stop, zero step,
|
|
101
|
-
* a
|
|
102
|
-
*
|
|
175
|
+
* a trend, AutoFill, a Growth that shrinks toward zero and never reaches a stop
|
|
176
|
+
* on the other side, …): a seed-only selection is then not filled at all. A Date
|
|
177
|
+
* series counts on the calendar: a 1904 workbook's serials (`date1904`) are
|
|
178
|
+
* moved onto the 1900 system first, as the engine does with the seed and stop.
|
|
103
179
|
*/
|
|
104
|
-
export const seriesCountToStop = (last, spec) => {
|
|
180
|
+
export const seriesCountToStop = (last, spec, options = {}) => {
|
|
105
181
|
const { stop } = spec;
|
|
106
|
-
if (stop === undefined || !Number.isFinite(stop))
|
|
182
|
+
if (stop === undefined || !Number.isFinite(stop) || !Number.isFinite(last)) {
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
185
|
+
// Trend ignores Step and Stop (Excel greys both out).
|
|
186
|
+
if (spec.trend)
|
|
107
187
|
return undefined;
|
|
108
188
|
const step = spec.step ?? 1;
|
|
109
189
|
if (spec.type === "linear") {
|
|
@@ -115,16 +195,29 @@ export const seriesCountToStop = (last, spec) => {
|
|
|
115
195
|
if (spec.type === "growth") {
|
|
116
196
|
if (last === 0 || step <= 0 || step === 1)
|
|
117
197
|
return undefined;
|
|
118
|
-
if (Math.sign(last) !== Math.sign(stop))
|
|
119
|
-
|
|
198
|
+
if (Math.sign(last) !== Math.sign(stop)) {
|
|
199
|
+
// Growing away from zero the first value is already past a stop on the other side; shrinking
|
|
200
|
+
// toward zero the series never reaches it, so it has no count (the engine would run on).
|
|
201
|
+
return step > 1 ? 0 : undefined;
|
|
202
|
+
}
|
|
120
203
|
const n = Math.floor(Math.log(Math.abs(stop) / Math.abs(last)) / Math.log(step) + 1e-9);
|
|
121
204
|
return n >= 0 ? n : 0;
|
|
122
205
|
}
|
|
123
|
-
if (spec.type === "date"
|
|
124
|
-
|
|
206
|
+
if (spec.type === "date") {
|
|
207
|
+
// The engine steps a date series by whole units; Excel fills nothing for Step 0.
|
|
208
|
+
const wholeStep = Math.trunc(step);
|
|
209
|
+
if (wholeStep === 0)
|
|
125
210
|
return undefined;
|
|
126
|
-
const
|
|
127
|
-
|
|
211
|
+
const shift = options.date1904 ? DATE_1904_OFFSET : 0;
|
|
212
|
+
const lastValue = last + shift;
|
|
213
|
+
const stopValue = stop + shift;
|
|
214
|
+
const lastDay = Math.floor(lastValue);
|
|
215
|
+
// Every value carries the seed's time of day; a value passes the Stop when it is beyond it.
|
|
216
|
+
const time = lastValue - lastDay;
|
|
217
|
+
const stopDay = wholeStep > 0
|
|
218
|
+
? Math.floor(stopValue - time + 1e-9)
|
|
219
|
+
: Math.ceil(stopValue - time - 1e-9);
|
|
220
|
+
return dateCountToStop(lastDay, stopDay, wholeStep, spec.dateUnit ?? "day");
|
|
128
221
|
}
|
|
129
222
|
return undefined;
|
|
130
223
|
};
|
|
@@ -134,24 +227,41 @@ export const seriesCountToStop = (last, spec) => {
|
|
|
134
227
|
* is nothing beyond the seed and no stop): the engines apply the `stop` value
|
|
135
228
|
* per fill line — every column (Series in Columns) / row (Rows) ends at the
|
|
136
229
|
* last value within its own stop and the remaining selected cells stay
|
|
137
|
-
* untouched, exactly as Excel leaves them.
|
|
138
|
-
*
|
|
139
|
-
* Excel
|
|
230
|
+
* untouched, exactly as Excel leaves them. A seed-only selection (one cell, or
|
|
231
|
+
* one line across the axis) is extended along the axis to the LONGEST of its
|
|
232
|
+
* lines' series — Excel runs every line from its own seed until its next value
|
|
233
|
+
* would pass the stop (A1:C1 = 8, 1, 5, Columns, Stop 10 fills A to 10, B to 10
|
|
234
|
+
* and C to 10: rows 2–3, 2–10 and 2–6) — and the engine's stop ends each
|
|
235
|
+
* shorter line inside that range. When any line is one the engine will not run
|
|
236
|
+
* as the series (`getSeedValue` answers `undefined`: text, empty, a formula, a
|
|
237
|
+
* plain number under Date), nothing is filled: the engine would copy or clear
|
|
238
|
+
* that line down the whole range.
|
|
140
239
|
*/
|
|
141
|
-
export const fillRangeForSeriesSpec = ({ target, seed, spec, getSeedValue, rowCount, columnCount, }) => {
|
|
240
|
+
export const fillRangeForSeriesSpec = ({ target, seed, spec, getSeedValue, rowCount, columnCount, date1904, }) => {
|
|
142
241
|
const down = spec.in === "columns";
|
|
143
|
-
// Excel reads the stop against the first seed line's last value.
|
|
144
|
-
const last = down
|
|
145
|
-
? getSeedValue(seed.endRowIndex, seed.startColumnIndex)
|
|
146
|
-
: getSeedValue(seed.startRowIndex, seed.endColumnIndex);
|
|
147
242
|
const selectedBeyondSeed = down
|
|
148
243
|
? target.endRowIndex - seed.endRowIndex
|
|
149
244
|
: target.endColumnIndex - seed.endColumnIndex;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
245
|
+
let extent = selectedBeyondSeed;
|
|
246
|
+
if (extent <= 0) {
|
|
247
|
+
// Every line of the seed continues from its own last value.
|
|
248
|
+
const [first, end] = down
|
|
249
|
+
? [seed.startColumnIndex, seed.endColumnIndex]
|
|
250
|
+
: [seed.startRowIndex, seed.endRowIndex];
|
|
251
|
+
for (let line = first; line <= end; line++) {
|
|
252
|
+
const last = down
|
|
253
|
+
? getSeedValue(seed.endRowIndex, line)
|
|
254
|
+
: getSeedValue(line, seed.endColumnIndex);
|
|
255
|
+
if (last === undefined)
|
|
256
|
+
return undefined;
|
|
257
|
+
// No count to the stop (no stop, a step that never reaches it, …): the engine would run
|
|
258
|
+
// that line over the whole range, so nothing is filled.
|
|
259
|
+
const count = seriesCountToStop(last, spec, { date1904 });
|
|
260
|
+
if (count === undefined)
|
|
261
|
+
return undefined;
|
|
262
|
+
extent = Math.max(extent, count);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
155
265
|
if (extent <= 0)
|
|
156
266
|
return undefined;
|
|
157
267
|
if (down) {
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* One axis of a freeze as it is sent: how many lines, and the first of them (absent = line 1).
|
|
3
|
+
* `seq`: the count the axis was noted at (set by {@link useNoteFrozenAreaSent}; absent = the
|
|
4
|
+
* value's `seq`). The grid consumes each axis once, by this count.
|
|
5
|
+
*/
|
|
2
6
|
export type FrozenAxisSent = {
|
|
3
7
|
count?: number;
|
|
4
8
|
start?: number | null;
|
|
9
|
+
seq?: number;
|
|
5
10
|
};
|
|
6
11
|
/**
|
|
7
12
|
* The last Freeze Panes / unfreeze this window itself sent, counted, with the area it asked for.
|
|
@@ -34,7 +39,13 @@ export declare const useFrozenAreaSentValue: () => {
|
|
|
34
39
|
rows?: FrozenAxisSent;
|
|
35
40
|
columns?: FrozenAxisSent;
|
|
36
41
|
} | null;
|
|
37
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Say "the next frozen-area change on this sheet is my own freeze" (see {@link frozenAreaSentAtom}).
|
|
44
|
+
* Noting one axis keeps the other axis's mark on the same sheet, with the count it was noted at,
|
|
45
|
+
* so a host that changes both axes in one act (`onFreezeRow` then `onFreezeColumn`) marks both;
|
|
46
|
+
* an axis the grid has already consumed keeps its old count and is not taken again
|
|
47
|
+
* (rowsncolumns/spreadsheet#1769). A mark on another sheet is dropped.
|
|
48
|
+
*/
|
|
38
49
|
export declare const useNoteFrozenAreaSent: () => (sheetId: number, area: {
|
|
39
50
|
rows?: FrozenAxisSent;
|
|
40
51
|
columns?: FrozenAxisSent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frozen-area-sent.atom.d.ts","sourceRoot":"","sources":["../../../atoms/frozen-area-sent.atom.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"frozen-area-sent.atom.d.ts","sourceRoot":"","sources":["../../../atoms/frozen-area-sent.atom.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAErF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB;SACxB,MAAM;aACF,MAAM;WACR,cAAc;cACX,cAAc;;;aAHnB,MAAM;iBACF,MAAM;eACR,cAAc;kBACX,cAAc;;CACX,CAAC;AAEhB,eAAO,MAAM,sBAAsB;SAN5B,MAAM;aACF,MAAM;WACR,cAAc;cACX,cAAc;QAGkD,CAAC;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,kBAGpB,MAAM,QAAQ;IAAE,IAAI,CAAC,EAAE,cAAc,CAAC;IAAC,OAAO,CAAC,EAAE,cAAc,CAAA;CAAE,SAqB9E,CAAC"}
|
|
@@ -14,8 +14,30 @@ import { useCallback } from "react";
|
|
|
14
14
|
*/
|
|
15
15
|
export const frozenAreaSentAtom = atom(null);
|
|
16
16
|
export const useFrozenAreaSentValue = () => useAtomValue(frozenAreaSentAtom);
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Say "the next frozen-area change on this sheet is my own freeze" (see {@link frozenAreaSentAtom}).
|
|
19
|
+
* Noting one axis keeps the other axis's mark on the same sheet, with the count it was noted at,
|
|
20
|
+
* so a host that changes both axes in one act (`onFreezeRow` then `onFreezeColumn`) marks both;
|
|
21
|
+
* an axis the grid has already consumed keeps its old count and is not taken again
|
|
22
|
+
* (rowsncolumns/spreadsheet#1769). A mark on another sheet is dropped.
|
|
23
|
+
*/
|
|
18
24
|
export const useNoteFrozenAreaSent = () => {
|
|
19
25
|
const set = useSetAtom(frozenAreaSentAtom);
|
|
20
|
-
return useCallback((sheetId, area) => set((previous) =>
|
|
26
|
+
return useCallback((sheetId, area) => set((previous) => {
|
|
27
|
+
const seq = (previous?.seq ?? 0) + 1;
|
|
28
|
+
const kept = previous && previous.sheetId === sheetId ? previous : undefined;
|
|
29
|
+
const axis = (noted, held) => noted
|
|
30
|
+
? { ...noted, seq }
|
|
31
|
+
: held
|
|
32
|
+
? { ...held, seq: held.seq ?? kept?.seq }
|
|
33
|
+
: undefined;
|
|
34
|
+
const rows = axis(area.rows, kept?.rows);
|
|
35
|
+
const columns = axis(area.columns, kept?.columns);
|
|
36
|
+
return {
|
|
37
|
+
seq,
|
|
38
|
+
sheetId,
|
|
39
|
+
...(rows ? { rows } : {}),
|
|
40
|
+
...(columns ? { columns } : {}),
|
|
41
|
+
};
|
|
42
|
+
}), [set]);
|
|
21
43
|
};
|
|
@@ -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;
|
|
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"}
|