@guiexpert/table 1.1.97 → 1.1.99
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/README.md +12 -0
- package/css/main.css +381 -27
- package/css/table-classes.css +33 -9
- package/css/table-clipboard.css +41 -0
- package/css/table-color-vars.css +56 -0
- package/css/table-fill-batch.css +9 -2
- package/css/table-master-detail.css +20 -0
- package/css/table-sheet-editing.css +149 -0
- package/css/table-spreadsheet.css +50 -0
- package/css/table-tree.css +23 -16
- package/index.cjs +54 -67
- package/index.d.ts +52 -0
- package/index.js +18968 -11475
- package/lib/table/action/action-id.type.d.ts +1 -1
- package/lib/table/action/shortcut.service.d.ts +9 -0
- package/lib/table/aria/aria-texts.d.ts +26 -0
- package/lib/table/aria/aria-texts.if.d.ts +196 -0
- package/lib/table/batch-edit/batch-edit-service.d.ts +22 -0
- package/lib/table/batch-edit/cell-change.if.d.ts +6 -2
- package/lib/table/batch-edit/pending-cell-changes.d.ts +7 -0
- package/lib/table/batch-edit/write-row-value.d.ts +14 -0
- package/lib/table/calc/column-values.d.ts +2 -0
- package/lib/table/clipboard/clipboard-html.d.ts +41 -0
- package/lib/table/clipboard/clipboard-keymap.d.ts +18 -0
- package/lib/table/clipboard/clipboard-options.d.ts +30 -0
- package/lib/table/clipboard/clipboard-options.if.d.ts +67 -0
- package/lib/table/clipboard/clipboard-service.d.ts +122 -0
- package/lib/table/clipboard/input-pipes.d.ts +59 -0
- package/lib/table/clipboard/paste-plan.d.ts +96 -0
- package/lib/table/clipboard/tsv.d.ts +31 -0
- package/lib/table/crud/crud-object-edit.d.ts +2 -0
- package/lib/table/crud/crud-object-view.d.ts +2 -0
- package/lib/table/crud/crud-table-model-factory.d.ts +2 -0
- package/lib/table/data/common/event/ge-edit-event.d.ts +46 -0
- package/lib/table/data/common/event/ge-row-drag-event.d.ts +2 -2
- package/lib/table/data/common/event/ge-undo-event.d.ts +29 -0
- package/lib/table/data/options/table-options.d.ts +34 -0
- package/lib/table/data/options/table-options.if.d.ts +116 -1
- package/lib/table/data/tablemodel/areamodel/abstract-area-model.d.ts +11 -2
- package/lib/table/data/tablemodel/areamodel/area-model-array-of-arrays.d.ts +14 -0
- package/lib/table/data/tablemodel/areamodel/area-model-object-array.d.ts +14 -0
- package/lib/table/data/tablemodel/areamodel/area-model.if.d.ts +11 -0
- package/lib/table/data/tablemodel/column/column-def.d.ts +13 -0
- package/lib/table/data/tablemodel/column/column-def.if.d.ts +36 -1
- package/lib/table/data/tablemodel/column/default-editable.d.ts +18 -0
- package/lib/table/ele-scope.d.ts +37 -0
- package/lib/table/event-adapter.d.ts +6 -0
- package/lib/table/event-listener-hub.d.ts +10 -0
- package/lib/table/event-listener.if.d.ts +16 -0
- package/lib/table/factory/pivot-factory.d.ts +1 -1
- package/lib/table/factory/row-group-factory.d.ts +1 -1
- package/lib/table/factory/table-factory.d.ts +14 -0
- package/lib/table/formula/formula-ast.if.d.ts +32 -2
- package/lib/table/formula/formula-error.d.ts +4 -2
- package/lib/table/formula/parser.d.ts +5 -2
- package/lib/table/formula/tokenizer.d.ts +5 -2
- package/lib/table/input-handler.d.ts +8 -0
- package/lib/table/master-detail/master-detail-service.d.ts +9 -0
- package/lib/table/render-scope.d.ts +40 -0
- package/lib/table/row-drag/row-drag-service.d.ts +3 -2
- package/lib/table/rtl/rtl-util.d.ts +126 -0
- package/lib/table/rtl/table-direction.type.d.ts +23 -0
- package/lib/table/selection/selection-service.d.ts +48 -0
- package/lib/table/service/convenience-dom.service.d.ts +49 -1
- package/lib/table/service/excel-export-options.if.d.ts +23 -0
- package/lib/table/service/excel-service.d.ts +12 -2
- package/lib/table/service/excel-service.if.d.ts +38 -1
- package/lib/table/sheet/cell-address.d.ts +100 -0
- package/lib/table/sheet/cell-formula-options.d.ts +27 -0
- package/lib/table/sheet/cell-formula-options.if.d.ts +27 -0
- package/lib/table/sheet/excel-formula.d.ts +20 -0
- package/lib/table/sheet/format-formula.d.ts +19 -0
- package/lib/table/sheet/sheet-cells.if.d.ts +17 -0
- package/lib/table/sheet/sheet-compiler.d.ts +47 -0
- package/lib/table/sheet/sheet-engine.d.ts +207 -0
- package/lib/table/sheet/sheet-function-info.d.ts +25 -0
- package/lib/table/sheet/sheet-functions.d.ts +27 -0
- package/lib/table/sheet/sheet-values.d.ts +154 -0
- package/lib/table/sheet/shift-formula.d.ts +71 -0
- package/lib/table/sheet/table-sheet.d.ts +214 -0
- package/lib/table/sheet-editing/cell-editor-service.d.ts +105 -0
- package/lib/table/sheet-editing/cell-editor.if.d.ts +110 -0
- package/lib/table/sheet-editing/editing-keymap.d.ts +17 -0
- package/lib/table/sheet-editing/editing-options.d.ts +34 -0
- package/lib/table/sheet-editing/editing-options.if.d.ts +49 -0
- package/lib/table/sheet-editing/editors/date-cell-editor.d.ts +23 -0
- package/lib/table/sheet-editing/editors/number-cell-editor.d.ts +18 -0
- package/lib/table/sheet-editing/editors/select-cell-editor.d.ts +36 -0
- package/lib/table/sheet-editing/editors/text-cell-editor.d.ts +35 -0
- package/lib/table/sheet-editing/formula-assist.d.ts +103 -0
- package/lib/table/sheet-editing/formula-text.d.ts +61 -0
- package/lib/table/sheet-editing/sheet-navigation.d.ts +26 -0
- package/lib/table/spreadsheet/area-model-sheet.d.ts +170 -0
- package/lib/table/spreadsheet/formula-bar.d.ts +53 -0
- package/lib/table/spreadsheet/spreadsheet-factory.d.ts +111 -0
- package/lib/table/spreadsheet/spreadsheet-options.if.d.ts +28 -0
- package/lib/table/spreadsheet/spreadsheet-preset.d.ts +37 -0
- package/lib/table/spreadsheet/structure-edit.d.ts +35 -0
- package/lib/table/table-api.d.ts +533 -4
- package/lib/table/table-scope.d.ts +299 -1
- package/lib/table/undo/cell-changes-undoable.d.ts +34 -0
- package/lib/table/undo/model-rows.d.ts +17 -0
- package/lib/table/undo/pending-changes-undoable.d.ts +35 -0
- package/lib/table/undo/undo-keymap.d.ts +17 -0
- package/lib/table/undo/undo-options.d.ts +26 -0
- package/lib/table/undo/undo-options.if.d.ts +30 -0
- package/lib/table/undo/undo-service.d.ts +103 -0
- package/lib/table/undo/undo-stack.d.ts +62 -0
- package/lib/table/undo/undoable.if.d.ts +36 -0
- package/package.json +1 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The undo and redo stacks of steps (DOM-free): a new step clears the redo stack; at most `maxSteps` steps and
|
|
3
|
+
* `maxCells` cells (over both stacks) are kept – the oldest go first; a single step with more than `maxCells` cells
|
|
4
|
+
* empties the history and is not kept.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* const stack = new UndoStack<{ cellCount: number; label: string }>(100, 1_000_000);
|
|
8
|
+
* stack.push({ cellCount: 1, label: "Edit" });
|
|
9
|
+
* stack.undo()?.label; // "Edit" – now on the redo stack
|
|
10
|
+
* stack.canRedo(); // true
|
|
11
|
+
*
|
|
12
|
+
* @category Spreadsheet
|
|
13
|
+
* @since 1.1.99
|
|
14
|
+
*/
|
|
15
|
+
export declare class UndoStack<T extends {
|
|
16
|
+
readonly cellCount: number;
|
|
17
|
+
}> {
|
|
18
|
+
private readonly maxSteps;
|
|
19
|
+
private readonly maxCells;
|
|
20
|
+
private readonly undoSteps;
|
|
21
|
+
private readonly redoSteps;
|
|
22
|
+
private cells;
|
|
23
|
+
/**
|
|
24
|
+
* @param {number} maxSteps - steps kept on the undo stack
|
|
25
|
+
* @param {number} maxCells - cells kept over both stacks
|
|
26
|
+
*/
|
|
27
|
+
constructor(maxSteps: number, maxCells: number);
|
|
28
|
+
/**
|
|
29
|
+
* Adds a step and clears the redo stack.
|
|
30
|
+
*
|
|
31
|
+
* @param {T} step - the new step
|
|
32
|
+
* @returns {boolean} false if the step was too large (the history is empty now)
|
|
33
|
+
*/
|
|
34
|
+
push(step: T): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Takes the last step for undo (it moves to the redo stack).
|
|
37
|
+
*
|
|
38
|
+
* @returns {T | undefined} the step, `undefined` if there is none
|
|
39
|
+
*/
|
|
40
|
+
undo(): T | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Takes the last undone step for redo (it moves back to the undo stack).
|
|
43
|
+
*
|
|
44
|
+
* @returns {T | undefined} the step, `undefined` if there is none
|
|
45
|
+
*/
|
|
46
|
+
redo(): T | undefined;
|
|
47
|
+
/** @returns {T | undefined} the step the next undo takes */
|
|
48
|
+
peekUndo(): T | undefined;
|
|
49
|
+
/** @returns {T | undefined} the step the next redo takes */
|
|
50
|
+
peekRedo(): T | undefined;
|
|
51
|
+
/** @returns {boolean} true if there is a step to undo */
|
|
52
|
+
canUndo(): boolean;
|
|
53
|
+
/** @returns {boolean} true if there is a step to redo */
|
|
54
|
+
canRedo(): boolean;
|
|
55
|
+
/** @returns {number} steps on the undo stack */
|
|
56
|
+
size(): number;
|
|
57
|
+
/** @returns {number} cells kept over both stacks */
|
|
58
|
+
cellCount(): number;
|
|
59
|
+
/** Empties both stacks. */
|
|
60
|
+
clear(): void;
|
|
61
|
+
private clearRedo;
|
|
62
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CellRange } from '../data/common/cell-range.js';
|
|
2
|
+
import { CellChangeSource } from '../batch-edit/cell-change.if.js';
|
|
3
|
+
import { TableScope } from '../table-scope.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* What an undo or redo did.
|
|
7
|
+
*
|
|
8
|
+
* @category Spreadsheet
|
|
9
|
+
* @since 1.1.99
|
|
10
|
+
*/
|
|
11
|
+
export interface UndoResultIf {
|
|
12
|
+
/** Cells written back. */
|
|
13
|
+
readonly applied: number;
|
|
14
|
+
/** Cells left out (row gone, no longer editable, changed by something else with `onConflict: "skip"`). */
|
|
15
|
+
readonly skipped: number;
|
|
16
|
+
/** The shown cells written back (display rows, model columns) – selected afterwards. */
|
|
17
|
+
readonly range?: CellRange;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* One step of the undo history (command pattern): what the user did as one action – an edit, a fill, a paste.
|
|
21
|
+
*
|
|
22
|
+
* @category Spreadsheet
|
|
23
|
+
* @since 1.1.99
|
|
24
|
+
*/
|
|
25
|
+
export interface UndoableIf {
|
|
26
|
+
/** For buttons and announcements: `"Edit"`, `"Paste"`, `"Fill"` … */
|
|
27
|
+
readonly label: string;
|
|
28
|
+
/** What started the step. */
|
|
29
|
+
readonly source: CellChangeSource;
|
|
30
|
+
/** Cells the step holds (for `UndoOptionsIf.maxCells`). */
|
|
31
|
+
readonly cellCount: number;
|
|
32
|
+
/** Writes the old values back. */
|
|
33
|
+
undo(scope: TableScope): UndoResultIf;
|
|
34
|
+
/** Writes the new values again. */
|
|
35
|
+
redo(scope: TableScope): UndoResultIf;
|
|
36
|
+
}
|