@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,245 @@
1
+ /**
2
+ * Table configuration interface - centralizes all table settings
3
+ * Provides a single source of truth for pagination, sorting, filtering, and display options
4
+ */
5
+ import { ColumnConfig } from './column-config.interface';
6
+ import { SortDirection, FilterOperator } from '../renderer/models/table-types';
7
+ import { RowManagementConfig } from './row-action.interface';
8
+ import { Observable } from 'rxjs';
9
+ /**
10
+ * Comprehensive table configuration interface
11
+ */
12
+ export interface TableConfig {
13
+ /**
14
+ * Column definitions (required)
15
+ */
16
+ columns: ColumnConfig[];
17
+ /**
18
+ * Pagination configuration
19
+ */
20
+ pagination?: {
21
+ /**
22
+ * Enable pagination
23
+ * @default true
24
+ */
25
+ enabled?: boolean;
26
+ /**
27
+ * Number of items per page
28
+ * @default 25
29
+ */
30
+ pageSize?: number;
31
+ /**
32
+ * Available page size options for user selection
33
+ * @default [10, 25, 50, 100]
34
+ */
35
+ pageSizeOptions?: number[];
36
+ /**
37
+ * Show pagination controls at the top of the table
38
+ * @default false
39
+ */
40
+ showTopControls?: boolean;
41
+ /**
42
+ * Show pagination controls at the bottom of the table
43
+ * @default true
44
+ */
45
+ showBottomControls?: boolean;
46
+ /**
47
+ * Total number of items available (for server-side pagination)
48
+ * When set, the pagination controls will display the correct total pages
49
+ * @default undefined (will be calculated from data length)
50
+ */
51
+ totalItems?: number;
52
+ /**
53
+ * Variant for nile-pagination component styling
54
+ * @default 'fluid'
55
+ */
56
+ variant?: 'fluid' | 'compact';
57
+ };
58
+ /**
59
+ * Sorting configuration
60
+ */
61
+ sorting?: {
62
+ /**
63
+ * Enable sorting
64
+ * @default true
65
+ */
66
+ enabled?: boolean;
67
+ /**
68
+ * Allow sorting by multiple columns simultaneously
69
+ * @default false
70
+ */
71
+ multiColumn?: boolean;
72
+ /**
73
+ * Sorting mode - local (client-side) or server (API-based)
74
+ * @default 'server'
75
+ */
76
+ mode?: 'local' | 'server';
77
+ };
78
+ /**
79
+ * Filtering configuration
80
+ */
81
+ filtering?: {
82
+ /**
83
+ * Enable filtering
84
+ * @default false
85
+ */
86
+ enabled?: boolean;
87
+ /**
88
+ * Filtering mode - local (client-side) or server (API-based)
89
+ * @default 'server'
90
+ */
91
+ mode?: 'local' | 'server';
92
+ };
93
+ /**
94
+ * Selection configuration (future feature)
95
+ */
96
+ selection?: {
97
+ /**
98
+ * Enable row selection
99
+ * @default false
100
+ */
101
+ enabled?: boolean;
102
+ /**
103
+ * Selection mode - single row or multiple rows
104
+ * @default 'multiple'
105
+ */
106
+ mode?: 'single' | 'multiple';
107
+ };
108
+ /**
109
+ * Display configuration
110
+ */
111
+ display?: {
112
+ /**
113
+ * Make table header sticky on scroll
114
+ * @default true
115
+ */
116
+ stickyHeader?: boolean;
117
+ /**
118
+ * Highlight row on hover
119
+ * @default true
120
+ */
121
+ hover?: boolean;
122
+ /**
123
+ * Max height of the table in pixels
124
+ * @default 300
125
+ */
126
+ maxHeight?: number;
127
+ /**
128
+ * Virtual scroll configuration for large datasets
129
+ * Enables efficient rendering by only showing visible rows
130
+ */
131
+ virtualScroll?: {
132
+ /**
133
+ * Enable virtual scrolling
134
+ * @default false
135
+ */
136
+ enabled?: boolean;
137
+ /**
138
+ * Row height in pixels (must be consistent for all rows)
139
+ * @default 48
140
+ */
141
+ itemSize?: number;
142
+ /**
143
+ * Number of buffer rows to render above/below viewport
144
+ * Higher values provide smoother scrolling but use more memory
145
+ * @default 5
146
+ */
147
+ bufferSize?: number;
148
+ /**
149
+ * Viewport height in pixels
150
+ * @default 600
151
+ */
152
+ viewportHeight?: number;
153
+ };
154
+ };
155
+ /**
156
+ * Initial state configuration
157
+ */
158
+ initialState?: {
159
+ /**
160
+ * Initial page number (0-indexed)
161
+ * @default 0
162
+ */
163
+ page?: number;
164
+ /**
165
+ * Initial sort configuration
166
+ */
167
+ sortBy?: Array<{
168
+ key: string;
169
+ direction: SortDirection;
170
+ }>;
171
+ /**
172
+ * Initial filter configuration
173
+ */
174
+ filters?: Array<{
175
+ key: string;
176
+ operator: FilterOperator;
177
+ value: any;
178
+ }>;
179
+ };
180
+ /**
181
+ * Features configuration
182
+ */
183
+ features?: {
184
+ /**
185
+ * Column management features
186
+ */
187
+ columnManagement?: {
188
+ /**
189
+ * Allow users to add new columns dynamically
190
+ * @default false
191
+ */
192
+ allowAdd?: boolean;
193
+ };
194
+ /**
195
+ * Row management features
196
+ * Provides a settings column with configurable actions for each row
197
+ */
198
+ rowManagement?: RowManagementConfig;
199
+ /**
200
+ * Keyboard navigation features
201
+ * Enables Excel-like keyboard navigation with arrow keys
202
+ */
203
+ keyboardNavigation?: {
204
+ /**
205
+ * Enable keyboard navigation
206
+ * @default false
207
+ */
208
+ enabled?: boolean;
209
+ };
210
+ };
211
+ /**
212
+ * Validation configuration - accumulates cell validation results
213
+ */
214
+ validation?: {
215
+ /**
216
+ * Validation trigger mode
217
+ * - 'lazy': Validate on cell save/blur
218
+ * - 'eager': Validate on every cell change
219
+ * @default 'lazy'
220
+ */
221
+ mode?: 'lazy' | 'eager';
222
+ };
223
+ /**
224
+ * Table skeleton configuration
225
+ * Shows a skeleton loader while data is loading
226
+ * @default undefined (disabled)
227
+ */
228
+ tableSkeleton?: {
229
+ enabled: Observable<boolean>;
230
+ rows: number;
231
+ columns: number;
232
+ };
233
+ /**
234
+ * Show row number in the table
235
+ */
236
+ showRowNumber?: boolean;
237
+ }
238
+ /**
239
+ * Default table configuration with sensible defaults
240
+ */
241
+ export declare const DEFAULT_TABLE_CONFIG: Partial<TableConfig>;
242
+ /**
243
+ * Helper function to merge user config with defaults
244
+ */
245
+ export declare function mergeTableConfig(userConfig: TableConfig): TableConfig;
@@ -0,0 +1,40 @@
1
+ import { TableConfig } from './table-config.interface';
2
+ import { RowValidationResult } from './row-validator.interface';
3
+ /**
4
+ * Table-level validation result
5
+ */
6
+ export interface TableValidationResult {
7
+ /** Whether the entire table is valid */
8
+ valid: boolean;
9
+ /** Row-specific validation results (rowIndex -> result) */
10
+ rowResults?: Map<number, RowValidationResult>;
11
+ /** Global table-level errors */
12
+ globalErrors?: string[];
13
+ /** Global warnings */
14
+ globalWarnings?: string[];
15
+ /** Total number of invalid rows */
16
+ invalidRowCount?: number;
17
+ /** Total number of valid rows */
18
+ validRowCount?: number;
19
+ }
20
+ /**
21
+ * Table validator interface for validating entire table
22
+ */
23
+ export interface TableValidator {
24
+ /**
25
+ * Validates the entire table
26
+ * @param rows Array of row data
27
+ * @param config Table configuration
28
+ * @param rowValidationResults Optional pre-computed row validation results
29
+ * @returns Table validation result
30
+ */
31
+ validateTable(rows: any[], config: TableConfig, rowValidationResults?: Map<number, RowValidationResult>): TableValidationResult;
32
+ /**
33
+ * Optional error message template
34
+ */
35
+ errorMessage?: string;
36
+ /**
37
+ * Optional validation ID
38
+ */
39
+ validatorId?: string;
40
+ }
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Workbook action interfaces for configurable workbook-level features
3
+ */
4
+ import { WorkbookSheetConfig } from './workbook-config.interface';
5
+ /**
6
+ * Defines a workbook-level action (export all, print, etc.)
7
+ */
8
+ export interface WorkbookAction {
9
+ /**
10
+ * Unique identifier for the action
11
+ */
12
+ id: string;
13
+ /**
14
+ * Display label for the action
15
+ */
16
+ label: string;
17
+ /**
18
+ * Optional icon to display (nile-icon name)
19
+ */
20
+ icon?: string;
21
+ /**
22
+ * Function to determine if action should be disabled
23
+ */
24
+ disabled?: boolean | (() => boolean);
25
+ /**
26
+ * Function to determine if action should be hidden
27
+ */
28
+ hidden?: boolean | (() => boolean);
29
+ /**
30
+ * Callback function to execute when action is clicked
31
+ * @param workbookId The ID of the workbook
32
+ */
33
+ action?: (workbookId: string) => void;
34
+ }
35
+ /**
36
+ * Defines a sheet tab action (rename, duplicate, delete)
37
+ */
38
+ export interface SheetTabAction {
39
+ /**
40
+ * Unique identifier for the action
41
+ */
42
+ id: string;
43
+ /**
44
+ * Display label for the action
45
+ */
46
+ label: string;
47
+ /**
48
+ * Optional icon to display (nile-icon name)
49
+ */
50
+ icon?: string;
51
+ /**
52
+ * Function to determine if action should be disabled
53
+ */
54
+ disabled?: boolean | ((sheet: WorkbookSheetConfig) => boolean);
55
+ /**
56
+ * Function to determine if action should be hidden
57
+ */
58
+ hidden?: boolean | ((sheet: WorkbookSheetConfig) => boolean);
59
+ /**
60
+ * Callback function to execute when action is clicked
61
+ * @param sheetId The ID of the sheet
62
+ */
63
+ action?: (sheetId: string) => void;
64
+ }
65
+ /**
66
+ * Event emitted when a workbook action is clicked
67
+ */
68
+ export interface WorkbookActionEvent {
69
+ /**
70
+ * The action that was clicked
71
+ */
72
+ action: WorkbookAction;
73
+ /**
74
+ * The workbook ID
75
+ */
76
+ workbookId: string;
77
+ }
78
+ /**
79
+ * Event emitted when a sheet tab action is clicked
80
+ */
81
+ export interface SheetTabActionEvent {
82
+ /**
83
+ * The action that was clicked
84
+ */
85
+ action: SheetTabAction;
86
+ /**
87
+ * The sheet ID
88
+ */
89
+ sheetId: string;
90
+ }
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Workbook configuration interface - manages multiple sheets
3
+ */
4
+ import { TableConfig } from './table-config.interface';
5
+ import { WorkbookAction, SheetTabAction } from './workbook-action.interface';
6
+ import { AutosaveConfig } from './autosave-config.interface';
7
+ /**
8
+ * Sheet configuration for workbook (simpler than standalone SheetConfig)
9
+ */
10
+ export interface WorkbookSheetConfig {
11
+ /**
12
+ * Unique identifier for the sheet
13
+ */
14
+ id: string;
15
+ /**
16
+ * Display name of the sheet
17
+ */
18
+ name: string;
19
+ /**
20
+ * Table configuration for this sheet
21
+ */
22
+ tableConfig: TableConfig;
23
+ /**
24
+ * Optional per-sheet tab actions (overrides workbook defaults)
25
+ */
26
+ tabActions?: SheetTabAction[];
27
+ }
28
+ /**
29
+ * Comprehensive workbook configuration interface
30
+ */
31
+ export interface WorkbookConfig {
32
+ /**
33
+ * Unique identifier for the workbook
34
+ */
35
+ id: string;
36
+ /**
37
+ * Display name of the workbook
38
+ */
39
+ name: string;
40
+ /**
41
+ * Array of sheets in the workbook
42
+ */
43
+ sheets: WorkbookSheetConfig[];
44
+ /**
45
+ * Initial active sheet index (0-based)
46
+ * @default 0
47
+ */
48
+ initialActiveSheetIndex?: number;
49
+ /**
50
+ * Workbook-level actions (dropdown in toolbar)
51
+ */
52
+ workbookActions?: WorkbookAction[];
53
+ /**
54
+ * Default sheet tab actions (applied to all sheets unless overridden)
55
+ */
56
+ defaultSheetTabActions?: SheetTabAction[];
57
+ /**
58
+ * Display configuration
59
+ */
60
+ display?: {
61
+ /**
62
+ * Allow adding new sheets
63
+ * @default true
64
+ */
65
+ allowAddSheet?: boolean;
66
+ /**
67
+ * Allow deleting sheets
68
+ * @default true
69
+ */
70
+ allowDeleteSheet?: boolean;
71
+ /**
72
+ * Allow fullscreen mode
73
+ * @default true
74
+ */
75
+ allowFullscreen?: boolean;
76
+ /**
77
+ * Maximum number of sheets allowed
78
+ * @default undefined (unlimited)
79
+ */
80
+ maxSheets?: number;
81
+ /**
82
+ * Minimum number of sheets required
83
+ * @default 1
84
+ */
85
+ minSheets?: number;
86
+ };
87
+ /**
88
+ * Defaults for new sheets created via "Add Sheet" button
89
+ */
90
+ newSheetDefaults?: {
91
+ /**
92
+ * Prefix for new sheet names
93
+ * @default 'Sheet'
94
+ */
95
+ namePrefix?: string;
96
+ /**
97
+ * Default table configuration for new sheets
98
+ */
99
+ tableConfig?: Partial<TableConfig>;
100
+ };
101
+ /**
102
+ * Autosave configuration
103
+ * Enables automatic saving of workbook config, state, and data to memory
104
+ * @default { enabled: true, strategy: 'lazy' }
105
+ */
106
+ autosave?: AutosaveConfig;
107
+ }
@@ -0,0 +1,9 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class StAddColumnButtonComponent {
4
+ enabled: boolean;
5
+ addColumnClicked: EventEmitter<void>;
6
+ onClick(event: Event): void;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<StAddColumnButtonComponent, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<StAddColumnButtonComponent, "st-add-column-button", never, { "enabled": "enabled"; }, { "addColumnClicked": "addColumnClicked"; }, never, never>;
9
+ }
@@ -0,0 +1,69 @@
1
+ import { EventEmitter, OnInit, OnDestroy, ElementRef, AfterViewInit, TemplateRef } from '@angular/core';
2
+ import { Cell } from '../../models/cell.class';
3
+ import { CellEditEvent, CellSaveEvent, CellChangeEvent, CellCancelEvent, EditMode, NavigationDirection } from '../../../models/cell-types';
4
+ import { TableState } from '../../models/table-state.class';
5
+ import { TableConfig } from '../../../models/table-config.interface';
6
+ import * as i0 from "@angular/core";
7
+ export declare class StCellComponent implements OnInit, OnDestroy, AfterViewInit {
8
+ cell: Cell<any>;
9
+ editMode: EditMode;
10
+ tableState?: TableState;
11
+ tableConfig?: TableConfig;
12
+ columnIndex?: number;
13
+ cellChange: EventEmitter<CellChangeEvent<any>>;
14
+ cellEdit: EventEmitter<CellEditEvent<any>>;
15
+ cellSave: EventEmitter<CellSaveEvent<any>>;
16
+ cellCancel: EventEmitter<CellCancelEvent<any>>;
17
+ cellSaveAndNavigate: EventEmitter<{
18
+ event: KeyboardEvent;
19
+ direction: NavigationDirection;
20
+ }>;
21
+ editorContainer?: ElementRef;
22
+ private editorCleanup?;
23
+ private editingPositionSubscription?;
24
+ constructor();
25
+ ngOnInit(): void;
26
+ ngAfterViewInit(): void;
27
+ ngOnDestroy(): void;
28
+ get isEditable(): boolean;
29
+ get validationError(): string | undefined;
30
+ get hasCellTemplate(): boolean;
31
+ get cellTemplate(): TemplateRef<any> | null;
32
+ get templateContext(): any;
33
+ onCellKeyDown(event: KeyboardEvent): void;
34
+ /**
35
+ * Check if Enter key can trigger editing
36
+ * Using EditMode enum values
37
+ */
38
+ private canEditViaEnter;
39
+ /**
40
+ * Check if keyboard can trigger editing (for alphanumeric and double-click)
41
+ */
42
+ private canEditViaKeyboard;
43
+ /**
44
+ * Check if a key is alphanumeric (single character)
45
+ */
46
+ private isAlphanumericKey;
47
+ /**
48
+ * Start editing with a specific key as the initial value
49
+ */
50
+ private startEditWithKey;
51
+ onCellClick(): void;
52
+ onCellDoubleClick(): void;
53
+ private startEdit;
54
+ private renderEditor;
55
+ private saveEdit;
56
+ /**
57
+ * Update validation state in TableState
58
+ * Called on save (lazy mode) or on change (eager mode)
59
+ */
60
+ private updateValidationState;
61
+ /**
62
+ * Trigger eager validation (on every change)
63
+ */
64
+ private triggerEagerValidation;
65
+ private cancelEdit;
66
+ private cleanupEditor;
67
+ static ɵfac: i0.ɵɵFactoryDeclaration<StCellComponent, never>;
68
+ static ɵcmp: i0.ɵɵComponentDeclaration<StCellComponent, "st-cell", never, { "cell": "cell"; "editMode": "editMode"; "tableState": "tableState"; "tableConfig": "tableConfig"; "columnIndex": "columnIndex"; }, { "cellChange": "cellChange"; "cellEdit": "cellEdit"; "cellSave": "cellSave"; "cellCancel": "cellCancel"; "cellSaveAndNavigate": "cellSaveAndNavigate"; }, never, never>;
69
+ }
@@ -0,0 +1,39 @@
1
+ import { EventEmitter, OnInit, OnDestroy } from '@angular/core';
2
+ import { ColumnConfig } from '../../../models/column-config.interface';
3
+ import { ColumnEditorComponent } from '../../../builder/components/column-editor/column-editor.component';
4
+ import * as i0 from "@angular/core";
5
+ export declare class StColumnEditorModalComponent implements OnInit, OnDestroy {
6
+ columnCreated: EventEmitter<ColumnConfig<any>>;
7
+ cancelled: EventEmitter<void>;
8
+ columnEditor: ColumnEditorComponent;
9
+ newColumn: ColumnConfig;
10
+ columnIndex: number;
11
+ ngOnInit(): void;
12
+ ngOnDestroy(): void;
13
+ /**
14
+ * Create a default column configuration
15
+ */
16
+ private createDefaultColumn;
17
+ /**
18
+ * Trigger save from external button
19
+ */
20
+ onSave(): void;
21
+ /**
22
+ * Handle column updates from the editor
23
+ */
24
+ onColumnUpdated(updates: Partial<ColumnConfig>): void;
25
+ /**
26
+ * Handle cancel from the editor
27
+ */
28
+ onCancel(): void;
29
+ /**
30
+ * Handle backdrop click to close modal
31
+ */
32
+ onBackdropClick(event: Event): void;
33
+ /**
34
+ * Prevent event propagation from modal content
35
+ */
36
+ onModalContentClick(event: Event): void;
37
+ static ɵfac: i0.ɵɵFactoryDeclaration<StColumnEditorModalComponent, never>;
38
+ static ɵcmp: i0.ɵɵComponentDeclaration<StColumnEditorModalComponent, "st-column-editor-modal", never, {}, { "columnCreated": "columnCreated"; "cancelled": "cancelled"; }, never, never>;
39
+ }