@aquera/ngx-smart-table 0.0.2-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.
Files changed (169) hide show
  1. package/README.md +152 -0
  2. package/aquera-ngx-smart-table.d.ts +5 -0
  3. package/esm2020/aquera-ngx-smart-table.mjs +5 -0
  4. package/esm2020/lib/builder/components/builder-preview/builder-preview.component.mjs +63 -0
  5. package/esm2020/lib/builder/components/builder-toolbar/builder-toolbar.component.mjs +115 -0
  6. package/esm2020/lib/builder/components/column-editor/column-editor.component.mjs +206 -0
  7. package/esm2020/lib/builder/components/column-list/column-list.component.mjs +125 -0
  8. package/esm2020/lib/builder/components/definition-builder/definition-builder.component.mjs +105 -0
  9. package/esm2020/lib/builder/components/table-config-editor/table-config-editor.component.mjs +132 -0
  10. package/esm2020/lib/builder/definition-builder.module.mjs +70 -0
  11. package/esm2020/lib/builder/models/builder-state.interface.mjs +5 -0
  12. package/esm2020/lib/builder/services/definition-builder.service.mjs +251 -0
  13. package/esm2020/lib/builder/services/definition-export.service.mjs +167 -0
  14. package/esm2020/lib/builder/services/definition-import.service.mjs +193 -0
  15. package/esm2020/lib/builder/services/sample-data-generator.service.mjs +126 -0
  16. package/esm2020/lib/builder/utils/config-validator.util.mjs +165 -0
  17. package/esm2020/lib/builder/utils/typescript-generator.util.mjs +206 -0
  18. package/esm2020/lib/editors/index.mjs +9 -0
  19. package/esm2020/lib/editors/nile-autocomplete-editor.mjs +228 -0
  20. package/esm2020/lib/editors/nile-calendar-editor.mjs +214 -0
  21. package/esm2020/lib/editors/nile-date-picker-editor.mjs +227 -0
  22. package/esm2020/lib/editors/nile-input-editor.mjs +235 -0
  23. package/esm2020/lib/editors/nile-select-editor.mjs +317 -0
  24. package/esm2020/lib/factories/column-config.factory.mjs +231 -0
  25. package/esm2020/lib/models/autosave-config.interface.mjs +8 -0
  26. package/esm2020/lib/models/base-column-config.class.mjs +253 -0
  27. package/esm2020/lib/models/cell-strategies.interface.mjs +6 -0
  28. package/esm2020/lib/models/cell-types.mjs +147 -0
  29. package/esm2020/lib/models/column-action.interface.mjs +6 -0
  30. package/esm2020/lib/models/column-config.interface.mjs +43 -0
  31. package/esm2020/lib/models/column-config.utils.mjs +101 -0
  32. package/esm2020/lib/models/row-action.interface.mjs +5 -0
  33. package/esm2020/lib/models/row-validator.interface.mjs +2 -0
  34. package/esm2020/lib/models/schema-validation.interface.mjs +2 -0
  35. package/esm2020/lib/models/sheet-action.interface.mjs +5 -0
  36. package/esm2020/lib/models/sheet-config.interface.mjs +5 -0
  37. package/esm2020/lib/models/table-config.interface.mjs +106 -0
  38. package/esm2020/lib/models/table-validator.interface.mjs +2 -0
  39. package/esm2020/lib/models/workbook-action.interface.mjs +5 -0
  40. package/esm2020/lib/models/workbook-config.interface.mjs +5 -0
  41. package/esm2020/lib/renderer/components/st-add-column-button/st-add-column-button.component.mjs +24 -0
  42. package/esm2020/lib/renderer/components/st-cell/st-cell.component.mjs +391 -0
  43. package/esm2020/lib/renderer/components/st-column-editor-modal/st-column-editor-modal.component.mjs +103 -0
  44. package/esm2020/lib/renderer/components/st-column-filter/st-column-filter.component.mjs +383 -0
  45. package/esm2020/lib/renderer/components/st-column-menu/st-column-menu.component.mjs +232 -0
  46. package/esm2020/lib/renderer/components/st-column-visibility/st-column-visibility.component.mjs +97 -0
  47. package/esm2020/lib/renderer/components/st-header/st-header.component.mjs +157 -0
  48. package/esm2020/lib/renderer/components/st-pagination/st-pagination.component.mjs +87 -0
  49. package/esm2020/lib/renderer/components/st-row-actions-dropdown/st-row-actions-dropdown.component.mjs +167 -0
  50. package/esm2020/lib/renderer/components/st-sheet/st-sheet.component.mjs +165 -0
  51. package/esm2020/lib/renderer/components/st-sheet-actions/st-sheet-actions.component.mjs +112 -0
  52. package/esm2020/lib/renderer/components/st-table/st-table.component.mjs +1246 -0
  53. package/esm2020/lib/renderer/components/st-table-actions/st-table-actions.component.mjs +171 -0
  54. package/esm2020/lib/renderer/components/st-workbook/st-workbook.component.mjs +489 -0
  55. package/esm2020/lib/renderer/directives/click-outside.directive.mjs +28 -0
  56. package/esm2020/lib/renderer/directives/st-column-resize.directive.mjs +108 -0
  57. package/esm2020/lib/renderer/directives/st-keyboard-navigation.directive.mjs +73 -0
  58. package/esm2020/lib/renderer/models/cell-state.interface.mjs +66 -0
  59. package/esm2020/lib/renderer/models/cell.class.mjs +389 -0
  60. package/esm2020/lib/renderer/models/row-validation-state.interface.mjs +7 -0
  61. package/esm2020/lib/renderer/models/sheet-state.class.mjs +90 -0
  62. package/esm2020/lib/renderer/models/sheet-state.interface.mjs +5 -0
  63. package/esm2020/lib/renderer/models/table-state.class.mjs +841 -0
  64. package/esm2020/lib/renderer/models/table-state.interface.mjs +5 -0
  65. package/esm2020/lib/renderer/models/table-types.mjs +29 -0
  66. package/esm2020/lib/renderer/models/table-validation-state.interface.mjs +7 -0
  67. package/esm2020/lib/renderer/models/workbook-state.class.mjs +174 -0
  68. package/esm2020/lib/renderer/models/workbook-state.interface.mjs +5 -0
  69. package/esm2020/lib/renderer/models/z-index.enum.mjs +55 -0
  70. package/esm2020/lib/schemas/table-config.schema.mjs +472 -0
  71. package/esm2020/lib/services/autosave.service.mjs +92 -0
  72. package/esm2020/lib/services/custom-validation-rules.util.mjs +124 -0
  73. package/esm2020/lib/services/json-schema-validator.service.mjs +216 -0
  74. package/esm2020/lib/services/row-validation.service.mjs +42 -0
  75. package/esm2020/lib/services/validation-logger.service.mjs +177 -0
  76. package/esm2020/lib/services/virtual-scroll.service.mjs +52 -0
  77. package/esm2020/lib/shared/shared-table-components.module.mjs +35 -0
  78. package/esm2020/lib/smart-table.module.mjs +124 -0
  79. package/esm2020/lib/strategies/default-editors.mjs +433 -0
  80. package/esm2020/lib/strategies/default-formatters.mjs +238 -0
  81. package/esm2020/lib/strategies/default-validators.mjs +327 -0
  82. package/esm2020/public-api.mjs +146 -0
  83. package/fesm2015/aquera-ngx-smart-table.mjs +11860 -0
  84. package/fesm2015/aquera-ngx-smart-table.mjs.map +1 -0
  85. package/fesm2020/aquera-ngx-smart-table.mjs +11897 -0
  86. package/fesm2020/aquera-ngx-smart-table.mjs.map +1 -0
  87. package/lib/builder/components/builder-preview/builder-preview.component.d.ts +31 -0
  88. package/lib/builder/components/builder-toolbar/builder-toolbar.component.d.ts +53 -0
  89. package/lib/builder/components/column-editor/column-editor.component.d.ts +69 -0
  90. package/lib/builder/components/column-list/column-list.component.d.ts +65 -0
  91. package/lib/builder/components/definition-builder/definition-builder.component.d.ts +58 -0
  92. package/lib/builder/components/table-config-editor/table-config-editor.component.d.ts +32 -0
  93. package/lib/builder/definition-builder.module.d.ts +15 -0
  94. package/lib/builder/models/builder-state.interface.d.ts +93 -0
  95. package/lib/builder/services/definition-builder.service.d.ts +80 -0
  96. package/lib/builder/services/definition-export.service.d.ts +59 -0
  97. package/lib/builder/services/definition-import.service.d.ts +31 -0
  98. package/lib/builder/services/sample-data-generator.service.d.ts +41 -0
  99. package/lib/builder/utils/config-validator.util.d.ts +32 -0
  100. package/lib/builder/utils/typescript-generator.util.d.ts +29 -0
  101. package/lib/editors/index.d.ts +8 -0
  102. package/lib/editors/nile-autocomplete-editor.d.ts +102 -0
  103. package/lib/editors/nile-calendar-editor.d.ts +89 -0
  104. package/lib/editors/nile-date-picker-editor.d.ts +95 -0
  105. package/lib/editors/nile-input-editor.d.ts +67 -0
  106. package/lib/editors/nile-select-editor.d.ts +109 -0
  107. package/lib/factories/column-config.factory.d.ts +73 -0
  108. package/lib/models/autosave-config.interface.d.ts +23 -0
  109. package/lib/models/base-column-config.class.d.ts +115 -0
  110. package/lib/models/cell-strategies.interface.d.ts +181 -0
  111. package/lib/models/cell-types.d.ts +337 -0
  112. package/lib/models/column-action.interface.d.ts +86 -0
  113. package/lib/models/column-config.interface.d.ts +272 -0
  114. package/lib/models/column-config.utils.d.ts +37 -0
  115. package/lib/models/row-action.interface.d.ts +86 -0
  116. package/lib/models/row-validator.interface.d.ts +37 -0
  117. package/lib/models/schema-validation.interface.d.ts +42 -0
  118. package/lib/models/sheet-action.interface.d.ts +59 -0
  119. package/lib/models/sheet-config.interface.d.ts +41 -0
  120. package/lib/models/table-config.interface.d.ts +245 -0
  121. package/lib/models/table-validator.interface.d.ts +40 -0
  122. package/lib/models/workbook-action.interface.d.ts +90 -0
  123. package/lib/models/workbook-config.interface.d.ts +107 -0
  124. package/lib/renderer/components/st-add-column-button/st-add-column-button.component.d.ts +9 -0
  125. package/lib/renderer/components/st-cell/st-cell.component.d.ts +69 -0
  126. package/lib/renderer/components/st-column-editor-modal/st-column-editor-modal.component.d.ts +39 -0
  127. package/lib/renderer/components/st-column-filter/st-column-filter.component.d.ts +139 -0
  128. package/lib/renderer/components/st-column-menu/st-column-menu.component.d.ts +81 -0
  129. package/lib/renderer/components/st-column-visibility/st-column-visibility.component.d.ts +44 -0
  130. package/lib/renderer/components/st-header/st-header.component.d.ts +93 -0
  131. package/lib/renderer/components/st-pagination/st-pagination.component.d.ts +42 -0
  132. package/lib/renderer/components/st-row-actions-dropdown/st-row-actions-dropdown.component.d.ts +67 -0
  133. package/lib/renderer/components/st-sheet/st-sheet.component.d.ts +98 -0
  134. package/lib/renderer/components/st-sheet-actions/st-sheet-actions.component.d.ts +58 -0
  135. package/lib/renderer/components/st-table/st-table.component.d.ts +349 -0
  136. package/lib/renderer/components/st-table-actions/st-table-actions.component.d.ts +77 -0
  137. package/lib/renderer/components/st-workbook/st-workbook.component.d.ts +235 -0
  138. package/lib/renderer/directives/click-outside.directive.d.ts +10 -0
  139. package/lib/renderer/directives/st-column-resize.directive.d.ts +44 -0
  140. package/lib/renderer/directives/st-keyboard-navigation.directive.d.ts +15 -0
  141. package/lib/renderer/models/cell-state.interface.d.ts +118 -0
  142. package/lib/renderer/models/cell.class.d.ts +174 -0
  143. package/lib/renderer/models/row-validation-state.interface.d.ts +27 -0
  144. package/lib/renderer/models/sheet-state.class.d.ts +67 -0
  145. package/lib/renderer/models/sheet-state.interface.d.ts +55 -0
  146. package/lib/renderer/models/table-state.class.d.ts +313 -0
  147. package/lib/renderer/models/table-state.interface.d.ts +18 -0
  148. package/lib/renderer/models/table-types.d.ts +228 -0
  149. package/lib/renderer/models/table-validation-state.interface.d.ts +34 -0
  150. package/lib/renderer/models/workbook-state.class.d.ts +117 -0
  151. package/lib/renderer/models/workbook-state.interface.d.ts +71 -0
  152. package/lib/renderer/models/z-index.enum.d.ts +44 -0
  153. package/lib/schemas/table-config.schema.d.ts +455 -0
  154. package/lib/services/autosave.service.d.ts +73 -0
  155. package/lib/services/custom-validation-rules.util.d.ts +12 -0
  156. package/lib/services/json-schema-validator.service.d.ts +49 -0
  157. package/lib/services/row-validation.service.d.ts +17 -0
  158. package/lib/services/validation-logger.service.d.ts +87 -0
  159. package/lib/services/virtual-scroll.service.d.ts +44 -0
  160. package/lib/shared/shared-table-components.module.d.ts +9 -0
  161. package/lib/smart-table.module.d.ts +26 -0
  162. package/lib/strategies/default-editors.d.ts +109 -0
  163. package/lib/strategies/default-formatters.d.ts +116 -0
  164. package/lib/strategies/default-validators.d.ts +113 -0
  165. package/package.json +42 -0
  166. package/public-api.d.ts +70 -0
  167. package/src/lib/builder/README.md +30 -0
  168. package/src/lib/editors/README.md +303 -0
  169. package/src/lib/renderer/components/st-column-filter/README.md +286 -0
@@ -0,0 +1,349 @@
1
+ import { EventEmitter, OnInit, OnDestroy, OnChanges, SimpleChanges, ElementRef, AfterViewInit } from '@angular/core';
2
+ import { ColumnConfig } from '../../../models/column-config.interface';
3
+ import { Cell } from '../../models/cell.class';
4
+ import { TableState } from '../../models/table-state.class';
5
+ import { TableConfig } from '../../../models/table-config.interface';
6
+ import { TableStateChangeEvent, ColumnResizeEvent, ColumnAddEvent, ColumnMoveEvent, DataChangeEvent } from '../../models/table-types';
7
+ import { CellChangeEvent, CellSaveEvent, CellEditEvent, CellCancelEvent, EditMode, NavigationDirection } from '../../../models/cell-types';
8
+ import { BehaviorSubject, Observable } from 'rxjs';
9
+ import { JsonSchemaValidatorService } from '../../../services/json-schema-validator.service';
10
+ import { SchemaValidationError } from '../../../models/schema-validation.interface';
11
+ import { ValidationLoggerService } from '../../../services/validation-logger.service';
12
+ import { VirtualScrollService } from '../../../services/virtual-scroll.service';
13
+ import { RowAction, RowActionContext, RowActionEvent } from '../../../models/row-action.interface';
14
+ import { ColumnActionContext, ColumnActionEvent } from '../../../models/column-action.interface';
15
+ import { TableZIndex } from '../../models/z-index.enum';
16
+ import { TableValidationState } from '../../models/table-validation-state.interface';
17
+ import * as i0 from "@angular/core";
18
+ export declare class StTableComponent implements OnInit, OnChanges, OnDestroy, AfterViewInit {
19
+ private schemaValidator;
20
+ private logger;
21
+ private virtualScrollService;
22
+ readonly ZIndex: typeof TableZIndex;
23
+ tableConfig: TableConfig;
24
+ data?: any[];
25
+ data$?: Observable<any[]> | BehaviorSubject<any[]>;
26
+ tableState?: TableState;
27
+ enableSorting: boolean;
28
+ enableFiltering: boolean;
29
+ stateChange: EventEmitter<TableStateChangeEvent>;
30
+ dataChange: EventEmitter<DataChangeEvent>;
31
+ cellEdit: EventEmitter<CellEditEvent<any>>;
32
+ cellSave: EventEmitter<CellSaveEvent<any>>;
33
+ cellCancel: EventEmitter<CellCancelEvent<any>>;
34
+ cellChange: EventEmitter<CellChangeEvent<any>>;
35
+ columnResized: EventEmitter<ColumnResizeEvent>;
36
+ columnMoved: EventEmitter<ColumnMoveEvent>;
37
+ configValidationErrors: EventEmitter<SchemaValidationError[]>;
38
+ columnAdded: EventEmitter<ColumnAddEvent>;
39
+ rowAction: EventEmitter<RowActionEvent>;
40
+ validationStateChange: EventEmitter<TableValidationState>;
41
+ validateConfig: boolean;
42
+ private internalTableState?;
43
+ private internalCellGrid?;
44
+ private stateSubscription?;
45
+ private focusSubscription?;
46
+ private validationSubscription?;
47
+ private dataSubscription?;
48
+ private internalData$;
49
+ private previousData;
50
+ mergedConfig: TableConfig;
51
+ showColumnModal: boolean;
52
+ visibleColumns: ColumnConfig<any>[];
53
+ visibleCellGrid: Cell<any>[][];
54
+ dropdownState: {
55
+ isOpen: boolean;
56
+ position: {
57
+ x: number;
58
+ y: number;
59
+ };
60
+ context: RowActionContext | null;
61
+ };
62
+ skeletonColumns?: number[];
63
+ skeletonRows?: number[];
64
+ columnMenuState: {
65
+ isOpen: boolean;
66
+ position: {
67
+ x: number;
68
+ y: number;
69
+ };
70
+ context: ColumnActionContext | null;
71
+ };
72
+ private scrollContainer?;
73
+ private scrollSubscription?;
74
+ private virtualScrollState$;
75
+ virtualScrollTotalHeight$: Observable<number>;
76
+ virtualScrollOffsetY$: Observable<number>;
77
+ virtualScrollOffsetYNeg$: Observable<number>;
78
+ visibleRows$: Observable<Cell<any>[][]>;
79
+ scrollViewport?: ElementRef<HTMLElement>;
80
+ constructor(schemaValidator: JsonSchemaValidatorService, logger: ValidationLoggerService, virtualScrollService: VirtualScrollService);
81
+ ngOnInit(): void;
82
+ ngAfterViewInit(): void;
83
+ ngOnChanges(changes: SimpleChanges): void;
84
+ /**
85
+ * Create internal TableState from config
86
+ */
87
+ private createInternalTableState;
88
+ /**
89
+ * Subscribe to external TableState changes
90
+ */
91
+ private subscribeToExternalTableState;
92
+ /**
93
+ * Create cell grid from raw data
94
+ */
95
+ private createCellGridFromData;
96
+ /**
97
+ * Setup data source - either sync array or async Observable
98
+ * Handles initialization and subscription to data changes
99
+ */
100
+ private setupDataSource;
101
+ /**
102
+ * Subscribe to data changes (either from data$ input or internal BehaviorSubject)
103
+ */
104
+ private subscribeToDataChanges;
105
+ /**
106
+ * Handle data change from Observable emission
107
+ */
108
+ private handleDataChange;
109
+ /**
110
+ * Handle sync data change (from @Input() data changes)
111
+ */
112
+ private handleSyncDataChange;
113
+ /**
114
+ * Get active TableState (provided or internal)
115
+ */
116
+ getActiveTableState(): TableState;
117
+ /**
118
+ * Get active cell grid (provided or internal)
119
+ */
120
+ getActiveCellGrid(): Cell<any>[][];
121
+ /**
122
+ * Get visible cell grid (filtered to only include visible columns)
123
+ */
124
+ getVisibleCellGrid(): Cell<any>[][];
125
+ /**
126
+ * Update the visible cell grid based on current visibility and column order
127
+ * Called when data, visibility, or column order changes
128
+ *
129
+ * This method properly handles column reordering by mapping cells based on
130
+ * column keys rather than indices, ensuring cells follow their columns.
131
+ */
132
+ private updateVisibleCellGrid;
133
+ /**
134
+ * Update the visible columns based on current visibility
135
+ * Called only when visibility actually changes
136
+ */
137
+ private updateVisibleColumns;
138
+ /**
139
+ * Update both visible columns and cell grid
140
+ * Call this whenever data or visibility changes
141
+ */
142
+ private updateVisibleData;
143
+ /**
144
+ * Get active columns (from config or legacy input)
145
+ */
146
+ getActiveColumns(): ColumnConfig<any>[];
147
+ /**
148
+ * Get visible columns (filtered by visibility property)
149
+ * Also recalculates sticky offsets based on visible columns only
150
+ */
151
+ getVisibleColumns(): ColumnConfig<any>[];
152
+ /**
153
+ * Recalculate sticky offsets based on visible columns only
154
+ * This ensures correct positioning when columns are hidden
155
+ */
156
+ private recalculateVisibleStickyOffsets;
157
+ onCellChange(event: CellChangeEvent): void;
158
+ onColumnResized(event: ColumnResizeEvent): void;
159
+ onColumnMoved(event: {
160
+ columnKey: string;
161
+ direction: 'left' | 'right';
162
+ }): void;
163
+ /**
164
+ * Move column to position just before right sticky columns (used when pinning right)
165
+ */
166
+ private moveColumnToEnd;
167
+ /**
168
+ * Get cumulative left offset for a sticky column on the left side
169
+ */
170
+ getStickyLeftOffset(columnKey: string): number;
171
+ /**
172
+ * Get cumulative right offset for a sticky column on the right side
173
+ */
174
+ getStickyRightOffset(columnKey: string): number;
175
+ /**
176
+ * Check if top pagination should be shown
177
+ */
178
+ showTopPagination(): boolean;
179
+ /**
180
+ * Check if bottom pagination should be shown
181
+ */
182
+ showBottomPagination(): boolean;
183
+ /**
184
+ * Validate table configuration
185
+ * @param config Table configuration to validate
186
+ */
187
+ private validateConfiguration;
188
+ /**
189
+ * Handle add column button click
190
+ */
191
+ onAddColumnClick(): void;
192
+ /**
193
+ * Handle column created from modal
194
+ */
195
+ onColumnCreated(column: ColumnConfig): void;
196
+ /**
197
+ * Handle modal cancelled
198
+ */
199
+ onModalCancelled(): void;
200
+ /**
201
+ * Check if virtual scroll is enabled
202
+ */
203
+ isVirtualScrollEnabled(): boolean;
204
+ /**
205
+ * Check if column is the first sticky-right column (for shadow styling)
206
+ */
207
+ isFirstStickyRight(columnKey: string): boolean;
208
+ /**
209
+ * Get virtual scroll item size
210
+ */
211
+ getVirtualScrollItemSize(): number;
212
+ /**
213
+ * Get viewport height
214
+ */
215
+ getVirtualScrollViewportHeight(): number;
216
+ /**
217
+ * Get buffer size
218
+ */
219
+ getVirtualScrollBufferSize(): number;
220
+ /**
221
+ * Initialize virtual scroll state
222
+ */
223
+ private initializeVirtualScroll;
224
+ /**
225
+ * Setup scroll event listener
226
+ */
227
+ private setupVirtualScrollListener;
228
+ /**
229
+ * Handle virtual scroll event
230
+ */
231
+ private onVirtualScroll;
232
+ /**
233
+ * Get row index for tracking
234
+ */
235
+ getAbsoluteRowIndex(relativeIndex: number): number;
236
+ /**
237
+ * TrackBy function for better performance
238
+ */
239
+ trackByRowIndex: (index: number, row: Cell<any>[]) => number;
240
+ /**
241
+ * Scroll to specific row programmatically
242
+ */
243
+ scrollToRow(index: number): void;
244
+ /**
245
+ * Check if row actions are enabled
246
+ */
247
+ hasRowActions(): boolean;
248
+ /**
249
+ * Get row actions from config
250
+ */
251
+ getRowActions(): RowAction[];
252
+ /**
253
+ * Get row data from cell grid
254
+ */
255
+ getRowData(rowIndex: number): any;
256
+ /**
257
+ * Open row actions dropdown
258
+ */
259
+ openRowActionsDropdown(event: MouseEvent, rowData: any, rowIndex: number): void;
260
+ /**
261
+ * Close row actions dropdown
262
+ */
263
+ closeRowActionsDropdown(): void;
264
+ /**
265
+ * Handle row action clicked
266
+ */
267
+ onRowActionClicked(event: RowActionEvent): void;
268
+ /**
269
+ * Open column menu dropdown
270
+ */
271
+ openColumnMenu(event: MouseEvent, column: ColumnConfig<any>, columnIndex: number, isFirst: boolean, isLast: boolean): void;
272
+ /**
273
+ * Close column menu dropdown
274
+ */
275
+ closeColumnMenu(): void;
276
+ /**
277
+ * Handle column action clicked
278
+ */
279
+ onColumnActionClicked(event: ColumnActionEvent): void;
280
+ /**
281
+ * Get column actions (built-in + custom)
282
+ */
283
+ private getColumnActions;
284
+ /**
285
+ * Get built-in column actions (sort, filter, pin, move)
286
+ */
287
+ private getBuiltInColumnActions;
288
+ /**
289
+ * Get sort label based on column data type
290
+ */
291
+ private getSortLabel;
292
+ /**
293
+ * Initialize keyboard navigation
294
+ */
295
+ private initializeKeyboardNavigation;
296
+ /**
297
+ * Update focus state in all cells
298
+ */
299
+ private updateCellFocusStates;
300
+ /**
301
+ * Focus the TD element in the DOM
302
+ */
303
+ private focusTdElement;
304
+ /**
305
+ * Handle cell click
306
+ */
307
+ onCellClick(rowIndex: number, columnIndex: number): void;
308
+ /**
309
+ * Handle cell entering edit mode
310
+ */
311
+ onCellEdit(event: CellEditEvent): void;
312
+ /**
313
+ * Handle cell save
314
+ */
315
+ onCellSave(event: CellSaveEvent): void;
316
+ /**
317
+ * Handle cell cancel
318
+ */
319
+ onCellCancel(event: CellCancelEvent): void;
320
+ /**
321
+ * Handle cell save with navigation (Excel-like behavior)
322
+ */
323
+ onCellSaveAndNavigate(event: {
324
+ event: KeyboardEvent;
325
+ direction: NavigationDirection;
326
+ }): void;
327
+ /**
328
+ * Handle focus on table container - focus first cell if no cell is focused
329
+ */
330
+ onTableContainerFocus(event: FocusEvent): void;
331
+ /**
332
+ * Check if keyboard navigation is enabled
333
+ */
334
+ isKeyboardNavigationEnabled(): boolean;
335
+ /**
336
+ * Get EditMode enum value for cells
337
+ * For Excel-like tables with keyboard navigation, use ENTER mode
338
+ * which allows arrow key navigation without triggering edit.
339
+ * Double-click will still work to start editing.
340
+ */
341
+ getEditModeForCells(): EditMode;
342
+ /**
343
+ * Clear focus when clicking outside table
344
+ */
345
+ onDocumentClick(event: MouseEvent): void;
346
+ ngOnDestroy(): void;
347
+ static ɵfac: i0.ɵɵFactoryDeclaration<StTableComponent, never>;
348
+ static ɵcmp: i0.ɵɵComponentDeclaration<StTableComponent, "st-table", never, { "tableConfig": "tableConfig"; "data": "data"; "data$": "data$"; "tableState": "tableState"; "enableSorting": "enableSorting"; "enableFiltering": "enableFiltering"; "validateConfig": "validateConfig"; }, { "stateChange": "stateChange"; "dataChange": "dataChange"; "cellEdit": "cellEdit"; "cellSave": "cellSave"; "cellCancel": "cellCancel"; "cellChange": "cellChange"; "columnResized": "columnResized"; "columnMoved": "columnMoved"; "configValidationErrors": "configValidationErrors"; "columnAdded": "columnAdded"; "rowAction": "rowAction"; "validationStateChange": "validationStateChange"; }, never, never>;
349
+ }
@@ -0,0 +1,77 @@
1
+ import { EventEmitter, OnInit, OnDestroy } from '@angular/core';
2
+ import { TableState } from '../../models/table-state.class';
3
+ import * as i0 from "@angular/core";
4
+ declare type MenuView = 'main' | 'columns';
5
+ export declare class StTableActionsComponent implements OnInit, OnDestroy {
6
+ tableState: TableState;
7
+ allowAddColumn: boolean;
8
+ addColumnClicked: EventEmitter<void>;
9
+ isOpen: boolean;
10
+ currentView: MenuView;
11
+ columnsVisibility: {
12
+ key: string;
13
+ header: string;
14
+ visible: boolean;
15
+ hideable: boolean;
16
+ }[];
17
+ /**
18
+ * Dropdown positioning style
19
+ */
20
+ dropdownStyle: any;
21
+ private stateSubscription?;
22
+ constructor();
23
+ ngOnInit(): void;
24
+ ngOnDestroy(): void;
25
+ /**
26
+ * Update columns visibility list from current table state
27
+ */
28
+ private updateColumnsVisibility;
29
+ /**
30
+ * Subscribe to table state changes
31
+ */
32
+ private subscribeToStateChanges;
33
+ /**
34
+ * Toggle menu open/close
35
+ */
36
+ toggleMenu(event: Event): void;
37
+ /**
38
+ * Update dropdown position based on trigger button
39
+ */
40
+ private updateDropdownPosition;
41
+ /**
42
+ * Close menu
43
+ */
44
+ closeMenu(): void;
45
+ /**
46
+ * Handle add column action
47
+ */
48
+ onAddColumn(event: Event): void;
49
+ /**
50
+ * Open column visibility submenu
51
+ */
52
+ openColumnsSubmenu(event: Event): void;
53
+ /**
54
+ * Go back to main menu
55
+ */
56
+ backToMain(event: Event): void;
57
+ /**
58
+ * Toggle column visibility
59
+ */
60
+ onToggleColumn(columnKey: string, event: Event): void;
61
+ /**
62
+ * Check if column is visible
63
+ */
64
+ isColumnVisible(columnKey: string): boolean;
65
+ /**
66
+ * Check if column is hideable
67
+ */
68
+ isColumnHideable(column: {
69
+ key: string;
70
+ header: string;
71
+ visible: boolean;
72
+ hideable: boolean;
73
+ }): boolean;
74
+ static ɵfac: i0.ɵɵFactoryDeclaration<StTableActionsComponent, never>;
75
+ static ɵcmp: i0.ɵɵComponentDeclaration<StTableActionsComponent, "st-table-actions", never, { "tableState": "tableState"; "allowAddColumn": "allowAddColumn"; }, { "addColumnClicked": "addColumnClicked"; }, never, never>;
76
+ }
77
+ export {};
@@ -0,0 +1,235 @@
1
+ import { EventEmitter, OnInit, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import { WorkbookConfig, WorkbookSheetConfig } from '../../../models/workbook-config.interface';
4
+ import { WorkbookAction, WorkbookActionEvent, SheetTabActionEvent } from '../../../models/workbook-action.interface';
5
+ import { WorkbookState } from '../../models/workbook-state.class';
6
+ import { TableState } from '../../models/table-state.class';
7
+ import { TableConfig } from '../../../models/table-config.interface';
8
+ import { CellChangeEvent } from '../../../models/cell-types';
9
+ import { TableStateChangeEvent } from '../../models/table-types';
10
+ import { AutosaveService } from '../../../services/autosave.service';
11
+ import * as i0 from "@angular/core";
12
+ export declare class StWorkbookComponent implements OnInit, OnChanges, OnDestroy {
13
+ private autosaveService;
14
+ /**
15
+ * Workbook configuration
16
+ */
17
+ config: WorkbookConfig;
18
+ /**
19
+ * Map of sheet ID to data array
20
+ */
21
+ sheetsData: BehaviorSubject<Map<string, any[]>>;
22
+ /**
23
+ * Optional external state management
24
+ */
25
+ state?: WorkbookState;
26
+ /**
27
+ * Emitted when active sheet changes
28
+ */
29
+ sheetChanged: EventEmitter<number>;
30
+ /**
31
+ * Emitted when add sheet button is clicked
32
+ */
33
+ addSheet: EventEmitter<void>;
34
+ /**
35
+ * Emitted when a sheet tab action is clicked
36
+ */
37
+ sheetTabAction: EventEmitter<SheetTabActionEvent>;
38
+ /**
39
+ * Emitted when a workbook action is clicked
40
+ */
41
+ workbookAction: EventEmitter<WorkbookActionEvent>;
42
+ /**
43
+ * Emitted when cell value changes
44
+ */
45
+ cellChange: EventEmitter<CellChangeEvent<any>>;
46
+ /**
47
+ * Emitted when cell is saved
48
+ */
49
+ cellSave: EventEmitter<any>;
50
+ /**
51
+ * Emitted when table state changes
52
+ */
53
+ tableStateChange: EventEmitter<TableStateChangeEvent>;
54
+ /**
55
+ * Emitted when fullscreen is toggled
56
+ */
57
+ fullscreenToggle: EventEmitter<boolean>;
58
+ /**
59
+ * Array of sheets
60
+ */
61
+ sheets: WorkbookSheetConfig[];
62
+ /**
63
+ * Active sheet index
64
+ */
65
+ activeSheetIndex: number;
66
+ /**
67
+ * Current table config (for active sheet)
68
+ */
69
+ currentTableConfig: TableConfig | null;
70
+ /**
71
+ * Current table data (for active sheet)
72
+ */
73
+ currentTableData: any[];
74
+ /**
75
+ * Current table state (for active sheet)
76
+ */
77
+ currentTableState: TableState | null;
78
+ /**
79
+ * Unique key for table component (changes on sheet switch to force reinitialization)
80
+ */
81
+ tableComponentKey: string;
82
+ /**
83
+ * Internal state instance
84
+ */
85
+ internalState?: WorkbookState;
86
+ /**
87
+ * Fullscreen state observable
88
+ */
89
+ isFullscreen$: BehaviorSubject<boolean>;
90
+ /**
91
+ * Tab actions dropdown state
92
+ */
93
+ tabActionsOpen: boolean;
94
+ selectedSheet: WorkbookSheetConfig | null;
95
+ selectedSheetIndex: number;
96
+ tabActionsPosition: any;
97
+ /**
98
+ * Workbook actions dropdown state
99
+ */
100
+ workbookActionsOpen: boolean;
101
+ workbookActionsPosition: any;
102
+ /**
103
+ * Visible workbook actions (filtered by hidden)
104
+ */
105
+ visibleWorkbookActions: WorkbookAction[];
106
+ /**
107
+ * Destroy subject for cleanup
108
+ */
109
+ private destroy$;
110
+ /**
111
+ * Autosave enabled flag
112
+ */
113
+ autosaveEnabled: boolean;
114
+ /**
115
+ * Autosave strategy
116
+ */
117
+ private autosaveStrategy;
118
+ /**
119
+ * Last save timestamp
120
+ */
121
+ lastSaveTime: Date | null;
122
+ /**
123
+ * Saving indicator
124
+ */
125
+ isSaving: boolean;
126
+ /**
127
+ * Beforeunload handler reference
128
+ */
129
+ private beforeUnloadHandler;
130
+ constructor(autosaveService: AutosaveService);
131
+ ngOnInit(): void;
132
+ ngOnChanges(changes: SimpleChanges): void;
133
+ /**
134
+ * Initialize component state
135
+ */
136
+ private initializeComponent;
137
+ /**
138
+ * Get active state (external or internal)
139
+ */
140
+ get activeState(): WorkbookState;
141
+ /**
142
+ * Handle tab change event from nile-tab-group
143
+ */
144
+ onTabChange(event: any): void;
145
+ /**
146
+ * Update active sheet data (triggers table re-initialization with new config/state)
147
+ */
148
+ private updateActiveSheet;
149
+ /**
150
+ * Add new sheet
151
+ */
152
+ onAddSheet(): void;
153
+ /**
154
+ * Check if can add more sheets
155
+ */
156
+ get canAddSheet(): boolean;
157
+ /**
158
+ * Get minimum sheets required
159
+ */
160
+ get minSheets(): number;
161
+ /**
162
+ * Open tab actions dropdown
163
+ */
164
+ openTabActions(event: MouseEvent, sheet: WorkbookSheetConfig, index: number): void;
165
+ /**
166
+ * Close tab actions dropdown
167
+ */
168
+ closeTabActions(): void;
169
+ /**
170
+ * Check if sheet has tab actions
171
+ */
172
+ hasTabActions(sheet: WorkbookSheetConfig): boolean;
173
+ /**
174
+ * Handle tab action click
175
+ */
176
+ onTabActionClick(action: any, event: Event): void;
177
+ /**
178
+ * Toggle workbook actions dropdown
179
+ */
180
+ toggleWorkbookActions(event: MouseEvent): void;
181
+ /**
182
+ * Close workbook actions dropdown
183
+ */
184
+ closeWorkbookActions(): void;
185
+ /**
186
+ * Update visible workbook actions
187
+ */
188
+ private updateVisibleWorkbookActions;
189
+ /**
190
+ * Check if workbook action is disabled
191
+ */
192
+ isActionDisabled(action: WorkbookAction): boolean;
193
+ /**
194
+ * Handle workbook action click
195
+ */
196
+ onWorkbookActionClick(action: WorkbookAction, event: Event): void;
197
+ /**
198
+ * Toggle fullscreen mode
199
+ */
200
+ toggleFullscreen(): void;
201
+ /**
202
+ * Handle cell change from table - update internal data and pass through to parent
203
+ */
204
+ onCellChange(event: CellChangeEvent): void;
205
+ /**
206
+ * Handle cell save from table - update internal data and pass through to parent
207
+ */
208
+ onCellSave(event: any): void;
209
+ /**
210
+ * Handle table state change - pass through to parent
211
+ */
212
+ onTableStateChange(event: TableStateChangeEvent): void;
213
+ /**
214
+ * Component cleanup
215
+ */
216
+ ngOnDestroy(): void;
217
+ /**
218
+ * Initialize autosave subscription
219
+ */
220
+ private initializeAutosave;
221
+ /**
222
+ * Perform autosave operation
223
+ */
224
+ private performAutosave;
225
+ /**
226
+ * Setup auto-restore from autosave
227
+ */
228
+ private setupAutoRestore;
229
+ /**
230
+ * Setup beforeunload warning for unsaved changes
231
+ */
232
+ private setupBeforeUnloadWarning;
233
+ static ɵfac: i0.ɵɵFactoryDeclaration<StWorkbookComponent, never>;
234
+ 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"; }, never, never>;
235
+ }
@@ -0,0 +1,10 @@
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
+ }