@testgorilla/tgo-ui 11.18.8 → 11.19.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/package.json
CHANGED
|
@@ -12,6 +12,11 @@ interface SegmentedToggleOption<T> {
|
|
|
12
12
|
* provide `icon` and `iconAriaLabel` so the segment still has an accessible name.
|
|
13
13
|
*/
|
|
14
14
|
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional quantity shown to the right of the label (e.g. `Saved 12`). While
|
|
17
|
+
* the toggle is `loading`, a skeleton is shown in its place.
|
|
18
|
+
*/
|
|
19
|
+
count?: number;
|
|
15
20
|
/** Optional leading icon, typed to the Canopy icon set. */
|
|
16
21
|
icon?: IconName;
|
|
17
22
|
/**
|
|
@@ -41,11 +46,30 @@ declare class SegmentedToggleComponent<T> {
|
|
|
41
46
|
readonly options: _angular_core.InputSignal<SegmentedToggleOption<T>[]>;
|
|
42
47
|
readonly value: _angular_core.ModelSignal<T | undefined>;
|
|
43
48
|
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
49
|
+
/**
|
|
50
|
+
* Shows a small skeleton to the right of each option's content, in place of
|
|
51
|
+
* its `count`, while the quantities are being fetched. Segments stay selectable.
|
|
52
|
+
*/
|
|
53
|
+
readonly loading: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
44
54
|
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
45
55
|
readonly testId: _angular_core.InputSignal<string | null>;
|
|
46
56
|
readonly applicationTheme: _angular_core.InputSignal<ApplicationTheme | undefined>;
|
|
47
57
|
private readonly defaultAppTheme;
|
|
48
58
|
readonly theme: _angular_core.Signal<ApplicationTheme>;
|
|
59
|
+
/**
|
|
60
|
+
* Pill-shaped placeholder sized to a short count next to a 16px icon/label.
|
|
61
|
+
* Tinted from the segment's text colour so it follows every state (unselected,
|
|
62
|
+
* selected, brand, disabled); the library's fixed light grey vanishes on white
|
|
63
|
+
* and glares on the black pill.
|
|
64
|
+
*/
|
|
65
|
+
protected readonly skeletonTheme: {
|
|
66
|
+
'background-color': string;
|
|
67
|
+
width: string;
|
|
68
|
+
height: string;
|
|
69
|
+
margin: string;
|
|
70
|
+
'border-radius': string;
|
|
71
|
+
'vertical-align': string;
|
|
72
|
+
};
|
|
49
73
|
/** One ElementRef per segment button; used to measure the active pill geometry. */
|
|
50
74
|
private readonly optionButtons;
|
|
51
75
|
/** Index of the selected option; -1 when value() matches no option. */
|
|
@@ -66,7 +90,9 @@ declare class SegmentedToggleComponent<T> {
|
|
|
66
90
|
* Last-resort accessible name for a segment. Used only for an icon-only option
|
|
67
91
|
* that provides neither a visible `label` nor an `iconAriaLabel`, so the button
|
|
68
92
|
* is never a nameless control. When a label or icon label is present those name
|
|
69
|
-
* the button and this returns `null` (no `aria-label` attribute).
|
|
93
|
+
* the button and this returns `null` (no `aria-label` attribute). The `aria-label`
|
|
94
|
+
* replaces the button's content as its name, so a visible `count` is appended
|
|
95
|
+
* here or it would never be announced.
|
|
70
96
|
*/
|
|
71
97
|
protected fallbackAriaLabel(option: SegmentedToggleOption<T>): string | null;
|
|
72
98
|
protected optionTestId(option: SegmentedToggleOption<T>): string | null;
|
|
@@ -75,7 +101,7 @@ declare class SegmentedToggleComponent<T> {
|
|
|
75
101
|
/** Reads the active button's box and writes it to the indicator signals. */
|
|
76
102
|
private measureIndicator;
|
|
77
103
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SegmentedToggleComponent<any>, never>;
|
|
78
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SegmentedToggleComponent<any>, "ui-segmented-toggle", never, { "options": { "alias": "options"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "testId": { "alias": "testId"; "required": false; "isSignal": true; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
104
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SegmentedToggleComponent<any>, "ui-segmented-toggle", never, { "options": { "alias": "options"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "testId": { "alias": "testId"; "required": false; "isSignal": true; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
79
105
|
}
|
|
80
106
|
|
|
81
107
|
export { SegmentedToggleComponent };
|