@aquera/ngx-smart-table 0.0.17-patch-0.4 → 0.0.17-patch-0.6
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/esm2020/lib/editors/index.mjs +2 -1
- package/esm2020/lib/editors/nile-chip-editor.mjs +293 -0
- package/esm2020/lib/editors/nile-code-editor.mjs +9 -10
- package/esm2020/lib/formatters/formatter-registry.mjs +21 -0
- package/esm2020/lib/formatters/index.mjs +3 -0
- package/esm2020/lib/formatters/ou-formatter.mjs +96 -0
- package/esm2020/lib/models/base-column-config.class.mjs +13 -6
- package/esm2020/lib/models/column-config.interface.mjs +1 -1
- package/esm2020/lib/renderer/components/st-table/st-table.component.mjs +2 -3
- package/esm2020/lib/renderer/models/cell.class.mjs +14 -8
- package/esm2020/public-api.mjs +5 -1
- package/fesm2015/aquera-ngx-smart-table.mjs +453 -25
- package/fesm2015/aquera-ngx-smart-table.mjs.map +1 -1
- package/fesm2020/aquera-ngx-smart-table.mjs +442 -23
- package/fesm2020/aquera-ngx-smart-table.mjs.map +1 -1
- package/lib/editors/index.d.ts +1 -0
- package/lib/editors/nile-chip-editor.d.ts +94 -0
- package/lib/formatters/formatter-registry.d.ts +13 -0
- package/lib/formatters/index.d.ts +2 -0
- package/lib/formatters/ou-formatter.d.ts +45 -0
- package/lib/models/base-column-config.class.d.ts +1 -1
- package/lib/models/column-config.interface.d.ts +4 -2
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
package/lib/editors/index.d.ts
CHANGED
|
@@ -6,4 +6,5 @@ export { NileSelectEditor, NileSelectEditorOptions, SelectOption } from './nile-
|
|
|
6
6
|
export { NileAutoCompleteEditor, NileAutoCompleteEditorOptions, AutoCompleteOption } from './nile-autocomplete-editor';
|
|
7
7
|
export { NileCalendarEditor, NileCalendarEditorOptions, AllowedDatesRange } from './nile-calendar-editor';
|
|
8
8
|
export { NileDatePickerEditor, NileDatePickerEditorOptions, DateRange } from './nile-date-picker-editor';
|
|
9
|
+
export { NileChipEditor, NileChipEditorOptions, ChipOption } from './nile-chip-editor';
|
|
9
10
|
export { NileCodeEditor, NileCodeEditorOptions, CodeEditorCompletion, AutoCompleteStyle } from './nile-code-editor';
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom editor using NileChip from @aquera/nile-elements
|
|
3
|
+
* Renders the chip input in a floating popover below the cell to avoid row height mismatch.
|
|
4
|
+
*
|
|
5
|
+
* @see https://nile.aqueralabs.com/1.6.3/chip?theme=enterprise
|
|
6
|
+
*/
|
|
7
|
+
import { CellEditor, CellEditorContext } from '../models/cell-strategies.interface';
|
|
8
|
+
/**
|
|
9
|
+
* Chip option for autocomplete suggestions
|
|
10
|
+
*/
|
|
11
|
+
export interface ChipOption {
|
|
12
|
+
/** The option's value */
|
|
13
|
+
value: string;
|
|
14
|
+
/** Display label for the option (defaults to value if omitted) */
|
|
15
|
+
label?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Options interface for NileChipEditor
|
|
19
|
+
*/
|
|
20
|
+
export interface NileChipEditorOptions {
|
|
21
|
+
/** Autocomplete suggestion list (full set) */
|
|
22
|
+
autoCompleteOptions?: ChipOption[] | string[];
|
|
23
|
+
/** Placeholder text shown inside the input area */
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
/** Allow users to type custom values not present in the suggestion list */
|
|
26
|
+
acceptUserInput?: boolean;
|
|
27
|
+
/** Prevent duplicate chip values */
|
|
28
|
+
noDuplicates?: boolean;
|
|
29
|
+
/** Disable the chip input */
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/** Make the chip input readonly */
|
|
32
|
+
readonly?: boolean;
|
|
33
|
+
/** Show a clear-all button */
|
|
34
|
+
clearable?: boolean;
|
|
35
|
+
/** Prevent chip tags from wrapping to multiple lines */
|
|
36
|
+
noWrap?: boolean;
|
|
37
|
+
/** Remove the autocomplete dropdown entirely */
|
|
38
|
+
noAutoComplete?: boolean;
|
|
39
|
+
/** Enable virtual scrolling in the suggestion dropdown */
|
|
40
|
+
enableVirtualScroll?: boolean;
|
|
41
|
+
/** Control whether the dropdown opens on focus — 'true' | 'false' | 'always' */
|
|
42
|
+
openDropdownOnFocus?: string;
|
|
43
|
+
/** Show loading spinner inside the dropdown */
|
|
44
|
+
loading?: 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 shown below the input */
|
|
52
|
+
errorMessage?: string;
|
|
53
|
+
/** Help text shown below the input */
|
|
54
|
+
helpText?: string;
|
|
55
|
+
/** Label text for the chip input */
|
|
56
|
+
label?: string;
|
|
57
|
+
/** Indexes of chips to highlight as errors */
|
|
58
|
+
errorIndexes?: number[];
|
|
59
|
+
/** Custom filter function for autocomplete */
|
|
60
|
+
filterFunction?: (query: string, option: string) => boolean;
|
|
61
|
+
/** Custom render function for dropdown items */
|
|
62
|
+
renderItemFunction?: (option: string) => string;
|
|
63
|
+
/** Auto-focus the input when editor opens (default: true) */
|
|
64
|
+
autoFocus?: boolean;
|
|
65
|
+
/** Minimum width of the popover in px (default: width of the cell) */
|
|
66
|
+
popoverMinWidth?: number;
|
|
67
|
+
/** Maximum height of the popover in px before it scrolls (default: 200) */
|
|
68
|
+
popoverMaxHeight?: number;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Custom editor that uses NileChip (tag input) component.
|
|
72
|
+
* Renders in a floating popover below the cell to avoid expanding row height.
|
|
73
|
+
*
|
|
74
|
+
* Cell value is expected to be `string[]` (array of tag strings).
|
|
75
|
+
*/
|
|
76
|
+
export declare class NileChipEditor implements CellEditor<string[]> {
|
|
77
|
+
private readonly options?;
|
|
78
|
+
acceptsInitialKeypress: boolean;
|
|
79
|
+
private chip?;
|
|
80
|
+
private popover?;
|
|
81
|
+
private cellContainer?;
|
|
82
|
+
private eventListeners;
|
|
83
|
+
private trackedValues;
|
|
84
|
+
constructor(options?: NileChipEditorOptions | undefined);
|
|
85
|
+
edit(context: CellEditorContext<string[]>): void;
|
|
86
|
+
private positionPopover;
|
|
87
|
+
private setInitialValue;
|
|
88
|
+
private applyOptions;
|
|
89
|
+
private addListener;
|
|
90
|
+
private setupEventListeners;
|
|
91
|
+
destroy(): void;
|
|
92
|
+
focus(): void;
|
|
93
|
+
getCurrentValue(): string[];
|
|
94
|
+
}
|
|
@@ -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,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
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';
|