@aquera/ngx-smart-table 0.0.22 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aquera/ngx-smart-table",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "license": "MIT",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0",
@@ -1415,10 +1415,27 @@ declare class Cell<T = any> {
1415
1415
  * Get row index
1416
1416
  */
1417
1417
  getRowIndex(): number | undefined;
1418
+ private stateChangeCallback?;
1418
1419
  /**
1419
- * Set loading state
1420
+ * When the data source refreshes, the table recreates Cell objects.
1421
+ * This field lets the old (stale) Cell forward calls to its replacement
1422
+ * so that async operations (e.g. setLoading from an API callback)
1423
+ * still reach the live component.
1424
+ */
1425
+ private replacementCell?;
1426
+ /**
1427
+ * Link this cell to its replacement so future state mutations forward.
1428
+ */
1429
+ setReplacement(replacement: Cell<any>): void;
1430
+ onStateChange(callback: () => void): void;
1431
+ /**
1432
+ * Set loading state. Forwards to replacement cell if this cell was replaced.
1420
1433
  */
1421
1434
  setLoading(isLoading: boolean): void;
1435
+ /**
1436
+ * Set cell value (public API, forwards to replacement if replaced).
1437
+ */
1438
+ setValueExternal(value: T): boolean;
1422
1439
  /**
1423
1440
  * Set disabled state
1424
1441
  */
@@ -3740,6 +3757,166 @@ declare class NileDatePickerEditor<T = string> implements CellEditor<T> {
3740
3757
  focus(): void;
3741
3758
  }
3742
3759
 
3760
+ /**
3761
+ * Custom editor using NileCodeEditor from @aquera/nile-elements
3762
+ * This provides code editing capabilities with syntax highlighting for table cells
3763
+ */
3764
+
3765
+ /**
3766
+ * Autocompletion item configuration
3767
+ */
3768
+ interface CodeEditorCompletion {
3769
+ /** The completion label shown in dropdown */
3770
+ label: string;
3771
+ /** The value to insert */
3772
+ value?: string;
3773
+ /** Optional description */
3774
+ detail?: string;
3775
+ }
3776
+ /**
3777
+ * Autocomplete style configuration
3778
+ */
3779
+ interface AutoCompleteStyle {
3780
+ /** Width of the autocomplete dropdown */
3781
+ width?: string;
3782
+ /** Enable multiline content in autocomplete */
3783
+ multiline?: boolean;
3784
+ }
3785
+ /**
3786
+ * Options interface for NileCodeEditor
3787
+ */
3788
+ interface NileCodeEditorOptions {
3789
+ /** Language mode for syntax highlighting */
3790
+ language?: 'javascript' | 'sql' | 'json' | 'html';
3791
+ /** Disable syntax highlighting */
3792
+ disableSyntaxHighlighting?: boolean;
3793
+ /** Placeholder text when empty */
3794
+ placeholder?: string;
3795
+ /** Show line numbers (single-line mode) */
3796
+ lineNumbers?: boolean;
3797
+ /** Show line numbers in multiline mode */
3798
+ lineNumbersMultiline?: boolean;
3799
+ /** Allow multi-line editing */
3800
+ multiline?: boolean;
3801
+ /** Render without border */
3802
+ noborder?: boolean;
3803
+ /** Use default font instead of inherit */
3804
+ defaultFont?: boolean;
3805
+ /** Auto focus on edit */
3806
+ autoFocus?: boolean;
3807
+ /** Read-only mode */
3808
+ readonly?: boolean;
3809
+ /** Disabled state */
3810
+ disabled?: boolean;
3811
+ /** Enable Tab-to-complete */
3812
+ tabCompletion?: boolean;
3813
+ /** Enable search keymap */
3814
+ enableSearch?: boolean;
3815
+ /** Show code folding gutters */
3816
+ enableFoldGutters?: boolean;
3817
+ /** Internal scroll container */
3818
+ hasScroller?: boolean;
3819
+ /** Show expand control (native nile-code-editor expand) */
3820
+ expandable?: boolean;
3821
+ /** Icon for expand control */
3822
+ expandIcon?: string;
3823
+ /** Show expand button to open full editor dialog (default: true) */
3824
+ showExpandButton?: boolean;
3825
+ /** Dialog title (default: 'Edit Code') */
3826
+ dialogTitle?: string;
3827
+ /** Dialog width (default: '600px') */
3828
+ dialogWidth?: string;
3829
+ /** Dialog max height (default: '80vh') */
3830
+ dialogMaxHeight?: string;
3831
+ /** Dialog editor min height (default: '300px') */
3832
+ dialogEditorHeight?: string;
3833
+ /** Minimum number of visible lines in the dialog editor (default: 20) */
3834
+ dialogMinLines?: number;
3835
+ /** Inline completion dataset */
3836
+ customAutoCompletions?: Record<string, CodeEditorCompletion[]> | CodeEditorCompletion[];
3837
+ /** Paths to fetch completion datasets from */
3838
+ customCompletionsPaths?: string[];
3839
+ /** Enable variables in suggestions */
3840
+ allowVariableInCustomSuggestion?: boolean;
3841
+ /** Show autocomplete above cursor */
3842
+ aboveCursor?: boolean;
3843
+ /** Style config for autocomplete dropdown */
3844
+ autoCompleteStyle?: AutoCompleteStyle;
3845
+ /** Debounce change events */
3846
+ debounce?: boolean;
3847
+ /** Debounce delay in ms */
3848
+ debounceTimeout?: number;
3849
+ /** Error state */
3850
+ error?: boolean;
3851
+ /** Error message to display */
3852
+ errorMessage?: string;
3853
+ /** Custom theme CSS object */
3854
+ customThemeCSS?: Record<string, Record<string, string>>;
3855
+ /** Validate before saving (default: true) */
3856
+ validateOnSave?: boolean;
3857
+ }
3858
+ /**
3859
+ * Custom editor that uses NileCodeEditor component
3860
+ * Provides code editing with syntax highlighting for table cells
3861
+ * @template T The value type (typically string)
3862
+ */
3863
+ declare class NileCodeEditor<T = string> implements CellEditor<T> {
3864
+ private readonly options?;
3865
+ private editor?;
3866
+ private wrapper?;
3867
+ private expandButton?;
3868
+ private dialog?;
3869
+ private dialogEditor?;
3870
+ private eventListeners;
3871
+ private context?;
3872
+ private dialogOpen;
3873
+ private expandButtonClicked;
3874
+ private documentClickHandler?;
3875
+ private trackedValue;
3876
+ constructor(options?: NileCodeEditorOptions | undefined);
3877
+ edit(context: CellEditorContext<T>): void;
3878
+ /**
3879
+ * Focus the editor and place cursor
3880
+ */
3881
+ private focusEditor;
3882
+ /**
3883
+ * Read the live value directly from CodeMirror's internal state,
3884
+ * bypassing debounced nile-change events and the possibly-stale .value property.
3885
+ */
3886
+ private getLiveEditorValue;
3887
+ /**
3888
+ * Open the full editor dialog
3889
+ */
3890
+ private openDialog;
3891
+ /**
3892
+ * Close the dialog and optionally save/exit edit mode
3893
+ */
3894
+ private closeDialog;
3895
+ /**
3896
+ * Apply all configuration options to the NileCodeEditor element
3897
+ */
3898
+ private applyOptions;
3899
+ /**
3900
+ * Set up all event listeners with proper cleanup tracking
3901
+ */
3902
+ private setupEventListeners;
3903
+ /**
3904
+ * Save value with optional validation
3905
+ */
3906
+ private saveValue;
3907
+ destroy(): void;
3908
+ focus(): void;
3909
+ getCurrentValue(): T;
3910
+ /**
3911
+ * Set value programmatically
3912
+ */
3913
+ setValue(value: T): void;
3914
+ /**
3915
+ * Get the CodeMirror instance (if needed for advanced usage)
3916
+ */
3917
+ getEditorInstance(): any;
3918
+ }
3919
+
3743
3920
  /**
3744
3921
  * Column configuration factory
3745
3922
  * Simplifies creation of common column types with sensible defaults
@@ -3830,7 +4007,9 @@ declare class StCellComponent implements OnInit, OnDestroy, AfterViewInit {
3830
4007
  direction: NavigationDirection;
3831
4008
  }>;
3832
4009
  editorContainer?: ElementRef;
4010
+ cellLoading: boolean;
3833
4011
  private editorCleanup?;
4012
+ private cdr;
3834
4013
  readonly isEditable: _angular_core.Signal<boolean>;
3835
4014
  readonly validationError: _angular_core.Signal<string | undefined>;
3836
4015
  readonly hasCellTemplate: _angular_core.Signal<boolean>;
@@ -5906,5 +6085,5 @@ declare class AutosaveService {
5906
6085
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<AutosaveService>;
5907
6086
  }
5908
6087
 
5909
- export { ArrayFormatter, AutosaveService, BaseColumnConfig, BooleanEditor, BooleanFormatter, BuilderPreviewComponent, BuilderToolbarComponent, Cell, CellAlignment, CellDataType, CellLifecycleState, CellVerticalAlignment, ChainValidator, ClickOutsideDirective, ColumnConfigFactory, ColumnEditorComponent, ColumnListComponent, Columns, CurrencyFormatter, DEFAULT_AUTOSAVE_CONFIG, DEFAULT_COLUMN_CONFIG, DEFAULT_TABLE_CONFIG, DateEditor, DateFormatter, DateRangeValidator, DefaultFormatter, DefinitionBuilderComponent, DefinitionBuilderModule, DefinitionBuilderService, DefinitionExportService, DefinitionImportService, EditMode, EmailValidator, FilterOperator, FunctionFormatter, FunctionValidator, JsonSchemaValidatorService, LengthValidator, NavigationDirection, NavigationKey, NileAutoCompleteEditor, NileCalendarEditor, NileDatePickerEditor, NileInputEditor, NileSelectEditor, NumberEditor, NumberFormatter, PatternValidators, PercentageFormatter, RangeValidator, RegexValidator, RequiredValidator, RowValidationService, SampleDataGeneratorService, SelectEditor, SharedTableComponentsModule, SheetState, SimpleColumnConfig, SmartTableModule, SortDirection, StAddColumnButtonComponent, StCellComponent, StColumnEditorModalComponent, StColumnFilterComponent, StColumnMenuDropdownComponent, StColumnResizeDirective, StColumnVisibilityComponent, StHeaderComponent, StKeyboardNavigationDirective, StPaginationComponent, StRowActionsDropdownComponent, StSheetActionsComponent, StSheetComponent, StTableActionsComponent, StTableComponent, StWorkbookComponent, StringFormatter, TableConfigEditorComponent, TableState, TableZIndex, TemplateFormatter, TextAreaEditor, TextEditor, UrlValidator, ValidationLoggerService, VirtualScrollService, WorkbookState, canEdit, createCellState, createMemento, isCellValid, isDisplayMode, isNullOrUndefined, isValidDate, isValidationSuccess, mergeTableConfig, restoreFromMemento };
5910
- export type { AllowedDatesRange, AsyncCellValidator, AutoCompleteOption, AutosaveConfig, AutosaveData, AutosaveStrategy, BuilderState, CellCancelEvent, CellChangeEvent, CellEditEvent, CellEditor, CellEditorContext, CellEvent, CellEventHandler, CellFocusPosition, CellFormatter, CellLifecycleHooks, CellParser, CellSaveEvent, CellState, CellStateMemento, CellValidator, CellValue, ColumnAction, ColumnActionContext, ColumnActionEvent, ColumnAddEvent, ColumnConfig, ColumnConfigOptions, ColumnConfigWithKey, ColumnFilterEvent, ColumnFilterState, ColumnMoveEvent, ColumnResizeEvent, ColumnSortEvent, ColumnSortState, CompositeValidator, DataChangeEvent, DateRange, ExportOptions, FilterContext, FilterOptions, ImportResult, NileAutoCompleteEditorOptions, NileCalendarEditorOptions, NileDatePickerEditorOptions, NileInputEditorOptions, NileSelectEditorOptions, PaginationState, PartialColumnConfig, RowAction, RowActionContext, RowActionEvent, RowManagementConfig, RowValidationState, SelectOption, SheetAction, SheetActionContext, SheetActionEvent, SheetConfig, SheetMetadata, SheetStateConfig, SheetStateSnapshot, SheetTabAction, SheetTabActionEvent, TableConfig, TableStateChangeEvent, TableStateConfig, TableStateSnapshot, TableValidationState, ValidationError, ValidationLogEntry, ValidationResult, VirtualScrollState, WorkbookAction, WorkbookActionEvent, WorkbookConfig, WorkbookMetadata, WorkbookSheetConfig, WorkbookStateConfig, WorkbookStateSnapshot };
6088
+ export { ArrayFormatter, AutosaveService, BaseColumnConfig, BooleanEditor, BooleanFormatter, BuilderPreviewComponent, BuilderToolbarComponent, Cell, CellAlignment, CellDataType, CellLifecycleState, CellVerticalAlignment, ChainValidator, ClickOutsideDirective, ColumnConfigFactory, ColumnEditorComponent, ColumnListComponent, Columns, CurrencyFormatter, DEFAULT_AUTOSAVE_CONFIG, DEFAULT_COLUMN_CONFIG, DEFAULT_TABLE_CONFIG, DateEditor, DateFormatter, DateRangeValidator, DefaultFormatter, DefinitionBuilderComponent, DefinitionBuilderModule, DefinitionBuilderService, DefinitionExportService, DefinitionImportService, EditMode, EmailValidator, FilterOperator, FunctionFormatter, FunctionValidator, JsonSchemaValidatorService, LengthValidator, NavigationDirection, NavigationKey, NileAutoCompleteEditor, NileCalendarEditor, NileCodeEditor, NileDatePickerEditor, NileInputEditor, NileSelectEditor, NumberEditor, NumberFormatter, PatternValidators, PercentageFormatter, RangeValidator, RegexValidator, RequiredValidator, RowValidationService, SampleDataGeneratorService, SelectEditor, SharedTableComponentsModule, SheetState, SimpleColumnConfig, SmartTableModule, SortDirection, StAddColumnButtonComponent, StCellComponent, StColumnEditorModalComponent, StColumnFilterComponent, StColumnMenuDropdownComponent, StColumnResizeDirective, StColumnVisibilityComponent, StHeaderComponent, StKeyboardNavigationDirective, StPaginationComponent, StRowActionsDropdownComponent, StSheetActionsComponent, StSheetComponent, StTableActionsComponent, StTableComponent, StWorkbookComponent, StringFormatter, TableConfigEditorComponent, TableState, TableZIndex, TemplateFormatter, TextAreaEditor, TextEditor, UrlValidator, ValidationLoggerService, VirtualScrollService, WorkbookState, canEdit, createCellState, createMemento, isCellValid, isDisplayMode, isNullOrUndefined, isValidDate, isValidationSuccess, mergeTableConfig, restoreFromMemento };
6089
+ export type { AllowedDatesRange, AsyncCellValidator, AutoCompleteOption, AutoCompleteStyle, AutosaveConfig, AutosaveData, AutosaveStrategy, BuilderState, CellCancelEvent, CellChangeEvent, CellEditEvent, CellEditor, CellEditorContext, CellEvent, CellEventHandler, CellFocusPosition, CellFormatter, CellLifecycleHooks, CellParser, CellSaveEvent, CellState, CellStateMemento, CellValidator, CellValue, CodeEditorCompletion, ColumnAction, ColumnActionContext, ColumnActionEvent, ColumnAddEvent, ColumnConfig, ColumnConfigOptions, ColumnConfigWithKey, ColumnFilterEvent, ColumnFilterState, ColumnMoveEvent, ColumnResizeEvent, ColumnSortEvent, ColumnSortState, CompositeValidator, DataChangeEvent, DateRange, ExportOptions, FilterContext, FilterOptions, ImportResult, NileAutoCompleteEditorOptions, NileCalendarEditorOptions, NileCodeEditorOptions, NileDatePickerEditorOptions, NileInputEditorOptions, NileSelectEditorOptions, PaginationState, PartialColumnConfig, RowAction, RowActionContext, RowActionEvent, RowManagementConfig, RowValidationState, SelectOption, SheetAction, SheetActionContext, SheetActionEvent, SheetConfig, SheetMetadata, SheetStateConfig, SheetStateSnapshot, SheetTabAction, SheetTabActionEvent, TableConfig, TableStateChangeEvent, TableStateConfig, TableStateSnapshot, TableValidationState, ValidationError, ValidationLogEntry, ValidationResult, VirtualScrollState, WorkbookAction, WorkbookActionEvent, WorkbookConfig, WorkbookMetadata, WorkbookSheetConfig, WorkbookStateConfig, WorkbookStateSnapshot };