@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,29 @@
1
+ /**
2
+ * TypeScript code generator utility
3
+ * Converts TableConfig to TypeScript code using ColumnConfigFactory
4
+ */
5
+ import { TableConfig } from '../../models/table-config.interface';
6
+ /**
7
+ * Options for TypeScript code generation
8
+ */
9
+ export interface TypeScriptGeneratorOptions {
10
+ /**
11
+ * Variable name for the exported config
12
+ */
13
+ variableName?: string;
14
+ /**
15
+ * Include comments in generated code
16
+ */
17
+ includeComments?: boolean;
18
+ /**
19
+ * Indentation string (default: 2 spaces)
20
+ */
21
+ indent?: string;
22
+ }
23
+ /**
24
+ * Generate TypeScript code from TableConfig
25
+ * @param config Table configuration
26
+ * @param options Generation options
27
+ * @returns TypeScript code string
28
+ */
29
+ export declare function generateTypeScriptCode(config: TableConfig, options?: TypeScriptGeneratorOptions): string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Custom cell editors for ngx-smart-table
3
+ */
4
+ export { NileInputEditor, NileInputEditorOptions } from './nile-input-editor';
5
+ export { NileSelectEditor, NileSelectEditorOptions, SelectOption } from './nile-select-editor';
6
+ export { NileAutoCompleteEditor, NileAutoCompleteEditorOptions, AutoCompleteOption } from './nile-autocomplete-editor';
7
+ export { NileCalendarEditor, NileCalendarEditorOptions, AllowedDatesRange } from './nile-calendar-editor';
8
+ export { NileDatePickerEditor, NileDatePickerEditorOptions, DateRange } from './nile-date-picker-editor';
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Custom editor using NileAutoComplete from @aquera/nile-elements
3
+ * Provides real-time suggestions as users type in table cells
4
+ */
5
+ import { CellEditor, CellEditorContext } from '../models/cell-strategies.interface';
6
+ /**
7
+ * Autocomplete option configuration
8
+ */
9
+ export interface AutoCompleteOption {
10
+ /** The option's value */
11
+ value: string;
12
+ /** Display label for the option */
13
+ label: string;
14
+ /** Whether the option is disabled */
15
+ disabled?: boolean;
16
+ }
17
+ /**
18
+ * Options interface for NileAutoCompleteEditor
19
+ */
20
+ export interface NileAutoCompleteEditorOptions {
21
+ /** Array of autocomplete suggestions - supports both simple string array or detailed AutoCompleteOption objects */
22
+ options: AutoCompleteOption[] | string[];
23
+ /** Placeholder text to show as a hint when the search is empty */
24
+ placeholder?: string;
25
+ /** Disable the autocomplete control */
26
+ disabled?: boolean;
27
+ /** Help text to display below the control */
28
+ helpText?: string;
29
+ /** Size of the autocomplete control */
30
+ size?: 'small' | 'medium' | 'large';
31
+ /** Adds clear button when value is not empty */
32
+ clearable?: boolean;
33
+ /** Make the autocomplete required */
34
+ required?: boolean;
35
+ /** Auto-focus the input when editor opens */
36
+ autoFocus?: boolean;
37
+ /** Select all text when focused */
38
+ selectOnFocus?: boolean;
39
+ /** Warning state styling */
40
+ warning?: boolean;
41
+ /** Error state styling */
42
+ error?: boolean;
43
+ /** Success state styling */
44
+ success?: boolean;
45
+ /** Error message to display */
46
+ errorMessage?: string;
47
+ /** Minimum number of characters before showing suggestions */
48
+ minSearchLength?: number;
49
+ /** Maximum number of suggestions to show */
50
+ maxSuggestions?: number;
51
+ /** Case-sensitive matching */
52
+ caseSensitive?: boolean;
53
+ /** Filter mode for matching suggestions */
54
+ filterMode?: 'startsWith' | 'contains' | 'custom';
55
+ /** Custom filter function for matching */
56
+ customFilter?: (input: string, option: AutoCompleteOption) => boolean;
57
+ /** Draws a filled autocomplete style */
58
+ filled?: boolean;
59
+ /** Pill-style with rounded edges */
60
+ pill?: boolean;
61
+ /** Use fixed positioning to prevent clipping */
62
+ hoist?: boolean;
63
+ /** Placement of the suggestions dropdown */
64
+ placement?: 'top' | 'bottom';
65
+ /** Validate before saving (default: true) */
66
+ validateOnSave?: boolean;
67
+ }
68
+ /**
69
+ * Custom editor that uses NileAutoComplete component
70
+ * @template T The value type (string by default)
71
+ */
72
+ export declare class NileAutoCompleteEditor<T = string> implements CellEditor<T> {
73
+ private readonly options;
74
+ private autocomplete?;
75
+ private eventListeners;
76
+ constructor(options: NileAutoCompleteEditorOptions);
77
+ edit(context: CellEditorContext<T>): void;
78
+ /**
79
+ * Set allMenuItems property for autocomplete suggestions
80
+ * NileAutoComplete requires allMenuItems to be set as a property, not child elements
81
+ */
82
+ private setMenuItems;
83
+ /**
84
+ * Apply all configuration options to the NileAutoComplete element
85
+ */
86
+ private applyOptions;
87
+ /**
88
+ * Set up all event listeners with proper cleanup tracking
89
+ */
90
+ private setupEventListeners;
91
+ /**
92
+ * Save value with optional validation
93
+ */
94
+ private saveValue;
95
+ /**
96
+ * Parse value to appropriate type
97
+ */
98
+ private parseValue;
99
+ destroy(): void;
100
+ focus(): void;
101
+ getCurrentValue(): T;
102
+ }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Custom editor using NileCalendar from @aquera/nile-elements
3
+ * Provides date selection functionality for table cells
4
+ */
5
+ import { CellEditor, CellEditorContext } from '../models/cell-strategies.interface';
6
+ /**
7
+ * Date range configuration for restricting allowed dates
8
+ */
9
+ export interface AllowedDatesRange {
10
+ /** Start date in ISO format (YYYY-MM-DD) */
11
+ startDate?: string;
12
+ /** End date in ISO format (YYYY-MM-DD) */
13
+ endDate?: string;
14
+ }
15
+ /**
16
+ * Options interface for NileCalendarEditor
17
+ */
18
+ export interface NileCalendarEditorOptions {
19
+ /** Placeholder text to show when no date is selected */
20
+ placeholder?: string;
21
+ /** Disable the calendar control */
22
+ disabled?: boolean;
23
+ /** Help text to display below the control */
24
+ helpText?: string;
25
+ /** Date format for display (default: 'YYYY-MM-DD') */
26
+ dateFormat?: string;
27
+ /** Start year for year dropdown */
28
+ startYear?: number;
29
+ /** End year for year dropdown */
30
+ endYear?: number;
31
+ /** Date range restrictions */
32
+ allowedDates?: AllowedDatesRange;
33
+ /** Show clear button for removing date */
34
+ allowClear?: boolean;
35
+ /** Allow double-click to unselect date */
36
+ doubleClickUnselect?: boolean;
37
+ /** Show month selection dropdown */
38
+ showMonthDropdown?: boolean;
39
+ /** Show year selection dropdown */
40
+ showYearDropdown?: boolean;
41
+ /** Allow manual date input via text fields */
42
+ showManualInputs?: boolean;
43
+ /** Auto-focus the calendar when editor opens */
44
+ autoFocus?: boolean;
45
+ /** Warning state styling */
46
+ warning?: boolean;
47
+ /** Error state styling */
48
+ error?: boolean;
49
+ /** Success state styling */
50
+ success?: boolean;
51
+ /** Error message to display */
52
+ errorMessage?: string;
53
+ /** Size of the calendar control */
54
+ size?: 'small' | 'medium' | 'large';
55
+ /** Use portal for dropdown rendering to prevent clipping */
56
+ portal?: boolean;
57
+ /** Validate before saving (default: true) */
58
+ validateOnSave?: boolean;
59
+ }
60
+ /**
61
+ * Custom editor that uses NileCalendar component for date selection
62
+ * @template T The value type (string by default, formatted as YYYY-MM-DD)
63
+ */
64
+ export declare class NileCalendarEditor<T = string> implements CellEditor<T> {
65
+ private readonly options?;
66
+ private calendar?;
67
+ private eventListeners;
68
+ constructor(options?: NileCalendarEditorOptions | undefined);
69
+ edit(context: CellEditorContext<T>): void;
70
+ /**
71
+ * Apply all configuration options to the NileCalendar element
72
+ */
73
+ private applyOptions;
74
+ /**
75
+ * Set up all event listeners with proper cleanup tracking
76
+ */
77
+ private setupEventListeners;
78
+ /**
79
+ * Save value with optional validation
80
+ */
81
+ private saveValue;
82
+ /**
83
+ * Parse value to appropriate type
84
+ */
85
+ private parseValue;
86
+ destroy(): void;
87
+ focus(): void;
88
+ getCurrentValue(): T;
89
+ }
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Custom editor using NileDatePicker from @aquera/nile-elements
3
+ * Supports both single date and range selection with slot-based trigger input
4
+ * Returns string values for both modes:
5
+ * - Single mode: 'YYYY-MM-DD'
6
+ * - Range mode: 'YYYY-MM-DD - YYYY-MM-DD'
7
+ */
8
+ import { CellEditor, CellEditorContext } from '../models/cell-strategies.interface';
9
+ /**
10
+ * Date range value interface (kept for reference but not used as return type)
11
+ * The editor returns string values instead
12
+ */
13
+ export interface DateRange {
14
+ /** Start date in ISO format (YYYY-MM-DD) */
15
+ startDate: string;
16
+ /** End date in ISO format (YYYY-MM-DD) */
17
+ endDate: string;
18
+ }
19
+ /**
20
+ * Options interface for NileDatePickerEditor
21
+ */
22
+ export interface NileDatePickerEditorOptions {
23
+ /** Placeholder text to show when no date is selected */
24
+ placeholder?: string;
25
+ /** Label for the trigger input */
26
+ label?: string;
27
+ /** Disable the date picker control */
28
+ disabled?: boolean;
29
+ /** Help text to display below the control */
30
+ helpText?: string;
31
+ /** Date format for display (default: 'YYYY-MM-DD') */
32
+ dateFormat?: string;
33
+ /** Enable range selection mode */
34
+ range?: boolean;
35
+ /** Sync date pickers in range mode */
36
+ syncDatePicker?: boolean;
37
+ /** Show clear button for removing date */
38
+ clearable?: boolean;
39
+ /** Auto-focus the date picker when editor opens */
40
+ autoFocus?: boolean;
41
+ /** Warning state styling */
42
+ warning?: boolean;
43
+ /** Error state styling */
44
+ error?: boolean;
45
+ /** Success state styling */
46
+ success?: boolean;
47
+ /** Error message to display */
48
+ errorMessage?: string;
49
+ /** Size of the date picker control */
50
+ size?: number;
51
+ /** Filled style for the input */
52
+ filled?: boolean;
53
+ /** Pill style for the input */
54
+ pill?: boolean;
55
+ /** Validate before saving (default: true) */
56
+ validateOnSave?: boolean;
57
+ }
58
+ /**
59
+ * Custom editor using NileDatePicker component
60
+ * Supports both single date and range selection
61
+ * @template T The value type - string for both single and range modes
62
+ * Single mode: 'YYYY-MM-DD'
63
+ * Range mode: 'YYYY-MM-DD - YYYY-MM-DD'
64
+ */
65
+ export declare class NileDatePickerEditor<T = string> implements CellEditor<T> {
66
+ private readonly options?;
67
+ private datePicker?;
68
+ private triggerInput?;
69
+ private eventListeners;
70
+ constructor(options?: NileDatePickerEditorOptions | undefined);
71
+ edit(context: CellEditorContext<T>): void;
72
+ /**
73
+ * Set initial value in the trigger input
74
+ */
75
+ private setInitialValue;
76
+ /**
77
+ * Apply all configuration options to both NileDatePicker and trigger input
78
+ */
79
+ private applyOptions;
80
+ /**
81
+ * Set up all event listeners with proper cleanup tracking
82
+ */
83
+ private setupEventListeners;
84
+ /**
85
+ * Save value with optional validation
86
+ */
87
+ private saveValue;
88
+ /**
89
+ * Parse value from string to appropriate type
90
+ */
91
+ private parseValue;
92
+ getCurrentValue(): T;
93
+ destroy(): void;
94
+ focus(): void;
95
+ }
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Custom editor using NileInput from @aquera/nile-elements
3
+ * This demonstrates how to create custom editors for ngx-smart-table
4
+ */
5
+ import { CellEditor, CellEditorContext } from '../models/cell-strategies.interface';
6
+ /**
7
+ * Options interface for NileInputEditor
8
+ */
9
+ export interface NileInputEditorOptions {
10
+ placeholder?: string;
11
+ maxLength?: number;
12
+ minLength?: number;
13
+ autoFocus?: boolean;
14
+ selectOnFocus?: boolean;
15
+ type?: 'text' | 'email' | 'tel' | 'url' | 'search' | 'number' | 'password' | 'date' | 'time' | 'datetime-local';
16
+ size?: 'small' | 'medium' | 'large';
17
+ filled?: boolean;
18
+ pill?: boolean;
19
+ clearable?: boolean;
20
+ disabled?: boolean;
21
+ readonly?: boolean;
22
+ required?: boolean;
23
+ pattern?: string;
24
+ min?: number | string;
25
+ max?: number | string;
26
+ step?: number | 'any';
27
+ warning?: boolean;
28
+ error?: boolean;
29
+ success?: boolean;
30
+ errorMessage?: string;
31
+ helpText?: string;
32
+ enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
33
+ spellcheck?: boolean;
34
+ autocomplete?: string;
35
+ inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
36
+ validateOnSave?: boolean;
37
+ }
38
+ /**
39
+ * Custom editor that uses NileInput component
40
+ * @template T The value type (string, number, or both)
41
+ */
42
+ export declare class NileInputEditor<T = string> implements CellEditor<T> {
43
+ private readonly options?;
44
+ private input?;
45
+ private eventListeners;
46
+ constructor(options?: NileInputEditorOptions | undefined);
47
+ edit(context: CellEditorContext<T>): void;
48
+ /**
49
+ * Apply all configuration options to the NileInput element
50
+ */
51
+ private applyOptions;
52
+ /**
53
+ * Set up all event listeners with proper cleanup tracking
54
+ */
55
+ private setupEventListeners;
56
+ /**
57
+ * Save value with optional validation
58
+ */
59
+ private saveValue;
60
+ /**
61
+ * Parse value based on input type
62
+ */
63
+ private parseValue;
64
+ destroy(): void;
65
+ focus(): void;
66
+ getCurrentValue(): T;
67
+ }
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Custom editor using NileSelect from @aquera/nile-elements
3
+ * This demonstrates how to create dropdown/select editors for ngx-smart-table
4
+ */
5
+ import { CellEditor, CellEditorContext } from '../models/cell-strategies.interface';
6
+ import { Observable } from 'rxjs';
7
+ /**
8
+ * Select option configuration
9
+ */
10
+ export interface SelectOption {
11
+ /** The option's value */
12
+ value: string;
13
+ /** Display label for the option */
14
+ label: string;
15
+ /** Whether the option is disabled */
16
+ disabled?: boolean;
17
+ /** Optional prefix icon or content */
18
+ prefix?: string;
19
+ }
20
+ /**
21
+ * Options interface for NileSelectEditor
22
+ */
23
+ export interface NileSelectEditorOptions {
24
+ /** Array of options - supports static arrays, Observable, or BehaviorSubject for reactive updates */
25
+ options: SelectOption[] | string[] | Observable<SelectOption[] | string[]>;
26
+ /** Placeholder text when no selection is made */
27
+ placeholder?: string;
28
+ /** Size of the select control */
29
+ size?: 'small' | 'medium' | 'large';
30
+ /** Enable multiple selection mode */
31
+ multiple?: boolean;
32
+ /** Adds clear button when value is not empty */
33
+ clearable?: boolean;
34
+ /** Disable the select control */
35
+ disabled?: boolean;
36
+ /** Make the select required */
37
+ required?: boolean;
38
+ /** Enable search functionality */
39
+ searchEnabled?: boolean;
40
+ /** Warning state styling */
41
+ warning?: boolean;
42
+ /** Error state styling */
43
+ error?: boolean;
44
+ /** Success state styling */
45
+ success?: boolean;
46
+ /** Error message to display */
47
+ errorMessage?: string;
48
+ /** Help text to display */
49
+ helpText?: string;
50
+ /** Maximum number of selected options to show in multiple mode (0 = no limit) */
51
+ maxOptionsVisible?: number;
52
+ /** Draws a filled select style */
53
+ filled?: boolean;
54
+ /** Pill-style with rounded edges */
55
+ pill?: boolean;
56
+ /** Use fixed positioning to prevent clipping */
57
+ hoist?: boolean;
58
+ /** Placement of the dropdown menu */
59
+ placement?: 'top' | 'bottom';
60
+ /** Enable virtual scrolling for better performance with many options */
61
+ enableVirtualScroll?: boolean;
62
+ /** Disable local search (use for server-side search) */
63
+ disableLocalSearch?: boolean;
64
+ /** Validate before saving (default: true) */
65
+ validateOnSave?: boolean;
66
+ /** Append dropdown to document body instead of parent */
67
+ portal?: boolean;
68
+ }
69
+ /**
70
+ * Custom editor that uses NileSelect component
71
+ * @template T The value type (string for single selection, string[] for multiple)
72
+ */
73
+ export declare class NileSelectEditor<T = string> implements CellEditor<T> {
74
+ private readonly options;
75
+ private select?;
76
+ private eventListeners;
77
+ private optionsSubscription?;
78
+ private currentOptions;
79
+ constructor(options: NileSelectEditorOptions);
80
+ edit(context: CellEditorContext<T>): void;
81
+ /**
82
+ * Set the initial value for the select
83
+ */
84
+ private setInitialValue;
85
+ /**
86
+ * Apply all configuration options to the NileSelect element
87
+ */
88
+ private applyOptions;
89
+ /**
90
+ * Update options dynamically while editor is active
91
+ */
92
+ private updateOptions;
93
+ /**
94
+ * Create NileOption elements and append them to the select
95
+ * @param options - The options to render
96
+ */
97
+ private createAndAppendOptions;
98
+ /**
99
+ * Set up all event listeners with proper cleanup tracking
100
+ */
101
+ private setupEventListeners;
102
+ /**
103
+ * Parse value based on selection mode
104
+ */
105
+ private parseValue;
106
+ destroy(): void;
107
+ focus(): void;
108
+ getCurrentValue(): T;
109
+ }
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Column configuration factory
3
+ * Simplifies creation of common column types with sensible defaults
4
+ */
5
+ import { ColumnConfig } from '../models/column-config.interface';
6
+ /**
7
+ * Column configuration factory - Factory Pattern
8
+ * Provides convenient methods to create pre-configured column types
9
+ */
10
+ export declare class ColumnConfigFactory {
11
+ /**
12
+ * Create a text column
13
+ */
14
+ static text(key: string, options?: Partial<ColumnConfig<string>>): ColumnConfig<string>;
15
+ /**
16
+ * Create a number column
17
+ */
18
+ static number(key: string, options?: Partial<ColumnConfig<number>>): ColumnConfig<number>;
19
+ /**
20
+ * Create a currency column
21
+ */
22
+ static currency(key: string, options?: Partial<ColumnConfig<number>> & {
23
+ currency?: string;
24
+ locale?: string;
25
+ }): ColumnConfig<number>;
26
+ /**
27
+ * Create a date column
28
+ */
29
+ static date(key: string, options?: Partial<ColumnConfig<Date>> & {
30
+ dateStyle?: 'full' | 'long' | 'medium' | 'short';
31
+ locale?: string;
32
+ }): ColumnConfig<Date>;
33
+ /**
34
+ * Create a boolean column
35
+ */
36
+ static boolean(key: string, options?: Partial<ColumnConfig<boolean>> & {
37
+ trueValue?: string;
38
+ falseValue?: string;
39
+ }): ColumnConfig<boolean>;
40
+ /**
41
+ * Create a select/dropdown column
42
+ */
43
+ static select<T = string>(key: string, selectOptions: Array<{
44
+ value: T;
45
+ label: string;
46
+ }>, options?: Partial<ColumnConfig<T>>): ColumnConfig<T>;
47
+ /**
48
+ * Create an email column
49
+ */
50
+ static email(key: string, options?: Partial<ColumnConfig<string>>): ColumnConfig<string>;
51
+ /**
52
+ * Create a readonly column
53
+ */
54
+ static readonly<T = any>(key: string, options?: Partial<ColumnConfig<T>>): ColumnConfig<T>;
55
+ /**
56
+ * Create a custom column with full control
57
+ */
58
+ static custom<T = any>(config: Partial<ColumnConfig<T>> & {
59
+ key: string;
60
+ }): ColumnConfig<T>;
61
+ /**
62
+ * Create multiple columns at once from a simple configuration
63
+ */
64
+ static fromKeys<T extends Record<string, any>>(keys: Array<keyof T | {
65
+ key: keyof T;
66
+ type?: 'text' | 'number' | 'date' | 'boolean';
67
+ options?: any;
68
+ }>): ColumnConfig<any>[];
69
+ }
70
+ /**
71
+ * Convenience exports for common column types
72
+ */
73
+ export declare const Columns: typeof ColumnConfigFactory;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Autosave strategy types
3
+ */
4
+ export declare type AutosaveStrategy = 'lazy' | 'eager';
5
+ /**
6
+ * Autosave configuration interface
7
+ */
8
+ export interface AutosaveConfig {
9
+ /**
10
+ * Whether autosave is enabled
11
+ */
12
+ enabled: boolean;
13
+ /**
14
+ * Autosave strategy:
15
+ * - 'lazy': Saves after user stops making changes (2s debounce)
16
+ * - 'eager': Saves on every change (100ms debounce)
17
+ */
18
+ strategy: AutosaveStrategy;
19
+ }
20
+ /**
21
+ * Default autosave configuration
22
+ */
23
+ export declare const DEFAULT_AUTOSAVE_CONFIG: AutosaveConfig;