@zengrid/core 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/dist/README.md +55 -0
- package/dist/index.cjs.default.js +1 -0
- package/dist/index.cjs.js +9882 -0
- package/dist/index.cjs.mjs +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +9847 -0
- package/dist/package.json +49 -0
- package/dist/src/a11y/aria-manager.d.ts +171 -0
- package/dist/src/a11y/aria-manager.d.ts.map +1 -0
- package/dist/src/a11y/focus-manager.d.ts +124 -0
- package/dist/src/a11y/focus-manager.d.ts.map +1 -0
- package/dist/src/a11y/index.d.ts +8 -0
- package/dist/src/a11y/index.d.ts.map +1 -0
- package/dist/src/data/data-accessor/array-accessor.d.ts +38 -0
- package/dist/src/data/data-accessor/array-accessor.d.ts.map +1 -0
- package/dist/src/data/data-accessor/column-store-accessor.d.ts +41 -0
- package/dist/src/data/data-accessor/column-store-accessor.d.ts.map +1 -0
- package/dist/src/data/data-accessor/data-accessor.interface.d.ts +41 -0
- package/dist/src/data/data-accessor/data-accessor.interface.d.ts.map +1 -0
- package/dist/src/data/data-accessor/index.d.ts +9 -0
- package/dist/src/data/data-accessor/index.d.ts.map +1 -0
- package/dist/src/data/data-accessor/sparse-matrix-accessor.d.ts +39 -0
- package/dist/src/data/data-accessor/sparse-matrix-accessor.d.ts.map +1 -0
- package/dist/src/data/data-manager.d.ts +161 -0
- package/dist/src/data/data-manager.d.ts.map +1 -0
- package/dist/src/data/data-source.interface.d.ts +82 -0
- package/dist/src/data/data-source.interface.d.ts.map +1 -0
- package/dist/src/data/grid-data-model.d.ts +102 -0
- package/dist/src/data/grid-data-model.d.ts.map +1 -0
- package/dist/src/data/index-map/index-map.d.ts +30 -0
- package/dist/src/data/index-map/index-map.d.ts.map +1 -0
- package/dist/src/data/index-map/index-map.interface.d.ts +49 -0
- package/dist/src/data/index-map/index-map.interface.d.ts.map +1 -0
- package/dist/src/data/index-map/index.d.ts +7 -0
- package/dist/src/data/index-map/index.d.ts.map +1 -0
- package/dist/src/data/index.d.ts +9 -0
- package/dist/src/data/index.d.ts.map +1 -0
- package/dist/src/editing/cell-editor.interface.d.ts +87 -0
- package/dist/src/editing/cell-editor.interface.d.ts.map +1 -0
- package/dist/src/editing/date-editor.d.ts +67 -0
- package/dist/src/editing/date-editor.d.ts.map +1 -0
- package/dist/src/editing/editor-manager.d.ts +141 -0
- package/dist/src/editing/editor-manager.d.ts.map +1 -0
- package/dist/src/editing/index.d.ts +15 -0
- package/dist/src/editing/index.d.ts.map +1 -0
- package/dist/src/editing/number-editor.d.ts +68 -0
- package/dist/src/editing/number-editor.d.ts.map +1 -0
- package/dist/src/editing/select-editor.d.ts +53 -0
- package/dist/src/editing/select-editor.d.ts.map +1 -0
- package/dist/src/editing/text-editor.d.ts +69 -0
- package/dist/src/editing/text-editor.d.ts.map +1 -0
- package/dist/src/events/event-emitter.d.ts +90 -0
- package/dist/src/events/event-emitter.d.ts.map +1 -0
- package/dist/src/events/grid-events.d.ts +277 -0
- package/dist/src/events/grid-events.d.ts.map +1 -0
- package/dist/src/events/index.d.ts +6 -0
- package/dist/src/events/index.d.ts.map +1 -0
- package/dist/src/features/autofill/autofill-manager.d.ts +103 -0
- package/dist/src/features/autofill/autofill-manager.d.ts.map +1 -0
- package/dist/src/features/autofill/index.d.ts +6 -0
- package/dist/src/features/autofill/index.d.ts.map +1 -0
- package/dist/src/features/column-resize/auto-fit-calculator.d.ts +52 -0
- package/dist/src/features/column-resize/auto-fit-calculator.d.ts.map +1 -0
- package/dist/src/features/column-resize/column-resize-manager.d.ts +114 -0
- package/dist/src/features/column-resize/column-resize-manager.d.ts.map +1 -0
- package/dist/src/features/column-resize/column-resize-manager.interface.d.ts +167 -0
- package/dist/src/features/column-resize/column-resize-manager.interface.d.ts.map +1 -0
- package/dist/src/features/column-resize/column-resize.styles.css +30 -0
- package/dist/src/features/column-resize/index.d.ts +15 -0
- package/dist/src/features/column-resize/index.d.ts.map +1 -0
- package/dist/src/features/column-resize/resize-constraint-manager.d.ts +52 -0
- package/dist/src/features/column-resize/resize-constraint-manager.d.ts.map +1 -0
- package/dist/src/features/column-resize/resize-handle-renderer.d.ts +41 -0
- package/dist/src/features/column-resize/resize-handle-renderer.d.ts.map +1 -0
- package/dist/src/features/column-resize/resize-preview.d.ts +32 -0
- package/dist/src/features/column-resize/resize-preview.d.ts.map +1 -0
- package/dist/src/features/column-resize/resize-state-manager.d.ts +75 -0
- package/dist/src/features/column-resize/resize-state-manager.d.ts.map +1 -0
- package/dist/src/features/column-resize/resize-strategies.d.ts +26 -0
- package/dist/src/features/column-resize/resize-strategies.d.ts.map +1 -0
- package/dist/src/features/column-resize/resize-test-helper.d.ts +71 -0
- package/dist/src/features/column-resize/resize-test-helper.d.ts.map +1 -0
- package/dist/src/features/column-resize/resize-zone-detector.d.ts +32 -0
- package/dist/src/features/column-resize/resize-zone-detector.d.ts.map +1 -0
- package/dist/src/features/copy-paste/clipboard-manager.d.ts +116 -0
- package/dist/src/features/copy-paste/clipboard-manager.d.ts.map +1 -0
- package/dist/src/features/copy-paste/index.d.ts +6 -0
- package/dist/src/features/copy-paste/index.d.ts.map +1 -0
- package/dist/src/features/filtering/adapters/adapter.interface.d.ts +100 -0
- package/dist/src/features/filtering/adapters/adapter.interface.d.ts.map +1 -0
- package/dist/src/features/filtering/adapters/graphql-adapter.d.ts +124 -0
- package/dist/src/features/filtering/adapters/graphql-adapter.d.ts.map +1 -0
- package/dist/src/features/filtering/adapters/index.d.ts +11 -0
- package/dist/src/features/filtering/adapters/index.d.ts.map +1 -0
- package/dist/src/features/filtering/adapters/rest-adapter.d.ts +108 -0
- package/dist/src/features/filtering/adapters/rest-adapter.d.ts.map +1 -0
- package/dist/src/features/filtering/adapters/sql-adapter.d.ts +123 -0
- package/dist/src/features/filtering/adapters/sql-adapter.d.ts.map +1 -0
- package/dist/src/features/filtering/adapters/types.d.ts +201 -0
- package/dist/src/features/filtering/adapters/types.d.ts.map +1 -0
- package/dist/src/features/filtering/column-filter.d.ts +117 -0
- package/dist/src/features/filtering/column-filter.d.ts.map +1 -0
- package/dist/src/features/filtering/filter-autocomplete.d.ts +78 -0
- package/dist/src/features/filtering/filter-autocomplete.d.ts.map +1 -0
- package/dist/src/features/filtering/filter-cache.d.ts +113 -0
- package/dist/src/features/filtering/filter-cache.d.ts.map +1 -0
- package/dist/src/features/filtering/filter-compiler.d.ts +66 -0
- package/dist/src/features/filtering/filter-compiler.d.ts.map +1 -0
- package/dist/src/features/filtering/filter-export-manager.d.ts +131 -0
- package/dist/src/features/filtering/filter-export-manager.d.ts.map +1 -0
- package/dist/src/features/filtering/filter-index-manager.d.ts +126 -0
- package/dist/src/features/filtering/filter-index-manager.d.ts.map +1 -0
- package/dist/src/features/filtering/filter-manager.d.ts +408 -0
- package/dist/src/features/filtering/filter-manager.d.ts.map +1 -0
- package/dist/src/features/filtering/filter-optimizer.d.ts +101 -0
- package/dist/src/features/filtering/filter-optimizer.d.ts.map +1 -0
- package/dist/src/features/filtering/filter-query-parser.d.ts +69 -0
- package/dist/src/features/filtering/filter-query-parser.d.ts.map +1 -0
- package/dist/src/features/filtering/index.d.ts +20 -0
- package/dist/src/features/filtering/index.d.ts.map +1 -0
- package/dist/src/features/filtering/range-filter-optimizer.d.ts +138 -0
- package/dist/src/features/filtering/range-filter-optimizer.d.ts.map +1 -0
- package/dist/src/features/filtering/substring-filter.d.ts +90 -0
- package/dist/src/features/filtering/substring-filter.d.ts.map +1 -0
- package/dist/src/features/filtering/types.d.ts +204 -0
- package/dist/src/features/filtering/types.d.ts.map +1 -0
- package/dist/src/features/formulas/formula-calculator.d.ts +151 -0
- package/dist/src/features/formulas/formula-calculator.d.ts.map +1 -0
- package/dist/src/features/formulas/index.d.ts +6 -0
- package/dist/src/features/formulas/index.d.ts.map +1 -0
- package/dist/src/features/hit-testing/index.d.ts +7 -0
- package/dist/src/features/hit-testing/index.d.ts.map +1 -0
- package/dist/src/features/hit-testing/spatial-hit-tester.d.ts +137 -0
- package/dist/src/features/hit-testing/spatial-hit-tester.d.ts.map +1 -0
- package/dist/src/features/loading/index.d.ts +5 -0
- package/dist/src/features/loading/index.d.ts.map +1 -0
- package/dist/src/features/loading/loading-indicator.d.ts +79 -0
- package/dist/src/features/loading/loading-indicator.d.ts.map +1 -0
- package/dist/src/features/loading/loading.styles.css +413 -0
- package/dist/src/features/pagination/index.d.ts +5 -0
- package/dist/src/features/pagination/index.d.ts.map +1 -0
- package/dist/src/features/pagination/pagination.styles.css +288 -0
- package/dist/src/features/pagination/paginator.d.ts +89 -0
- package/dist/src/features/pagination/paginator.d.ts.map +1 -0
- package/dist/src/features/selection/index.d.ts +7 -0
- package/dist/src/features/selection/index.d.ts.map +1 -0
- package/dist/src/features/selection/selection-manager.d.ts +167 -0
- package/dist/src/features/selection/selection-manager.d.ts.map +1 -0
- package/dist/src/features/sorting/index.d.ts +13 -0
- package/dist/src/features/sorting/index.d.ts.map +1 -0
- package/dist/src/features/sorting/row-sorter.interface.d.ts +63 -0
- package/dist/src/features/sorting/row-sorter.interface.d.ts.map +1 -0
- package/dist/src/features/sorting/single-column-sorter.d.ts +75 -0
- package/dist/src/features/sorting/single-column-sorter.d.ts.map +1 -0
- package/dist/src/features/sorting/sort-manager.d.ts +132 -0
- package/dist/src/features/sorting/sort-manager.d.ts.map +1 -0
- package/dist/src/features/undo-redo/index.d.ts +8 -0
- package/dist/src/features/undo-redo/index.d.ts.map +1 -0
- package/dist/src/features/undo-redo/undo-redo-manager.d.ts +215 -0
- package/dist/src/features/undo-redo/undo-redo-manager.d.ts.map +1 -0
- package/dist/src/grid.d.ts +412 -0
- package/dist/src/grid.d.ts.map +1 -0
- package/dist/src/i18n/index.d.ts +8 -0
- package/dist/src/i18n/index.d.ts.map +1 -0
- package/dist/src/i18n/locale-manager.d.ts +123 -0
- package/dist/src/i18n/locale-manager.d.ts.map +1 -0
- package/dist/src/i18n/rtl-support.d.ts +120 -0
- package/dist/src/i18n/rtl-support.d.ts.map +1 -0
- package/dist/src/index.d.ts +38 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/keyboard/index.d.ts +6 -0
- package/dist/src/keyboard/index.d.ts.map +1 -0
- package/dist/src/keyboard/keyboard-navigator.d.ts +171 -0
- package/dist/src/keyboard/keyboard-navigator.d.ts.map +1 -0
- package/dist/src/rendering/cache/index.d.ts +3 -0
- package/dist/src/rendering/cache/index.d.ts.map +1 -0
- package/dist/src/rendering/cache/renderer-cache.d.ts +100 -0
- package/dist/src/rendering/cache/renderer-cache.d.ts.map +1 -0
- package/dist/src/rendering/cache/renderer-cache.interface.d.ts +89 -0
- package/dist/src/rendering/cache/renderer-cache.interface.d.ts.map +1 -0
- package/dist/src/rendering/cell-pool/cell-pool.d.ts +36 -0
- package/dist/src/rendering/cell-pool/cell-pool.d.ts.map +1 -0
- package/dist/src/rendering/cell-pool/cell-pool.interface.d.ts +76 -0
- package/dist/src/rendering/cell-pool/cell-pool.interface.d.ts.map +1 -0
- package/dist/src/rendering/cell-pool/index.d.ts +6 -0
- package/dist/src/rendering/cell-pool/index.d.ts.map +1 -0
- package/dist/src/rendering/cell-positioner/cell-positioner.d.ts +46 -0
- package/dist/src/rendering/cell-positioner/cell-positioner.d.ts.map +1 -0
- package/dist/src/rendering/cell-positioner/cell-positioner.interface.d.ts +86 -0
- package/dist/src/rendering/cell-positioner/cell-positioner.interface.d.ts.map +1 -0
- package/dist/src/rendering/cell-positioner/index.d.ts +6 -0
- package/dist/src/rendering/cell-positioner/index.d.ts.map +1 -0
- package/dist/src/rendering/height-provider/height-provider.interface.d.ts +62 -0
- package/dist/src/rendering/height-provider/height-provider.interface.d.ts.map +1 -0
- package/dist/src/rendering/height-provider/index.d.ts +7 -0
- package/dist/src/rendering/height-provider/index.d.ts.map +1 -0
- package/dist/src/rendering/height-provider/uniform-height-provider.d.ts +31 -0
- package/dist/src/rendering/height-provider/uniform-height-provider.d.ts.map +1 -0
- package/dist/src/rendering/height-provider/variable-height-provider.d.ts +33 -0
- package/dist/src/rendering/height-provider/variable-height-provider.d.ts.map +1 -0
- package/dist/src/rendering/renderers/advanced-cell-renderer.d.ts +105 -0
- package/dist/src/rendering/renderers/advanced-cell-renderer.d.ts.map +1 -0
- package/dist/src/rendering/renderers/image-renderer.d.ts +60 -0
- package/dist/src/rendering/renderers/image-renderer.d.ts.map +1 -0
- package/dist/src/rendering/renderers/index.d.ts +13 -0
- package/dist/src/rendering/renderers/index.d.ts.map +1 -0
- package/dist/src/rendering/renderers/number-renderer.d.ts +71 -0
- package/dist/src/rendering/renderers/number-renderer.d.ts.map +1 -0
- package/dist/src/rendering/renderers/renderer-registry.d.ts +55 -0
- package/dist/src/rendering/renderers/renderer-registry.d.ts.map +1 -0
- package/dist/src/rendering/renderers/renderer.interface.d.ts +79 -0
- package/dist/src/rendering/renderers/renderer.interface.d.ts.map +1 -0
- package/dist/src/rendering/renderers/text-renderer.d.ts +20 -0
- package/dist/src/rendering/renderers/text-renderer.d.ts.map +1 -0
- package/dist/src/rendering/spatial-hit-tester.d.ts +108 -0
- package/dist/src/rendering/spatial-hit-tester.d.ts.map +1 -0
- package/dist/src/rendering/virtual-scroller/index.d.ts +6 -0
- package/dist/src/rendering/virtual-scroller/index.d.ts.map +1 -0
- package/dist/src/rendering/virtual-scroller/virtual-scroller.d.ts +56 -0
- package/dist/src/rendering/virtual-scroller/virtual-scroller.d.ts.map +1 -0
- package/dist/src/rendering/virtual-scroller/virtual-scroller.interface.d.ts +170 -0
- package/dist/src/rendering/virtual-scroller/virtual-scroller.interface.d.ts.map +1 -0
- package/dist/src/rendering/width-provider/index.d.ts +7 -0
- package/dist/src/rendering/width-provider/index.d.ts.map +1 -0
- package/dist/src/rendering/width-provider/uniform-width-provider.d.ts +31 -0
- package/dist/src/rendering/width-provider/uniform-width-provider.d.ts.map +1 -0
- package/dist/src/rendering/width-provider/variable-width-provider.d.ts +33 -0
- package/dist/src/rendering/width-provider/variable-width-provider.d.ts.map +1 -0
- package/dist/src/rendering/width-provider/width-provider.interface.d.ts +62 -0
- package/dist/src/rendering/width-provider/width-provider.interface.d.ts.map +1 -0
- package/dist/src/selection/hit-tester.d.ts +168 -0
- package/dist/src/selection/hit-tester.d.ts.map +1 -0
- package/dist/src/selection/hit-tester.interface.d.ts +108 -0
- package/dist/src/selection/hit-tester.interface.d.ts.map +1 -0
- package/dist/src/selection/index.d.ts +9 -0
- package/dist/src/selection/index.d.ts.map +1 -0
- package/dist/src/selection/range-utils.d.ts +219 -0
- package/dist/src/selection/range-utils.d.ts.map +1 -0
- package/dist/src/selection/range-utils.interface.d.ts +51 -0
- package/dist/src/selection/range-utils.interface.d.ts.map +1 -0
- package/dist/src/styles/grid.css +356 -0
- package/dist/src/styles.css +273 -0
- package/dist/src/touch/index.d.ts +6 -0
- package/dist/src/touch/index.d.ts.map +1 -0
- package/dist/src/touch/touch-handler.d.ts +167 -0
- package/dist/src/touch/touch-handler.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +133 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types.d.ts +559 -0
- package/dist/src/types.d.ts.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formula Calculator using DependencyGraph
|
|
3
|
+
*
|
|
4
|
+
* Tracks formula dependencies and calculates cells in correct order.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Cell formula information
|
|
8
|
+
*/
|
|
9
|
+
export interface CellFormula {
|
|
10
|
+
cell: string;
|
|
11
|
+
formula: string;
|
|
12
|
+
dependencies: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* FormulaCalculator - Formula dependency tracking and calculation ordering
|
|
16
|
+
*
|
|
17
|
+
* Uses a dependency graph to track formula relationships and determine
|
|
18
|
+
* the correct calculation order, with circular reference detection.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const calculator = new FormulaCalculator();
|
|
23
|
+
*
|
|
24
|
+
* // Cell C1 = A1 + B1
|
|
25
|
+
* calculator.setFormula('C1', '=A1+B1', ['A1', 'B1']);
|
|
26
|
+
*
|
|
27
|
+
* // Cell D1 = C1 * 2
|
|
28
|
+
* calculator.setFormula('D1', '=C1*2', ['C1']);
|
|
29
|
+
*
|
|
30
|
+
* // Get calculation order (dependencies first)
|
|
31
|
+
* const order = calculator.getCalculationOrder();
|
|
32
|
+
* // ['C1', 'D1'] - C1 first (no formula deps), then D1 (depends on C1)
|
|
33
|
+
*
|
|
34
|
+
* // User changes A1 - get cells to recalculate
|
|
35
|
+
* const toRecalc = calculator.getCellsToRecalculate(['A1']);
|
|
36
|
+
* // ['C1', 'D1'] - all cells that transitively depend on A1
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare class FormulaCalculator {
|
|
40
|
+
private graph;
|
|
41
|
+
private formulas;
|
|
42
|
+
/**
|
|
43
|
+
* Register a formula cell
|
|
44
|
+
*
|
|
45
|
+
* @param cell - Cell reference (e.g., 'A1')
|
|
46
|
+
* @param formula - Formula string (e.g., '=SUM(B1:B10)')
|
|
47
|
+
* @param dependencies - Array of cell references this formula depends on
|
|
48
|
+
* @throws Error if circular reference detected
|
|
49
|
+
*/
|
|
50
|
+
setFormula(cell: string, formula: string, dependencies: string[]): void;
|
|
51
|
+
/**
|
|
52
|
+
* Remove a formula
|
|
53
|
+
*
|
|
54
|
+
* @param cell - Cell reference
|
|
55
|
+
*/
|
|
56
|
+
removeFormula(cell: string): void;
|
|
57
|
+
/**
|
|
58
|
+
* Get formula for a cell
|
|
59
|
+
*
|
|
60
|
+
* @param cell - Cell reference
|
|
61
|
+
* @returns Formula info or undefined
|
|
62
|
+
*/
|
|
63
|
+
getFormula(cell: string): CellFormula | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Check if cell has a formula
|
|
66
|
+
*
|
|
67
|
+
* @param cell - Cell reference
|
|
68
|
+
* @returns true if cell has formula
|
|
69
|
+
*/
|
|
70
|
+
hasFormula(cell: string): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Get all cells with formulas
|
|
73
|
+
*
|
|
74
|
+
* @returns Array of cell references
|
|
75
|
+
*/
|
|
76
|
+
getAllFormulaCells(): string[];
|
|
77
|
+
/**
|
|
78
|
+
* Get calculation order for all formulas
|
|
79
|
+
*
|
|
80
|
+
* Returns cells in dependency order (dependencies before dependents).
|
|
81
|
+
*
|
|
82
|
+
* @returns Array of cell references in calculation order
|
|
83
|
+
* @throws Error if circular references detected
|
|
84
|
+
*/
|
|
85
|
+
getCalculationOrder(): string[];
|
|
86
|
+
/**
|
|
87
|
+
* Get cells to recalculate when specific cells change
|
|
88
|
+
*
|
|
89
|
+
* Returns all formula cells that transitively depend on the changed cells,
|
|
90
|
+
* in correct calculation order.
|
|
91
|
+
*
|
|
92
|
+
* @param changedCells - Array of cell references that changed
|
|
93
|
+
* @returns Array of formula cells to recalculate, in order
|
|
94
|
+
*/
|
|
95
|
+
getCellsToRecalculate(changedCells: string[]): string[];
|
|
96
|
+
/**
|
|
97
|
+
* Get direct dependencies of a cell
|
|
98
|
+
*
|
|
99
|
+
* @param cell - Cell reference
|
|
100
|
+
* @returns Array of cell references this cell depends on
|
|
101
|
+
*/
|
|
102
|
+
getDependencies(cell: string): string[];
|
|
103
|
+
/**
|
|
104
|
+
* Get direct dependents of a cell
|
|
105
|
+
*
|
|
106
|
+
* @param cell - Cell reference
|
|
107
|
+
* @returns Array of cell references that depend on this cell
|
|
108
|
+
*/
|
|
109
|
+
getDependents(cell: string): string[];
|
|
110
|
+
/**
|
|
111
|
+
* Get all transitive dependencies (recursive)
|
|
112
|
+
*
|
|
113
|
+
* @param cell - Cell reference
|
|
114
|
+
* @returns Array of all cells this cell transitively depends on
|
|
115
|
+
*/
|
|
116
|
+
getTransitiveDependencies(cell: string): string[];
|
|
117
|
+
/**
|
|
118
|
+
* Get all transitive dependents (recursive)
|
|
119
|
+
*
|
|
120
|
+
* @param cell - Cell reference
|
|
121
|
+
* @returns Array of all cells that transitively depend on this cell
|
|
122
|
+
*/
|
|
123
|
+
getTransitiveDependents(cell: string): string[];
|
|
124
|
+
/**
|
|
125
|
+
* Check if adding a dependency would create a cycle
|
|
126
|
+
*
|
|
127
|
+
* @param cell - Dependent cell
|
|
128
|
+
* @param dependency - Dependency cell
|
|
129
|
+
* @returns true if would create cycle
|
|
130
|
+
*/
|
|
131
|
+
wouldCreateCycle(cell: string, dependency: string): boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Detect all circular references in current formulas
|
|
134
|
+
*
|
|
135
|
+
* @returns Array of cycles, where each cycle is an array of cell references
|
|
136
|
+
*/
|
|
137
|
+
detectCircularReferences(): string[][];
|
|
138
|
+
/**
|
|
139
|
+
* Get statistics about the formula graph
|
|
140
|
+
*/
|
|
141
|
+
getStats(): {
|
|
142
|
+
formulaCount: number;
|
|
143
|
+
dependencyCount: number;
|
|
144
|
+
maxDepth: number;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Clear all formulas
|
|
148
|
+
*/
|
|
149
|
+
clear(): void;
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=formula-calculator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formula-calculator.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/features/formulas/formula-calculator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,KAAK,CAA+C;IAC5D,OAAO,CAAC,QAAQ,CAAuC;IAEvD;;;;;;;OAOG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI;IAqCvE;;;;OAIG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKjC;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAIjD;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIjC;;;;OAIG;IACH,kBAAkB,IAAI,MAAM,EAAE;IAI9B;;;;;;;OAOG;IACH,mBAAmB,IAAI,MAAM,EAAE;IAW/B;;;;;;;;OAQG;IACH,qBAAqB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAOvD;;;;;OAKG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IAIvC;;;;;OAKG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IAIrC;;;;;OAKG;IACH,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IAIjD;;;;;OAKG;IACH,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IAI/C;;;;;;OAMG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO;IAI3D;;;;OAIG;IACH,wBAAwB,IAAI,MAAM,EAAE,EAAE;IAItC;;OAEG;IACH,QAAQ,IAAI;QACV,YAAY,EAAE,MAAM,CAAC;QACrB,eAAe,EAAE,MAAM,CAAC;QACxB,QAAQ,EAAE,MAAM,CAAC;KAClB;IAUD;;OAEG;IACH,KAAK,IAAI,IAAI;CAId"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/features/formulas/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hit testing feature
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
export { SpatialHitTester } from './spatial-hit-tester';
|
|
6
|
+
export type { CellPosition, CellBounds, HitTestResult, SpatialHitTesterOptions, } from './spatial-hit-tester';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/features/hit-testing/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,YAAY,EACV,YAAY,EACZ,UAAU,EACV,aAAa,EACb,uBAAuB,GACxB,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SpatialHitTester - Efficient cell lookup using RTree
|
|
3
|
+
*
|
|
4
|
+
* Uses RTree from shared package for O(log n) spatial queries.
|
|
5
|
+
* Particularly useful for:
|
|
6
|
+
* - Merged cells
|
|
7
|
+
* - Variable cell sizes
|
|
8
|
+
* - Finding cells at mouse coordinates
|
|
9
|
+
* - Viewport intersection queries
|
|
10
|
+
*/
|
|
11
|
+
import type { Rectangle } from '@zengrid/shared/data-structures/rtree';
|
|
12
|
+
/**
|
|
13
|
+
* Cell position in the grid
|
|
14
|
+
*/
|
|
15
|
+
export interface CellPosition {
|
|
16
|
+
row: number;
|
|
17
|
+
col: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Cell bounds (in pixels)
|
|
21
|
+
*/
|
|
22
|
+
export interface CellBounds extends Rectangle {
|
|
23
|
+
row: number;
|
|
24
|
+
col: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Hit test result
|
|
28
|
+
*/
|
|
29
|
+
export interface HitTestResult {
|
|
30
|
+
row: number;
|
|
31
|
+
col: number;
|
|
32
|
+
bounds: Rectangle;
|
|
33
|
+
distance?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Hit tester options
|
|
37
|
+
*/
|
|
38
|
+
export interface SpatialHitTesterOptions {
|
|
39
|
+
/**
|
|
40
|
+
* Enable merged cell support
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
supportMergedCells?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* SpatialHitTester - Uses RTree for efficient spatial queries
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* const hitTester = new SpatialHitTester();
|
|
51
|
+
*
|
|
52
|
+
* // Index all visible cells
|
|
53
|
+
* for (let row = 0; row < 100; row++) {
|
|
54
|
+
* for (let col = 0; col < 50; col++) {
|
|
55
|
+
* const bounds = getCellBounds(row, col);
|
|
56
|
+
* hitTester.indexCell(row, col, bounds);
|
|
57
|
+
* }
|
|
58
|
+
* }
|
|
59
|
+
*
|
|
60
|
+
* // Find cell at mouse coordinates
|
|
61
|
+
* const cell = hitTester.hitTest(mouseX, mouseY);
|
|
62
|
+
* if (cell) {
|
|
63
|
+
* console.log(`Clicked cell: row=${cell.row}, col=${cell.col}`);
|
|
64
|
+
* }
|
|
65
|
+
*
|
|
66
|
+
* // Find all cells in viewport
|
|
67
|
+
* const visibleCells = hitTester.findCellsInRect({
|
|
68
|
+
* minX: viewportLeft,
|
|
69
|
+
* minY: viewportTop,
|
|
70
|
+
* maxX: viewportRight,
|
|
71
|
+
* maxY: viewportBottom,
|
|
72
|
+
* });
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export declare class SpatialHitTester {
|
|
76
|
+
private rtree;
|
|
77
|
+
private supportMergedCells;
|
|
78
|
+
private mergedCells;
|
|
79
|
+
constructor(options?: SpatialHitTesterOptions);
|
|
80
|
+
/**
|
|
81
|
+
* Index a cell for spatial queries
|
|
82
|
+
*/
|
|
83
|
+
indexCell(row: number, col: number, bounds: Rectangle): void;
|
|
84
|
+
/**
|
|
85
|
+
* Index a merged cell (spanning multiple rows/columns)
|
|
86
|
+
*/
|
|
87
|
+
indexMergedCell(startRow: number, startCol: number, endRow: number, endCol: number, bounds: Rectangle): void;
|
|
88
|
+
/**
|
|
89
|
+
* Hit test at a specific point
|
|
90
|
+
* Returns the cell at the given coordinates
|
|
91
|
+
*/
|
|
92
|
+
hitTest(x: number, y: number): HitTestResult | null;
|
|
93
|
+
/**
|
|
94
|
+
* Find the nearest cell to a point
|
|
95
|
+
*/
|
|
96
|
+
hitTestNearest(x: number, y: number, maxDistance?: number): HitTestResult | null;
|
|
97
|
+
/**
|
|
98
|
+
* Find all cells intersecting a rectangle
|
|
99
|
+
*/
|
|
100
|
+
findCellsInRect(rect: Rectangle): HitTestResult[];
|
|
101
|
+
/**
|
|
102
|
+
* Find all cells in viewport
|
|
103
|
+
*/
|
|
104
|
+
findCellsInViewport(viewportLeft: number, viewportTop: number, viewportRight: number, viewportBottom: number): HitTestResult[];
|
|
105
|
+
/**
|
|
106
|
+
* Check if a cell is merged
|
|
107
|
+
*/
|
|
108
|
+
isMergedCell(row: number, col: number): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Get merged cell info
|
|
111
|
+
*/
|
|
112
|
+
getMergedCellInfo(row: number, col: number): CellBounds | null;
|
|
113
|
+
/**
|
|
114
|
+
* Clear all indexed cells
|
|
115
|
+
*/
|
|
116
|
+
clear(): void;
|
|
117
|
+
/**
|
|
118
|
+
* Get statistics
|
|
119
|
+
*/
|
|
120
|
+
getStats(): {
|
|
121
|
+
indexedCells: number;
|
|
122
|
+
mergedCells: number;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Generate key for merged cell
|
|
126
|
+
*/
|
|
127
|
+
private getMergedCellKey;
|
|
128
|
+
/**
|
|
129
|
+
* Parse merged cell key
|
|
130
|
+
*/
|
|
131
|
+
private parseMergedCellKey;
|
|
132
|
+
/**
|
|
133
|
+
* Cleanup
|
|
134
|
+
*/
|
|
135
|
+
destroy(): void;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=spatial-hit-tester.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spatial-hit-tester.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/features/hit-testing/spatial-hit-tester.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,KAAK,CAAsB;IACnC,OAAO,CAAC,kBAAkB,CAAU;IAGpC,OAAO,CAAC,WAAW,CAAsC;gBAE7C,OAAO,GAAE,uBAA4B;IAOjD;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI;IAI5D;;OAEG;IACH,eAAe,CACb,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,SAAS,GAChB,IAAI;IAiBP;;;OAGG;IACH,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAkBnD;;OAEG;IACH,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAiBhF;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,aAAa,EAAE;IAUjD;;OAEG;IACH,mBAAmB,CACjB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,GACrB,aAAa,EAAE;IASlB;;OAEG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IAqB/C;;OAEG;IACH,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAoB9D;;OAEG;IACH,KAAK,IAAI,IAAI;IAOb;;OAEG;IACH,QAAQ,IAAI;QACV,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;KACrB;IAOD;;OAEG;IACH,OAAO,CAAC,gBAAgB;IASxB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAK1B;;OAEG;IACH,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/features/loading/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { LoadingState, LoadingConfig } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* LoadingIndicator - Renders loading UI with multiple template styles
|
|
4
|
+
*
|
|
5
|
+
* Provides 4 built-in template styles:
|
|
6
|
+
* 1. **Simple**: Basic text "Loading..."
|
|
7
|
+
* 2. **Animated**: Animated spinner with rotating dots
|
|
8
|
+
* 3. **Modern**: Modern circular loader with smooth animation
|
|
9
|
+
* 4. **Skeleton**: Skeleton screen with shimmer effect
|
|
10
|
+
*
|
|
11
|
+
* @example Basic Usage
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const loadingIndicator = new LoadingIndicator({
|
|
14
|
+
* enabled: true,
|
|
15
|
+
* template: 'modern',
|
|
16
|
+
* message: 'Loading data...',
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* const container = loadingIndicator.render({ isLoading: true });
|
|
20
|
+
* document.body.appendChild(container);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare class LoadingIndicator {
|
|
24
|
+
private config;
|
|
25
|
+
private container;
|
|
26
|
+
private startTime;
|
|
27
|
+
private minDisplayTimeout;
|
|
28
|
+
constructor(config?: LoadingConfig);
|
|
29
|
+
/**
|
|
30
|
+
* Render loading indicator
|
|
31
|
+
*/
|
|
32
|
+
render(state: LoadingState): HTMLElement;
|
|
33
|
+
/**
|
|
34
|
+
* Show loading indicator
|
|
35
|
+
*/
|
|
36
|
+
show(parentElement: HTMLElement, state?: LoadingState): void;
|
|
37
|
+
/**
|
|
38
|
+
* Hide loading indicator with minimum display time
|
|
39
|
+
*/
|
|
40
|
+
hide(): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Update loading state
|
|
43
|
+
*/
|
|
44
|
+
update(state: LoadingState): void;
|
|
45
|
+
/**
|
|
46
|
+
* Template 1: Simple - Basic text
|
|
47
|
+
* Layout: Loading...
|
|
48
|
+
*/
|
|
49
|
+
private renderSimpleTemplate;
|
|
50
|
+
/**
|
|
51
|
+
* Template 2: Animated - Rotating dots spinner
|
|
52
|
+
* Layout: ● ● ● Loading...
|
|
53
|
+
*/
|
|
54
|
+
private renderAnimatedTemplate;
|
|
55
|
+
/**
|
|
56
|
+
* Template 3: Modern - Circular loader
|
|
57
|
+
* Layout: ○ Loading...
|
|
58
|
+
*/
|
|
59
|
+
private renderModernTemplate;
|
|
60
|
+
/**
|
|
61
|
+
* Template 4: Skeleton - Skeleton screen shimmer
|
|
62
|
+
* Layout: [==== ] shimmer effect
|
|
63
|
+
*/
|
|
64
|
+
private renderSkeletonTemplate;
|
|
65
|
+
/**
|
|
66
|
+
* Check if loading is currently visible
|
|
67
|
+
*/
|
|
68
|
+
isVisible(): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Update configuration
|
|
71
|
+
*/
|
|
72
|
+
updateConfig(config: Partial<LoadingConfig>): void;
|
|
73
|
+
/**
|
|
74
|
+
* Destroy loading indicator
|
|
75
|
+
* Safely removes all references and cleans up DOM
|
|
76
|
+
*/
|
|
77
|
+
destroy(): void;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=loading-indicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loading-indicator.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/features/loading/loading-indicator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAA0F;IACxG,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,iBAAiB,CAAuB;gBAEpC,MAAM,GAAE,aAAkB;IAatC;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,WAAW;IA2BxC;;OAEG;IACH,IAAI,CAAC,aAAa,EAAE,WAAW,EAAE,KAAK,GAAE,YAAkC,GAAG,IAAI;IAiCjF;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAuDrB;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAqBjC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAa5B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IA0B9B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAgC5B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAqC9B;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI;IAIlD;;;OAGG;IACH,OAAO,IAAI,IAAI;CAuBhB"}
|