@gridsheet/react-core 3.0.0-rc.2 → 3.0.0-rc.4
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/components/Cell.d.ts.map +1 -1
- package/dist/components/ColumnMenu.d.ts.map +1 -1
- package/dist/components/ColumnMenuFilterSection.d.ts +5 -0
- package/dist/components/ColumnMenuFilterSection.d.ts.map +1 -0
- package/dist/components/ColumnMenuLabelSection.d.ts +5 -0
- package/dist/components/ColumnMenuLabelSection.d.ts.map +1 -0
- package/dist/components/ColumnMenuSortSection.d.ts +5 -0
- package/dist/components/ColumnMenuSortSection.d.ts.map +1 -0
- package/dist/components/ContextMenu.d.ts +0 -19
- package/dist/components/ContextMenu.d.ts.map +1 -1
- package/dist/components/Editor.d.ts.map +1 -1
- package/dist/components/EditorOptions.d.ts.map +1 -1
- package/dist/components/FormulaBar.d.ts.map +1 -1
- package/dist/components/FunctionGuide.d.ts.map +1 -1
- package/dist/components/GridSheet.d.ts +6 -4
- package/dist/components/GridSheet.d.ts.map +1 -1
- package/dist/components/HeaderCellLeft.d.ts.map +1 -1
- package/dist/components/HeaderCellTop.d.ts.map +1 -1
- package/dist/components/MenuItem.d.ts +18 -0
- package/dist/components/MenuItem.d.ts.map +1 -0
- package/dist/components/PluginBase.d.ts +2 -2
- package/dist/components/PluginBase.d.ts.map +1 -1
- package/dist/components/RowMenu.d.ts.map +1 -1
- package/dist/components/StoreObserver.d.ts +7 -4
- package/dist/components/StoreObserver.d.ts.map +1 -1
- package/dist/components/Tabular.d.ts.map +1 -1
- package/dist/constants.d.ts +3 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/formula/evaluator.d.ts +28 -25
- package/dist/formula/evaluator.d.ts.map +1 -1
- package/dist/formula/formula-error.d.ts +1 -1
- package/dist/formula/formula-error.d.ts.map +1 -1
- package/dist/formula/functions/__async.d.ts +9 -9
- package/dist/formula/functions/__async.d.ts.map +1 -1
- package/dist/formula/functions/__base.d.ts +14 -21
- package/dist/formula/functions/__base.d.ts.map +1 -1
- package/dist/formula/functions/__utils.d.ts +2 -2
- package/dist/formula/functions/__utils.d.ts.map +1 -1
- package/dist/formula/functions/add.d.ts.map +1 -1
- package/dist/formula/functions/minus.d.ts +0 -1
- package/dist/formula/functions/minus.d.ts.map +1 -1
- package/dist/formula/solver.d.ts +25 -14
- package/dist/formula/solver.d.ts.map +1 -1
- package/dist/index.d.ts +16 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4487 -4524
- package/dist/index.js.map +1 -1
- package/dist/lib/autofill.d.ts +3 -3
- package/dist/lib/autofill.d.ts.map +1 -1
- package/dist/lib/{hub.d.ts → book.d.ts} +28 -27
- package/dist/lib/book.d.ts.map +1 -0
- package/dist/lib/cell.d.ts +6 -4
- package/dist/lib/cell.d.ts.map +1 -1
- package/dist/lib/clipboard.d.ts +7 -7
- package/dist/lib/coords.d.ts +13 -1
- package/dist/lib/coords.d.ts.map +1 -1
- package/dist/lib/dom.d.ts +5 -0
- package/dist/lib/dom.d.ts.map +1 -1
- package/dist/lib/input.d.ts +2 -2
- package/dist/lib/label.d.ts +4 -0
- package/dist/lib/label.d.ts.map +1 -0
- package/dist/lib/menu.d.ts +99 -0
- package/dist/lib/menu.d.ts.map +1 -0
- package/dist/lib/popup.d.ts +24 -0
- package/dist/lib/popup.d.ts.map +1 -0
- package/dist/lib/reference.d.ts +10 -4
- package/dist/lib/reference.d.ts.map +1 -1
- package/dist/lib/sheet.d.ts +507 -2
- package/dist/lib/sheet.d.ts.map +1 -1
- package/dist/lib/sheet_utils.d.ts +55 -0
- package/dist/lib/sheet_utils.d.ts.map +1 -0
- package/dist/lib/spatial.d.ts +5 -20
- package/dist/lib/spatial.d.ts.map +1 -1
- package/dist/lib/virtualization.d.ts +4 -4
- package/dist/policy/core.d.ts +13 -13
- package/dist/policy/core.d.ts.map +1 -1
- package/dist/sentinels.d.ts +3 -2
- package/dist/sentinels.d.ts.map +1 -1
- package/dist/store/actions.d.ts +3 -3
- package/dist/store/actions.d.ts.map +1 -1
- package/dist/store/dispatchers.d.ts +38 -34
- package/dist/store/dispatchers.d.ts.map +1 -1
- package/dist/store/helpers.d.ts +10 -5
- package/dist/store/helpers.d.ts.map +1 -1
- package/dist/styles/minified.d.ts +2 -2
- package/dist/styles/minified.d.ts.map +1 -1
- package/dist/types.d.ts +51 -35
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/lib/hub.d.ts.map +0 -1
- package/dist/lib/table.d.ts +0 -484
- package/dist/lib/table.d.ts.map +0 -1
package/dist/lib/autofill.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { AreaType, PointType, StoreType } from '../types';
|
|
2
|
-
import {
|
|
2
|
+
import { Sheet } from './sheet';
|
|
3
3
|
import { CSSProperties } from 'react';
|
|
4
4
|
export declare class Autofill {
|
|
5
5
|
private readonly src;
|
|
6
6
|
private readonly dst;
|
|
7
7
|
private readonly direction;
|
|
8
|
-
private readonly
|
|
8
|
+
private readonly sheet;
|
|
9
9
|
constructor(store: StoreType, draggingTo: PointType);
|
|
10
|
-
get applied():
|
|
10
|
+
get applied(): Sheet;
|
|
11
11
|
get wholeArea(): AreaType;
|
|
12
12
|
getCellStyle(target: PointType): CSSProperties;
|
|
13
13
|
private getDestinationArea;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autofill.d.ts","sourceRoot":"","sources":["../../src/lib/autofill.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAgC,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC7F,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKhC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAgBtC,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAW;IAC/B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAW;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;gBAClB,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS;IAYnD,IAAW,OAAO,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"autofill.d.ts","sourceRoot":"","sources":["../../src/lib/autofill.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAgC,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC7F,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKhC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAgBtC,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAW;IAC/B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAW;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;gBAClB,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS;IAYnD,IAAW,OAAO,IAAI,KAAK,CAiE1B;IAED,IAAW,SAAS,aAEnB;IAEM,YAAY,CAAC,MAAM,EAAE,SAAS;IAmErC,OAAO,CAAC,kBAAkB;IAgB1B,OAAO,CAAC,gBAAgB;IA8BxB,OAAO,CAAC,iBAAiB;CA4F1B"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Pending } from '../sentinels';
|
|
2
|
-
import { HistoryType, RefPaletteType, SheetIdsByName, ContextsBySheetId, ZoneType, CellsByIdType, Id, FeedbackType, EditorEvent, CursorStateType } from '../types';
|
|
3
|
-
import {
|
|
2
|
+
import { HistoryType, RefPaletteType, SheetIdsByName, ContextsBySheetId, ZoneType, CellsByIdType, SystemsByIdType, Id, FeedbackType, EditorEvent, CursorStateType } from '../types';
|
|
3
|
+
import { UserSheet } from './sheet';
|
|
4
4
|
import { FunctionMapping } from '../formula/functions/__base';
|
|
5
5
|
import { PolicyType } from '../policy/core';
|
|
6
|
-
export type
|
|
6
|
+
export type RegistryProps = {
|
|
7
7
|
historyLimit?: number;
|
|
8
8
|
additionalFunctions?: FunctionMapping;
|
|
9
9
|
policies?: {
|
|
@@ -12,20 +12,20 @@ export type WireProps = {
|
|
|
12
12
|
onSave?: FeedbackType;
|
|
13
13
|
onChange?: FeedbackType;
|
|
14
14
|
onRemoveRows?: (args: {
|
|
15
|
-
|
|
15
|
+
sheet: UserSheet;
|
|
16
16
|
ys: number[];
|
|
17
17
|
}) => void;
|
|
18
18
|
onRemoveCols?: (args: {
|
|
19
|
-
|
|
19
|
+
sheet: UserSheet;
|
|
20
20
|
xs: number[];
|
|
21
21
|
}) => void;
|
|
22
22
|
onInsertRows?: (args: {
|
|
23
|
-
|
|
23
|
+
sheet: UserSheet;
|
|
24
24
|
y: number;
|
|
25
25
|
numRows: number;
|
|
26
26
|
}) => void;
|
|
27
27
|
onInsertCols?: (args: {
|
|
28
|
-
|
|
28
|
+
sheet: UserSheet;
|
|
29
29
|
x: number;
|
|
30
30
|
numCols: number;
|
|
31
31
|
}) => void;
|
|
@@ -35,14 +35,15 @@ export type WireProps = {
|
|
|
35
35
|
points: CursorStateType;
|
|
36
36
|
}) => void;
|
|
37
37
|
onInit?: (args: {
|
|
38
|
-
|
|
38
|
+
sheet: UserSheet;
|
|
39
39
|
}) => void;
|
|
40
40
|
};
|
|
41
|
-
export type
|
|
42
|
-
export declare class
|
|
41
|
+
export type BookProps = RegistryProps;
|
|
42
|
+
export declare class Registry {
|
|
43
43
|
sheetHead: number;
|
|
44
44
|
cellHead: number;
|
|
45
45
|
data: CellsByIdType;
|
|
46
|
+
systems: SystemsByIdType;
|
|
46
47
|
sheetIdsByName: SheetIdsByName;
|
|
47
48
|
contextsBySheetId: ContextsBySheetId;
|
|
48
49
|
choosingSheetId: number;
|
|
@@ -54,8 +55,6 @@ export declare class Wire {
|
|
|
54
55
|
};
|
|
55
56
|
lastFocused: HTMLTextAreaElement | null;
|
|
56
57
|
solvedCaches: Map<Id, any>;
|
|
57
|
-
/** Maps each cell id to the set of cell ids whose formula depends on it. */
|
|
58
|
-
dependents: Map<Id, Set<Id>>;
|
|
59
58
|
/** IDs of non-origin cells that received spilled values (populated in spill(), cleared in clearSolvedCaches()). */
|
|
60
59
|
lastSpilledTargetIds: Set<Id>;
|
|
61
60
|
/** Currently in-flight async formula Pending sentinels (keyed by cell ID). */
|
|
@@ -81,20 +80,20 @@ export declare class Wire {
|
|
|
81
80
|
onSave?: FeedbackType;
|
|
82
81
|
onChange?: FeedbackType;
|
|
83
82
|
onRemoveRows?: (args: {
|
|
84
|
-
|
|
83
|
+
sheet: UserSheet;
|
|
85
84
|
ys: number[];
|
|
86
85
|
}) => void;
|
|
87
86
|
onRemoveCols?: (args: {
|
|
88
|
-
|
|
87
|
+
sheet: UserSheet;
|
|
89
88
|
xs: number[];
|
|
90
89
|
}) => void;
|
|
91
90
|
onInsertRows?: (args: {
|
|
92
|
-
|
|
91
|
+
sheet: UserSheet;
|
|
93
92
|
y: number;
|
|
94
93
|
numRows: number;
|
|
95
94
|
}) => void;
|
|
96
95
|
onInsertCols?: (args: {
|
|
97
|
-
|
|
96
|
+
sheet: UserSheet;
|
|
98
97
|
x: number;
|
|
99
98
|
numCols: number;
|
|
100
99
|
}) => void;
|
|
@@ -104,17 +103,19 @@ export declare class Wire {
|
|
|
104
103
|
points: CursorStateType;
|
|
105
104
|
}) => void;
|
|
106
105
|
onInit?: (args: {
|
|
107
|
-
|
|
106
|
+
sheet: UserSheet;
|
|
108
107
|
}) => void;
|
|
109
|
-
transmit: (
|
|
110
|
-
|
|
111
|
-
constructor({ historyLimit, additionalFunctions, policies, onSave, onChange, onRemoveRows, onRemoveCols, onInsertRows, onInsertCols, onSelect, onKeyUp, onInit, }?:
|
|
108
|
+
transmit: (newBook?: TransmitProps) => void;
|
|
109
|
+
boot(): void;
|
|
110
|
+
constructor({ historyLimit, additionalFunctions, policies, onSave, onChange, onRemoveRows, onRemoveCols, onInsertRows, onInsertCols, onSelect, onKeyUp, onInit, }?: RegistryProps);
|
|
112
111
|
}
|
|
113
|
-
export type TransmitProps = Partial<
|
|
114
|
-
export declare const
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
export type TransmitProps = Partial<Registry>;
|
|
113
|
+
export declare const createRegistry: (props?: RegistryProps) => Registry;
|
|
114
|
+
/** @deprecated use createRegistry */
|
|
115
|
+
export declare const createBinding: (props?: RegistryProps) => Registry;
|
|
116
|
+
export type BookType = {
|
|
117
|
+
registry: Registry;
|
|
117
118
|
};
|
|
118
|
-
export declare const
|
|
119
|
-
export declare const
|
|
120
|
-
//# sourceMappingURL=
|
|
119
|
+
export declare const createBook: (props?: RegistryProps) => BookType;
|
|
120
|
+
export declare const useBook: (props?: RegistryProps) => BookType;
|
|
121
|
+
//# sourceMappingURL=book.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"book.d.ts","sourceRoot":"","sources":["../../src/lib/book.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,QAAQ,EACR,aAAa,EACb,eAAe,EAEf,EAAE,EAEF,YAAY,EACZ,WAAW,EACX,eAAe,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,CAAC,EAAE,eAAe,CAAC;IACtC,QAAQ,CAAC,EAAE;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAAA;KAAE,CAAC;IACvD,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AI,QAAO,aAAkB,aAchD,CAAC"}
|
package/dist/lib/cell.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { AsyncCache, CellType, System } from '../types';
|
|
2
2
|
export declare const filterCellFields: (cell: CellType, ignoreFields: (keyof CellType)[]) => CellType;
|
|
3
3
|
/**
|
|
4
|
-
* Ensure that `
|
|
5
|
-
* when missing. Any keys present in `defaults` that are absent on
|
|
6
|
-
* existing
|
|
4
|
+
* Ensure that `registry.systems[id]` exists, initialising it with sensible
|
|
5
|
+
* defaults when missing. Any keys present in `defaults` that are absent on
|
|
6
|
+
* the existing System object are filled in.
|
|
7
7
|
* Returns the (possibly freshly-created) `System` object.
|
|
8
8
|
*/
|
|
9
|
-
export declare const ensureSys: (
|
|
9
|
+
export declare const ensureSys: (registry: {
|
|
10
|
+
systems: Record<string, System>;
|
|
11
|
+
}, id: string, defaults?: Partial<System>) => System;
|
|
10
12
|
/**
|
|
11
13
|
* Write an `AsyncCache` entry into `cell.asyncCaches[key]`, creating the
|
|
12
14
|
* `asyncCaches` record if it does not yet exist.
|
package/dist/lib/cell.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../../src/lib/cell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAE7D,eAAO,MAAM,gBAAgB,GAAI,MAAM,QAAQ,EAAE,cAAc,CAAC,MAAM,QAAQ,CAAC,EAAE,KAAG,QAOnF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../../src/lib/cell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAE7D,eAAO,MAAM,gBAAgB,GAAI,MAAM,QAAQ,EAAE,cAAc,CAAC,MAAM,QAAQ,CAAC,EAAE,KAAG,QAOnF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GACpB,UAAU;IAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,EAC7C,IAAI,MAAM,EACV,WAAU,OAAO,CAAC,MAAM,CAAM,KAC7B,MASF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,QAAQ,EAAE,KAAK,MAAM,EAAE,IAAI,UAAU,KAAG,IAK3E,CAAC"}
|
package/dist/lib/clipboard.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { StoreType, AreaType, PointType } from '../types';
|
|
2
|
-
import {
|
|
2
|
+
import { UserSheet } from './sheet';
|
|
3
3
|
export declare const clip: (store: StoreType) => AreaType;
|
|
4
|
-
export type
|
|
5
|
-
getter?: (
|
|
4
|
+
export type SheetCSVProps = {
|
|
5
|
+
getter?: (sheet: UserSheet, point: PointType) => string;
|
|
6
6
|
filteredRowsIncluded?: boolean;
|
|
7
7
|
trailingEmptyRowsOmitted?: boolean;
|
|
8
8
|
separator?: string;
|
|
9
9
|
newline?: string;
|
|
10
10
|
};
|
|
11
|
-
export declare const
|
|
12
|
-
export type
|
|
13
|
-
getter?: (
|
|
11
|
+
export declare const sheet2csv: (sheet: UserSheet, { getter, filteredRowsIncluded, trailingEmptyRowsOmitted, separator, newline, }?: SheetCSVProps) => string;
|
|
12
|
+
export type SheetHTMLProps = {
|
|
13
|
+
getter?: (sheet: UserSheet, point: PointType) => string;
|
|
14
14
|
filteredRowsIncluded?: boolean;
|
|
15
15
|
trailingEmptyRowsOmitted?: boolean;
|
|
16
16
|
};
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const sheet2html: (sheet: UserSheet, { getter, filteredRowsIncluded, trailingEmptyRowsOmitted, }?: SheetHTMLProps) => string;
|
|
18
18
|
//# sourceMappingURL=clipboard.d.ts.map
|
package/dist/lib/coords.d.ts
CHANGED
|
@@ -3,8 +3,20 @@ export declare const x2c: (x: number) => string;
|
|
|
3
3
|
export declare const c2x: (col: string, absolute?: boolean) => number;
|
|
4
4
|
export declare const y2r: (y: number) => string;
|
|
5
5
|
export declare const r2y: (row: number | string, absolute?: boolean) => number;
|
|
6
|
-
export declare const p2a: ({ y, x, absX, absY }: ExtraPointType) => string;
|
|
6
|
+
export declare const p2a: ({ y, x, absX, absY }: Partial<ExtraPointType>) => string;
|
|
7
7
|
export declare const a2p: (address: Address) => ExtraPointType;
|
|
8
8
|
export declare const grantAddressAbsolute: (address: Address, absCol: boolean, absRow: boolean) => string;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the row header cell address for a given row number by prepending `0`.
|
|
11
|
+
* e.g. rh(6) → '06', rh(1) → '01'
|
|
12
|
+
*/
|
|
13
|
+
export declare const rh: (y: number) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the column header cell address for a given column letter or column index
|
|
16
|
+
* (1-based, same as point.x) by appending `0`.
|
|
17
|
+
* e.g. ch('A') → 'A0', ch(1) → 'A0'
|
|
18
|
+
*/
|
|
19
|
+
export declare const ch: (col: string | number) => string;
|
|
9
20
|
export declare const stripAddressAbsolute: (address: Address) => string;
|
|
21
|
+
export declare const buildIdentifiedRef: (id: string, absX?: boolean, absY?: boolean) => string;
|
|
10
22
|
//# sourceMappingURL=coords.d.ts.map
|
package/dist/lib/coords.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coords.d.ts","sourceRoot":"","sources":["../../src/lib/coords.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAa,cAAc,EAAE,MAAM,UAAU,CAAC;AAwDnE,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,KAAG,MAM/B,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,KAAK,MAAM,EAAE,kBAAgB,KAAG,MAGnD,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,WAK5B,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,KAAK,MAAM,GAAG,MAAM,EAAE,kBAAgB,WAKzD,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,sBAAsB,cAAc,
|
|
1
|
+
{"version":3,"file":"coords.d.ts","sourceRoot":"","sources":["../../src/lib/coords.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAa,cAAc,EAAE,MAAM,UAAU,CAAC;AAwDnE,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,KAAG,MAM/B,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,KAAK,MAAM,EAAE,kBAAgB,KAAG,MAGnD,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,WAK5B,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,KAAK,MAAM,GAAG,MAAM,EAAE,kBAAgB,WAKzD,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,sBAAsB,OAAO,CAAC,cAAc,CAAC,WAOhE,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,SAAS,OAAO,KAAG,cAWtC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,SAAS,OAAO,EAAE,QAAQ,OAAO,EAAE,QAAQ,OAAO,WAOtF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,EAAE,GAAI,GAAG,MAAM,KAAG,MAAiB,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,EAAE,GAAI,KAAK,MAAM,GAAG,MAAM,KAAG,MAC0B,CAAC;AAErE,eAAO,MAAM,oBAAoB,GAAI,SAAS,OAAO,WAEpD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,IAAI,MAAM,EAAE,cAAY,EAAE,cAAY,KAAG,MAE3E,CAAC"}
|
package/dist/lib/dom.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
export declare const focus: (el: HTMLElement | null | undefined) => void;
|
|
2
|
+
/**
|
|
3
|
+
* Prevents Safari elastic bounce (rubber-band) at scroll boundaries.
|
|
4
|
+
* No-op on non-Safari browsers. Returns a cleanup function to remove the listeners.
|
|
5
|
+
*/
|
|
6
|
+
export declare const preventSafariBounce: (el: HTMLDivElement) => (() => void);
|
|
2
7
|
//# sourceMappingURL=dom.d.ts.map
|
package/dist/lib/dom.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/lib/dom.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,GAAI,IAAI,WAAW,GAAG,IAAI,GAAG,SAAS,SAEvD,CAAC"}
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/lib/dom.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,GAAI,IAAI,WAAW,GAAG,IAAI,GAAG,SAAS,SAEvD,CAAC;AAKF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,IAAI,cAAc,KAAG,CAAC,MAAM,IAAI,CAmDnE,CAAC"}
|
package/dist/lib/input.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PointType } from '../types';
|
|
2
|
-
import {
|
|
2
|
+
import { Sheet } from './sheet';
|
|
3
3
|
export declare const insertTextAtCursor: (input: HTMLTextAreaElement, text: string) => void;
|
|
4
4
|
type InsertRefProps = {
|
|
5
5
|
input: HTMLTextAreaElement | null;
|
|
@@ -9,7 +9,7 @@ type InsertRefProps = {
|
|
|
9
9
|
export declare const insertRef: ({ input, ref, dryRun }: InsertRefProps) => boolean;
|
|
10
10
|
export declare const isRefInsertable: (input: HTMLTextAreaElement | null) => boolean;
|
|
11
11
|
export declare const expandInput: (input: HTMLTextAreaElement | null) => void;
|
|
12
|
-
export declare const resetInput: (input: HTMLTextAreaElement | null,
|
|
12
|
+
export declare const resetInput: (input: HTMLTextAreaElement | null, sheet: Sheet, point: PointType) => void;
|
|
13
13
|
export declare const isFocus: (input: HTMLTextAreaElement | null) => boolean;
|
|
14
14
|
/**
|
|
15
15
|
* Handles auto-close behavior for double quotes in formula editing.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../src/lib/label.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,EAAE,OAAO,MAAM,GAAG,SAAS,EAAE,OAAO,SAAS,EAAE,GAAG,MAAM,KAAG,MAAM,GAAG,IAM5G,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { PointType, ZoneType, FilterConfig, StoreType } from '../types';
|
|
2
|
+
import { UserSheet } from './sheet';
|
|
3
|
+
import { Dispatcher } from '../store';
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
export type MenuContext = {
|
|
6
|
+
/** Current sheet instance */
|
|
7
|
+
sheet: UserSheet;
|
|
8
|
+
/** Currently focused cell */
|
|
9
|
+
choosing: PointType;
|
|
10
|
+
/** Currently selected zone */
|
|
11
|
+
selectingZone: ZoneType;
|
|
12
|
+
/** True when the left (row) header is being selected */
|
|
13
|
+
leftHeaderSelecting: boolean;
|
|
14
|
+
/** True when the top (column) header is being selected */
|
|
15
|
+
topHeaderSelecting: boolean;
|
|
16
|
+
cut(): Promise<void>;
|
|
17
|
+
copy(): Promise<void>;
|
|
18
|
+
paste(onlyValue?: boolean): Promise<void>;
|
|
19
|
+
undo(): void;
|
|
20
|
+
redo(): void;
|
|
21
|
+
insertRowsAbove(y: number, numRows: number): void;
|
|
22
|
+
insertRowsBelow(y: number, numRows: number): void;
|
|
23
|
+
removeRows(y: number, numRows: number): void;
|
|
24
|
+
insertColsLeft(x: number, numCols: number): void;
|
|
25
|
+
insertColsRight(x: number, numCols: number): void;
|
|
26
|
+
removeCols(x: number, numCols: number): void;
|
|
27
|
+
sortRows(x: number, direction: 'asc' | 'desc'): Promise<void>;
|
|
28
|
+
filterRows(x: number, filter?: FilterConfig): Promise<void>;
|
|
29
|
+
clearFilter(x?: number): void;
|
|
30
|
+
toggleSortFixed(y: number): void;
|
|
31
|
+
toggleFilterFixed(y: number): void;
|
|
32
|
+
search(): void;
|
|
33
|
+
updateColLabel(x: number, label: string | undefined): void;
|
|
34
|
+
/** Close the currently open menu */
|
|
35
|
+
close(): void;
|
|
36
|
+
};
|
|
37
|
+
export type MenuDividerItem = {
|
|
38
|
+
type: 'divider';
|
|
39
|
+
visible?: (ctx: MenuContext) => boolean;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Base structure shared by all menu item descriptors.
|
|
43
|
+
* `Args` is the tuple of coordinate arguments passed after `ctx`:
|
|
44
|
+
* - `[]` → ContextMenu (no coordinate)
|
|
45
|
+
* - `[y: number]` → RowMenu
|
|
46
|
+
* - `[x: number]` → ColMenu
|
|
47
|
+
*/
|
|
48
|
+
export type MenuItemBase<Args extends unknown[] = []> = {
|
|
49
|
+
type?: 'item';
|
|
50
|
+
id?: string;
|
|
51
|
+
label: string | ((ctx: MenuContext, ...args: Args) => string);
|
|
52
|
+
shortcuts?: string[] | ((ctx: MenuContext, ...args: Args) => string[]);
|
|
53
|
+
visible?: (ctx: MenuContext, ...args: Args) => boolean;
|
|
54
|
+
disabled?: (ctx: MenuContext, ...args: Args) => boolean;
|
|
55
|
+
/** Render a checkmark prefix when defined. */
|
|
56
|
+
checked?: (ctx: MenuContext, ...args: Args) => boolean;
|
|
57
|
+
onClick: (ctx: MenuContext, ...args: Args) => void | Promise<void>;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* A menu entry that renders a registered React component.
|
|
61
|
+
* Use `registerMenuComponent(id, Component)` to associate an id with a component,
|
|
62
|
+
* then reference it here as `{ type: 'component', componentId: id }`.
|
|
63
|
+
*/
|
|
64
|
+
export type MenuComponentItem<Args extends unknown[] = []> = {
|
|
65
|
+
type: 'component';
|
|
66
|
+
componentId: string;
|
|
67
|
+
visible?: (ctx: MenuContext, ...args: Args) => boolean;
|
|
68
|
+
};
|
|
69
|
+
export type ContextMenuItemDescriptor = MenuDividerItem | MenuItemBase | MenuComponentItem;
|
|
70
|
+
export type RowMenuItemDescriptor = MenuDividerItem | MenuItemBase<[y: number]> | MenuComponentItem<[y: number]>;
|
|
71
|
+
export type ColMenuItemDescriptor = MenuDividerItem | MenuItemBase<[x: number]> | MenuComponentItem<[x: number]>;
|
|
72
|
+
export declare const defaultContextMenuDescriptors: ContextMenuItemDescriptor[];
|
|
73
|
+
export declare const defaultRowMenuDescriptors: RowMenuItemDescriptor[];
|
|
74
|
+
export declare const defaultColMenuDescriptors: ColMenuItemDescriptor[];
|
|
75
|
+
export declare function buildMenuContext(store: StoreType, dispatch: Dispatcher, close: () => void): MenuContext;
|
|
76
|
+
export type ContextMenuSectionProps = {
|
|
77
|
+
close: () => void;
|
|
78
|
+
};
|
|
79
|
+
export type RowMenuSectionProps = {
|
|
80
|
+
y: number;
|
|
81
|
+
close: () => void;
|
|
82
|
+
};
|
|
83
|
+
export type ColMenuSectionProps = {
|
|
84
|
+
x: number;
|
|
85
|
+
close: () => void;
|
|
86
|
+
/** Signal waiting state to parent menu. Pass null to clear. */
|
|
87
|
+
onWaiting?: (message: string | null, cancel?: () => void) => void;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Register a React component under a string id so it can be referenced in menu
|
|
91
|
+
* descriptors via `{ type: 'component', componentId: '...' }`.
|
|
92
|
+
*
|
|
93
|
+
* Built-in ids: `'col-filter'`, `'col-sort'`, `'col-label'`.
|
|
94
|
+
* You can override any built-in by registering your own component with the same id.
|
|
95
|
+
*/
|
|
96
|
+
export declare function registerMenuComponent(id: string, component: FC<any>): void;
|
|
97
|
+
/** Look up a previously registered component by id. */
|
|
98
|
+
export declare function getMenuComponent(id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eAAO,MAAM,yBAAyB,EAAE,qBAAqB,EA0F5D,CAAC;AAIF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,IAAI,GAAG,WAAW,CAiFvG;AAID,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CACnE,CAAC;AAIF;;;;;;GAMG;AAEH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAE1E;AAED,uDAAuD;AAEvD,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAEhE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lib/popup.ts
|
|
3
|
+
*
|
|
4
|
+
* Utility functions for computing the position of floating UI elements
|
|
5
|
+
* (tooltips, dropdowns, autocomplete lists, function guides, etc.)
|
|
6
|
+
* so they don't overflow the viewport.
|
|
7
|
+
*/
|
|
8
|
+
export type HAlign = 'left' | 'right';
|
|
9
|
+
export type VAlign = 'top' | 'bottom';
|
|
10
|
+
export type PopupPosition = {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
hAlign: HAlign;
|
|
14
|
+
};
|
|
15
|
+
export declare const calcBelowPosition: (rect: DOMRect, maxWidth?: number, margin?: number) => PopupPosition;
|
|
16
|
+
export declare const clampLeft: (left: number, width: number, margin?: number) => number;
|
|
17
|
+
export type SideStyle = {
|
|
18
|
+
left: string;
|
|
19
|
+
right: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const calcSideStyle: (el: HTMLElement, gap?: number) => SideStyle;
|
|
22
|
+
export declare const clampPopup: (el: HTMLElement) => void;
|
|
23
|
+
export declare const hAlignTransform: (hAlign: HAlign) => string;
|
|
24
|
+
//# sourceMappingURL=popup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popup.d.ts","sourceRoot":"","sources":["../../src/lib/popup.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AACtC,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAgBF,eAAO,MAAM,iBAAiB,GAAI,MAAM,OAAO,EAAE,iBAAc,EAAE,eAAe,KAAG,aAKlF,CAAC;AAUF,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,eAAe,KAAG,MAIxE,CAAC;AAgBF,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,eAAO,MAAM,aAAa,GAAI,IAAI,WAAW,EAAE,YAAY,KAAG,SAc7D,CAAC;AAYF,eAAO,MAAM,UAAU,GAAI,IAAI,WAAW,KAAG,IAW5C,CAAC;AASF,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,KAAG,MAA6D,CAAC"}
|
package/dist/lib/reference.d.ts
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { CellsByIdType, Id } from '../types';
|
|
2
|
-
import {
|
|
2
|
+
import { Sheet } from './sheet';
|
|
3
3
|
export declare class ReferencePreserver {
|
|
4
4
|
map: {
|
|
5
5
|
[id: Id]: Id;
|
|
6
6
|
};
|
|
7
|
-
private
|
|
7
|
+
private sheet;
|
|
8
8
|
private dependentIds;
|
|
9
|
-
constructor(
|
|
10
|
-
|
|
9
|
+
constructor(sheet: Sheet);
|
|
10
|
+
collectDependents(...ids: Id[]): void;
|
|
11
|
+
/**
|
|
12
|
+
* Compare two idMatrix snapshots (`before` and `after`) and populate
|
|
13
|
+
* `this.map` and collect dependents for every position where the occupying
|
|
14
|
+
* cell ID changed. Works for any rearrangement (sort, move, etc.).
|
|
15
|
+
*/
|
|
16
|
+
buildMap(before: Id[], after: Id[]): void;
|
|
11
17
|
resolveDependents(operation?: 'move' | 'removeRows' | 'removeCols'): CellsByIdType;
|
|
12
18
|
}
|
|
13
19
|
//# sourceMappingURL=reference.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../src/lib/reference.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../src/lib/reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,qBAAa,kBAAkB;IACtB,GAAG,EAAE;QAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAA;KAAE,CAAM;IAClC,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,YAAY,CAA0B;gBAElC,KAAK,EAAE,KAAK;IAIxB,iBAAiB,CAAC,GAAG,GAAG,EAAE,EAAE,EAAE;IAQ9B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;IAWlC,iBAAiB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,YAAY,GAAG,aAAa;CAmBnF"}
|