@aquera/ngx-smart-table 0.0.16-alpha → 0.0.18-alpha
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/{fesm2020 → fesm2022}/aquera-ngx-smart-table.mjs +1664 -2107
- package/fesm2022/aquera-ngx-smart-table.mjs.map +1 -0
- package/package.json +8 -16
- package/types/aquera-ngx-smart-table.d.ts +5909 -0
- package/aquera-ngx-smart-table.d.ts +0 -5
- package/esm2020/aquera-ngx-smart-table.mjs +0 -5
- package/esm2020/lib/builder/components/builder-preview/builder-preview.component.mjs +0 -63
- package/esm2020/lib/builder/components/builder-toolbar/builder-toolbar.component.mjs +0 -115
- package/esm2020/lib/builder/components/column-editor/column-editor.component.mjs +0 -206
- package/esm2020/lib/builder/components/column-list/column-list.component.mjs +0 -125
- package/esm2020/lib/builder/components/definition-builder/definition-builder.component.mjs +0 -105
- package/esm2020/lib/builder/components/table-config-editor/table-config-editor.component.mjs +0 -132
- package/esm2020/lib/builder/definition-builder.module.mjs +0 -70
- package/esm2020/lib/builder/models/builder-state.interface.mjs +0 -5
- package/esm2020/lib/builder/services/definition-builder.service.mjs +0 -251
- package/esm2020/lib/builder/services/definition-export.service.mjs +0 -167
- package/esm2020/lib/builder/services/definition-import.service.mjs +0 -193
- package/esm2020/lib/builder/services/sample-data-generator.service.mjs +0 -126
- package/esm2020/lib/builder/utils/config-validator.util.mjs +0 -165
- package/esm2020/lib/builder/utils/typescript-generator.util.mjs +0 -206
- package/esm2020/lib/editors/index.mjs +0 -9
- package/esm2020/lib/editors/nile-autocomplete-editor.mjs +0 -228
- package/esm2020/lib/editors/nile-calendar-editor.mjs +0 -211
- package/esm2020/lib/editors/nile-date-picker-editor.mjs +0 -188
- package/esm2020/lib/editors/nile-input-editor.mjs +0 -235
- package/esm2020/lib/editors/nile-select-editor.mjs +0 -419
- package/esm2020/lib/factories/column-config.factory.mjs +0 -231
- package/esm2020/lib/models/autosave-config.interface.mjs +0 -8
- package/esm2020/lib/models/base-column-config.class.mjs +0 -253
- package/esm2020/lib/models/cell-strategies.interface.mjs +0 -6
- package/esm2020/lib/models/cell-types.mjs +0 -147
- package/esm2020/lib/models/column-action.interface.mjs +0 -6
- package/esm2020/lib/models/column-config.interface.mjs +0 -43
- package/esm2020/lib/models/column-config.utils.mjs +0 -101
- package/esm2020/lib/models/row-action.interface.mjs +0 -5
- package/esm2020/lib/models/row-validator.interface.mjs +0 -2
- package/esm2020/lib/models/schema-validation.interface.mjs +0 -2
- package/esm2020/lib/models/sheet-action.interface.mjs +0 -5
- package/esm2020/lib/models/sheet-config.interface.mjs +0 -5
- package/esm2020/lib/models/table-config.interface.mjs +0 -107
- package/esm2020/lib/models/table-validator.interface.mjs +0 -2
- package/esm2020/lib/models/workbook-action.interface.mjs +0 -5
- package/esm2020/lib/models/workbook-config.interface.mjs +0 -5
- package/esm2020/lib/renderer/components/st-add-column-button/st-add-column-button.component.mjs +0 -24
- package/esm2020/lib/renderer/components/st-cell/st-cell.component.mjs +0 -397
- package/esm2020/lib/renderer/components/st-column-editor-modal/st-column-editor-modal.component.mjs +0 -103
- package/esm2020/lib/renderer/components/st-column-filter/st-column-filter.component.mjs +0 -383
- package/esm2020/lib/renderer/components/st-column-menu/st-column-menu.component.mjs +0 -232
- package/esm2020/lib/renderer/components/st-column-visibility/st-column-visibility.component.mjs +0 -97
- package/esm2020/lib/renderer/components/st-header/st-header.component.mjs +0 -157
- package/esm2020/lib/renderer/components/st-pagination/st-pagination.component.mjs +0 -87
- package/esm2020/lib/renderer/components/st-row-actions-dropdown/st-row-actions-dropdown.component.mjs +0 -167
- package/esm2020/lib/renderer/components/st-sheet/st-sheet.component.mjs +0 -165
- package/esm2020/lib/renderer/components/st-sheet-actions/st-sheet-actions.component.mjs +0 -112
- package/esm2020/lib/renderer/components/st-table/st-table.component.mjs +0 -1453
- package/esm2020/lib/renderer/components/st-table-actions/st-table-actions.component.mjs +0 -169
- package/esm2020/lib/renderer/components/st-workbook/st-workbook.component.mjs +0 -581
- package/esm2020/lib/renderer/directives/click-outside.directive.mjs +0 -28
- package/esm2020/lib/renderer/directives/st-column-resize.directive.mjs +0 -108
- package/esm2020/lib/renderer/directives/st-keyboard-navigation.directive.mjs +0 -83
- package/esm2020/lib/renderer/models/cell-state.interface.mjs +0 -66
- package/esm2020/lib/renderer/models/cell.class.mjs +0 -389
- package/esm2020/lib/renderer/models/row-validation-state.interface.mjs +0 -7
- package/esm2020/lib/renderer/models/sheet-state.class.mjs +0 -90
- package/esm2020/lib/renderer/models/sheet-state.interface.mjs +0 -5
- package/esm2020/lib/renderer/models/table-state.class.mjs +0 -871
- package/esm2020/lib/renderer/models/table-state.interface.mjs +0 -5
- package/esm2020/lib/renderer/models/table-types.mjs +0 -29
- package/esm2020/lib/renderer/models/table-validation-state.interface.mjs +0 -7
- package/esm2020/lib/renderer/models/workbook-state.class.mjs +0 -174
- package/esm2020/lib/renderer/models/workbook-state.interface.mjs +0 -5
- package/esm2020/lib/renderer/models/z-index.enum.mjs +0 -55
- package/esm2020/lib/schemas/table-config.schema.mjs +0 -472
- package/esm2020/lib/services/autosave.service.mjs +0 -92
- package/esm2020/lib/services/custom-validation-rules.util.mjs +0 -124
- package/esm2020/lib/services/json-schema-validator.service.mjs +0 -216
- package/esm2020/lib/services/row-validation.service.mjs +0 -42
- package/esm2020/lib/services/validation-logger.service.mjs +0 -177
- package/esm2020/lib/services/virtual-scroll.service.mjs +0 -52
- package/esm2020/lib/shared/shared-table-components.module.mjs +0 -35
- package/esm2020/lib/smart-table.module.mjs +0 -124
- package/esm2020/lib/strategies/default-editors.mjs +0 -433
- package/esm2020/lib/strategies/default-formatters.mjs +0 -238
- package/esm2020/lib/strategies/default-validators.mjs +0 -327
- package/esm2020/public-api.mjs +0 -146
- package/fesm2015/aquera-ngx-smart-table.mjs +0 -12267
- package/fesm2015/aquera-ngx-smart-table.mjs.map +0 -1
- package/fesm2020/aquera-ngx-smart-table.mjs.map +0 -1
- package/lib/builder/components/builder-preview/builder-preview.component.d.ts +0 -31
- package/lib/builder/components/builder-toolbar/builder-toolbar.component.d.ts +0 -53
- package/lib/builder/components/column-editor/column-editor.component.d.ts +0 -69
- package/lib/builder/components/column-list/column-list.component.d.ts +0 -65
- package/lib/builder/components/definition-builder/definition-builder.component.d.ts +0 -58
- package/lib/builder/components/table-config-editor/table-config-editor.component.d.ts +0 -32
- package/lib/builder/definition-builder.module.d.ts +0 -15
- package/lib/builder/models/builder-state.interface.d.ts +0 -93
- package/lib/builder/services/definition-builder.service.d.ts +0 -80
- package/lib/builder/services/definition-export.service.d.ts +0 -59
- package/lib/builder/services/definition-import.service.d.ts +0 -31
- package/lib/builder/services/sample-data-generator.service.d.ts +0 -41
- package/lib/builder/utils/config-validator.util.d.ts +0 -32
- package/lib/builder/utils/typescript-generator.util.d.ts +0 -29
- package/lib/editors/index.d.ts +0 -8
- package/lib/editors/nile-autocomplete-editor.d.ts +0 -102
- package/lib/editors/nile-calendar-editor.d.ts +0 -88
- package/lib/editors/nile-date-picker-editor.d.ts +0 -97
- package/lib/editors/nile-input-editor.d.ts +0 -67
- package/lib/editors/nile-select-editor.d.ts +0 -110
- package/lib/factories/column-config.factory.d.ts +0 -73
- package/lib/models/autosave-config.interface.d.ts +0 -23
- package/lib/models/base-column-config.class.d.ts +0 -115
- package/lib/models/cell-strategies.interface.d.ts +0 -188
- package/lib/models/cell-types.d.ts +0 -337
- package/lib/models/column-action.interface.d.ts +0 -86
- package/lib/models/column-config.interface.d.ts +0 -272
- package/lib/models/column-config.utils.d.ts +0 -37
- package/lib/models/row-action.interface.d.ts +0 -86
- package/lib/models/row-validator.interface.d.ts +0 -37
- package/lib/models/schema-validation.interface.d.ts +0 -42
- package/lib/models/sheet-action.interface.d.ts +0 -59
- package/lib/models/sheet-config.interface.d.ts +0 -41
- package/lib/models/table-config.interface.d.ts +0 -251
- package/lib/models/table-validator.interface.d.ts +0 -40
- package/lib/models/workbook-action.interface.d.ts +0 -95
- package/lib/models/workbook-config.interface.d.ts +0 -107
- package/lib/renderer/components/st-add-column-button/st-add-column-button.component.d.ts +0 -9
- package/lib/renderer/components/st-cell/st-cell.component.d.ts +0 -69
- package/lib/renderer/components/st-column-editor-modal/st-column-editor-modal.component.d.ts +0 -39
- package/lib/renderer/components/st-column-filter/st-column-filter.component.d.ts +0 -139
- package/lib/renderer/components/st-column-menu/st-column-menu.component.d.ts +0 -81
- package/lib/renderer/components/st-column-visibility/st-column-visibility.component.d.ts +0 -44
- package/lib/renderer/components/st-header/st-header.component.d.ts +0 -93
- package/lib/renderer/components/st-pagination/st-pagination.component.d.ts +0 -42
- package/lib/renderer/components/st-row-actions-dropdown/st-row-actions-dropdown.component.d.ts +0 -67
- package/lib/renderer/components/st-sheet/st-sheet.component.d.ts +0 -98
- package/lib/renderer/components/st-sheet-actions/st-sheet-actions.component.d.ts +0 -58
- package/lib/renderer/components/st-table/st-table.component.d.ts +0 -380
- package/lib/renderer/components/st-table-actions/st-table-actions.component.d.ts +0 -77
- package/lib/renderer/components/st-workbook/st-workbook.component.d.ts +0 -275
- package/lib/renderer/directives/click-outside.directive.d.ts +0 -10
- package/lib/renderer/directives/st-column-resize.directive.d.ts +0 -44
- package/lib/renderer/directives/st-keyboard-navigation.directive.d.ts +0 -19
- package/lib/renderer/models/cell-state.interface.d.ts +0 -118
- package/lib/renderer/models/cell.class.d.ts +0 -174
- package/lib/renderer/models/row-validation-state.interface.d.ts +0 -27
- package/lib/renderer/models/sheet-state.class.d.ts +0 -67
- package/lib/renderer/models/sheet-state.interface.d.ts +0 -55
- package/lib/renderer/models/table-state.class.d.ts +0 -320
- package/lib/renderer/models/table-state.interface.d.ts +0 -18
- package/lib/renderer/models/table-types.d.ts +0 -228
- package/lib/renderer/models/table-validation-state.interface.d.ts +0 -34
- package/lib/renderer/models/workbook-state.class.d.ts +0 -117
- package/lib/renderer/models/workbook-state.interface.d.ts +0 -71
- package/lib/renderer/models/z-index.enum.d.ts +0 -44
- package/lib/schemas/table-config.schema.d.ts +0 -455
- package/lib/services/autosave.service.d.ts +0 -73
- package/lib/services/custom-validation-rules.util.d.ts +0 -12
- package/lib/services/json-schema-validator.service.d.ts +0 -49
- package/lib/services/row-validation.service.d.ts +0 -17
- package/lib/services/validation-logger.service.d.ts +0 -87
- package/lib/services/virtual-scroll.service.d.ts +0 -44
- package/lib/shared/shared-table-components.module.d.ts +0 -9
- package/lib/smart-table.module.d.ts +0 -26
- package/lib/strategies/default-editors.d.ts +0 -109
- package/lib/strategies/default-formatters.d.ts +0 -116
- package/lib/strategies/default-validators.d.ts +0 -113
- package/public-api.d.ts +0 -70
- package/src/lib/builder/README.md +0 -30
- package/src/lib/editors/README.md +0 -303
- package/src/lib/renderer/components/st-column-filter/README.md +0 -286
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
import { EventEmitter, OnInit, OnChanges, OnDestroy, SimpleChanges, ChangeDetectorRef } from '@angular/core';
|
|
2
|
-
import { StTableComponent } from '../st-table/st-table.component';
|
|
3
|
-
import { BehaviorSubject } from 'rxjs';
|
|
4
|
-
import { WorkbookConfig, WorkbookSheetConfig } from '../../../models/workbook-config.interface';
|
|
5
|
-
import { WorkbookAction, WorkbookActionEvent, SheetTabActionEvent } from '../../../models/workbook-action.interface';
|
|
6
|
-
import { WorkbookState } from '../../models/workbook-state.class';
|
|
7
|
-
import { TableState } from '../../models/table-state.class';
|
|
8
|
-
import { TableConfig } from '../../../models/table-config.interface';
|
|
9
|
-
import { CellChangeEvent } from '../../../models/cell-types';
|
|
10
|
-
import { TableStateChangeEvent } from '../../models/table-types';
|
|
11
|
-
import { AutosaveService } from '../../../services/autosave.service';
|
|
12
|
-
import * as i0 from "@angular/core";
|
|
13
|
-
export declare class StWorkbookComponent implements OnInit, OnChanges, OnDestroy {
|
|
14
|
-
private autosaveService;
|
|
15
|
-
private cdr;
|
|
16
|
-
/**
|
|
17
|
-
* Workbook configuration
|
|
18
|
-
*/
|
|
19
|
-
config: WorkbookConfig;
|
|
20
|
-
/**
|
|
21
|
-
* Map of sheet ID to data array
|
|
22
|
-
*/
|
|
23
|
-
sheetsData: BehaviorSubject<Map<string, any[]>>;
|
|
24
|
-
/**
|
|
25
|
-
* Optional external state management
|
|
26
|
-
*/
|
|
27
|
-
state?: WorkbookState;
|
|
28
|
-
/**
|
|
29
|
-
* Emitted when active sheet changes
|
|
30
|
-
*/
|
|
31
|
-
sheetChanged: EventEmitter<number>;
|
|
32
|
-
/**
|
|
33
|
-
* Emitted when add sheet button is clicked
|
|
34
|
-
*/
|
|
35
|
-
addSheet: EventEmitter<void>;
|
|
36
|
-
/**
|
|
37
|
-
* Emitted when a sheet tab action is clicked
|
|
38
|
-
*/
|
|
39
|
-
sheetTabAction: EventEmitter<SheetTabActionEvent>;
|
|
40
|
-
/**
|
|
41
|
-
* Emitted when a workbook action is clicked
|
|
42
|
-
*/
|
|
43
|
-
workbookAction: EventEmitter<WorkbookActionEvent>;
|
|
44
|
-
/**
|
|
45
|
-
* Emitted when cell value changes
|
|
46
|
-
*/
|
|
47
|
-
cellChange: EventEmitter<CellChangeEvent<any>>;
|
|
48
|
-
/**
|
|
49
|
-
* Emitted when cell is saved
|
|
50
|
-
*/
|
|
51
|
-
cellSave: EventEmitter<any>;
|
|
52
|
-
/**
|
|
53
|
-
* Emitted when table state changes
|
|
54
|
-
*/
|
|
55
|
-
tableStateChange: EventEmitter<TableStateChangeEvent>;
|
|
56
|
-
/**
|
|
57
|
-
* Emitted when fullscreen is toggled
|
|
58
|
-
*/
|
|
59
|
-
fullscreenToggle: EventEmitter<boolean>;
|
|
60
|
-
/**
|
|
61
|
-
* Emitted when user navigates past last row (arrow down at bottom)
|
|
62
|
-
* Only emitted if addRowOnNavigatePastEnd is enabled in tableConfig
|
|
63
|
-
*/
|
|
64
|
-
requestAddRow: EventEmitter<{
|
|
65
|
-
sheetId: string;
|
|
66
|
-
focusColumn?: number | undefined;
|
|
67
|
-
}>;
|
|
68
|
-
/**
|
|
69
|
-
* Reference to the st-table component for programmatic control
|
|
70
|
-
*/
|
|
71
|
-
tableComponent?: StTableComponent;
|
|
72
|
-
/**
|
|
73
|
-
* Array of sheets
|
|
74
|
-
*/
|
|
75
|
-
sheets: WorkbookSheetConfig[];
|
|
76
|
-
/**
|
|
77
|
-
* Active sheet index
|
|
78
|
-
*/
|
|
79
|
-
activeSheetIndex: number;
|
|
80
|
-
/**
|
|
81
|
-
* Current table config (for active sheet)
|
|
82
|
-
*/
|
|
83
|
-
currentTableConfig: TableConfig | null;
|
|
84
|
-
/**
|
|
85
|
-
* Current table data (for active sheet) - using BehaviorSubject for reactive updates
|
|
86
|
-
*/
|
|
87
|
-
currentTableData$: BehaviorSubject<any[]>;
|
|
88
|
-
/**
|
|
89
|
-
* Current table state (for active sheet)
|
|
90
|
-
*/
|
|
91
|
-
currentTableState: TableState | null;
|
|
92
|
-
/**
|
|
93
|
-
* Unique key for table component (changes on sheet switch to force reinitialization)
|
|
94
|
-
*/
|
|
95
|
-
tableComponentKey: string;
|
|
96
|
-
/**
|
|
97
|
-
* Internal state instance
|
|
98
|
-
*/
|
|
99
|
-
internalState?: WorkbookState;
|
|
100
|
-
/**
|
|
101
|
-
* Fullscreen state observable
|
|
102
|
-
*/
|
|
103
|
-
isFullscreen$: BehaviorSubject<boolean>;
|
|
104
|
-
/**
|
|
105
|
-
* Tab actions dropdown state
|
|
106
|
-
*/
|
|
107
|
-
tabActionsOpen: boolean;
|
|
108
|
-
selectedSheet: WorkbookSheetConfig | null;
|
|
109
|
-
selectedSheetIndex: number;
|
|
110
|
-
tabActionsPosition: any;
|
|
111
|
-
/**
|
|
112
|
-
* Workbook actions dropdown state
|
|
113
|
-
*/
|
|
114
|
-
workbookActionsOpen: boolean;
|
|
115
|
-
workbookActionsPosition: any;
|
|
116
|
-
/**
|
|
117
|
-
* Visible workbook actions for dropdown (filtered by hidden and showInToolbar)
|
|
118
|
-
*/
|
|
119
|
-
visibleWorkbookActions: WorkbookAction[];
|
|
120
|
-
/**
|
|
121
|
-
* Workbook actions to show directly in toolbar
|
|
122
|
-
*/
|
|
123
|
-
toolbarWorkbookActions: WorkbookAction[];
|
|
124
|
-
/**
|
|
125
|
-
* Destroy subject for cleanup
|
|
126
|
-
*/
|
|
127
|
-
private destroy$;
|
|
128
|
-
/**
|
|
129
|
-
* Autosave enabled flag
|
|
130
|
-
*/
|
|
131
|
-
autosaveEnabled: boolean;
|
|
132
|
-
/**
|
|
133
|
-
* Autosave strategy
|
|
134
|
-
*/
|
|
135
|
-
private autosaveStrategy;
|
|
136
|
-
/**
|
|
137
|
-
* Last save timestamp
|
|
138
|
-
*/
|
|
139
|
-
lastSaveTime: Date | null;
|
|
140
|
-
/**
|
|
141
|
-
* Saving indicator
|
|
142
|
-
*/
|
|
143
|
-
isSaving: boolean;
|
|
144
|
-
/**
|
|
145
|
-
* Beforeunload handler reference
|
|
146
|
-
*/
|
|
147
|
-
private beforeUnloadHandler;
|
|
148
|
-
constructor(autosaveService: AutosaveService, cdr: ChangeDetectorRef);
|
|
149
|
-
ngOnInit(): void;
|
|
150
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
151
|
-
/**
|
|
152
|
-
* Initialize component state
|
|
153
|
-
* @param isFirstInit Whether this is the first initialization (true) or a config update (false)
|
|
154
|
-
*/
|
|
155
|
-
private initializeComponent;
|
|
156
|
-
/**
|
|
157
|
-
* Get active state (external or internal)
|
|
158
|
-
*/
|
|
159
|
-
get activeState(): WorkbookState;
|
|
160
|
-
/**
|
|
161
|
-
* Handle tab change event from nile-tab-group
|
|
162
|
-
*/
|
|
163
|
-
onTabChange(event: any): void;
|
|
164
|
-
/**
|
|
165
|
-
* Update active sheet data (triggers table re-initialization with new config/state)
|
|
166
|
-
*/
|
|
167
|
-
private updateActiveSheet;
|
|
168
|
-
/**
|
|
169
|
-
* Add new sheet
|
|
170
|
-
*/
|
|
171
|
-
onAddSheet(): void;
|
|
172
|
-
/**
|
|
173
|
-
* TrackBy function to force component recreation when key changes
|
|
174
|
-
*/
|
|
175
|
-
trackByKey(index: number, key: string): string;
|
|
176
|
-
/**
|
|
177
|
-
* Check if can add more sheets
|
|
178
|
-
*/
|
|
179
|
-
get canAddSheet(): boolean;
|
|
180
|
-
/**
|
|
181
|
-
* Get minimum sheets required
|
|
182
|
-
*/
|
|
183
|
-
get minSheets(): number;
|
|
184
|
-
/**
|
|
185
|
-
* Open tab actions dropdown
|
|
186
|
-
*/
|
|
187
|
-
openTabActions(event: MouseEvent, sheet: WorkbookSheetConfig, index: number): void;
|
|
188
|
-
/**
|
|
189
|
-
* Close tab actions dropdown
|
|
190
|
-
*/
|
|
191
|
-
closeTabActions(): void;
|
|
192
|
-
/**
|
|
193
|
-
* Check if sheet has tab actions
|
|
194
|
-
*/
|
|
195
|
-
hasTabActions(sheet: WorkbookSheetConfig): boolean;
|
|
196
|
-
/**
|
|
197
|
-
* Handle tab action click
|
|
198
|
-
*/
|
|
199
|
-
onTabActionClick(action: any, event: Event): void;
|
|
200
|
-
/**
|
|
201
|
-
* Toggle workbook actions dropdown
|
|
202
|
-
*/
|
|
203
|
-
toggleWorkbookActions(event: MouseEvent): void;
|
|
204
|
-
/**
|
|
205
|
-
* Close workbook actions dropdown
|
|
206
|
-
*/
|
|
207
|
-
closeWorkbookActions(): void;
|
|
208
|
-
/**
|
|
209
|
-
* Update visible workbook actions
|
|
210
|
-
*/
|
|
211
|
-
private updateVisibleWorkbookActions;
|
|
212
|
-
/**
|
|
213
|
-
* Check if workbook action is disabled
|
|
214
|
-
*/
|
|
215
|
-
isActionDisabled(action: WorkbookAction): boolean;
|
|
216
|
-
/**
|
|
217
|
-
* Handle workbook action click
|
|
218
|
-
*/
|
|
219
|
-
onWorkbookActionClick(action: WorkbookAction, event: Event): void;
|
|
220
|
-
/**
|
|
221
|
-
* Toggle fullscreen mode
|
|
222
|
-
*/
|
|
223
|
-
toggleFullscreen(): void;
|
|
224
|
-
/**
|
|
225
|
-
* Handle cell change from table - update internal data and pass through to parent
|
|
226
|
-
*/
|
|
227
|
-
onCellChange(event: CellChangeEvent): void;
|
|
228
|
-
/**
|
|
229
|
-
* Handle cell save from table - update internal data and pass through to parent
|
|
230
|
-
*/
|
|
231
|
-
onCellSave(event: any): void;
|
|
232
|
-
/**
|
|
233
|
-
* Handle table state change - pass through to parent
|
|
234
|
-
*/
|
|
235
|
-
onTableStateChange(event: TableStateChangeEvent): void;
|
|
236
|
-
/**
|
|
237
|
-
* Handle request to add a new row - emitted when navigating past last row
|
|
238
|
-
*/
|
|
239
|
-
onRequestAddRow(event: {
|
|
240
|
-
focusColumn?: number;
|
|
241
|
-
}): void;
|
|
242
|
-
/**
|
|
243
|
-
* Component cleanup
|
|
244
|
-
*/
|
|
245
|
-
ngOnDestroy(): void;
|
|
246
|
-
/**
|
|
247
|
-
* Initialize autosave subscription
|
|
248
|
-
*/
|
|
249
|
-
private initializeAutosave;
|
|
250
|
-
/**
|
|
251
|
-
* Perform autosave operation
|
|
252
|
-
*/
|
|
253
|
-
private performAutosave;
|
|
254
|
-
/**
|
|
255
|
-
* Setup auto-restore from autosave
|
|
256
|
-
*/
|
|
257
|
-
private setupAutoRestore;
|
|
258
|
-
/**
|
|
259
|
-
* Setup beforeunload warning for unsaved changes
|
|
260
|
-
*/
|
|
261
|
-
private setupBeforeUnloadWarning;
|
|
262
|
-
/**
|
|
263
|
-
* Scroll to a specific row in the current table
|
|
264
|
-
* @param rowIndex - The index of the row to scroll to
|
|
265
|
-
* @param focusFirstCell - Whether to focus the first editable cell (default: false)
|
|
266
|
-
*/
|
|
267
|
-
scrollToRow(rowIndex: number, focusFirstCell?: boolean): void;
|
|
268
|
-
/**
|
|
269
|
-
* Scroll to the last row in the current table
|
|
270
|
-
* @param focusFirstCell - Whether to focus the first editable cell (default: true)
|
|
271
|
-
*/
|
|
272
|
-
scrollToLastRow(focusFirstCell?: boolean): void;
|
|
273
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<StWorkbookComponent, never>;
|
|
274
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<StWorkbookComponent, "st-workbook", never, { "config": "config"; "sheetsData": "sheetsData"; "state": "state"; }, { "sheetChanged": "sheetChanged"; "addSheet": "addSheet"; "sheetTabAction": "sheetTabAction"; "workbookAction": "workbookAction"; "cellChange": "cellChange"; "cellSave": "cellSave"; "tableStateChange": "tableStateChange"; "fullscreenToggle": "fullscreenToggle"; "requestAddRow": "requestAddRow"; }, never, never>;
|
|
275
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ElementRef, EventEmitter } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class ClickOutsideDirective {
|
|
4
|
-
private el;
|
|
5
|
-
clickOutside: EventEmitter<void>;
|
|
6
|
-
constructor(el: ElementRef);
|
|
7
|
-
onClick(target: HTMLElement): void;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ClickOutsideDirective, never>;
|
|
9
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ClickOutsideDirective, "[clickOutside]", never, {}, { "clickOutside": "clickOutside"; }, never>;
|
|
10
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Column Resize Directive
|
|
3
|
-
* Handles column resizing when applied to th/td elements
|
|
4
|
-
*/
|
|
5
|
-
import { ElementRef, EventEmitter, OnDestroy } from '@angular/core';
|
|
6
|
-
import { ColumnConfig } from '../../models/column-config.interface';
|
|
7
|
-
import { ColumnResizeEvent } from '../models/table-types';
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
export declare class StColumnResizeDirective implements OnDestroy {
|
|
10
|
-
private el;
|
|
11
|
-
/**
|
|
12
|
-
* Column configuration
|
|
13
|
-
*/
|
|
14
|
-
column: ColumnConfig<any>;
|
|
15
|
-
/**
|
|
16
|
-
* Emits when column is resized
|
|
17
|
-
*/
|
|
18
|
-
columnResized: EventEmitter<ColumnResizeEvent>;
|
|
19
|
-
/**
|
|
20
|
-
* Resize state
|
|
21
|
-
*/
|
|
22
|
-
private isResizing;
|
|
23
|
-
private startX;
|
|
24
|
-
private startWidth;
|
|
25
|
-
constructor(el: ElementRef<HTMLElement>);
|
|
26
|
-
/**
|
|
27
|
-
* Start resize on mousedown
|
|
28
|
-
*/
|
|
29
|
-
onResizeStart(event: MouseEvent): void;
|
|
30
|
-
/**
|
|
31
|
-
* Track mouse movement during resize
|
|
32
|
-
*/
|
|
33
|
-
private onResizeMove;
|
|
34
|
-
/**
|
|
35
|
-
* End resize on mouseup
|
|
36
|
-
*/
|
|
37
|
-
private onResizeEnd;
|
|
38
|
-
/**
|
|
39
|
-
* Cleanup on destroy
|
|
40
|
-
*/
|
|
41
|
-
ngOnDestroy(): void;
|
|
42
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<StColumnResizeDirective, never>;
|
|
43
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<StColumnResizeDirective, "[stColumnResize]", never, { "column": "column"; }, { "columnResized": "columnResized"; }, never>;
|
|
44
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { TableState } from '../models/table-state.class';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
/**
|
|
4
|
-
* Directive to handle keyboard navigation in table cells
|
|
5
|
-
*/
|
|
6
|
-
export declare class StKeyboardNavigationDirective {
|
|
7
|
-
tableState: TableState;
|
|
8
|
-
/**
|
|
9
|
-
* When enabled, pressing arrow down at the last row will emit requestAddRow event
|
|
10
|
-
*/
|
|
11
|
-
addRowOnNavigatePastEnd: boolean;
|
|
12
|
-
onKeyDown(event: KeyboardEvent): void;
|
|
13
|
-
/**
|
|
14
|
-
* Convert navigation key to direction using enums
|
|
15
|
-
*/
|
|
16
|
-
private getDirection;
|
|
17
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<StKeyboardNavigationDirective, never>;
|
|
18
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<StKeyboardNavigationDirective, "[stKeyboardNavigation]", never, { "tableState": "tableState"; "addRowOnNavigatePastEnd": "addRowOnNavigatePastEnd"; }, {}, never>;
|
|
19
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cell state interface - represents unique state per cell instance
|
|
3
|
-
* This is the "Context" in the Flyweight pattern
|
|
4
|
-
*/
|
|
5
|
-
import { CellLifecycleState } from '../../models/cell-types';
|
|
6
|
-
/**
|
|
7
|
-
* Cell state containing all unique state per cell instance
|
|
8
|
-
* This is stored individually per cell, while ColumnConfig is shared (Flyweight)
|
|
9
|
-
*/
|
|
10
|
-
export interface CellState<T = any> {
|
|
11
|
-
/**
|
|
12
|
-
* Current cell value
|
|
13
|
-
*/
|
|
14
|
-
value: T;
|
|
15
|
-
/**
|
|
16
|
-
* Whether the cell is currently in edit mode
|
|
17
|
-
*/
|
|
18
|
-
isEditing: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Whether the cell value has been modified
|
|
21
|
-
*/
|
|
22
|
-
isDirty: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Previous value before current edit (for undo/cancel)
|
|
25
|
-
*/
|
|
26
|
-
previousValue?: T;
|
|
27
|
-
/**
|
|
28
|
-
* Original value when cell was initialized (for reset)
|
|
29
|
-
*/
|
|
30
|
-
originalValue?: T;
|
|
31
|
-
/**
|
|
32
|
-
* Validation error message if validation failed
|
|
33
|
-
*/
|
|
34
|
-
error?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Multiple validation errors (field-specific)
|
|
37
|
-
*/
|
|
38
|
-
errors?: Record<string, string>;
|
|
39
|
-
/**
|
|
40
|
-
* Warning messages (non-blocking)
|
|
41
|
-
*/
|
|
42
|
-
warnings?: string[];
|
|
43
|
-
/**
|
|
44
|
-
* Current lifecycle state of the cell
|
|
45
|
-
*/
|
|
46
|
-
lifecycleState: CellLifecycleState;
|
|
47
|
-
/**
|
|
48
|
-
* Whether the cell is currently loading (async operations)
|
|
49
|
-
*/
|
|
50
|
-
isLoading?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Whether the cell is disabled
|
|
53
|
-
*/
|
|
54
|
-
isDisabled?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Whether the cell is readonly
|
|
57
|
-
*/
|
|
58
|
-
isReadonly?: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Whether the cell is selected
|
|
61
|
-
*/
|
|
62
|
-
isSelected?: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Whether the cell is focused
|
|
65
|
-
*/
|
|
66
|
-
isFocused?: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* Whether the cell is hovered
|
|
69
|
-
*/
|
|
70
|
-
isHovered?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Custom metadata for cell-specific data
|
|
73
|
-
*/
|
|
74
|
-
metadata?: Record<string, any>;
|
|
75
|
-
/**
|
|
76
|
-
* Timestamp of last modification
|
|
77
|
-
*/
|
|
78
|
-
lastModified?: Date;
|
|
79
|
-
/**
|
|
80
|
-
* Timestamp of last validation
|
|
81
|
-
*/
|
|
82
|
-
lastValidated?: Date;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Factory function to create initial cell state with defaults
|
|
86
|
-
*/
|
|
87
|
-
export declare function createCellState<T>(value: T, overrides?: Partial<CellState<T>>): CellState<T>;
|
|
88
|
-
/**
|
|
89
|
-
* Cell state memento for save/restore operations (Memento pattern)
|
|
90
|
-
* Contains minimal state needed for undo/redo
|
|
91
|
-
*/
|
|
92
|
-
export interface CellStateMemento<T = any> {
|
|
93
|
-
value: T;
|
|
94
|
-
isDirty: boolean;
|
|
95
|
-
error?: string;
|
|
96
|
-
metadata?: Record<string, any>;
|
|
97
|
-
timestamp: Date;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Create a memento snapshot of cell state
|
|
101
|
-
*/
|
|
102
|
-
export declare function createMemento<T>(state: CellState<T>): CellStateMemento<T>;
|
|
103
|
-
/**
|
|
104
|
-
* Restore cell state from memento
|
|
105
|
-
*/
|
|
106
|
-
export declare function restoreFromMemento<T>(currentState: CellState<T>, memento: CellStateMemento<T>): CellState<T>;
|
|
107
|
-
/**
|
|
108
|
-
* Helper to check if cell is in valid state
|
|
109
|
-
*/
|
|
110
|
-
export declare function isCellValid<T>(state: CellState<T>): boolean;
|
|
111
|
-
/**
|
|
112
|
-
* Helper to check if cell can be edited
|
|
113
|
-
*/
|
|
114
|
-
export declare function canEdit<T>(state: CellState<T>): boolean;
|
|
115
|
-
/**
|
|
116
|
-
* Helper to check if cell is in display mode
|
|
117
|
-
*/
|
|
118
|
-
export declare function isDisplayMode<T>(state: CellState<T>): boolean;
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cell class - represents individual cell instances
|
|
3
|
-
* Combines ColumnConfig (Flyweight) with CellState (unique per instance)
|
|
4
|
-
*/
|
|
5
|
-
import { ColumnConfig } from '../../models/column-config.interface';
|
|
6
|
-
import { CellState } from './cell-state.interface';
|
|
7
|
-
import { ValidationResult } from '../../models/cell-types';
|
|
8
|
-
/**
|
|
9
|
-
* Cell class implementing the Flyweight pattern
|
|
10
|
-
* - References shared ColumnConfig (Flyweight)
|
|
11
|
-
* - Owns unique CellState (Flyweight Context)
|
|
12
|
-
*/
|
|
13
|
-
export declare class Cell<T = any> {
|
|
14
|
-
/**
|
|
15
|
-
* Shared column configuration (Flyweight - reference only, not owned)
|
|
16
|
-
*/
|
|
17
|
-
private readonly columnConfig;
|
|
18
|
-
/**
|
|
19
|
-
* Unique cell state (owned by this instance)
|
|
20
|
-
*/
|
|
21
|
-
private state;
|
|
22
|
-
/**
|
|
23
|
-
* Row data context (reference to parent row data)
|
|
24
|
-
*/
|
|
25
|
-
private rowData?;
|
|
26
|
-
/**
|
|
27
|
-
* Row index in table
|
|
28
|
-
*/
|
|
29
|
-
private rowIndex?;
|
|
30
|
-
/**
|
|
31
|
-
* History of state mementos for undo/redo
|
|
32
|
-
*/
|
|
33
|
-
private history;
|
|
34
|
-
/**
|
|
35
|
-
* Current position in history
|
|
36
|
-
*/
|
|
37
|
-
private historyIndex;
|
|
38
|
-
/**
|
|
39
|
-
* Maximum history size
|
|
40
|
-
*/
|
|
41
|
-
private readonly maxHistorySize;
|
|
42
|
-
constructor(columnConfig: ColumnConfig<T>, initialValue: T, rowData?: any, rowIndex?: number);
|
|
43
|
-
/**
|
|
44
|
-
* Get current cell value
|
|
45
|
-
*/
|
|
46
|
-
getValue(): T;
|
|
47
|
-
/**
|
|
48
|
-
* Set cell value
|
|
49
|
-
* @param value New value
|
|
50
|
-
* @param skipValidation Skip validation (useful for programmatic sets)
|
|
51
|
-
*/
|
|
52
|
-
setValue(value: T, skipValidation?: boolean): boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Render cell value as formatted string (delegates to formatter strategy)
|
|
55
|
-
*/
|
|
56
|
-
render(): string;
|
|
57
|
-
/**
|
|
58
|
-
* Validate cell value (delegates to validator strategy)
|
|
59
|
-
*/
|
|
60
|
-
validate(): ValidationResult;
|
|
61
|
-
/**
|
|
62
|
-
* Start edit mode
|
|
63
|
-
*/
|
|
64
|
-
startEdit(): boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Save edited value
|
|
67
|
-
* @param newValue The new value from editor
|
|
68
|
-
*/
|
|
69
|
-
saveEdit(newValue: T): boolean;
|
|
70
|
-
/**
|
|
71
|
-
* Cancel edit and revert to previous value
|
|
72
|
-
*/
|
|
73
|
-
cancelEdit(): void;
|
|
74
|
-
/**
|
|
75
|
-
* Reset cell to original value
|
|
76
|
-
*/
|
|
77
|
-
reset(): void;
|
|
78
|
-
/**
|
|
79
|
-
* Check if cell can be edited
|
|
80
|
-
*/
|
|
81
|
-
canEdit(): boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Check if cell is valid
|
|
84
|
-
*/
|
|
85
|
-
isValid(): boolean;
|
|
86
|
-
/**
|
|
87
|
-
* Check if cell is dirty (modified)
|
|
88
|
-
*/
|
|
89
|
-
isDirty(): boolean;
|
|
90
|
-
/**
|
|
91
|
-
* Check if cell is in edit mode
|
|
92
|
-
*/
|
|
93
|
-
isEditing(): boolean;
|
|
94
|
-
/**
|
|
95
|
-
* Set focus state on this cell
|
|
96
|
-
*/
|
|
97
|
-
focus(): void;
|
|
98
|
-
/**
|
|
99
|
-
* Remove focus from this cell
|
|
100
|
-
*/
|
|
101
|
-
blur(): void;
|
|
102
|
-
/**
|
|
103
|
-
* Check if this cell is focused
|
|
104
|
-
*/
|
|
105
|
-
isFocused(): boolean;
|
|
106
|
-
/**
|
|
107
|
-
* Get current cell state (Memento pattern)
|
|
108
|
-
*/
|
|
109
|
-
getState(): CellState<T>;
|
|
110
|
-
/**
|
|
111
|
-
* Restore cell state from snapshot (Memento pattern)
|
|
112
|
-
*/
|
|
113
|
-
restoreState(state: CellState<T>): void;
|
|
114
|
-
/**
|
|
115
|
-
* Get column configuration (readonly access)
|
|
116
|
-
*/
|
|
117
|
-
getColumnConfig(): Readonly<ColumnConfig<T>>;
|
|
118
|
-
/**
|
|
119
|
-
* Get row data context
|
|
120
|
-
*/
|
|
121
|
-
getRowData(): any;
|
|
122
|
-
/**
|
|
123
|
-
* Get row index
|
|
124
|
-
*/
|
|
125
|
-
getRowIndex(): number | undefined;
|
|
126
|
-
/**
|
|
127
|
-
* Set loading state
|
|
128
|
-
*/
|
|
129
|
-
setLoading(isLoading: boolean): void;
|
|
130
|
-
/**
|
|
131
|
-
* Set disabled state
|
|
132
|
-
*/
|
|
133
|
-
setDisabled(isDisabled: boolean): void;
|
|
134
|
-
/**
|
|
135
|
-
* Set readonly state
|
|
136
|
-
*/
|
|
137
|
-
setReadonly(isReadonly: boolean): void;
|
|
138
|
-
/**
|
|
139
|
-
* Save current state to history
|
|
140
|
-
*/
|
|
141
|
-
private saveToHistory;
|
|
142
|
-
/**
|
|
143
|
-
* Undo last change
|
|
144
|
-
*/
|
|
145
|
-
undo(): boolean;
|
|
146
|
-
/**
|
|
147
|
-
* Redo last undone change
|
|
148
|
-
*/
|
|
149
|
-
redo(): boolean;
|
|
150
|
-
/**
|
|
151
|
-
* Check if undo is available
|
|
152
|
-
*/
|
|
153
|
-
canUndo(): boolean;
|
|
154
|
-
/**
|
|
155
|
-
* Check if redo is available
|
|
156
|
-
*/
|
|
157
|
-
canRedo(): boolean;
|
|
158
|
-
/**
|
|
159
|
-
* Create cell event for hooks
|
|
160
|
-
*/
|
|
161
|
-
private createEvent;
|
|
162
|
-
/**
|
|
163
|
-
* Get cell metadata
|
|
164
|
-
*/
|
|
165
|
-
getMetadata(key: string): any;
|
|
166
|
-
/**
|
|
167
|
-
* Set cell metadata
|
|
168
|
-
*/
|
|
169
|
-
setMetadata(key: string, value: any): void;
|
|
170
|
-
/**
|
|
171
|
-
* Clear all metadata
|
|
172
|
-
*/
|
|
173
|
-
clearMetadata(): void;
|
|
174
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Row validation state interface
|
|
3
|
-
* Represents an INVALID row with accumulated cell errors
|
|
4
|
-
* Note: Valid rows are not stored - absence of a row state means the row is valid
|
|
5
|
-
*/
|
|
6
|
-
export interface RowValidationState {
|
|
7
|
-
/**
|
|
8
|
-
* Index of the row in the table
|
|
9
|
-
*/
|
|
10
|
-
rowIndex: number;
|
|
11
|
-
/**
|
|
12
|
-
* Always false for stored states (only invalid rows are stored)
|
|
13
|
-
*/
|
|
14
|
-
isValid: false;
|
|
15
|
-
/**
|
|
16
|
-
* Number of invalid cells in the row
|
|
17
|
-
*/
|
|
18
|
-
invalidCellCount: number;
|
|
19
|
-
/**
|
|
20
|
-
* Map of column keys to validation error messages
|
|
21
|
-
*/
|
|
22
|
-
cellErrors: Map<string, string>;
|
|
23
|
-
/**
|
|
24
|
-
* Timestamp of the last validation
|
|
25
|
-
*/
|
|
26
|
-
lastValidated: Date;
|
|
27
|
-
}
|