@truenas/ui-components 0.1.23 → 0.1.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,8 +1,8 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { ElementRef, AfterViewInit, OnDestroy, AfterContentInit, TemplateRef, Provider, ChangeDetectorRef, PipeTransform, OnInit, ViewContainerRef, AfterViewChecked } from '@angular/core';
|
|
3
|
+
import { ControlValueAccessor, NgControl } from '@angular/forms';
|
|
3
4
|
import { ComponentHarness, BaseHarnessFilters, HarnessPredicate, HarnessLoader } from '@angular/cdk/testing';
|
|
4
5
|
import { SafeHtml, SafeResourceUrl, DomSanitizer } from '@angular/platform-browser';
|
|
5
|
-
import { ControlValueAccessor, NgControl } from '@angular/forms';
|
|
6
6
|
import { DataSource } from '@angular/cdk/collections';
|
|
7
7
|
import * as i1 from '@angular/cdk/tree';
|
|
8
8
|
import { CdkTree, FlatTreeControl, CdkTreeNode, CdkNestedTreeNode } from '@angular/cdk/tree';
|
|
@@ -13,6 +13,246 @@ import { DialogConfig, DialogRef } from '@angular/cdk/dialog';
|
|
|
13
13
|
import { ComponentType } from '@angular/cdk/portal';
|
|
14
14
|
import { ComponentFixture } from '@angular/core/testing';
|
|
15
15
|
|
|
16
|
+
declare class TnAutocompleteComponent<T = unknown> implements ControlValueAccessor {
|
|
17
|
+
private readonly elementRef;
|
|
18
|
+
/** Unique instance ID for ARIA linkage */
|
|
19
|
+
protected readonly uid: string;
|
|
20
|
+
/** All available options */
|
|
21
|
+
options: _angular_core.InputSignal<T[]>;
|
|
22
|
+
/** Transform a value to its display string */
|
|
23
|
+
displayWith: _angular_core.InputSignal<(value: T) => string>;
|
|
24
|
+
/** Placeholder text for the input */
|
|
25
|
+
placeholder: _angular_core.InputSignal<string>;
|
|
26
|
+
/** Whether the input is disabled */
|
|
27
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
28
|
+
/** Require the user to select from the dropdown — reverts on blur if no match */
|
|
29
|
+
requireSelection: _angular_core.InputSignal<boolean>;
|
|
30
|
+
/** Custom filter function. Defaults to case-insensitive includes on displayWith text */
|
|
31
|
+
filterFn: _angular_core.InputSignal<((option: T, searchTerm: string) => boolean) | undefined>;
|
|
32
|
+
/** Text shown when no options match the search */
|
|
33
|
+
noResultsText: _angular_core.InputSignal<string>;
|
|
34
|
+
/** Maximum number of options to render */
|
|
35
|
+
maxResults: _angular_core.InputSignal<number>;
|
|
36
|
+
/** Test ID attribute */
|
|
37
|
+
testId: _angular_core.InputSignal<string>;
|
|
38
|
+
/** Emits when an option is selected */
|
|
39
|
+
optionSelected: _angular_core.OutputEmitterRef<T>;
|
|
40
|
+
/** Reference to the input element */
|
|
41
|
+
inputEl: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
42
|
+
/** Current search term typed by the user */
|
|
43
|
+
protected searchTerm: _angular_core.WritableSignal<string>;
|
|
44
|
+
/** Whether the dropdown is open */
|
|
45
|
+
protected isOpen: _angular_core.WritableSignal<boolean>;
|
|
46
|
+
/** Index of the currently highlighted option for keyboard nav */
|
|
47
|
+
protected highlightedIndex: _angular_core.WritableSignal<number>;
|
|
48
|
+
/** The currently selected value */
|
|
49
|
+
private selectedValue;
|
|
50
|
+
/** CVA disabled state from the form */
|
|
51
|
+
private formDisabled;
|
|
52
|
+
/** Combined disabled state */
|
|
53
|
+
isDisabled: _angular_core.Signal<boolean>;
|
|
54
|
+
/** Filtered and capped options */
|
|
55
|
+
protected filteredOptions: _angular_core.Signal<T[]>;
|
|
56
|
+
/** Whether there are any results to show */
|
|
57
|
+
protected hasResults: _angular_core.Signal<boolean>;
|
|
58
|
+
private onChange;
|
|
59
|
+
private onTouched;
|
|
60
|
+
constructor();
|
|
61
|
+
writeValue(value: T | null): void;
|
|
62
|
+
registerOnChange(fn: (value: T | null) => void): void;
|
|
63
|
+
registerOnTouched(fn: () => void): void;
|
|
64
|
+
setDisabledState(isDisabled: boolean): void;
|
|
65
|
+
onInput(event: Event): void;
|
|
66
|
+
onFocus(): void;
|
|
67
|
+
onBlur(): void;
|
|
68
|
+
onOptionClick(option: T): void;
|
|
69
|
+
onKeydown(event: KeyboardEvent): void;
|
|
70
|
+
private selectOption;
|
|
71
|
+
private close;
|
|
72
|
+
private scrollToHighlighted;
|
|
73
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TnAutocompleteComponent<any>, never>;
|
|
74
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TnAutocompleteComponent<any>, "tn-autocomplete", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "displayWith": { "alias": "displayWith"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "requireSelection": { "alias": "requireSelection"; "required": false; "isSignal": true; }; "filterFn": { "alias": "filterFn"; "required": false; "isSignal": true; }; "noResultsText": { "alias": "noResultsText"; "required": false; "isSignal": true; }; "maxResults": { "alias": "maxResults"; "required": false; "isSignal": true; }; "testId": { "alias": "testId"; "required": false; "isSignal": true; }; }, { "optionSelected": "optionSelected"; }, never, never, true, never>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Harness for interacting with tn-autocomplete in tests.
|
|
79
|
+
* Provides methods for querying state, typing search text, and selecting options.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* // Find and select an option
|
|
84
|
+
* const ac = await loader.getHarness(TnAutocompleteHarness);
|
|
85
|
+
* await ac.selectOption('United States');
|
|
86
|
+
*
|
|
87
|
+
* // Type to filter, then read options
|
|
88
|
+
* await ac.setInputValue('Can');
|
|
89
|
+
* const options = await ac.getOptions();
|
|
90
|
+
* expect(options).toEqual(['Canada']);
|
|
91
|
+
*
|
|
92
|
+
* // Filter by placeholder
|
|
93
|
+
* const countryAc = await loader.getHarness(
|
|
94
|
+
* TnAutocompleteHarness.with({ placeholder: 'Search countries...' })
|
|
95
|
+
* );
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
declare class TnAutocompleteHarness extends ComponentHarness {
|
|
99
|
+
/**
|
|
100
|
+
* The selector for the host element of a `TnAutocompleteComponent` instance.
|
|
101
|
+
*/
|
|
102
|
+
static hostSelector: string;
|
|
103
|
+
private _input;
|
|
104
|
+
/**
|
|
105
|
+
* Gets a `HarnessPredicate` that can be used to search for an autocomplete
|
|
106
|
+
* with specific attributes.
|
|
107
|
+
*
|
|
108
|
+
* @param options Options for filtering which autocomplete instances are considered a match.
|
|
109
|
+
* @returns A `HarnessPredicate` configured with the given options.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* // Find by exact placeholder
|
|
114
|
+
* const ac = await loader.getHarness(
|
|
115
|
+
* TnAutocompleteHarness.with({ placeholder: 'Search countries...' })
|
|
116
|
+
* );
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
static with(options?: AutocompleteHarnessFilters): HarnessPredicate<TnAutocompleteHarness>;
|
|
120
|
+
/**
|
|
121
|
+
* Gets the current value of the input field.
|
|
122
|
+
*
|
|
123
|
+
* @returns Promise resolving to the input value.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```typescript
|
|
127
|
+
* const ac = await loader.getHarness(TnAutocompleteHarness);
|
|
128
|
+
* await ac.selectOption('Canada');
|
|
129
|
+
* expect(await ac.getInputValue()).toBe('Canada');
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
getInputValue(): Promise<string>;
|
|
133
|
+
/**
|
|
134
|
+
* Sets the value of the input by clearing and typing.
|
|
135
|
+
* This triggers filtering of the dropdown options.
|
|
136
|
+
*
|
|
137
|
+
* @param value The text to type into the input.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* const ac = await loader.getHarness(TnAutocompleteHarness);
|
|
142
|
+
* await ac.setInputValue('Can');
|
|
143
|
+
* const options = await ac.getOptions();
|
|
144
|
+
* expect(options).toEqual(['Canada']);
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
setInputValue(value: string): Promise<void>;
|
|
148
|
+
/**
|
|
149
|
+
* Gets the placeholder text of the input.
|
|
150
|
+
*
|
|
151
|
+
* @returns Promise resolving to the placeholder string, or null.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```typescript
|
|
155
|
+
* const ac = await loader.getHarness(TnAutocompleteHarness);
|
|
156
|
+
* expect(await ac.getPlaceholder()).toBe('Type to search...');
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
getPlaceholder(): Promise<string | null>;
|
|
160
|
+
/**
|
|
161
|
+
* Checks whether the dropdown is currently open.
|
|
162
|
+
*
|
|
163
|
+
* @returns Promise resolving to true if the dropdown is visible.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```typescript
|
|
167
|
+
* const ac = await loader.getHarness(TnAutocompleteHarness);
|
|
168
|
+
* expect(await ac.isOpen()).toBe(false);
|
|
169
|
+
* await ac.focus();
|
|
170
|
+
* expect(await ac.isOpen()).toBe(true);
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
173
|
+
isOpen(): Promise<boolean>;
|
|
174
|
+
/**
|
|
175
|
+
* Checks whether the autocomplete input is disabled.
|
|
176
|
+
*
|
|
177
|
+
* @returns Promise resolving to true if the input is disabled.
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```typescript
|
|
181
|
+
* const ac = await loader.getHarness(TnAutocompleteHarness);
|
|
182
|
+
* expect(await ac.isDisabled()).toBe(false);
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
isDisabled(): Promise<boolean>;
|
|
186
|
+
/**
|
|
187
|
+
* Gets the labels of all visible options in the dropdown.
|
|
188
|
+
* Opens the dropdown via focus if not already open.
|
|
189
|
+
*
|
|
190
|
+
* @returns Promise resolving to an array of option label strings.
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```typescript
|
|
194
|
+
* const ac = await loader.getHarness(TnAutocompleteHarness);
|
|
195
|
+
* await ac.setInputValue('C');
|
|
196
|
+
* const options = await ac.getOptions();
|
|
197
|
+
* expect(options).toContain('Canada');
|
|
198
|
+
* ```
|
|
199
|
+
*/
|
|
200
|
+
getOptions(): Promise<string[]>;
|
|
201
|
+
/**
|
|
202
|
+
* Selects an option by its label text. Opens the dropdown via focus if needed.
|
|
203
|
+
*
|
|
204
|
+
* @param filter The text to match against option labels. Supports string or RegExp.
|
|
205
|
+
* @returns Promise that resolves when the option has been selected.
|
|
206
|
+
* @throws Error if no matching option is found.
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```typescript
|
|
210
|
+
* const ac = await loader.getHarness(TnAutocompleteHarness);
|
|
211
|
+
*
|
|
212
|
+
* // Select by exact text
|
|
213
|
+
* await ac.selectOption('Canada');
|
|
214
|
+
*
|
|
215
|
+
* // Select by regex
|
|
216
|
+
* await ac.selectOption(/united/i);
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
selectOption(filter: string | RegExp): Promise<void>;
|
|
220
|
+
/**
|
|
221
|
+
* Focuses the autocomplete input, which opens the dropdown.
|
|
222
|
+
*
|
|
223
|
+
* @returns Promise that resolves when the input is focused.
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* ```typescript
|
|
227
|
+
* const ac = await loader.getHarness(TnAutocompleteHarness);
|
|
228
|
+
* await ac.focus();
|
|
229
|
+
* expect(await ac.isOpen()).toBe(true);
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
232
|
+
focus(): Promise<void>;
|
|
233
|
+
/**
|
|
234
|
+
* Blurs the autocomplete input, which closes the dropdown.
|
|
235
|
+
*
|
|
236
|
+
* @returns Promise that resolves when the input is blurred.
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* ```typescript
|
|
240
|
+
* const ac = await loader.getHarness(TnAutocompleteHarness);
|
|
241
|
+
* await ac.focus();
|
|
242
|
+
* await ac.blur();
|
|
243
|
+
* expect(await ac.isOpen()).toBe(false);
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
blur(): Promise<void>;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* A set of criteria that can be used to filter a list of `TnAutocompleteHarness` instances.
|
|
250
|
+
*/
|
|
251
|
+
interface AutocompleteHarnessFilters extends BaseHarnessFilters {
|
|
252
|
+
/** Filters by placeholder text. */
|
|
253
|
+
placeholder?: string;
|
|
254
|
+
}
|
|
255
|
+
|
|
16
256
|
declare enum DiskType {
|
|
17
257
|
Hdd = "HDD",
|
|
18
258
|
Ssd = "SSD"
|
|
@@ -951,6 +1191,21 @@ declare class TnExpansionPanelComponent {
|
|
|
951
1191
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TnExpansionPanelComponent, "tn-expansion-panel", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "elevation": { "alias": "elevation"; "required": false; "isSignal": true; }; "padding": { "alias": "padding"; "required": false; "isSignal": true; }; "bordered": { "alias": "bordered"; "required": false; "isSignal": true; }; "background": { "alias": "background"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "titleStyle": { "alias": "titleStyle"; "required": false; "isSignal": true; }; }, { "expandedChange": "expandedChange"; "toggleEvent": "toggleEvent"; }, never, ["[slot=title]", "*"], true, never>;
|
|
952
1192
|
}
|
|
953
1193
|
|
|
1194
|
+
/**
|
|
1195
|
+
* Directive to mark content for projection into the checkbox label area.
|
|
1196
|
+
* Use when the label needs rich content (links, icons, etc.) instead of plain text.
|
|
1197
|
+
*
|
|
1198
|
+
* @example
|
|
1199
|
+
* ```html
|
|
1200
|
+
* <tn-checkbox formControlName="terms">
|
|
1201
|
+
* <span tnCheckboxLabel>I agree to the <a href="/terms">Terms</a></span>
|
|
1202
|
+
* </tn-checkbox>
|
|
1203
|
+
* ```
|
|
1204
|
+
*/
|
|
1205
|
+
declare class TnCheckboxLabelDirective {
|
|
1206
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TnCheckboxLabelDirective, never>;
|
|
1207
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TnCheckboxLabelDirective, "[tnCheckboxLabel]", never, {}, {}, never, never, true, never>;
|
|
1208
|
+
}
|
|
954
1209
|
declare class TnCheckboxComponent implements AfterViewInit, OnDestroy, ControlValueAccessor {
|
|
955
1210
|
checkboxEl: _angular_core.Signal<ElementRef<HTMLInputElement>>;
|
|
956
1211
|
label: _angular_core.InputSignal<string>;
|
|
@@ -962,8 +1217,11 @@ declare class TnCheckboxComponent implements AfterViewInit, OnDestroy, ControlVa
|
|
|
962
1217
|
error: _angular_core.InputSignal<string | null>;
|
|
963
1218
|
checked: _angular_core.InputSignal<boolean>;
|
|
964
1219
|
change: _angular_core.OutputEmitterRef<boolean>;
|
|
1220
|
+
private labelContent;
|
|
1221
|
+
protected hasProjectedLabel: _angular_core.Signal<boolean>;
|
|
965
1222
|
id: string;
|
|
966
1223
|
private internalChecked;
|
|
1224
|
+
private cvaControlled;
|
|
967
1225
|
private formDisabled;
|
|
968
1226
|
isDisabled: _angular_core.Signal<boolean>;
|
|
969
1227
|
private focusMonitor;
|
|
@@ -979,7 +1237,182 @@ declare class TnCheckboxComponent implements AfterViewInit, OnDestroy, ControlVa
|
|
|
979
1237
|
onCheckboxChange(event: Event): void;
|
|
980
1238
|
classes: _angular_core.Signal<string[]>;
|
|
981
1239
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TnCheckboxComponent, never>;
|
|
982
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TnCheckboxComponent, "tn-checkbox", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "hideLabel": { "alias": "hideLabel"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "testId": { "alias": "testId"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; }, { "change": "change"; },
|
|
1240
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TnCheckboxComponent, "tn-checkbox", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "hideLabel": { "alias": "hideLabel"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "testId": { "alias": "testId"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; }, { "change": "change"; }, ["labelContent"], ["[tnCheckboxLabel]"], true, never>;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* Harness for interacting with tn-checkbox in tests.
|
|
1245
|
+
* Provides methods for checking, unchecking, and querying checkbox state.
|
|
1246
|
+
*
|
|
1247
|
+
* @example
|
|
1248
|
+
* ```typescript
|
|
1249
|
+
* // Find and check a checkbox
|
|
1250
|
+
* const checkbox = await loader.getHarness(TnCheckboxHarness.with({ label: 'Accept terms' }));
|
|
1251
|
+
* await checkbox.check();
|
|
1252
|
+
* expect(await checkbox.isChecked()).toBe(true);
|
|
1253
|
+
*
|
|
1254
|
+
* // Toggle a checkbox
|
|
1255
|
+
* await checkbox.toggle();
|
|
1256
|
+
* expect(await checkbox.isChecked()).toBe(false);
|
|
1257
|
+
*
|
|
1258
|
+
* // Find by testId
|
|
1259
|
+
* const terms = await loader.getHarness(TnCheckboxHarness.with({ testId: 'terms-checkbox' }));
|
|
1260
|
+
* ```
|
|
1261
|
+
*/
|
|
1262
|
+
declare class TnCheckboxHarness extends ComponentHarness {
|
|
1263
|
+
/**
|
|
1264
|
+
* The selector for the host element of a `TnCheckboxComponent` instance.
|
|
1265
|
+
*/
|
|
1266
|
+
static hostSelector: string;
|
|
1267
|
+
private _input;
|
|
1268
|
+
private _label;
|
|
1269
|
+
private _text;
|
|
1270
|
+
private _error;
|
|
1271
|
+
/**
|
|
1272
|
+
* Gets a `HarnessPredicate` that can be used to search for a checkbox
|
|
1273
|
+
* with specific attributes.
|
|
1274
|
+
*
|
|
1275
|
+
* @param options Options for filtering which checkbox instances are considered a match.
|
|
1276
|
+
* @returns A `HarnessPredicate` configured with the given options.
|
|
1277
|
+
*
|
|
1278
|
+
* @example
|
|
1279
|
+
* ```typescript
|
|
1280
|
+
* // Find by label text
|
|
1281
|
+
* const checkbox = await loader.getHarness(TnCheckboxHarness.with({ label: 'Accept' }));
|
|
1282
|
+
*
|
|
1283
|
+
* // Find by label regex
|
|
1284
|
+
* const checkbox = await loader.getHarness(TnCheckboxHarness.with({ label: /terms/i }));
|
|
1285
|
+
*
|
|
1286
|
+
* // Find by testId
|
|
1287
|
+
* const checkbox = await loader.getHarness(TnCheckboxHarness.with({ testId: 'my-checkbox' }));
|
|
1288
|
+
* ```
|
|
1289
|
+
*/
|
|
1290
|
+
static with(options?: CheckboxHarnessFilters): HarnessPredicate<TnCheckboxHarness>;
|
|
1291
|
+
/**
|
|
1292
|
+
* Gets the checkbox label text content.
|
|
1293
|
+
*
|
|
1294
|
+
* @returns Promise resolving to the label text.
|
|
1295
|
+
*
|
|
1296
|
+
* @example
|
|
1297
|
+
* ```typescript
|
|
1298
|
+
* const checkbox = await loader.getHarness(TnCheckboxHarness);
|
|
1299
|
+
* expect(await checkbox.getLabelText()).toBe('Accept terms');
|
|
1300
|
+
* ```
|
|
1301
|
+
*/
|
|
1302
|
+
getLabelText(): Promise<string>;
|
|
1303
|
+
/**
|
|
1304
|
+
* Checks whether the checkbox is currently checked.
|
|
1305
|
+
*
|
|
1306
|
+
* @returns Promise resolving to true if the checkbox is checked.
|
|
1307
|
+
*
|
|
1308
|
+
* @example
|
|
1309
|
+
* ```typescript
|
|
1310
|
+
* const checkbox = await loader.getHarness(TnCheckboxHarness);
|
|
1311
|
+
* expect(await checkbox.isChecked()).toBe(false);
|
|
1312
|
+
* ```
|
|
1313
|
+
*/
|
|
1314
|
+
isChecked(): Promise<boolean>;
|
|
1315
|
+
/**
|
|
1316
|
+
* Checks whether the checkbox is disabled.
|
|
1317
|
+
*
|
|
1318
|
+
* @returns Promise resolving to true if the checkbox is disabled.
|
|
1319
|
+
*
|
|
1320
|
+
* @example
|
|
1321
|
+
* ```typescript
|
|
1322
|
+
* const checkbox = await loader.getHarness(TnCheckboxHarness);
|
|
1323
|
+
* expect(await checkbox.isDisabled()).toBe(false);
|
|
1324
|
+
* ```
|
|
1325
|
+
*/
|
|
1326
|
+
isDisabled(): Promise<boolean>;
|
|
1327
|
+
/**
|
|
1328
|
+
* Checks whether the checkbox is required.
|
|
1329
|
+
*
|
|
1330
|
+
* @returns Promise resolving to true if the checkbox is required.
|
|
1331
|
+
*
|
|
1332
|
+
* @example
|
|
1333
|
+
* ```typescript
|
|
1334
|
+
* const checkbox = await loader.getHarness(TnCheckboxHarness);
|
|
1335
|
+
* expect(await checkbox.isRequired()).toBe(true);
|
|
1336
|
+
* ```
|
|
1337
|
+
*/
|
|
1338
|
+
isRequired(): Promise<boolean>;
|
|
1339
|
+
/**
|
|
1340
|
+
* Checks whether the checkbox is in the indeterminate state.
|
|
1341
|
+
*
|
|
1342
|
+
* @returns Promise resolving to true if the checkbox is indeterminate.
|
|
1343
|
+
*
|
|
1344
|
+
* @example
|
|
1345
|
+
* ```typescript
|
|
1346
|
+
* const checkbox = await loader.getHarness(TnCheckboxHarness);
|
|
1347
|
+
* expect(await checkbox.isIndeterminate()).toBe(false);
|
|
1348
|
+
* ```
|
|
1349
|
+
*/
|
|
1350
|
+
isIndeterminate(): Promise<boolean>;
|
|
1351
|
+
/**
|
|
1352
|
+
* Gets the test ID attribute value.
|
|
1353
|
+
*
|
|
1354
|
+
* @returns Promise resolving to the test ID string, or null.
|
|
1355
|
+
*
|
|
1356
|
+
* @example
|
|
1357
|
+
* ```typescript
|
|
1358
|
+
* const checkbox = await loader.getHarness(TnCheckboxHarness);
|
|
1359
|
+
* expect(await checkbox.getTestId()).toBe('terms-checkbox');
|
|
1360
|
+
* ```
|
|
1361
|
+
*/
|
|
1362
|
+
getTestId(): Promise<string | null>;
|
|
1363
|
+
/**
|
|
1364
|
+
* Gets the error message text, if any.
|
|
1365
|
+
*
|
|
1366
|
+
* @returns Promise resolving to the error message, or null if none.
|
|
1367
|
+
*
|
|
1368
|
+
* @example
|
|
1369
|
+
* ```typescript
|
|
1370
|
+
* const checkbox = await loader.getHarness(TnCheckboxHarness);
|
|
1371
|
+
* expect(await checkbox.getErrorText()).toBe('You must accept the terms');
|
|
1372
|
+
* ```
|
|
1373
|
+
*/
|
|
1374
|
+
getErrorText(): Promise<string | null>;
|
|
1375
|
+
/**
|
|
1376
|
+
* Checks the checkbox. No-op if already checked.
|
|
1377
|
+
*
|
|
1378
|
+
* @example
|
|
1379
|
+
* ```typescript
|
|
1380
|
+
* const checkbox = await loader.getHarness(TnCheckboxHarness);
|
|
1381
|
+
* await checkbox.check();
|
|
1382
|
+
* expect(await checkbox.isChecked()).toBe(true);
|
|
1383
|
+
* ```
|
|
1384
|
+
*/
|
|
1385
|
+
check(): Promise<void>;
|
|
1386
|
+
/**
|
|
1387
|
+
* Unchecks the checkbox. No-op if already unchecked.
|
|
1388
|
+
*
|
|
1389
|
+
* @example
|
|
1390
|
+
* ```typescript
|
|
1391
|
+
* const checkbox = await loader.getHarness(TnCheckboxHarness);
|
|
1392
|
+
* await checkbox.uncheck();
|
|
1393
|
+
* expect(await checkbox.isChecked()).toBe(false);
|
|
1394
|
+
* ```
|
|
1395
|
+
*/
|
|
1396
|
+
uncheck(): Promise<void>;
|
|
1397
|
+
/**
|
|
1398
|
+
* Toggles the checkbox checked state by clicking the label.
|
|
1399
|
+
*
|
|
1400
|
+
* @example
|
|
1401
|
+
* ```typescript
|
|
1402
|
+
* const checkbox = await loader.getHarness(TnCheckboxHarness);
|
|
1403
|
+
* await checkbox.toggle();
|
|
1404
|
+
* ```
|
|
1405
|
+
*/
|
|
1406
|
+
toggle(): Promise<void>;
|
|
1407
|
+
}
|
|
1408
|
+
/**
|
|
1409
|
+
* A set of criteria that can be used to filter a list of `TnCheckboxHarness` instances.
|
|
1410
|
+
*/
|
|
1411
|
+
interface CheckboxHarnessFilters extends BaseHarnessFilters {
|
|
1412
|
+
/** Filters by label text. Supports string or regex matching. */
|
|
1413
|
+
label?: string | RegExp;
|
|
1414
|
+
/** Filters by data-testid attribute. */
|
|
1415
|
+
testId?: string;
|
|
983
1416
|
}
|
|
984
1417
|
|
|
985
1418
|
declare class TnRadioComponent implements AfterViewInit, OnDestroy, ControlValueAccessor {
|
|
@@ -4179,5 +4612,5 @@ declare const TN_THEME_DEFINITIONS: readonly TnThemeDefinition[];
|
|
|
4179
4612
|
*/
|
|
4180
4613
|
declare const THEME_MAP: Map<TnTheme, TnThemeDefinition>;
|
|
4181
4614
|
|
|
4182
|
-
export { CommonShortcuts, DEFAULT_THEME, DiskIconComponent, DiskType, FileSizePipe, InputType, LIGHT_THEME, LinuxModifierKeys, LinuxShortcuts, ModifierKeys, QuickShortcuts, ShortcutBuilder, StripMntPrefixPipe, THEME_MAP, THEME_STORAGE_KEY, TN_THEME_DEFINITIONS, TnBannerActionDirective, TnBannerComponent, TnBannerHarness, TnBrandedSpinnerComponent, TnButtonComponent, TnButtonHarness, TnButtonToggleComponent, TnButtonToggleGroupComponent, TnCalendarComponent, TnCalendarHeaderComponent, TnCardComponent, TnCellDefDirective, TnCheckboxComponent, TnChipComponent, TnConfirmDialogComponent, TnDateInputComponent, TnDateRangeInputComponent, TnDialog, TnDialogHarness, TnDialogShellComponent, TnDialogTesting, TnDividerComponent, TnDividerDirective, TnEmptyComponent, TnEmptyHarness, TnExpansionPanelComponent, TnFilePickerComponent, TnFilePickerPopupComponent, TnFormFieldComponent, TnHeaderCellDefDirective, TnIconButtonComponent, TnIconButtonHarness, TnIconComponent, TnIconHarness, TnIconRegistryService, TnIconTesting, TnInputComponent, TnInputDirective, TnInputHarness, TnKeyboardShortcutComponent, TnKeyboardShortcutService, TnListAvatarDirective, TnListComponent, TnListIconDirective, TnListItemComponent, TnListItemLineDirective, TnListItemPrimaryDirective, TnListItemSecondaryDirective, TnListItemTitleDirective, TnListItemTrailingDirective, TnListOptionComponent, TnListSubheaderComponent, TnMenuActivateHoverDirective, TnMenuComponent, TnMenuTriggerDirective, TnMonthViewComponent, TnMultiYearViewComponent, TnNestedTreeNodeComponent, TnParticleProgressBarComponent, TnProgressBarComponent, TnRadioComponent, TnSelectComponent, TnSelectHarness, TnSelectionListComponent, TnSidePanelActionDirective, TnSidePanelComponent, TnSidePanelHarness, TnSidePanelHeaderActionDirective, TnSlideToggleComponent, TnSliderComponent, TnSliderThumbDirective, TnSliderWithLabelDirective, TnSpinnerComponent, TnSpriteLoaderService, TnStepComponent, TnStepperComponent, TnTabComponent, TnTabHarness, TnTabPanelComponent, TnTabPanelHarness, TnTableColumnDirective, TnTableComponent, TnTabsComponent, TnTabsHarness, TnTheme, TnThemeService, TnTimeInputComponent, TnTooltipComponent, TnTooltipDirective, TnTreeComponent, TnTreeFlatDataSource, TnTreeFlattener, TnTreeNodeComponent, TnTreeNodeOutletDirective, TruncatePathPipe, WindowsModifierKeys, WindowsShortcuts, createLucideLibrary, createShortcut, defaultSpriteBasePath, defaultSpriteConfigPath, libIconMarker, registerLucideIcons, setupLucideIntegration, tnIconMarker };
|
|
4183
|
-
export type { BannerHarnessFilters, ButtonHarnessFilters, CalendarCell, ChipColor, CreateFolderEvent, DateRange, DialogHarnessFilters, EmptyHarnessFilters, FilePickerCallbacks, FilePickerError, FilePickerMode, FileSystemItem, IconButtonHarnessFilters, IconHarnessFilters, IconLibrary, IconLibraryType, IconResult, IconSize, IconSource, IconTestingMockOverrides, InputHarnessFilters, KeyCombination, LabelType, LucideIconOptions, MockIconRegistry, MockSpriteLoader, PathSegment, PlatformType, ProgressBarMode, ResolvedIcon, SelectHarnessFilters, ShortcutHandler, SidePanelHarnessFilters, SlideToggleColor, SpinnerMode, SpriteConfig, TabChangeEvent, TabHarnessFilters, TabPanelHarnessFilters, TabsHarnessFilters, TnBannerType, TnButtonToggleType, TnCardAction, TnCardControl, TnCardFooterLink, TnCardHeaderStatus, TnConfirmDialogData, TnDialogDefaults, TnDialogOpenTarget, TnEmptySize, TnFlatTreeNode, TnMenuItem, TnSelectOption, TnSelectOptionGroup, TnSelectionChange, TnTableDataSource, TnThemeDefinition, TooltipPosition, YearCell };
|
|
4615
|
+
export { CommonShortcuts, DEFAULT_THEME, DiskIconComponent, DiskType, FileSizePipe, InputType, LIGHT_THEME, LinuxModifierKeys, LinuxShortcuts, ModifierKeys, QuickShortcuts, ShortcutBuilder, StripMntPrefixPipe, THEME_MAP, THEME_STORAGE_KEY, TN_THEME_DEFINITIONS, TnAutocompleteComponent, TnAutocompleteHarness, TnBannerActionDirective, TnBannerComponent, TnBannerHarness, TnBrandedSpinnerComponent, TnButtonComponent, TnButtonHarness, TnButtonToggleComponent, TnButtonToggleGroupComponent, TnCalendarComponent, TnCalendarHeaderComponent, TnCardComponent, TnCellDefDirective, TnCheckboxComponent, TnCheckboxHarness, TnCheckboxLabelDirective, TnChipComponent, TnConfirmDialogComponent, TnDateInputComponent, TnDateRangeInputComponent, TnDialog, TnDialogHarness, TnDialogShellComponent, TnDialogTesting, TnDividerComponent, TnDividerDirective, TnEmptyComponent, TnEmptyHarness, TnExpansionPanelComponent, TnFilePickerComponent, TnFilePickerPopupComponent, TnFormFieldComponent, TnHeaderCellDefDirective, TnIconButtonComponent, TnIconButtonHarness, TnIconComponent, TnIconHarness, TnIconRegistryService, TnIconTesting, TnInputComponent, TnInputDirective, TnInputHarness, TnKeyboardShortcutComponent, TnKeyboardShortcutService, TnListAvatarDirective, TnListComponent, TnListIconDirective, TnListItemComponent, TnListItemLineDirective, TnListItemPrimaryDirective, TnListItemSecondaryDirective, TnListItemTitleDirective, TnListItemTrailingDirective, TnListOptionComponent, TnListSubheaderComponent, TnMenuActivateHoverDirective, TnMenuComponent, TnMenuTriggerDirective, TnMonthViewComponent, TnMultiYearViewComponent, TnNestedTreeNodeComponent, TnParticleProgressBarComponent, TnProgressBarComponent, TnRadioComponent, TnSelectComponent, TnSelectHarness, TnSelectionListComponent, TnSidePanelActionDirective, TnSidePanelComponent, TnSidePanelHarness, TnSidePanelHeaderActionDirective, TnSlideToggleComponent, TnSliderComponent, TnSliderThumbDirective, TnSliderWithLabelDirective, TnSpinnerComponent, TnSpriteLoaderService, TnStepComponent, TnStepperComponent, TnTabComponent, TnTabHarness, TnTabPanelComponent, TnTabPanelHarness, TnTableColumnDirective, TnTableComponent, TnTabsComponent, TnTabsHarness, TnTheme, TnThemeService, TnTimeInputComponent, TnTooltipComponent, TnTooltipDirective, TnTreeComponent, TnTreeFlatDataSource, TnTreeFlattener, TnTreeNodeComponent, TnTreeNodeOutletDirective, TruncatePathPipe, WindowsModifierKeys, WindowsShortcuts, createLucideLibrary, createShortcut, defaultSpriteBasePath, defaultSpriteConfigPath, libIconMarker, registerLucideIcons, setupLucideIntegration, tnIconMarker };
|
|
4616
|
+
export type { AutocompleteHarnessFilters, BannerHarnessFilters, ButtonHarnessFilters, CalendarCell, CheckboxHarnessFilters, ChipColor, CreateFolderEvent, DateRange, DialogHarnessFilters, EmptyHarnessFilters, FilePickerCallbacks, FilePickerError, FilePickerMode, FileSystemItem, IconButtonHarnessFilters, IconHarnessFilters, IconLibrary, IconLibraryType, IconResult, IconSize, IconSource, IconTestingMockOverrides, InputHarnessFilters, KeyCombination, LabelType, LucideIconOptions, MockIconRegistry, MockSpriteLoader, PathSegment, PlatformType, ProgressBarMode, ResolvedIcon, SelectHarnessFilters, ShortcutHandler, SidePanelHarnessFilters, SlideToggleColor, SpinnerMode, SpriteConfig, TabChangeEvent, TabHarnessFilters, TabPanelHarnessFilters, TabsHarnessFilters, TnBannerType, TnButtonToggleType, TnCardAction, TnCardControl, TnCardFooterLink, TnCardHeaderStatus, TnConfirmDialogData, TnDialogDefaults, TnDialogOpenTarget, TnEmptySize, TnFlatTreeNode, TnMenuItem, TnSelectOption, TnSelectOptionGroup, TnSelectionChange, TnTableDataSource, TnThemeDefinition, TooltipPosition, YearCell };
|