@akcelik/strct 4.9.0 → 4.10.0
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/fesm2022/akcelik-strct.mjs +1690 -1553
- package/fesm2022/akcelik-strct.mjs.map +1 -1
- package/package.json +1 -1
- package/types/akcelik-strct.d.ts +42 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akcelik/strct",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.10.0",
|
|
4
4
|
"description": "UIStruct — a standalone Angular component library with a tokenised, multi-palette theme system, built for datacenter / infrastructure management UIs.",
|
|
5
5
|
"author": "Serkan Akcelik <serkan.akcelik@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
package/types/akcelik-strct.d.ts
CHANGED
|
@@ -3503,6 +3503,19 @@ interface StrctDatagridColumn {
|
|
|
3503
3503
|
* change in your handler and pass the updated array back in.
|
|
3504
3504
|
*/
|
|
3505
3505
|
editable?: boolean;
|
|
3506
|
+
/**
|
|
3507
|
+
* Which editor an `editable` column opens. `'text'` (the default) is the
|
|
3508
|
+
* free-text box; `'number'` opens `strct-number`, and `'select'` opens
|
|
3509
|
+
* `strct-select` over `editorOptions` — a value that is one of a set is
|
|
3510
|
+
* chosen, not typed. The cell shows the chosen option's label at rest.
|
|
3511
|
+
*/
|
|
3512
|
+
editor?: 'text' | 'number' | 'select';
|
|
3513
|
+
/** Options for `editor: 'select'` (the library's own option shape). */
|
|
3514
|
+
editorOptions?: StrctOption[];
|
|
3515
|
+
/** Bounds and step for `editor: 'number'`. */
|
|
3516
|
+
editorMin?: number;
|
|
3517
|
+
editorMax?: number;
|
|
3518
|
+
editorStep?: number;
|
|
3506
3519
|
}
|
|
3507
3520
|
/** Per-column filter state: contains-text, or the checked value set. */
|
|
3508
3521
|
type StrctDatagridFilters = Record<string, string | unknown[]>;
|
|
@@ -3742,12 +3755,20 @@ declare class StrctDatagrid {
|
|
|
3742
3755
|
}>;
|
|
3743
3756
|
/** Server-side data request (lazy mode): load this page / sort and set `rows`. */
|
|
3744
3757
|
readonly lazyLoad: _angular_core.OutputEmitterRef<StrctDatagridLazyState>;
|
|
3745
|
-
/** An editable cell was committed (Enter / blur
|
|
3746
|
-
* rows — apply
|
|
3758
|
+
/** An editable cell was committed (Enter / blur, or choosing in a `select`
|
|
3759
|
+
* editor). The grid does not mutate rows — apply the value to your data and
|
|
3760
|
+
* pass the updated array back in. */
|
|
3747
3761
|
readonly cellEdit: _angular_core.OutputEmitterRef<{
|
|
3748
3762
|
row: StrctRow;
|
|
3749
3763
|
column: StrctDatagridColumn;
|
|
3764
|
+
/** The committed value as text — what a `text` editor produces. */
|
|
3750
3765
|
value: string;
|
|
3766
|
+
/**
|
|
3767
|
+
* The same commit, typed: the number a `number` editor holds, or the
|
|
3768
|
+
* option's `value` a `select` editor chose. `value` stays a string so
|
|
3769
|
+
* handlers written against it keep working.
|
|
3770
|
+
*/
|
|
3771
|
+
typedValue: unknown;
|
|
3751
3772
|
previous: unknown;
|
|
3752
3773
|
}>;
|
|
3753
3774
|
private readonly menu;
|
|
@@ -3836,7 +3857,26 @@ declare class StrctDatagrid {
|
|
|
3836
3857
|
colKey: string;
|
|
3837
3858
|
} | null>;
|
|
3838
3859
|
protected isEditingCell(row: StrctRow, col: StrctDatagridColumn): boolean;
|
|
3860
|
+
/** The value a typed editor holds while it is open (committed on Enter / blur). */
|
|
3861
|
+
protected readonly editDraft: _angular_core.WritableSignal<unknown>;
|
|
3839
3862
|
protected startEdit(row: StrctRow, col: StrctDatagridColumn): void;
|
|
3863
|
+
/** A select column reads as its option's label, not as the stored value. */
|
|
3864
|
+
protected displayValue(row: StrctRow, col: StrctDatagridColumn): unknown;
|
|
3865
|
+
/** Close the editor and emit `cellEdit` when the value actually changed. */
|
|
3866
|
+
protected commitValue(row: StrctRow, col: StrctDatagridColumn, raw: unknown): void;
|
|
3867
|
+
/** Enter / blur on a typed editor commits what it currently holds. */
|
|
3868
|
+
protected commitDraft(row: StrctRow, col: StrctDatagridColumn, event?: Event): void;
|
|
3869
|
+
/**
|
|
3870
|
+
* A column that declares bounds means them: Enter commits what the field
|
|
3871
|
+
* holds, and `strct-number` only clamps on blur, so the grid clamps here
|
|
3872
|
+
* rather than letting an out-of-range value reach `cellEdit`.
|
|
3873
|
+
*/
|
|
3874
|
+
private clampToColumn;
|
|
3875
|
+
/**
|
|
3876
|
+
* A number editor is a field between two stepper buttons, so focus moves
|
|
3877
|
+
* inside it — only a move that actually leaves the editor is a blur.
|
|
3878
|
+
*/
|
|
3879
|
+
protected commitOnLeave(row: StrctRow, col: StrctDatagridColumn, event: FocusEvent): void;
|
|
3840
3880
|
protected commitEdit(row: StrctRow, col: StrctDatagridColumn, event: Event): void;
|
|
3841
3881
|
protected cancelEdit(event?: Event): void;
|
|
3842
3882
|
/**
|