@bootkit/ng0 0.0.0-alpha.26 → 0.0.0-alpha.28
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/common/index.d.ts +15 -29
- package/components/form-field/index.d.ts +24 -41
- package/components/list/index.d.ts +47 -28
- package/components/select/index.d.ts +78 -42
- package/components/sidenav/index.d.ts +1 -1
- package/fesm2022/bootkit-ng0-common.mjs +23 -36
- package/fesm2022/bootkit-ng0-common.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-form-field.mjs +47 -78
- package/fesm2022/bootkit-ng0-components-form-field.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-list.mjs +131 -108
- package/fesm2022/bootkit-ng0-components-list.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-select.mjs +261 -174
- package/fesm2022/bootkit-ng0-components-select.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-sidenav.mjs +1 -1
- package/fesm2022/bootkit-ng0-components-sidenav.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-localization.mjs +131 -67
- package/fesm2022/bootkit-ng0-localization.mjs.map +1 -1
- package/localization/index.d.ts +27 -21
- package/package.json +12 -12
package/common/index.d.ts
CHANGED
|
@@ -3,14 +3,6 @@ import { InjectionToken, TrackByFunction } from '@angular/core';
|
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
|
|
5
5
|
declare const RTL: InjectionToken<boolean>;
|
|
6
|
-
/**
|
|
7
|
-
* List item interface.
|
|
8
|
-
*/
|
|
9
|
-
interface SelectOption {
|
|
10
|
-
id: string;
|
|
11
|
-
value: any;
|
|
12
|
-
show?: boolean;
|
|
13
|
-
}
|
|
14
6
|
|
|
15
7
|
/**
|
|
16
8
|
* Represents a claim object that can contain multiple claims.
|
|
@@ -129,7 +121,7 @@ type CssClassGetter = (obj: any) => CssClass;
|
|
|
129
121
|
/**
|
|
130
122
|
* A type that represents a CSS class or a function that returns a CSS class.
|
|
131
123
|
*/
|
|
132
|
-
type CssClassLike = CssClass | CssClassGetter
|
|
124
|
+
type CssClassLike = CssClass | CssClassGetter;
|
|
133
125
|
/**
|
|
134
126
|
* Converts a CssClassLike to a CssClassGetter function.
|
|
135
127
|
* @param v The CssClassLike to convert.
|
|
@@ -162,20 +154,6 @@ declare function defaultEqualityComparer(a: any, b: any): boolean;
|
|
|
162
154
|
* @returns The converted EqualityComparer.
|
|
163
155
|
*/
|
|
164
156
|
declare function equalityComparerAttribute(e: EqualityComparerLike): EqualityComparer;
|
|
165
|
-
/**
|
|
166
|
-
* @private
|
|
167
|
-
* @param items
|
|
168
|
-
* @param value
|
|
169
|
-
* @param comparer
|
|
170
|
-
*/
|
|
171
|
-
declare function findValueByComparer(items: any[], value: any, comparer: EqualityComparer): any;
|
|
172
|
-
/**
|
|
173
|
-
* @private
|
|
174
|
-
* @param items
|
|
175
|
-
* @param values
|
|
176
|
-
* @param comparer
|
|
177
|
-
*/
|
|
178
|
-
declare function findValuesByComparer(items: any[], values: any[], comparer: EqualityComparer): any[];
|
|
179
157
|
|
|
180
158
|
/**
|
|
181
159
|
* Value writer function type.
|
|
@@ -231,19 +209,27 @@ declare function comparerAttribute(v: ComparerLike): Comparer;
|
|
|
231
209
|
/**
|
|
232
210
|
* Filter predicate function type.
|
|
233
211
|
* @param item The item to test against the filter.
|
|
212
|
+
* @param params Additional parameters to pass to the filter.
|
|
234
213
|
* @returns True if the item matches the filter, false otherwise.
|
|
235
214
|
*/
|
|
236
|
-
type FilterPredicate = (item: any) => boolean;
|
|
215
|
+
type FilterPredicate = (item: any, ...params: any[]) => boolean;
|
|
237
216
|
/**
|
|
238
217
|
* Filter predicate can be a function or a string representing the property name to filter.
|
|
239
218
|
*/
|
|
240
219
|
type FilterPredicateLike = FilterPredicate | string;
|
|
241
220
|
/**
|
|
242
|
-
*
|
|
243
|
-
* @param item
|
|
244
|
-
* @returns
|
|
221
|
+
* No-op filter predicate that always returns true.
|
|
222
|
+
* @param item The item to test against the filter.
|
|
223
|
+
* @returns true
|
|
245
224
|
*/
|
|
246
225
|
declare const noopFilter: FilterPredicate;
|
|
226
|
+
/**
|
|
227
|
+
* A simple filter predicate that checks if the item's string representation includes the match string.
|
|
228
|
+
* @param item The item to test against the filter.
|
|
229
|
+
* @param match The string to match.
|
|
230
|
+
* @returns True if the item matches the filter, false otherwise.
|
|
231
|
+
*/
|
|
232
|
+
declare const defaultFilter: FilterPredicate;
|
|
247
233
|
/**
|
|
248
234
|
* Converts a FilterPredicateLike to a FilterPredicate function.
|
|
249
235
|
* If the input is a string, it creates a predicate that checks the property with that name.
|
|
@@ -286,5 +272,5 @@ declare class IfDirective {
|
|
|
286
272
|
static ɵdir: i0.ɵɵDirectiveDeclaration<IfDirective, "[ng0If]", ["ng0If"], { "show": { "alias": "ng0If"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
287
273
|
}
|
|
288
274
|
|
|
289
|
-
export { CssClassAttribute, IdGeneratorAttribute, IfDirective, RTL, TrackByAttribute, comparerAttribute, defaultComparer, defaultEqualityComparer, defaultValueWriter, deleteEntries, equalityComparerAttribute, filterPredicateAttribute,
|
|
290
|
-
export type { Alignment, ClaimLike, ClaimObject, Comparer, ComparerLike, CssClass, CssClassGetter, CssClassLike, EqualityComparer, EqualityComparerLike, FilterPredicate, FilterPredicateLike, IdGenerator, IdGeneratorLike, MenuItem, Placement,
|
|
275
|
+
export { CssClassAttribute, IdGeneratorAttribute, IfDirective, RTL, TrackByAttribute, comparerAttribute, defaultComparer, defaultEqualityComparer, defaultFilter, defaultValueWriter, deleteEntries, equalityComparerAttribute, filterPredicateAttribute, flipPlacement, formatString, getEnumValues, noopFilter, numberArray, sequentialIdGenerator, toObservable, trackByIndex, trackByItem, valueWriterAttribute };
|
|
276
|
+
export type { Alignment, ClaimLike, ClaimObject, Comparer, ComparerLike, CssClass, CssClassGetter, CssClassLike, EqualityComparer, EqualityComparerLike, FilterPredicate, FilterPredicateLike, IdGenerator, IdGeneratorLike, MenuItem, Placement, TrackByLike, ValueWriter, ValueWriterLike };
|
|
@@ -1,66 +1,49 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { LocalizationService } from '@bootkit/ng0/localization';
|
|
2
|
+
import { AfterContentInit } from '@angular/core';
|
|
3
|
+
import { NgControl } from '@angular/forms';
|
|
5
4
|
import * as i1 from '@angular/common';
|
|
6
5
|
|
|
7
|
-
declare class FormFieldComponent implements
|
|
8
|
-
private
|
|
6
|
+
declare class FormFieldComponent implements AfterContentInit {
|
|
7
|
+
private _ngControlElement?;
|
|
9
8
|
private _destroyRef;
|
|
10
|
-
private
|
|
11
|
-
private
|
|
9
|
+
private _renderer;
|
|
10
|
+
private _localizationService;
|
|
11
|
+
protected _ngControl?: NgControl;
|
|
12
|
+
protected _status: _angular_core.WritableSignal<string>;
|
|
13
|
+
protected _hasRequiredControl: _angular_core.WritableSignal<boolean>;
|
|
14
|
+
protected _errorText: _angular_core.Signal<string | undefined>;
|
|
12
15
|
/**
|
|
13
16
|
* The label text for the form field.
|
|
14
17
|
*/
|
|
15
|
-
label: _angular_core.InputSignal<string | undefined>;
|
|
18
|
+
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
16
19
|
/**
|
|
17
20
|
* The hint text to display below the form field.
|
|
18
|
-
* This is typically used to provide additional information or instructions to the user.
|
|
19
21
|
*/
|
|
20
|
-
hint: _angular_core.InputSignal<string | undefined>;
|
|
22
|
+
readonly hint: _angular_core.InputSignal<string | undefined>;
|
|
21
23
|
/**
|
|
22
24
|
* If true, the form-field will show validation errors.
|
|
23
|
-
* This is useful for displaying validation messages when the form control is invalid.
|
|
24
25
|
*/
|
|
25
|
-
showErrors: _angular_core.
|
|
26
|
+
readonly showErrors: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
26
27
|
/**
|
|
27
|
-
* If
|
|
28
|
-
*
|
|
28
|
+
* If undefined, the indicator will be shown based on the control's required state.
|
|
29
|
+
* If true, the form-field will show a required indicator (*) next to the label (regardless of the control's required state).
|
|
30
|
+
* If false, the required indicator will not be shown (regardless of the control's required state).
|
|
29
31
|
*/
|
|
30
|
-
|
|
32
|
+
readonly showRequired: _angular_core.InputSignal<boolean | undefined>;
|
|
31
33
|
/**
|
|
32
34
|
* If true, the form-field will show subscripts (e.g. hints, errors) for the field label.
|
|
33
|
-
* This is useful for displaying additional information or validation messages.
|
|
34
35
|
*/
|
|
35
|
-
showSubscripts: _angular_core.
|
|
36
|
+
readonly showSubscripts: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
36
37
|
/**
|
|
37
38
|
* If true, the form-field will be rendered inside a ".input-group" element.
|
|
38
39
|
*/
|
|
39
|
-
inputGroup: _angular_core.
|
|
40
|
-
/**
|
|
41
|
-
* Returns the first localized error of the control
|
|
42
|
-
*/
|
|
43
|
-
get errorText(): string | undefined;
|
|
44
|
-
/** Reports whether the control is touched. */
|
|
45
|
-
get touched(): boolean | null | undefined;
|
|
46
|
-
/** Reports whether the control is dirty. */
|
|
47
|
-
get dirty(): boolean | null | undefined;
|
|
48
|
-
/** Returns true if this form-field is required, otherwise returns false. */
|
|
49
|
-
get isRequired(): boolean;
|
|
50
|
-
private _onFocusOut;
|
|
51
|
-
private _ngControl?;
|
|
52
|
-
private _ngControlElement?;
|
|
53
|
-
private _isRequired;
|
|
54
|
-
private _locale?;
|
|
55
|
-
private _errorText?;
|
|
56
|
-
constructor(_renderer: Renderer2, _destroyRef: DestroyRef, _form: NgForm, _ls: LocalizationService);
|
|
57
|
-
ngOnInit(): void;
|
|
40
|
+
readonly inputGroup: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
58
41
|
ngAfterContentInit(): void;
|
|
59
|
-
private
|
|
60
|
-
private
|
|
61
|
-
|
|
62
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormFieldComponent,
|
|
63
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormFieldComponent, "ng0-form-field, ng0-field", ["ng0FormField"], { "label": { "alias": "label"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "showErrors": { "alias": "showErrors"; "required": false; "isSignal": true; }; "
|
|
42
|
+
private _isControlRequired;
|
|
43
|
+
private _updateControlStyles;
|
|
44
|
+
private _onFocusOut;
|
|
45
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormFieldComponent, never>;
|
|
46
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormFieldComponent, "ng0-form-field, ng0-field", ["ng0FormField"], { "label": { "alias": "label"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "showErrors": { "alias": "showErrors"; "required": false; "isSignal": true; }; "showRequired": { "alias": "showRequired"; "required": false; "isSignal": true; }; "showSubscripts": { "alias": "showSubscripts"; "required": false; "isSignal": true; }; "inputGroup": { "alias": "inputGroup"; "required": false; "isSignal": true; }; }, {}, ["_ngControlElement", "_ngControl"], ["*"], true, never>;
|
|
64
47
|
}
|
|
65
48
|
|
|
66
49
|
declare class FormFieldModule {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as _bootkit_ng0_localization from '@bootkit/ng0/localization';
|
|
2
2
|
import * as _bootkit_ng0_common from '@bootkit/ng0/common';
|
|
3
3
|
import * as _angular_core from '@angular/core';
|
|
4
|
-
import { ElementRef, TemplateRef, EventEmitter } from '@angular/core';
|
|
4
|
+
import { ElementRef, TemplateRef, QueryList, EventEmitter } from '@angular/core';
|
|
5
5
|
import { DataSource, DataSourceLike } from '@bootkit/ng0/data';
|
|
6
6
|
import { ControlValueAccessor } from '@angular/forms';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* ListItem represents an individual item within a ListComponent.
|
|
10
10
|
*/
|
|
11
|
-
declare class
|
|
11
|
+
declare class ListItem {
|
|
12
12
|
/**
|
|
13
13
|
* The value associated with the item. This can be of any type.
|
|
14
14
|
*/
|
|
@@ -63,8 +63,8 @@ declare class ListItemComponent {
|
|
|
63
63
|
*/
|
|
64
64
|
focus(): void;
|
|
65
65
|
private _getTabIndex;
|
|
66
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
67
|
-
static
|
|
66
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ListItem, never>;
|
|
67
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ListItem, "ng0-list-item", ["ng0ListItem"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/**
|
|
@@ -74,15 +74,19 @@ declare class ListItemComponent {
|
|
|
74
74
|
declare class ListComponent implements ControlValueAccessor {
|
|
75
75
|
private _localizationService;
|
|
76
76
|
private _changeDetector;
|
|
77
|
-
private _value;
|
|
78
77
|
private _changeCallback?;
|
|
79
78
|
private _touchCallback?;
|
|
79
|
+
private readonly _selectedItems;
|
|
80
80
|
protected readonly _sourceItems: _angular_core.WritableSignal<any[]>;
|
|
81
|
-
|
|
82
|
-
protected readonly _activeItem: _angular_core.WritableSignal<
|
|
83
|
-
private readonly _visibleItems;
|
|
81
|
+
protected _itemTemplate?: TemplateRef<any>;
|
|
82
|
+
protected readonly _activeItem: _angular_core.WritableSignal<ListItem | undefined>;
|
|
84
83
|
protected readonly _isDisabled: _angular_core.WritableSignal<boolean>;
|
|
85
|
-
|
|
84
|
+
private readonly _value;
|
|
85
|
+
private _renderer;
|
|
86
|
+
/**
|
|
87
|
+
* A list of all visible list items.
|
|
88
|
+
*/
|
|
89
|
+
readonly listItems?: QueryList<ListItem>;
|
|
86
90
|
/**
|
|
87
91
|
* Reference to the host element
|
|
88
92
|
*/
|
|
@@ -103,22 +107,22 @@ declare class ListComponent implements ControlValueAccessor {
|
|
|
103
107
|
*/
|
|
104
108
|
readonly showSelectionIndicator: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
105
109
|
/**
|
|
106
|
-
* A
|
|
110
|
+
* A comparer to compare items for selection.
|
|
111
|
+
* Default uses strict equality (===).
|
|
107
112
|
*/
|
|
108
113
|
readonly compareBy: _angular_core.InputSignalWithTransform<_bootkit_ng0_common.EqualityComparer, _bootkit_ng0_common.EqualityComparerLike>;
|
|
109
114
|
/**
|
|
110
|
-
*
|
|
115
|
+
* A fromatter to convert each item to a string for display.
|
|
111
116
|
* Default converts the item to a string using its toString method.
|
|
112
117
|
*/
|
|
113
118
|
readonly formatBy: _angular_core.InputSignalWithTransform<_bootkit_ng0_localization.ObjectFormatter, _bootkit_ng0_localization.ObjectFormatterLike>;
|
|
114
119
|
/**
|
|
115
|
-
* Custom value
|
|
120
|
+
* Custom value writer to extract the value of any object while writing values.
|
|
116
121
|
*/
|
|
117
122
|
readonly writeBy: _angular_core.InputSignalWithTransform<_bootkit_ng0_common.ValueWriter, _bootkit_ng0_common.ValueWriterLike>;
|
|
118
123
|
/**
|
|
119
|
-
*
|
|
120
|
-
* Default
|
|
121
|
-
* The filter predicate can be a function or a string representing the property name to filter.
|
|
124
|
+
* Custom filter function to filter items.
|
|
125
|
+
* Default is a noop filter that does not filter any items.
|
|
122
126
|
*/
|
|
123
127
|
readonly filterBy: _angular_core.InputSignalWithTransform<_bootkit_ng0_common.FilterPredicate, _bootkit_ng0_common.FilterPredicateLike>;
|
|
124
128
|
/**
|
|
@@ -140,7 +144,7 @@ declare class ListComponent implements ControlValueAccessor {
|
|
|
140
144
|
* CSS class or classes to apply to the list container.
|
|
141
145
|
* Default is undefined.
|
|
142
146
|
*/
|
|
143
|
-
readonly itemClass: _angular_core.InputSignalWithTransform<_bootkit_ng0_common.CssClassGetter, _bootkit_ng0_common.CssClassLike>;
|
|
147
|
+
readonly itemClass: _angular_core.InputSignalWithTransform<_bootkit_ng0_common.CssClassGetter | undefined, _bootkit_ng0_common.CssClassLike>;
|
|
144
148
|
/**
|
|
145
149
|
* Defines the focus behavior of the list component.
|
|
146
150
|
* - 'none': No keyboard interaction is possible. The list cannot be focused.
|
|
@@ -148,7 +152,7 @@ declare class ListComponent implements ControlValueAccessor {
|
|
|
148
152
|
* - 'activeDescendant': The list can be focused, but no item is tabbable. The active item is indicated using aria-activedescendant.
|
|
149
153
|
* @default 'activeDescendant'.
|
|
150
154
|
*/
|
|
151
|
-
readonly
|
|
155
|
+
readonly focusMode: _angular_core.InputSignal<"none" | "roving" | "activeDescendant">;
|
|
152
156
|
/**
|
|
153
157
|
* A function that generates unique ids for each item in the list.
|
|
154
158
|
* If set to a function, it will be called with the item as an argument to generate the id.
|
|
@@ -159,15 +163,18 @@ declare class ListComponent implements ControlValueAccessor {
|
|
|
159
163
|
/**
|
|
160
164
|
* Event emitted when the selection state of an item changes by user interaction.
|
|
161
165
|
*/
|
|
162
|
-
readonly
|
|
163
|
-
|
|
166
|
+
readonly itemSelect: EventEmitter<ListItemSelectEvent>;
|
|
167
|
+
/**
|
|
168
|
+
* The template to use for each item in the list.
|
|
169
|
+
*/
|
|
170
|
+
readonly itemTemplate: _angular_core.InputSignal<TemplateRef<any> | undefined>;
|
|
164
171
|
constructor();
|
|
165
172
|
/**
|
|
166
173
|
* Indicates whether an item is active.
|
|
167
174
|
* @param item
|
|
168
175
|
* @returns
|
|
169
176
|
*/
|
|
170
|
-
isActive(item:
|
|
177
|
+
isActive(item: ListItem): boolean;
|
|
171
178
|
/**
|
|
172
179
|
* Indicates whether the given value is selected.
|
|
173
180
|
* @param item
|
|
@@ -197,30 +204,42 @@ declare class ListComponent implements ControlValueAccessor {
|
|
|
197
204
|
* Selects all items in the list. Only applicable in multiple selection mode.
|
|
198
205
|
*/
|
|
199
206
|
selectAll(): void;
|
|
207
|
+
/**
|
|
208
|
+
* Gets the current value(s) of the list.
|
|
209
|
+
*/
|
|
210
|
+
get value(): ReadonlyArray<any | any[]>;
|
|
211
|
+
/**
|
|
212
|
+
* Gets the current items in the list.
|
|
213
|
+
*/
|
|
214
|
+
get items(): ReadonlyArray<any[]>;
|
|
200
215
|
writeValue(value: any): void;
|
|
201
216
|
registerOnChange(fn: any): void;
|
|
202
217
|
registerOnTouched(fn: any): void;
|
|
203
218
|
setDisabledState?(isDisabled: boolean): void;
|
|
204
|
-
protected _handleUserSelection(item:
|
|
219
|
+
protected _handleUserSelection(item: ListItem, index: number): void;
|
|
205
220
|
protected _showLoadingSppiner: _angular_core.Signal<boolean>;
|
|
206
|
-
private
|
|
221
|
+
private _updateSelectedItems;
|
|
222
|
+
private _activateFirstSelectedItem;
|
|
207
223
|
private _updateValue;
|
|
208
224
|
private _hostAriaActiveDescendant;
|
|
209
225
|
private _hostTabIndex;
|
|
210
|
-
private _onHostClick;
|
|
211
226
|
private _onHostBlur;
|
|
212
227
|
private _onKeydown;
|
|
213
228
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ListComponent, never>;
|
|
214
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ListComponent, "ng0-list", ["ng0List"], { "source": { "alias": "source"; "required": true; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "showSelectionIndicator": { "alias": "showSelectionIndicator"; "required": false; "isSignal": true; }; "compareBy": { "alias": "compareBy"; "required": false; "isSignal": true; }; "formatBy": { "alias": "formatBy"; "required": false; "isSignal": true; }; "writeBy": { "alias": "writeBy"; "required": false; "isSignal": true; }; "filterBy": { "alias": "filterBy"; "required": false; "isSignal": true; }; "trackBy": { "alias": "trackBy"; "required": false; "isSignal": true; }; "itemClass": { "alias": "itemClass"; "required": false; "isSignal": true; }; "
|
|
229
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ListComponent, "ng0-list, ng0-select-list", ["ng0List"], { "source": { "alias": "source"; "required": true; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "showSelectionIndicator": { "alias": "showSelectionIndicator"; "required": false; "isSignal": true; }; "compareBy": { "alias": "compareBy"; "required": false; "isSignal": true; }; "formatBy": { "alias": "formatBy"; "required": false; "isSignal": true; }; "writeBy": { "alias": "writeBy"; "required": false; "isSignal": true; }; "filterBy": { "alias": "filterBy"; "required": false; "isSignal": true; }; "trackBy": { "alias": "trackBy"; "required": false; "isSignal": true; }; "itemClass": { "alias": "itemClass"; "required": false; "isSignal": true; }; "focusMode": { "alias": "focusMode"; "required": false; "isSignal": true; }; "idGenerator": { "alias": "idGenerator"; "required": false; "isSignal": true; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; "isSignal": true; }; }, { "itemSelect": "itemSelect"; }, ["_itemTemplate"], never, true, never>;
|
|
215
230
|
}
|
|
216
231
|
/**
|
|
217
232
|
* Event emitted when the selection state of the list changes by user interaction.
|
|
218
233
|
*/
|
|
219
|
-
interface
|
|
234
|
+
interface ListItemSelectEvent {
|
|
235
|
+
/**
|
|
236
|
+
* The value of the item that was selected or deselected.
|
|
237
|
+
*/
|
|
238
|
+
value: any;
|
|
220
239
|
/**
|
|
221
240
|
* The item that was selected or deselected.
|
|
222
241
|
*/
|
|
223
|
-
readonly item:
|
|
242
|
+
readonly item: ListItem;
|
|
224
243
|
/**
|
|
225
244
|
* The list component that emitted the event.
|
|
226
245
|
*/
|
|
@@ -237,4 +256,4 @@ declare class ListModule {
|
|
|
237
256
|
}
|
|
238
257
|
|
|
239
258
|
export { ListComponent, ListModule };
|
|
240
|
-
export type {
|
|
259
|
+
export type { ListItemSelectEvent };
|
|
@@ -1,114 +1,149 @@
|
|
|
1
1
|
import * as _bootkit_ng0_localization from '@bootkit/ng0/localization';
|
|
2
2
|
import * as _bootkit_ng0_common from '@bootkit/ng0/common';
|
|
3
|
-
import { SelectOption, FilterPredicate, IdGenerator } from '@bootkit/ng0/common';
|
|
4
3
|
import * as _angular_core from '@angular/core';
|
|
5
|
-
import {
|
|
4
|
+
import { ElementRef, TemplateRef, EventEmitter } from '@angular/core';
|
|
6
5
|
import { DataSource, DataSourceLike } from '@bootkit/ng0/data';
|
|
7
6
|
import { ControlValueAccessor } from '@angular/forms';
|
|
8
7
|
import { FlexibleConnectedPositionStrategy, ScrollStrategy } from '@angular/cdk/overlay';
|
|
9
|
-
import {
|
|
8
|
+
import { ListItemSelectEvent } from '@bootkit/ng0/components/list';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* Select component that allows users to choose an option from a dropdown list.
|
|
13
12
|
*/
|
|
14
|
-
declare class SelectComponent implements
|
|
15
|
-
private _resizeObserver?;
|
|
16
|
-
private _resizeObserverInitialized;
|
|
13
|
+
declare class SelectComponent implements ControlValueAccessor {
|
|
17
14
|
private _viewpoerRulerSubscription?;
|
|
18
15
|
private _filterElementRef?;
|
|
19
16
|
private _listComponent?;
|
|
20
17
|
private _changeCallback;
|
|
21
18
|
private _touchCallback;
|
|
22
|
-
protected readonly
|
|
19
|
+
protected readonly _sourceItems: _angular_core.WritableSignal<any[] | undefined>;
|
|
20
|
+
protected readonly _selectedItems: Set<any>;
|
|
23
21
|
protected readonly _isDisabled: _angular_core.WritableSignal<boolean>;
|
|
24
|
-
protected readonly _activeOptionIndex: _angular_core.WritableSignal<number>;
|
|
25
|
-
protected _optionTemplate?: TemplateRef<any>;
|
|
26
22
|
protected _positionStrategy: FlexibleConnectedPositionStrategy;
|
|
27
23
|
protected _scrollStrategy: ScrollStrategy;
|
|
28
24
|
private _overlay;
|
|
29
|
-
private
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
protected _el: ElementRef<any>;
|
|
25
|
+
private _localizationService;
|
|
26
|
+
protected _elementRef: ElementRef<any>;
|
|
27
|
+
protected readonly _filterValue: _angular_core.WritableSignal<string>;
|
|
33
28
|
private _renderer;
|
|
34
29
|
private _viewportRuler;
|
|
35
|
-
private
|
|
36
|
-
private
|
|
30
|
+
private _changeDetectorRef;
|
|
31
|
+
private readonly _value;
|
|
32
|
+
/**
|
|
33
|
+
* Template for rendering each item in the select component.
|
|
34
|
+
*/
|
|
35
|
+
itemTemplate?: TemplateRef<any>;
|
|
37
36
|
/**
|
|
38
37
|
* The data source for the select component.
|
|
39
38
|
* This can be an array of data, a function that returns an observable of data,
|
|
40
39
|
* or an instance of DataSource.
|
|
41
40
|
*/
|
|
42
41
|
readonly source: _angular_core.InputSignalWithTransform<DataSource<any>, DataSourceLike<any>>;
|
|
43
|
-
/**
|
|
44
|
-
* Value of the select component.
|
|
45
|
-
*/
|
|
46
|
-
value: _angular_core.ModelSignal<any>;
|
|
47
42
|
/**
|
|
48
43
|
* Indicates whether multi selection is enabled or not.
|
|
49
44
|
*/
|
|
50
45
|
readonly multiple: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
46
|
+
/**
|
|
47
|
+
* Indicates whether to show selection indicator (checkbox/radio) next to each item.
|
|
48
|
+
* Default is false.
|
|
49
|
+
*/
|
|
50
|
+
readonly showSelectionIndicator: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
51
51
|
/**
|
|
52
52
|
* Indicates whether the dropdown is open or closed.
|
|
53
53
|
*/
|
|
54
54
|
readonly open: _angular_core.ModelSignal<boolean>;
|
|
55
55
|
/**
|
|
56
|
-
* A
|
|
56
|
+
* A comparer to compare items for selection.
|
|
57
57
|
*/
|
|
58
58
|
readonly compareBy: _angular_core.InputSignalWithTransform<_bootkit_ng0_common.EqualityComparer, _bootkit_ng0_common.EqualityComparerLike>;
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
61
|
-
* Default converts the item to a string using its toString method.
|
|
60
|
+
* A fromatter to convert each item to a string for display.
|
|
62
61
|
*/
|
|
63
62
|
readonly formatBy: _angular_core.InputSignalWithTransform<_bootkit_ng0_localization.ObjectFormatter, _bootkit_ng0_localization.ObjectFormatterLike>;
|
|
64
63
|
/**
|
|
65
|
-
* Custom value writer
|
|
64
|
+
* Custom value writer to extract the value of any object while writing values.
|
|
66
65
|
*/
|
|
67
66
|
readonly writeBy: _angular_core.InputSignalWithTransform<_bootkit_ng0_common.ValueWriter, _bootkit_ng0_common.ValueWriterLike>;
|
|
68
67
|
/**
|
|
69
68
|
* Indicates whether the select component is filterable.
|
|
70
69
|
*/
|
|
71
70
|
readonly filterable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
72
|
-
/**
|
|
73
|
-
* Placeholder text for the filter input field.
|
|
74
|
-
*/
|
|
75
|
-
readonly filterPlaceholder: _angular_core.InputSignal<string>;
|
|
76
71
|
/**
|
|
77
72
|
* Custom filter function to filter items based on a filter value.
|
|
78
73
|
* Default checks if the item contains the filter value (case-insensitive).
|
|
79
74
|
*/
|
|
80
|
-
readonly filterBy: _angular_core.
|
|
75
|
+
readonly filterBy: _angular_core.InputSignalWithTransform<_bootkit_ng0_common.FilterPredicate, _bootkit_ng0_common.FilterPredicateLike>;
|
|
76
|
+
/**
|
|
77
|
+
* Placeholder text for the filter input field.
|
|
78
|
+
*/
|
|
79
|
+
readonly filterPlaceholder: _angular_core.InputSignal<string | undefined>;
|
|
81
80
|
/**
|
|
82
81
|
* CSS class or classes to apply to the items.
|
|
83
82
|
*/
|
|
84
|
-
readonly itemClass: _angular_core.InputSignalWithTransform<_bootkit_ng0_common.CssClassGetter, _bootkit_ng0_common.CssClassLike>;
|
|
83
|
+
readonly itemClass: _angular_core.InputSignalWithTransform<_bootkit_ng0_common.CssClassGetter | undefined, _bootkit_ng0_common.CssClassLike>;
|
|
85
84
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* If set to undefined, no ids will be generated.
|
|
85
|
+
* A function that generates unique ids for each item in the list.
|
|
86
|
+
* If set to a function, it will be called with the item as an argument to generate the id.
|
|
87
|
+
* If set to undefined, no ids will be generated for the items.
|
|
88
|
+
* @default undefined
|
|
89
89
|
*/
|
|
90
|
-
readonly idGenerator: _angular_core.
|
|
90
|
+
readonly idGenerator: _angular_core.InputSignalWithTransform<_bootkit_ng0_common.IdGenerator | undefined, _bootkit_ng0_common.IdGeneratorLike>;
|
|
91
|
+
/**
|
|
92
|
+
* Event emitted when the selected value changes.
|
|
93
|
+
*/
|
|
94
|
+
readonly valueChange: EventEmitter<SelectItemEvent>;
|
|
91
95
|
constructor();
|
|
92
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Indicates whether the given value is selected.
|
|
98
|
+
* @param item
|
|
99
|
+
* @returns
|
|
100
|
+
*/
|
|
101
|
+
isSelected(value: any): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Selects the given value.
|
|
104
|
+
* @param item
|
|
105
|
+
*/
|
|
106
|
+
select(value: any): void;
|
|
107
|
+
/**
|
|
108
|
+
* Deselects the given value.
|
|
109
|
+
* @param item
|
|
110
|
+
*/
|
|
111
|
+
deselect(value: any): void;
|
|
112
|
+
/**
|
|
113
|
+
* Toggles the selection state of the given value.
|
|
114
|
+
* @param item
|
|
115
|
+
*/
|
|
116
|
+
toggle(value: any): void;
|
|
93
117
|
writeValue(obj: any): void;
|
|
94
118
|
registerOnChange(fn: any): void;
|
|
95
119
|
registerOnTouched(fn: any): void;
|
|
96
120
|
setDisabledState?(isDisabled: boolean): void;
|
|
97
|
-
|
|
121
|
+
private _findAndSelectItems;
|
|
122
|
+
private _updateValue;
|
|
98
123
|
protected _onOverlayAttach(): void;
|
|
99
124
|
protected _onOverlayDetach(): void;
|
|
100
|
-
protected _onListSelectionChange(e:
|
|
101
|
-
protected
|
|
125
|
+
protected _onListSelectionChange(e: ListItemSelectEvent): void;
|
|
126
|
+
protected _filterPredicate: _angular_core.Signal<(item: any) => boolean>;
|
|
127
|
+
protected _onFilterKeydown(e: KeyboardEvent): void;
|
|
102
128
|
private _listenToResizeEvents;
|
|
103
129
|
private _unlistenFromResizeEvents;
|
|
104
|
-
private _selectFirst;
|
|
105
|
-
private _selectLast;
|
|
106
|
-
private _selectNext;
|
|
107
|
-
private _selectPrevious;
|
|
108
130
|
private _onHostKeydown;
|
|
109
131
|
private _onHostClick;
|
|
110
132
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectComponent, never>;
|
|
111
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectComponent, "ng0-select", ["ng0Select"], { "source": { "alias": "source"; "required": true; "isSignal": true; }; "
|
|
133
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectComponent, "ng0-select", ["ng0Select"], { "source": { "alias": "source"; "required": true; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "showSelectionIndicator": { "alias": "showSelectionIndicator"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; "compareBy": { "alias": "compareBy"; "required": false; "isSignal": true; }; "formatBy": { "alias": "formatBy"; "required": false; "isSignal": true; }; "writeBy": { "alias": "writeBy"; "required": false; "isSignal": true; }; "filterable": { "alias": "filterable"; "required": false; "isSignal": true; }; "filterBy": { "alias": "filterBy"; "required": false; "isSignal": true; }; "filterPlaceholder": { "alias": "filterPlaceholder"; "required": false; "isSignal": true; }; "itemClass": { "alias": "itemClass"; "required": false; "isSignal": true; }; "idGenerator": { "alias": "idGenerator"; "required": false; "isSignal": true; }; }, { "open": "openChange"; "valueChange": "valueChange"; }, ["itemTemplate"], never, true, never>;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Event emitted when the selection state of the select component changes by user interaction.
|
|
137
|
+
*/
|
|
138
|
+
interface SelectItemEvent {
|
|
139
|
+
/**
|
|
140
|
+
* The value of the item that was selected or deselected.
|
|
141
|
+
*/
|
|
142
|
+
value: any;
|
|
143
|
+
/**
|
|
144
|
+
* The select component that emitted the event.
|
|
145
|
+
*/
|
|
146
|
+
readonly select: SelectComponent;
|
|
112
147
|
}
|
|
113
148
|
|
|
114
149
|
/**
|
|
@@ -121,3 +156,4 @@ declare class SelectModule {
|
|
|
121
156
|
}
|
|
122
157
|
|
|
123
158
|
export { SelectComponent, SelectModule };
|
|
159
|
+
export type { SelectItemEvent };
|
|
@@ -15,7 +15,7 @@ declare class SidenavComponent implements OnInit, OnDestroy {
|
|
|
15
15
|
private _renderer;
|
|
16
16
|
open: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
17
17
|
mode: _angular_core.InputSignal<SidenavMode>;
|
|
18
|
-
hasBackdrop: _angular_core.
|
|
18
|
+
hasBackdrop: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
19
19
|
zIndex: _angular_core.InputSignal<number | undefined>;
|
|
20
20
|
position: _angular_core.InputSignal<SidenavPosition>;
|
|
21
21
|
sidenavWidth: _angular_core.InputSignal<number>;
|
|
@@ -157,37 +157,6 @@ function equalityComparerAttribute(e) {
|
|
|
157
157
|
}
|
|
158
158
|
throw Error('invalid equality comparer');
|
|
159
159
|
}
|
|
160
|
-
/**
|
|
161
|
-
* @private
|
|
162
|
-
* @param items
|
|
163
|
-
* @param value
|
|
164
|
-
* @param comparer
|
|
165
|
-
*/
|
|
166
|
-
function findValueByComparer(items, value, comparer) {
|
|
167
|
-
if (!items || items.length === 0 || value === undefined || value === null) {
|
|
168
|
-
return undefined;
|
|
169
|
-
}
|
|
170
|
-
return items.find(i => comparer(i, value));
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* @private
|
|
174
|
-
* @param items
|
|
175
|
-
* @param values
|
|
176
|
-
* @param comparer
|
|
177
|
-
*/
|
|
178
|
-
function findValuesByComparer(items, values, comparer) {
|
|
179
|
-
if (!items || items.length === 0 || !values || values.length === 0) {
|
|
180
|
-
return [];
|
|
181
|
-
}
|
|
182
|
-
const result = [];
|
|
183
|
-
for (let v of values) {
|
|
184
|
-
const item = items.find(i => comparer(i, v));
|
|
185
|
-
if (item) {
|
|
186
|
-
result.push(item);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return result;
|
|
190
|
-
}
|
|
191
160
|
|
|
192
161
|
/**
|
|
193
162
|
* Default value writer function.
|
|
@@ -235,11 +204,26 @@ function comparerAttribute(v) {
|
|
|
235
204
|
}
|
|
236
205
|
|
|
237
206
|
/**
|
|
238
|
-
*
|
|
239
|
-
* @param item
|
|
240
|
-
* @returns
|
|
207
|
+
* No-op filter predicate that always returns true.
|
|
208
|
+
* @param item The item to test against the filter.
|
|
209
|
+
* @returns true
|
|
241
210
|
*/
|
|
242
|
-
const noopFilter = (item) => true;
|
|
211
|
+
const noopFilter = (item, ...params) => true;
|
|
212
|
+
/**
|
|
213
|
+
* A simple filter predicate that checks if the item's string representation includes the match string.
|
|
214
|
+
* @param item The item to test against the filter.
|
|
215
|
+
* @param match The string to match.
|
|
216
|
+
* @returns True if the item matches the filter, false otherwise.
|
|
217
|
+
*/
|
|
218
|
+
const defaultFilter = (item, match) => {
|
|
219
|
+
if (match == undefined || match == '') {
|
|
220
|
+
return true;
|
|
221
|
+
}
|
|
222
|
+
if (item == undefined) {
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
return item.toString().toLowerCase().includes(match.toLowerCase());
|
|
226
|
+
};
|
|
243
227
|
/**
|
|
244
228
|
* Converts a FilterPredicateLike to a FilterPredicate function.
|
|
245
229
|
* If the input is a string, it creates a predicate that checks the property with that name.
|
|
@@ -249,6 +233,9 @@ const noopFilter = (item) => true;
|
|
|
249
233
|
function filterPredicateAttribute(v) {
|
|
250
234
|
if (typeof v === 'function')
|
|
251
235
|
return v;
|
|
236
|
+
else if (typeof v === 'string') {
|
|
237
|
+
return (item, match) => item != null && Object.hasOwn(item, v) ? defaultFilter(item[v], match) : false;
|
|
238
|
+
}
|
|
252
239
|
throw Error('invalid filter predicate');
|
|
253
240
|
}
|
|
254
241
|
|
|
@@ -325,5 +312,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
|
|
|
325
312
|
* Generated bundle index. Do not edit.
|
|
326
313
|
*/
|
|
327
314
|
|
|
328
|
-
export { CssClassAttribute, IdGeneratorAttribute, IfDirective, RTL, TrackByAttribute, comparerAttribute, defaultComparer, defaultEqualityComparer, defaultValueWriter, deleteEntries, equalityComparerAttribute, filterPredicateAttribute,
|
|
315
|
+
export { CssClassAttribute, IdGeneratorAttribute, IfDirective, RTL, TrackByAttribute, comparerAttribute, defaultComparer, defaultEqualityComparer, defaultFilter, defaultValueWriter, deleteEntries, equalityComparerAttribute, filterPredicateAttribute, flipPlacement, formatString, getEnumValues, noopFilter, numberArray, sequentialIdGenerator, toObservable, trackByIndex, trackByItem, valueWriterAttribute };
|
|
329
316
|
//# sourceMappingURL=bootkit-ng0-common.mjs.map
|