@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,49 @@
1
+ import { ValidationLoggerService } from './validation-logger.service';
2
+ import { SchemaValidationResult } from '../models/schema-validation.interface';
3
+ import * as i0 from "@angular/core";
4
+ export declare class JsonSchemaValidatorService {
5
+ private logger;
6
+ private ajv;
7
+ private validateFn;
8
+ private ajvAvailable;
9
+ private initialized;
10
+ constructor(logger: ValidationLoggerService);
11
+ /**
12
+ * Ensure ajv is initialized (lazy initialization)
13
+ */
14
+ private ensureInitialized;
15
+ /**
16
+ * Initialize ajv validator
17
+ */
18
+ private initializeAjv;
19
+ /**
20
+ * Validate JSON data against TableConfig schema
21
+ * @param data JSON data to validate
22
+ * @param includeCustomRules Whether to include custom business rule validations
23
+ * @param enableLogging Whether to log validation errors (default: true)
24
+ * @returns Validation result
25
+ */
26
+ validate(data: any, includeCustomRules?: boolean, enableLogging?: boolean): SchemaValidationResult;
27
+ /**
28
+ * Validate JSON string
29
+ * @param jsonString JSON string to validate
30
+ * @param includeCustomRules Whether to include custom business rule validations
31
+ * @param enableLogging Whether to log validation errors (default: true)
32
+ * @returns Validation result
33
+ */
34
+ validateJSONString(jsonString: string, includeCustomRules?: boolean, enableLogging?: boolean): SchemaValidationResult;
35
+ /**
36
+ * Check if ajv is available
37
+ */
38
+ isAvailable(): boolean;
39
+ /**
40
+ * Convert JSON path to user-friendly field name
41
+ */
42
+ private pathToFieldName;
43
+ /**
44
+ * Format error message from ajv error
45
+ */
46
+ private formatErrorMessage;
47
+ static ɵfac: i0.ɵɵFactoryDeclaration<JsonSchemaValidatorService, never>;
48
+ static ɵprov: i0.ɵɵInjectableDeclaration<JsonSchemaValidatorService>;
49
+ }
@@ -0,0 +1,17 @@
1
+ import { Cell } from '../renderer/models/cell.class';
2
+ import { RowValidator, RowValidationResult } from '../models/row-validator.interface';
3
+ import { TableValidator, TableValidationResult } from '../models/table-validator.interface';
4
+ import { TableConfig } from '../models/table-config.interface';
5
+ import * as i0 from "@angular/core";
6
+ export declare class RowValidationService {
7
+ /**
8
+ * Validate a single row
9
+ */
10
+ validateRow(rowData: any, cells: Cell[], rowIndex: number, validator: RowValidator): RowValidationResult;
11
+ /**
12
+ * Validate entire table
13
+ */
14
+ validateTable(rows: any[], config: TableConfig, validator: TableValidator, rowValidationResults?: Map<number, RowValidationResult>): TableValidationResult;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<RowValidationService, never>;
16
+ static ɵprov: i0.ɵɵInjectableDeclaration<RowValidationService>;
17
+ }
@@ -0,0 +1,87 @@
1
+ import { SchemaValidationError } from '../models/schema-validation.interface';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Validation log entry interface
5
+ */
6
+ export interface ValidationLogEntry {
7
+ /**
8
+ * ISO timestamp when validation failed
9
+ */
10
+ timestamp: string;
11
+ /**
12
+ * Source of validation (e.g., 'import', 'renderer', 'schema-validation')
13
+ */
14
+ source: string;
15
+ /**
16
+ * Array of validation errors
17
+ */
18
+ errors: SchemaValidationError[];
19
+ /**
20
+ * Optional context information
21
+ */
22
+ context?: {
23
+ fileName?: string;
24
+ configSnippet?: string;
25
+ storageKey?: string;
26
+ };
27
+ }
28
+ export declare class ValidationLoggerService {
29
+ private logEntries;
30
+ private downloadTimeoutId;
31
+ private readonly DOWNLOAD_DELAY_MS;
32
+ /**
33
+ * Log validation errors
34
+ * @param errors Array of validation errors
35
+ * @param source Source of validation (e.g., 'import', 'renderer', 'schema-validation')
36
+ * @param context Optional context information
37
+ * @param autoDownload Whether to automatically download log file (default: true)
38
+ */
39
+ logValidationErrors(errors: SchemaValidationError[], source: string, context?: {
40
+ fileName?: string;
41
+ configSnippet?: string;
42
+ storageKey?: string;
43
+ }, autoDownload?: boolean): void;
44
+ /**
45
+ * Schedule log file download with debounce
46
+ * This ensures we only download once after all errors are accumulated
47
+ */
48
+ private scheduleDownload;
49
+ /**
50
+ * Download log file with timestamped filename
51
+ * Called automatically when validation errors occur (after debounce delay)
52
+ */
53
+ private downloadLogFileOnError;
54
+ /**
55
+ * Get all log entries
56
+ * @returns Array of all log entries
57
+ */
58
+ getLogEntries(): ValidationLogEntry[];
59
+ /**
60
+ * Format all log entries as plain text
61
+ * @returns Formatted log text
62
+ */
63
+ formatLogAsText(): string;
64
+ /**
65
+ * Format a single log entry as plain text
66
+ * @param entry Log entry to format
67
+ * @param entryNumber Entry number (for display)
68
+ * @returns Formatted entry text
69
+ */
70
+ private formatLogEntry;
71
+ /**
72
+ * Download log file
73
+ * @param filename Optional filename (default: 'smart-table-validation-errors.log')
74
+ */
75
+ downloadLogFile(filename?: string): void;
76
+ /**
77
+ * Clear all log entries
78
+ */
79
+ clearLog(): void;
80
+ /**
81
+ * Get number of log entries
82
+ * @returns Number of log entries
83
+ */
84
+ getLogSize(): number;
85
+ static ɵfac: i0.ɵɵFactoryDeclaration<ValidationLoggerService, never>;
86
+ static ɵprov: i0.ɵɵInjectableDeclaration<ValidationLoggerService>;
87
+ }
@@ -0,0 +1,44 @@
1
+ import { Observable } from 'rxjs';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Virtual scroll state interface
5
+ * Contains all information needed for virtual scroll calculations
6
+ */
7
+ export interface VirtualScrollState {
8
+ scrollTop: number;
9
+ viewportHeight: number;
10
+ totalItems: number;
11
+ itemSize: number;
12
+ bufferSize: number;
13
+ startIndex: number;
14
+ endIndex: number;
15
+ totalHeight: number;
16
+ offsetY: number;
17
+ }
18
+ /**
19
+ * Virtual Scroll Service
20
+ * Handles all virtual scroll calculations for efficient rendering of large datasets
21
+ */
22
+ export declare class VirtualScrollService {
23
+ /**
24
+ * Calculate visible range based on scroll position
25
+ * @param state Current scroll state parameters
26
+ * @returns Complete virtual scroll state with calculated indices
27
+ */
28
+ calculateVisibleRange(state: {
29
+ scrollTop: number;
30
+ viewportHeight: number;
31
+ totalItems: number;
32
+ itemSize: number;
33
+ bufferSize: number;
34
+ }): VirtualScrollState;
35
+ /**
36
+ * Create throttled scroll observable for performance
37
+ * Throttles to 60fps (16ms) for smooth scrolling
38
+ * @param element The scrollable element to observe
39
+ * @returns Observable emitting scroll position
40
+ */
41
+ createScrollObservable(element: HTMLElement): Observable<number>;
42
+ static ɵfac: i0.ɵɵFactoryDeclaration<VirtualScrollService, never>;
43
+ static ɵprov: i0.ɵɵInjectableDeclaration<VirtualScrollService>;
44
+ }
@@ -0,0 +1,9 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "../builder/components/column-editor/column-editor.component";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "@angular/forms";
5
+ export declare class SharedTableComponentsModule {
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<SharedTableComponentsModule, never>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SharedTableComponentsModule, [typeof i1.ColumnEditorComponent], [typeof i2.CommonModule, typeof i3.ReactiveFormsModule], [typeof i1.ColumnEditorComponent]>;
8
+ static ɵinj: i0.ɵɵInjectorDeclaration<SharedTableComponentsModule>;
9
+ }
@@ -0,0 +1,26 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./renderer/components/st-cell/st-cell.component";
3
+ import * as i2 from "./renderer/components/st-table/st-table.component";
4
+ import * as i3 from "./renderer/components/st-header/st-header.component";
5
+ import * as i4 from "./renderer/components/st-column-menu/st-column-menu.component";
6
+ import * as i5 from "./renderer/components/st-column-visibility/st-column-visibility.component";
7
+ import * as i6 from "./renderer/components/st-column-filter/st-column-filter.component";
8
+ import * as i7 from "./renderer/components/st-pagination/st-pagination.component";
9
+ import * as i8 from "./renderer/components/st-add-column-button/st-add-column-button.component";
10
+ import * as i9 from "./renderer/components/st-column-editor-modal/st-column-editor-modal.component";
11
+ import * as i10 from "./renderer/components/st-table-actions/st-table-actions.component";
12
+ import * as i11 from "./renderer/components/st-row-actions-dropdown/st-row-actions-dropdown.component";
13
+ import * as i12 from "./renderer/components/st-sheet/st-sheet.component";
14
+ import * as i13 from "./renderer/components/st-sheet-actions/st-sheet-actions.component";
15
+ import * as i14 from "./renderer/components/st-workbook/st-workbook.component";
16
+ import * as i15 from "./renderer/directives/click-outside.directive";
17
+ import * as i16 from "./renderer/directives/st-column-resize.directive";
18
+ import * as i17 from "./renderer/directives/st-keyboard-navigation.directive";
19
+ import * as i18 from "@angular/common";
20
+ import * as i19 from "@angular/forms";
21
+ import * as i20 from "./shared/shared-table-components.module";
22
+ export declare class SmartTableModule {
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<SmartTableModule, never>;
24
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SmartTableModule, [typeof i1.StCellComponent, typeof i2.StTableComponent, typeof i3.StHeaderComponent, typeof i4.StColumnMenuDropdownComponent, typeof i5.StColumnVisibilityComponent, typeof i6.StColumnFilterComponent, typeof i7.StPaginationComponent, typeof i8.StAddColumnButtonComponent, typeof i9.StColumnEditorModalComponent, typeof i10.StTableActionsComponent, typeof i11.StRowActionsDropdownComponent, typeof i12.StSheetComponent, typeof i13.StSheetActionsComponent, typeof i14.StWorkbookComponent, typeof i15.ClickOutsideDirective, typeof i16.StColumnResizeDirective, typeof i17.StKeyboardNavigationDirective], [typeof i18.CommonModule, typeof i19.FormsModule, typeof i19.ReactiveFormsModule, typeof i20.SharedTableComponentsModule], [typeof i1.StCellComponent, typeof i2.StTableComponent, typeof i3.StHeaderComponent, typeof i4.StColumnMenuDropdownComponent, typeof i5.StColumnVisibilityComponent, typeof i6.StColumnFilterComponent, typeof i7.StPaginationComponent, typeof i8.StAddColumnButtonComponent, typeof i9.StColumnEditorModalComponent, typeof i10.StTableActionsComponent, typeof i11.StRowActionsDropdownComponent, typeof i12.StSheetComponent, typeof i13.StSheetActionsComponent, typeof i14.StWorkbookComponent, typeof i15.ClickOutsideDirective, typeof i16.StColumnResizeDirective, typeof i17.StKeyboardNavigationDirective]>;
25
+ static ɵinj: i0.ɵɵInjectorDeclaration<SmartTableModule>;
26
+ }
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Default editor implementations
3
+ */
4
+ import { CellEditor, CellEditorContext } from '../models/cell-strategies.interface';
5
+ /**
6
+ * Text editor - basic text input
7
+ */
8
+ export declare class TextEditor implements CellEditor<string> {
9
+ private readonly options?;
10
+ private input?;
11
+ constructor(options?: {
12
+ placeholder?: string | undefined;
13
+ maxLength?: number | undefined;
14
+ autoFocus?: boolean | undefined;
15
+ selectOnFocus?: boolean | undefined;
16
+ } | undefined);
17
+ edit(context: CellEditorContext<string>): void;
18
+ destroy(): void;
19
+ focus(): void;
20
+ getCurrentValue(): string;
21
+ }
22
+ /**
23
+ * Number editor - numeric input
24
+ */
25
+ export declare class NumberEditor implements CellEditor<number> {
26
+ private readonly options?;
27
+ private input?;
28
+ constructor(options?: {
29
+ min?: number | undefined;
30
+ max?: number | undefined;
31
+ step?: number | undefined;
32
+ placeholder?: string | undefined;
33
+ autoFocus?: boolean | undefined;
34
+ selectOnFocus?: boolean | undefined;
35
+ } | undefined);
36
+ edit(context: CellEditorContext<number>): void;
37
+ destroy(): void;
38
+ focus(): void;
39
+ getCurrentValue(): number;
40
+ }
41
+ /**
42
+ * Date editor - date input
43
+ */
44
+ export declare class DateEditor implements CellEditor<Date> {
45
+ private readonly options?;
46
+ private input?;
47
+ constructor(options?: {
48
+ min?: string | Date | undefined;
49
+ max?: string | Date | undefined;
50
+ autoFocus?: boolean | undefined;
51
+ } | undefined);
52
+ edit(context: CellEditorContext<Date>): void;
53
+ destroy(): void;
54
+ focus(): void;
55
+ getCurrentValue(): Date;
56
+ }
57
+ /**
58
+ * Select editor - dropdown selection
59
+ */
60
+ export declare class SelectEditor<T = any> implements CellEditor<T> {
61
+ private readonly options;
62
+ private select?;
63
+ constructor(options: {
64
+ options: Array<{
65
+ value: T;
66
+ label: string;
67
+ }>;
68
+ placeholder?: string;
69
+ autoFocus?: boolean;
70
+ });
71
+ edit(context: CellEditorContext<T>): void;
72
+ destroy(): void;
73
+ focus(): void;
74
+ getCurrentValue(): T;
75
+ }
76
+ /**
77
+ * Boolean editor - checkbox
78
+ */
79
+ export declare class BooleanEditor implements CellEditor<boolean> {
80
+ private readonly options?;
81
+ private checkbox?;
82
+ constructor(options?: {
83
+ autoFocus?: boolean | undefined;
84
+ saveOnChange?: boolean | undefined;
85
+ } | undefined);
86
+ edit(context: CellEditorContext<boolean>): void;
87
+ destroy(): void;
88
+ focus(): void;
89
+ getCurrentValue(): boolean;
90
+ }
91
+ /**
92
+ * Textarea editor - multi-line text input
93
+ */
94
+ export declare class TextAreaEditor implements CellEditor<string> {
95
+ private readonly options?;
96
+ private textarea?;
97
+ constructor(options?: {
98
+ rows?: number | undefined;
99
+ cols?: number | undefined;
100
+ placeholder?: string | undefined;
101
+ maxLength?: number | undefined;
102
+ autoFocus?: boolean | undefined;
103
+ selectOnFocus?: boolean | undefined;
104
+ } | undefined);
105
+ edit(context: CellEditorContext<string>): void;
106
+ destroy(): void;
107
+ focus(): void;
108
+ getCurrentValue(): string;
109
+ }
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Default formatter implementations
3
+ */
4
+ import { CellFormatter } from '../models/cell-strategies.interface';
5
+ /**
6
+ * String formatter - default string display
7
+ */
8
+ export declare class StringFormatter implements CellFormatter<string> {
9
+ private readonly options?;
10
+ constructor(options?: {
11
+ maxLength?: number | undefined;
12
+ ellipsis?: string | undefined;
13
+ trim?: boolean | undefined;
14
+ toUpperCase?: boolean | undefined;
15
+ toLowerCase?: boolean | undefined;
16
+ } | undefined);
17
+ format(value: string): string;
18
+ }
19
+ /**
20
+ * Number formatter - formats numbers with decimals
21
+ */
22
+ export declare class NumberFormatter implements CellFormatter<number> {
23
+ private readonly options?;
24
+ constructor(options?: {
25
+ decimals?: number | undefined;
26
+ thousandsSeparator?: string | undefined;
27
+ decimalSeparator?: string | undefined;
28
+ prefix?: string | undefined;
29
+ suffix?: string | undefined;
30
+ } | undefined);
31
+ format(value: number): string;
32
+ }
33
+ /**
34
+ * Currency formatter - formats currency values
35
+ */
36
+ export declare class CurrencyFormatter implements CellFormatter<number> {
37
+ private readonly options?;
38
+ constructor(options?: {
39
+ currency?: string | undefined;
40
+ locale?: string | undefined;
41
+ decimals?: number | undefined;
42
+ } | undefined);
43
+ format(value: number): string;
44
+ }
45
+ /**
46
+ * Percentage formatter
47
+ */
48
+ export declare class PercentageFormatter implements CellFormatter<number> {
49
+ private readonly options?;
50
+ constructor(options?: {
51
+ decimals?: number | undefined;
52
+ multiplier?: number | undefined;
53
+ } | undefined);
54
+ format(value: number): string;
55
+ }
56
+ /**
57
+ * Date formatter - locale-aware date formatting
58
+ */
59
+ export declare class DateFormatter implements CellFormatter<Date> {
60
+ private readonly options?;
61
+ constructor(options?: {
62
+ locale?: string | undefined;
63
+ dateStyle?: "long" | "short" | "medium" | "full" | undefined;
64
+ timeStyle?: "long" | "short" | "medium" | "full" | undefined;
65
+ format?: string | undefined;
66
+ } | undefined);
67
+ format(value: Date): string;
68
+ private formatCustom;
69
+ }
70
+ /**
71
+ * Boolean formatter - formats boolean values
72
+ */
73
+ export declare class BooleanFormatter implements CellFormatter<boolean> {
74
+ private readonly options?;
75
+ constructor(options?: {
76
+ trueValue?: string | undefined;
77
+ falseValue?: string | undefined;
78
+ nullValue?: string | undefined;
79
+ } | undefined);
80
+ format(value: boolean): string;
81
+ }
82
+ /**
83
+ * Array formatter - formats array values
84
+ */
85
+ export declare class ArrayFormatter<T = any> implements CellFormatter<T[]> {
86
+ private readonly options?;
87
+ constructor(options?: {
88
+ separator?: string | undefined;
89
+ maxItems?: number | undefined;
90
+ ellipsis?: string | undefined;
91
+ itemFormatter?: ((item: T) => string) | undefined;
92
+ } | undefined);
93
+ format(value: T[]): string;
94
+ }
95
+ /**
96
+ * Template formatter - formats values using a template string
97
+ */
98
+ export declare class TemplateFormatter implements CellFormatter<any> {
99
+ private readonly template;
100
+ constructor(template: string);
101
+ format(value: any): string;
102
+ }
103
+ /**
104
+ * Function formatter - formats values using a custom function
105
+ */
106
+ export declare class FunctionFormatter<T = any> implements CellFormatter<T> {
107
+ private readonly formatFn;
108
+ constructor(formatFn: (value: T) => string);
109
+ format(value: T): string;
110
+ }
111
+ /**
112
+ * Default formatter - returns string representation
113
+ */
114
+ export declare class DefaultFormatter implements CellFormatter<any> {
115
+ format(value: any): string;
116
+ }
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Default validator implementations
3
+ */
4
+ import { CellValidator, CompositeValidator } from '../models/cell-strategies.interface';
5
+ import { ValidationResult } from '../models/cell-types';
6
+ /**
7
+ * Required validator - ensures value is not empty
8
+ */
9
+ export declare class RequiredValidator implements CellValidator<any> {
10
+ private readonly customMessage?;
11
+ errorMessage: string;
12
+ constructor(customMessage?: string | undefined);
13
+ validate(value: any): ValidationResult;
14
+ }
15
+ /**
16
+ * Range validator - validates numeric range
17
+ */
18
+ export declare class RangeValidator implements CellValidator<number> {
19
+ private readonly min?;
20
+ private readonly max?;
21
+ errorMessage: string;
22
+ constructor(min?: number | undefined, max?: number | undefined, customMessage?: string);
23
+ validate(value: number): ValidationResult;
24
+ private buildErrorMessage;
25
+ }
26
+ /**
27
+ * String length validator
28
+ */
29
+ export declare class LengthValidator implements CellValidator<string> {
30
+ private readonly minLength?;
31
+ private readonly maxLength?;
32
+ errorMessage: string;
33
+ constructor(minLength?: number | undefined, maxLength?: number | undefined, customMessage?: string);
34
+ validate(value: string): ValidationResult;
35
+ private buildErrorMessage;
36
+ }
37
+ /**
38
+ * Regex validator - validates against regular expression
39
+ */
40
+ export declare class RegexValidator implements CellValidator<string> {
41
+ private readonly pattern;
42
+ errorMessage: string;
43
+ constructor(pattern: RegExp | string, customMessage?: string);
44
+ validate(value: string): ValidationResult;
45
+ }
46
+ /**
47
+ * Email validator
48
+ */
49
+ export declare class EmailValidator implements CellValidator<string> {
50
+ errorMessage: string;
51
+ private readonly emailPattern;
52
+ constructor(customMessage?: string);
53
+ validate(value: string): ValidationResult;
54
+ }
55
+ /**
56
+ * URL validator
57
+ */
58
+ export declare class UrlValidator implements CellValidator<string> {
59
+ errorMessage: string;
60
+ constructor(customMessage?: string);
61
+ validate(value: string): ValidationResult;
62
+ }
63
+ /**
64
+ * Date range validator
65
+ */
66
+ export declare class DateRangeValidator implements CellValidator<Date> {
67
+ private readonly minDate?;
68
+ private readonly maxDate?;
69
+ errorMessage: string;
70
+ constructor(minDate?: Date | undefined, maxDate?: Date | undefined, customMessage?: string);
71
+ validate(value: Date): ValidationResult;
72
+ private buildErrorMessage;
73
+ }
74
+ /**
75
+ * Custom function validator
76
+ */
77
+ export declare class FunctionValidator<T = any> implements CellValidator<T> {
78
+ private readonly validateFn;
79
+ errorMessage: string;
80
+ constructor(validateFn: (value: T) => boolean | ValidationResult, customMessage?: string);
81
+ validate(value: T): ValidationResult;
82
+ }
83
+ /**
84
+ * Composite validator - chains multiple validators (Chain of Responsibility)
85
+ */
86
+ export declare class ChainValidator<T = any> implements CompositeValidator<T> {
87
+ errorMessage: string;
88
+ private validators;
89
+ constructor(validators?: CellValidator<T>[]);
90
+ addValidator(validator: CellValidator<T>): this;
91
+ getValidators(): CellValidator<T>[];
92
+ validate(value: T): ValidationResult;
93
+ }
94
+ /**
95
+ * Async validator interface (for future implementation)
96
+ */
97
+ export interface AsyncCellValidator<T = any> {
98
+ validateAsync(value: T): Promise<ValidationResult>;
99
+ }
100
+ /**
101
+ * Pattern validators for common use cases
102
+ */
103
+ export declare class PatternValidators {
104
+ static email(message?: string): EmailValidator;
105
+ static url(message?: string): UrlValidator;
106
+ static required(message?: string): RequiredValidator;
107
+ static range(min?: number, max?: number, message?: string): RangeValidator;
108
+ static stringLength(min?: number, max?: number, message?: string): LengthValidator;
109
+ static regex(pattern: RegExp | string, message?: string): RegexValidator;
110
+ static dateRange(min?: Date, max?: Date, message?: string): DateRangeValidator;
111
+ static custom<T>(fn: (value: T) => boolean | ValidationResult, message?: string): FunctionValidator<T>;
112
+ static chain<T>(...validators: CellValidator<T>[]): ChainValidator<T>;
113
+ }
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@aquera/ngx-smart-table",
3
+ "version": "0.0.2-alpha",
4
+ "peerDependencies": {
5
+ "@angular/common": ">=13.0.0 <16.0.0",
6
+ "@angular/core": ">=13.0.0 <16.0.0",
7
+ "@aquera/nile": "^1.0.0",
8
+ "@aquera/nile-elements": "^1.4.4",
9
+ "rxjs": ">=6.0.0"
10
+ },
11
+ "dependencies": {
12
+ "tslib": "^2.3.0"
13
+ },
14
+ "peerDependenciesMeta": {
15
+ "ajv": {
16
+ "optional": true
17
+ }
18
+ },
19
+ "optionalDependencies": {
20
+ "ajv": "^8.12.0"
21
+ },
22
+ "sideEffects": false,
23
+ "module": "fesm2015/aquera-ngx-smart-table.mjs",
24
+ "es2020": "fesm2020/aquera-ngx-smart-table.mjs",
25
+ "esm2020": "esm2020/aquera-ngx-smart-table.mjs",
26
+ "fesm2020": "fesm2020/aquera-ngx-smart-table.mjs",
27
+ "fesm2015": "fesm2015/aquera-ngx-smart-table.mjs",
28
+ "typings": "aquera-ngx-smart-table.d.ts",
29
+ "exports": {
30
+ "./package.json": {
31
+ "default": "./package.json"
32
+ },
33
+ ".": {
34
+ "types": "./aquera-ngx-smart-table.d.ts",
35
+ "esm2020": "./esm2020/aquera-ngx-smart-table.mjs",
36
+ "es2020": "./fesm2020/aquera-ngx-smart-table.mjs",
37
+ "es2015": "./fesm2015/aquera-ngx-smart-table.mjs",
38
+ "node": "./fesm2015/aquera-ngx-smart-table.mjs",
39
+ "default": "./fesm2020/aquera-ngx-smart-table.mjs"
40
+ }
41
+ }
42
+ }