@aquera/ngx-smart-table 0.0.24 → 0.0.25

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.24",
3
+ "version": "0.0.25",
4
4
  "license": "MIT",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0",
@@ -951,9 +951,11 @@ interface ColumnConfig<T = any> {
951
951
  */
952
952
  readonly dataType?: CellDataType;
953
953
  /**
954
- * Formatter strategy for displaying cell values
954
+ * Formatter strategy for displaying cell values.
955
+ * Can be a CellFormatter instance or a predefined formatter name string
956
+ * (e.g. 'ouFormatter'). Use registerFormatter() to add custom named formatters.
955
957
  */
956
- readonly formatter?: CellFormatter<T>;
958
+ readonly formatter?: CellFormatter<T> | string;
957
959
  /**
958
960
  * Validator strategy for validating cell values
959
961
  */
@@ -2845,7 +2847,7 @@ declare abstract class BaseColumnConfig<T = any> implements ColumnConfig<T> {
2845
2847
  readonly key: string;
2846
2848
  readonly header?: string;
2847
2849
  readonly dataType?: CellDataType;
2848
- readonly formatter?: CellFormatter<T>;
2850
+ readonly formatter?: CellFormatter<T> | string;
2849
2851
  readonly validator?: CellValidator<T>;
2850
2852
  readonly editor?: CellEditor<T>;
2851
2853
  readonly parser?: CellParser<T>;
@@ -3062,6 +3064,63 @@ declare class DefaultFormatter implements CellFormatter<any> {
3062
3064
  format(value: any): string;
3063
3065
  }
3064
3066
 
3067
+ /**
3068
+ * Convert an LDAP Distinguished Name (DN) string to a human-readable path.
3069
+ *
3070
+ * @example
3071
+ * "OU=Engineering,OU=India,DC=company,DC=com"
3072
+ * → "Engineering / India (company.com)"
3073
+ *
3074
+ * "CN=John Smith,OU=Admins,OU=Engineering,DC=company,DC=com"
3075
+ * → "John Smith / Admins / Engineering (company.com)"
3076
+ *
3077
+ * "OU=R\\,D,OU=Teams,DC=example,DC=org"
3078
+ * → "R,D / Teams (example.org)"
3079
+ */
3080
+ declare function dnToHumanReadable(dn: string): string;
3081
+ interface OUFormatterOptions {
3082
+ /** Separator between OU components (default: ' / ') */
3083
+ separator?: string;
3084
+ /** Whether to show the domain suffix from DC components (default: true) */
3085
+ showDomain?: boolean;
3086
+ /** Fallback text when value is empty or not a valid DN (default: '') */
3087
+ emptyText?: string;
3088
+ /** Separator between multiple formatted DNs when value is an array (default: ', ') */
3089
+ arraySeparator?: string;
3090
+ }
3091
+ /**
3092
+ * Cell formatter that converts LDAP Distinguished Name (DN) strings
3093
+ * into human-readable OU paths with optional domain suffix.
3094
+ *
3095
+ * @example
3096
+ * // In column config:
3097
+ * formatter: new OUFormatter()
3098
+ *
3099
+ * // With options:
3100
+ * formatter: new OUFormatter({ separator: ' > ', showDomain: false })
3101
+ *
3102
+ * // Handles arrays from multiselect:
3103
+ * // ['OU=Eng,DC=co,DC=com', 'OU=HR,DC=co,DC=com'] → "Eng (co.com), HR (co.com)"
3104
+ */
3105
+ declare class OUFormatter implements CellFormatter<string | string[]> {
3106
+ private readonly options?;
3107
+ constructor(options?: OUFormatterOptions | undefined);
3108
+ format(value: string | string[]): string;
3109
+ private formatSingle;
3110
+ }
3111
+
3112
+ type FormatterFactory = () => CellFormatter<any>;
3113
+ /**
3114
+ * Resolve a formatter by name. Looks up custom formatters first, then built-in.
3115
+ * Returns undefined if the name is not registered.
3116
+ */
3117
+ declare function resolveFormatter(name: string): CellFormatter<any> | undefined;
3118
+ /**
3119
+ * Register a custom formatter so it can be referenced by string name
3120
+ * in column configs (e.g. `formatter: 'myFormatter'`).
3121
+ */
3122
+ declare function registerFormatter(name: string, factory: FormatterFactory): void;
3123
+
3065
3124
  /**
3066
3125
  * Default validator implementations
3067
3126
  */
@@ -6104,5 +6163,5 @@ declare class AutosaveService {
6104
6163
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<AutosaveService>;
6105
6164
  }
6106
6165
 
6107
- 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 };
6108
- 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 };
6166
+ 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, OUFormatter, 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, dnToHumanReadable, isCellValid, isDisplayMode, isNullOrUndefined, isValidDate, isValidationSuccess, mergeTableConfig, registerFormatter, resolveFormatter, restoreFromMemento };
6167
+ 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, OUFormatterOptions, 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 };