@rowsncolumns/spreadsheet 10.15.0 → 10.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/editor-formula.d.ts +40 -0
- package/dist/cjs/api/editor-formula.d.ts.map +1 -0
- package/dist/cjs/api/editor-formula.js +87 -0
- package/dist/cjs/atoms/cell-input-context.atom.d.ts.map +1 -1
- package/dist/cjs/components/autocorrect-options-smart-tag/index.d.ts +22 -8
- package/dist/cjs/components/autocorrect-options-smart-tag/index.d.ts.map +1 -1
- package/dist/cjs/components/autocorrect-options-smart-tag/index.js +107 -22
- package/dist/cjs/components/canvas-grid/frozen-start.d.ts +130 -0
- package/dist/cjs/components/canvas-grid/frozen-start.d.ts.map +1 -0
- package/dist/cjs/components/canvas-grid/frozen-start.js +266 -0
- package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/cjs/components/canvas-grid/index.js +515 -71
- package/dist/cjs/components/canvas-grid/typings.d.ts +24 -8
- package/dist/cjs/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/cjs/components/cell-input/cell-input.d.ts.map +1 -1
- package/dist/cjs/components/cell-input/cell-input.js +3 -1
- package/dist/cjs/components/embeds/embed-draggable.d.ts.map +1 -1
- package/dist/cjs/components/embeds/embed-draggable.js +42 -19
- package/dist/cjs/components/embeds/object-cell-offset.d.ts +10 -0
- package/dist/cjs/components/embeds/object-cell-offset.d.ts.map +1 -0
- package/dist/cjs/components/embeds/object-cell-offset.js +12 -0
- package/dist/cjs/components/embeds/object-focus.d.ts +16 -3
- package/dist/cjs/components/embeds/object-focus.d.ts.map +1 -1
- package/dist/cjs/components/embeds/object-focus.js +62 -6
- package/dist/cjs/components/outline-gutter/index.d.ts +11 -3
- package/dist/cjs/components/outline-gutter/index.d.ts.map +1 -1
- package/dist/cjs/components/outline-gutter/index.js +11 -6
- 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 +2 -2
- package/dist/cjs/components/selection/types.d.ts +2 -0
- package/dist/cjs/components/selection/types.d.ts.map +1 -1
- package/dist/cjs/hooks/object-spec-schema.generated.d.ts.map +1 -1
- package/dist/cjs/hooks/object-spec-schema.generated.js +16 -0
- package/dist/cjs/hooks/use-editable.d.ts.map +1 -1
- package/dist/cjs/hooks/use-editable.js +5 -1
- package/dist/cjs/hooks/use-editor-change.d.ts.map +1 -1
- package/dist/cjs/hooks/use-editor-change.js +3 -1
- package/dist/cjs/hooks/use-export-range.d.ts +12 -1
- package/dist/cjs/hooks/use-export-range.d.ts.map +1 -1
- package/dist/cjs/hooks/use-export-range.js +75 -35
- package/dist/cjs/hooks/use-flash-fill-suggestion.d.ts.map +1 -1
- package/dist/cjs/hooks/use-flash-fill-suggestion.js +15 -4
- package/dist/cjs/hooks/use-grid-children.d.ts +27 -2
- package/dist/cjs/hooks/use-grid-children.d.ts.map +1 -1
- package/dist/cjs/hooks/use-grid-children.js +61 -21
- package/dist/cjs/hooks/use-header-actions.d.ts +3 -1
- package/dist/cjs/hooks/use-header-actions.d.ts.map +1 -1
- package/dist/cjs/hooks/use-header-actions.js +5 -4
- package/dist/cjs/hooks/use-hidden-dimension-markers.d.ts +7 -1
- package/dist/cjs/hooks/use-hidden-dimension-markers.d.ts.map +1 -1
- package/dist/cjs/hooks/use-hidden-dimension-markers.js +9 -5
- package/dist/cjs/hooks/use-selection-interceptors.d.ts +7 -1
- package/dist/cjs/hooks/use-selection-interceptors.d.ts.map +1 -1
- package/dist/cjs/hooks/use-selection-interceptors.js +5 -3
- package/dist/cjs/hooks/use-selection-renderer.d.ts.map +1 -1
- package/dist/cjs/hooks/use-selection-renderer.js +18 -4
- package/dist/cjs/hooks/use-sizer.d.ts +9 -1
- package/dist/cjs/hooks/use-sizer.d.ts.map +1 -1
- package/dist/cjs/hooks/use-sizer.js +5 -3
- package/dist/cjs/release-date.js +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/cjs/types.d.ts +24 -0
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/esm/api/editor-formula.d.ts +40 -0
- package/dist/esm/api/editor-formula.d.ts.map +1 -0
- package/dist/esm/api/editor-formula.js +76 -0
- package/dist/esm/atoms/cell-input-context.atom.d.ts.map +1 -1
- package/dist/esm/components/autocorrect-options-smart-tag/index.d.ts +22 -8
- package/dist/esm/components/autocorrect-options-smart-tag/index.d.ts.map +1 -1
- package/dist/esm/components/autocorrect-options-smart-tag/index.js +103 -22
- package/dist/esm/components/canvas-grid/frozen-start.d.ts +130 -0
- package/dist/esm/components/canvas-grid/frozen-start.d.ts.map +1 -0
- package/dist/esm/components/canvas-grid/frozen-start.js +222 -0
- package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/esm/components/canvas-grid/index.js +439 -20
- package/dist/esm/components/canvas-grid/typings.d.ts +24 -8
- package/dist/esm/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/esm/components/cell-input/cell-input.d.ts.map +1 -1
- package/dist/esm/components/cell-input/cell-input.js +4 -2
- package/dist/esm/components/embeds/embed-draggable.d.ts.map +1 -1
- package/dist/esm/components/embeds/embed-draggable.js +34 -14
- package/dist/esm/components/embeds/object-cell-offset.d.ts +10 -0
- package/dist/esm/components/embeds/object-cell-offset.d.ts.map +1 -0
- package/dist/esm/components/embeds/object-cell-offset.js +9 -0
- package/dist/esm/components/embeds/object-focus.d.ts +16 -3
- package/dist/esm/components/embeds/object-focus.d.ts.map +1 -1
- package/dist/esm/components/embeds/object-focus.js +38 -2
- package/dist/esm/components/outline-gutter/index.d.ts +11 -3
- package/dist/esm/components/outline-gutter/index.d.ts.map +1 -1
- package/dist/esm/components/outline-gutter/index.js +11 -6
- 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 +2 -2
- package/dist/esm/components/selection/types.d.ts +2 -0
- package/dist/esm/components/selection/types.d.ts.map +1 -1
- package/dist/esm/hooks/object-spec-schema.generated.d.ts.map +1 -1
- package/dist/esm/hooks/object-spec-schema.generated.js +16 -0
- package/dist/esm/hooks/use-editable.d.ts.map +1 -1
- package/dist/esm/hooks/use-editable.js +6 -2
- package/dist/esm/hooks/use-editor-change.d.ts.map +1 -1
- package/dist/esm/hooks/use-editor-change.js +4 -2
- package/dist/esm/hooks/use-export-range.d.ts +12 -1
- package/dist/esm/hooks/use-export-range.d.ts.map +1 -1
- package/dist/esm/hooks/use-export-range.js +31 -4
- package/dist/esm/hooks/use-flash-fill-suggestion.d.ts.map +1 -1
- package/dist/esm/hooks/use-flash-fill-suggestion.js +15 -4
- package/dist/esm/hooks/use-grid-children.d.ts +27 -2
- package/dist/esm/hooks/use-grid-children.d.ts.map +1 -1
- package/dist/esm/hooks/use-grid-children.js +53 -16
- package/dist/esm/hooks/use-header-actions.d.ts +3 -1
- package/dist/esm/hooks/use-header-actions.d.ts.map +1 -1
- package/dist/esm/hooks/use-header-actions.js +3 -2
- package/dist/esm/hooks/use-hidden-dimension-markers.d.ts +7 -1
- package/dist/esm/hooks/use-hidden-dimension-markers.d.ts.map +1 -1
- package/dist/esm/hooks/use-hidden-dimension-markers.js +7 -3
- package/dist/esm/hooks/use-selection-interceptors.d.ts +7 -1
- package/dist/esm/hooks/use-selection-interceptors.d.ts.map +1 -1
- package/dist/esm/hooks/use-selection-interceptors.js +5 -3
- package/dist/esm/hooks/use-selection-renderer.d.ts.map +1 -1
- package/dist/esm/hooks/use-selection-renderer.js +18 -4
- package/dist/esm/hooks/use-sizer.d.ts +9 -1
- package/dist/esm/hooks/use-sizer.d.ts.map +1 -1
- package/dist/esm/hooks/use-sizer.js +5 -3
- package/dist/esm/release-date.js +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/types.d.ts +24 -0
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/spreadsheet.min.css +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The cell editor's own reading of the text being typed (demo-app-monorepo#57258): the engine takes
|
|
3
|
+
* a sign typed in front of a number literal as that number (rowsncolumns/spreadsheet#1666,
|
|
4
|
+
* rnc-cellmodel `is_a_formula_in`), so the editor does not colour it, offer function hints or pick
|
|
5
|
+
* references with the arrow keys while it is typed.
|
|
6
|
+
*/
|
|
7
|
+
/** The marks a locale writes numbers with: its decimal mark and its thousands separator. */
|
|
8
|
+
export type NumberSeparators = {
|
|
9
|
+
decimal: string;
|
|
10
|
+
group: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The number marks of a locale, from CLDR as the engine reads them (ICU there, `Intl` here): de-DE
|
|
14
|
+
* `1.234,5`, fr-FR `1 234,5` (a narrow no-break space), de-CH `1'234.5`. Without a locale, or one
|
|
15
|
+
* `Intl` does not know: en-US.
|
|
16
|
+
*/
|
|
17
|
+
export declare const numberSeparatorsOf: (locale?: {
|
|
18
|
+
id?: string;
|
|
19
|
+
} | null) => NumberSeparators;
|
|
20
|
+
/**
|
|
21
|
+
* A `+` / `-` right in front of a number literal that the engine takes as that number
|
|
22
|
+
* (rnc-cellmodel `is_a_formula_in`, rowsncolumns/spreadsheet#1666): a percent, a number ending in
|
|
23
|
+
* `€`, or a mixed fraction (`-3%`, `+3%`, `-1,234.5%`, `-.5%`, `-0 1/2`, `-5€`, `-3,5%` in de-DE).
|
|
24
|
+
* A date or a time after the sign (`-1/2`, `-3 PM`, `-12:30`), a bracket or a second sign (`-(3)`,
|
|
25
|
+
* `--3%`), a `%` after an exponent (`-1e5%`) and anything that is not a number (`+A1`,
|
|
26
|
+
* `-SUM(A1)`) are not. Kept to what that rule accepts: the editor never calls something a number
|
|
27
|
+
* that the engine will store as a formula.
|
|
28
|
+
*/
|
|
29
|
+
export declare const isSignedNumberLiteral: (text: string, separators?: NumberSeparators) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the cell editor treats the text being typed as a formula: its syntax colouring, its
|
|
32
|
+
* function hints and autocomplete, and arrow keys picking references. The same as
|
|
33
|
+
* {@link isAFormula}, except that a sign in front of a number literal (`-3%`) is that number, as
|
|
34
|
+
* the engine stores it. `isAFormula` itself is unchanged: it classifies entries on the commit
|
|
35
|
+
* paths, which follow the engine.
|
|
36
|
+
*/
|
|
37
|
+
export declare const isAFormulaWhileEditing: (text: unknown, locale?: {
|
|
38
|
+
id?: string;
|
|
39
|
+
} | null) => boolean;
|
|
40
|
+
//# sourceMappingURL=editor-formula.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-formula.d.ts","sourceRoot":"","sources":["../../../api/editor-formula.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,4FAA4F;AAC5F,MAAM,MAAM,gBAAgB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAMlE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC7B,SAAS;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,KAC9B,gBAiBF,CAAC;AAkCF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAChC,MAAM,MAAM,EACZ,aAAY,gBAAmC,KAC9C,OAAsE,CAAC;AAE1E;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GACjC,MAAM,OAAO,EACb,SAAS;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,KAC9B,OAIF,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isAFormulaWhileEditing = exports.isSignedNumberLiteral = exports.numberSeparatorsOf = void 0;
|
|
4
|
+
var utils_1 = require("@rowsncolumns/utils");
|
|
5
|
+
var EN_US_SEPARATORS = { decimal: ".", group: "," };
|
|
6
|
+
var separatorsByLocale = new Map();
|
|
7
|
+
/**
|
|
8
|
+
* The number marks of a locale, from CLDR as the engine reads them (ICU there, `Intl` here): de-DE
|
|
9
|
+
* `1.234,5`, fr-FR `1 234,5` (a narrow no-break space), de-CH `1'234.5`. Without a locale, or one
|
|
10
|
+
* `Intl` does not know: en-US.
|
|
11
|
+
*/
|
|
12
|
+
var numberSeparatorsOf = function (locale) {
|
|
13
|
+
var _a, _b, _c, _d;
|
|
14
|
+
var tag = locale === null || locale === void 0 ? void 0 : locale.id;
|
|
15
|
+
if (!tag)
|
|
16
|
+
return EN_US_SEPARATORS;
|
|
17
|
+
var separators = separatorsByLocale.get(tag);
|
|
18
|
+
if (!separators) {
|
|
19
|
+
try {
|
|
20
|
+
var parts = new Intl.NumberFormat(tag, { useGrouping: true }).formatToParts(1234567.5);
|
|
21
|
+
separators = {
|
|
22
|
+
decimal: (_b = (_a = parts.find(function (part) { return part.type === "decimal"; })) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ".",
|
|
23
|
+
group: (_d = (_c = parts.find(function (part) { return part.type === "group"; })) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : ",",
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
catch (_e) {
|
|
27
|
+
separators = EN_US_SEPARATORS;
|
|
28
|
+
}
|
|
29
|
+
separatorsByLocale.set(tag, separators);
|
|
30
|
+
}
|
|
31
|
+
return separators;
|
|
32
|
+
};
|
|
33
|
+
exports.numberSeparatorsOf = numberSeparatorsOf;
|
|
34
|
+
var escapeRegExp = function (text) { return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); };
|
|
35
|
+
var signedNumberLiteralPatterns = new Map();
|
|
36
|
+
/**
|
|
37
|
+
* The literals of rowsncolumns/spreadsheet#1666's entry table, and nothing wider: a whole number
|
|
38
|
+
* (thousands-grouped or not) with decimal digits after the mark, or decimals alone, ending in `%`
|
|
39
|
+
* or `€`; or a mixed fraction as the engine reads one (`\d{1,15} +\d{1,3}/\d{1,3}`, a non-zero
|
|
40
|
+
* denominator). A plain or scientific number after a sign is not a formula already.
|
|
41
|
+
*/
|
|
42
|
+
var signedNumberLiteralPattern = function (_a) {
|
|
43
|
+
var decimal = _a.decimal, group = _a.group;
|
|
44
|
+
var key = "".concat(decimal).concat(group);
|
|
45
|
+
var pattern = signedNumberLiteralPatterns.get(key);
|
|
46
|
+
if (!pattern) {
|
|
47
|
+
var d = escapeRegExp(decimal);
|
|
48
|
+
// Groups only with `,` or `.`: a space or an apostrophe as the thousands mark (fr-FR, de-CH)
|
|
49
|
+
// is written differently across CLDR versions and keyboards, so a grouped number there keeps
|
|
50
|
+
// the formula reading rather than risk calling a number what the engine does not.
|
|
51
|
+
var whole = group === "," || group === "."
|
|
52
|
+
? "(?:\\d{1,3}(?:".concat(escapeRegExp(group), "\\d{3})+|\\d+)")
|
|
53
|
+
: "\\d+";
|
|
54
|
+
var number = "(?:".concat(whole, "(?:").concat(d, "\\d+)?|").concat(d, "\\d+)");
|
|
55
|
+
pattern = new RegExp("^[+-](?:".concat(number, "(?:%|\u20AC)|\\d{1,15} +\\d{1,3}/(?!0+$)\\d{1,3})$"), "u");
|
|
56
|
+
signedNumberLiteralPatterns.set(key, pattern);
|
|
57
|
+
}
|
|
58
|
+
return pattern;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* A `+` / `-` right in front of a number literal that the engine takes as that number
|
|
62
|
+
* (rnc-cellmodel `is_a_formula_in`, rowsncolumns/spreadsheet#1666): a percent, a number ending in
|
|
63
|
+
* `€`, or a mixed fraction (`-3%`, `+3%`, `-1,234.5%`, `-.5%`, `-0 1/2`, `-5€`, `-3,5%` in de-DE).
|
|
64
|
+
* A date or a time after the sign (`-1/2`, `-3 PM`, `-12:30`), a bracket or a second sign (`-(3)`,
|
|
65
|
+
* `--3%`), a `%` after an exponent (`-1e5%`) and anything that is not a number (`+A1`,
|
|
66
|
+
* `-SUM(A1)`) are not. Kept to what that rule accepts: the editor never calls something a number
|
|
67
|
+
* that the engine will store as a formula.
|
|
68
|
+
*/
|
|
69
|
+
var isSignedNumberLiteral = function (text, separators) {
|
|
70
|
+
if (separators === void 0) { separators = EN_US_SEPARATORS; }
|
|
71
|
+
return signedNumberLiteralPattern(separators).test(text.trimEnd());
|
|
72
|
+
};
|
|
73
|
+
exports.isSignedNumberLiteral = isSignedNumberLiteral;
|
|
74
|
+
/**
|
|
75
|
+
* Whether the cell editor treats the text being typed as a formula: its syntax colouring, its
|
|
76
|
+
* function hints and autocomplete, and arrow keys picking references. The same as
|
|
77
|
+
* {@link isAFormula}, except that a sign in front of a number literal (`-3%`) is that number, as
|
|
78
|
+
* the engine stores it. `isAFormula` itself is unchanged: it classifies entries on the commit
|
|
79
|
+
* paths, which follow the engine.
|
|
80
|
+
*/
|
|
81
|
+
var isAFormulaWhileEditing = function (text, locale) {
|
|
82
|
+
if (!(0, utils_1.isAFormula)(text))
|
|
83
|
+
return false;
|
|
84
|
+
var textStr = String(text);
|
|
85
|
+
return !(0, exports.isSignedNumberLiteral)(textStr, (0, exports.numberSeparatorsOf)(locale));
|
|
86
|
+
};
|
|
87
|
+
exports.isAFormulaWhileEditing = isAFormulaWhileEditing;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-input-context.atom.d.ts","sourceRoot":"","sources":["../../../atoms/cell-input-context.atom.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,mBAAmB;;;;
|
|
1
|
+
{"version":3,"file":"cell-input-context.atom.d.ts","sourceRoot":"","sources":["../../../atoms/cell-input-context.atom.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,mBAAmB;;;;oBACyq6F,CAAC;qBAAwB,CAAC;;;;;;;;;;;CADpp6F,CAAC"}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { CalculatedColumnFillKind, CalculatedColumnOption } from "../../api/calculated-column-fill";
|
|
3
3
|
import type { TableAutoExpansionOption } from "../../api/table-auto-expansion";
|
|
4
|
+
/**
|
|
5
|
+
* Where the button hangs from its cell. `outside`: just outside the bottom-right corner, over the
|
|
6
|
+
* next row (Excel for Mac). When a split bar runs along the cell's bottom or right edge, that
|
|
7
|
+
* corner is in no pane, so the pane showing the cell keeps the button inside itself: `above-bar`
|
|
8
|
+
* (the bar under the cell: beside the cell, its bottom on the bar), `left-of-bar` (the bar right
|
|
9
|
+
* of the cell: under the cell, its right on the bar), `inside` (both: in the cell's corner).
|
|
10
|
+
*/
|
|
11
|
+
export type AutoCorrectPlacement = "outside" | "above-bar" | "left-of-bar" | "inside";
|
|
4
12
|
export type AutoCorrectOptionsSmartTagProps = {
|
|
5
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Position/size of the cell the tag belongs to; the tag hangs just outside its bottom-right
|
|
15
|
+
* corner, over the next row (where Excel for Mac puts it).
|
|
16
|
+
*/
|
|
6
17
|
x: number;
|
|
7
18
|
y: number;
|
|
8
19
|
width: number;
|
|
@@ -21,17 +32,20 @@ export type AutoCorrectOptionsSmartTagProps = {
|
|
|
21
32
|
canStop: boolean;
|
|
22
33
|
};
|
|
23
34
|
onChooseCalculatedColumnOption?(option: CalculatedColumnOption): void;
|
|
35
|
+
/** Where the button hangs from the cell; `outside` by default. */
|
|
36
|
+
placement?: AutoCorrectPlacement;
|
|
24
37
|
};
|
|
25
38
|
/**
|
|
26
|
-
* Excel's AutoCorrect Options smart tag
|
|
27
|
-
* table column's formula into — ONE button, carrying the entries of
|
|
28
|
-
* (a formula typed in the column right of a table): "Undo Table
|
|
29
|
-
* Automatically Expanding Tables", and "Undo Calculated Column" (or
|
|
30
|
-
* column with this formula") / "Stop automatically creating
|
|
31
|
-
* host cannot carry out is not offered; with none left, no
|
|
39
|
+
* Excel's AutoCorrect Options smart tag, hanging from the bottom-right corner of the cell an edit
|
|
40
|
+
* grew a table from, or typed a table column's formula into — ONE button, carrying the entries of
|
|
41
|
+
* both when one edit did both (a formula typed in the column right of a table): "Undo Table
|
|
42
|
+
* AutoExpansion" / "Stop Automatically Expanding Tables", and "Undo Calculated Column" (or
|
|
43
|
+
* "Overwrite all cells in this column with this formula") / "Stop automatically creating
|
|
44
|
+
* calculated columns". An entry the host cannot carry out is not offered; with none left, no
|
|
45
|
+
* button.
|
|
32
46
|
*/
|
|
33
47
|
export declare const AutoCorrectOptionsSmartTag: {
|
|
34
|
-
({ x, y, width, tableAutoExpansion, onChooseTableAutoExpansionOption, calculatedColumn, onChooseCalculatedColumnOption, }: AutoCorrectOptionsSmartTagProps): React.JSX.Element | null;
|
|
48
|
+
({ x, y, width, height, tableAutoExpansion, onChooseTableAutoExpansionOption, calculatedColumn, onChooseCalculatedColumnOption, placement, }: AutoCorrectOptionsSmartTagProps): React.JSX.Element | null;
|
|
35
49
|
displayName: string;
|
|
36
50
|
};
|
|
37
51
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/autocorrect-options-smart-tag/index.tsx"],"names":[],"mappings":"AASA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/autocorrect-options-smart-tag/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EACV,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE/E;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAC5B,SAAS,GACT,WAAW,GACX,aAAa,GACb,QAAQ,CAAC;AA+Eb,MAAM,MAAM,+BAA+B,GAAG;IAC5C;;;OAGG;IACH,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,kBAAkB,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAC5D,gCAAgC,CAAC,CAAC,MAAM,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAC1E,yGAAyG;IACzG,gBAAgB,CAAC,EAAE;QACjB,IAAI,EAAE,wBAAwB,CAAC;QAC/B,OAAO,EAAE,OAAO,CAAC;QACjB,YAAY,EAAE,OAAO,CAAC;QACtB,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IACF,8BAA8B,CAAC,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACtE,kEAAkE;IAClE,SAAS,CAAC,EAAE,oBAAoB,CAAC;CAClC,CAAC;AAgCF;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B;kJAUpC,+BAA+B;;CA+HjC,CAAC"}
|
|
@@ -4,20 +4,100 @@ exports.AutoCorrectOptionsSmartTag = void 0;
|
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var ui_1 = require("@rowsncolumns/ui");
|
|
6
6
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
7
|
+
var placementStyle = function (placement, _a) {
|
|
8
|
+
var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
|
|
9
|
+
var beside = placement === "outside" || placement === "above-bar";
|
|
10
|
+
var below = placement === "outside" || placement === "left-of-bar";
|
|
11
|
+
return {
|
|
12
|
+
left: beside ? x + width + 2 : x + width,
|
|
13
|
+
top: y + height,
|
|
14
|
+
transform: beside && below
|
|
15
|
+
? undefined
|
|
16
|
+
: "translate(".concat(beside ? "0" : "-100%", ", ").concat(below ? "0" : "-100%", ")"),
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
/** The nearest ancestor that clips its content: the pane the button is drawn in. */
|
|
20
|
+
var clipOf = function (node) {
|
|
21
|
+
var _a;
|
|
22
|
+
var view = node.ownerDocument.defaultView;
|
|
23
|
+
for (var el = node.parentElement; el; el = el.parentElement) {
|
|
24
|
+
var overflow = (_a = view === null || view === void 0 ? void 0 : view.getComputedStyle(el).overflow) !== null && _a !== void 0 ? _a : "";
|
|
25
|
+
if (overflow && overflow !== "visible")
|
|
26
|
+
return el;
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
};
|
|
30
|
+
var THRESHOLDS = Array.from({ length: 25 }, function (_, i) { return i / 24; });
|
|
31
|
+
/**
|
|
32
|
+
* Keeps the button whole inside the pane it is drawn in: an invisible box at the button's own
|
|
33
|
+
* place is watched against the pane (an `IntersectionObserver`, so a pane scrolling the cell toward
|
|
34
|
+
* its edge is seen too), and the button is moved back inside by as much as that box sticks out —
|
|
35
|
+
* a cell one row above a split bar or the window's edge, where hanging below the cell would cut
|
|
36
|
+
* the button. Without `IntersectionObserver` (jsdom) the button stays at its place.
|
|
37
|
+
*/
|
|
38
|
+
var useKeepInsidePane = function (deps) {
|
|
39
|
+
var sentinelRef = (0, react_1.useRef)(null);
|
|
40
|
+
var _a = tslib_1.__read((0, react_1.useState)({ x: 0, y: 0 }), 2), shift = _a[0], setShift = _a[1];
|
|
41
|
+
(0, react_1.useEffect)(function () {
|
|
42
|
+
var _a;
|
|
43
|
+
var sentinel = sentinelRef.current;
|
|
44
|
+
var IO = (_a = sentinel === null || sentinel === void 0 ? void 0 : sentinel.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.IntersectionObserver;
|
|
45
|
+
if (!sentinel || !IO)
|
|
46
|
+
return;
|
|
47
|
+
var root = clipOf(sentinel);
|
|
48
|
+
if (!root)
|
|
49
|
+
return;
|
|
50
|
+
var observer = new IO(function (entries) {
|
|
51
|
+
var _a;
|
|
52
|
+
var entry = entries[entries.length - 1];
|
|
53
|
+
var box = entry.boundingClientRect;
|
|
54
|
+
var bounds = (_a = entry.rootBounds) !== null && _a !== void 0 ? _a : root.getBoundingClientRect();
|
|
55
|
+
var x = box.right > bounds.right
|
|
56
|
+
? bounds.right - box.right
|
|
57
|
+
: box.left < bounds.left
|
|
58
|
+
? bounds.left - box.left
|
|
59
|
+
: 0;
|
|
60
|
+
var y = box.bottom > bounds.bottom
|
|
61
|
+
? bounds.bottom - box.bottom
|
|
62
|
+
: box.top < bounds.top
|
|
63
|
+
? bounds.top - box.top
|
|
64
|
+
: 0;
|
|
65
|
+
setShift(function (prev) { return (prev.x === x && prev.y === y ? prev : { x: x, y: y }); });
|
|
66
|
+
}, { root: root, threshold: THRESHOLDS });
|
|
67
|
+
observer.observe(sentinel);
|
|
68
|
+
return function () { return observer.disconnect(); };
|
|
69
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
70
|
+
}, deps);
|
|
71
|
+
return { sentinelRef: sentinelRef, shift: shift };
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* The AutoCorrect Options glyph: a letter "A" with a lightning bolt at its shoulder, and a ▾ for
|
|
75
|
+
* the menu the button opens — the same reading as Excel's button, drawn here from scratch. Every
|
|
76
|
+
* mark is a path (no font), so it reads the same at 1× on every system.
|
|
77
|
+
*/
|
|
78
|
+
var AutoCorrectGlyph = function () { return (react_1.default.createElement("svg", { width: "20", height: "14", viewBox: "0 0 20 14", "aria-hidden": "true", "data-testid": "autocorrect-options-glyph" },
|
|
79
|
+
react_1.default.createElement("path", { d: "M1.2 13 5 2.2 8.8 13M2.6 9.4h4.8", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinejoin: "round" }),
|
|
80
|
+
react_1.default.createElement("path", { d: "M12.6 0.6 9.2 6.2h2.3l-1 4.4 4.1-6.1h-2.3l1.5-3.9z", fill: "#E8A317" }),
|
|
81
|
+
react_1.default.createElement("path", { d: "M15.6 7h4l-2 2.6z", fill: "currentColor" }))); };
|
|
10
82
|
/**
|
|
11
|
-
* Excel's AutoCorrect Options smart tag
|
|
12
|
-
* table column's formula into — ONE button, carrying the entries of
|
|
13
|
-
* (a formula typed in the column right of a table): "Undo Table
|
|
14
|
-
* Automatically Expanding Tables", and "Undo Calculated Column" (or
|
|
15
|
-
* column with this formula") / "Stop automatically creating
|
|
16
|
-
* host cannot carry out is not offered; with none left, no
|
|
83
|
+
* Excel's AutoCorrect Options smart tag, hanging from the bottom-right corner of the cell an edit
|
|
84
|
+
* grew a table from, or typed a table column's formula into — ONE button, carrying the entries of
|
|
85
|
+
* both when one edit did both (a formula typed in the column right of a table): "Undo Table
|
|
86
|
+
* AutoExpansion" / "Stop Automatically Expanding Tables", and "Undo Calculated Column" (or
|
|
87
|
+
* "Overwrite all cells in this column with this formula") / "Stop automatically creating
|
|
88
|
+
* calculated columns". An entry the host cannot carry out is not offered; with none left, no
|
|
89
|
+
* button.
|
|
17
90
|
*/
|
|
18
91
|
var AutoCorrectOptionsSmartTag = function (_a) {
|
|
19
|
-
var x = _a.x, y = _a.y, width = _a.width, tableAutoExpansion = _a.tableAutoExpansion, onChooseTableAutoExpansionOption = _a.onChooseTableAutoExpansionOption, calculatedColumn = _a.calculatedColumn, onChooseCalculatedColumnOption = _a.onChooseCalculatedColumnOption;
|
|
20
|
-
var
|
|
92
|
+
var x = _a.x, y = _a.y, width = _a.width, height = _a.height, tableAutoExpansion = _a.tableAutoExpansion, onChooseTableAutoExpansionOption = _a.onChooseTableAutoExpansionOption, calculatedColumn = _a.calculatedColumn, onChooseCalculatedColumnOption = _a.onChooseCalculatedColumnOption, _b = _a.placement, placement = _b === void 0 ? "outside" : _b;
|
|
93
|
+
var _c = tslib_1.__read((0, react_1.useState)(false), 2), open = _c[0], setOpen = _c[1];
|
|
94
|
+
var _d = useKeepInsidePane([
|
|
95
|
+
placement,
|
|
96
|
+
x,
|
|
97
|
+
y,
|
|
98
|
+
width,
|
|
99
|
+
height,
|
|
100
|
+
]), sentinelRef = _d.sentinelRef, shift = _d.shift;
|
|
21
101
|
var tableEntries = tableAutoExpansion && onChooseTableAutoExpansionOption
|
|
22
102
|
? tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read((tableAutoExpansion.canUndo
|
|
23
103
|
? [
|
|
@@ -45,7 +125,8 @@ var AutoCorrectOptionsSmartTag = function (_a) {
|
|
|
45
125
|
onSelect: function () { return onChooseCalculatedColumnOption("undo"); },
|
|
46
126
|
},
|
|
47
127
|
]
|
|
48
|
-
: [])), false), tslib_1.__read((calculatedColumn.kind !== "filled" &&
|
|
128
|
+
: [])), false), tslib_1.__read((calculatedColumn.kind !== "filled" &&
|
|
129
|
+
calculatedColumn.canOverwrite
|
|
49
130
|
? [
|
|
50
131
|
{
|
|
51
132
|
key: "column-overwrite",
|
|
@@ -69,16 +150,20 @@ var AutoCorrectOptionsSmartTag = function (_a) {
|
|
|
69
150
|
tableEntries.length ? "table-auto-expansion" : undefined,
|
|
70
151
|
columnEntries.length ? "calculated-column" : undefined,
|
|
71
152
|
].filter(Boolean);
|
|
72
|
-
return (react_1.default.createElement("div", { className: "absolute pointer-events-auto flex items-start justify-start", style: {
|
|
73
|
-
react_1.default.createElement(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
react_1.default.createElement(ui_1.
|
|
78
|
-
react_1.default.createElement(ui_1.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
153
|
+
return (react_1.default.createElement("div", { className: "absolute pointer-events-auto flex items-start justify-start", style: placementStyle(placement, { x: x, y: y, width: width, height: height }), onMouseDown: function (e) { return e.stopPropagation(); }, "data-testid": "autocorrect-options", "data-autocorrect": kinds.join(" "), "data-placement": placement },
|
|
154
|
+
react_1.default.createElement("div", { ref: sentinelRef, "aria-hidden": "true", className: "absolute inset-0 invisible pointer-events-none" }),
|
|
155
|
+
react_1.default.createElement("div", { style: shift.x || shift.y
|
|
156
|
+
? { transform: "translate(".concat(shift.x, "px, ").concat(shift.y, "px)") }
|
|
157
|
+
: undefined },
|
|
158
|
+
react_1.default.createElement(ui_1.DropdownMenu, { modal: false, open: open, onOpenChange: setOpen },
|
|
159
|
+
react_1.default.createElement(ui_1.DropdownMenuTrigger, { asChild: true },
|
|
160
|
+
react_1.default.createElement(ui_1.IconButton, { tooltip: "AutoCorrect Options", "aria-label": "AutoCorrect Options", className: "shadow-sm bg-rnc-background border-rnc-border border border-solid rounded-md" },
|
|
161
|
+
react_1.default.createElement(AutoCorrectGlyph, null))),
|
|
162
|
+
react_1.default.createElement(ui_1.DropdownMenuPortal, null,
|
|
163
|
+
react_1.default.createElement(ui_1.DropdownMenuContent, { align: "start", onCloseAutoFocus: function (event) { return event.preventDefault(); } },
|
|
164
|
+
tableEntries.map(function (entry) { return (react_1.default.createElement(ui_1.DropdownMenuItem, { key: entry.key, onSelect: entry.onSelect }, entry.label)); }),
|
|
165
|
+
tableEntries.length && columnEntries.length ? (react_1.default.createElement(ui_1.DropdownMenuSeparator, null)) : null,
|
|
166
|
+
columnEntries.map(function (entry) { return (react_1.default.createElement(ui_1.DropdownMenuItem, { key: entry.key, onSelect: entry.onSelect }, entry.label)); })))))));
|
|
82
167
|
};
|
|
83
168
|
exports.AutoCorrectOptionsSmartTag = AutoCorrectOptionsSmartTag;
|
|
84
169
|
exports.AutoCorrectOptionsSmartTag.displayName = "AutoCorrectOptionsSmartTag";
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { CellInterface, CellPosition, ItemSizeHint } from "@rowsncolumns/grid";
|
|
2
|
+
/**
|
|
3
|
+
* A sheet frozen while scrolled (demo-app-monorepo#57258 W-5): Excel's Freeze Panes on a sheet
|
|
4
|
+
* scrolled to row 40 freezes from row 40, and rows 1 … 39 stay out of view above the frozen band
|
|
5
|
+
* (`<sheetView topLeftCell>` of a frozen view, stored as `frozenRowStart` / `frozenColumnStart`).
|
|
6
|
+
*
|
|
7
|
+
* The grid draws this with two things only: the rows / columns above the start get NO SIZE in what
|
|
8
|
+
* the grid lays out, and the grid's frozen count covers them (`start − 1 + count`). Everything that
|
|
9
|
+
* is not layout (copy, paste, fill, sort, filters, Find, auto-fit, export, print, the stored sizes)
|
|
10
|
+
* keeps reading the sheet's own sizes and sees those rows as ordinary rows. With no start (or a
|
|
11
|
+
* start of 1) every helper here hands back what it was given, so nothing changes.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* How many rows (or columns) sit above the frozen start: `start − 1`, or 0 when there is no start,
|
|
15
|
+
* the start is 1, nothing is frozen on that axis, or the frozen area would run past the sheet (the
|
|
16
|
+
* engine does not store such a start; a hand-edited document is drawn as if it had none).
|
|
17
|
+
*/
|
|
18
|
+
export declare const linesAboveFrozenStart: (start: number | null | undefined, frozenCount: number | null | undefined, lineCount: number) => number;
|
|
19
|
+
/** Whether a grid row / column index (1-based sheet line) lies above the frozen start. */
|
|
20
|
+
export declare const isAboveFrozenStart: (index: number, linesAbove: number) => boolean;
|
|
21
|
+
/** The grid's size function: lines above the start have no size. The same function without a start. */
|
|
22
|
+
export declare const sizeAboveFrozenStartZero: (size: (index: number) => number, linesAbove: number) => ((index: number) => number);
|
|
23
|
+
type Range = {
|
|
24
|
+
start: number;
|
|
25
|
+
end: number;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The grid's visible row ranges without the rows above the start: the grid treats rows outside
|
|
29
|
+
* them as having no height (its size-hint path never asks their size). The same array without a
|
|
30
|
+
* start.
|
|
31
|
+
*/
|
|
32
|
+
export declare const rangesWithoutLinesAboveFrozenStart: <T extends Range>(ranges: T[], linesAbove: number) => T[];
|
|
33
|
+
/**
|
|
34
|
+
* The grid's column size hint with the columns above the start listed as exceptions (the grid then
|
|
35
|
+
* asks their size, which is 0). At most 16,383 columns; the same hint without a start.
|
|
36
|
+
*/
|
|
37
|
+
export declare const sizeHintWithLinesAboveFrozenStart: (hint: ItemSizeHint, linesAbove: number) => ItemSizeHint;
|
|
38
|
+
/**
|
|
39
|
+
* The sum of the sheet's own (unscaled) sizes of lines `from … to`, measured the way the grid's
|
|
40
|
+
* size hint describes them: `defaultSize` for every line between exceptions, `size(e)` for an
|
|
41
|
+
* exception, 0 for a line outside `visibleRanges` (rows hidden by a filter). O(exceptions and ranges
|
|
42
|
+
* in the span), whatever its length, so a start at row 1,000,000 costs no more than one at row 40.
|
|
43
|
+
*/
|
|
44
|
+
export declare const sumLineSizes: ({ from, to, size, hint, visibleRanges, }: {
|
|
45
|
+
from: number;
|
|
46
|
+
to: number;
|
|
47
|
+
size: (index: number) => number;
|
|
48
|
+
hint: ItemSizeHint;
|
|
49
|
+
visibleRanges?: Range[];
|
|
50
|
+
}) => number;
|
|
51
|
+
/**
|
|
52
|
+
* Where an OBJECT lays out a cell (charts, pictures, slicers): the grid's own answer, except for a
|
|
53
|
+
* cell above the frozen start, which is placed where it would be if those lines kept their size:
|
|
54
|
+
* that far above the first frozen line. An object anchored there is then drawn cut at the top of
|
|
55
|
+
* the frozen band (or not at all, when it lies wholly above), never squashed onto the band's edge.
|
|
56
|
+
* `distanceAbove(axis, index)` is the scaled distance from the line's top / left edge to the start.
|
|
57
|
+
*/
|
|
58
|
+
export declare const objectCellOffsetAboveFrozenStart: ({ getCellOffsetFromCoords, rowsAbove, columnsAbove, rowSize, columnSize, distanceAbove, }: {
|
|
59
|
+
getCellOffsetFromCoords: (cell: CellInterface) => CellPosition | undefined;
|
|
60
|
+
rowsAbove: number;
|
|
61
|
+
columnsAbove: number;
|
|
62
|
+
/** Scaled size of one line, as the sheet stores it. */
|
|
63
|
+
rowSize: (index: number) => number;
|
|
64
|
+
columnSize: (index: number) => number;
|
|
65
|
+
distanceAbove: (axis: "row" | "column", index: number) => number;
|
|
66
|
+
}) => (cell: CellInterface) => CellPosition | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Freeze Panes up to a line ("Freeze up to Row 45"): Excel freezes from the top line on screen,
|
|
69
|
+
* `firstShown`, so the count is measured from there and the start is sent when it is not line 1. A
|
|
70
|
+
* line above `firstShown` (reached with the keyboard on a sheet frozen from a start) freezes from
|
|
71
|
+
* line 1. 0 unfreezes, and an unfreeze carries no start.
|
|
72
|
+
*/
|
|
73
|
+
export declare const freezeUpTo: (line: number, firstShown: number) => {
|
|
74
|
+
count: number;
|
|
75
|
+
start?: number;
|
|
76
|
+
};
|
|
77
|
+
/** One axis of a frozen area as the grid lays it out: lines above the start, frozen lines. */
|
|
78
|
+
export type FrozenAxis = {
|
|
79
|
+
lines: number;
|
|
80
|
+
count: number;
|
|
81
|
+
};
|
|
82
|
+
/** A freeze or unfreeze this window sent and has not seen arrive yet. */
|
|
83
|
+
export type PendingFreeze = {
|
|
84
|
+
expected: FrozenAxis;
|
|
85
|
+
scrollBefore: number;
|
|
86
|
+
};
|
|
87
|
+
/** The last freeze or unfreeze from a start this window made: its undo and redo are this window's. */
|
|
88
|
+
export type LocalFreeze = {
|
|
89
|
+
before: FrozenAxis;
|
|
90
|
+
after: FrozenAxis;
|
|
91
|
+
scrollBefore: number;
|
|
92
|
+
};
|
|
93
|
+
/** Where the view was on one axis before a frozen area changed, read in the old layout. */
|
|
94
|
+
export type FrozenViewSnapshot = {
|
|
95
|
+
/** The first scrolling line on screen. */
|
|
96
|
+
topLine: number;
|
|
97
|
+
/** How far into it the view was scrolled (px). */
|
|
98
|
+
intoLine: number;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Where one axis of the view goes when its frozen area changes and a start is involved
|
|
102
|
+
* (demo-app-monorepo#57258 W-5). `undefined` = leave the scroll position as it is (every change
|
|
103
|
+
* without a start, as before).
|
|
104
|
+
*
|
|
105
|
+
* - **A freeze or unfreeze this window sent** (`pending`, matched by the area it asked for): freezing
|
|
106
|
+
* from a start puts the scrolling area right below the band (0); unfreezing keeps the start's line
|
|
107
|
+
* first on screen. This window's next undo / redo of it is remembered (`local`).
|
|
108
|
+
* - **This window's undo of that change** (the area goes back from `local.after` to `local.before`):
|
|
109
|
+
* back where the window was before the change. Its redo: as the change itself.
|
|
110
|
+
* - **Anything else** (another window's freeze, unfreeze, undo or redo): the same line stays first on
|
|
111
|
+
* screen, at the same depth; the scroll moves by the band's change. When that line now lies in the
|
|
112
|
+
* band or above the start it cannot stay: the view lands on the first scrolling line (0).
|
|
113
|
+
*
|
|
114
|
+
* `offset(index)` is a line's offset in the NEW layout; scroll positions are measured from the first
|
|
115
|
+
* scrolling line, as the grid's are.
|
|
116
|
+
*/
|
|
117
|
+
export declare const frozenStartScroll: ({ before, after, pending, local, snapshot, offset, }: {
|
|
118
|
+
before: FrozenAxis;
|
|
119
|
+
after: FrozenAxis;
|
|
120
|
+
pending?: PendingFreeze;
|
|
121
|
+
local?: LocalFreeze;
|
|
122
|
+
snapshot?: FrozenViewSnapshot;
|
|
123
|
+
offset: (index: number) => number;
|
|
124
|
+
}) => {
|
|
125
|
+
scroll?: number;
|
|
126
|
+
consumed: boolean;
|
|
127
|
+
local?: LocalFreeze;
|
|
128
|
+
};
|
|
129
|
+
export {};
|
|
130
|
+
//# sourceMappingURL=frozen-start.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frozen-start.d.ts","sourceRoot":"","sources":["../../../../components/canvas-grid/frozen-start.ts"],"names":[],"mappings":"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"}
|