@aquera/ngx-smart-table 0.0.17-patch-0.3 → 0.0.17-patch-0.5

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.
@@ -71,8 +71,6 @@ export interface NileCodeEditorOptions {
71
71
  dialogMaxHeight?: string;
72
72
  /** Dialog editor min height (default: '300px') */
73
73
  dialogEditorHeight?: string;
74
- /** Minimum number of visible lines in the dialog editor (default: 20) */
75
- dialogMinLines?: number;
76
74
  /** Inline completion dataset */
77
75
  customAutoCompletions?: Record<string, CodeEditorCompletion[]> | CodeEditorCompletion[];
78
76
  /** Paths to fetch completion datasets from */
@@ -114,6 +112,10 @@ export declare class NileCodeEditor<T = string> implements CellEditor<T> {
114
112
  private expandButtonClicked;
115
113
  private documentClickHandler?;
116
114
  private trackedValue;
115
+ private syncingFromDialog;
116
+ private userEditedInline;
117
+ private dialogOriginalValue;
118
+ private dialogCurrentValue;
117
119
  constructor(options?: NileCodeEditorOptions | undefined);
118
120
  edit(context: CellEditorContext<T>): void;
119
121
  /**
@@ -123,6 +125,11 @@ export declare class NileCodeEditor<T = string> implements CellEditor<T> {
123
125
  /**
124
126
  * Read the live value directly from CodeMirror's internal state,
125
127
  * bypassing debounced nile-change events and the possibly-stale .value property.
128
+ *
129
+ * Priority order:
130
+ * 1. trackedValue - always up to date from change events
131
+ * 2. CodeMirror internal state - for real-time reading
132
+ * 3. editor.value property - fallback
126
133
  */
127
134
  private getLiveEditorValue;
128
135
  /**
@@ -130,9 +137,21 @@ export declare class NileCodeEditor<T = string> implements CellEditor<T> {
130
137
  */
131
138
  private openDialog;
132
139
  /**
133
- * Close the dialog and optionally save/exit edit mode
140
+ * Get the current value from the dialog editor
134
141
  */
135
- private closeDialog;
142
+ private getDialogEditorValue;
143
+ /**
144
+ * Apply changes from dialog and close it
145
+ */
146
+ private applyDialogChanges;
147
+ /**
148
+ * Cancel dialog changes and revert to original value
149
+ */
150
+ private cancelDialogChanges;
151
+ /**
152
+ * Close and remove the dialog UI
153
+ */
154
+ private closeDialogUI;
136
155
  /**
137
156
  * Apply all configuration options to the NileCodeEditor element
138
157
  */
@@ -0,0 +1,13 @@
1
+ import { CellFormatter } from '../models/cell-strategies.interface';
2
+ declare type FormatterFactory = () => CellFormatter<any>;
3
+ /**
4
+ * Resolve a formatter by name. Looks up custom formatters first, then built-in.
5
+ * Returns undefined if the name is not registered.
6
+ */
7
+ export declare function resolveFormatter(name: string): CellFormatter<any> | undefined;
8
+ /**
9
+ * Register a custom formatter so it can be referenced by string name
10
+ * in column configs (e.g. `formatter: 'myFormatter'`).
11
+ */
12
+ export declare function registerFormatter(name: string, factory: FormatterFactory): void;
13
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './ou-formatter';
2
+ export * from './formatter-registry';
@@ -0,0 +1,45 @@
1
+ import { CellFormatter } from '../models/cell-strategies.interface';
2
+ /**
3
+ * Convert an LDAP Distinguished Name (DN) string to a human-readable path.
4
+ *
5
+ * @example
6
+ * "OU=Engineering,OU=India,DC=company,DC=com"
7
+ * → "Engineering / India (company.com)"
8
+ *
9
+ * "CN=John Smith,OU=Admins,OU=Engineering,DC=company,DC=com"
10
+ * → "John Smith / Admins / Engineering (company.com)"
11
+ *
12
+ * "OU=R\\,D,OU=Teams,DC=example,DC=org"
13
+ * → "R,D / Teams (example.org)"
14
+ */
15
+ export declare function dnToHumanReadable(dn: string): string;
16
+ export interface OUFormatterOptions {
17
+ /** Separator between OU components (default: ' / ') */
18
+ separator?: string;
19
+ /** Whether to show the domain suffix from DC components (default: true) */
20
+ showDomain?: boolean;
21
+ /** Fallback text when value is empty or not a valid DN (default: '') */
22
+ emptyText?: string;
23
+ /** Separator between multiple formatted DNs when value is an array (default: ', ') */
24
+ arraySeparator?: string;
25
+ }
26
+ /**
27
+ * Cell formatter that converts LDAP Distinguished Name (DN) strings
28
+ * into human-readable OU paths with optional domain suffix.
29
+ *
30
+ * @example
31
+ * // In column config:
32
+ * formatter: new OUFormatter()
33
+ *
34
+ * // With options:
35
+ * formatter: new OUFormatter({ separator: ' > ', showDomain: false })
36
+ *
37
+ * // Handles arrays from multiselect:
38
+ * // ['OU=Eng,DC=co,DC=com', 'OU=HR,DC=co,DC=com'] → "Eng (co.com), HR (co.com)"
39
+ */
40
+ export declare class OUFormatter implements CellFormatter<string | string[]> {
41
+ private readonly options?;
42
+ constructor(options?: OUFormatterOptions | undefined);
43
+ format(value: string | string[]): string;
44
+ private formatSingle;
45
+ }
@@ -14,7 +14,7 @@ export declare abstract class BaseColumnConfig<T = any> implements ColumnConfig<
14
14
  readonly key: string;
15
15
  readonly header?: string;
16
16
  readonly dataType?: CellDataType;
17
- readonly formatter?: CellFormatter<T>;
17
+ readonly formatter?: CellFormatter<T> | string;
18
18
  readonly validator?: CellValidator<T>;
19
19
  readonly editor?: CellEditor<T>;
20
20
  readonly parser?: CellParser<T>;
@@ -49,9 +49,11 @@ export interface ColumnConfig<T = any> {
49
49
  */
50
50
  readonly dataType?: CellDataType;
51
51
  /**
52
- * Formatter strategy for displaying cell values
52
+ * Formatter strategy for displaying cell values.
53
+ * Can be a CellFormatter instance or a predefined formatter name string
54
+ * (e.g. 'ouFormatter'). Use registerFormatter() to add custom named formatters.
53
55
  */
54
- readonly formatter?: CellFormatter<T>;
56
+ readonly formatter?: CellFormatter<T> | string;
55
57
  /**
56
58
  * Validator strategy for validating cell values
57
59
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aquera/ngx-smart-table",
3
- "version": "0.0.17-patch-0.3",
3
+ "version": "0.0.17-patch-0.5",
4
4
  "license": "MIT",
5
5
  "peerDependencies": {
6
6
  "@angular/common": ">=13.0.0 <16.0.0",
package/public-api.d.ts CHANGED
@@ -25,6 +25,7 @@ export * from './lib/renderer/models/workbook-state.class';
25
25
  export * from './lib/renderer/models/cell.class';
26
26
  export * from './lib/models/base-column-config.class';
27
27
  export * from './lib/strategies/default-formatters';
28
+ export * from './lib/formatters/index';
28
29
  export * from './lib/strategies/default-validators';
29
30
  export * from './lib/renderer/models/row-validation-state.interface';
30
31
  export * from './lib/renderer/models/table-validation-state.interface';