@rowsncolumns/spreadsheet 10.2.75 → 10.2.76
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 +38 -0
- package/dist/cjs/api/fill-series.d.ts.map +1 -0
- package/dist/cjs/api/fill-series.js +89 -0
- package/dist/cjs/api/spreadsheet-api.d.ts +6 -2
- package/dist/cjs/api/spreadsheet-api.d.ts.map +1 -1
- package/dist/cjs/api/spreadsheet-api.js +9 -3
- package/dist/cjs/atoms/fill-options.atom.d.ts +36 -0
- package/dist/cjs/atoms/fill-options.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/fill-options.atom.js +11 -0
- package/dist/cjs/atoms/fill-series-dialog.atom.d.ts +26 -0
- package/dist/cjs/atoms/fill-series-dialog.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/fill-series-dialog.atom.js +14 -0
- package/dist/cjs/atoms/index.d.ts +2 -0
- package/dist/cjs/atoms/index.d.ts.map +1 -1
- package/dist/cjs/atoms/index.js +2 -0
- package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/cjs/components/canvas-grid/index.js +224 -50
- package/dist/cjs/components/canvas-grid/typings.d.ts +13 -4
- package/dist/cjs/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/cjs/components/cell-editor/helpers.d.ts +9 -0
- package/dist/cjs/components/cell-editor/helpers.d.ts.map +1 -1
- package/dist/cjs/components/cell-editor/helpers.js +8 -1
- package/dist/cjs/components/cell-editor/helpers.spec.js +14 -0
- package/dist/cjs/components/cell-editor/index.d.ts.map +1 -1
- package/dist/cjs/components/cell-editor/index.js +6 -3
- package/dist/cjs/components/fill-series-dialog/index.d.ts +29 -0
- package/dist/cjs/components/fill-series-dialog/index.d.ts.map +1 -0
- package/dist/cjs/components/fill-series-dialog/index.js +156 -0
- package/dist/cjs/components/selection/fill-options-menu.d.ts +32 -0
- package/dist/cjs/components/selection/fill-options-menu.d.ts.map +1 -0
- package/dist/cjs/components/selection/fill-options-menu.js +65 -0
- package/dist/cjs/components/selection/index.d.ts +1 -1
- package/dist/cjs/components/selection/index.d.ts.map +1 -1
- package/dist/cjs/components/selection/index.js +4 -2
- package/dist/cjs/components/selection/types.d.ts +11 -1
- package/dist/cjs/components/selection/types.d.ts.map +1 -1
- package/dist/cjs/components/toolbar/text-format-selector.d.ts +9 -0
- package/dist/cjs/components/toolbar/text-format-selector.d.ts.map +1 -1
- package/dist/cjs/components/toolbar/text-format-selector.js +15 -3
- package/dist/cjs/hooks/use-editable.d.ts +11 -2
- package/dist/cjs/hooks/use-editable.d.ts.map +1 -1
- package/dist/cjs/hooks/use-editable.js +8 -0
- package/dist/cjs/hooks/use-editor-submit.d.ts +32 -3
- package/dist/cjs/hooks/use-editor-submit.d.ts.map +1 -1
- package/dist/cjs/hooks/use-editor-submit.js +111 -2
- package/dist/cjs/hooks/use-keyboard-handler.d.ts.map +1 -1
- package/dist/cjs/hooks/use-keyboard-handler.js +3 -2
- package/dist/cjs/hooks/use-selection-renderer.d.ts +13 -2
- package/dist/cjs/hooks/use-selection-renderer.d.ts.map +1 -1
- package/dist/cjs/hooks/use-selection-renderer.js +21 -4
- package/dist/cjs/hooks/use-selection.d.ts +54 -4
- package/dist/cjs/hooks/use-selection.d.ts.map +1 -1
- package/dist/cjs/hooks/use-selection.js +232 -37
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/release-date.js +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/cjs/types.d.ts +39 -1
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/esm/api/fill-series.d.ts +38 -0
- package/dist/esm/api/fill-series.d.ts.map +1 -0
- package/dist/esm/api/fill-series.js +78 -0
- package/dist/esm/api/spreadsheet-api.d.ts +6 -2
- package/dist/esm/api/spreadsheet-api.d.ts.map +1 -1
- package/dist/esm/api/spreadsheet-api.js +8 -3
- package/dist/esm/atoms/fill-options.atom.d.ts +36 -0
- package/dist/esm/atoms/fill-options.atom.d.ts.map +1 -0
- package/dist/esm/atoms/fill-options.atom.js +5 -0
- package/dist/esm/atoms/fill-series-dialog.atom.d.ts +26 -0
- package/dist/esm/atoms/fill-series-dialog.atom.d.ts.map +1 -0
- package/dist/esm/atoms/fill-series-dialog.atom.js +9 -0
- package/dist/esm/atoms/index.d.ts +2 -0
- package/dist/esm/atoms/index.d.ts.map +1 -1
- package/dist/esm/atoms/index.js +2 -0
- package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/esm/components/canvas-grid/index.js +167 -6
- package/dist/esm/components/canvas-grid/typings.d.ts +13 -4
- package/dist/esm/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/esm/components/cell-editor/helpers.d.ts +9 -0
- package/dist/esm/components/cell-editor/helpers.d.ts.map +1 -1
- package/dist/esm/components/cell-editor/helpers.js +6 -0
- package/dist/esm/components/cell-editor/helpers.spec.js +15 -1
- package/dist/esm/components/cell-editor/index.d.ts.map +1 -1
- package/dist/esm/components/cell-editor/index.js +7 -4
- package/dist/esm/components/fill-series-dialog/index.d.ts +29 -0
- package/dist/esm/components/fill-series-dialog/index.d.ts.map +1 -0
- package/dist/esm/components/fill-series-dialog/index.js +151 -0
- package/dist/esm/components/selection/fill-options-menu.d.ts +32 -0
- package/dist/esm/components/selection/fill-options-menu.d.ts.map +1 -0
- package/dist/esm/components/selection/fill-options-menu.js +63 -0
- package/dist/esm/components/selection/index.d.ts +1 -1
- package/dist/esm/components/selection/index.d.ts.map +1 -1
- package/dist/esm/components/selection/index.js +4 -2
- package/dist/esm/components/selection/types.d.ts +11 -1
- package/dist/esm/components/selection/types.d.ts.map +1 -1
- package/dist/esm/components/toolbar/text-format-selector.d.ts +9 -0
- package/dist/esm/components/toolbar/text-format-selector.d.ts.map +1 -1
- package/dist/esm/components/toolbar/text-format-selector.js +14 -2
- package/dist/esm/hooks/use-editable.d.ts +11 -2
- package/dist/esm/hooks/use-editable.d.ts.map +1 -1
- package/dist/esm/hooks/use-editable.js +8 -0
- package/dist/esm/hooks/use-editor-submit.d.ts +32 -3
- package/dist/esm/hooks/use-editor-submit.d.ts.map +1 -1
- package/dist/esm/hooks/use-editor-submit.js +82 -3
- package/dist/esm/hooks/use-keyboard-handler.d.ts.map +1 -1
- package/dist/esm/hooks/use-keyboard-handler.js +3 -2
- package/dist/esm/hooks/use-selection-renderer.d.ts +13 -2
- package/dist/esm/hooks/use-selection-renderer.d.ts.map +1 -1
- package/dist/esm/hooks/use-selection-renderer.js +22 -5
- package/dist/esm/hooks/use-selection.d.ts +54 -4
- package/dist/esm/hooks/use-selection.d.ts.map +1 -1
- package/dist/esm/hooks/use-selection.js +220 -36
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/release-date.js +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/types.d.ts +39 -1
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/spreadsheet.min.css +1 -1
- package/package.json +4 -4
|
@@ -9,8 +9,11 @@ var atoms_1 = require("../atoms");
|
|
|
9
9
|
var formula_mode_atom_1 = require("../atoms/formula-mode.atom");
|
|
10
10
|
var config_1 = require("../config");
|
|
11
11
|
var selection_1 = require("./../components/selection");
|
|
12
|
+
/** Excel greys the cells a fill-handle drag-back is about to clear. */
|
|
13
|
+
var FILL_SHRINK_COLOR = "#808080";
|
|
14
|
+
var FILL_SHRINK_OPACITY = 0.25;
|
|
12
15
|
var useSelectionRenderer = function (_a) {
|
|
13
|
-
var sheetId = _a.sheetId, selectionCount = _a.selectionCount, selectionBackgroundColor = _a.selectionBackgroundColor, selectionBorderColor = _a.selectionBorderColor, onSelectionMouseDown = _a.onSelectionMouseDown, onChangeActiveCell = _a.onChangeActiveCell, onChangeSelections = _a.onChangeSelections, onRequestEditTable = _a.onRequestEditTable, onRequestEditPivotTable = _a.onRequestEditPivotTable, onMouseDownResizeHandle = _a.onMouseDownResizeHandle, onMouseDownMoveSelection = _a.onMouseDownMoveSelection, isDraggingMoveSelection = _a.isDraggingMoveSelection, onFlashEnd = _a.onFlashEnd, getSheetName = _a.getSheetName, _b = _a.resizeHandleSize, resizeHandleSize = _b === void 0 ? 6 : _b, showSelectionResizeHandles = _a.showSelectionResizeHandles, resizeHandleBorderColor = _a.resizeHandleBorderColor, SelectionTitleComponent = _a.SelectionTitleComponent, isResizingTable = _a.isResizingTable, fillHandleSize = _a.fillHandleSize, showFillHandle = _a.showFillHandle, enableMagicFill = _a.enableMagicFill, MagicFillComponent = _a.MagicFillComponent, MagicFillContent = _a.MagicFillContent, readonly = _a.readonly, showPasteMenu = _a.showPasteMenu, hoveredCell = _a.hoveredCell, onSplitTextToColumns = _a.onSplitTextToColumns, onRemoveQuickEdit = _a.onRemoveQuickEdit, onAddQuickEdit = _a.onAddQuickEdit, QuickEdit = _a.QuickEdit, PasteMenu = _a.PasteMenu, SuggestionAction = _a.SuggestionAction, cachedHoveredSelectionIds = _a.cachedHoveredSelectionIds;
|
|
16
|
+
var sheetId = _a.sheetId, selectionCount = _a.selectionCount, selectionBackgroundColor = _a.selectionBackgroundColor, selectionBorderColor = _a.selectionBorderColor, onSelectionMouseDown = _a.onSelectionMouseDown, onChangeActiveCell = _a.onChangeActiveCell, onChangeSelections = _a.onChangeSelections, onRequestEditTable = _a.onRequestEditTable, onRequestEditPivotTable = _a.onRequestEditPivotTable, onMouseDownResizeHandle = _a.onMouseDownResizeHandle, onMouseDownMoveSelection = _a.onMouseDownMoveSelection, isDraggingMoveSelection = _a.isDraggingMoveSelection, onFlashEnd = _a.onFlashEnd, getSheetName = _a.getSheetName, _b = _a.resizeHandleSize, resizeHandleSize = _b === void 0 ? 6 : _b, showSelectionResizeHandles = _a.showSelectionResizeHandles, resizeHandleBorderColor = _a.resizeHandleBorderColor, SelectionTitleComponent = _a.SelectionTitleComponent, isResizingTable = _a.isResizingTable, fillHandleSize = _a.fillHandleSize, showFillHandle = _a.showFillHandle, enableMagicFill = _a.enableMagicFill, MagicFillComponent = _a.MagicFillComponent, MagicFillContent = _a.MagicFillContent, readonly = _a.readonly, showPasteMenu = _a.showPasteMenu, fillOptions = _a.fillOptions, onChooseFillType = _a.onChooseFillType, onOpenFillSeriesDialog = _a.onOpenFillSeriesDialog, onCloseFillOptions = _a.onCloseFillOptions, hoveredCell = _a.hoveredCell, onSplitTextToColumns = _a.onSplitTextToColumns, onRemoveQuickEdit = _a.onRemoveQuickEdit, onAddQuickEdit = _a.onAddQuickEdit, QuickEdit = _a.QuickEdit, PasteMenu = _a.PasteMenu, SuggestionAction = _a.SuggestionAction, cachedHoveredSelectionIds = _a.cachedHoveredSelectionIds, _c = _a.isFillShrink, isFillShrink = _c === void 0 ? false : _c;
|
|
14
17
|
var formulaMode = (0, formula_mode_atom_1.useFormulaModeValue)();
|
|
15
18
|
var selectionIndex = (0, atoms_1.useFormulaSelectionIndex)();
|
|
16
19
|
var hoveredCellRef = (0, react_1.useRef)(hoveredCell);
|
|
@@ -52,13 +55,17 @@ var useSelectionRenderer = function (_a) {
|
|
|
52
55
|
: (0, selections_1.getSelectionStrokeWidth)(formulaMode, isFill, isActiveCell, isResizingTable);
|
|
53
56
|
var fillOpacity = isBorder
|
|
54
57
|
? props.fillOpacity
|
|
55
|
-
:
|
|
58
|
+
: isFill && isFillShrink
|
|
59
|
+
? FILL_SHRINK_OPACITY
|
|
60
|
+
: (0, selections_1.getSelectionFillOpacity)(formulaMode, isFill);
|
|
56
61
|
var stroke = isBorder
|
|
57
62
|
? props.stroke
|
|
58
63
|
: (0, selections_1.getSelectionStroke)(formulaMode, isFill, isActiveCell, isEmptySelections, inProgress, selectionBorderColor, index);
|
|
59
64
|
var fill = isBorder
|
|
60
65
|
? props.fill
|
|
61
|
-
:
|
|
66
|
+
: isFill && isFillShrink
|
|
67
|
+
? FILL_SHRINK_COLOR
|
|
68
|
+
: (0, selections_1.getSelectionFill)(formulaMode, isFill, isActiveCell, selectionBackgroundColor, index, isActiveIndex, isResizingTable);
|
|
62
69
|
return (react_1.default.createElement(selection_1.Selection, tslib_1.__assign({}, props, { key: index,
|
|
63
70
|
// Overwrite draggable
|
|
64
71
|
draggable: isResizingTable ? false : draggable,
|
|
@@ -91,7 +98,12 @@ var useSelectionRenderer = function (_a) {
|
|
|
91
98
|
onSelectionMouseDown === null || onSelectionMouseDown === void 0 ? void 0 : onSelectionMouseDown(e, activeCell, newSelection, 0);
|
|
92
99
|
}
|
|
93
100
|
}
|
|
94
|
-
}, isHovered: isHovered, TitleComponent: SelectionTitleComponent, onRequestEditTable: onRequestEditTable, onRequestEditPivotTable: onRequestEditPivotTable, fillHandleSize: fillHandleSize, showFillHandle: showFillHandle, onFlashEnd: onFlashEnd, duration: duration, enableMagicFill: formulaMode ? false : enableMagicFill, MagicFillComponent: MagicFillComponent, readonly: readonly, showPasteMenu: showPasteMenu,
|
|
101
|
+
}, isHovered: isHovered, TitleComponent: SelectionTitleComponent, onRequestEditTable: onRequestEditTable, onRequestEditPivotTable: onRequestEditPivotTable, fillHandleSize: fillHandleSize, showFillHandle: showFillHandle, onFlashEnd: onFlashEnd, duration: duration, enableMagicFill: formulaMode ? false : enableMagicFill, MagicFillComponent: MagicFillComponent, readonly: readonly, showPasteMenu: showPasteMenu, fillOptions: fillOptions &&
|
|
102
|
+
range &&
|
|
103
|
+
fillOptions.sheetId === sheetId &&
|
|
104
|
+
(0, grid_1.isAreasEqual)(fillOptions.fillSelection.range, range)
|
|
105
|
+
? fillOptions
|
|
106
|
+
: undefined, onChooseFillType: onChooseFillType, onOpenFillSeriesDialog: onOpenFillSeriesDialog, onCloseFillOptions: onCloseFillOptions, sheetId: sheetId, MagicFillContent: MagicFillContent, QuickEdit: QuickEdit, PasteMenu: PasteMenu, SuggestionAction: SuggestionAction, onSplitTextToColumns: function (delimiter) {
|
|
95
107
|
// Active cell
|
|
96
108
|
var newActiveCell = range
|
|
97
109
|
? {
|
|
@@ -132,6 +144,10 @@ var useSelectionRenderer = function (_a) {
|
|
|
132
144
|
MagicFillComponent,
|
|
133
145
|
readonly,
|
|
134
146
|
showPasteMenu,
|
|
147
|
+
fillOptions,
|
|
148
|
+
onChooseFillType,
|
|
149
|
+
onOpenFillSeriesDialog,
|
|
150
|
+
onCloseFillOptions,
|
|
135
151
|
onSplitTextToColumns,
|
|
136
152
|
MagicFillContent,
|
|
137
153
|
QuickEdit,
|
|
@@ -140,6 +156,7 @@ var useSelectionRenderer = function (_a) {
|
|
|
140
156
|
onRemoveQuickEdit,
|
|
141
157
|
onAddQuickEdit,
|
|
142
158
|
cachedHoveredSelectionIds,
|
|
159
|
+
isFillShrink,
|
|
143
160
|
]);
|
|
144
161
|
};
|
|
145
162
|
exports.useSelectionRenderer = useSelectionRenderer;
|
|
@@ -2,7 +2,40 @@ import type { AreaStyle, CellInterface, GridRange, HiddenType, OptionalCellInter
|
|
|
2
2
|
import { Align } from "@rowsncolumns/grid";
|
|
3
3
|
import type React from "react";
|
|
4
4
|
import type { CanvasGridProps } from "../components/canvas-grid/typings";
|
|
5
|
-
import type { SheetRange } from "../types";
|
|
5
|
+
import type { AutoFillType, FillOptions, SheetRange } from "../types";
|
|
6
|
+
/**
|
|
7
|
+
* What the grid learns when a fill-handle gesture ends. For a left drag the
|
|
8
|
+
* fill has already been issued (`onFill`) and this lets the grid show Excel's
|
|
9
|
+
* Auto Fill Options smart tag; for a right-button drag NOTHING has been filled
|
|
10
|
+
* yet — the grid opens the fill menu and issues `onFill` with the chosen type.
|
|
11
|
+
*/
|
|
12
|
+
export type FillHandleRelease<T extends AreaStyle = AreaStyle> = {
|
|
13
|
+
sheetId: number;
|
|
14
|
+
activeCell: CellInterface;
|
|
15
|
+
/** Target range of the drag (source + filled area). */
|
|
16
|
+
fillSelection: SelectionArea;
|
|
17
|
+
/** Source selection the drag started from. */
|
|
18
|
+
selections: SelectionArea<T>[];
|
|
19
|
+
/** Ctrl (or Cmd on macOS) held when the handle was released. */
|
|
20
|
+
toggle: boolean;
|
|
21
|
+
button: "left" | "right";
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Modifier state of a fill-handle gesture (drag, double-click, drag-back). `"toggle"` = Ctrl
|
|
25
|
+
* (Cmd on Mac) was held: Excel flips copy↔series for a fill and clears formats too for a
|
|
26
|
+
* drag-back shrink.
|
|
27
|
+
*/
|
|
28
|
+
export type FillGestureOptions = {
|
|
29
|
+
modifier?: "toggle";
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A fill-handle drag back INSIDE the selection: `clearRange` = the excluded cells Excel empties on
|
|
33
|
+
* release (rendered greyed while dragging), `remaining` = the selection that survives.
|
|
34
|
+
*/
|
|
35
|
+
export type FillShrink = {
|
|
36
|
+
clearRange: GridRange;
|
|
37
|
+
remaining: GridRange;
|
|
38
|
+
};
|
|
6
39
|
export type UseSelectionOptions<T extends AreaStyle = AreaStyle> = {
|
|
7
40
|
sheetId: number;
|
|
8
41
|
/**
|
|
@@ -34,9 +67,25 @@ export type UseSelectionOptions<T extends AreaStyle = AreaStyle> = {
|
|
|
34
67
|
*/
|
|
35
68
|
allowDeselectSelection?: boolean;
|
|
36
69
|
/**
|
|
37
|
-
* onFill
|
|
70
|
+
* onFill. `fillType` is only set when the user picked an entry from the
|
|
71
|
+
* fill menu; `options.modifier` is `"toggle"` when Ctrl/Cmd was held at
|
|
72
|
+
* release (Excel decides the copy↔series inversion on release, not press) —
|
|
73
|
+
* for a Ctrl+drag and a Ctrl+double-click of the fill handle alike.
|
|
74
|
+
*/
|
|
75
|
+
onFill?: (sheetId: number, activeCell: CellInterface, fillSelection: SelectionArea, selections: SelectionArea<T>[], fillableSelections?: SelectionArea<T>[], fillType?: AutoFillType, options?: FillOptions) => void;
|
|
76
|
+
/**
|
|
77
|
+
* Dragging the fill handle BACK inside a multi-cell selection (up or left, without passing its
|
|
78
|
+
* first row/column) excludes the dragged-over cells: Excel clears their contents (formats kept;
|
|
79
|
+
* Ctrl+drag also clears formats) and shrinks the selection to `remaining`. Called on mouse-up with
|
|
80
|
+
* the cells to clear; the hook then publishes `remaining` through `onChangeSelections`.
|
|
81
|
+
*/
|
|
82
|
+
onFillShrink?: (sheetId: number, activeCell: CellInterface, clearRange: GridRange, options?: FillGestureOptions) => void;
|
|
83
|
+
/**
|
|
84
|
+
* Fired when a fill-handle drag ends (after `onFill` for a left drag; INSTEAD
|
|
85
|
+
* of `onFill` for a right-button drag). Lets the grid show the Auto Fill
|
|
86
|
+
* Options smart tag / right-drag fill menu.
|
|
38
87
|
*/
|
|
39
|
-
|
|
88
|
+
onFillHandleRelease?: (release: FillHandleRelease<T>) => void;
|
|
40
89
|
/**
|
|
41
90
|
* Hidden rows
|
|
42
91
|
*/
|
|
@@ -150,7 +199,7 @@ export type NewSelectionMode = "clear" | "modify" | "append";
|
|
|
150
199
|
* Hook to enable selection in datagrid
|
|
151
200
|
* @param initialSelection
|
|
152
201
|
*/
|
|
153
|
-
export declare const useSelection: <T extends AreaStyle>({ sheetId, activeCell, onChangeActiveCell, selections, onChangeSelections, columnCount, rowCount, selectionPolicy, newSelectionMode, allowDeselectSelection, onFill, isHiddenRow, isHiddenColumn, alwaysScrollToActiveCell, selectionTopBound, selectionBottomBound, selectionLeftBound, selectionRightBound, mouseDownInterceptor, mouseMoveInterceptor, mergedCells, canSelectionSpanMergedCells, getValue, onMoveSelection, getCellCoordsFromOffset, getCellBounds, getViewPort, focus, scrollToCell, isMergedCell, enableSelectOnEnterKey, formulaMode, isTouchDevice, getDataRowCount, isRowHeader, isColumnHeader, enableDataBoundaryNavigation, }: UseSelectionOptions<T>) => {
|
|
202
|
+
export declare const useSelection: <T extends AreaStyle>({ sheetId, activeCell, onChangeActiveCell, selections, onChangeSelections, columnCount, rowCount, selectionPolicy, newSelectionMode, allowDeselectSelection, onFill, onFillHandleRelease, onFillShrink, isHiddenRow, isHiddenColumn, alwaysScrollToActiveCell, selectionTopBound, selectionBottomBound, selectionLeftBound, selectionRightBound, mouseDownInterceptor, mouseMoveInterceptor, mergedCells, canSelectionSpanMergedCells, getValue, onMoveSelection, getCellCoordsFromOffset, getCellBounds, getViewPort, focus, scrollToCell, isMergedCell, enableSelectOnEnterKey, formulaMode, isTouchDevice, getDataRowCount, isRowHeader, isColumnHeader, enableDataBoundaryNavigation, }: UseSelectionOptions<T>) => {
|
|
154
203
|
isDragging: boolean;
|
|
155
204
|
draggedSelection: SelectionArea<T> | undefined;
|
|
156
205
|
initialDraggedSelection: SelectionArea<T> | undefined;
|
|
@@ -164,6 +213,7 @@ export declare const useSelection: <T extends AreaStyle>({ sheetId, activeCell,
|
|
|
164
213
|
onFillHandleMouseDown: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
165
214
|
onFillHandleDoubleClick: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
166
215
|
fillSelection: SelectionArea | undefined;
|
|
216
|
+
fillShrink: FillShrink | undefined;
|
|
167
217
|
clearLastSelection: () => void;
|
|
168
218
|
modifySelection: (coords: CellInterface, setInProgress?: boolean) => void;
|
|
169
219
|
selectAll: () => void;
|
|
@@ -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,EACb,SAAS,EACT,UAAU,EACV,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,aAAa,EACd,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EACL,KAAK,EAcN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAGzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"use-selection.d.ts","sourceRoot":"","sources":["../../../hooks/use-selection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK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,CAAC,SAAS,SAAS,EAAE,6pBAwC/C,mBAAmB,CAAC,CAAC,CAAC;;;;;;8BAmvDhB,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,cACvB,aAAa,GAAG,SAAS,aAC1B,aAAa,GAAG,SAAS,SAC7B,MAAM,GAAG,SAAS;4BAmLnB,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC;qBA75BtC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,UAAU,CAAC,YAAY;mBAmL1D,KAAK,CAAC,aAAa,GAAG,UAAU,CAAC,aAAa;0BAl9B1C,aAAa,QAAO,aAAa;+BA+1CrC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC;iCAsXhC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC;;;;8BAj0D3B,aAAa,kBAAkB,OAAO;;6BA+DvC,aAAa,QAAO,aAAa;;;6BAkL5B,MAAM,UACP,aAAa,kCAEb,KAAK;;6CA+7CT,aAAa,GAAG,SAAS,cACnB,aAAa,EAAE,GAAG,SAAS;mCA9tDjC,aAAa,OAAO,aAAa;;;;;;gCA+rB3B,MAAM,GAAG,SAAS;gDAsmCpB,MAAM,aAAa,aAAa,KAAG,SAAS;CA4O3D,CAAC"}
|
|
@@ -11,6 +11,13 @@ var scheduler_1 = require("../api/scheduler");
|
|
|
11
11
|
var config_1 = require("../config");
|
|
12
12
|
var helpers_1 = require("../helpers");
|
|
13
13
|
var use_callback_ref_1 = require("./use-callback-ref");
|
|
14
|
+
/** Ctrl on every platform; Cmd is accepted as an alias on macOS (Excel for Mac uses Ctrl). */
|
|
15
|
+
var isFillToggleModifier = function (e) {
|
|
16
|
+
return e.ctrlKey || e.metaKey;
|
|
17
|
+
};
|
|
18
|
+
var fillGestureOptions = function (e) {
|
|
19
|
+
return e.ctrlKey || e.metaKey ? { modifier: "toggle" } : undefined;
|
|
20
|
+
};
|
|
14
21
|
var defaultIsHidden = function () { return false; };
|
|
15
22
|
var defaultSelectionSpan = function () { return true; };
|
|
16
23
|
var getPossibleActiveCellFromSelections = function (selections) {
|
|
@@ -45,23 +52,90 @@ var boundsSubsetOfSelection = function (range, selection) {
|
|
|
45
52
|
range.startColumnIndex >= selection.startColumnIndex &&
|
|
46
53
|
range.endColumnIndex <= selection.endColumnIndex);
|
|
47
54
|
};
|
|
55
|
+
var cellInRange = function (cell, range) {
|
|
56
|
+
return cell.rowIndex >= range.startRowIndex &&
|
|
57
|
+
cell.rowIndex <= range.endRowIndex &&
|
|
58
|
+
cell.columnIndex >= range.startColumnIndex &&
|
|
59
|
+
cell.columnIndex <= range.endColumnIndex;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Resolve a fill-handle drag to a shrink of `selection` (Excel "drag back inside the selection").
|
|
63
|
+
* `coords` is the cell under the pointer. A shrink needs a multi-cell selection and a pointer that
|
|
64
|
+
* is inside it but short of its bottom-right corner along at least one axis; the axis with the
|
|
65
|
+
* larger travel wins (rows first on a tie), mirroring how a fill picks its direction. Returns
|
|
66
|
+
* `undefined` when the drag is not a shrink (outside the selection, single cell, or still at the
|
|
67
|
+
* corner) — the caller then treats it as a regular fill.
|
|
68
|
+
*/
|
|
69
|
+
var fillShrinkFor = function (selection, coords) {
|
|
70
|
+
var isSingleCell = selection.startRowIndex === selection.endRowIndex &&
|
|
71
|
+
selection.startColumnIndex === selection.endColumnIndex;
|
|
72
|
+
if (isSingleCell || !cellInRange(coords, selection))
|
|
73
|
+
return undefined;
|
|
74
|
+
var rowsExcluded = selection.endRowIndex - coords.rowIndex;
|
|
75
|
+
var colsExcluded = selection.endColumnIndex - coords.columnIndex;
|
|
76
|
+
if (rowsExcluded <= 0 && colsExcluded <= 0)
|
|
77
|
+
return undefined;
|
|
78
|
+
if (rowsExcluded >= colsExcluded) {
|
|
79
|
+
return {
|
|
80
|
+
clearRange: tslib_1.__assign(tslib_1.__assign({}, selection), { startRowIndex: coords.rowIndex + 1 }),
|
|
81
|
+
remaining: tslib_1.__assign(tslib_1.__assign({}, selection), { endRowIndex: coords.rowIndex }),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
clearRange: tslib_1.__assign(tslib_1.__assign({}, selection), { startColumnIndex: coords.columnIndex + 1 }),
|
|
86
|
+
remaining: tslib_1.__assign(tslib_1.__assign({}, selection), { endColumnIndex: coords.columnIndex }),
|
|
87
|
+
};
|
|
88
|
+
};
|
|
48
89
|
/**
|
|
49
90
|
* Hook to enable selection in datagrid
|
|
50
91
|
* @param initialSelection
|
|
51
92
|
*/
|
|
52
93
|
var useSelection = function (_a) {
|
|
53
|
-
var sheetId = _a.sheetId, activeCell = _a.activeCell, onChangeActiveCell = _a.onChangeActiveCell, selections = _a.selections, onChangeSelections = _a.onChangeSelections, _b = _a.columnCount, columnCount = _b === void 0 ? 0 : _b, _c = _a.rowCount, rowCount = _c === void 0 ? 0 : _c, _d = _a.selectionPolicy, selectionPolicy = _d === void 0 ? "multiple" : _d, _e = _a.newSelectionMode, newSelectionMode = _e === void 0 ? "clear" : _e, _f = _a.allowDeselectSelection, allowDeselectSelection = _f === void 0 ? true : _f, onFill = _a.onFill, _g = _a.isHiddenRow, isHiddenRow = _g === void 0 ? defaultIsHidden : _g, _h = _a.isHiddenColumn, isHiddenColumn = _h === void 0 ? defaultIsHidden : _h, _j = _a.alwaysScrollToActiveCell, alwaysScrollToActiveCell = _j === void 0 ? true : _j, _k = _a.selectionTopBound, selectionTopBound = _k === void 0 ? 0 : _k, _l = _a.selectionBottomBound, selectionBottomBound = _l === void 0 ? rowCount : _l, _m = _a.selectionLeftBound, selectionLeftBound = _m === void 0 ? 0 : _m, _o = _a.selectionRightBound, selectionRightBound = _o === void 0 ? columnCount : _o, mouseDownInterceptor = _a.mouseDownInterceptor, mouseMoveInterceptor = _a.mouseMoveInterceptor, _p = _a.mergedCells, mergedCells = _p === void 0 ? config_1.DEFAULT_ARRAY : _p, _q = _a.canSelectionSpanMergedCells, canSelectionSpanMergedCells = _q === void 0 ? defaultSelectionSpan : _q, getValue = _a.getValue, onMoveSelection = _a.onMoveSelection, getCellCoordsFromOffset = _a.getCellCoordsFromOffset, getCellBounds = _a.getCellBounds, getViewPort = _a.getViewPort, focus = _a.focus, scrollToCell = _a.scrollToCell, isMergedCell = _a.isMergedCell, enableSelectOnEnterKey = _a.enableSelectOnEnterKey, formulaMode = _a.formulaMode, isTouchDevice = _a.isTouchDevice, getDataRowCount = _a.getDataRowCount, isRowHeader = _a.isRowHeader, isColumnHeader = _a.isColumnHeader, _r = _a.enableDataBoundaryNavigation, enableDataBoundaryNavigation = _r === void 0 ? false : _r;
|
|
94
|
+
var sheetId = _a.sheetId, activeCell = _a.activeCell, onChangeActiveCell = _a.onChangeActiveCell, selections = _a.selections, onChangeSelections = _a.onChangeSelections, _b = _a.columnCount, columnCount = _b === void 0 ? 0 : _b, _c = _a.rowCount, rowCount = _c === void 0 ? 0 : _c, _d = _a.selectionPolicy, selectionPolicy = _d === void 0 ? "multiple" : _d, _e = _a.newSelectionMode, newSelectionMode = _e === void 0 ? "clear" : _e, _f = _a.allowDeselectSelection, allowDeselectSelection = _f === void 0 ? true : _f, onFill = _a.onFill, onFillHandleRelease = _a.onFillHandleRelease, onFillShrink = _a.onFillShrink, _g = _a.isHiddenRow, isHiddenRow = _g === void 0 ? defaultIsHidden : _g, _h = _a.isHiddenColumn, isHiddenColumn = _h === void 0 ? defaultIsHidden : _h, _j = _a.alwaysScrollToActiveCell, alwaysScrollToActiveCell = _j === void 0 ? true : _j, _k = _a.selectionTopBound, selectionTopBound = _k === void 0 ? 0 : _k, _l = _a.selectionBottomBound, selectionBottomBound = _l === void 0 ? rowCount : _l, _m = _a.selectionLeftBound, selectionLeftBound = _m === void 0 ? 0 : _m, _o = _a.selectionRightBound, selectionRightBound = _o === void 0 ? columnCount : _o, mouseDownInterceptor = _a.mouseDownInterceptor, mouseMoveInterceptor = _a.mouseMoveInterceptor, _p = _a.mergedCells, mergedCells = _p === void 0 ? config_1.DEFAULT_ARRAY : _p, _q = _a.canSelectionSpanMergedCells, canSelectionSpanMergedCells = _q === void 0 ? defaultSelectionSpan : _q, getValue = _a.getValue, onMoveSelection = _a.onMoveSelection, getCellCoordsFromOffset = _a.getCellCoordsFromOffset, getCellBounds = _a.getCellBounds, getViewPort = _a.getViewPort, focus = _a.focus, scrollToCell = _a.scrollToCell, isMergedCell = _a.isMergedCell, enableSelectOnEnterKey = _a.enableSelectOnEnterKey, formulaMode = _a.formulaMode, isTouchDevice = _a.isTouchDevice, getDataRowCount = _a.getDataRowCount, isRowHeader = _a.isRowHeader, isColumnHeader = _a.isColumnHeader, _r = _a.enableDataBoundaryNavigation, enableDataBoundaryNavigation = _r === void 0 ? false : _r;
|
|
54
95
|
var _s = tslib_1.__read((0, react_1.useState)(), 2), fillSelection = _s[0], setFillSelection = _s[1];
|
|
96
|
+
var _t = tslib_1.__read((0, react_1.useState)(), 2), fillShrink = _t[0], setFillShrink = _t[1];
|
|
97
|
+
var fillShrinkRef = (0, react_1.useRef)(undefined);
|
|
98
|
+
// Ctrl/Cmd state of the fill-handle drag, sampled on every mousemove (mouseup carries the
|
|
99
|
+
// modifier too, but a key released mid-drag should still count — Excel reads it at drop time,
|
|
100
|
+
// and the last move before the drop is the closest we get to that without a keyup listener).
|
|
101
|
+
var fillModifierRef = (0, react_1.useRef)(undefined);
|
|
55
102
|
var selectionStart = (0, react_1.useRef)(null);
|
|
56
103
|
var selectionEnd = (0, react_1.useRef)(null);
|
|
57
104
|
var isSelecting = (0, react_1.useRef)(false);
|
|
58
105
|
var isFilling = (0, react_1.useRef)(false);
|
|
106
|
+
/** Mouse button that grabbed the fill handle (a right-button drag opens the fill menu). */
|
|
107
|
+
var fillButtonRef = (0, react_1.useRef)("left");
|
|
108
|
+
/**
|
|
109
|
+
* One-shot, capture-phase `contextmenu` suppressor for a fill-handle
|
|
110
|
+
* gesture. Ctrl+click is the macOS context-menu gesture and a right-button
|
|
111
|
+
* release always fires `contextmenu`; neither may reach the grid's cell
|
|
112
|
+
* context menu while the user is dragging the fill handle.
|
|
113
|
+
*/
|
|
114
|
+
var contextMenuSuppressorRef = (0, react_1.useRef)(null);
|
|
115
|
+
var releaseContextMenuSuppressor = (0, react_1.useCallback)(function () {
|
|
116
|
+
var handler = contextMenuSuppressorRef.current;
|
|
117
|
+
if (!handler)
|
|
118
|
+
return;
|
|
119
|
+
contextMenuSuppressorRef.current = null;
|
|
120
|
+
document.removeEventListener("contextmenu", handler, true);
|
|
121
|
+
}, []);
|
|
122
|
+
var suppressNextContextMenu = (0, react_1.useCallback)(function () {
|
|
123
|
+
if (contextMenuSuppressorRef.current)
|
|
124
|
+
return;
|
|
125
|
+
var handler = function (e) {
|
|
126
|
+
e.preventDefault();
|
|
127
|
+
e.stopPropagation();
|
|
128
|
+
releaseContextMenuSuppressor();
|
|
129
|
+
};
|
|
130
|
+
contextMenuSuppressorRef.current = handler;
|
|
131
|
+
document.addEventListener("contextmenu", handler, true);
|
|
132
|
+
}, [releaseContextMenuSuppressor]);
|
|
59
133
|
var selectionsRef = (0, react_1.useRef)([]);
|
|
60
134
|
var fillSelectionRef = (0, react_1.useRef)(undefined);
|
|
61
135
|
var onChangeSelectionsRef = (0, use_callback_ref_1.useCallbackRef)(onChangeSelections);
|
|
62
136
|
/* Drag drop selection */
|
|
63
137
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
64
|
-
var
|
|
138
|
+
var _u = tslib_1.__read((0, react_1.useReducer)(function (s) { return s + 1; }, 0), 2), _ = _u[0], forceRender = _u[1];
|
|
65
139
|
var isDragging = (0, react_1.useRef)(false);
|
|
66
140
|
var hasUserMovedSelection = (0, react_1.useRef)(false);
|
|
67
141
|
var initialDraggedSelection = (0, react_1.useRef)(undefined);
|
|
@@ -86,6 +160,9 @@ var useSelection = function (_a) {
|
|
|
86
160
|
(0, grid_3.useIsomorphicLayoutEffect)(function () {
|
|
87
161
|
fillSelectionRef.current = fillSelection;
|
|
88
162
|
}, [fillSelection]);
|
|
163
|
+
(0, grid_3.useIsomorphicLayoutEffect)(function () {
|
|
164
|
+
fillShrinkRef.current = fillShrink;
|
|
165
|
+
}, [fillShrink]);
|
|
89
166
|
/* Check if cell is out of bounds */
|
|
90
167
|
var isCellOutOfBounds = (0, react_1.useCallback)(function (cell) {
|
|
91
168
|
return cell.rowIndex < 0 || cell.columnIndex < 0;
|
|
@@ -1060,6 +1137,7 @@ var useSelection = function (_a) {
|
|
|
1060
1137
|
var coords = getCellCoordsFromOffset(e.clientX, e.clientY, false);
|
|
1061
1138
|
if (!coords)
|
|
1062
1139
|
return;
|
|
1140
|
+
fillModifierRef.current = fillGestureOptions(e);
|
|
1063
1141
|
var selections = selectionsRef.current;
|
|
1064
1142
|
var range = selectionFromStartEnd(activeCellRef.current, coords);
|
|
1065
1143
|
var hasSelections = selections.length > 0;
|
|
@@ -1068,6 +1146,22 @@ var useSelection = function (_a) {
|
|
|
1068
1146
|
: getCellBounds(activeCellRef.current);
|
|
1069
1147
|
if (!range)
|
|
1070
1148
|
return;
|
|
1149
|
+
/**
|
|
1150
|
+
* Drag-back shrink (Excel): the handle sits at the selection's bottom-right corner; dragging
|
|
1151
|
+
* it up or left while staying INSIDE a multi-cell selection excludes the dragged-over rows
|
|
1152
|
+
* (or columns). Those cells are greyed now and cleared on release; the selection shrinks to
|
|
1153
|
+
* the rest. Dragging PAST the first row/column is an ordinary fill in that direction.
|
|
1154
|
+
*/
|
|
1155
|
+
var shrink = hasSelections
|
|
1156
|
+
? fillShrinkFor(activeCellBounds, coords)
|
|
1157
|
+
: undefined;
|
|
1158
|
+
if (shrink) {
|
|
1159
|
+
setFillSelection(undefined);
|
|
1160
|
+
setFillShrink(shrink);
|
|
1161
|
+
scrollToCell(coords);
|
|
1162
|
+
return;
|
|
1163
|
+
}
|
|
1164
|
+
setFillShrink(undefined);
|
|
1071
1165
|
var direction = range.startRowIndex < activeCellBounds.startRowIndex
|
|
1072
1166
|
? grid_4.Direction.Up
|
|
1073
1167
|
: range.endRowIndex > activeCellBounds.endRowIndex
|
|
@@ -1109,24 +1203,59 @@ var useSelection = function (_a) {
|
|
|
1109
1203
|
selectionTopBound,
|
|
1110
1204
|
]);
|
|
1111
1205
|
/**
|
|
1112
|
-
* When user releases mouse on the fill handle
|
|
1206
|
+
* When user releases mouse on the fill handle. Excel reads the Ctrl toggle
|
|
1207
|
+
* at RELEASE (the user can press/let go of Ctrl mid-drag), so the modifier
|
|
1208
|
+
* comes from the mouseup event, not the mousedown.
|
|
1113
1209
|
*/
|
|
1114
|
-
var handleFillMouseUp = (0, react_1.useCallback)(function () {
|
|
1210
|
+
var handleFillMouseUp = (0, react_1.useCallback)(function (e) {
|
|
1211
|
+
var _a;
|
|
1115
1212
|
isFilling.current = false;
|
|
1213
|
+
var toggle = isFillToggleModifier(e);
|
|
1214
|
+
var button = fillButtonRef.current;
|
|
1116
1215
|
/* Remove listener */
|
|
1117
1216
|
document.removeEventListener("mousemove", handleFillMouseMove);
|
|
1118
1217
|
document.removeEventListener("mouseup", handleFillMouseUp);
|
|
1218
|
+
// The right-button (or macOS Ctrl+click) `contextmenu` event follows this
|
|
1219
|
+
// mouseup; keep swallowing it for one tick, then drop the suppressor so a
|
|
1220
|
+
// later, unrelated right-click still opens the cell context menu.
|
|
1221
|
+
setTimeout(releaseContextMenuSuppressor, 0);
|
|
1119
1222
|
/* Exit early */
|
|
1120
1223
|
if (!activeCellRef.current) {
|
|
1121
1224
|
return;
|
|
1122
1225
|
}
|
|
1123
1226
|
// Active fill selection
|
|
1124
1227
|
var fillSelection = fillSelectionRef.current;
|
|
1228
|
+
var shrink = fillShrinkRef.current;
|
|
1229
|
+
// Modifier for a drag-back shrink: the last move's state, else the release's.
|
|
1230
|
+
var gestureOptions = (_a = fillModifierRef.current) !== null && _a !== void 0 ? _a : (toggle ? { modifier: "toggle" } : undefined);
|
|
1231
|
+
fillModifierRef.current = undefined;
|
|
1125
1232
|
/* Update last selection */
|
|
1126
1233
|
setFillSelection(undefined);
|
|
1234
|
+
setFillShrink(undefined);
|
|
1127
1235
|
/* Use ref, as we are binding to document */
|
|
1128
1236
|
var selections = selectionsRef.current;
|
|
1129
1237
|
var activeCell = activeCellRef.current;
|
|
1238
|
+
/* Drag-back inside the selection: clear the excluded cells, keep the rest selected */
|
|
1239
|
+
if (activeCell && shrink) {
|
|
1240
|
+
focus();
|
|
1241
|
+
onFillShrink === null || onFillShrink === void 0 ? void 0 : onFillShrink(sheetId, activeCell, shrink.clearRange, gestureOptions);
|
|
1242
|
+
var len_1 = selections.length;
|
|
1243
|
+
var shrunkSelections = len_1
|
|
1244
|
+
? selections.map(function (sel, i) {
|
|
1245
|
+
return len_1 - 1 === i ? tslib_1.__assign(tslib_1.__assign({}, sel), { range: shrink.remaining }) : sel;
|
|
1246
|
+
})
|
|
1247
|
+
: [{ range: shrink.remaining }];
|
|
1248
|
+
onChangeSelections === null || onChangeSelections === void 0 ? void 0 : onChangeSelections(shrunkSelections);
|
|
1249
|
+
// The active cell normally anchors the surviving corner; if it fell in the cleared band,
|
|
1250
|
+
// move it to the remaining range's top-left so it never points at a deselected cell.
|
|
1251
|
+
if (!cellInRange(activeCell, shrink.remaining)) {
|
|
1252
|
+
onChangeActiveCell === null || onChangeActiveCell === void 0 ? void 0 : onChangeActiveCell(sheetId, {
|
|
1253
|
+
rowIndex: shrink.remaining.startRowIndex,
|
|
1254
|
+
columnIndex: shrink.remaining.startColumnIndex,
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
return;
|
|
1258
|
+
}
|
|
1130
1259
|
if (!activeCell || !fillSelection) {
|
|
1131
1260
|
return;
|
|
1132
1261
|
}
|
|
@@ -1139,8 +1268,11 @@ var useSelection = function (_a) {
|
|
|
1139
1268
|
}
|
|
1140
1269
|
/* Focus on the grid */
|
|
1141
1270
|
focus();
|
|
1142
|
-
/* Callback
|
|
1143
|
-
|
|
1271
|
+
/* Callback — a right-button drag fills nothing yet: the grid opens the
|
|
1272
|
+
* fill menu and issues `onFill` with the entry the user picks. */
|
|
1273
|
+
if (button === "left") {
|
|
1274
|
+
onFill === null || onFill === void 0 ? void 0 : onFill(sheetId, activeCell, fillSelection, selections, undefined, undefined, toggle ? { modifier: "toggle" } : undefined);
|
|
1275
|
+
}
|
|
1144
1276
|
/* Modify last selection */
|
|
1145
1277
|
var curSelections = selectionsRef.current;
|
|
1146
1278
|
var len = curSelections.length;
|
|
@@ -1153,14 +1285,40 @@ var useSelection = function (_a) {
|
|
|
1153
1285
|
})
|
|
1154
1286
|
: [{ range: newBounds }];
|
|
1155
1287
|
onChangeSelections === null || onChangeSelections === void 0 ? void 0 : onChangeSelections(newSelections);
|
|
1156
|
-
|
|
1288
|
+
onFillHandleRelease === null || onFillHandleRelease === void 0 ? void 0 : onFillHandleRelease({
|
|
1289
|
+
sheetId: sheetId,
|
|
1290
|
+
activeCell: activeCell,
|
|
1291
|
+
fillSelection: fillSelection,
|
|
1292
|
+
selections: selections,
|
|
1293
|
+
toggle: toggle,
|
|
1294
|
+
button: button,
|
|
1295
|
+
});
|
|
1296
|
+
}, [
|
|
1297
|
+
focus,
|
|
1298
|
+
handleFillMouseMove,
|
|
1299
|
+
onChangeSelections,
|
|
1300
|
+
onChangeActiveCell,
|
|
1301
|
+
onFill,
|
|
1302
|
+
onFillHandleRelease,
|
|
1303
|
+
onFillShrink,
|
|
1304
|
+
releaseContextMenuSuppressor,
|
|
1305
|
+
sheetId,
|
|
1306
|
+
]);
|
|
1157
1307
|
var handleFillMouseDown = (0, react_1.useCallback)(function (e) {
|
|
1158
1308
|
e.stopPropagation();
|
|
1159
1309
|
e.preventDefault();
|
|
1310
|
+
var isRightButton = e.button === grid_4.MouseButtonCodes.right;
|
|
1311
|
+
fillButtonRef.current = isRightButton ? "right" : "left";
|
|
1312
|
+
// Ctrl+drag on the handle must never become the macOS Ctrl+click
|
|
1313
|
+
// context-menu gesture, and a right-button drag must not open the cell
|
|
1314
|
+
// context menu on release — swallow that gesture's `contextmenu`.
|
|
1315
|
+
if (isRightButton || isFillToggleModifier(e)) {
|
|
1316
|
+
suppressNextContextMenu();
|
|
1317
|
+
}
|
|
1160
1318
|
isFilling.current = true;
|
|
1161
1319
|
document.addEventListener("mousemove", handleFillMouseMove);
|
|
1162
1320
|
document.addEventListener("mouseup", handleFillMouseUp);
|
|
1163
|
-
}, [handleFillMouseMove, handleFillMouseUp]);
|
|
1321
|
+
}, [handleFillMouseMove, handleFillMouseUp, suppressNextContextMenu]);
|
|
1164
1322
|
/**
|
|
1165
1323
|
* Remove the last selection from state
|
|
1166
1324
|
*/
|
|
@@ -1402,10 +1560,17 @@ var useSelection = function (_a) {
|
|
|
1402
1560
|
// Add a ref. makeEditable renders way too often
|
|
1403
1561
|
var handleKeyDownRef = (0, use_callback_ref_1.useCallbackRef)(handleKeyDown);
|
|
1404
1562
|
/**
|
|
1405
|
-
* Double-click fill handle
|
|
1406
|
-
* 1.
|
|
1407
|
-
*
|
|
1408
|
-
*
|
|
1563
|
+
* Double-click fill handle — Excel's AutoFill rules:
|
|
1564
|
+
* 1. Pick the adjacent column: the one LEFT of the selection when its cell on the selection's top
|
|
1565
|
+
* row is non-blank, else the one on the RIGHT; neither → nothing happens.
|
|
1566
|
+
* 2. Extent = that column's contiguous data block below the selection (End+Down semantics: a
|
|
1567
|
+
* blank ends the block; only a blank in the very first row below the selection is skipped,
|
|
1568
|
+
* and only when the row after it is non-blank).
|
|
1569
|
+
* 3. Never overwrite: the fill halts before the first pre-existing non-blank cell in the fill
|
|
1570
|
+
* column(s) themselves.
|
|
1571
|
+
* 4. Ctrl (Cmd on Mac) held → the same copy↔series inversion as a Ctrl+drag (`options.modifier`).
|
|
1572
|
+
* Scans are row-by-row through `getValue` and bounded by the sheet's data extent, so the cost is
|
|
1573
|
+
* O(rows of the adjacent block), never O(sheet).
|
|
1409
1574
|
*/
|
|
1410
1575
|
var handleFillDoubleClick = (0, react_1.useCallback)(function (e) {
|
|
1411
1576
|
e.stopPropagation();
|
|
@@ -1423,33 +1588,60 @@ var useSelection = function (_a) {
|
|
|
1423
1588
|
var endRow = currentBounds.endRowIndex;
|
|
1424
1589
|
var leftCol = currentBounds.startColumnIndex;
|
|
1425
1590
|
var rightCol = currentBounds.endColumnIndex;
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
if (leftCol > selectionLeftBound) {
|
|
1432
|
-
|
|
1433
|
-
if (!(0, grid_1.isNull)(leftValue)) {
|
|
1434
|
-
hasAdjacentData = true;
|
|
1435
|
-
}
|
|
1591
|
+
var hasValue = function (rowIndex, columnIndex) {
|
|
1592
|
+
return !(0, grid_1.isNull)(getValue(sheetId, rowIndex, columnIndex));
|
|
1593
|
+
};
|
|
1594
|
+
// 1. Adjacent column: left first, then right — judged on the selection's top row.
|
|
1595
|
+
var adjacentColumn;
|
|
1596
|
+
if (leftCol > selectionLeftBound && hasValue(startRow, leftCol - 1)) {
|
|
1597
|
+
adjacentColumn = leftCol - 1;
|
|
1436
1598
|
}
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
if (!(0, grid_1.isNull)(rightValue)) {
|
|
1441
|
-
hasAdjacentData = true;
|
|
1442
|
-
}
|
|
1599
|
+
else if (rightCol < selectionRightBound &&
|
|
1600
|
+
hasValue(startRow, rightCol + 1)) {
|
|
1601
|
+
adjacentColumn = rightCol + 1;
|
|
1443
1602
|
}
|
|
1444
|
-
|
|
1445
|
-
if (!hasAdjacentData)
|
|
1603
|
+
if (adjacentColumn === undefined)
|
|
1446
1604
|
return;
|
|
1447
|
-
//
|
|
1448
|
-
//
|
|
1605
|
+
// The last row that can hold data — bounds every scan below. `getDataRowCount` is the legacy
|
|
1606
|
+
// `sheetData.length` contract (rows are 1-based, so the count is lastDataRow + 1); the rnc
|
|
1607
|
+
// engine's windowed path answers with the same shape (its 1-based `sheet_extents` max_row + 1).
|
|
1449
1608
|
var dataRowCount = getDataRowCount === null || getDataRowCount === void 0 ? void 0 : getDataRowCount(sheetId);
|
|
1450
|
-
var
|
|
1451
|
-
|
|
1452
|
-
|
|
1609
|
+
var lastDataRow = Math.min(selectionBottomBound, dataRowCount !== undefined ? dataRowCount - 1 : selectionBottomBound);
|
|
1610
|
+
if (lastDataRow <= endRow)
|
|
1611
|
+
return;
|
|
1612
|
+
// 2. Walk the adjacent column's contiguous block below the selection.
|
|
1613
|
+
var adjacentEnd = endRow;
|
|
1614
|
+
var row = endRow + 1;
|
|
1615
|
+
if (!hasValue(row, adjacentColumn)) {
|
|
1616
|
+
// End+Down: skip exactly one blank directly below the selection when data resumes after it.
|
|
1617
|
+
if (row + 1 <= lastDataRow && hasValue(row + 1, adjacentColumn)) {
|
|
1618
|
+
row += 1;
|
|
1619
|
+
}
|
|
1620
|
+
else {
|
|
1621
|
+
return;
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
while (row <= lastDataRow && hasValue(row, adjacentColumn)) {
|
|
1625
|
+
adjacentEnd = row;
|
|
1626
|
+
row += 1;
|
|
1627
|
+
}
|
|
1628
|
+
if (adjacentEnd <= endRow)
|
|
1629
|
+
return;
|
|
1630
|
+
// 3. Stop before the first pre-existing value in the fill column(s) — existing data is kept.
|
|
1631
|
+
var targetRow = adjacentEnd;
|
|
1632
|
+
for (var r = endRow + 1; r <= adjacentEnd; r++) {
|
|
1633
|
+
var occupied = false;
|
|
1634
|
+
for (var c = leftCol; c <= rightCol; c++) {
|
|
1635
|
+
if (hasValue(r, c)) {
|
|
1636
|
+
occupied = true;
|
|
1637
|
+
break;
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
if (occupied) {
|
|
1641
|
+
targetRow = r - 1;
|
|
1642
|
+
break;
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1453
1645
|
// No additional rows to fill
|
|
1454
1646
|
if (targetRow <= endRow)
|
|
1455
1647
|
return;
|
|
@@ -1463,8 +1655,10 @@ var useSelection = function (_a) {
|
|
|
1463
1655
|
var newFillSelection = { range: fillRange };
|
|
1464
1656
|
// Focus on the grid
|
|
1465
1657
|
focus();
|
|
1466
|
-
// Callback to perform the fill
|
|
1467
|
-
|
|
1658
|
+
// 4. Callback to perform the fill (Ctrl/Cmd on the double-click toggles
|
|
1659
|
+
// copy↔series exactly like a Ctrl+drag)
|
|
1660
|
+
var toggle = isFillToggleModifier(e);
|
|
1661
|
+
onFill === null || onFill === void 0 ? void 0 : onFill(sheetId, activeCell, newFillSelection, selections, undefined, undefined, toggle ? { modifier: "toggle" } : undefined);
|
|
1468
1662
|
// Update selection to the new range
|
|
1469
1663
|
var curSelections = selectionsRef.current;
|
|
1470
1664
|
var len = curSelections.length;
|
|
@@ -1503,6 +1697,7 @@ var useSelection = function (_a) {
|
|
|
1503
1697
|
onFillHandleMouseDown: handleFillMouseDown,
|
|
1504
1698
|
onFillHandleDoubleClick: handleFillDoubleClick,
|
|
1505
1699
|
fillSelection: fillSelection,
|
|
1700
|
+
fillShrink: fillShrink,
|
|
1506
1701
|
clearLastSelection: handleClearLastSelection,
|
|
1507
1702
|
modifySelection: modifySelection,
|
|
1508
1703
|
selectAll: selectAll,
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ export * from "./components/sheet-status";
|
|
|
8
8
|
export * from "./components/cell-tooltip";
|
|
9
9
|
export * from "./components/insert-function-dialog";
|
|
10
10
|
export * from "./components/sort-range-dialog";
|
|
11
|
+
export * from "./components/fill-series-dialog";
|
|
12
|
+
export * from "./components/selection/fill-options-menu";
|
|
13
|
+
export * from "./api/fill-series";
|
|
14
|
+
export { type FillHandleRelease } from "./hooks/use-selection";
|
|
11
15
|
export * from "./components/paste-special-dialog";
|
|
12
16
|
export * from "./components/go-to-dialog";
|
|
13
17
|
export * from "./components/evaluate-formula-dialog";
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.tsx"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,C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AC;AAGrD,cAAc,sBAAsB,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -12,6 +12,9 @@ tslib_1.__exportStar(require("./components/sheet-status"), exports);
|
|
|
12
12
|
tslib_1.__exportStar(require("./components/cell-tooltip"), exports);
|
|
13
13
|
tslib_1.__exportStar(require("./components/insert-function-dialog"), exports);
|
|
14
14
|
tslib_1.__exportStar(require("./components/sort-range-dialog"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./components/fill-series-dialog"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./components/selection/fill-options-menu"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./api/fill-series"), exports);
|
|
15
18
|
tslib_1.__exportStar(require("./components/paste-special-dialog"), exports);
|
|
16
19
|
tslib_1.__exportStar(require("./components/go-to-dialog"), exports);
|
|
17
20
|
tslib_1.__exportStar(require("./components/evaluate-formula-dialog"), exports);
|
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-09-
|
|
7
|
+
(_a = new Date("2026-09-17")) !== null && _a !== void 0 ? _a : new Date("2025-06-18");
|