@rowsncolumns/spreadsheet 10.4.13 → 10.5.1
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/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/cjs/components/canvas-grid/index.js +122 -98
- package/dist/cjs/components/canvas-grid/typings.d.ts +10 -0
- package/dist/cjs/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/cjs/components/cell-editor/index.d.ts.map +1 -1
- package/dist/cjs/components/cell-editor/index.js +16 -12
- package/dist/cjs/components/range-selector/index.d.ts.map +1 -1
- package/dist/cjs/components/range-selector/index.js +54 -34
- package/dist/cjs/components/toolbar/font-family-selector.d.ts +6 -1
- package/dist/cjs/components/toolbar/font-family-selector.d.ts.map +1 -1
- package/dist/cjs/components/toolbar/font-family-selector.js +1 -2
- package/dist/cjs/hooks/use-fonts.d.ts +23 -2
- package/dist/cjs/hooks/use-fonts.d.ts.map +1 -1
- package/dist/cjs/hooks/use-fonts.js +33 -3
- package/dist/cjs/hooks/use-selection.d.ts.map +1 -1
- package/dist/cjs/hooks/use-selection.js +62 -16
- package/dist/cjs/release-date.js +1 -1
- package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/esm/components/canvas-grid/index.js +65 -37
- package/dist/esm/components/canvas-grid/typings.d.ts +10 -0
- package/dist/esm/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/esm/components/cell-editor/index.d.ts.map +1 -1
- package/dist/esm/components/cell-editor/index.js +6 -2
- package/dist/esm/components/range-selector/index.d.ts.map +1 -1
- package/dist/esm/components/range-selector/index.js +56 -36
- package/dist/esm/components/toolbar/font-family-selector.d.ts +6 -1
- package/dist/esm/components/toolbar/font-family-selector.d.ts.map +1 -1
- package/dist/esm/components/toolbar/font-family-selector.js +1 -2
- package/dist/esm/hooks/use-fonts.d.ts +23 -2
- package/dist/esm/hooks/use-fonts.d.ts.map +1 -1
- package/dist/esm/hooks/use-fonts.js +28 -2
- package/dist/esm/hooks/use-selection.d.ts.map +1 -1
- package/dist/esm/hooks/use-selection.js +62 -17
- package/dist/esm/release-date.js +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useFonts = exports.loadWebFont = exports.getWebFont = void 0;
|
|
3
|
+
exports.useFonts = exports.loadWebFont = exports.getWebFont = exports.isWebFontLoadingEnabled = exports.configureWebFonts = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var grid_1 = require("@rowsncolumns/grid");
|
|
6
6
|
var react_1 = require("react");
|
|
7
7
|
var font_loader_1 = require("../api/font-loader");
|
|
8
|
+
// Page-level: every grid on the page shares one policy, and the paste / import /
|
|
9
|
+
// font-picker fallbacks consult it too, so "off" means no third-party request at all.
|
|
10
|
+
var webFontConfig = { enabled: true };
|
|
11
|
+
/** Configure web-font loading for every grid on the page (what `useFonts` applies from its options). */
|
|
12
|
+
var configureWebFonts = function (options) {
|
|
13
|
+
var _a;
|
|
14
|
+
webFontConfig = {
|
|
15
|
+
enabled: (_a = options === null || options === void 0 ? void 0 : options.loadWebFonts) !== null && _a !== void 0 ? _a : true,
|
|
16
|
+
loader: options === null || options === void 0 ? void 0 : options.onRequestFonts,
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
exports.configureWebFonts = configureWebFonts;
|
|
20
|
+
var isWebFontLoadingEnabled = function () { return webFontConfig.enabled; };
|
|
21
|
+
exports.isWebFontLoadingEnabled = isWebFontLoadingEnabled;
|
|
8
22
|
var getWebFont = function () { return (grid_1.canUseDOM ? new font_loader_1.FontLoader() : undefined); };
|
|
9
23
|
exports.getWebFont = getWebFont;
|
|
24
|
+
/**
|
|
25
|
+
* Load `Family:weight` specs — through the host's loader when one is configured,
|
|
26
|
+
* otherwise from Google Fonts; a no-op when web fonts are turned off.
|
|
27
|
+
*/
|
|
10
28
|
var loadWebFont = function (fonts) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
11
29
|
var _a;
|
|
12
30
|
return tslib_1.__generator(this, function (_b) {
|
|
31
|
+
if (!webFontConfig.enabled)
|
|
32
|
+
return [2 /*return*/];
|
|
33
|
+
if (webFontConfig.loader)
|
|
34
|
+
return [2 /*return*/, webFontConfig.loader(fonts)];
|
|
13
35
|
return [2 /*return*/, (_a = (0, exports.getWebFont)()) === null || _a === void 0 ? void 0 : _a.loadFonts(fonts)];
|
|
14
36
|
});
|
|
15
37
|
}); };
|
|
16
38
|
exports.loadWebFont = loadWebFont;
|
|
17
|
-
var useFonts = function (fonts) {
|
|
39
|
+
var useFonts = function (fonts, options) {
|
|
40
|
+
var _a;
|
|
41
|
+
var loadWebFonts = (_a = options === null || options === void 0 ? void 0 : options.loadWebFonts) !== null && _a !== void 0 ? _a : true;
|
|
42
|
+
var onRequestFonts = options === null || options === void 0 ? void 0 : options.onRequestFonts;
|
|
43
|
+
(0, react_1.useEffect)(function () {
|
|
44
|
+
(0, exports.configureWebFonts)({ loadWebFonts: loadWebFonts, onRequestFonts: onRequestFonts });
|
|
45
|
+
}, [loadWebFonts, onRequestFonts]);
|
|
18
46
|
(0, react_1.useEffect)(function () {
|
|
47
|
+
if (!loadWebFonts)
|
|
48
|
+
return;
|
|
19
49
|
var defaultFonts = ["Inconsolata:400"];
|
|
20
50
|
var finalFonts = fonts === null || fonts === void 0 ? void 0 : fonts.split(",").map(function (value) { return String(value).trim(); });
|
|
21
51
|
(0, exports.loadWebFont)(defaultFonts.concat(finalFonts ? finalFonts : []));
|
|
22
|
-
}, [fonts]);
|
|
52
|
+
}, [fonts, loadWebFonts]);
|
|
23
53
|
};
|
|
24
54
|
exports.useFonts = useFonts;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-selection.d.ts","sourceRoot":"","sources":["../../../hooks/use-selection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,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AAa,kCAEb,KAAK;;6CAkqDT,aAAa,GAAG,SAAS,cACnB,aAAa,EAAE,GAAG,SAAS;mCAn8DjC,aAAa,OAAO,aAAa;;;;;;gCAguB3B,MAAM,GAAG,SAAS;gDA0yCpB,MAAM,aAAa,aAAa,KAAG,SAAS;CAgP3D,CAAC"}
|
|
@@ -171,6 +171,52 @@ var useSelection = function (_a) {
|
|
|
171
171
|
(0, grid_3.useIsomorphicLayoutEffect)(function () {
|
|
172
172
|
activeCellRef.current = activeCell;
|
|
173
173
|
}, [activeCell]);
|
|
174
|
+
/**
|
|
175
|
+
* The last active cell this hook itself emitted. When the `activeCell` prop
|
|
176
|
+
* moves without a grid gesture — undo/redo restoring the cursor, a host
|
|
177
|
+
* navigating — the arrow-key anchor (`selectionStart`/`selectionEnd`) must
|
|
178
|
+
* follow it, or the next arrow key moves from where the cursor was before
|
|
179
|
+
* (rowsncolumns/spreadsheet#1124). Cells the hook emitted itself are skipped:
|
|
180
|
+
* Cmd+click anchors at the range's `start`, not the top-left it emits, and
|
|
181
|
+
* Shift+Arrow never emits at all, so its fixed anchor survives.
|
|
182
|
+
*/
|
|
183
|
+
var lastEmittedActiveCellRef = (0, react_1.useRef)(null);
|
|
184
|
+
var emitActiveCell = (0, react_1.useCallback)(function (sheetId, cell) {
|
|
185
|
+
lastEmittedActiveCellRef.current = cell;
|
|
186
|
+
onChangeActiveCell === null || onChangeActiveCell === void 0 ? void 0 : onChangeActiveCell(sheetId, cell);
|
|
187
|
+
}, [onChangeActiveCell]);
|
|
188
|
+
(0, grid_3.useIsomorphicLayoutEffect)(function () {
|
|
189
|
+
var _a;
|
|
190
|
+
if (!activeCell)
|
|
191
|
+
return;
|
|
192
|
+
var emitted = lastEmittedActiveCellRef.current;
|
|
193
|
+
if (emitted &&
|
|
194
|
+
emitted.rowIndex === activeCell.rowIndex &&
|
|
195
|
+
emitted.columnIndex === activeCell.columnIndex) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (isSelecting.current || isFilling.current || isDragging.current)
|
|
199
|
+
return;
|
|
200
|
+
var range = (_a = selections[selections.length - 1]) === null || _a === void 0 ? void 0 : _a.range;
|
|
201
|
+
if (range && (0, grid_1.isCellWithinBounds)(activeCell, range)) {
|
|
202
|
+
// Keep the selection; anchor at the active cell and let the far corner
|
|
203
|
+
// be the moving end so Shift+Arrow extends from here.
|
|
204
|
+
selectionStart.current = activeCell;
|
|
205
|
+
selectionEnd.current = {
|
|
206
|
+
rowIndex: activeCell.rowIndex === range.startRowIndex
|
|
207
|
+
? range.endRowIndex
|
|
208
|
+
: range.startRowIndex,
|
|
209
|
+
columnIndex: activeCell.columnIndex === range.startColumnIndex
|
|
210
|
+
? range.endColumnIndex
|
|
211
|
+
: range.startColumnIndex,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
selectionStart.current = activeCell;
|
|
216
|
+
selectionEnd.current = activeCell;
|
|
217
|
+
}
|
|
218
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
219
|
+
}, [sheetId, activeCell === null || activeCell === void 0 ? void 0 : activeCell.rowIndex, activeCell === null || activeCell === void 0 ? void 0 : activeCell.columnIndex]);
|
|
174
220
|
(0, grid_3.useIsomorphicLayoutEffect)(function () {
|
|
175
221
|
mergedCellsRef.current = mergedCells;
|
|
176
222
|
}, [mergedCells]);
|
|
@@ -280,7 +326,7 @@ var useSelection = function (_a) {
|
|
|
280
326
|
if (!range) {
|
|
281
327
|
return;
|
|
282
328
|
}
|
|
283
|
-
|
|
329
|
+
emitActiveCell(sheetId, {
|
|
284
330
|
rowIndex: range.startRowIndex,
|
|
285
331
|
columnIndex: range.startColumnIndex,
|
|
286
332
|
});
|
|
@@ -290,7 +336,7 @@ var useSelection = function (_a) {
|
|
|
290
336
|
}, [
|
|
291
337
|
sheetId,
|
|
292
338
|
onChangeSelections,
|
|
293
|
-
|
|
339
|
+
emitActiveCell,
|
|
294
340
|
selectionFromStartEnd,
|
|
295
341
|
isCellOutOfBounds,
|
|
296
342
|
selectionPolicy,
|
|
@@ -317,7 +363,7 @@ var useSelection = function (_a) {
|
|
|
317
363
|
columnIndex: bounds.startColumnIndex,
|
|
318
364
|
};
|
|
319
365
|
/* Keep track of first cell that was selected by user */
|
|
320
|
-
|
|
366
|
+
emitActiveCell(sheetId, coords);
|
|
321
367
|
if (newSelectionMode === "clear") {
|
|
322
368
|
clearSelections();
|
|
323
369
|
}
|
|
@@ -333,7 +379,7 @@ var useSelection = function (_a) {
|
|
|
333
379
|
appendSelection,
|
|
334
380
|
newSelectionMode,
|
|
335
381
|
clearSelections,
|
|
336
|
-
|
|
382
|
+
emitActiveCell,
|
|
337
383
|
selectionFromStartEnd,
|
|
338
384
|
isCellOutOfBounds,
|
|
339
385
|
]);
|
|
@@ -411,12 +457,12 @@ var useSelection = function (_a) {
|
|
|
411
457
|
if (shouldScroll === void 0) { shouldScroll = true; }
|
|
412
458
|
selectionStart.current = coords;
|
|
413
459
|
selectionEnd.current = coords;
|
|
414
|
-
|
|
460
|
+
emitActiveCell(sheetId, coords);
|
|
415
461
|
/* Scroll to the cell */
|
|
416
462
|
if (shouldScroll && coords) {
|
|
417
463
|
scrollToCell(coords, align);
|
|
418
464
|
}
|
|
419
|
-
}, [
|
|
465
|
+
}, [emitActiveCell, scrollToCell]));
|
|
420
466
|
/**
|
|
421
467
|
* Navigate selection using keyboard
|
|
422
468
|
* @param direction
|
|
@@ -1036,7 +1082,7 @@ var useSelection = function (_a) {
|
|
|
1036
1082
|
var newSelection_1 = removeSelectionByIndex(cellIndex);
|
|
1037
1083
|
var nextActiveCell = getPossibleActiveCellFromSelections(newSelection_1);
|
|
1038
1084
|
if (nextActiveCell !== null) {
|
|
1039
|
-
|
|
1085
|
+
emitActiveCell(sheetId, nextActiveCell);
|
|
1040
1086
|
}
|
|
1041
1087
|
if (newSelection_1.length === 1 &&
|
|
1042
1088
|
cellEqualsSelection(nextActiveCell, newSelection_1)) {
|
|
@@ -1090,7 +1136,7 @@ var useSelection = function (_a) {
|
|
|
1090
1136
|
modifySelection,
|
|
1091
1137
|
mouseDownInterceptor,
|
|
1092
1138
|
newSelection,
|
|
1093
|
-
|
|
1139
|
+
emitActiveCell,
|
|
1094
1140
|
removeSelectionByIndex,
|
|
1095
1141
|
selectionLeftBound,
|
|
1096
1142
|
selectionTopBound,
|
|
@@ -1174,7 +1220,7 @@ var useSelection = function (_a) {
|
|
|
1174
1220
|
var direction = isShiftKey ? grid_4.Direction.Up : grid_4.Direction.Down;
|
|
1175
1221
|
var nextCell = (0, grid_4.findNextCellWithinBounds)(activeCellBounds, range, direction);
|
|
1176
1222
|
if (nextCell) {
|
|
1177
|
-
|
|
1223
|
+
emitActiveCell(sheetId, nextCell);
|
|
1178
1224
|
scrollToCell(nextCell);
|
|
1179
1225
|
}
|
|
1180
1226
|
}
|
|
@@ -1195,7 +1241,7 @@ var useSelection = function (_a) {
|
|
|
1195
1241
|
var direction = isShiftKey ? grid_4.Direction.Left : grid_4.Direction.Right;
|
|
1196
1242
|
var nextCell = (0, grid_4.findNextCellWithinBounds)(activeCellBounds, range, direction);
|
|
1197
1243
|
if (nextCell) {
|
|
1198
|
-
|
|
1244
|
+
emitActiveCell(sheetId, nextCell);
|
|
1199
1245
|
scrollToCell(nextCell);
|
|
1200
1246
|
}
|
|
1201
1247
|
}
|
|
@@ -1246,7 +1292,7 @@ var useSelection = function (_a) {
|
|
|
1246
1292
|
activeCell,
|
|
1247
1293
|
selections,
|
|
1248
1294
|
keyNavigate,
|
|
1249
|
-
|
|
1295
|
+
emitActiveCell,
|
|
1250
1296
|
pageDown,
|
|
1251
1297
|
pageLeft,
|
|
1252
1298
|
pageRight,
|
|
@@ -1394,7 +1440,7 @@ var useSelection = function (_a) {
|
|
|
1394
1440
|
// The active cell normally anchors the surviving corner; if it fell in the cleared band,
|
|
1395
1441
|
// move it to the remaining range's top-left so it never points at a deselected cell.
|
|
1396
1442
|
if (!cellInRange(activeCell, shrink.remaining)) {
|
|
1397
|
-
|
|
1443
|
+
emitActiveCell(sheetId, {
|
|
1398
1444
|
rowIndex: shrink.remaining.startRowIndex,
|
|
1399
1445
|
columnIndex: shrink.remaining.startColumnIndex,
|
|
1400
1446
|
});
|
|
@@ -1442,7 +1488,7 @@ var useSelection = function (_a) {
|
|
|
1442
1488
|
focus,
|
|
1443
1489
|
handleFillMouseMove,
|
|
1444
1490
|
onChangeSelections,
|
|
1445
|
-
|
|
1491
|
+
emitActiveCell,
|
|
1446
1492
|
onFill,
|
|
1447
1493
|
onFillHandleRelease,
|
|
1448
1494
|
onFillShrink,
|
|
@@ -1543,7 +1589,7 @@ var useSelection = function (_a) {
|
|
|
1543
1589
|
columnIndex: toSelection.range.startColumnIndex,
|
|
1544
1590
|
};
|
|
1545
1591
|
/* Pick the first cell as activee cell */
|
|
1546
|
-
|
|
1592
|
+
emitActiveCell(sheetId, coords);
|
|
1547
1593
|
/* Update selection start */
|
|
1548
1594
|
selectionStart.current = coords;
|
|
1549
1595
|
if ((0, grid_4.selectionSpansCells)(toSelection === null || toSelection === void 0 ? void 0 : toSelection.range)) {
|
|
@@ -1581,7 +1627,7 @@ var useSelection = function (_a) {
|
|
|
1581
1627
|
onMoveSelection === null || onMoveSelection === void 0 ? void 0 : onMoveSelection(sheetId, fromSelection, toSelection);
|
|
1582
1628
|
return;
|
|
1583
1629
|
}
|
|
1584
|
-
|
|
1630
|
+
emitActiveCell(sheetId, {
|
|
1585
1631
|
rowIndex: fromSelection.range.startRowIndex,
|
|
1586
1632
|
columnIndex: fromSelection.range.startColumnIndex,
|
|
1587
1633
|
});
|
|
@@ -1621,7 +1667,7 @@ var useSelection = function (_a) {
|
|
|
1621
1667
|
getValue,
|
|
1622
1668
|
handleSelectionMouseMove,
|
|
1623
1669
|
focus,
|
|
1624
|
-
|
|
1670
|
+
emitActiveCell,
|
|
1625
1671
|
onChangeSelections,
|
|
1626
1672
|
]);
|
|
1627
1673
|
/**
|
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-10-
|
|
7
|
+
(_a = new Date("2026-10-12")) !== null && _a !== void 0 ? _a : new Date("2025-06-18");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/canvas-grid/index.tsx"],"names":[],"mappings":"AAoDA,OAAO,KASN,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/canvas-grid/index.tsx"],"names":[],"mappings":"AAoDA,OAAO,KASN,MAAM,OAAO,CAAC;AAqNf,OAAO,KAAK,EAGV,QAAQ,EAWT,MAAM,aAAa,CAAC;AAoBrB,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EAEhB,MAAM,WAAW,CAAC;AAg3LnB,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"}
|
|
@@ -32,7 +32,7 @@ import { useFormulaSelections } from "../../atoms/formula-selections.atom";
|
|
|
32
32
|
import { useQuickEditState } from "../../atoms/magic-fill-state.atom";
|
|
33
33
|
import { useOnHideFormulaHelp, useOnShowFormulaHelp, useShowFormulaHelpValue, } from "../../atoms/show-formula-help.atom";
|
|
34
34
|
import { useSetSpreadsheetApi } from "../../atoms/spreadsheet-api.atom";
|
|
35
|
-
import { ARROW_DOWN_WIDTH, CALCULATED_ICON_WIDTH, CELL_HORIZONTAL_ALIGNMENT, CF_ICON_SPACING, CF_ICON_WIDTH, CHIP_COLOR, CHIP_SPACING, COLUMN_HEADER_HEIGHT, DEFAULT_ACTIVE_CELL, DEFAULT_ARRAY, DEFAULT_CELL_BACKGROUND_COLOR, DEFAULT_CELL_COLOR, DEFAULT_CELL_SPACING, DEFAULT_COLUMN_COUNT, DEFAULT_COLUMN_WIDTH, DEFAULT_FONT_SIZE_PT, DEFAULT_HEADER_ACTIVE_BG, DEFAULT_HEADER_ACTIVE_TABLE_BG, DEFAULT_HEADER_BG, DEFAULT_HEADER_BORDER_COLOR, DEFAULT_HEADER_COLOR, DEFAULT_HEADER_SELECTED_BG, DEFAULT_HEADER_SELECTED_TABLE_BG, DEFAULT_HEADER_TABLE_BG, DEFAULT_ROW_COUNT, DEFAULT_ROW_HEIGHT, DEFAULT_SCROLL_POSITION,
|
|
35
|
+
import { ARROW_DOWN_WIDTH, CALCULATED_ICON_WIDTH, CELL_HORIZONTAL_ALIGNMENT, CF_ICON_SPACING, CF_ICON_WIDTH, CHIP_COLOR, CHIP_SPACING, COLUMN_HEADER_HEIGHT, DEFAULT_ACTIVE_CELL, DEFAULT_ARRAY, DEFAULT_CELL_BACKGROUND_COLOR, DEFAULT_CELL_COLOR, DEFAULT_CELL_SPACING, DEFAULT_COLUMN_COUNT, DEFAULT_COLUMN_WIDTH, DEFAULT_FONT_SIZE_PT, DEFAULT_HEADER_ACTIVE_BG, DEFAULT_HEADER_ACTIVE_TABLE_BG, DEFAULT_HEADER_BG, DEFAULT_HEADER_BORDER_COLOR, DEFAULT_HEADER_COLOR, DEFAULT_HEADER_SELECTED_BG, DEFAULT_HEADER_SELECTED_TABLE_BG, DEFAULT_HEADER_TABLE_BG, DEFAULT_ROW_COUNT, DEFAULT_ROW_HEIGHT, DEFAULT_SCROLL_POSITION, defaultSpreadsheetTheme, EXPAND_COLLAPSE_ICON_WIDTH, FILTER_ICON_WIDTH, GRIDLINE_COLOR, HEADER_TEXT_FORMAT, INDENT_SPACING, MAX_COLUMN_COUNT, MAX_ROW_COUNT, MIN_COLUMN_WIDTH, ROW_HEADER_WIDTH, SCROLLBAR_SIZE, SELECTION_BG, SELECTION_BORDER, } from "../../config";
|
|
36
36
|
import { definedProps, getCellEffectiveValue, getCellFormattedValue, getCellUserEnteredValue, getDefaultColumnHeader, getDefaultRowHeader, getExtendedValueBool, getExtendedValueError, getExtendedValueFormula, getExtendedValueNumber, getExtendedValueString, getTableHeaderCells, isFirefox, isStyleReference, isTouchDevice, } from "../../helpers";
|
|
37
37
|
import { useBorderStyles } from "../../hooks/use-border-styles";
|
|
38
38
|
import { useCallbackRef } from "../../hooks/use-callback-ref";
|
|
@@ -93,7 +93,7 @@ import { useTouch } from "../../hooks/use-touch";
|
|
|
93
93
|
import { multiInstanceStore } from "../../providers/spreadsheet-provider";
|
|
94
94
|
import { scrollSubscriber } from "../../signals/scroll-subscriber";
|
|
95
95
|
import { getStringifiedColor } from "../../themes";
|
|
96
|
-
import { fillRangeForSeriesSpec, seedRangeForSeriesSpec } from "../../api/fill-series";
|
|
96
|
+
import { fillRangeForSeriesSpec, seedRangeForSeriesSpec, } from "../../api/fill-series";
|
|
97
97
|
import { Cell as DefaultCell } from "../cell";
|
|
98
98
|
import { CellEditor as DefaultCellEditor } from "../cell-editor";
|
|
99
99
|
import { ContextMenu as DefaultContextMenu } from "../context-menu";
|
|
@@ -117,7 +117,7 @@ import { getNestedPropertyNames } from "./helpers";
|
|
|
117
117
|
/** Where the grid focuses when no cell is given (A1); mirrors spreadsheet-state's `defaultCellCoords` without importing it — that package depends on this one. */
|
|
118
118
|
const defaultCellCoords = { rowIndex: 1, columnIndex: 1 };
|
|
119
119
|
function CanvasGridComponent(props, forwardedRef) {
|
|
120
|
-
const { licenseKey, sheetId, sheetType, ChartSheetView: ChartSheetViewComponent = ChartSheetView, instanceId, activeCell = DEFAULT_ACTIVE_CELL, selections = DEFAULT_ARRAY, frozenColumnCount = 0, frozenRowCount = 0, rowCount = DEFAULT_ROW_COUNT, columnCount = DEFAULT_COLUMN_COUNT, autoFocus, basicFilter, tables, namedRanges, bandedRanges = DEFAULT_ARRAY, tableBorderColor = "#008000", filterIconColor = "#008000", conditionalFormats, showFilterIcon = true, showCalculatedColumnIcon = true, showHeaders = true, defaultColumnWidth = DEFAULT_COLUMN_WIDTH, defaultRowHeight = DEFAULT_ROW_HEIGHT, columnHeaderHeight = COLUMN_HEADER_HEIGHT, rowHeaderWidth = ROW_HEADER_WIDTH, gridLineColor = GRIDLINE_COLOR, cellBackgroundColor = DEFAULT_CELL_BACKGROUND_COLOR, cellColor = DEFAULT_CELL_COLOR, headerBorderColor = DEFAULT_HEADER_BORDER_COLOR, headerBackgroundColor = DEFAULT_HEADER_BG, headerColor = DEFAULT_HEADER_COLOR, headerActiveBackgroundColor = DEFAULT_HEADER_ACTIVE_BG, headerSelectedBackgroundColor = DEFAULT_HEADER_SELECTED_BG, headerSelectedColor = "white", headerTableBackgroundColor = DEFAULT_HEADER_TABLE_BG, headerTableActiveBackgroundColor = DEFAULT_HEADER_ACTIVE_TABLE_BG, headerTableSelectedBackgroundColor = DEFAULT_HEADER_SELECTED_TABLE_BG, frozenShadowColor = headerBorderColor, frozenShadowThickness = 1, selectionBackgroundColor = SELECTION_BG, selectionBorderColor = SELECTION_BORDER, selectionDragBorderColor = SELECTION_BORDER, chartSelectedColor, chipBackgroundColor = CHIP_COLOR, merges = DEFAULT_ARRAY, borderStyles, protectedRanges, isWorkbookProtected: isWorkbookProtectedProp = false, getSheetProtection, pivotTables, charts, onUpdateChart, onChangeZOrder, embeds, slicers, rowMetadata = DEFAULT_ARRAY, columnMetadata = DEFAULT_ARRAY, scale = 1, zoomSpeed = 1, overscanCount = 3, enableEditOnEnterKey = true, enableTextOverflow = true, showGridLines: _showGridLines, showFormulas = false, protectFormulas = false, showFrozenSeparator = true, HeaderCell = DefaultHeaderCell, Cell = DefaultCell, SelectionTitleComponent = SelectionTitle, CellEditor = DefaultCellEditor, CellTooltip, ContextMenu = DefaultContextMenu, ContextMenuWrapper = DefaultContextMenuWrapper, FilterBox = DefaultFilterBox, HeaderMoveDragComponent = DefaultHeaderMoveDragComponent, SuggestionsDropdown, stickyEditor = true, scrollSnap = false, scrollThrottleTimeout, preventBrowserDefaultScroll, mouseMoveThrottleTimeout = 60, tooltipIntentInterval = 60, selectionPolicy, users, userId, renderCollaboratorCursor, functionDescriptions, showHeaderMenuButton = true, scrollbarSize = SCROLLBAR_SIZE, theme = defaultSpreadsheetTheme, showNotes = true, showComments = true, locale, formulaLocale: formulaLocaleProp, agentSuggestions, onReviewSuggestion, onShowFormulas, getDataRowCount, getDataRegion, getChartComponent, getEmbedComponent, getSlicerComponent, onChange, onChangeBatch, onExpandCollapse, onPivotDrillDown, onDelete, onChangeEditorValue, onFill, onRequestCalculate, onChangeActiveCell, onChangeActiveSheet, onChangeSelections, getSheetName, getSheetId, getCellData, getNote: getNoteProp, getTextFormatRuns, getDataValidation, getEffectiveFormat, getFormattedValue: getFormattedValueProp, getTooltipContent, errorResolutionComponent, getEffectiveValue: getEffectiveValueProp, getSparklineGroup, getUserEnteredExtendedValue, getEffectiveExtendedValue, getSheetRowCount, getSheetColumnCount, getCellPopoverContent, onScroll, onViewPortChange, windowConditionalFormats = false, engineConditionalFormatResults = false, onResize, onAutoResize, onHideColumn, onHideRow, onShowColumn, onShowRow, onGroupRows, onUngroupRows, onCollapseRowGroup, onExpandRowGroup, onGroupColumns, onUngroupColumns, onCollapseColumnGroup, onExpandColumnGroup, onSetOutlineDepth, onDeleteRow, onDeleteColumn, onInsertRow, onInsertColumn, onChangeAutoExpandTables, onChangeAutoCalculatedColumns, onInsertCellsShiftDown, onInsertCellsShiftRight, onDeleteCellsShiftLeft, onDeleteCellsShiftUp, onClearContents, onMoveColumns, onMoveRows, onSelectNextSheet, onSelectPreviousSheet, onCreateNewSheet, onKeyDown, onChangeFormatting, onRepeatFormatting, onClearFormatting, onRequestEditProtectedRange, onMoveChart, onResizeChart, onDeleteChart, onCutChart, onCopyChart, onMoveEmbed, onResizeEmbed, onDeleteEmbed, onRequestEditEmbed, onMoveSlicer, onResizeSlicer, onDeleteSlicer, onRequestEditSlicer, onFillRange, disableFillRightShortcut, keymap, onCalculateNow, onRequestGoTo, onMoveSelection, onInsertCutCells, onInsertTime, onInsertDate, onInsertDateTime, onInsertAutoSum, onUndo, onRedo, onPaste, onCopy, onCut, onSortColumn, onSortTable, onFilterTable, onFilterPivot, onResizeTable, onUndoTableAutoExpansion, onUndoCalculatedColumn, onOverwriteCalculatedColumn, onRequestEditTable, onRequestEditPivotTable, onRequestDeletePivotTable, onRequestCreatePivotChart, onRemoveTable, onCreateTable, onRequestCreateTable, onInsertTableColumn, onDeleteTableColumn, onInsertTableRow, onDeleteTableRow, onUpdateTable, onRequestResizeTable, onRequestInsertSlicer, onCreateBasicFilter, onRequestDefineNamedRange, onRequestFormatCells, onRequestConditionalFormat, onRequestDataValidation, onRequestInsertComment, onRequestInsertLink, onFreezeColumn, onFreezeRow, onUpdateNote, onProtectRange, onUnProtectRange, onSortRange, onRequestSearch, onRequestReplace, onRequestResize, getRowHeaderText = getDefaultRowHeader, getColumnHeaderText = getDefaultColumnHeader, getAdditionalCellSpacing, tokenizer: defaultTokenizer = defaultFormulaTokenizer, onChangeScale, onRemoveLink, onSelectLink, onSplitTextToColumns, onRemoveDuplicates, onGoalSeek, onSubtotal, onAdvancedFilter, onRequestExpand, cellExpandPredicate, StructuredResult = DefaultStructuredResult, getMentions, getStructuredProperties: getStructuredPropertiesProp, getFunctionParameterSuggestions, shouldFetchFunctionParameters, MentionTagComponent, MentionDropdownItemComponent, showSelectionResizeHandles = true, enableMagicFill, enableQuickEdit = true, MagicFillComponent, MagicFillContent, QuickEdit, PasteMenu, SuggestionAction, HiddenRowMarkers, HiddenColumnMarkers, enableResizerOverflow, className, defaultFontSizePoint = DEFAULT_FONT_SIZE_PT, readonly, isComparing = false, getCellDiff, enableDataBoundaryNavigation, footerHeight, footerComponent, arrowComponents,
|
|
120
|
+
const { licenseKey, sheetId, sheetType, ChartSheetView: ChartSheetViewComponent = ChartSheetView, instanceId, activeCell = DEFAULT_ACTIVE_CELL, selections = DEFAULT_ARRAY, frozenColumnCount = 0, frozenRowCount = 0, rowCount = DEFAULT_ROW_COUNT, columnCount = DEFAULT_COLUMN_COUNT, autoFocus, basicFilter, tables, namedRanges, bandedRanges = DEFAULT_ARRAY, tableBorderColor = "#008000", filterIconColor = "#008000", conditionalFormats, showFilterIcon = true, showCalculatedColumnIcon = true, showHeaders = true, defaultColumnWidth = DEFAULT_COLUMN_WIDTH, defaultRowHeight = DEFAULT_ROW_HEIGHT, columnHeaderHeight = COLUMN_HEADER_HEIGHT, rowHeaderWidth = ROW_HEADER_WIDTH, gridLineColor = GRIDLINE_COLOR, cellBackgroundColor = DEFAULT_CELL_BACKGROUND_COLOR, cellColor = DEFAULT_CELL_COLOR, headerBorderColor = DEFAULT_HEADER_BORDER_COLOR, headerBackgroundColor = DEFAULT_HEADER_BG, headerColor = DEFAULT_HEADER_COLOR, headerActiveBackgroundColor = DEFAULT_HEADER_ACTIVE_BG, headerSelectedBackgroundColor = DEFAULT_HEADER_SELECTED_BG, headerSelectedColor = "white", headerTableBackgroundColor = DEFAULT_HEADER_TABLE_BG, headerTableActiveBackgroundColor = DEFAULT_HEADER_ACTIVE_TABLE_BG, headerTableSelectedBackgroundColor = DEFAULT_HEADER_SELECTED_TABLE_BG, frozenShadowColor = headerBorderColor, frozenShadowThickness = 1, selectionBackgroundColor = SELECTION_BG, selectionBorderColor = SELECTION_BORDER, selectionDragBorderColor = SELECTION_BORDER, chartSelectedColor, chipBackgroundColor = CHIP_COLOR, merges = DEFAULT_ARRAY, borderStyles, protectedRanges, isWorkbookProtected: isWorkbookProtectedProp = false, getSheetProtection, pivotTables, charts, onUpdateChart, onChangeZOrder, embeds, slicers, rowMetadata = DEFAULT_ARRAY, columnMetadata = DEFAULT_ARRAY, scale = 1, zoomSpeed = 1, overscanCount = 3, enableEditOnEnterKey = true, enableTextOverflow = true, showGridLines: _showGridLines, showFormulas = false, protectFormulas = false, showFrozenSeparator = true, HeaderCell = DefaultHeaderCell, Cell = DefaultCell, SelectionTitleComponent = SelectionTitle, CellEditor = DefaultCellEditor, CellTooltip, ContextMenu = DefaultContextMenu, ContextMenuWrapper = DefaultContextMenuWrapper, FilterBox = DefaultFilterBox, HeaderMoveDragComponent = DefaultHeaderMoveDragComponent, SuggestionsDropdown, stickyEditor = true, scrollSnap = false, scrollThrottleTimeout, preventBrowserDefaultScroll, mouseMoveThrottleTimeout = 60, tooltipIntentInterval = 60, selectionPolicy, users, userId, renderCollaboratorCursor, functionDescriptions, showHeaderMenuButton = true, scrollbarSize = SCROLLBAR_SIZE, theme = defaultSpreadsheetTheme, showNotes = true, showComments = true, locale, formulaLocale: formulaLocaleProp, agentSuggestions, onReviewSuggestion, onShowFormulas, getDataRowCount, getDataRegion, getChartComponent, getEmbedComponent, getSlicerComponent, onChange, onChangeBatch, onExpandCollapse, onPivotDrillDown, onDelete, onChangeEditorValue, onFill, onRequestCalculate, onChangeActiveCell, onChangeActiveSheet, onChangeSelections, getSheetName, getSheetId, getCellData, getNote: getNoteProp, getTextFormatRuns, getDataValidation, getEffectiveFormat, getFormattedValue: getFormattedValueProp, getTooltipContent, errorResolutionComponent, getEffectiveValue: getEffectiveValueProp, getSparklineGroup, getUserEnteredExtendedValue, getEffectiveExtendedValue, getSheetRowCount, getSheetColumnCount, getCellPopoverContent, onScroll, onViewPortChange, windowConditionalFormats = false, engineConditionalFormatResults = false, onResize, onAutoResize, onHideColumn, onHideRow, onShowColumn, onShowRow, onGroupRows, onUngroupRows, onCollapseRowGroup, onExpandRowGroup, onGroupColumns, onUngroupColumns, onCollapseColumnGroup, onExpandColumnGroup, onSetOutlineDepth, onDeleteRow, onDeleteColumn, onInsertRow, onInsertColumn, onChangeAutoExpandTables, onChangeAutoCalculatedColumns, onInsertCellsShiftDown, onInsertCellsShiftRight, onDeleteCellsShiftLeft, onDeleteCellsShiftUp, onClearContents, onMoveColumns, onMoveRows, onSelectNextSheet, onSelectPreviousSheet, onCreateNewSheet, onKeyDown, onChangeFormatting, onRepeatFormatting, onClearFormatting, onRequestEditProtectedRange, onMoveChart, onResizeChart, onDeleteChart, onCutChart, onCopyChart, onMoveEmbed, onResizeEmbed, onDeleteEmbed, onRequestEditEmbed, onMoveSlicer, onResizeSlicer, onDeleteSlicer, onRequestEditSlicer, onFillRange, disableFillRightShortcut, keymap, onCalculateNow, onRequestGoTo, onMoveSelection, onInsertCutCells, onInsertTime, onInsertDate, onInsertDateTime, onInsertAutoSum, onUndo, onRedo, onPaste, onCopy, onCut, onSortColumn, onSortTable, onFilterTable, onFilterPivot, onResizeTable, onUndoTableAutoExpansion, onUndoCalculatedColumn, onOverwriteCalculatedColumn, onRequestEditTable, onRequestEditPivotTable, onRequestDeletePivotTable, onRequestCreatePivotChart, onRemoveTable, onCreateTable, onRequestCreateTable, onInsertTableColumn, onDeleteTableColumn, onInsertTableRow, onDeleteTableRow, onUpdateTable, onRequestResizeTable, onRequestInsertSlicer, onCreateBasicFilter, onRequestDefineNamedRange, onRequestFormatCells, onRequestConditionalFormat, onRequestDataValidation, onRequestInsertComment, onRequestInsertLink, onFreezeColumn, onFreezeRow, onUpdateNote, onProtectRange, onUnProtectRange, onSortRange, onRequestSearch, onRequestReplace, onRequestResize, getRowHeaderText = getDefaultRowHeader, getColumnHeaderText = getDefaultColumnHeader, getAdditionalCellSpacing, tokenizer: defaultTokenizer = defaultFormulaTokenizer, onChangeScale, onRemoveLink, onSelectLink, onSplitTextToColumns, onRemoveDuplicates, onGoalSeek, onSubtotal, onAdvancedFilter, onRequestExpand, cellExpandPredicate, StructuredResult = DefaultStructuredResult, getMentions, getStructuredProperties: getStructuredPropertiesProp, getFunctionParameterSuggestions, shouldFetchFunctionParameters, MentionTagComponent, MentionDropdownItemComponent, showSelectionResizeHandles = true, enableMagicFill, enableQuickEdit = true, MagicFillComponent, MagicFillContent, QuickEdit, PasteMenu, SuggestionAction, HiddenRowMarkers, HiddenColumnMarkers, enableResizerOverflow, className, defaultFontSizePoint = DEFAULT_FONT_SIZE_PT, defaultCellFormat, readonly, isComparing = false, getCellDiff, enableDataBoundaryNavigation, footerHeight, footerComponent, arrowComponents,
|
|
121
121
|
// Host-driven filter props. `hostHiddenRowRanges`
|
|
122
122
|
// supplies compact [start, end] hidden-row tuples; `getFilterValues` supplies a
|
|
123
123
|
// column's distinct values. Both let a million-row filter render without scanning
|
|
@@ -129,7 +129,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
129
129
|
// defaults to `getFormattedValue` inside `useGetValuesFromRange`.
|
|
130
130
|
getValidationSourceValue,
|
|
131
131
|
// Unused props only for api
|
|
132
|
-
onChangeBorder, onDuplicateSheet, onCreateConditionalFormattingRule, onDeleteConditionalFormattingRule, onUpdateConditionalFormattingRule, onCreateDataValidationRule, onUpdateDataValidationRule, onDeleteDataValidationRule, onCreateChart, onDeleteSheet, onCreateEmbed, onDecreaseIndent, onIncreaseIndent, onChangeTheme, onChangeDecimals, onUpdateSheet, onChangeBatchStream, onBlur, ...rest } = props;
|
|
132
|
+
getDataColumnCount, onDeleteNamedRange, onChangeBorder, onDuplicateSheet, onCreateConditionalFormattingRule, onDeleteConditionalFormattingRule, onUpdateConditionalFormattingRule, onCreateDataValidationRule, onUpdateDataValidationRule, onDeleteDataValidationRule, onCreateChart, onDeleteSheet, onCreateEmbed, onDecreaseIndent, onIncreaseIndent, onChangeTheme, onChangeDecimals, onUpdateSheet, onChangeBatchStream, onBlur, ...rest } = props;
|
|
133
133
|
/**
|
|
134
134
|
* Fire onBlur only when the cell editor blurs to an element outside the
|
|
135
135
|
* spreadsheet. Routed through `useEditable` so we hook the always-focused
|
|
@@ -1106,6 +1106,26 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
1106
1106
|
*
|
|
1107
1107
|
* We are generating conditionalFormatting on the component level,
|
|
1108
1108
|
*/
|
|
1109
|
+
// The workbook's default font — Excel's `Normal` style when the host
|
|
1110
|
+
// supplies one (#1117), else the theme body font at the default size. The
|
|
1111
|
+
// painter, the sizer, the editor and the keyboard font-size step all read
|
|
1112
|
+
// these so they agree on what an unformatted cell looks like.
|
|
1113
|
+
const defaultFontFamily = defaultCellFormat?.textFormat?.fontFamily ?? theme.primaryFontFamily;
|
|
1114
|
+
const defaultFontSize = defaultCellFormat?.textFormat?.fontSize ?? defaultFontSizePoint;
|
|
1115
|
+
const defaultCellTextFormat = useMemo(() => ({
|
|
1116
|
+
...defaultCellFormat?.textFormat,
|
|
1117
|
+
fontFamily: defaultFontFamily,
|
|
1118
|
+
fontSize: defaultFontSize,
|
|
1119
|
+
}), [defaultCellFormat, defaultFontFamily, defaultFontSize]);
|
|
1120
|
+
// The non-text part of the workbook default (borders, fill, number format,
|
|
1121
|
+
// alignment) — almost always empty, in which case the per-cell merge below
|
|
1122
|
+
// stays exactly the pre-#1117 two-source merge.
|
|
1123
|
+
const defaultCellFormatRest = useMemo(() => {
|
|
1124
|
+
if (!defaultCellFormat)
|
|
1125
|
+
return undefined;
|
|
1126
|
+
const { textFormat: _textFormat, ...rest } = defaultCellFormat;
|
|
1127
|
+
return Object.keys(rest).length ? rest : undefined;
|
|
1128
|
+
}, [defaultCellFormat]);
|
|
1109
1129
|
const getEffectiveCellFormat = useCallback((sheetId, rowIndex, columnIndex) => {
|
|
1110
1130
|
const cellFormat = getCellFormat(sheetId, rowIndex, columnIndex);
|
|
1111
1131
|
const isHyperlink = Boolean(getHyperlink(sheetId, rowIndex, columnIndex));
|
|
@@ -1145,24 +1165,30 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
1145
1165
|
// Final text format. Hyperlink cells auto-derive underline at paint
|
|
1146
1166
|
// time — `uf.textFormat.underline` is merged on top below, so a user
|
|
1147
1167
|
// who explicitly sets underline=false still wins.
|
|
1168
|
+
// The workbook default (Excel's Normal style, #1117) is folded in by a
|
|
1169
|
+
// shallow spread — this runs per cell per paint, so no extra deep merge.
|
|
1148
1170
|
const defaultTextFormat = {
|
|
1171
|
+
...defaultCellTextFormat,
|
|
1149
1172
|
bold: bandedCellFormat?.textFormat?.bold ??
|
|
1150
1173
|
(isTableHeader(rowIndex, columnIndex) &&
|
|
1151
1174
|
isTableHeaderThemed(rowIndex, columnIndex)
|
|
1152
1175
|
? true
|
|
1153
|
-
:
|
|
1154
|
-
fontFamily: theme.primaryFontFamily,
|
|
1176
|
+
: defaultCellTextFormat.bold),
|
|
1155
1177
|
color: isHyperlink
|
|
1156
1178
|
? theme.themeColors.hyperlink
|
|
1157
1179
|
: patternColor ??
|
|
1158
1180
|
bandedCellFormat?.textFormat?.color ??
|
|
1159
1181
|
conditionalFormatColor ??
|
|
1160
|
-
getStringifiedColor(cellColor, theme),
|
|
1161
|
-
underline: isHyperlink ? true :
|
|
1182
|
+
getStringifiedColor(defaultCellTextFormat.color ?? cellColor, theme),
|
|
1183
|
+
underline: isHyperlink ? true : defaultCellTextFormat.underline,
|
|
1162
1184
|
};
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1185
|
+
// `merge` mutates its first argument, so the target is always a fresh
|
|
1186
|
+
// object; a Normal style with non-text fields adds one more source.
|
|
1187
|
+
const mergedFormat = defaultCellFormatRest
|
|
1188
|
+
? merge({ textFormat: defaultTextFormat }, defaultCellFormatRest, definedProps(cellFormat), conditionalCellFormat)
|
|
1189
|
+
: merge({
|
|
1190
|
+
textFormat: defaultTextFormat,
|
|
1191
|
+
}, definedProps(cellFormat), conditionalCellFormat);
|
|
1166
1192
|
// Number-format section colors beat the cell's font color (Excel
|
|
1167
1193
|
// parity), but never a conditional-format font color or the
|
|
1168
1194
|
// hyperlink color.
|
|
@@ -1188,6 +1214,8 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
1188
1214
|
getEffectiveValue,
|
|
1189
1215
|
theme,
|
|
1190
1216
|
cellColor,
|
|
1217
|
+
defaultCellTextFormat,
|
|
1218
|
+
defaultCellFormatRest,
|
|
1191
1219
|
]);
|
|
1192
1220
|
/**
|
|
1193
1221
|
* Get horizontal alignment of editor
|
|
@@ -1224,8 +1252,8 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
1224
1252
|
return HEADER_TEXT_FORMAT;
|
|
1225
1253
|
}
|
|
1226
1254
|
return (getEffectiveCellFormat?.(sheetId, rowIndex, columnIndex)?.textFormat ??
|
|
1227
|
-
|
|
1228
|
-
}, [getEffectiveCellFormat, isRowHeader, isColumnHeader]);
|
|
1255
|
+
defaultCellTextFormat);
|
|
1256
|
+
}, [getEffectiveCellFormat, isRowHeader, isColumnHeader, defaultCellTextFormat]);
|
|
1229
1257
|
/**
|
|
1230
1258
|
* Get cell selections from structured tables
|
|
1231
1259
|
*/
|
|
@@ -1284,7 +1312,9 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
1284
1312
|
editingCellCoordinate,
|
|
1285
1313
|
sheetId,
|
|
1286
1314
|
activeCell,
|
|
1287
|
-
tokenizer: formulaLocale.isCanonical
|
|
1315
|
+
tokenizer: formulaLocale.isCanonical
|
|
1316
|
+
? defaultTokenizer
|
|
1317
|
+
: localeTokenizerBase,
|
|
1288
1318
|
});
|
|
1289
1319
|
// Helper function to convert a selection to readable selection address
|
|
1290
1320
|
const [getAddressFromSelection, getR1C1AddressFromSelection] = useCreateAddressFromSelection({
|
|
@@ -1587,13 +1617,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
1587
1617
|
return false;
|
|
1588
1618
|
}
|
|
1589
1619
|
return true;
|
|
1590
|
-
}, [
|
|
1591
|
-
getEffectiveCellFormat,
|
|
1592
|
-
isRowHeader,
|
|
1593
|
-
isColumnHeader,
|
|
1594
|
-
isMergedCell,
|
|
1595
|
-
sheetId,
|
|
1596
|
-
]);
|
|
1620
|
+
}, [getEffectiveCellFormat, isRowHeader, isColumnHeader, isMergedCell, sheetId]);
|
|
1597
1621
|
/**
|
|
1598
1622
|
* Row height getter
|
|
1599
1623
|
*/
|
|
@@ -1850,7 +1874,9 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
1850
1874
|
columnCount,
|
|
1851
1875
|
rowCount,
|
|
1852
1876
|
getDataRowCount,
|
|
1853
|
-
|
|
1877
|
+
// Measure with the same font the painter draws with (#1117).
|
|
1878
|
+
fontFamily: defaultFontFamily,
|
|
1879
|
+
fontSize: defaultFontSize,
|
|
1854
1880
|
resizeStrategy: "full",
|
|
1855
1881
|
});
|
|
1856
1882
|
/**
|
|
@@ -1893,7 +1919,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
1893
1919
|
const editingSheetName = getSheetName?.(editingSheetId);
|
|
1894
1920
|
const effectiveValue = getEffectiveValue(editingSheetId, rowIndex, columnIndex);
|
|
1895
1921
|
const horizontalAlignment = getEditorHorizontalAlignment(editingSheetId, rowIndex, columnIndex);
|
|
1896
|
-
return (React.createElement(CellEditor, { ...props, locale: locale, effectiveValue: effectiveValue, format: cellFormat, dataValidation: dataValidation, getRangeValues: getFormattedValuesFromAddress, getRangeValuesAsync: getFormattedValuesFromAddressAsync, scale: scale, sheetName: sheetName, editingSheetId: editingSheetId, sheetId: sheetId, editingSheetName: editingSheetName, address: address, theme: theme, tokenizer: localeTokenizer, formulaLocale: formulaLocale, horizontalAlignment: horizontalAlignment, defaultBackgroundColor: cellBackgroundColor, defaultTextColor: getStringifiedColor(cellColor, theme), functionDescriptions: localizedFunctionDescriptions, getNamedRanges: getNamedRanges, getTableNames: getTableNames, getStructuredProperties: getStructuredProperties, getTableColumnNames: getTableColumnNames, showFormulaHelp: showFormulaHelp, onHideFormulaHelp: onHideFormulaHelp, onShowFormulaHelp: onShowFormulaHelp, onRequestCalculate: onRequestCalculate, SuggestionsDropdown: SuggestionsDropdown, stickyEditor: stickyEditor, defaultFontSizePoint:
|
|
1922
|
+
return (React.createElement(CellEditor, { ...props, locale: locale, effectiveValue: effectiveValue, format: cellFormat, dataValidation: dataValidation, getRangeValues: getFormattedValuesFromAddress, getRangeValuesAsync: getFormattedValuesFromAddressAsync, scale: scale, sheetName: sheetName, editingSheetId: editingSheetId, sheetId: sheetId, editingSheetName: editingSheetName, address: address, theme: theme, tokenizer: localeTokenizer, formulaLocale: formulaLocale, horizontalAlignment: horizontalAlignment, defaultBackgroundColor: cellBackgroundColor, defaultTextColor: getStringifiedColor(cellColor, theme), functionDescriptions: localizedFunctionDescriptions, getNamedRanges: getNamedRanges, getTableNames: getTableNames, getStructuredProperties: getStructuredProperties, getTableColumnNames: getTableColumnNames, showFormulaHelp: showFormulaHelp, onHideFormulaHelp: onHideFormulaHelp, onShowFormulaHelp: onShowFormulaHelp, onRequestCalculate: onRequestCalculate, SuggestionsDropdown: SuggestionsDropdown, stickyEditor: stickyEditor, defaultFontSizePoint: defaultFontSize, getMentions: getMentions, getFunctionParameterSuggestions: getFunctionParameterSuggestions, shouldFetchFunctionParameters: shouldFetchFunctionParameters, MentionTagComponent: MentionTagComponent, MentionDropdownItemComponent: MentionDropdownItemComponent }));
|
|
1897
1923
|
}, [
|
|
1898
1924
|
scale,
|
|
1899
1925
|
getEffectiveCellFormat,
|
|
@@ -1995,7 +2021,9 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
1995
2021
|
if (++visited > 256)
|
|
1996
2022
|
return false;
|
|
1997
2023
|
const uf = getCellData?.(fillSheetId, r, c)?.userEnteredFormat;
|
|
1998
|
-
const type = (uf && "numberFormat" in uf
|
|
2024
|
+
const type = (uf && "numberFormat" in uf
|
|
2025
|
+
? uf.numberFormat?.type
|
|
2026
|
+
: undefined) ??
|
|
1999
2027
|
getEffectiveFormat?.(fillSheetId, r, c)?.numberFormat?.type;
|
|
2000
2028
|
if (type === "DATE" || type === "DATE_TIME")
|
|
2001
2029
|
return true;
|
|
@@ -2129,7 +2157,9 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
2129
2157
|
if (plan) {
|
|
2130
2158
|
// Both engines accept the paint-format shape (format grid + replace);
|
|
2131
2159
|
// the grid prop type only names the key/value overload.
|
|
2132
|
-
onChangeFormatting?.(sheetId, activeCell, plan.selections, plan.formats, {
|
|
2160
|
+
onChangeFormatting?.(sheetId, activeCell, plan.selections, plan.formats, {
|
|
2161
|
+
replace: true,
|
|
2162
|
+
});
|
|
2133
2163
|
}
|
|
2134
2164
|
else {
|
|
2135
2165
|
clearBand();
|
|
@@ -2292,7 +2322,9 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
2292
2322
|
const openFillSeriesDialogFor = useCallback((target, initialIn) => {
|
|
2293
2323
|
const selection = target ??
|
|
2294
2324
|
selections[selections.length - 1] ??
|
|
2295
|
-
{
|
|
2325
|
+
{
|
|
2326
|
+
range: cellToArea(activeCell),
|
|
2327
|
+
};
|
|
2296
2328
|
openFillSeriesDialog({
|
|
2297
2329
|
sheetId,
|
|
2298
2330
|
activeCell,
|
|
@@ -2328,7 +2360,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
2328
2360
|
*/
|
|
2329
2361
|
const openMoveOverwriteConfirm = useOpenMoveOverwriteConfirm();
|
|
2330
2362
|
const isMoveOverwriteConfirmMounted = useIsMoveOverwriteConfirmMounted();
|
|
2331
|
-
const confirmMoveOverwrite = useMemo(() =>
|
|
2363
|
+
const confirmMoveOverwrite = useMemo(() => isMoveOverwriteConfirmMounted ? openMoveOverwriteConfirm : undefined, [isMoveOverwriteConfirmMounted, openMoveOverwriteConfirm]);
|
|
2332
2364
|
/**
|
|
2333
2365
|
* Fill handle dragged BACK inside the selection (Excel): the dragged-over cells lose their
|
|
2334
2366
|
* contents — formats stay unless Ctrl/Cmd was held — through the same `onDelete` path as the
|
|
@@ -2411,7 +2443,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
2411
2443
|
onCutChart,
|
|
2412
2444
|
focusSheet,
|
|
2413
2445
|
});
|
|
2414
|
-
const { copyChart, cutChart, pasteChart, duplicateChart, clearChartClipboard } = chartClipboard;
|
|
2446
|
+
const { copyChart, cutChart, pasteChart, duplicateChart, clearChartClipboard, } = chartClipboard;
|
|
2415
2447
|
const handleEditorCopy = useCallback((e) => {
|
|
2416
2448
|
clearChartClipboard();
|
|
2417
2449
|
onInternalCopy(e);
|
|
@@ -2454,7 +2486,8 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
2454
2486
|
startRowIndex: activeCell.rowIndex,
|
|
2455
2487
|
startColumnIndex: activeCell.columnIndex,
|
|
2456
2488
|
endRowIndex: activeCell.rowIndex + (range.endRowIndex - range.startRowIndex),
|
|
2457
|
-
endColumnIndex: activeCell.columnIndex +
|
|
2489
|
+
endColumnIndex: activeCell.columnIndex +
|
|
2490
|
+
(range.endColumnIndex - range.startColumnIndex),
|
|
2458
2491
|
},
|
|
2459
2492
|
};
|
|
2460
2493
|
onInsertCutCells?.(sheetId, from, to);
|
|
@@ -2917,7 +2950,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
2917
2950
|
onShowRow,
|
|
2918
2951
|
onAddQuickEdit,
|
|
2919
2952
|
isSheetFocused,
|
|
2920
|
-
defaultFontSizePoint,
|
|
2953
|
+
defaultFontSizePoint: defaultFontSize,
|
|
2921
2954
|
});
|
|
2922
2955
|
/**
|
|
2923
2956
|
* Bind to keydown events
|
|
@@ -3390,12 +3423,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
3390
3423
|
onMouseDownEditable(event);
|
|
3391
3424
|
// // Hide filter
|
|
3392
3425
|
hideFilter();
|
|
3393
|
-
}, [
|
|
3394
|
-
hideFilter,
|
|
3395
|
-
onPointerDownSelection,
|
|
3396
|
-
onMouseDownEditable,
|
|
3397
|
-
onMouseDownCharts,
|
|
3398
|
-
]);
|
|
3426
|
+
}, [hideFilter, onPointerDownSelection, onMouseDownEditable, onMouseDownCharts]);
|
|
3399
3427
|
/**
|
|
3400
3428
|
* Keep focus on the editor
|
|
3401
3429
|
*/
|
|
@@ -3551,7 +3579,7 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
3551
3579
|
onFilterClick: handleFilterClick,
|
|
3552
3580
|
onCheckboxClick: handleCheckboxClick,
|
|
3553
3581
|
onExpandCollapse: handleExpandCollapse,
|
|
3554
|
-
defaultFontSizePoint,
|
|
3582
|
+
defaultFontSizePoint: defaultFontSize,
|
|
3555
3583
|
Cell,
|
|
3556
3584
|
HeaderCell,
|
|
3557
3585
|
theme,
|
|
@@ -217,6 +217,16 @@ export type CanvasGridProps<T extends CellData = CellData<any, any>> = {
|
|
|
217
217
|
* Default font size in points
|
|
218
218
|
*/
|
|
219
219
|
defaultFontSizePoint?: number;
|
|
220
|
+
/**
|
|
221
|
+
* Workbook-level default cell format — Excel's `Normal` style
|
|
222
|
+
* (`cellStyleXfs[0]` → `fonts[0]`). Every cell's own format is layered on
|
|
223
|
+
* top of it, and painting, measuring, editing and new cells use its font
|
|
224
|
+
* instead of `theme.primaryFontFamily` / `defaultFontSizePoint`, so an
|
|
225
|
+
* importer no longer has to copy the workbook font into every cell.
|
|
226
|
+
* `useSpreadsheetState` derives it from `namedCellStyles` as
|
|
227
|
+
* `defaultCellFormat`.
|
|
228
|
+
*/
|
|
229
|
+
defaultCellFormat?: Maybe<CellFormat>;
|
|
220
230
|
/**
|
|
221
231
|
* Default row height
|
|
222
232
|
*/
|