@ardium-ui/ui 5.0.0-alpha.25 → 5.0.0-alpha.27
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/ardium-ui-ui.mjs +398 -408
- package/fesm2022/ardium-ui-ui.mjs.map +1 -1
- package/lib/_internal/item-storages/dropdown-item-storage.d.ts +16 -18
- package/lib/_internal/item-storages/simple-item-storage.d.ts +15 -12
- package/lib/_internal/item-storages/simplest-item-storage.d.ts +1 -1
- package/lib/_internal/selectable-list-component.d.ts +2 -3
- package/lib/checkbox-list/checkbox-list.component.d.ts +2 -3
- package/lib/inputs/autocomplete-input/autocomplete-input.component.d.ts +2 -2
- package/lib/select/select.component.d.ts +6 -8
- package/lib/select/select.types.d.ts +4 -2
- package/lib/slider/range-slider/range-slider.component.d.ts +1 -1
- package/lib/types/item-storage.types.d.ts +15 -17
- package/package.json +1 -1
- package/prebuilt-themes/default/buttons/button.css.map +1 -1
- package/prebuilt-themes/default/buttons/fab.css.map +1 -1
- package/prebuilt-themes/default/buttons/icon-button.css.map +1 -1
- package/prebuilt-themes/default/calendar.css.map +1 -1
- package/prebuilt-themes/default/card.css.map +1 -1
- package/prebuilt-themes/default/chips.css.map +1 -1
- package/prebuilt-themes/default/core.css +1 -0
- package/prebuilt-themes/default/core.css.map +1 -1
- package/prebuilt-themes/default/dropdown-panel.css.map +1 -1
- package/prebuilt-themes/default/form-field-frame.css.map +1 -1
- package/prebuilt-themes/default/form-field.css.map +1 -1
- package/prebuilt-themes/default/inputs/autocomplete-input.css.map +1 -1
- package/prebuilt-themes/default/inputs/color-input.css.map +1 -1
- package/prebuilt-themes/default/inputs/digit-input.css.map +1 -1
- package/prebuilt-themes/default/inputs/file-input.css.map +1 -1
- package/prebuilt-themes/default/inputs/hex-input.css.map +1 -1
- package/prebuilt-themes/default/inputs/input.css.map +1 -1
- package/prebuilt-themes/default/inputs/search-bar.css.map +1 -1
- package/prebuilt-themes/default/modal.css.map +1 -1
- package/prebuilt-themes/default/progress-circle.css.map +1 -1
- package/prebuilt-themes/default/segment.css +70 -57
- package/prebuilt-themes/default/segment.css.map +1 -1
- package/prebuilt-themes/default/select.css +6 -2
- package/prebuilt-themes/default/select.css.map +1 -1
- package/prebuilt-themes/default/slide-toggle.css.map +1 -1
- package/prebuilt-themes/default/slider.css +88 -49
- package/prebuilt-themes/default/slider.css.map +1 -1
- package/prebuilt-themes/default/stars.css.map +1 -1
- package/prebuilt-themes/default/table.css.map +1 -1
- package/themes/_variables.scss +1 -0
- package/themes/default/core.scss +1 -0
- package/themes/default/segment.scss +75 -67
- package/themes/default/select.scss +7 -2
- package/themes/default/slider.scss +88 -53
|
@@ -2,10 +2,10 @@ import 'first-last';
|
|
|
2
2
|
import { Overlay, ScrollStrategyOptions, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
3
3
|
import { TemplatePortal, ComponentPortal } from '@angular/cdk/portal';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { signal, computed, InjectionToken, input, Directive, Input, HostBinding, output, ViewChildren, inject, Injector, runInInjectionContext, viewChild, contentChild, Component, ViewEncapsulation, ChangeDetectionStrategy, Inject, ViewContainerRef, TemplateRef, forwardRef, HostListener, NgModule, effect, viewChildren, Pipe, model, ElementRef, ChangeDetectorRef, ContentChildren,
|
|
5
|
+
import { signal, computed, InjectionToken, input, Directive, Input, HostBinding, output, ViewChildren, inject, Injector, runInInjectionContext, viewChild, contentChild, Component, ViewEncapsulation, ChangeDetectionStrategy, Inject, ViewContainerRef, TemplateRef, forwardRef, HostListener, NgModule, effect, viewChildren, Pipe, model, ElementRef, ChangeDetectorRef, ContentChildren, linkedSignal, contentChildren, Renderer2, Injectable } from '@angular/core';
|
|
6
6
|
import { NgControl, Validators, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
7
|
import * as i5 from '@ardium-ui/devkit';
|
|
8
|
-
import { coerceBooleanProperty, coerceNumberProperty, coerceArrayProperty, ArdiumClickOutsideModule, ArdiumEscapeHTMLModule, FileSystemService, FileSystemMethod, ArdiumFilePipesModule, coerceDateProperty, ArdiumHoldModule } from '@ardium-ui/devkit';
|
|
8
|
+
import { arraySignal, coerceBooleanProperty, coerceNumberProperty, coerceArrayProperty, ArdiumClickOutsideModule, ArdiumEscapeHTMLModule, FileSystemService, FileSystemMethod, ArdiumFilePipesModule, coerceDateProperty, ArdiumHoldModule } from '@ardium-ui/devkit';
|
|
9
9
|
import { isDefined, any, isPrimitive, isAnyString, isNull, isNumber, isString, isArray, isFunction, isRegExp, evaluate, isObject, isPromise } from 'simple-bool';
|
|
10
10
|
import { resolvePath } from 'resolve-object-path';
|
|
11
11
|
import { toObservable } from '@angular/core/rxjs-interop';
|
|
@@ -22,7 +22,7 @@ import { A11yModule } from '@angular/cdk/a11y';
|
|
|
22
22
|
class SimplestItemStorage {
|
|
23
23
|
constructor(_ardParentComp) {
|
|
24
24
|
this._ardParentComp = _ardParentComp;
|
|
25
|
-
this._items =
|
|
25
|
+
this._items = arraySignal([]);
|
|
26
26
|
this._highlightedItem = signal(null);
|
|
27
27
|
/**
|
|
28
28
|
* Gets all items.
|
|
@@ -58,12 +58,12 @@ class SimplestItemStorage {
|
|
|
58
58
|
_setItemsMapFn(rawItemData, index, areItemsPrimitive) {
|
|
59
59
|
if (areItemsPrimitive) {
|
|
60
60
|
return {
|
|
61
|
-
itemData:
|
|
61
|
+
itemData: rawItemData,
|
|
62
62
|
index: index,
|
|
63
|
-
value:
|
|
64
|
-
label:
|
|
65
|
-
selected:
|
|
66
|
-
highlighted:
|
|
63
|
+
value: rawItemData.value,
|
|
64
|
+
label: rawItemData.value?.toString?.() ?? String(rawItemData.value),
|
|
65
|
+
selected: false,
|
|
66
|
+
highlighted: false,
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
//get value
|
|
@@ -74,12 +74,12 @@ class SimplestItemStorage {
|
|
|
74
74
|
const label = resolvePath(rawItemData, labelPath) ?? value;
|
|
75
75
|
//return
|
|
76
76
|
return {
|
|
77
|
-
itemData:
|
|
77
|
+
itemData: rawItemData,
|
|
78
78
|
index: index,
|
|
79
|
-
value:
|
|
80
|
-
label:
|
|
81
|
-
selected:
|
|
82
|
-
highlighted:
|
|
79
|
+
value: value,
|
|
80
|
+
label: label?.toString?.() ?? String(label),
|
|
81
|
+
selected: false,
|
|
82
|
+
highlighted: false,
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
@@ -102,7 +102,10 @@ class SimplestItemStorage {
|
|
|
102
102
|
unhighlightCurrent() {
|
|
103
103
|
const hi = this._highlightedItem();
|
|
104
104
|
if (hi) {
|
|
105
|
-
|
|
105
|
+
this._items.setAt(hi.index, {
|
|
106
|
+
...hi,
|
|
107
|
+
highlighted: false,
|
|
108
|
+
});
|
|
106
109
|
}
|
|
107
110
|
this._highlightedItem.set(null);
|
|
108
111
|
}
|
|
@@ -112,7 +115,10 @@ class SimplestItemStorage {
|
|
|
112
115
|
*/
|
|
113
116
|
highlightItem(item) {
|
|
114
117
|
this.unhighlightCurrent();
|
|
115
|
-
|
|
118
|
+
this._items.setAt(item.index, {
|
|
119
|
+
...item,
|
|
120
|
+
highlighted: true,
|
|
121
|
+
});
|
|
116
122
|
this._highlightedItem.set(item);
|
|
117
123
|
}
|
|
118
124
|
/**
|
|
@@ -120,7 +126,10 @@ class SimplestItemStorage {
|
|
|
120
126
|
* @param item The item to be unhighlighted.
|
|
121
127
|
*/
|
|
122
128
|
unhighlightItem(item) {
|
|
123
|
-
|
|
129
|
+
this._items.setAt(item.index, {
|
|
130
|
+
...item,
|
|
131
|
+
highlighted: false,
|
|
132
|
+
});
|
|
124
133
|
if (this._highlightedItem()?.index === item.index)
|
|
125
134
|
this._highlightedItem.set(null);
|
|
126
135
|
}
|
|
@@ -1245,6 +1254,16 @@ class ArdiumAutocompleteInputComponent extends _SimpleInputComponentBase {
|
|
|
1245
1254
|
//! suggestions overlay
|
|
1246
1255
|
this.dropdownHost = viewChild('suggestionsHost');
|
|
1247
1256
|
this.dropdownTemplate = viewChild('suggestionsTemplate', { read: TemplateRef });
|
|
1257
|
+
this.optionContextGenerator = computed(() => item => ({
|
|
1258
|
+
$implicit: item,
|
|
1259
|
+
item,
|
|
1260
|
+
index: item.index,
|
|
1261
|
+
value: item.value,
|
|
1262
|
+
label: item.label,
|
|
1263
|
+
selected: item.selected,
|
|
1264
|
+
highlighted: item.highlighted,
|
|
1265
|
+
itemData: item.itemData,
|
|
1266
|
+
}));
|
|
1248
1267
|
//! suggestion-highligh-related
|
|
1249
1268
|
this._isMouseBeingUsed = false;
|
|
1250
1269
|
//! suggestion appearance
|
|
@@ -1302,13 +1321,6 @@ class ArdiumAutocompleteInputComponent extends _SimpleInputComponentBase {
|
|
|
1302
1321
|
const rect = this.dropdownHost()?.nativeElement.getBoundingClientRect();
|
|
1303
1322
|
this.dropdownOverlay.updateSize({ width: rect?.width });
|
|
1304
1323
|
}
|
|
1305
|
-
getOptionContext(item) {
|
|
1306
|
-
return {
|
|
1307
|
-
$implicit: item,
|
|
1308
|
-
item,
|
|
1309
|
-
itemData: item.itemData,
|
|
1310
|
-
};
|
|
1311
|
-
}
|
|
1312
1324
|
onMouseMove() {
|
|
1313
1325
|
this._isMouseBeingUsed = true;
|
|
1314
1326
|
}
|
|
@@ -1415,7 +1427,7 @@ class ArdiumAutocompleteInputComponent extends _SimpleInputComponentBase {
|
|
|
1415
1427
|
provide: ARD_FORM_FIELD_CONTROL,
|
|
1416
1428
|
useExisting: ArdiumAutocompleteInputComponent,
|
|
1417
1429
|
},
|
|
1418
|
-
], queries: [{ propertyName: "prefixTemplate", first: true, predicate: ArdAutocompleteInputPrefixTemplateDirective, descendants: true, isSignal: true }, { propertyName: "suffixTemplate", first: true, predicate: ArdAutocompleteInputSuffixTemplateDirective, descendants: true, isSignal: true }, { propertyName: "placeholderTemplate", first: true, predicate: ArdAutocompleteInputPlaceholderTemplateDirective, descendants: true, isSignal: true }, { propertyName: "suggestionTemplate", first: true, predicate: ArdAutocompleteInputSuggestionTemplateDirective, descendants: true, isSignal: true }, { propertyName: "suggestionLoadingTemplate", first: true, predicate: ArdAutocompleteInputLoadingTemplateDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "dropdownHost", first: true, predicate: ["suggestionsHost"], descendants: true, isSignal: true }, { propertyName: "dropdownTemplate", first: true, predicate: ["suggestionsTemplate"], descendants: true, read: TemplateRef, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ard-form-field-frame\r\n [appearance]=\"appearance()\"\r\n [variant]=\"variant()\"\r\n [compact]=\"compact()\"\r\n [readonly]=\"readonly()\"\r\n [isFocused]=\"isFocused()\"\r\n [hasError]=\"hasError()\"\r\n [isSuccess]=\"isSuccess()\"\r\n [prefixTemplate]=\"prefixTemplate()?.template\"\r\n [suffixTemplate]=\"suffixTemplate()?.template\"\r\n>\r\n <div\r\n class=\"ard-autocomplete-input\"\r\n #suggestionsHost\r\n [ngClass]=\"ngClasses()\"\r\n [class.ard-has-value]=\"value\"\r\n (click)=\"focus()\"\r\n >\r\n <div class=\"ard-input-container\">\r\n @if (shouldDisplayAutocomplete()) {\r\n <div class=\"ard-autocomplete\">{{ autocomplete() }}</div>\r\n }\r\n @if (shouldDisplayPlaceholder()) {\r\n <ng-template #defaultPlaceholderTemplate>\r\n <div class=\"ard-placeholder\">{{ placeholder() }}</div>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"placeholderTemplate()?.template || defaultPlaceholderTemplate\"></ng-template>\r\n }\r\n <input\r\n #textInput\r\n #focusableElement\r\n type=\"text\"\r\n [attr.id]=\"inputId()\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n [readonly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [maxLength]=\"maxLengthAsInt()\"\r\n (input)=\"onInput(textInput.value)\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (copy)=\"onCopy($event)\"\r\n />\r\n </div>\r\n\r\n @if (shouldShowClearButton()) {\r\n <ard-clear-button\r\n [title]=\"clearButtonTitle()\"\r\n (click)=\"onClearButtonClick($event)\"\r\n />\r\n }\r\n </div>\r\n</ard-form-field-frame>\r\n\r\n<ng-template #suggestionsTemplate>\r\n <ard-dropdown-panel\r\n class=\"ard-dropdown-panel ard-input-suggestions-panel\"\r\n role=\"listbox\"\r\n [compact]=\"compact()\"\r\n aria-label=\"Suggestions\"\r\n [appearance]=\"dropdownAppearanceOrDefault()\"\r\n [variant]=\"dropdownVariantOrDefault()\"\r\n [isOpen]=\"shouldDisplaySuggestions()\"\r\n (ardClickOutside)=\"handleSuggestionClickOutside($event)\"\r\n (mousemove)=\"onMouseMove()\"\r\n >\r\n @for (item of suggestionItems(); track item.index) {\r\n <div\r\n class=\"ard-option\"\r\n role=\"option\"\r\n [class.ard-option-selected]=\"item.selected
|
|
1430
|
+
], queries: [{ propertyName: "prefixTemplate", first: true, predicate: ArdAutocompleteInputPrefixTemplateDirective, descendants: true, isSignal: true }, { propertyName: "suffixTemplate", first: true, predicate: ArdAutocompleteInputSuffixTemplateDirective, descendants: true, isSignal: true }, { propertyName: "placeholderTemplate", first: true, predicate: ArdAutocompleteInputPlaceholderTemplateDirective, descendants: true, isSignal: true }, { propertyName: "suggestionTemplate", first: true, predicate: ArdAutocompleteInputSuggestionTemplateDirective, descendants: true, isSignal: true }, { propertyName: "suggestionLoadingTemplate", first: true, predicate: ArdAutocompleteInputLoadingTemplateDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "dropdownHost", first: true, predicate: ["suggestionsHost"], descendants: true, isSignal: true }, { propertyName: "dropdownTemplate", first: true, predicate: ["suggestionsTemplate"], descendants: true, read: TemplateRef, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ard-form-field-frame\r\n [appearance]=\"appearance()\"\r\n [variant]=\"variant()\"\r\n [compact]=\"compact()\"\r\n [readonly]=\"readonly()\"\r\n [isFocused]=\"isFocused()\"\r\n [hasError]=\"hasError()\"\r\n [isSuccess]=\"isSuccess()\"\r\n [prefixTemplate]=\"prefixTemplate()?.template\"\r\n [suffixTemplate]=\"suffixTemplate()?.template\"\r\n>\r\n <div\r\n class=\"ard-autocomplete-input\"\r\n #suggestionsHost\r\n [ngClass]=\"ngClasses()\"\r\n [class.ard-has-value]=\"value\"\r\n (click)=\"focus()\"\r\n >\r\n <div class=\"ard-input-container\">\r\n @if (shouldDisplayAutocomplete()) {\r\n <div class=\"ard-autocomplete\">{{ autocomplete() }}</div>\r\n }\r\n @if (shouldDisplayPlaceholder()) {\r\n <ng-template #defaultPlaceholderTemplate>\r\n <div class=\"ard-placeholder\">{{ placeholder() }}</div>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"placeholderTemplate()?.template || defaultPlaceholderTemplate\"></ng-template>\r\n }\r\n <input\r\n #textInput\r\n #focusableElement\r\n type=\"text\"\r\n [attr.id]=\"inputId()\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n [readonly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [maxLength]=\"maxLengthAsInt()\"\r\n (input)=\"onInput(textInput.value)\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (copy)=\"onCopy($event)\"\r\n />\r\n </div>\r\n\r\n @if (shouldShowClearButton()) {\r\n <ard-clear-button\r\n [title]=\"clearButtonTitle()\"\r\n (click)=\"onClearButtonClick($event)\"\r\n />\r\n }\r\n </div>\r\n</ard-form-field-frame>\r\n\r\n<ng-template #suggestionsTemplate>\r\n <ard-dropdown-panel\r\n class=\"ard-dropdown-panel ard-input-suggestions-panel\"\r\n role=\"listbox\"\r\n [compact]=\"compact()\"\r\n aria-label=\"Suggestions\"\r\n [appearance]=\"dropdownAppearanceOrDefault()\"\r\n [variant]=\"dropdownVariantOrDefault()\"\r\n [isOpen]=\"shouldDisplaySuggestions()\"\r\n (ardClickOutside)=\"handleSuggestionClickOutside($event)\"\r\n (mousemove)=\"onMouseMove()\"\r\n >\r\n @for (item of suggestionItems(); track item.index) {\r\n <div\r\n class=\"ard-option\"\r\n role=\"option\"\r\n [class.ard-option-selected]=\"item.selected\"\r\n [class.ard-option-highlighted]=\"item.highlighted\"\r\n [attr.aria-selected]=\"item.selected\"\r\n (click)=\"selectSuggestion(item, $event)\"\r\n (mouseenter)=\"onSuggestionMouseEnter(item, $event)\"\r\n (mouseleave)=\"onSuggestionMouseLeave(item, $event)\"\r\n >\r\n <span class=\"ard-option-label\">\r\n <ng-template #defaultOptionTemplate>\r\n {{ item.label }}\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"suggestionTemplate()?.template || defaultOptionTemplate\"\r\n [ngTemplateOutletContext]=\"optionContextGenerator()(item)\"\r\n ></ng-template>\r\n </span>\r\n </div>\r\n }\r\n @if (areSuggestionsLoading()) {\r\n <ng-template #defaultLoadingPlaceholderTemplate>\r\n <div class=\"ard-option ard-option-disabled\">{{ suggestionsLoadingText() }}</div>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"suggestionLoadingTemplate()?.template || defaultLoadingPlaceholderTemplate\"></ng-template>\r\n }\r\n </ard-dropdown-panel>\r\n</ng-template>\r\n", styles: [".ard-input-container{position:relative}.ard-placeholder{position:absolute;left:0;right:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;pointer-events:none}.ard-text-align-left input,.ard-text-align-left .ard-placeholder{text-align:left}.ard-text-align-center input,.ard-text-align-center .ard-placeholder{text-align:center}.ard-text-align-right input,.ard-text-align-right .ard-placeholder{text-align:right}.ard-autocomplete{position:absolute}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ArdiumFormFieldFrameComponent, selector: "ard-form-field-frame", inputs: ["hasError", "isSuccess", "isFocused", "appearance", "variant", "compact", "prefixTemplate", "suffixTemplate"] }, { kind: "component", type: _ClearButtonComponent, selector: "ard-clear-button" }, { kind: "component", type: ArdiumDropdownPanelComponent, selector: "ard-dropdown-panel", inputs: ["panelId", "headerTemplate", "footerTemplate", "filterValue", "appearance", "variant", "compact", "isOpen"], outputs: ["scroll", "scrollToEnd"] }, { kind: "directive", type: i5.ArdiumClickOutsideDirective, selector: "[ardClickOutside]", outputs: ["ardClickOutside"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1419
1431
|
}
|
|
1420
1432
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumAutocompleteInputComponent, decorators: [{
|
|
1421
1433
|
type: Component,
|
|
@@ -1429,7 +1441,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
1429
1441
|
provide: ARD_FORM_FIELD_CONTROL,
|
|
1430
1442
|
useExisting: ArdiumAutocompleteInputComponent,
|
|
1431
1443
|
},
|
|
1432
|
-
], template: "<ard-form-field-frame\r\n [appearance]=\"appearance()\"\r\n [variant]=\"variant()\"\r\n [compact]=\"compact()\"\r\n [readonly]=\"readonly()\"\r\n [isFocused]=\"isFocused()\"\r\n [hasError]=\"hasError()\"\r\n [isSuccess]=\"isSuccess()\"\r\n [prefixTemplate]=\"prefixTemplate()?.template\"\r\n [suffixTemplate]=\"suffixTemplate()?.template\"\r\n>\r\n <div\r\n class=\"ard-autocomplete-input\"\r\n #suggestionsHost\r\n [ngClass]=\"ngClasses()\"\r\n [class.ard-has-value]=\"value\"\r\n (click)=\"focus()\"\r\n >\r\n <div class=\"ard-input-container\">\r\n @if (shouldDisplayAutocomplete()) {\r\n <div class=\"ard-autocomplete\">{{ autocomplete() }}</div>\r\n }\r\n @if (shouldDisplayPlaceholder()) {\r\n <ng-template #defaultPlaceholderTemplate>\r\n <div class=\"ard-placeholder\">{{ placeholder() }}</div>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"placeholderTemplate()?.template || defaultPlaceholderTemplate\"></ng-template>\r\n }\r\n <input\r\n #textInput\r\n #focusableElement\r\n type=\"text\"\r\n [attr.id]=\"inputId()\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n [readonly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [maxLength]=\"maxLengthAsInt()\"\r\n (input)=\"onInput(textInput.value)\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (copy)=\"onCopy($event)\"\r\n />\r\n </div>\r\n\r\n @if (shouldShowClearButton()) {\r\n <ard-clear-button\r\n [title]=\"clearButtonTitle()\"\r\n (click)=\"onClearButtonClick($event)\"\r\n />\r\n }\r\n </div>\r\n</ard-form-field-frame>\r\n\r\n<ng-template #suggestionsTemplate>\r\n <ard-dropdown-panel\r\n class=\"ard-dropdown-panel ard-input-suggestions-panel\"\r\n role=\"listbox\"\r\n [compact]=\"compact()\"\r\n aria-label=\"Suggestions\"\r\n [appearance]=\"dropdownAppearanceOrDefault()\"\r\n [variant]=\"dropdownVariantOrDefault()\"\r\n [isOpen]=\"shouldDisplaySuggestions()\"\r\n (ardClickOutside)=\"handleSuggestionClickOutside($event)\"\r\n (mousemove)=\"onMouseMove()\"\r\n >\r\n @for (item of suggestionItems(); track item.index) {\r\n <div\r\n class=\"ard-option\"\r\n role=\"option\"\r\n [class.ard-option-selected]=\"item.selected
|
|
1444
|
+
], template: "<ard-form-field-frame\r\n [appearance]=\"appearance()\"\r\n [variant]=\"variant()\"\r\n [compact]=\"compact()\"\r\n [readonly]=\"readonly()\"\r\n [isFocused]=\"isFocused()\"\r\n [hasError]=\"hasError()\"\r\n [isSuccess]=\"isSuccess()\"\r\n [prefixTemplate]=\"prefixTemplate()?.template\"\r\n [suffixTemplate]=\"suffixTemplate()?.template\"\r\n>\r\n <div\r\n class=\"ard-autocomplete-input\"\r\n #suggestionsHost\r\n [ngClass]=\"ngClasses()\"\r\n [class.ard-has-value]=\"value\"\r\n (click)=\"focus()\"\r\n >\r\n <div class=\"ard-input-container\">\r\n @if (shouldDisplayAutocomplete()) {\r\n <div class=\"ard-autocomplete\">{{ autocomplete() }}</div>\r\n }\r\n @if (shouldDisplayPlaceholder()) {\r\n <ng-template #defaultPlaceholderTemplate>\r\n <div class=\"ard-placeholder\">{{ placeholder() }}</div>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"placeholderTemplate()?.template || defaultPlaceholderTemplate\"></ng-template>\r\n }\r\n <input\r\n #textInput\r\n #focusableElement\r\n type=\"text\"\r\n [attr.id]=\"inputId()\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n [readonly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [maxLength]=\"maxLengthAsInt()\"\r\n (input)=\"onInput(textInput.value)\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (copy)=\"onCopy($event)\"\r\n />\r\n </div>\r\n\r\n @if (shouldShowClearButton()) {\r\n <ard-clear-button\r\n [title]=\"clearButtonTitle()\"\r\n (click)=\"onClearButtonClick($event)\"\r\n />\r\n }\r\n </div>\r\n</ard-form-field-frame>\r\n\r\n<ng-template #suggestionsTemplate>\r\n <ard-dropdown-panel\r\n class=\"ard-dropdown-panel ard-input-suggestions-panel\"\r\n role=\"listbox\"\r\n [compact]=\"compact()\"\r\n aria-label=\"Suggestions\"\r\n [appearance]=\"dropdownAppearanceOrDefault()\"\r\n [variant]=\"dropdownVariantOrDefault()\"\r\n [isOpen]=\"shouldDisplaySuggestions()\"\r\n (ardClickOutside)=\"handleSuggestionClickOutside($event)\"\r\n (mousemove)=\"onMouseMove()\"\r\n >\r\n @for (item of suggestionItems(); track item.index) {\r\n <div\r\n class=\"ard-option\"\r\n role=\"option\"\r\n [class.ard-option-selected]=\"item.selected\"\r\n [class.ard-option-highlighted]=\"item.highlighted\"\r\n [attr.aria-selected]=\"item.selected\"\r\n (click)=\"selectSuggestion(item, $event)\"\r\n (mouseenter)=\"onSuggestionMouseEnter(item, $event)\"\r\n (mouseleave)=\"onSuggestionMouseLeave(item, $event)\"\r\n >\r\n <span class=\"ard-option-label\">\r\n <ng-template #defaultOptionTemplate>\r\n {{ item.label }}\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"suggestionTemplate()?.template || defaultOptionTemplate\"\r\n [ngTemplateOutletContext]=\"optionContextGenerator()(item)\"\r\n ></ng-template>\r\n </span>\r\n </div>\r\n }\r\n @if (areSuggestionsLoading()) {\r\n <ng-template #defaultLoadingPlaceholderTemplate>\r\n <div class=\"ard-option ard-option-disabled\">{{ suggestionsLoadingText() }}</div>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"suggestionLoadingTemplate()?.template || defaultLoadingPlaceholderTemplate\"></ng-template>\r\n }\r\n </ard-dropdown-panel>\r\n</ng-template>\r\n", styles: [".ard-input-container{position:relative}.ard-placeholder{position:absolute;left:0;right:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;pointer-events:none}.ard-text-align-left input,.ard-text-align-left .ard-placeholder{text-align:left}.ard-text-align-center input,.ard-text-align-center .ard-placeholder{text-align:center}.ard-text-align-right input,.ard-text-align-right .ard-placeholder{text-align:right}.ard-autocomplete{position:absolute}\n"] }]
|
|
1433
1445
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1434
1446
|
type: Inject,
|
|
1435
1447
|
args: [ARD_AUTOCOMPLETE_INPUT_DEFAULTS]
|
|
@@ -2657,43 +2669,66 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
2657
2669
|
}] });
|
|
2658
2670
|
|
|
2659
2671
|
class ItemStorage {
|
|
2672
|
+
_updateItems(updateFn) {
|
|
2673
|
+
this._items.map(updateFn);
|
|
2674
|
+
}
|
|
2675
|
+
_updateItemsFromArray(updateFn, itemsToUpdate) {
|
|
2676
|
+
this._items.update(items => {
|
|
2677
|
+
for (const itemToUpdate of itemsToUpdate) {
|
|
2678
|
+
const item = items[itemToUpdate.index];
|
|
2679
|
+
if (item) {
|
|
2680
|
+
items[itemToUpdate.index] = updateFn(item);
|
|
2681
|
+
}
|
|
2682
|
+
}
|
|
2683
|
+
return items;
|
|
2684
|
+
});
|
|
2685
|
+
}
|
|
2660
2686
|
constructor(_ardParentComp) {
|
|
2661
2687
|
this._ardParentComp = _ardParentComp;
|
|
2662
|
-
this.
|
|
2663
|
-
this.
|
|
2664
|
-
this.
|
|
2665
|
-
this.
|
|
2666
|
-
this.
|
|
2688
|
+
this._items = arraySignal([]);
|
|
2689
|
+
this.filteredItems = computed(() => this.items().filter(item => item.filtered));
|
|
2690
|
+
this.selectedItems = computed(() => this.items().filter(item => item.selected));
|
|
2691
|
+
this.highlightedItems = computed(() => this.items().filter(item => item.highlighted));
|
|
2692
|
+
this._lastHighlightedItem = signal(undefined);
|
|
2667
2693
|
this._recentlyHighlightedItem = signal(undefined);
|
|
2668
|
-
this.
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2694
|
+
this._groups = computed(() => {
|
|
2695
|
+
const groupMap = this._createEmptyGroupMap();
|
|
2696
|
+
for (const item of this.filteredItems()) {
|
|
2697
|
+
if (this._ardParentComp.hideSelected() && item.selected)
|
|
2698
|
+
continue;
|
|
2699
|
+
let group = groupMap.get(item.group);
|
|
2700
|
+
if (!group) {
|
|
2701
|
+
group = {
|
|
2702
|
+
label: item.group?.toString?.() ?? String(item.group),
|
|
2703
|
+
children: [],
|
|
2704
|
+
disabled: false,
|
|
2705
|
+
};
|
|
2706
|
+
groupMap.set(item.group, group);
|
|
2707
|
+
}
|
|
2708
|
+
group.children.push(item);
|
|
2680
2709
|
}
|
|
2681
|
-
return
|
|
2710
|
+
return groupMap;
|
|
2682
2711
|
});
|
|
2683
|
-
this.
|
|
2712
|
+
this.groups = computed(() => Array.from(this._groups().entries())
|
|
2713
|
+
.map(([, group]) => group)
|
|
2714
|
+
.filter(group => group.children.length));
|
|
2715
|
+
this.items = computed(() => [...this._items()]);
|
|
2716
|
+
this.lastSelectedItem = computed(() => this.selectedItems().last(1, item => !item.disabled));
|
|
2684
2717
|
this.value = computed(() => this._itemsToValue(this.selectedItems()));
|
|
2685
|
-
this.isNoItemsToSelect = computed(() => this.
|
|
2686
|
-
this.isNoItemsFound = computed(() => this.
|
|
2687
|
-
this.isAnyItemSelected = computed(() => this.
|
|
2688
|
-
this.isAnyItemHighlighted = computed(() => this.
|
|
2689
|
-
this.
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
this.
|
|
2693
|
-
this.
|
|
2718
|
+
this.isNoItemsToSelect = computed(() => this.items().length === this.selectedItems().length);
|
|
2719
|
+
this.isNoItemsFound = computed(() => this.filteredItems().length === 0);
|
|
2720
|
+
this.isAnyItemSelected = computed(() => this.selectedItems().length > 0);
|
|
2721
|
+
this.isAnyItemHighlighted = computed(() => this.highlightedItems().length > 0);
|
|
2722
|
+
this.itemsLeftUntilLimit = computed(() => this._ardParentComp.multiselectable() && isDefined(this._ardParentComp.maxSelectedItems())
|
|
2723
|
+
? this._ardParentComp.maxSelectedItems() - this.selectedItems().length
|
|
2724
|
+
: 1);
|
|
2725
|
+
this.isItemLimitReached = computed(() => this.itemsLeftUntilLimit() <= 0);
|
|
2726
|
+
this._highlightableItems = computed(() => this.filteredItems().filter(item => !item.disabled && (this._ardParentComp.hideSelected() ? !item.selected : this.isItemLimitReached() ? item.selected : true)));
|
|
2727
|
+
this._valueToWriteAfterItemsLoad = null;
|
|
2728
|
+
this._wasValueWriteDeferred = false;
|
|
2694
2729
|
}
|
|
2695
2730
|
_itemsToValue(items) {
|
|
2696
|
-
return items.map(item => item.value
|
|
2731
|
+
return items.map(item => item.value);
|
|
2697
2732
|
}
|
|
2698
2733
|
setItems(items) {
|
|
2699
2734
|
let areItemsPrimitive = false;
|
|
@@ -2713,16 +2748,18 @@ class ItemStorage {
|
|
|
2713
2748
|
this._items.set(items.map((item, index) => {
|
|
2714
2749
|
return this._setItemsMapFn(item, index, areItemsPrimitive);
|
|
2715
2750
|
}));
|
|
2716
|
-
//
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
this._populateGroups();
|
|
2720
|
-
//write value if it was
|
|
2721
|
-
const toWrite = this._valueToWriteAfterItemsLoad();
|
|
2722
|
-
if (toWrite !== undefined) {
|
|
2723
|
-
this.handleWriteValue(toWrite);
|
|
2751
|
+
// write value if it was deferred
|
|
2752
|
+
if (isDefined(this._valueToWriteAfterItemsLoad)) {
|
|
2753
|
+
this.handleWriteValue(this._valueToWriteAfterItemsLoad);
|
|
2724
2754
|
}
|
|
2725
2755
|
}
|
|
2756
|
+
updateItemFromOptionComponent(itemValue, updatedItem) {
|
|
2757
|
+
const item = this.findItemByValue(itemValue);
|
|
2758
|
+
if (!item)
|
|
2759
|
+
return;
|
|
2760
|
+
const index = item.index;
|
|
2761
|
+
this._items.setAt(index, { ...item, ...updatedItem });
|
|
2762
|
+
}
|
|
2726
2763
|
_addSingleItem(item) {
|
|
2727
2764
|
const isItemPrimitive = isPrimitive(item);
|
|
2728
2765
|
//map a primitive item to a usable object
|
|
@@ -2730,13 +2767,11 @@ class ItemStorage {
|
|
|
2730
2767
|
item = this._primitiveItemsMapFn(item);
|
|
2731
2768
|
}
|
|
2732
2769
|
//map the item to create data bindings
|
|
2733
|
-
const ardOption = this._setItemsMapFn(item, (this.
|
|
2770
|
+
const ardOption = this._setItemsMapFn(item, (this.items().last()?.index ?? 0) + 1, isItemPrimitive);
|
|
2734
2771
|
//push the item into all items
|
|
2735
|
-
this._items.
|
|
2772
|
+
this._items.push(ardOption);
|
|
2736
2773
|
//add all items to filter array
|
|
2737
|
-
this.
|
|
2738
|
-
//add item to groups
|
|
2739
|
-
this._populateGroups();
|
|
2774
|
+
this._updateItems(item => ({ ...item, filtered: true }));
|
|
2740
2775
|
return ardOption;
|
|
2741
2776
|
}
|
|
2742
2777
|
_primitiveItemsMapFn(item) {
|
|
@@ -2775,15 +2810,16 @@ class ItemStorage {
|
|
|
2775
2810
|
_setItemsMapFn(rawItemData, index, areItemsPrimitive) {
|
|
2776
2811
|
if (areItemsPrimitive) {
|
|
2777
2812
|
return {
|
|
2778
|
-
itemData:
|
|
2813
|
+
itemData: rawItemData,
|
|
2779
2814
|
index: index,
|
|
2780
|
-
value:
|
|
2781
|
-
label:
|
|
2782
|
-
disabled:
|
|
2783
|
-
|
|
2784
|
-
|
|
2815
|
+
value: rawItemData.value,
|
|
2816
|
+
label: rawItemData.value?.toString?.() ?? String(rawItemData.value),
|
|
2817
|
+
disabled: false,
|
|
2818
|
+
filtered: true,
|
|
2819
|
+
selected: false,
|
|
2820
|
+
highlighted: false,
|
|
2785
2821
|
group: undefined,
|
|
2786
|
-
highlighted_recently:
|
|
2822
|
+
highlighted_recently: false,
|
|
2787
2823
|
};
|
|
2788
2824
|
}
|
|
2789
2825
|
//get value
|
|
@@ -2815,55 +2851,28 @@ class ItemStorage {
|
|
|
2815
2851
|
}
|
|
2816
2852
|
}
|
|
2817
2853
|
return {
|
|
2818
|
-
itemData:
|
|
2854
|
+
itemData: rawItemData,
|
|
2819
2855
|
index: index,
|
|
2820
|
-
value:
|
|
2821
|
-
label:
|
|
2822
|
-
disabled:
|
|
2856
|
+
value: value,
|
|
2857
|
+
label: label?.toString?.() ?? String(label),
|
|
2858
|
+
disabled: disabled,
|
|
2823
2859
|
group: group,
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2860
|
+
filtered: true,
|
|
2861
|
+
selected: false,
|
|
2862
|
+
highlighted: false,
|
|
2863
|
+
highlighted_recently: false,
|
|
2827
2864
|
};
|
|
2828
2865
|
}
|
|
2829
|
-
_populateGroups() {
|
|
2830
|
-
this._groups.set(this._createEmptyGroupMap());
|
|
2831
|
-
for (const item of this._filteredItems()) {
|
|
2832
|
-
if (this._ardParentComp.hideSelected() && item.selected())
|
|
2833
|
-
continue;
|
|
2834
|
-
this._addToGroup(item);
|
|
2835
|
-
}
|
|
2836
|
-
}
|
|
2837
|
-
_addToGroup(item) {
|
|
2838
|
-
const groupKey = item.group;
|
|
2839
|
-
const targetGroup = this._groups().get(groupKey);
|
|
2840
|
-
//create new group if no such group exists
|
|
2841
|
-
if (!targetGroup) {
|
|
2842
|
-
this._groups.update(v => {
|
|
2843
|
-
const map = new Map(v);
|
|
2844
|
-
map.set(groupKey, {
|
|
2845
|
-
label: signal(String(groupKey ?? '')),
|
|
2846
|
-
children: signal([item]),
|
|
2847
|
-
disabled: signal(false),
|
|
2848
|
-
selected: signal(false),
|
|
2849
|
-
highlighted: signal(false),
|
|
2850
|
-
});
|
|
2851
|
-
return map;
|
|
2852
|
-
});
|
|
2853
|
-
return;
|
|
2854
|
-
}
|
|
2855
|
-
targetGroup.children.update(v => [...v, item]);
|
|
2856
|
-
}
|
|
2857
2866
|
_createEmptyGroupMap() {
|
|
2858
2867
|
return new Map([
|
|
2859
2868
|
[
|
|
2860
2869
|
undefined,
|
|
2861
2870
|
{
|
|
2862
|
-
label:
|
|
2863
|
-
children:
|
|
2864
|
-
disabled:
|
|
2865
|
-
selected:
|
|
2866
|
-
highlighted:
|
|
2871
|
+
label: '',
|
|
2872
|
+
children: [],
|
|
2873
|
+
disabled: false,
|
|
2874
|
+
selected: false,
|
|
2875
|
+
highlighted: false,
|
|
2867
2876
|
},
|
|
2868
2877
|
],
|
|
2869
2878
|
]);
|
|
@@ -2879,8 +2888,9 @@ class ItemStorage {
|
|
|
2879
2888
|
}
|
|
2880
2889
|
handleWriteValue(ngModel) {
|
|
2881
2890
|
//defer writing the value if no options are yet loaded
|
|
2882
|
-
if (!this._wasValueWriteDeferred
|
|
2883
|
-
this._valueToWriteAfterItemsLoad
|
|
2891
|
+
if (!this._wasValueWriteDeferred && this._items().length === 0) {
|
|
2892
|
+
this._valueToWriteAfterItemsLoad = ngModel;
|
|
2893
|
+
this._wasValueWriteDeferred = true;
|
|
2884
2894
|
return;
|
|
2885
2895
|
}
|
|
2886
2896
|
// if null or undefined clear selection
|
|
@@ -2892,11 +2902,12 @@ class ItemStorage {
|
|
|
2892
2902
|
if (!isArray(ngModel)) {
|
|
2893
2903
|
ngModel = [ngModel];
|
|
2894
2904
|
}
|
|
2905
|
+
const ngModelArray = ngModel;
|
|
2895
2906
|
// check value validity
|
|
2896
|
-
if (!this._isWriteValueValid(
|
|
2907
|
+
if (!this._isWriteValueValid(ngModelArray)) {
|
|
2897
2908
|
return;
|
|
2898
2909
|
}
|
|
2899
|
-
const itemsToSelect =
|
|
2910
|
+
const itemsToSelect = ngModelArray
|
|
2900
2911
|
.map(v => {
|
|
2901
2912
|
const item = this.findItemByValue(v);
|
|
2902
2913
|
if (item) {
|
|
@@ -2911,12 +2922,12 @@ class ItemStorage {
|
|
|
2911
2922
|
findItemByValue(valueToFind) {
|
|
2912
2923
|
let findBy;
|
|
2913
2924
|
if (this._ardParentComp.compareWith()) {
|
|
2914
|
-
findBy = item => this._ardParentComp.compareWith()(valueToFind, item.value
|
|
2925
|
+
findBy = item => this._ardParentComp.compareWith()(valueToFind, item.value);
|
|
2915
2926
|
}
|
|
2916
2927
|
else {
|
|
2917
|
-
findBy = item => item.value
|
|
2928
|
+
findBy = item => item.value === valueToFind;
|
|
2918
2929
|
}
|
|
2919
|
-
return this.
|
|
2930
|
+
return this.items().find(item => findBy(item));
|
|
2920
2931
|
}
|
|
2921
2932
|
async addCustomOption(value, fn) {
|
|
2922
2933
|
const fnResult = fn(value);
|
|
@@ -2933,20 +2944,13 @@ class ItemStorage {
|
|
|
2933
2944
|
const newOptionObj = this._addSingleItem(optionValue);
|
|
2934
2945
|
return newOptionObj;
|
|
2935
2946
|
}
|
|
2936
|
-
clearAllSelected(
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
}
|
|
2940
|
-
const removedItemValues = this._itemsToValue(this._selectedItems());
|
|
2941
|
-
if (this._selectedItems().length) {
|
|
2942
|
-
this._selectedItems.set([]);
|
|
2943
|
-
}
|
|
2944
|
-
if (repopulateGroups && this._ardParentComp.hideSelected())
|
|
2945
|
-
this._populateGroups();
|
|
2947
|
+
clearAllSelected() {
|
|
2948
|
+
const removedItemValues = this._itemsToValue(this.selectedItems());
|
|
2949
|
+
this._updateItems(item => ({ ...item, selected: false }));
|
|
2946
2950
|
return removedItemValues;
|
|
2947
2951
|
}
|
|
2948
2952
|
clearLastSelected() {
|
|
2949
|
-
const item = this.
|
|
2953
|
+
const item = this.selectedItems().last();
|
|
2950
2954
|
if (!item)
|
|
2951
2955
|
return item;
|
|
2952
2956
|
this.unselectItem(item);
|
|
@@ -2956,120 +2960,94 @@ class ItemStorage {
|
|
|
2956
2960
|
if (this.isItemLimitReached()) {
|
|
2957
2961
|
return [[], [], this._itemsToValue(items)];
|
|
2958
2962
|
}
|
|
2963
|
+
const itemsLeftUntilLimit = this.itemsLeftUntilLimit();
|
|
2959
2964
|
let itemsSelectedCount = 0;
|
|
2965
|
+
const newItemsArray = [...this.items()];
|
|
2960
2966
|
for (const item of items) {
|
|
2961
2967
|
itemsSelectedCount++;
|
|
2962
|
-
if (item.selected
|
|
2968
|
+
if (item.selected)
|
|
2963
2969
|
continue;
|
|
2964
|
-
if (
|
|
2970
|
+
if (itemsSelectedCount > itemsLeftUntilLimit) {
|
|
2965
2971
|
break;
|
|
2966
2972
|
}
|
|
2967
|
-
item.selected
|
|
2968
|
-
}
|
|
2969
|
-
if (this._ardParentComp.hideSelected()) {
|
|
2970
|
-
this._populateGroups();
|
|
2973
|
+
newItemsArray[item.index] = { ...item, selected: true };
|
|
2971
2974
|
}
|
|
2972
2975
|
const itemsUnselected = this._ardParentComp.multiselectable()
|
|
2973
2976
|
? []
|
|
2974
|
-
: this.
|
|
2977
|
+
: this.selectedItems().filter(item => !items.find(v => v.value === item.value));
|
|
2978
|
+
for (const item of itemsUnselected) {
|
|
2979
|
+
newItemsArray[item.index] = { ...item, selected: false };
|
|
2980
|
+
}
|
|
2975
2981
|
const itemsSelected = items.slice(0, itemsSelectedCount);
|
|
2976
2982
|
const itemsFailedToSelect = items.slice(itemsSelectedCount);
|
|
2977
|
-
const isAnyNewItemToBeSelected = !!itemsSelected.find(item => !this.
|
|
2983
|
+
const isAnyNewItemToBeSelected = !!itemsSelected.find(item => !this.selectedItems().find(v => v.value === item.value));
|
|
2978
2984
|
if (isAnyNewItemToBeSelected) {
|
|
2979
|
-
|
|
2980
|
-
this._selectedItems.update(v => [...v, ...itemsSelected]);
|
|
2981
|
-
}
|
|
2982
|
-
else {
|
|
2983
|
-
this._selectedItems.set(itemsSelected);
|
|
2984
|
-
}
|
|
2985
|
+
this._items.set(newItemsArray);
|
|
2985
2986
|
}
|
|
2986
|
-
|
|
2987
|
+
if (!this._lastHighlightedItem()) {
|
|
2988
|
+
this._lastHighlightedItem.set(itemsFailedToSelect.first() || itemsSelected.last());
|
|
2989
|
+
}
|
|
2990
|
+
return [this._itemsToValue(itemsSelected), this._itemsToValue(itemsUnselected), this._itemsToValue(itemsFailedToSelect)];
|
|
2987
2991
|
}
|
|
2988
2992
|
unselectItem(...items) {
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
item.selected.set(false);
|
|
2993
|
-
}
|
|
2994
|
-
this._selectedItems.update(v => v.filter(v => v.selected()));
|
|
2995
|
-
if (this._ardParentComp.hideSelected()) {
|
|
2996
|
-
this._populateGroups();
|
|
2993
|
+
this._updateItemsFromArray(item => ({ ...item, selected: false }), items);
|
|
2994
|
+
if (!this._lastHighlightedItem()) {
|
|
2995
|
+
this._lastHighlightedItem.set(items.last());
|
|
2997
2996
|
}
|
|
2998
2997
|
return this._itemsToValue(items);
|
|
2999
2998
|
}
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
for (const group of this._highlightedGroups()) {
|
|
3005
|
-
group.highlighted.set(false);
|
|
2999
|
+
toggleItem(item) {
|
|
3000
|
+
if (item.selected) {
|
|
3001
|
+
this.unselectItem(item);
|
|
3002
|
+
return;
|
|
3006
3003
|
}
|
|
3007
|
-
this.
|
|
3008
|
-
|
|
3004
|
+
this.selectItem(item);
|
|
3005
|
+
}
|
|
3006
|
+
clearAllHighlights() {
|
|
3007
|
+
this._updateItems(item => ({ ...item, highlighted: false }));
|
|
3009
3008
|
}
|
|
3010
3009
|
highlightGroup(group) {
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
return group.children().first();
|
|
3010
|
+
const childrenIndexes = new Set(group.children.map(item => item.index));
|
|
3011
|
+
this._updateItems(item => ({ ...item, highlighted: childrenIndexes.has(item.index) }));
|
|
3012
|
+
return group.children.first();
|
|
3015
3013
|
}
|
|
3016
3014
|
highlightSingleItem(item) {
|
|
3017
|
-
if (!item || item.disabled
|
|
3015
|
+
if (!item || item.disabled)
|
|
3018
3016
|
return null;
|
|
3019
3017
|
this.clearAllHighlights();
|
|
3020
3018
|
return this.highlightItem(item);
|
|
3021
3019
|
}
|
|
3022
3020
|
highlightItem(...items) {
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
}
|
|
3026
|
-
this._highlightedItems.update(v => [...v, ...items]);
|
|
3021
|
+
this._updateItemsFromArray(item => ({ ...item, highlighted: true }), items);
|
|
3022
|
+
this._lastHighlightedItem.set(items.last());
|
|
3027
3023
|
return items.last();
|
|
3028
3024
|
}
|
|
3029
3025
|
unhighlightItem(...items) {
|
|
3030
|
-
|
|
3031
|
-
if (!item || !item.highlighted)
|
|
3032
|
-
return;
|
|
3033
|
-
item.highlighted.set(false);
|
|
3034
|
-
}
|
|
3035
|
-
this._highlightedItems.update(v => v.filter(v => v.highlighted()));
|
|
3026
|
+
this._updateItemsFromArray(item => ({ ...item, highlighted: false }), items);
|
|
3036
3027
|
}
|
|
3037
3028
|
highlightFirstItem() {
|
|
3038
3029
|
this.clearAllHighlights();
|
|
3039
|
-
const itemsToHighlight = this.
|
|
3030
|
+
const itemsToHighlight = this._highlightableItems();
|
|
3040
3031
|
return this.highlightSingleItem(itemsToHighlight.first());
|
|
3041
3032
|
}
|
|
3042
3033
|
highlightLastItem() {
|
|
3043
3034
|
this.clearAllHighlights();
|
|
3044
|
-
const itemsToHighlight = this.
|
|
3035
|
+
const itemsToHighlight = this._highlightableItems();
|
|
3045
3036
|
return this.highlightSingleItem(itemsToHighlight.last());
|
|
3046
3037
|
}
|
|
3047
|
-
_getHiglightableItems() {
|
|
3048
|
-
let itemsToHighlight = this._filteredItems().filter(item => !item.disabled());
|
|
3049
|
-
if (this._ardParentComp.hideSelected()) {
|
|
3050
|
-
itemsToHighlight = itemsToHighlight.filter(item => !item.selected());
|
|
3051
|
-
}
|
|
3052
|
-
return itemsToHighlight;
|
|
3053
|
-
}
|
|
3054
3038
|
highlightAllItems() {
|
|
3055
|
-
this.highlightItem(...this.
|
|
3056
|
-
}
|
|
3057
|
-
_clearRecentlyHighlighted() {
|
|
3058
|
-
if (this._recentlyHighlightedItem()) {
|
|
3059
|
-
this._recentlyHighlightedItem().highlighted_recently.set(false);
|
|
3060
|
-
}
|
|
3039
|
+
this.highlightItem(...this._highlightableItems());
|
|
3061
3040
|
}
|
|
3062
|
-
setRecentlyHighlighted(
|
|
3063
|
-
this.
|
|
3064
|
-
|
|
3065
|
-
this._recentlyHighlightedItem.set(item);
|
|
3041
|
+
setRecentlyHighlighted(itemToSet) {
|
|
3042
|
+
this._updateItemsFromArray(item => ({ ...item, highlighted_recently: itemToSet.index === item.index }), [itemToSet]);
|
|
3043
|
+
this._recentlyHighlightedItem.set(itemToSet);
|
|
3066
3044
|
}
|
|
3067
3045
|
highlightNextItem(offset, hasShift) {
|
|
3068
3046
|
if (!this.isAnyItemHighlighted()) {
|
|
3069
3047
|
return this.highlightFirstItem();
|
|
3070
3048
|
}
|
|
3071
|
-
const currentItem = this.
|
|
3072
|
-
const highlightableItems = this.
|
|
3049
|
+
const currentItem = this._lastHighlightedItem() ?? this._highlightableItems().first();
|
|
3050
|
+
const highlightableItems = this._highlightableItems();
|
|
3073
3051
|
const currentIndexInFiltered = highlightableItems.findIndex(item => item.index === currentItem.index);
|
|
3074
3052
|
let nextItemIndex = currentIndexInFiltered + offset;
|
|
3075
3053
|
if (nextItemIndex >= highlightableItems.length) {
|
|
@@ -3080,7 +3058,7 @@ class ItemStorage {
|
|
|
3080
3058
|
}
|
|
3081
3059
|
const itemToHighlight = highlightableItems[nextItemIndex];
|
|
3082
3060
|
if (hasShift && this._ardParentComp.multiselectable()) {
|
|
3083
|
-
if (itemToHighlight.highlighted
|
|
3061
|
+
if (itemToHighlight.highlighted) {
|
|
3084
3062
|
this.unhighlightItem(currentItem);
|
|
3085
3063
|
}
|
|
3086
3064
|
return this.highlightItem(itemToHighlight);
|
|
@@ -3095,24 +3073,18 @@ class ItemStorage {
|
|
|
3095
3073
|
filterTerm = filterTerm.toLocaleLowerCase();
|
|
3096
3074
|
}
|
|
3097
3075
|
const searchFn = this._ardParentComp.searchFn();
|
|
3098
|
-
|
|
3099
|
-
this._filteredItems.set(newFilteredItems);
|
|
3100
|
-
this._populateGroups();
|
|
3076
|
+
this._updateItems(item => ({ ...item, filtered: searchFn(filterTerm, item) }));
|
|
3101
3077
|
if (!this.isNoItemsFound)
|
|
3102
3078
|
this.highlightFirstItem();
|
|
3103
3079
|
else
|
|
3104
3080
|
this.clearAllHighlights();
|
|
3105
|
-
return this._itemsToValue(
|
|
3081
|
+
return this._itemsToValue(this.filteredItems());
|
|
3106
3082
|
}
|
|
3107
3083
|
resetFiltered() {
|
|
3108
|
-
if (this.
|
|
3109
|
-
return this.
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
newFilteredItems = newFilteredItems.filter(item => !item.selected());
|
|
3113
|
-
}
|
|
3114
|
-
this._populateGroups();
|
|
3115
|
-
return newFilteredItems;
|
|
3084
|
+
if (this.filteredItems().length === this.items().length)
|
|
3085
|
+
return this.items();
|
|
3086
|
+
this._updateItems(item => ({ ...item, filtered: true }));
|
|
3087
|
+
return this.items();
|
|
3116
3088
|
}
|
|
3117
3089
|
}
|
|
3118
3090
|
|
|
@@ -3129,7 +3101,7 @@ const searchFunctions = {
|
|
|
3129
3101
|
* @returns `true` if the item matches the search term, otherwise `false`.
|
|
3130
3102
|
*/
|
|
3131
3103
|
byLabel: (searchTerm, item) => {
|
|
3132
|
-
return searchInString(searchTerm, item.label
|
|
3104
|
+
return searchInString(searchTerm, item.label);
|
|
3133
3105
|
},
|
|
3134
3106
|
/**
|
|
3135
3107
|
* Determines if the item should appear in the search results, based on the value only.
|
|
@@ -3138,7 +3110,7 @@ const searchFunctions = {
|
|
|
3138
3110
|
* @returns `true` if the item matches the search term, otherwise `false`.
|
|
3139
3111
|
*/
|
|
3140
3112
|
byValue: (searchTerm, item) => {
|
|
3141
|
-
return searchInString(searchTerm, item.value
|
|
3113
|
+
return searchInString(searchTerm, item.value);
|
|
3142
3114
|
},
|
|
3143
3115
|
/**
|
|
3144
3116
|
* Determines if the item should appear in the search results, based on the group only.
|
|
@@ -3156,7 +3128,7 @@ const searchFunctions = {
|
|
|
3156
3128
|
* @returns `true` if the item matches the search term, otherwise `false`.
|
|
3157
3129
|
*/
|
|
3158
3130
|
byLabelAndGroup: (searchTerm, item) => {
|
|
3159
|
-
return (searchFunctions.byLabel(searchTerm, item) || (item.label
|
|
3131
|
+
return (searchFunctions.byLabel(searchTerm, item) || (item.label !== item.value && searchFunctions.byValue(searchTerm, item)));
|
|
3160
3132
|
},
|
|
3161
3133
|
/**
|
|
3162
3134
|
* Determines if the item should appear in the search results, based on the label and value.
|
|
@@ -3175,7 +3147,7 @@ const searchFunctions = {
|
|
|
3175
3147
|
*/
|
|
3176
3148
|
byLabelAndGroupAndValue: (searchTerm, item) => {
|
|
3177
3149
|
return (searchFunctions.byLabel(searchTerm, item) ||
|
|
3178
|
-
(item.label
|
|
3150
|
+
(item.label !== item.value && searchFunctions.byValue(searchTerm, item)) ||
|
|
3179
3151
|
searchFunctions.byGroup(searchTerm, item));
|
|
3180
3152
|
},
|
|
3181
3153
|
};
|
|
@@ -3587,16 +3559,19 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3587
3559
|
this.itemsAlreadyGrouped = input(this._DEFAULTS.itemsAlreadyGrouped, {
|
|
3588
3560
|
transform: v => coerceBooleanProperty(v),
|
|
3589
3561
|
});
|
|
3590
|
-
this.invertDisabled = input(this._DEFAULTS.invertDisabled, {
|
|
3591
|
-
|
|
3562
|
+
this.invertDisabled = input(this._DEFAULTS.invertDisabled, {
|
|
3563
|
+
transform: v => coerceBooleanProperty(v),
|
|
3564
|
+
});
|
|
3565
|
+
this.noGroupActions = input(this._DEFAULTS.noGroupActions, {
|
|
3566
|
+
transform: v => coerceBooleanProperty(v),
|
|
3567
|
+
});
|
|
3592
3568
|
this.autoHighlightFirst = input(this._DEFAULTS.autoHighlightFirst, {
|
|
3593
3569
|
transform: v => coerceBooleanProperty(v),
|
|
3594
3570
|
});
|
|
3595
3571
|
this.autoFocus = input(this._DEFAULTS.autoFocus, { transform: v => coerceBooleanProperty(v) });
|
|
3596
3572
|
this.keepOpen = input(this._DEFAULTS.keepOpen, { transform: v => coerceBooleanProperty(v) });
|
|
3597
3573
|
this.hideSelected = input(this._DEFAULTS.hideSelected, { transform: v => coerceBooleanProperty(v) });
|
|
3598
|
-
this.noBackspaceClear = input(this._DEFAULTS.noBackspaceClear, {
|
|
3599
|
-
this.sortMultipleValues = input(this._DEFAULTS.sortMultipleValues, {
|
|
3574
|
+
this.noBackspaceClear = input(this._DEFAULTS.noBackspaceClear, {
|
|
3600
3575
|
transform: v => coerceBooleanProperty(v),
|
|
3601
3576
|
});
|
|
3602
3577
|
this.searchCaseSensitive = input(this._DEFAULTS.searchCaseSensitive, {
|
|
@@ -3649,7 +3624,9 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3649
3624
|
return variant;
|
|
3650
3625
|
});
|
|
3651
3626
|
//! attribute and/or class setters/getters
|
|
3652
|
-
this.multiselectable = input(this._DEFAULTS.multiselectable, {
|
|
3627
|
+
this.multiselectable = input(this._DEFAULTS.multiselectable, {
|
|
3628
|
+
transform: v => coerceBooleanProperty(v),
|
|
3629
|
+
});
|
|
3653
3630
|
this.clearable = input(this._DEFAULTS.clearable, { transform: v => coerceBooleanProperty(v) });
|
|
3654
3631
|
this.searchable = input(this._DEFAULTS.searchable, { transform: v => coerceBooleanProperty(v) });
|
|
3655
3632
|
this.filtered = computed(() => this.searchable() && this.searchTerm() !== '');
|
|
@@ -3669,7 +3646,6 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3669
3646
|
this.shouldShowAddCustom = computed(() => this.addCustom() !== false && this.searchTerm().length > 0 && this.itemStorage.isNoItemsFound());
|
|
3670
3647
|
this.valueChange = output();
|
|
3671
3648
|
//! output events
|
|
3672
|
-
this.changeEvent = output({ alias: 'change' });
|
|
3673
3649
|
this.addEvent = output({ alias: 'add' });
|
|
3674
3650
|
this.failedToAddEvent = output({ alias: 'failedToAdd' });
|
|
3675
3651
|
this.removeEvent = output({ alias: 'remove' });
|
|
@@ -3699,6 +3675,34 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3699
3675
|
this.itemDisplayLimitTemplate = contentChild(ArdItemDisplayLimitTemplateDirective);
|
|
3700
3676
|
this.prefixTemplate = contentChild(ArdSelectPrefixTemplateDirective);
|
|
3701
3677
|
this.suffixTemplate = contentChild(ArdSelectSuffixTemplateDirective);
|
|
3678
|
+
//! context providers
|
|
3679
|
+
this.optionContextGenerator = computed(() => item => ({
|
|
3680
|
+
$implicit: item,
|
|
3681
|
+
item,
|
|
3682
|
+
index: item.index,
|
|
3683
|
+
value: item.value,
|
|
3684
|
+
label: item.label,
|
|
3685
|
+
selected: item.selected,
|
|
3686
|
+
highlighted: item.highlighted,
|
|
3687
|
+
itemData: item.itemData,
|
|
3688
|
+
group: item.group,
|
|
3689
|
+
disabled: item.disabled,
|
|
3690
|
+
highlighted_recently: item.highlighted_recently,
|
|
3691
|
+
}));
|
|
3692
|
+
this.valueContextGenerator = computed(() => item => ({
|
|
3693
|
+
...this.optionContextGenerator()(item),
|
|
3694
|
+
unselect: () => {
|
|
3695
|
+
this.unselectItem(item);
|
|
3696
|
+
},
|
|
3697
|
+
}));
|
|
3698
|
+
this.groupContextGenerator = computed(() => group => ({
|
|
3699
|
+
$implicit: group,
|
|
3700
|
+
group,
|
|
3701
|
+
label: group.label,
|
|
3702
|
+
disabled: group.disabled,
|
|
3703
|
+
selectedChildrenCount: group.children.filter(v => v.selected).length,
|
|
3704
|
+
totalChildrenCount: group.children.length,
|
|
3705
|
+
}));
|
|
3702
3706
|
this.getStatsContext = computed(() => ({
|
|
3703
3707
|
totalItems: this.totalItems(),
|
|
3704
3708
|
foundItems: this.foundItems(),
|
|
@@ -3739,6 +3743,9 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3739
3743
|
this.overlay = inject(Overlay);
|
|
3740
3744
|
this.viewContainerRef = inject(ViewContainerRef);
|
|
3741
3745
|
this.scrollStrategyOpts = inject(ScrollStrategyOptions);
|
|
3746
|
+
//! dropdown overlay
|
|
3747
|
+
this.dropdownHost = viewChild.required('dropdownHost');
|
|
3748
|
+
this.dropdownTemplate = viewChild.required('dropdownTemplate');
|
|
3742
3749
|
this.dropdownPanelWidth = input(this._DEFAULTS.dropdownPanelWidth, {
|
|
3743
3750
|
transform: transformDropdownPanelSize,
|
|
3744
3751
|
});
|
|
@@ -3798,18 +3805,16 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3798
3805
|
.pipe(takeUntil(changedOrDestroyed))
|
|
3799
3806
|
.subscribe(option => {
|
|
3800
3807
|
setTimeout(() => {
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
label: option.label || item.label(),
|
|
3808
|
+
this.itemStorage.updateItemFromOptionComponent(option.oldValue ?? option.value, {
|
|
3809
|
+
disabled: option.disabled,
|
|
3810
|
+
label: option.label || undefined,
|
|
3811
|
+
value: option.value,
|
|
3812
|
+
itemData: {
|
|
3813
|
+
label: option.label,
|
|
3808
3814
|
value: option.value,
|
|
3809
3815
|
disabled: option.disabled,
|
|
3810
|
-
}
|
|
3811
|
-
}
|
|
3812
|
-
this.detectChanges();
|
|
3816
|
+
},
|
|
3817
|
+
});
|
|
3813
3818
|
}, 0);
|
|
3814
3819
|
});
|
|
3815
3820
|
};
|
|
@@ -3854,7 +3859,6 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3854
3859
|
_emitChange() {
|
|
3855
3860
|
const value = this.multiselectable() ? this.itemStorage.value() : this.itemStorage.value()[0];
|
|
3856
3861
|
this._onChangeRegistered?.(value);
|
|
3857
|
-
this.changeEvent.emit(value);
|
|
3858
3862
|
this.valueChange.emit(value);
|
|
3859
3863
|
}
|
|
3860
3864
|
_onTouched() {
|
|
@@ -3874,36 +3878,10 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3874
3878
|
get value() {
|
|
3875
3879
|
return this.itemStorage.value;
|
|
3876
3880
|
}
|
|
3877
|
-
//! context providers
|
|
3878
|
-
getValueContext(item) {
|
|
3879
|
-
return {
|
|
3880
|
-
$implicit: item,
|
|
3881
|
-
item,
|
|
3882
|
-
itemData: item.itemData(),
|
|
3883
|
-
unselect: () => {
|
|
3884
|
-
this.unselectItem(item);
|
|
3885
|
-
},
|
|
3886
|
-
};
|
|
3887
|
-
}
|
|
3888
|
-
getGroupContext(group) {
|
|
3889
|
-
return {
|
|
3890
|
-
$implicit: group,
|
|
3891
|
-
group,
|
|
3892
|
-
selectedChildren: group.children().filter(v => v.selected()).length,
|
|
3893
|
-
totalChildren: group.children().length,
|
|
3894
|
-
};
|
|
3895
|
-
}
|
|
3896
|
-
getOptionContext(item) {
|
|
3897
|
-
return {
|
|
3898
|
-
$implicit: item,
|
|
3899
|
-
item,
|
|
3900
|
-
itemData: item.itemData(),
|
|
3901
|
-
};
|
|
3902
|
-
}
|
|
3903
3881
|
_createOverlay() {
|
|
3904
3882
|
const strategy = this.overlay
|
|
3905
3883
|
.position()
|
|
3906
|
-
.flexibleConnectedTo(this.dropdownHost)
|
|
3884
|
+
.flexibleConnectedTo(this.dropdownHost())
|
|
3907
3885
|
.withFlexibleDimensions(false)
|
|
3908
3886
|
.withPositions([
|
|
3909
3887
|
{
|
|
@@ -3943,7 +3921,7 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3943
3921
|
maxHeight: this.dropdownPanelMaxHeight() ?? undefined,
|
|
3944
3922
|
});
|
|
3945
3923
|
this.dropdownOverlay = this.overlay.create(config);
|
|
3946
|
-
const portal = new TemplatePortal(this.dropdownTemplate, this.viewContainerRef);
|
|
3924
|
+
const portal = new TemplatePortal(this.dropdownTemplate(), this.viewContainerRef);
|
|
3947
3925
|
this.dropdownOverlay.attach(portal);
|
|
3948
3926
|
this.setOverlaySize();
|
|
3949
3927
|
}
|
|
@@ -3956,7 +3934,7 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3956
3934
|
setOverlaySize() {
|
|
3957
3935
|
if (!this.dropdownOverlay)
|
|
3958
3936
|
return;
|
|
3959
|
-
const rect = this.dropdownHost.nativeElement.getBoundingClientRect();
|
|
3937
|
+
const rect = this.dropdownHost().nativeElement.getBoundingClientRect();
|
|
3960
3938
|
this.dropdownOverlay.updateSize({ width: rect.width });
|
|
3961
3939
|
}
|
|
3962
3940
|
onWindowResize() {
|
|
@@ -4017,7 +3995,8 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
4017
3995
|
}
|
|
4018
3996
|
//! item selection handlers
|
|
4019
3997
|
toggleItem(item) {
|
|
4020
|
-
|
|
3998
|
+
// don't use itemStorage.toggleItem() - we need to emit different events for select/unselect
|
|
3999
|
+
if (item.selected) {
|
|
4021
4000
|
this.unselectItem(item);
|
|
4022
4001
|
return;
|
|
4023
4002
|
}
|
|
@@ -4056,14 +4035,14 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
4056
4035
|
}
|
|
4057
4036
|
}
|
|
4058
4037
|
_clearAllItems() {
|
|
4059
|
-
const cleared = this.itemStorage.clearAllSelected(
|
|
4038
|
+
const cleared = this.itemStorage.clearAllSelected();
|
|
4060
4039
|
this.focus();
|
|
4061
4040
|
this.clearEvent.emit();
|
|
4062
4041
|
this.removeEvent.emit(cleared);
|
|
4063
4042
|
this._emitChange();
|
|
4064
4043
|
}
|
|
4065
4044
|
_clearLastItem() {
|
|
4066
|
-
const clearedValue = this.itemStorage.clearLastSelected().value
|
|
4045
|
+
const clearedValue = this.itemStorage.clearLastSelected().value;
|
|
4067
4046
|
this.focus();
|
|
4068
4047
|
this.removeEvent.emit([clearedValue]);
|
|
4069
4048
|
this._emitChange();
|
|
@@ -4094,7 +4073,7 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
4094
4073
|
}
|
|
4095
4074
|
onItemClick(option, event) {
|
|
4096
4075
|
event.stopPropagation();
|
|
4097
|
-
if (this.clearable())
|
|
4076
|
+
if (this.clearable() || this.multiselectable())
|
|
4098
4077
|
this.toggleItem(option);
|
|
4099
4078
|
else
|
|
4100
4079
|
this.selectItem(option);
|
|
@@ -4103,11 +4082,11 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
4103
4082
|
onGroupClick(group) {
|
|
4104
4083
|
if (!this.multiselectable() || this.noGroupActions())
|
|
4105
4084
|
return;
|
|
4106
|
-
if (group.children
|
|
4107
|
-
this.unselectItem(...group.children
|
|
4085
|
+
if (group.children.every(o => o.selected)) {
|
|
4086
|
+
this.unselectItem(...group.children);
|
|
4108
4087
|
return;
|
|
4109
4088
|
}
|
|
4110
|
-
this.selectItem(...group.children
|
|
4089
|
+
this.selectItem(...group.children);
|
|
4111
4090
|
this._isClickedWithin.set(true);
|
|
4112
4091
|
}
|
|
4113
4092
|
handleClearButtonClick(event) {
|
|
@@ -4248,9 +4227,10 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
4248
4227
|
async _onEnterPress(event) {
|
|
4249
4228
|
event.preventDefault();
|
|
4250
4229
|
let shouldClose = true;
|
|
4230
|
+
console.log('enter pressed', this.itemStorage.highlightedItems());
|
|
4251
4231
|
//select the currently highlighted option
|
|
4252
4232
|
if (this.isOpen() && this.firstHighlightedItem()) {
|
|
4253
|
-
if (this.clearable() && this.itemStorage.highlightedItems().every(item => item.selected)) {
|
|
4233
|
+
if ((this.clearable() || this.multiselectable()) && this.itemStorage.highlightedItems().every(item => item.selected)) {
|
|
4254
4234
|
this.unselectItem(...this.itemStorage.highlightedItems());
|
|
4255
4235
|
}
|
|
4256
4236
|
else {
|
|
@@ -4262,8 +4242,9 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
4262
4242
|
await this.addCustomOption(this.searchTerm());
|
|
4263
4243
|
}
|
|
4264
4244
|
//in case of no action, open the dropdown (or keep it open)
|
|
4265
|
-
else
|
|
4245
|
+
else {
|
|
4266
4246
|
shouldClose = false;
|
|
4247
|
+
}
|
|
4267
4248
|
if (!this.keepOpen() && shouldClose) {
|
|
4268
4249
|
this.itemStorage.clearAllHighlights();
|
|
4269
4250
|
this.close();
|
|
@@ -4338,7 +4319,7 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
4338
4319
|
this.itemStorage.highlightAllItems();
|
|
4339
4320
|
}
|
|
4340
4321
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumSelectComponent, deps: [{ token: ARD_SELECT_DEFAULTS }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4341
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: ArdiumSelectComponent, isStandalone: false, selector: "ard-select", inputs: { valueFrom: { classPropertyName: "valueFrom", publicName: "valueFrom", isSignal: true, isRequired: false, transformFunction: null }, labelFrom: { classPropertyName: "labelFrom", publicName: "labelFrom", isSignal: true, isRequired: false, transformFunction: null }, disabledFrom: { classPropertyName: "disabledFrom", publicName: "disabledFrom", isSignal: true, isRequired: false, transformFunction: null }, groupLabelFrom: { classPropertyName: "groupLabelFrom", publicName: "groupLabelFrom", isSignal: true, isRequired: false, transformFunction: null }, groupDisabledFrom: { classPropertyName: "groupDisabledFrom", publicName: "groupDisabledFrom", isSignal: true, isRequired: false, transformFunction: null }, childrenFrom: { classPropertyName: "childrenFrom", publicName: "childrenFrom", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, clearButtonTitle: { classPropertyName: "clearButtonTitle", publicName: "clearButtonTitle", isSignal: true, isRequired: false, transformFunction: null }, dropdownPosition: { classPropertyName: "dropdownPosition", publicName: "dropdownPosition", isSignal: true, isRequired: false, transformFunction: null }, noItemsFoundText: { classPropertyName: "noItemsFoundText", publicName: "noItemsFoundText", isSignal: true, isRequired: false, transformFunction: null }, addCustomOptionText: { classPropertyName: "addCustomOptionText", publicName: "addCustomOptionText", isSignal: true, isRequired: false, transformFunction: null }, loadingPlaceholderText: { classPropertyName: "loadingPlaceholderText", publicName: "loadingPlaceholderText", isSignal: true, isRequired: false, transformFunction: null }, searchInputId: { classPropertyName: "searchInputId", publicName: "searchInputId", isSignal: true, isRequired: false, transformFunction: null }, inputAttrs: { classPropertyName: "inputAttrs", publicName: "inputAttrs", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, itemsAlreadyGrouped: { classPropertyName: "itemsAlreadyGrouped", publicName: "itemsAlreadyGrouped", isSignal: true, isRequired: false, transformFunction: null }, invertDisabled: { classPropertyName: "invertDisabled", publicName: "invertDisabled", isSignal: true, isRequired: false, transformFunction: null }, noGroupActions: { classPropertyName: "noGroupActions", publicName: "noGroupActions", isSignal: true, isRequired: false, transformFunction: null }, autoHighlightFirst: { classPropertyName: "autoHighlightFirst", publicName: "autoHighlightFirst", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, keepOpen: { classPropertyName: "keepOpen", publicName: "keepOpen", isSignal: true, isRequired: false, transformFunction: null }, hideSelected: { classPropertyName: "hideSelected", publicName: "hideSelected", isSignal: true, isRequired: false, transformFunction: null }, noBackspaceClear: { classPropertyName: "noBackspaceClear", publicName: "noBackspaceClear", isSignal: true, isRequired: false, transformFunction: null },
|
|
4322
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: ArdiumSelectComponent, isStandalone: false, selector: "ard-select", inputs: { valueFrom: { classPropertyName: "valueFrom", publicName: "valueFrom", isSignal: true, isRequired: false, transformFunction: null }, labelFrom: { classPropertyName: "labelFrom", publicName: "labelFrom", isSignal: true, isRequired: false, transformFunction: null }, disabledFrom: { classPropertyName: "disabledFrom", publicName: "disabledFrom", isSignal: true, isRequired: false, transformFunction: null }, groupLabelFrom: { classPropertyName: "groupLabelFrom", publicName: "groupLabelFrom", isSignal: true, isRequired: false, transformFunction: null }, groupDisabledFrom: { classPropertyName: "groupDisabledFrom", publicName: "groupDisabledFrom", isSignal: true, isRequired: false, transformFunction: null }, childrenFrom: { classPropertyName: "childrenFrom", publicName: "childrenFrom", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, clearButtonTitle: { classPropertyName: "clearButtonTitle", publicName: "clearButtonTitle", isSignal: true, isRequired: false, transformFunction: null }, dropdownPosition: { classPropertyName: "dropdownPosition", publicName: "dropdownPosition", isSignal: true, isRequired: false, transformFunction: null }, noItemsFoundText: { classPropertyName: "noItemsFoundText", publicName: "noItemsFoundText", isSignal: true, isRequired: false, transformFunction: null }, addCustomOptionText: { classPropertyName: "addCustomOptionText", publicName: "addCustomOptionText", isSignal: true, isRequired: false, transformFunction: null }, loadingPlaceholderText: { classPropertyName: "loadingPlaceholderText", publicName: "loadingPlaceholderText", isSignal: true, isRequired: false, transformFunction: null }, searchInputId: { classPropertyName: "searchInputId", publicName: "searchInputId", isSignal: true, isRequired: false, transformFunction: null }, inputAttrs: { classPropertyName: "inputAttrs", publicName: "inputAttrs", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, itemsAlreadyGrouped: { classPropertyName: "itemsAlreadyGrouped", publicName: "itemsAlreadyGrouped", isSignal: true, isRequired: false, transformFunction: null }, invertDisabled: { classPropertyName: "invertDisabled", publicName: "invertDisabled", isSignal: true, isRequired: false, transformFunction: null }, noGroupActions: { classPropertyName: "noGroupActions", publicName: "noGroupActions", isSignal: true, isRequired: false, transformFunction: null }, autoHighlightFirst: { classPropertyName: "autoHighlightFirst", publicName: "autoHighlightFirst", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, keepOpen: { classPropertyName: "keepOpen", publicName: "keepOpen", isSignal: true, isRequired: false, transformFunction: null }, hideSelected: { classPropertyName: "hideSelected", publicName: "hideSelected", isSignal: true, isRequired: false, transformFunction: null }, noBackspaceClear: { classPropertyName: "noBackspaceClear", publicName: "noBackspaceClear", isSignal: true, isRequired: false, transformFunction: null }, searchCaseSensitive: { classPropertyName: "searchCaseSensitive", publicName: "searchCaseSensitive", isSignal: true, isRequired: false, transformFunction: null }, keepSearchAfterSelect: { classPropertyName: "keepSearchAfterSelect", publicName: "keepSearchAfterSelect", isSignal: true, isRequired: false, transformFunction: null }, maxSelectedItems: { classPropertyName: "maxSelectedItems", publicName: "maxSelectedItems", isSignal: true, isRequired: false, transformFunction: null }, itemDisplayLimit: { classPropertyName: "itemDisplayLimit", publicName: "itemDisplayLimit", isSignal: true, isRequired: false, transformFunction: null }, searchFn: { classPropertyName: "searchFn", publicName: "searchFn", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, dropdownAppearance: { classPropertyName: "dropdownAppearance", publicName: "dropdownAppearance", isSignal: true, isRequired: false, transformFunction: null }, dropdownVariant: { classPropertyName: "dropdownVariant", publicName: "dropdownVariant", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: false, isRequired: false, transformFunction: null }, multiselectable: { classPropertyName: "multiselectable", publicName: "multiselectable", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, addCustom: { classPropertyName: "addCustom", publicName: "addCustom", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, dropdownPanelWidth: { classPropertyName: "dropdownPanelWidth", publicName: "dropdownPanelWidth", isSignal: true, isRequired: false, transformFunction: null }, dropdownPanelHeight: { classPropertyName: "dropdownPanelHeight", publicName: "dropdownPanelHeight", isSignal: true, isRequired: false, transformFunction: null }, dropdownPanelMinWidth: { classPropertyName: "dropdownPanelMinWidth", publicName: "dropdownPanelMinWidth", isSignal: true, isRequired: false, transformFunction: null }, dropdownPanelMinHeight: { classPropertyName: "dropdownPanelMinHeight", publicName: "dropdownPanelMinHeight", isSignal: true, isRequired: false, transformFunction: null }, dropdownPanelMaxWidth: { classPropertyName: "dropdownPanelMaxWidth", publicName: "dropdownPanelMaxWidth", isSignal: true, isRequired: false, transformFunction: null }, dropdownPanelMaxHeight: { classPropertyName: "dropdownPanelMaxHeight", publicName: "dropdownPanelMaxHeight", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", addEvent: "add", failedToAddEvent: "failedToAdd", removeEvent: "remove", clearEvent: "clear", openEvent: "open", closeEvent: "close", scrollEvent: "scroll", scrollToEndEvent: "scrollToEnd", searchEvent: "search", isOpen: "isOpenChange" }, host: { listeners: { "window:resize": "onWindowResize()", "mouseup": "onMouseup()", "keydown": "onKeyPress($event)" }, properties: { "class.ard-group-items": "this._groupItemsHostAttribute" } }, providers: [
|
|
4342
4323
|
{
|
|
4343
4324
|
provide: NG_VALUE_ACCESSOR,
|
|
4344
4325
|
useExisting: forwardRef(() => ArdiumSelectComponent),
|
|
@@ -4348,7 +4329,7 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
4348
4329
|
provide: ARD_FORM_FIELD_CONTROL,
|
|
4349
4330
|
useExisting: ArdiumSelectComponent,
|
|
4350
4331
|
},
|
|
4351
|
-
], queries: [{ propertyName: "optionTemplate", first: true, predicate: ArdOptionTemplateDirective, descendants: true, isSignal: true }, { propertyName: "optgroupTemplate", first: true, predicate: ArdOptgroupTemplateDirective, descendants: true, isSignal: true }, { propertyName: "valueTemplate", first: true, predicate: ArdValueTemplateDirective, descendants: true, isSignal: true }, { propertyName: "placeholderTemplate", first: true, predicate: ArdSelectPlaceholderTemplateDirective, descendants: true, isSignal: true }, { propertyName: "dropdownArrowTemplate", first: true, predicate: ArdSelectDropdownArrowTemplateDirective, descendants: true, isSignal: true }, { propertyName: "loadingSpinnerTemplate", first: true, predicate: ArdLoadingSpinnerTemplateDirective, descendants: true, isSignal: true }, { propertyName: "loadingPlaceholderTemplate", first: true, predicate: ArdLoadingPlaceholderTemplateDirective, descendants: true, isSignal: true }, { propertyName: "dropdownHeaderTemplate", first: true, predicate: ArdDropdownHeaderTemplateDirective, descendants: true, isSignal: true }, { propertyName: "dropdownFooterTemplate", first: true, predicate: ArdDropdownFooterTemplateDirective, descendants: true, isSignal: true }, { propertyName: "noItemsFoundTemplate", first: true, predicate: ArdNoItemsFoundTemplateDirective, descendants: true, isSignal: true }, { propertyName: "addCustomTemplate", first: true, predicate: ArdAddCustomTemplateDirective, descendants: true, isSignal: true }, { propertyName: "itemLimitReachedTemplate", first: true, predicate: ArdItemLimitReachedTemplateDirective, descendants: true, isSignal: true }, { propertyName: "itemDisplayLimitTemplate", first: true, predicate: ArdItemDisplayLimitTemplateDirective, descendants: true, isSignal: true }, { propertyName: "prefixTemplate", first: true, predicate: ArdSelectPrefixTemplateDirective, descendants: true, isSignal: true }, { propertyName: "suffixTemplate", first: true, predicate: ArdSelectSuffixTemplateDirective, descendants: true, isSignal: true }, { propertyName: "optionComponents", predicate: ArdiumOptionComponent }], viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "dropdownPanel", first: true, predicate: ArdiumDropdownPanelComponent, descendants: true, isSignal: true }, { propertyName: "dropdownHost", first: true, predicate: ["dropdownHost"], descendants: true, read: ElementRef }, { propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, read: TemplateRef }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ard-form-field-frame\r\n [appearance]=\"appearance()\"\r\n [variant]=\"variant()\"\r\n [compact]=\"compact()\"\r\n [readonly]=\"readonly()\"\r\n [isFocused]=\"isFocused()\"\r\n [hasError]=\"hasError()\"\r\n [isSuccess]=\"isSuccess()\"\r\n [prefixTemplate]=\"prefixTemplate()?.template\"\r\n [suffixTemplate]=\"suffixTemplate()?.template\"\r\n>\r\n <div\r\n class=\"ard-select\"\r\n #dropdownHost\r\n (click)=\"handleAnywhereClick($event)\"\r\n [class.ard-has-value]=\"itemStorage.isAnyItemSelected()\"\r\n [ngClass]=\"ngClasses()\"\r\n >\r\n <div class=\"ard-select-value-container\">\r\n @if (shouldDisplayPlaceholder()) {\r\n <ng-template #defaultPlaceholderTemplate>\r\n <div class=\"ard-placeholder\">{{ placeholder() }}</div>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"placeholderTemplate()?.template || defaultPlaceholderTemplate\" />\r\n } @if (shouldDisplayValue()) { @for (item of itemStorage.selectedItems(); track item.index) {\r\n <div\r\n class=\"ard-select-value\"\r\n [class.ard-value-disabled]=\"item.disabled()\"\r\n [attr.hidden]=\"!isValueWithinDisplayLimit($index)\"\r\n >\r\n @if (isValueWithinDisplayLimit($index)) {\r\n <ng-template\r\n [ngTemplateOutlet]=\"valueTemplate()?.template || (multiselectable() ? defaultMultiValueTemplate : defaultValueTemplate)\"\r\n [ngTemplateOutletContext]=\"getValueContext(item)\"\r\n />\r\n }\r\n </div>\r\n }\r\n\r\n <ng-template\r\n #defaultValueTemplate\r\n let-item\r\n >\r\n <div\r\n class=\"ard-select-value\"\r\n [innerHTML]=\"isItemsInputUsed ? (item.label() | escapeHTML) : item.label()\"\r\n ></div>\r\n </ng-template>\r\n <ng-template\r\n #defaultMultiValueTemplate\r\n let-item\r\n let-unselect=\"unselect\"\r\n >\r\n <ard-deletable-chip\r\n (delete)=\"unselect(item)\"\r\n [variant]=\"variant()\"\r\n compact\r\n appearance=\"outlined\"\r\n >\r\n <div [innerHTML]=\"isItemsInputUsed ? (item.label() | escapeHTML) : item.label()\"></div>\r\n </ard-deletable-chip>\r\n </ng-template>\r\n } @if (itemStorage.isAnyItemSelected() && shouldShowItemDisplayLimit()) {\r\n <div class=\"ard-overflow-indicator\">\r\n <ng-template\r\n [ngTemplateOutlet]=\"itemDisplayLimitTemplate()?.template || defaultItemDisplayLimitTemplate\"\r\n [ngTemplateOutletContext]=\"getItemDisplayLimitContext()\"\r\n />\r\n\r\n <ng-template\r\n #defaultItemDisplayLimitTemplate\r\n let-count=\"overflowCount\"\r\n >\r\n <div>{{ count }} more...</div>\r\n </ng-template>\r\n </div>\r\n }\r\n\r\n <div\r\n class=\"ard-search-input\"\r\n role=\"combobox\"\r\n aria-haspopup=\"listbox\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-owns]=\"isOpen() ? htmlId() : null\"\r\n >\r\n <input\r\n #searchInput\r\n #focusableElement\r\n type=\"text\"\r\n [attr.id]=\"searchInputId()\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n [readonly]=\"isInputElementReadonly()\"\r\n [disabled]=\"disabled()\"\r\n [value]=\"searchTerm()\"\r\n aria-autocomplete=\"list\"\r\n [attr.aria-controls]=\"isOpen() ? htmlId() : null\"\r\n (input)=\"filter(searchInput.value)\"\r\n (change)=\"$event.stopPropagation()\"\r\n (focus)=\"onFocus($event)\"\r\n (focus)=\"onSearchInputFocus()\"\r\n (blur)=\"onBlur($event)\"\r\n (blur)=\"onSearchInputBlur()\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div class=\"ard-select-controls\">\r\n @if (isLoading()) {\r\n <ng-template #defaultLoadingSpinnerTemplate>\r\n <div class=\"ard-spinner\"></div>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"loadingSpinnerTemplate()?.template || defaultLoadingSpinnerTemplate\" />\r\n } @if (shouldShowClearButton()) {\r\n <ard-clear-button\r\n [title]=\"clearButtonTitle()\"\r\n (click)=\"handleClearButtonClick($event)\"\r\n />\r\n } @if (!readonly()) {\r\n <button\r\n type=\"button\"\r\n class=\"ard-dropdown-arrow-wrapper\"\r\n (click)=\"handleDropdownArrowClick($event)\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n >\r\n <ng-template #defaultDropdownArrowTemplate>\r\n <span class=\"ard-dropdown-arrow\"></span>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"dropdownArrowTemplate()?.template || defaultDropdownArrowTemplate\" />\r\n <div class=\"ard-hitbox\"></div>\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n</ard-form-field-frame>\r\n\r\n<ng-template #dropdownTemplate>\r\n <ard-dropdown-panel\r\n class=\"ard-dropdown-panel ard-select-dropdown-panel\"\r\n role=\"listbox\"\r\n aria-label=\"Options list\"\r\n [headerTemplate]=\"dropdownHeaderTemplate()?.template ?? null\"\r\n [footerTemplate]=\"dropdownFooterTemplate()?.template ?? null\"\r\n [appearance]=\"dropdownAppearanceOrDefault()\"\r\n [variant]=\"dropdownVariantOrDefault()\"\r\n [isOpen]=\"true\"\r\n [filterValue]=\"searchTerm()\"\r\n [panelId]=\"htmlId()\"\r\n [compact]=\"compact()\"\r\n (ardClickOutside)=\"handleOutsideClick($event)\"\r\n (mousemove)=\"onMouseMove()\"\r\n (scroll)=\"scrollEvent.emit($event)\"\r\n (scrollToEnd)=\"scrollToEndEvent.emit($event)\"\r\n >\r\n @if (!shouldShowNoItemsFound()) { @for (group of itemStorage.groups(); track $index) {\r\n <div\r\n class=\"ard-optgroup\"\r\n role=\"group\"\r\n [class.ard-group-disabled]=\"group.disabled()\"\r\n [class.ard-group-selected]=\"group.selected()\"\r\n [class.ard-group-highlighted]=\"group.highlighted()\"\r\n (mouseover)=\"onGroupMouseover(group)\"\r\n (click)=\"onGroupClick(group)\"\r\n >\r\n @if (group.label() !== '' && group.label() !== undefined) {\r\n <ng-template\r\n #defaultOptgroupTemplate\r\n let-group\r\n >\r\n <span\r\n class=\"ard-optgroup-label\"\r\n [innerHTML]=\"isItemsInputUsed ? (group.label() | escapeHTML) : group.label()\"\r\n ></span>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"optgroupTemplate()?.template || defaultOptgroupTemplate\"\r\n [ngTemplateOutletContext]=\"getGroupContext(group)\"\r\n />\r\n }\r\n\r\n <div class=\"ard-optgroup-children\">\r\n @for (option of group.children(); track option.index) {\r\n <div\r\n class=\"ard-option\"\r\n role=\"option\"\r\n [class.ard-option-disabled]=\"option.disabled()\"\r\n [class.ard-option-selected]=\"option.selected()\"\r\n [class.ard-option-highlighted]=\"option.highlighted()\"\r\n [class.ard-option-highlighted-recent]=\"option.highlighted_recently()\"\r\n [attr.aria-selected]=\"option.selected()\"\r\n [attr.id]=\"htmlId() + '-' + option.index\"\r\n (click)=\"onItemClick(option, $event)\"\r\n (mouseover)=\"onItemMouseOver($event)\"\r\n (mouseenter)=\"onItemMouseEnter(option, $event)\"\r\n (mouseleave)=\"onItemMouseLeave(option, $event)\"\r\n >\r\n <div class=\"ard-option-label\">\r\n <ng-template\r\n #defaultOptionTemplate\r\n let-option\r\n >\r\n <span [innerHTML]=\"isItemsInputUsed ? (option.label() | escapeHTML) : option.label()\"></span>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"optionTemplate()?.template || defaultOptionTemplate\"\r\n [ngTemplateOutletContext]=\"getOptionContext(option)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n } } @if (shouldShowNoItemsFound()) {\r\n <ng-template #defaultNoItemsFoundTemplate>\r\n <div class=\"ard-option ard-option-disabled\">{{ noItemsFoundText() }}</div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"noItemsFoundTemplate()?.template || defaultNoItemsFoundTemplate\"\r\n [ngTemplateOutletContext]=\"getSearchContext()\"\r\n />\r\n } @if (shouldShowAddCustom()) {\r\n <ng-template\r\n #defaultAddCustomTemplate\r\n let-searchTerm\r\n >\r\n <span class=\"ard-add-custom-label\">{{ addCustomOptionText() }}</span>\r\n <span class=\"ard-add-custom-value\">\"{{ searchTerm }}\"</span>\r\n </ng-template>\r\n\r\n <div\r\n class=\"ard-option ard-option-highlighted ard-add-custom\"\r\n (click)=\"addCustomOption(searchTerm())\"\r\n >\r\n <ng-template\r\n [ngTemplateOutlet]=\"addCustomTemplate()?.template || defaultAddCustomTemplate\"\r\n [ngTemplateOutletContext]=\"getCustomOptionContext()\"\r\n />\r\n </div>\r\n } @if (isLoading()) {\r\n <ng-template #defaultLoadingPlaceholderTemplate>\r\n <div class=\"ard-option ard-option-disabled\">{{ loadingPlaceholderText() }}</div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"loadingPlaceholderTemplate()?.template || defaultLoadingPlaceholderTemplate\"\r\n [ngTemplateOutletContext]=\"getSearchContext()\"\r\n />\r\n }\r\n </ard-dropdown-panel>\r\n</ng-template>\r\n", styles: [".ard-select .ard-select-container{display:flex;cursor:pointer}.ard-select .ard-placeholder,.ard-select .ard-value,.ard-select .ard-dropdown-arrow-wrapper,.ard-select .ard-clear-btn-wrapper{-webkit-user-select:none;user-select:none}.ard-select .ard-clear-btn,.ard-select .ard-dropdown-arrow{border:none;background:transparent;padding:0;box-sizing:content-box}.ard-select .ard-option-disabled{pointer-events:none}.ard-select .ard-select-value{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ard-select .ard-select-value[hidden=true]{display:none}.ard-select .ard-searchable .ard-select-value-container{cursor:text}.ard-select .ard-dropdown-arrow-wrapper{position:relative}.ard-select .ard-dropdown-arrow-wrapper .ard-hitbox{position:absolute;left:-4px;right:-4px;aspect-ratio:1}.ard-select-dropdown-panel .ard-optgroup,.ard-select-dropdown-panel .ard-option{-webkit-user-select:none;user-select:none}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ArdiumFormFieldFrameComponent, selector: "ard-form-field-frame", inputs: ["hasError", "isSuccess", "isFocused", "appearance", "variant", "compact", "prefixTemplate", "suffixTemplate"] }, { kind: "component", type: ArdiumDropdownPanelComponent, selector: "ard-dropdown-panel", inputs: ["panelId", "headerTemplate", "footerTemplate", "filterValue", "appearance", "variant", "compact", "isOpen"], outputs: ["scroll", "scrollToEnd"] }, { kind: "component", type: ArdiumDeletableChipComponent, selector: "ard-deletable-chip", inputs: ["deleteButtonTitle", "contentAlignment", "appearance", "variant", "color", "compact", "wrapperClasses"], outputs: ["delete"] }, { kind: "directive", type: i5.ArdiumClickOutsideDirective, selector: "[ardClickOutside]", outputs: ["ardClickOutside"] }, { kind: "component", type: _ClearButtonComponent, selector: "ard-clear-button" }, { kind: "pipe", type: i5.ArdiumEscapeHTMLPipe, name: "escapeHTML" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
4332
|
+
], queries: [{ propertyName: "optionTemplate", first: true, predicate: ArdOptionTemplateDirective, descendants: true, isSignal: true }, { propertyName: "optgroupTemplate", first: true, predicate: ArdOptgroupTemplateDirective, descendants: true, isSignal: true }, { propertyName: "valueTemplate", first: true, predicate: ArdValueTemplateDirective, descendants: true, isSignal: true }, { propertyName: "placeholderTemplate", first: true, predicate: ArdSelectPlaceholderTemplateDirective, descendants: true, isSignal: true }, { propertyName: "dropdownArrowTemplate", first: true, predicate: ArdSelectDropdownArrowTemplateDirective, descendants: true, isSignal: true }, { propertyName: "loadingSpinnerTemplate", first: true, predicate: ArdLoadingSpinnerTemplateDirective, descendants: true, isSignal: true }, { propertyName: "loadingPlaceholderTemplate", first: true, predicate: ArdLoadingPlaceholderTemplateDirective, descendants: true, isSignal: true }, { propertyName: "dropdownHeaderTemplate", first: true, predicate: ArdDropdownHeaderTemplateDirective, descendants: true, isSignal: true }, { propertyName: "dropdownFooterTemplate", first: true, predicate: ArdDropdownFooterTemplateDirective, descendants: true, isSignal: true }, { propertyName: "noItemsFoundTemplate", first: true, predicate: ArdNoItemsFoundTemplateDirective, descendants: true, isSignal: true }, { propertyName: "addCustomTemplate", first: true, predicate: ArdAddCustomTemplateDirective, descendants: true, isSignal: true }, { propertyName: "itemLimitReachedTemplate", first: true, predicate: ArdItemLimitReachedTemplateDirective, descendants: true, isSignal: true }, { propertyName: "itemDisplayLimitTemplate", first: true, predicate: ArdItemDisplayLimitTemplateDirective, descendants: true, isSignal: true }, { propertyName: "prefixTemplate", first: true, predicate: ArdSelectPrefixTemplateDirective, descendants: true, isSignal: true }, { propertyName: "suffixTemplate", first: true, predicate: ArdSelectSuffixTemplateDirective, descendants: true, isSignal: true }, { propertyName: "optionComponents", predicate: ArdiumOptionComponent }], viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "dropdownPanel", first: true, predicate: ArdiumDropdownPanelComponent, descendants: true, isSignal: true }, { propertyName: "dropdownHost", first: true, predicate: ["dropdownHost"], descendants: true, isSignal: true }, { propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, isSignal: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ard-form-field-frame\r\n [appearance]=\"appearance()\"\r\n [variant]=\"variant()\"\r\n [compact]=\"compact()\"\r\n [readonly]=\"readonly()\"\r\n [isFocused]=\"isFocused()\"\r\n [hasError]=\"hasError()\"\r\n [isSuccess]=\"isSuccess()\"\r\n [prefixTemplate]=\"prefixTemplate()?.template\"\r\n [suffixTemplate]=\"suffixTemplate()?.template\"\r\n>\r\n <div\r\n class=\"ard-select\"\r\n #dropdownHost\r\n (click)=\"handleAnywhereClick($event)\"\r\n [class.ard-has-value]=\"itemStorage.isAnyItemSelected()\"\r\n [ngClass]=\"ngClasses()\"\r\n >\r\n <div class=\"ard-select-value-container\">\r\n @if (shouldDisplayPlaceholder()) {\r\n <ng-template #defaultPlaceholderTemplate>\r\n <div class=\"ard-placeholder\">{{ placeholder() }}</div>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"placeholderTemplate()?.template || defaultPlaceholderTemplate\" />\r\n } @if (shouldDisplayValue()) { @for (item of itemStorage.selectedItems(); track item.index) {\r\n <div\r\n class=\"ard-select-value\"\r\n [class.ard-value-disabled]=\"item.disabled\"\r\n [attr.hidden]=\"!isValueWithinDisplayLimit($index)\"\r\n >\r\n @if (isValueWithinDisplayLimit($index)) {\r\n <ng-template\r\n [ngTemplateOutlet]=\"valueTemplate()?.template || (multiselectable() ? defaultMultiValueTemplate : defaultValueTemplate)\"\r\n [ngTemplateOutletContext]=\"valueContextGenerator()(item)\"\r\n />\r\n }\r\n </div>\r\n }\r\n\r\n <ng-template\r\n #defaultValueTemplate\r\n let-label=\"label\"\r\n >\r\n <div\r\n class=\"ard-select-value\"\r\n [innerHTML]=\"isItemsInputUsed ? (label | escapeHTML) : label\"\r\n ></div>\r\n </ng-template>\r\n <ng-template\r\n #defaultMultiValueTemplate\r\n let-item\r\n let-label=\"label\"\r\n let-unselect=\"unselect\"\r\n >\r\n <ard-deletable-chip\r\n (delete)=\"unselect(item)\"\r\n [variant]=\"variant()\"\r\n compact\r\n appearance=\"outlined\"\r\n >\r\n <div [innerHTML]=\"isItemsInputUsed ? (label | escapeHTML) : label\"></div>\r\n </ard-deletable-chip>\r\n </ng-template>\r\n } @if (itemStorage.isAnyItemSelected() && shouldShowItemDisplayLimit()) {\r\n <div class=\"ard-overflow-indicator\">\r\n <ng-template\r\n [ngTemplateOutlet]=\"itemDisplayLimitTemplate()?.template || defaultItemDisplayLimitTemplate\"\r\n [ngTemplateOutletContext]=\"getItemDisplayLimitContext()\"\r\n />\r\n\r\n <ng-template\r\n #defaultItemDisplayLimitTemplate\r\n let-count=\"overflowCount\"\r\n >\r\n <div>{{ count }} more...</div>\r\n </ng-template>\r\n </div>\r\n }\r\n\r\n <div\r\n class=\"ard-search-input\"\r\n role=\"combobox\"\r\n aria-haspopup=\"listbox\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-owns]=\"isOpen() ? htmlId() : null\"\r\n >\r\n <input\r\n #searchInput\r\n #focusableElement\r\n type=\"text\"\r\n [attr.id]=\"searchInputId()\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n [readonly]=\"isInputElementReadonly()\"\r\n [disabled]=\"disabled()\"\r\n [value]=\"searchTerm()\"\r\n aria-autocomplete=\"list\"\r\n [attr.aria-controls]=\"isOpen() ? htmlId() : null\"\r\n (input)=\"filter(searchInput.value)\"\r\n (change)=\"$event.stopPropagation()\"\r\n (focus)=\"onFocus($event)\"\r\n (focus)=\"onSearchInputFocus()\"\r\n (blur)=\"onBlur($event)\"\r\n (blur)=\"onSearchInputBlur()\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div class=\"ard-select-controls\">\r\n @if (isLoading()) {\r\n <ng-template #defaultLoadingSpinnerTemplate>\r\n <div class=\"ard-spinner\"></div>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"loadingSpinnerTemplate()?.template || defaultLoadingSpinnerTemplate\" />\r\n } @if (shouldShowClearButton()) {\r\n <ard-clear-button\r\n [title]=\"clearButtonTitle()\"\r\n (click)=\"handleClearButtonClick($event)\"\r\n />\r\n } @if (!readonly()) {\r\n <button\r\n type=\"button\"\r\n class=\"ard-dropdown-arrow-wrapper\"\r\n (click)=\"handleDropdownArrowClick($event)\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n >\r\n <ng-template #defaultDropdownArrowTemplate>\r\n <span class=\"ard-dropdown-arrow\"></span>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"dropdownArrowTemplate()?.template || defaultDropdownArrowTemplate\" />\r\n <div class=\"ard-hitbox\"></div>\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n</ard-form-field-frame>\r\n\r\n<ng-template #dropdownTemplate>\r\n <ard-dropdown-panel\r\n class=\"ard-dropdown-panel ard-select-dropdown-panel\"\r\n role=\"listbox\"\r\n aria-label=\"Options list\"\r\n [headerTemplate]=\"dropdownHeaderTemplate()?.template ?? null\"\r\n [footerTemplate]=\"dropdownFooterTemplate()?.template ?? null\"\r\n [appearance]=\"dropdownAppearanceOrDefault()\"\r\n [variant]=\"dropdownVariantOrDefault()\"\r\n [isOpen]=\"true\"\r\n [filterValue]=\"searchTerm()\"\r\n [panelId]=\"htmlId()\"\r\n [compact]=\"compact()\"\r\n (ardClickOutside)=\"handleOutsideClick($event)\"\r\n (mousemove)=\"onMouseMove()\"\r\n (scroll)=\"scrollEvent.emit($event)\"\r\n (scrollToEnd)=\"scrollToEndEvent.emit($event)\"\r\n >\r\n @if (!shouldShowNoItemsFound()) { @for (group of itemStorage.groups(); track $index) {\r\n <div\r\n class=\"ard-optgroup\"\r\n role=\"group\"\r\n [class.ard-group-disabled]=\"group.disabled\"\r\n (mouseover)=\"onGroupMouseover(group)\"\r\n (click)=\"onGroupClick(group)\"\r\n >\r\n @if (!!group.label) {\r\n <ng-template\r\n #defaultOptgroupTemplate\r\n let-label=\"label\"\r\n >\r\n <span\r\n class=\"ard-optgroup-label\"\r\n [innerHTML]=\"isItemsInputUsed ? (label | escapeHTML) : label\"\r\n ></span>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"optgroupTemplate()?.template || defaultOptgroupTemplate\"\r\n [ngTemplateOutletContext]=\"groupContextGenerator()(group)\"\r\n />\r\n }\r\n\r\n <div class=\"ard-optgroup-children\">\r\n @for (option of group.children; track option.index) {\r\n <div\r\n class=\"ard-option\"\r\n role=\"option\"\r\n [class.ard-option-disabled]=\"option.disabled || (itemStorage.isItemLimitReached() && !option.selected)\"\r\n [class.ard-option-selected]=\"option.selected\"\r\n [class.ard-option-highlighted]=\"option.highlighted\"\r\n [class.ard-option-highlighted-recent]=\"option.highlighted_recently\"\r\n [attr.aria-selected]=\"option.selected\"\r\n [attr.id]=\"htmlId() + '-' + option.index\"\r\n (click)=\"onItemClick(option, $event)\"\r\n (mouseover)=\"onItemMouseOver($event)\"\r\n (mouseenter)=\"onItemMouseEnter(option, $event)\"\r\n (mouseleave)=\"onItemMouseLeave(option, $event)\"\r\n >\r\n <div class=\"ard-option-label\">\r\n <ng-template\r\n #defaultOptionTemplate\r\n let-label=\"label\"\r\n >\r\n <span [innerHTML]=\"isItemsInputUsed ? (label | escapeHTML) : label\"></span>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"optionTemplate()?.template || defaultOptionTemplate\"\r\n [ngTemplateOutletContext]=\"optionContextGenerator()(option)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n } } @if (shouldShowNoItemsFound()) {\r\n <ng-template #defaultNoItemsFoundTemplate>\r\n <div class=\"ard-option ard-option-disabled\">{{ noItemsFoundText() }}</div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"noItemsFoundTemplate()?.template || defaultNoItemsFoundTemplate\"\r\n [ngTemplateOutletContext]=\"getSearchContext()\"\r\n />\r\n } @if (shouldShowAddCustom()) {\r\n <div\r\n class=\"ard-option ard-option-highlighted ard-add-custom\"\r\n (click)=\"addCustomOption(searchTerm())\"\r\n >\r\n <ng-template\r\n #defaultAddCustomTemplate\r\n let-searchTerm\r\n >\r\n <span class=\"ard-add-custom-label\">{{ addCustomOptionText() }}</span>\r\n <span class=\"ard-add-custom-value\">\"{{ searchTerm }}\"</span>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"addCustomTemplate()?.template || defaultAddCustomTemplate\"\r\n [ngTemplateOutletContext]=\"getCustomOptionContext()\"\r\n />\r\n </div>\r\n } @if (isLoading()) {\r\n <ng-template #defaultLoadingPlaceholderTemplate>\r\n <div class=\"ard-option ard-option-disabled\">{{ loadingPlaceholderText() }}</div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"loadingPlaceholderTemplate()?.template || defaultLoadingPlaceholderTemplate\"\r\n [ngTemplateOutletContext]=\"getSearchContext()\"\r\n />\r\n }\r\n </ard-dropdown-panel>\r\n</ng-template>\r\n", styles: [".ard-select .ard-select-container{display:flex;cursor:pointer}.ard-select .ard-placeholder,.ard-select .ard-value,.ard-select .ard-dropdown-arrow-wrapper,.ard-select .ard-clear-btn-wrapper{-webkit-user-select:none;user-select:none}.ard-select .ard-clear-btn,.ard-select .ard-dropdown-arrow{border:none;background:transparent;padding:0;box-sizing:content-box}.ard-select .ard-option-disabled{pointer-events:none}.ard-select .ard-select-value{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ard-select .ard-select-value[hidden=true]{display:none}.ard-select .ard-searchable .ard-select-value-container{cursor:text}.ard-select .ard-dropdown-arrow-wrapper{position:relative}.ard-select .ard-dropdown-arrow-wrapper .ard-hitbox{position:absolute;left:-4px;right:-4px;aspect-ratio:1}.ard-select-dropdown-panel .ard-optgroup,.ard-select-dropdown-panel .ard-option{-webkit-user-select:none;user-select:none}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ArdiumFormFieldFrameComponent, selector: "ard-form-field-frame", inputs: ["hasError", "isSuccess", "isFocused", "appearance", "variant", "compact", "prefixTemplate", "suffixTemplate"] }, { kind: "component", type: ArdiumDropdownPanelComponent, selector: "ard-dropdown-panel", inputs: ["panelId", "headerTemplate", "footerTemplate", "filterValue", "appearance", "variant", "compact", "isOpen"], outputs: ["scroll", "scrollToEnd"] }, { kind: "component", type: ArdiumDeletableChipComponent, selector: "ard-deletable-chip", inputs: ["deleteButtonTitle", "contentAlignment", "appearance", "variant", "color", "compact", "wrapperClasses"], outputs: ["delete"] }, { kind: "directive", type: i5.ArdiumClickOutsideDirective, selector: "[ardClickOutside]", outputs: ["ardClickOutside"] }, { kind: "component", type: _ClearButtonComponent, selector: "ard-clear-button" }, { kind: "pipe", type: i5.ArdiumEscapeHTMLPipe, name: "escapeHTML" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
4352
4333
|
}
|
|
4353
4334
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumSelectComponent, decorators: [{
|
|
4354
4335
|
type: Component,
|
|
@@ -4362,7 +4343,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
4362
4343
|
provide: ARD_FORM_FIELD_CONTROL,
|
|
4363
4344
|
useExisting: ArdiumSelectComponent,
|
|
4364
4345
|
},
|
|
4365
|
-
], template: "<ard-form-field-frame\r\n [appearance]=\"appearance()\"\r\n [variant]=\"variant()\"\r\n [compact]=\"compact()\"\r\n [readonly]=\"readonly()\"\r\n [isFocused]=\"isFocused()\"\r\n [hasError]=\"hasError()\"\r\n [isSuccess]=\"isSuccess()\"\r\n [prefixTemplate]=\"prefixTemplate()?.template\"\r\n [suffixTemplate]=\"suffixTemplate()?.template\"\r\n>\r\n <div\r\n class=\"ard-select\"\r\n #dropdownHost\r\n (click)=\"handleAnywhereClick($event)\"\r\n [class.ard-has-value]=\"itemStorage.isAnyItemSelected()\"\r\n [ngClass]=\"ngClasses()\"\r\n >\r\n <div class=\"ard-select-value-container\">\r\n @if (shouldDisplayPlaceholder()) {\r\n <ng-template #defaultPlaceholderTemplate>\r\n <div class=\"ard-placeholder\">{{ placeholder() }}</div>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"placeholderTemplate()?.template || defaultPlaceholderTemplate\" />\r\n } @if (shouldDisplayValue()) { @for (item of itemStorage.selectedItems(); track item.index) {\r\n <div\r\n class=\"ard-select-value\"\r\n [class.ard-value-disabled]=\"item.disabled()\"\r\n [attr.hidden]=\"!isValueWithinDisplayLimit($index)\"\r\n >\r\n @if (isValueWithinDisplayLimit($index)) {\r\n <ng-template\r\n [ngTemplateOutlet]=\"valueTemplate()?.template || (multiselectable() ? defaultMultiValueTemplate : defaultValueTemplate)\"\r\n [ngTemplateOutletContext]=\"getValueContext(item)\"\r\n />\r\n }\r\n </div>\r\n }\r\n\r\n <ng-template\r\n #defaultValueTemplate\r\n let-item\r\n >\r\n <div\r\n class=\"ard-select-value\"\r\n [innerHTML]=\"isItemsInputUsed ? (item.label() | escapeHTML) : item.label()\"\r\n ></div>\r\n </ng-template>\r\n <ng-template\r\n #defaultMultiValueTemplate\r\n let-item\r\n let-unselect=\"unselect\"\r\n >\r\n <ard-deletable-chip\r\n (delete)=\"unselect(item)\"\r\n [variant]=\"variant()\"\r\n compact\r\n appearance=\"outlined\"\r\n >\r\n <div [innerHTML]=\"isItemsInputUsed ? (item.label() | escapeHTML) : item.label()\"></div>\r\n </ard-deletable-chip>\r\n </ng-template>\r\n } @if (itemStorage.isAnyItemSelected() && shouldShowItemDisplayLimit()) {\r\n <div class=\"ard-overflow-indicator\">\r\n <ng-template\r\n [ngTemplateOutlet]=\"itemDisplayLimitTemplate()?.template || defaultItemDisplayLimitTemplate\"\r\n [ngTemplateOutletContext]=\"getItemDisplayLimitContext()\"\r\n />\r\n\r\n <ng-template\r\n #defaultItemDisplayLimitTemplate\r\n let-count=\"overflowCount\"\r\n >\r\n <div>{{ count }} more...</div>\r\n </ng-template>\r\n </div>\r\n }\r\n\r\n <div\r\n class=\"ard-search-input\"\r\n role=\"combobox\"\r\n aria-haspopup=\"listbox\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-owns]=\"isOpen() ? htmlId() : null\"\r\n >\r\n <input\r\n #searchInput\r\n #focusableElement\r\n type=\"text\"\r\n [attr.id]=\"searchInputId()\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n [readonly]=\"isInputElementReadonly()\"\r\n [disabled]=\"disabled()\"\r\n [value]=\"searchTerm()\"\r\n aria-autocomplete=\"list\"\r\n [attr.aria-controls]=\"isOpen() ? htmlId() : null\"\r\n (input)=\"filter(searchInput.value)\"\r\n (change)=\"$event.stopPropagation()\"\r\n (focus)=\"onFocus($event)\"\r\n (focus)=\"onSearchInputFocus()\"\r\n (blur)=\"onBlur($event)\"\r\n (blur)=\"onSearchInputBlur()\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div class=\"ard-select-controls\">\r\n @if (isLoading()) {\r\n <ng-template #defaultLoadingSpinnerTemplate>\r\n <div class=\"ard-spinner\"></div>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"loadingSpinnerTemplate()?.template || defaultLoadingSpinnerTemplate\" />\r\n } @if (shouldShowClearButton()) {\r\n <ard-clear-button\r\n [title]=\"clearButtonTitle()\"\r\n (click)=\"handleClearButtonClick($event)\"\r\n />\r\n } @if (!readonly()) {\r\n <button\r\n type=\"button\"\r\n class=\"ard-dropdown-arrow-wrapper\"\r\n (click)=\"handleDropdownArrowClick($event)\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n >\r\n <ng-template #defaultDropdownArrowTemplate>\r\n <span class=\"ard-dropdown-arrow\"></span>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"dropdownArrowTemplate()?.template || defaultDropdownArrowTemplate\" />\r\n <div class=\"ard-hitbox\"></div>\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n</ard-form-field-frame>\r\n\r\n<ng-template #dropdownTemplate>\r\n <ard-dropdown-panel\r\n class=\"ard-dropdown-panel ard-select-dropdown-panel\"\r\n role=\"listbox\"\r\n aria-label=\"Options list\"\r\n [headerTemplate]=\"dropdownHeaderTemplate()?.template ?? null\"\r\n [footerTemplate]=\"dropdownFooterTemplate()?.template ?? null\"\r\n [appearance]=\"dropdownAppearanceOrDefault()\"\r\n [variant]=\"dropdownVariantOrDefault()\"\r\n [isOpen]=\"true\"\r\n [filterValue]=\"searchTerm()\"\r\n [panelId]=\"htmlId()\"\r\n [compact]=\"compact()\"\r\n (ardClickOutside)=\"handleOutsideClick($event)\"\r\n (mousemove)=\"onMouseMove()\"\r\n (scroll)=\"scrollEvent.emit($event)\"\r\n (scrollToEnd)=\"scrollToEndEvent.emit($event)\"\r\n >\r\n @if (!shouldShowNoItemsFound()) { @for (group of itemStorage.groups(); track $index) {\r\n <div\r\n class=\"ard-optgroup\"\r\n role=\"group\"\r\n [class.ard-group-disabled]=\"group.disabled()\"\r\n [class.ard-group-selected]=\"group.selected()\"\r\n [class.ard-group-highlighted]=\"group.highlighted()\"\r\n (mouseover)=\"onGroupMouseover(group)\"\r\n (click)=\"onGroupClick(group)\"\r\n >\r\n @if (group.label() !== '' && group.label() !== undefined) {\r\n <ng-template\r\n #defaultOptgroupTemplate\r\n let-group\r\n >\r\n <span\r\n class=\"ard-optgroup-label\"\r\n [innerHTML]=\"isItemsInputUsed ? (group.label() | escapeHTML) : group.label()\"\r\n ></span>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"optgroupTemplate()?.template || defaultOptgroupTemplate\"\r\n [ngTemplateOutletContext]=\"getGroupContext(group)\"\r\n />\r\n }\r\n\r\n <div class=\"ard-optgroup-children\">\r\n @for (option of group.children(); track option.index) {\r\n <div\r\n class=\"ard-option\"\r\n role=\"option\"\r\n [class.ard-option-disabled]=\"option.disabled()\"\r\n [class.ard-option-selected]=\"option.selected()\"\r\n [class.ard-option-highlighted]=\"option.highlighted()\"\r\n [class.ard-option-highlighted-recent]=\"option.highlighted_recently()\"\r\n [attr.aria-selected]=\"option.selected()\"\r\n [attr.id]=\"htmlId() + '-' + option.index\"\r\n (click)=\"onItemClick(option, $event)\"\r\n (mouseover)=\"onItemMouseOver($event)\"\r\n (mouseenter)=\"onItemMouseEnter(option, $event)\"\r\n (mouseleave)=\"onItemMouseLeave(option, $event)\"\r\n >\r\n <div class=\"ard-option-label\">\r\n <ng-template\r\n #defaultOptionTemplate\r\n let-option\r\n >\r\n <span [innerHTML]=\"isItemsInputUsed ? (option.label() | escapeHTML) : option.label()\"></span>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"optionTemplate()?.template || defaultOptionTemplate\"\r\n [ngTemplateOutletContext]=\"getOptionContext(option)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n } } @if (shouldShowNoItemsFound()) {\r\n <ng-template #defaultNoItemsFoundTemplate>\r\n <div class=\"ard-option ard-option-disabled\">{{ noItemsFoundText() }}</div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"noItemsFoundTemplate()?.template || defaultNoItemsFoundTemplate\"\r\n [ngTemplateOutletContext]=\"getSearchContext()\"\r\n />\r\n } @if (shouldShowAddCustom()) {\r\n <ng-template\r\n #defaultAddCustomTemplate\r\n let-searchTerm\r\n >\r\n <span class=\"ard-add-custom-label\">{{ addCustomOptionText() }}</span>\r\n <span class=\"ard-add-custom-value\">\"{{ searchTerm }}\"</span>\r\n </ng-template>\r\n\r\n <div\r\n class=\"ard-option ard-option-highlighted ard-add-custom\"\r\n (click)=\"addCustomOption(searchTerm())\"\r\n >\r\n <ng-template\r\n [ngTemplateOutlet]=\"addCustomTemplate()?.template || defaultAddCustomTemplate\"\r\n [ngTemplateOutletContext]=\"getCustomOptionContext()\"\r\n />\r\n </div>\r\n } @if (isLoading()) {\r\n <ng-template #defaultLoadingPlaceholderTemplate>\r\n <div class=\"ard-option ard-option-disabled\">{{ loadingPlaceholderText() }}</div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"loadingPlaceholderTemplate()?.template || defaultLoadingPlaceholderTemplate\"\r\n [ngTemplateOutletContext]=\"getSearchContext()\"\r\n />\r\n }\r\n </ard-dropdown-panel>\r\n</ng-template>\r\n", styles: [".ard-select .ard-select-container{display:flex;cursor:pointer}.ard-select .ard-placeholder,.ard-select .ard-value,.ard-select .ard-dropdown-arrow-wrapper,.ard-select .ard-clear-btn-wrapper{-webkit-user-select:none;user-select:none}.ard-select .ard-clear-btn,.ard-select .ard-dropdown-arrow{border:none;background:transparent;padding:0;box-sizing:content-box}.ard-select .ard-option-disabled{pointer-events:none}.ard-select .ard-select-value{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ard-select .ard-select-value[hidden=true]{display:none}.ard-select .ard-searchable .ard-select-value-container{cursor:text}.ard-select .ard-dropdown-arrow-wrapper{position:relative}.ard-select .ard-dropdown-arrow-wrapper .ard-hitbox{position:absolute;left:-4px;right:-4px;aspect-ratio:1}.ard-select-dropdown-panel .ard-optgroup,.ard-select-dropdown-panel .ard-option{-webkit-user-select:none;user-select:none}\n"] }]
|
|
4346
|
+
], template: "<ard-form-field-frame\r\n [appearance]=\"appearance()\"\r\n [variant]=\"variant()\"\r\n [compact]=\"compact()\"\r\n [readonly]=\"readonly()\"\r\n [isFocused]=\"isFocused()\"\r\n [hasError]=\"hasError()\"\r\n [isSuccess]=\"isSuccess()\"\r\n [prefixTemplate]=\"prefixTemplate()?.template\"\r\n [suffixTemplate]=\"suffixTemplate()?.template\"\r\n>\r\n <div\r\n class=\"ard-select\"\r\n #dropdownHost\r\n (click)=\"handleAnywhereClick($event)\"\r\n [class.ard-has-value]=\"itemStorage.isAnyItemSelected()\"\r\n [ngClass]=\"ngClasses()\"\r\n >\r\n <div class=\"ard-select-value-container\">\r\n @if (shouldDisplayPlaceholder()) {\r\n <ng-template #defaultPlaceholderTemplate>\r\n <div class=\"ard-placeholder\">{{ placeholder() }}</div>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"placeholderTemplate()?.template || defaultPlaceholderTemplate\" />\r\n } @if (shouldDisplayValue()) { @for (item of itemStorage.selectedItems(); track item.index) {\r\n <div\r\n class=\"ard-select-value\"\r\n [class.ard-value-disabled]=\"item.disabled\"\r\n [attr.hidden]=\"!isValueWithinDisplayLimit($index)\"\r\n >\r\n @if (isValueWithinDisplayLimit($index)) {\r\n <ng-template\r\n [ngTemplateOutlet]=\"valueTemplate()?.template || (multiselectable() ? defaultMultiValueTemplate : defaultValueTemplate)\"\r\n [ngTemplateOutletContext]=\"valueContextGenerator()(item)\"\r\n />\r\n }\r\n </div>\r\n }\r\n\r\n <ng-template\r\n #defaultValueTemplate\r\n let-label=\"label\"\r\n >\r\n <div\r\n class=\"ard-select-value\"\r\n [innerHTML]=\"isItemsInputUsed ? (label | escapeHTML) : label\"\r\n ></div>\r\n </ng-template>\r\n <ng-template\r\n #defaultMultiValueTemplate\r\n let-item\r\n let-label=\"label\"\r\n let-unselect=\"unselect\"\r\n >\r\n <ard-deletable-chip\r\n (delete)=\"unselect(item)\"\r\n [variant]=\"variant()\"\r\n compact\r\n appearance=\"outlined\"\r\n >\r\n <div [innerHTML]=\"isItemsInputUsed ? (label | escapeHTML) : label\"></div>\r\n </ard-deletable-chip>\r\n </ng-template>\r\n } @if (itemStorage.isAnyItemSelected() && shouldShowItemDisplayLimit()) {\r\n <div class=\"ard-overflow-indicator\">\r\n <ng-template\r\n [ngTemplateOutlet]=\"itemDisplayLimitTemplate()?.template || defaultItemDisplayLimitTemplate\"\r\n [ngTemplateOutletContext]=\"getItemDisplayLimitContext()\"\r\n />\r\n\r\n <ng-template\r\n #defaultItemDisplayLimitTemplate\r\n let-count=\"overflowCount\"\r\n >\r\n <div>{{ count }} more...</div>\r\n </ng-template>\r\n </div>\r\n }\r\n\r\n <div\r\n class=\"ard-search-input\"\r\n role=\"combobox\"\r\n aria-haspopup=\"listbox\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-owns]=\"isOpen() ? htmlId() : null\"\r\n >\r\n <input\r\n #searchInput\r\n #focusableElement\r\n type=\"text\"\r\n [attr.id]=\"searchInputId()\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n [readonly]=\"isInputElementReadonly()\"\r\n [disabled]=\"disabled()\"\r\n [value]=\"searchTerm()\"\r\n aria-autocomplete=\"list\"\r\n [attr.aria-controls]=\"isOpen() ? htmlId() : null\"\r\n (input)=\"filter(searchInput.value)\"\r\n (change)=\"$event.stopPropagation()\"\r\n (focus)=\"onFocus($event)\"\r\n (focus)=\"onSearchInputFocus()\"\r\n (blur)=\"onBlur($event)\"\r\n (blur)=\"onSearchInputBlur()\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div class=\"ard-select-controls\">\r\n @if (isLoading()) {\r\n <ng-template #defaultLoadingSpinnerTemplate>\r\n <div class=\"ard-spinner\"></div>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"loadingSpinnerTemplate()?.template || defaultLoadingSpinnerTemplate\" />\r\n } @if (shouldShowClearButton()) {\r\n <ard-clear-button\r\n [title]=\"clearButtonTitle()\"\r\n (click)=\"handleClearButtonClick($event)\"\r\n />\r\n } @if (!readonly()) {\r\n <button\r\n type=\"button\"\r\n class=\"ard-dropdown-arrow-wrapper\"\r\n (click)=\"handleDropdownArrowClick($event)\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n >\r\n <ng-template #defaultDropdownArrowTemplate>\r\n <span class=\"ard-dropdown-arrow\"></span>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"dropdownArrowTemplate()?.template || defaultDropdownArrowTemplate\" />\r\n <div class=\"ard-hitbox\"></div>\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n</ard-form-field-frame>\r\n\r\n<ng-template #dropdownTemplate>\r\n <ard-dropdown-panel\r\n class=\"ard-dropdown-panel ard-select-dropdown-panel\"\r\n role=\"listbox\"\r\n aria-label=\"Options list\"\r\n [headerTemplate]=\"dropdownHeaderTemplate()?.template ?? null\"\r\n [footerTemplate]=\"dropdownFooterTemplate()?.template ?? null\"\r\n [appearance]=\"dropdownAppearanceOrDefault()\"\r\n [variant]=\"dropdownVariantOrDefault()\"\r\n [isOpen]=\"true\"\r\n [filterValue]=\"searchTerm()\"\r\n [panelId]=\"htmlId()\"\r\n [compact]=\"compact()\"\r\n (ardClickOutside)=\"handleOutsideClick($event)\"\r\n (mousemove)=\"onMouseMove()\"\r\n (scroll)=\"scrollEvent.emit($event)\"\r\n (scrollToEnd)=\"scrollToEndEvent.emit($event)\"\r\n >\r\n @if (!shouldShowNoItemsFound()) { @for (group of itemStorage.groups(); track $index) {\r\n <div\r\n class=\"ard-optgroup\"\r\n role=\"group\"\r\n [class.ard-group-disabled]=\"group.disabled\"\r\n (mouseover)=\"onGroupMouseover(group)\"\r\n (click)=\"onGroupClick(group)\"\r\n >\r\n @if (!!group.label) {\r\n <ng-template\r\n #defaultOptgroupTemplate\r\n let-label=\"label\"\r\n >\r\n <span\r\n class=\"ard-optgroup-label\"\r\n [innerHTML]=\"isItemsInputUsed ? (label | escapeHTML) : label\"\r\n ></span>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"optgroupTemplate()?.template || defaultOptgroupTemplate\"\r\n [ngTemplateOutletContext]=\"groupContextGenerator()(group)\"\r\n />\r\n }\r\n\r\n <div class=\"ard-optgroup-children\">\r\n @for (option of group.children; track option.index) {\r\n <div\r\n class=\"ard-option\"\r\n role=\"option\"\r\n [class.ard-option-disabled]=\"option.disabled || (itemStorage.isItemLimitReached() && !option.selected)\"\r\n [class.ard-option-selected]=\"option.selected\"\r\n [class.ard-option-highlighted]=\"option.highlighted\"\r\n [class.ard-option-highlighted-recent]=\"option.highlighted_recently\"\r\n [attr.aria-selected]=\"option.selected\"\r\n [attr.id]=\"htmlId() + '-' + option.index\"\r\n (click)=\"onItemClick(option, $event)\"\r\n (mouseover)=\"onItemMouseOver($event)\"\r\n (mouseenter)=\"onItemMouseEnter(option, $event)\"\r\n (mouseleave)=\"onItemMouseLeave(option, $event)\"\r\n >\r\n <div class=\"ard-option-label\">\r\n <ng-template\r\n #defaultOptionTemplate\r\n let-label=\"label\"\r\n >\r\n <span [innerHTML]=\"isItemsInputUsed ? (label | escapeHTML) : label\"></span>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"optionTemplate()?.template || defaultOptionTemplate\"\r\n [ngTemplateOutletContext]=\"optionContextGenerator()(option)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n } } @if (shouldShowNoItemsFound()) {\r\n <ng-template #defaultNoItemsFoundTemplate>\r\n <div class=\"ard-option ard-option-disabled\">{{ noItemsFoundText() }}</div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"noItemsFoundTemplate()?.template || defaultNoItemsFoundTemplate\"\r\n [ngTemplateOutletContext]=\"getSearchContext()\"\r\n />\r\n } @if (shouldShowAddCustom()) {\r\n <div\r\n class=\"ard-option ard-option-highlighted ard-add-custom\"\r\n (click)=\"addCustomOption(searchTerm())\"\r\n >\r\n <ng-template\r\n #defaultAddCustomTemplate\r\n let-searchTerm\r\n >\r\n <span class=\"ard-add-custom-label\">{{ addCustomOptionText() }}</span>\r\n <span class=\"ard-add-custom-value\">\"{{ searchTerm }}\"</span>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"addCustomTemplate()?.template || defaultAddCustomTemplate\"\r\n [ngTemplateOutletContext]=\"getCustomOptionContext()\"\r\n />\r\n </div>\r\n } @if (isLoading()) {\r\n <ng-template #defaultLoadingPlaceholderTemplate>\r\n <div class=\"ard-option ard-option-disabled\">{{ loadingPlaceholderText() }}</div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"loadingPlaceholderTemplate()?.template || defaultLoadingPlaceholderTemplate\"\r\n [ngTemplateOutletContext]=\"getSearchContext()\"\r\n />\r\n }\r\n </ard-dropdown-panel>\r\n</ng-template>\r\n", styles: [".ard-select .ard-select-container{display:flex;cursor:pointer}.ard-select .ard-placeholder,.ard-select .ard-value,.ard-select .ard-dropdown-arrow-wrapper,.ard-select .ard-clear-btn-wrapper{-webkit-user-select:none;user-select:none}.ard-select .ard-clear-btn,.ard-select .ard-dropdown-arrow{border:none;background:transparent;padding:0;box-sizing:content-box}.ard-select .ard-option-disabled{pointer-events:none}.ard-select .ard-select-value{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ard-select .ard-select-value[hidden=true]{display:none}.ard-select .ard-searchable .ard-select-value-container{cursor:text}.ard-select .ard-dropdown-arrow-wrapper{position:relative}.ard-select .ard-dropdown-arrow-wrapper .ard-hitbox{position:absolute;left:-4px;right:-4px;aspect-ratio:1}.ard-select-dropdown-panel .ard-optgroup,.ard-select-dropdown-panel .ard-option{-webkit-user-select:none;user-select:none}\n"] }]
|
|
4366
4347
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
4367
4348
|
type: Inject,
|
|
4368
4349
|
args: [ARD_SELECT_DEFAULTS]
|
|
@@ -4376,12 +4357,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
4376
4357
|
args: [ArdiumOptionComponent]
|
|
4377
4358
|
}], value: [{
|
|
4378
4359
|
type: Input
|
|
4379
|
-
}], dropdownHost: [{
|
|
4380
|
-
type: ViewChild,
|
|
4381
|
-
args: ['dropdownHost', { read: ElementRef }]
|
|
4382
|
-
}], dropdownTemplate: [{
|
|
4383
|
-
type: ViewChild,
|
|
4384
|
-
args: ['dropdownTemplate', { read: TemplateRef }]
|
|
4385
4360
|
}], onWindowResize: [{
|
|
4386
4361
|
type: HostListener,
|
|
4387
4362
|
args: ['window:resize']
|
|
@@ -9110,46 +9085,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
9110
9085
|
class SimpleItemStorage {
|
|
9111
9086
|
constructor(_ardParentComp) {
|
|
9112
9087
|
this._ardParentComp = _ardParentComp;
|
|
9113
|
-
this._items =
|
|
9114
|
-
this._highlightedItems = signal([]);
|
|
9115
|
-
this._selectedItems = signal([]);
|
|
9088
|
+
this._items = arraySignal([]);
|
|
9116
9089
|
/**
|
|
9117
9090
|
* Gets all items.
|
|
9118
9091
|
*/
|
|
9119
|
-
this.items = this._items
|
|
9092
|
+
this.items = computed(() => [...this._items()]);
|
|
9120
9093
|
/**
|
|
9121
|
-
* Gets all currently
|
|
9094
|
+
* Gets all currently selected items.
|
|
9122
9095
|
*/
|
|
9123
|
-
this.
|
|
9096
|
+
this.selectedItems = computed(() => this.items().filter(item => item.selected));
|
|
9124
9097
|
/**
|
|
9125
|
-
* Gets all currently
|
|
9098
|
+
* Gets all currently highlighted items.
|
|
9126
9099
|
*/
|
|
9127
|
-
this.
|
|
9100
|
+
this.highlightedItems = computed(() => this.items().filter(item => item.highlighted));
|
|
9128
9101
|
/**
|
|
9129
9102
|
* Gets the values of the currently selected items.
|
|
9130
9103
|
*/
|
|
9131
|
-
this.value = computed(() => this._itemsToValue(this.
|
|
9104
|
+
this.value = computed(() => this._itemsToValue(this.selectedItems()));
|
|
9132
9105
|
/**
|
|
9133
9106
|
* Returns true if at least one item is highlighted, otherwise false.
|
|
9134
9107
|
*/
|
|
9135
|
-
this.isAnyItemHighlighted = computed(() => this.
|
|
9108
|
+
this.isAnyItemHighlighted = computed(() => this.highlightedItems().length > 0);
|
|
9109
|
+
/**
|
|
9110
|
+
* Finds all highlightable items. An item is considered highlightable if it is **not** disabled.
|
|
9111
|
+
* @returns An array of all highlightable items.
|
|
9112
|
+
*/
|
|
9113
|
+
this._highlightableItems = computed(() => this.items().filter(item => !item.disabled && (this.isItemLimitReached() ? item.selected : true)));
|
|
9114
|
+
this.itemsLeftUntilLimit = computed(() => this._ardParentComp.multiselectable() && isDefined(this._ardParentComp.maxSelectedItems())
|
|
9115
|
+
? this._ardParentComp.maxSelectedItems() - this.selectedItems().length
|
|
9116
|
+
: 1);
|
|
9136
9117
|
/**
|
|
9137
9118
|
* Returns true if the parent component defines the limit of concurrently selectable items and the amount of currently selected items matches that limit. Otherwise returns false.
|
|
9138
9119
|
*
|
|
9139
9120
|
* **TLDR**: true if `maxSelectedItems` is defined and the number of selected items matches that value.
|
|
9140
9121
|
*/
|
|
9141
|
-
this.isItemLimitReached = computed(() =>
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
return false;
|
|
9145
|
-
}
|
|
9146
|
-
return msi <= this.selectedItems().length;
|
|
9147
|
-
});
|
|
9148
|
-
/**
|
|
9149
|
-
* Finds all highlightable items. An item is considered highlightable if it is **not** disabled.
|
|
9150
|
-
* @returns An array of all highlightable items.
|
|
9151
|
-
*/
|
|
9152
|
-
this.highlightableItems = computed(() => this._items().filter(item => !item.disabled()));
|
|
9122
|
+
this.isItemLimitReached = computed(() => this.itemsLeftUntilLimit() <= 0);
|
|
9123
|
+
this._areItemsInitialized = false;
|
|
9124
|
+
this._valueBeforeItemsSet = null;
|
|
9153
9125
|
}
|
|
9154
9126
|
/**
|
|
9155
9127
|
* Maps an array of items into their values.
|
|
@@ -9157,7 +9129,21 @@ class SimpleItemStorage {
|
|
|
9157
9129
|
* @returns An array of item values.
|
|
9158
9130
|
*/
|
|
9159
9131
|
_itemsToValue(items) {
|
|
9160
|
-
return items.map(item => item.value
|
|
9132
|
+
return items.map(item => item.value);
|
|
9133
|
+
}
|
|
9134
|
+
_updateItems(updateFn) {
|
|
9135
|
+
this._items.map(updateFn);
|
|
9136
|
+
}
|
|
9137
|
+
_updateItemsFromArray(updateFn, itemsToUpdate) {
|
|
9138
|
+
this._items.update(items => {
|
|
9139
|
+
for (const itemToUpdate of itemsToUpdate) {
|
|
9140
|
+
const item = items[itemToUpdate.index];
|
|
9141
|
+
if (item) {
|
|
9142
|
+
items[itemToUpdate.index] = updateFn(item);
|
|
9143
|
+
}
|
|
9144
|
+
}
|
|
9145
|
+
return items;
|
|
9146
|
+
});
|
|
9161
9147
|
}
|
|
9162
9148
|
/**
|
|
9163
9149
|
* Sets the component's items. Takes into account the values defined by the parent component for `valueFrom`, `labelFrom`, and `disabledFrom`.
|
|
@@ -9165,6 +9151,7 @@ class SimpleItemStorage {
|
|
|
9165
9151
|
* @returns true if at least one of the items is of primitive type, otherwise false.
|
|
9166
9152
|
*/
|
|
9167
9153
|
setItems(items) {
|
|
9154
|
+
this._areItemsInitialized = true;
|
|
9168
9155
|
let areItemsPrimitive = false;
|
|
9169
9156
|
if (items.some(isPrimitive)) {
|
|
9170
9157
|
items = items.map(this._primitiveItemsMapFn);
|
|
@@ -9173,6 +9160,10 @@ class SimpleItemStorage {
|
|
|
9173
9160
|
this._items.set(items.map((item, index) => {
|
|
9174
9161
|
return this._setItemsMapFn(item, index, areItemsPrimitive);
|
|
9175
9162
|
}));
|
|
9163
|
+
if (this._valueBeforeItemsSet !== null) {
|
|
9164
|
+
this.writeValue(this._valueBeforeItemsSet);
|
|
9165
|
+
this._valueBeforeItemsSet = null;
|
|
9166
|
+
}
|
|
9176
9167
|
}
|
|
9177
9168
|
_primitiveItemsMapFn(item) {
|
|
9178
9169
|
return { value: item };
|
|
@@ -9180,13 +9171,13 @@ class SimpleItemStorage {
|
|
|
9180
9171
|
_setItemsMapFn(rawItemData, index, areItemsPrimitive) {
|
|
9181
9172
|
if (areItemsPrimitive) {
|
|
9182
9173
|
return {
|
|
9183
|
-
itemData:
|
|
9174
|
+
itemData: rawItemData,
|
|
9184
9175
|
index: index,
|
|
9185
|
-
value:
|
|
9186
|
-
label:
|
|
9187
|
-
disabled:
|
|
9188
|
-
selected:
|
|
9189
|
-
highlighted:
|
|
9176
|
+
value: rawItemData.value,
|
|
9177
|
+
label: rawItemData.value?.toString?.() ?? String(rawItemData.value),
|
|
9178
|
+
disabled: false,
|
|
9179
|
+
selected: false,
|
|
9180
|
+
highlighted: false,
|
|
9190
9181
|
};
|
|
9191
9182
|
}
|
|
9192
9183
|
//get value
|
|
@@ -9203,13 +9194,13 @@ class SimpleItemStorage {
|
|
|
9203
9194
|
}
|
|
9204
9195
|
//return
|
|
9205
9196
|
return {
|
|
9206
|
-
itemData:
|
|
9197
|
+
itemData: rawItemData,
|
|
9207
9198
|
index: index,
|
|
9208
|
-
value:
|
|
9209
|
-
label:
|
|
9210
|
-
disabled:
|
|
9211
|
-
selected:
|
|
9212
|
-
highlighted:
|
|
9199
|
+
value: value,
|
|
9200
|
+
label: label?.toString?.() ?? String(label),
|
|
9201
|
+
disabled: disabled,
|
|
9202
|
+
selected: false,
|
|
9203
|
+
highlighted: false,
|
|
9213
9204
|
};
|
|
9214
9205
|
}
|
|
9215
9206
|
/**
|
|
@@ -9217,6 +9208,10 @@ class SimpleItemStorage {
|
|
|
9217
9208
|
* @param ngModel The value of the ngModel to set.
|
|
9218
9209
|
*/
|
|
9219
9210
|
writeValue(ngModel) {
|
|
9211
|
+
if (!this._areItemsInitialized) {
|
|
9212
|
+
this._valueBeforeItemsSet = ngModel;
|
|
9213
|
+
return;
|
|
9214
|
+
}
|
|
9220
9215
|
this._forceUnselectAll();
|
|
9221
9216
|
if (!this._validateWriteValue(ngModel))
|
|
9222
9217
|
return;
|
|
@@ -9282,12 +9277,12 @@ class SimpleItemStorage {
|
|
|
9282
9277
|
let findBy;
|
|
9283
9278
|
const cmpFn = this._ardParentComp.compareWith();
|
|
9284
9279
|
if (isDefined(cmpFn)) {
|
|
9285
|
-
findBy = item => cmpFn(valueToFind, item.value
|
|
9280
|
+
findBy = item => cmpFn(valueToFind, item.value);
|
|
9286
9281
|
}
|
|
9287
9282
|
else {
|
|
9288
|
-
findBy = item => item.value
|
|
9283
|
+
findBy = item => item.value === valueToFind;
|
|
9289
9284
|
}
|
|
9290
|
-
return this.
|
|
9285
|
+
return this.items().find(item => findBy(item));
|
|
9291
9286
|
}
|
|
9292
9287
|
/**
|
|
9293
9288
|
* Unselects all selected items.
|
|
@@ -9296,27 +9291,15 @@ class SimpleItemStorage {
|
|
|
9296
9291
|
* @returns An array of items cleared, mapped to only their values.
|
|
9297
9292
|
*/
|
|
9298
9293
|
unselectAll() {
|
|
9299
|
-
|
|
9300
|
-
item.selected.set(false);
|
|
9301
|
-
}
|
|
9302
|
-
const ret = this.value();
|
|
9303
|
-
if (this._ardParentComp.isValueRequired() && this._selectedItems().length > 0) {
|
|
9304
|
-
this._selectedItems().first().selected.set(true);
|
|
9305
|
-
ret.splice(0, 1);
|
|
9306
|
-
}
|
|
9307
|
-
this._selectedItems.set([]);
|
|
9308
|
-
return ret;
|
|
9294
|
+
return this.unselectItem(...this.selectedItems());
|
|
9309
9295
|
}
|
|
9310
9296
|
/**
|
|
9311
9297
|
* Unselects all selected items, no matter what the component settings are.
|
|
9312
9298
|
* @returns An array of items cleared, mapped to only their values.
|
|
9313
9299
|
*/
|
|
9314
9300
|
_forceUnselectAll() {
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
}
|
|
9318
|
-
const ret = this._itemsToValue(this._selectedItems());
|
|
9319
|
-
this._selectedItems.set([]);
|
|
9301
|
+
const ret = this.value();
|
|
9302
|
+
this._updateItems(item => ({ ...item, selected: false }));
|
|
9320
9303
|
return ret;
|
|
9321
9304
|
}
|
|
9322
9305
|
/**
|
|
@@ -9333,25 +9316,31 @@ class SimpleItemStorage {
|
|
|
9333
9316
|
if (this.isItemLimitReached()) {
|
|
9334
9317
|
return [[], [], this._itemsToValue(items)];
|
|
9335
9318
|
}
|
|
9336
|
-
|
|
9337
|
-
if (!this._ardParentComp.multiselectable()) {
|
|
9338
|
-
unselected = this._forceUnselectAll();
|
|
9339
|
-
}
|
|
9319
|
+
const itemsLeftUntilLimit = this.itemsLeftUntilLimit();
|
|
9340
9320
|
let itemsSelectedCount = 0;
|
|
9341
|
-
const
|
|
9321
|
+
const newItemsArray = [...this.items()];
|
|
9342
9322
|
for (const item of items) {
|
|
9343
9323
|
itemsSelectedCount++;
|
|
9344
|
-
if (item.selected
|
|
9324
|
+
if (item.selected)
|
|
9345
9325
|
continue;
|
|
9346
|
-
if (
|
|
9326
|
+
if (itemsSelectedCount > itemsLeftUntilLimit) {
|
|
9347
9327
|
break;
|
|
9348
9328
|
}
|
|
9349
|
-
item.selected
|
|
9350
|
-
itemsSelected.push(item);
|
|
9329
|
+
newItemsArray[item.index] = { ...item, selected: true };
|
|
9351
9330
|
}
|
|
9352
|
-
this.
|
|
9353
|
-
|
|
9354
|
-
|
|
9331
|
+
const itemsUnselected = this._ardParentComp.multiselectable()
|
|
9332
|
+
? []
|
|
9333
|
+
: this.selectedItems().filter(item => !items.find(v => v.value === item.value));
|
|
9334
|
+
for (const item of itemsUnselected) {
|
|
9335
|
+
newItemsArray[item.index] = { ...item, selected: false };
|
|
9336
|
+
}
|
|
9337
|
+
const itemsSelected = items.slice(0, itemsSelectedCount);
|
|
9338
|
+
const itemsFailedToSelect = items.slice(itemsSelectedCount);
|
|
9339
|
+
const isAnyNewItemToBeSelected = !!itemsSelected.find(item => !this.selectedItems().find(v => v.value === item.value));
|
|
9340
|
+
if (isAnyNewItemToBeSelected) {
|
|
9341
|
+
this._items.set(newItemsArray);
|
|
9342
|
+
}
|
|
9343
|
+
return [this._itemsToValue(itemsSelected), this._itemsToValue(itemsUnselected), this._itemsToValue(itemsFailedToSelect)];
|
|
9355
9344
|
}
|
|
9356
9345
|
/**
|
|
9357
9346
|
*
|
|
@@ -9359,27 +9348,28 @@ class SimpleItemStorage {
|
|
|
9359
9348
|
* @returns An array of items unselected, mapped to only their values.
|
|
9360
9349
|
*/
|
|
9361
9350
|
unselectItem(...items) {
|
|
9362
|
-
let
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9351
|
+
let shouldKeepFirstSelected = this._ardParentComp.isValueRequired();
|
|
9352
|
+
const unselectedItems = [];
|
|
9353
|
+
this._updateItemsFromArray(item => {
|
|
9354
|
+
if (item.selected && shouldKeepFirstSelected) {
|
|
9355
|
+
shouldKeepFirstSelected = false;
|
|
9356
|
+
return item;
|
|
9367
9357
|
}
|
|
9368
|
-
if (
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
|
|
9373
|
-
|
|
9358
|
+
if (item.selected) {
|
|
9359
|
+
unselectedItems.push(item);
|
|
9360
|
+
}
|
|
9361
|
+
return {
|
|
9362
|
+
...item,
|
|
9363
|
+
selected: false,
|
|
9364
|
+
};
|
|
9365
|
+
}, items);
|
|
9366
|
+
return this._itemsToValue(unselectedItems);
|
|
9374
9367
|
}
|
|
9375
9368
|
/**
|
|
9376
9369
|
* Unhighlights all currently highlighted items.
|
|
9377
9370
|
*/
|
|
9378
9371
|
unhighlightAll() {
|
|
9379
|
-
|
|
9380
|
-
item.highlighted.set(false);
|
|
9381
|
-
}
|
|
9382
|
-
this._highlightedItems.set([]);
|
|
9372
|
+
this._updateItems(item => ({ ...item, highlighted: false }));
|
|
9383
9373
|
}
|
|
9384
9374
|
/**
|
|
9385
9375
|
* Highlights the given item, while unhighlighting all other items. Does nothing when the item is disabled.
|
|
@@ -9387,7 +9377,7 @@ class SimpleItemStorage {
|
|
|
9387
9377
|
* @returns The highlighted item.
|
|
9388
9378
|
*/
|
|
9389
9379
|
highlightSingleItem(item) {
|
|
9390
|
-
if (!item || item.disabled
|
|
9380
|
+
if (!item || item.disabled)
|
|
9391
9381
|
return null;
|
|
9392
9382
|
this.unhighlightAll();
|
|
9393
9383
|
return this.highlightItem(item);
|
|
@@ -9398,10 +9388,7 @@ class SimpleItemStorage {
|
|
|
9398
9388
|
* @returns The last highlighted item.
|
|
9399
9389
|
*/
|
|
9400
9390
|
highlightItem(...items) {
|
|
9401
|
-
|
|
9402
|
-
item.highlighted.set(true);
|
|
9403
|
-
}
|
|
9404
|
-
this._highlightedItems.update(v => [...v, ...items]);
|
|
9391
|
+
this._updateItemsFromArray(item => ({ ...item, highlighted: true }), items);
|
|
9405
9392
|
return items.last();
|
|
9406
9393
|
}
|
|
9407
9394
|
/**
|
|
@@ -9409,12 +9396,7 @@ class SimpleItemStorage {
|
|
|
9409
9396
|
* @param items A rest operator array of items to be unhighlighted.
|
|
9410
9397
|
*/
|
|
9411
9398
|
unhighlightItem(...items) {
|
|
9412
|
-
|
|
9413
|
-
if (!item || !item.highlighted())
|
|
9414
|
-
return;
|
|
9415
|
-
item.highlighted.set(false);
|
|
9416
|
-
}
|
|
9417
|
-
this._highlightedItems.update(v => v.filter(v => v.highlighted()));
|
|
9399
|
+
this._updateItemsFromArray(item => ({ ...item, highlighted: false }), items);
|
|
9418
9400
|
}
|
|
9419
9401
|
/**
|
|
9420
9402
|
* Highlights the first item out of all items.
|
|
@@ -9422,7 +9404,7 @@ class SimpleItemStorage {
|
|
|
9422
9404
|
*/
|
|
9423
9405
|
highlightFirstItem() {
|
|
9424
9406
|
this.unhighlightAll();
|
|
9425
|
-
const itemToHighlight = this.
|
|
9407
|
+
const itemToHighlight = this._highlightableItems().first();
|
|
9426
9408
|
return this.highlightItem(itemToHighlight);
|
|
9427
9409
|
}
|
|
9428
9410
|
/**
|
|
@@ -9431,14 +9413,14 @@ class SimpleItemStorage {
|
|
|
9431
9413
|
*/
|
|
9432
9414
|
highlightLastItem() {
|
|
9433
9415
|
this.unhighlightAll();
|
|
9434
|
-
const itemToHighlight = this.
|
|
9416
|
+
const itemToHighlight = this._highlightableItems().last();
|
|
9435
9417
|
return this.highlightItem(itemToHighlight);
|
|
9436
9418
|
}
|
|
9437
9419
|
/**
|
|
9438
9420
|
* Highlights all non-disabled items.
|
|
9439
9421
|
*/
|
|
9440
9422
|
highlightAllItems() {
|
|
9441
|
-
const itemsToHighlight = this.
|
|
9423
|
+
const itemsToHighlight = this._highlightableItems();
|
|
9442
9424
|
this.highlightItem(...itemsToHighlight);
|
|
9443
9425
|
}
|
|
9444
9426
|
/**
|
|
@@ -9454,7 +9436,7 @@ class SimpleItemStorage {
|
|
|
9454
9436
|
return this.highlightFirstItem();
|
|
9455
9437
|
}
|
|
9456
9438
|
const currentItem = this.highlightedItems().last();
|
|
9457
|
-
const itemsWithoutDisabled = this._items().filter(item => !item.disabled
|
|
9439
|
+
const itemsWithoutDisabled = this._items().filter(item => !item.disabled && (!this.isItemLimitReached() || item.selected));
|
|
9458
9440
|
const currentIndexInItems = itemsWithoutDisabled.findIndex(item => item.index === currentItem.index);
|
|
9459
9441
|
let nextItemIndex = currentIndexInItems + offset;
|
|
9460
9442
|
if (nextItemIndex >= itemsWithoutDisabled.length) {
|
|
@@ -9465,7 +9447,7 @@ class SimpleItemStorage {
|
|
|
9465
9447
|
}
|
|
9466
9448
|
const itemToHighlight = itemsWithoutDisabled[nextItemIndex];
|
|
9467
9449
|
if (hasShift && this._ardParentComp.multiselectable()) {
|
|
9468
|
-
if (itemToHighlight.highlighted
|
|
9450
|
+
if (itemToHighlight.highlighted) {
|
|
9469
9451
|
this.unhighlightItem(currentItem);
|
|
9470
9452
|
}
|
|
9471
9453
|
return this.highlightItem(itemToHighlight);
|
|
@@ -9498,13 +9480,17 @@ class _SelectableListComponentBase extends _FormFieldComponentBase {
|
|
|
9498
9480
|
this.disabledFrom = input(this._DEFAULTS.disabledFrom);
|
|
9499
9481
|
this.compareWith = input(this._DEFAULTS.compareWith);
|
|
9500
9482
|
//! multiselectable
|
|
9501
|
-
this.multiselectable = input(this._DEFAULTS.multiselectable, {
|
|
9483
|
+
this.multiselectable = input(this._DEFAULTS.multiselectable, {
|
|
9484
|
+
transform: v => coerceBooleanProperty(v),
|
|
9485
|
+
});
|
|
9502
9486
|
this.singleselectable = computed(() => !this.multiselectable());
|
|
9503
9487
|
//! require value
|
|
9504
9488
|
this.requireValue = input(this._DEFAULTS.requireValue, { transform: v => coerceBooleanProperty(v) });
|
|
9505
9489
|
this.isValueRequired = computed(() => this.requireValue() || !this.multiselectable());
|
|
9506
9490
|
//! coerced properties
|
|
9507
|
-
this.invertDisabled = input(this._DEFAULTS.invertDisabled, {
|
|
9491
|
+
this.invertDisabled = input(this._DEFAULTS.invertDisabled, {
|
|
9492
|
+
transform: v => coerceBooleanProperty(v),
|
|
9493
|
+
});
|
|
9508
9494
|
this.maxSelectedItems = input(this._DEFAULTS.maxSelectedItems, {
|
|
9509
9495
|
transform: v => coerceNumberProperty(v, undefined),
|
|
9510
9496
|
});
|
|
@@ -9516,9 +9502,20 @@ class _SelectableListComponentBase extends _FormFieldComponentBase {
|
|
|
9516
9502
|
this.highlightedItems = computed(() => this.itemStorage.highlightedItems());
|
|
9517
9503
|
this.firstHighlightedItem = computed(() => this.highlightedItems()?.first());
|
|
9518
9504
|
this.isItemLimitReached = computed(() => this.itemStorage.isItemLimitReached());
|
|
9505
|
+
//! context providers
|
|
9506
|
+
this.optionContextGenerator = computed(() => item => ({
|
|
9507
|
+
$implicit: item,
|
|
9508
|
+
item,
|
|
9509
|
+
index: item.index,
|
|
9510
|
+
value: item.value,
|
|
9511
|
+
label: item.label,
|
|
9512
|
+
selected: item.selected,
|
|
9513
|
+
highlighted: item.highlighted,
|
|
9514
|
+
itemData: item.itemData,
|
|
9515
|
+
disabled: item.disabled,
|
|
9516
|
+
}));
|
|
9519
9517
|
this.valueChange = output();
|
|
9520
9518
|
//! output events
|
|
9521
|
-
this.changeEvent = output({ alias: 'change' });
|
|
9522
9519
|
this.addEvent = output({ alias: 'add' });
|
|
9523
9520
|
this.removeEvent = output({ alias: 'remove' });
|
|
9524
9521
|
//! highligh-related
|
|
@@ -9555,7 +9552,6 @@ class _SelectableListComponentBase extends _FormFieldComponentBase {
|
|
|
9555
9552
|
_emitChange() {
|
|
9556
9553
|
const value = this.singleselectable() ? this.itemStorage.value()[0] : this.itemStorage.value();
|
|
9557
9554
|
this._onChangeRegistered?.(value);
|
|
9558
|
-
this.changeEvent.emit(value);
|
|
9559
9555
|
this.valueChange.emit(value);
|
|
9560
9556
|
}
|
|
9561
9557
|
_onTouched() {
|
|
@@ -9577,14 +9573,6 @@ class _SelectableListComponentBase extends _FormFieldComponentBase {
|
|
|
9577
9573
|
if (!this.touched())
|
|
9578
9574
|
this.lastBlurTimestamp.set(Date.now());
|
|
9579
9575
|
}
|
|
9580
|
-
//! context providers
|
|
9581
|
-
getOptionContext(item) {
|
|
9582
|
-
return {
|
|
9583
|
-
$implicit: item,
|
|
9584
|
-
item,
|
|
9585
|
-
itemData: item.itemData(),
|
|
9586
|
-
};
|
|
9587
|
-
}
|
|
9588
9576
|
//! value input & output
|
|
9589
9577
|
set value(newValue) {
|
|
9590
9578
|
if (this.multiselectable() && !Array.isArray(newValue))
|
|
@@ -9593,7 +9581,7 @@ class _SelectableListComponentBase extends _FormFieldComponentBase {
|
|
|
9593
9581
|
}
|
|
9594
9582
|
//! item selection handlers
|
|
9595
9583
|
toggleItem(item) {
|
|
9596
|
-
if (item.selected
|
|
9584
|
+
if (item.selected) {
|
|
9597
9585
|
if (this.singleselectable())
|
|
9598
9586
|
return;
|
|
9599
9587
|
this.unselectItem(item);
|
|
@@ -9712,7 +9700,7 @@ class _SelectableListComponentBase extends _FormFieldComponentBase {
|
|
|
9712
9700
|
this.itemStorage.highlightAllItems();
|
|
9713
9701
|
}
|
|
9714
9702
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: _SelectableListComponentBase, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
9715
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.15", type: _SelectableListComponentBase, isStandalone: true, inputs: { valueFrom: { classPropertyName: "valueFrom", publicName: "valueFrom", isSignal: true, isRequired: false, transformFunction: null }, labelFrom: { classPropertyName: "labelFrom", publicName: "labelFrom", isSignal: true, isRequired: false, transformFunction: null }, disabledFrom: { classPropertyName: "disabledFrom", publicName: "disabledFrom", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: false, isRequired: false, transformFunction: null }, multiselectable: { classPropertyName: "multiselectable", publicName: "multiselectable", isSignal: true, isRequired: false, transformFunction: null }, requireValue: { classPropertyName: "requireValue", publicName: "requireValue", isSignal: true, isRequired: false, transformFunction: null }, invertDisabled: { classPropertyName: "invertDisabled", publicName: "invertDisabled", isSignal: true, isRequired: false, transformFunction: null }, maxSelectedItems: { classPropertyName: "maxSelectedItems", publicName: "maxSelectedItems", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange",
|
|
9703
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.15", type: _SelectableListComponentBase, isStandalone: true, inputs: { valueFrom: { classPropertyName: "valueFrom", publicName: "valueFrom", isSignal: true, isRequired: false, transformFunction: null }, labelFrom: { classPropertyName: "labelFrom", publicName: "labelFrom", isSignal: true, isRequired: false, transformFunction: null }, disabledFrom: { classPropertyName: "disabledFrom", publicName: "disabledFrom", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: false, isRequired: false, transformFunction: null }, multiselectable: { classPropertyName: "multiselectable", publicName: "multiselectable", isSignal: true, isRequired: false, transformFunction: null }, requireValue: { classPropertyName: "requireValue", publicName: "requireValue", isSignal: true, isRequired: false, transformFunction: null }, invertDisabled: { classPropertyName: "invertDisabled", publicName: "invertDisabled", isSignal: true, isRequired: false, transformFunction: null }, maxSelectedItems: { classPropertyName: "maxSelectedItems", publicName: "maxSelectedItems", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", addEvent: "add", removeEvent: "remove" }, host: { listeners: { "mousemove": "onMouseMove()", "keydown": "onKeyPress($event)" }, properties: { "attr.multiple": "this._multiselectableHostAttribute", "class.ard-multiselect": "this._multiselectableHostAttribute", "class.ard-require-value": "this._requireValueHostAttribute", "class.ard-touched": "this._touchedHostAttribute" } }, usesInheritance: true, ngImport: i0 }); }
|
|
9716
9704
|
}
|
|
9717
9705
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: _SelectableListComponentBase, decorators: [{
|
|
9718
9706
|
type: Directive
|
|
@@ -9881,7 +9869,7 @@ class ArdiumSegmentComponent extends _SelectableListComponentBase {
|
|
|
9881
9869
|
provide: ARD_FORM_FIELD_CONTROL,
|
|
9882
9870
|
useExisting: ArdiumSegmentComponent,
|
|
9883
9871
|
},
|
|
9884
|
-
], queries: [{ propertyName: "optionTemplate", first: true, predicate: ArdSegmentOptionTemplateDirective, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\r\n #focusableElement\r\n class=\"ard-segment-container\"\r\n [class.ard-disabled]=\"disabled()\"\r\n [ariaDisabled]=\"disabled()\"\r\n [ngClass]=\"ngClasses()\"\r\n [class.ard-focus-visible]=\"isFocused() && !isMouseBeingUsed\"\r\n [class.ard-using-keyboard]=\"!isMouseBeingUsed()\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n>\r\n @for (row of itemRows(); track $index) {\r\n <div\r\n class=\"ard-segment-row\"\r\n [class.ard-segment-row-partial]=\"row.isNotFull\"\r\n [class.ard-segment-row-uniform]=\"uniformWidths() || itemsPerRow() < items.length\"\r\n [style]=\"{ '--ard-_segment-row-items': itemsInActualRow }\"\r\n >\r\n @for (option of row.options; track $index) {\r\n <button\r\n type=\"button\"\r\n class=\"ard-segment-option\"\r\n tabindex=\"-1\"\r\n [class.ard-option-disabled]=\"option.disabled
|
|
9872
|
+
], queries: [{ propertyName: "optionTemplate", first: true, predicate: ArdSegmentOptionTemplateDirective, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\r\n #focusableElement\r\n class=\"ard-segment-container\"\r\n [class.ard-disabled]=\"disabled()\"\r\n [ariaDisabled]=\"disabled()\"\r\n [ngClass]=\"ngClasses()\"\r\n [class.ard-focus-visible]=\"isFocused() && !isMouseBeingUsed\"\r\n [class.ard-using-keyboard]=\"!isMouseBeingUsed()\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n>\r\n @for (row of itemRows(); track $index) {\r\n <div\r\n class=\"ard-segment-row\"\r\n [class.ard-segment-row-partial]=\"row.isNotFull\"\r\n [class.ard-segment-row-uniform]=\"uniformWidths() || itemsPerRow() < items.length\"\r\n [style]=\"{ '--ard-_segment-row-items': itemsInActualRow }\"\r\n >\r\n @for (option of row.options; track $index) {\r\n <button\r\n type=\"button\"\r\n class=\"ard-segment-option\"\r\n tabindex=\"-1\"\r\n [class.ard-option-disabled]=\"option.disabled || (isItemLimitReached() && !option.selected)\"\r\n [class.ard-option-selected]=\"option.selected\"\r\n [class.ard-option-highlighted]=\"option.highlighted\"\r\n [ariaSelected]=\"option.selected\"\r\n (mouseenter)=\"onItemMouseEnter(option, $event)\"\r\n (mouseleave)=\"onItemMouseLeave(option, $event)\"\r\n (click)=\"onItemClick(option, $event)\"\r\n >\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <span class=\"ard-option-label\">\r\n <ng-template #defaultOptionTemplate>\r\n {{ option.label }}\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"optionTemplate()?.template || defaultOptionTemplate\"\r\n [ngTemplateOutletContext]=\"optionContextGenerator()(option)\"\r\n />\r\n </span>\r\n </div>\r\n </button>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".ard-segment-container{display:flex;flex-direction:column}.ard-segment-container.ard-align-left .ard-segment-option{justify-content:left}.ard-segment-container.ard-align-middle .ard-segment-option{justify-content:center}.ard-segment-container.ard-align-right .ard-segment-option{justify-content:right}.ard-segment-row{width:100%;display:flex;align-items:center}.ard-segment-row.ard-segment-row-uniform{display:grid;grid-template-columns:repeat(var(--ard-_segment-row-items),1fr)}.ard-segment-option{-webkit-user-select:none;user-select:none}.ard-option-disabled{pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
9885
9873
|
}
|
|
9886
9874
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumSegmentComponent, decorators: [{
|
|
9887
9875
|
type: Component,
|
|
@@ -9895,7 +9883,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
9895
9883
|
provide: ARD_FORM_FIELD_CONTROL,
|
|
9896
9884
|
useExisting: ArdiumSegmentComponent,
|
|
9897
9885
|
},
|
|
9898
|
-
], template: "<div\r\n #focusableElement\r\n class=\"ard-segment-container\"\r\n [class.ard-disabled]=\"disabled()\"\r\n [ariaDisabled]=\"disabled()\"\r\n [ngClass]=\"ngClasses()\"\r\n [class.ard-focus-visible]=\"isFocused() && !isMouseBeingUsed\"\r\n [class.ard-using-keyboard]=\"!isMouseBeingUsed()\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n>\r\n @for (row of itemRows(); track $index) {\r\n <div\r\n class=\"ard-segment-row\"\r\n [class.ard-segment-row-partial]=\"row.isNotFull\"\r\n [class.ard-segment-row-uniform]=\"uniformWidths() || itemsPerRow() < items.length\"\r\n [style]=\"{ '--ard-_segment-row-items': itemsInActualRow }\"\r\n >\r\n @for (option of row.options; track $index) {\r\n <button\r\n type=\"button\"\r\n class=\"ard-segment-option\"\r\n tabindex=\"-1\"\r\n [class.ard-option-disabled]=\"option.disabled
|
|
9886
|
+
], template: "<div\r\n #focusableElement\r\n class=\"ard-segment-container\"\r\n [class.ard-disabled]=\"disabled()\"\r\n [ariaDisabled]=\"disabled()\"\r\n [ngClass]=\"ngClasses()\"\r\n [class.ard-focus-visible]=\"isFocused() && !isMouseBeingUsed\"\r\n [class.ard-using-keyboard]=\"!isMouseBeingUsed()\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n>\r\n @for (row of itemRows(); track $index) {\r\n <div\r\n class=\"ard-segment-row\"\r\n [class.ard-segment-row-partial]=\"row.isNotFull\"\r\n [class.ard-segment-row-uniform]=\"uniformWidths() || itemsPerRow() < items.length\"\r\n [style]=\"{ '--ard-_segment-row-items': itemsInActualRow }\"\r\n >\r\n @for (option of row.options; track $index) {\r\n <button\r\n type=\"button\"\r\n class=\"ard-segment-option\"\r\n tabindex=\"-1\"\r\n [class.ard-option-disabled]=\"option.disabled || (isItemLimitReached() && !option.selected)\"\r\n [class.ard-option-selected]=\"option.selected\"\r\n [class.ard-option-highlighted]=\"option.highlighted\"\r\n [ariaSelected]=\"option.selected\"\r\n (mouseenter)=\"onItemMouseEnter(option, $event)\"\r\n (mouseleave)=\"onItemMouseLeave(option, $event)\"\r\n (click)=\"onItemClick(option, $event)\"\r\n >\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <span class=\"ard-option-label\">\r\n <ng-template #defaultOptionTemplate>\r\n {{ option.label }}\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"optionTemplate()?.template || defaultOptionTemplate\"\r\n [ngTemplateOutletContext]=\"optionContextGenerator()(option)\"\r\n />\r\n </span>\r\n </div>\r\n </button>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".ard-segment-container{display:flex;flex-direction:column}.ard-segment-container.ard-align-left .ard-segment-option{justify-content:left}.ard-segment-container.ard-align-middle .ard-segment-option{justify-content:center}.ard-segment-container.ard-align-right .ard-segment-option{justify-content:right}.ard-segment-row{width:100%;display:flex;align-items:center}.ard-segment-row.ard-segment-row-uniform{display:grid;grid-template-columns:repeat(var(--ard-_segment-row-items),1fr)}.ard-segment-option{-webkit-user-select:none;user-select:none}.ard-option-disabled{pointer-events:none}\n"] }]
|
|
9899
9887
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
9900
9888
|
type: Inject,
|
|
9901
9889
|
args: [ARD_SEGMENT_DEFAULTS]
|
|
@@ -11138,9 +11126,9 @@ class ArdiumCheckboxListComponent extends _NgModelComponentBase {
|
|
|
11138
11126
|
this._componentId = '300';
|
|
11139
11127
|
this._componentName = 'checkbox-list';
|
|
11140
11128
|
this._itemStorage = new SimpleItemStorage(this);
|
|
11141
|
-
this.valueFrom = input(this.
|
|
11142
|
-
this.labelFrom = input(this.
|
|
11143
|
-
this.disabledFrom = input(this.
|
|
11129
|
+
this.valueFrom = input(this._DEFAULTS.valueFrom);
|
|
11130
|
+
this.labelFrom = input(this._DEFAULTS.labelFrom);
|
|
11131
|
+
this.disabledFrom = input(this._DEFAULTS.disabledFrom);
|
|
11144
11132
|
this.compareWith = input(this._DEFAULTS.compareWith);
|
|
11145
11133
|
this.invertDisabled = input(this._DEFAULTS.invertDisabled, {
|
|
11146
11134
|
transform: v => coerceBooleanProperty(v),
|
|
@@ -11154,11 +11142,21 @@ class ArdiumCheckboxListComponent extends _NgModelComponentBase {
|
|
|
11154
11142
|
this.compact = input(this._DEFAULTS.compact, { transform: v => coerceBooleanProperty(v) });
|
|
11155
11143
|
this.ngClasses = computed(() => [`ard-color-${this.color()}`, `ard-align-${this.align()}`, this.compact() ? 'ard-compact' : ''].join(' '));
|
|
11156
11144
|
this.valueChange = output();
|
|
11157
|
-
this.changeEvent = output({ alias: 'change' });
|
|
11158
11145
|
this._isViewInit = false;
|
|
11159
11146
|
//! templates
|
|
11160
11147
|
this.checkboxTemplate = contentChild(ArdCheckboxListCheckboxTemplateDirective);
|
|
11161
11148
|
this.labelTemplate = contentChild(ArdCheckboxListLabelTemplateDirective);
|
|
11149
|
+
this.labelContextGenerator = computed(() => item => ({
|
|
11150
|
+
$implicit: item,
|
|
11151
|
+
item,
|
|
11152
|
+
index: item.index,
|
|
11153
|
+
value: item.value,
|
|
11154
|
+
label: item.label,
|
|
11155
|
+
selected: item.selected,
|
|
11156
|
+
highlighted: item.highlighted,
|
|
11157
|
+
itemData: item.itemData,
|
|
11158
|
+
disabled: item.disabled,
|
|
11159
|
+
}));
|
|
11162
11160
|
}
|
|
11163
11161
|
get _htmlIdHostAttribute() {
|
|
11164
11162
|
return this.htmlId();
|
|
@@ -11192,7 +11190,6 @@ class ArdiumCheckboxListComponent extends _NgModelComponentBase {
|
|
|
11192
11190
|
_emitChange() {
|
|
11193
11191
|
const v = this.value;
|
|
11194
11192
|
this._onChangeRegistered?.(v);
|
|
11195
|
-
this.changeEvent.emit(v);
|
|
11196
11193
|
this.valueChange.emit(v);
|
|
11197
11194
|
}
|
|
11198
11195
|
onItemHighlight(v) {
|
|
@@ -11213,25 +11210,18 @@ class ArdiumCheckboxListComponent extends _NgModelComponentBase {
|
|
|
11213
11210
|
this._emitChange();
|
|
11214
11211
|
}
|
|
11215
11212
|
toggleItem(v) {
|
|
11216
|
-
if (v.selected
|
|
11213
|
+
if (v.selected) {
|
|
11217
11214
|
this.unselectItem(v);
|
|
11218
11215
|
return;
|
|
11219
11216
|
}
|
|
11220
11217
|
this.selectItem(v);
|
|
11221
11218
|
}
|
|
11222
|
-
getLabelContext(item) {
|
|
11223
|
-
return {
|
|
11224
|
-
$implicit: item,
|
|
11225
|
-
item,
|
|
11226
|
-
itemData: item.itemData(),
|
|
11227
|
-
};
|
|
11228
|
-
}
|
|
11229
11219
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumCheckboxListComponent, deps: [{ token: ARD_CHECKBOX_LIST_DEFAULTS }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11230
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: ArdiumCheckboxListComponent, isStandalone: false, selector: "ard-checkbox-list", inputs: { valueFrom: { classPropertyName: "valueFrom", publicName: "valueFrom", isSignal: true, isRequired: false, transformFunction: null }, labelFrom: { classPropertyName: "labelFrom", publicName: "labelFrom", isSignal: true, isRequired: false, transformFunction: null }, disabledFrom: { classPropertyName: "disabledFrom", publicName: "disabledFrom", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: false, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, invertDisabled: { classPropertyName: "invertDisabled", publicName: "invertDisabled", isSignal: true, isRequired: false, transformFunction: null }, maxSelectedItems: { classPropertyName: "maxSelectedItems", publicName: "maxSelectedItems", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange"
|
|
11220
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: ArdiumCheckboxListComponent, isStandalone: false, selector: "ard-checkbox-list", inputs: { valueFrom: { classPropertyName: "valueFrom", publicName: "valueFrom", isSignal: true, isRequired: false, transformFunction: null }, labelFrom: { classPropertyName: "labelFrom", publicName: "labelFrom", isSignal: true, isRequired: false, transformFunction: null }, disabledFrom: { classPropertyName: "disabledFrom", publicName: "disabledFrom", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: false, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, invertDisabled: { classPropertyName: "invertDisabled", publicName: "invertDisabled", isSignal: true, isRequired: false, transformFunction: null }, maxSelectedItems: { classPropertyName: "maxSelectedItems", publicName: "maxSelectedItems", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { properties: { "attr.id": "this._htmlIdHostAttribute" } }, queries: [{ propertyName: "checkboxTemplate", first: true, predicate: ArdCheckboxListCheckboxTemplateDirective, descendants: true, isSignal: true }, { propertyName: "labelTemplate", first: true, predicate: ArdCheckboxListLabelTemplateDirective, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"ard-checkbox-list\"\r\n [ngClass]=\"ngClasses()\"\r\n>\r\n @for (item of items; track item.index) {\r\n <div\r\n class=\"ard-checkbox-list__item\"\r\n [class.ard-item-highlighted]=\"item.highlighted\"\r\n [class.ard-item-disabled]=\"item.disabled\"\r\n [class.ard-item-selected]=\"item.selected\"\r\n (mouseover)=\"onItemHighlight(item)\"\r\n (mouseleave)=\"onItemBlur()\"\r\n (click)=\"toggleItem(item)\"\r\n >\r\n <div class=\"ard-focus-overlay\"></div>\r\n <ard-checkbox\r\n [selected]=\"item.selected\"\r\n [disabled]=\"item.disabled\"\r\n [color]=\"color()\"\r\n [htmlId]=\"htmlId() + item.index\"\r\n [tabIndex]=\"tabIndex()\"\r\n (focus)=\"onFocus($event)\"\r\n (focus)=\"onItemFocus(item)\"\r\n (blur)=\"onBlur($event)\"\r\n (blur)=\"onItemBlur()\"\r\n (select)=\"selectItem(item)\"\r\n (unselect)=\"unselectItem(item)\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <ng-template\r\n _ard-tmp-repository\r\n [checkboxTmp]=\"checkboxTemplate()\"\r\n />\r\n </ard-checkbox>\r\n <label [for]=\"htmlId() + item.index\">\r\n <ng-template\r\n #defaultLabelTemplate\r\n let-label=\"label\"\r\n >\r\n {{ label }}\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"labelTemplate()?.template || defaultLabelTemplate\"\r\n [ngTemplateOutletContext]=\"labelContextGenerator()(item)\"\r\n />\r\n </label>\r\n </div>\r\n }\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ArdiumCheckboxComponent, selector: "ard-checkbox", inputs: ["color", "unselectedColor", "state"], outputs: ["stateChange"] }, { kind: "directive", type: _CheckboxTemplateRepositoryDirective, selector: "ard-checkbox > ng-template[_ard-tmp-repository]", inputs: ["checkboxTmp"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
11231
11221
|
}
|
|
11232
11222
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumCheckboxListComponent, decorators: [{
|
|
11233
11223
|
type: Component,
|
|
11234
|
-
args: [{ standalone: false, selector: 'ard-checkbox-list', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n class=\"ard-checkbox-list\"\r\n [ngClass]=\"ngClasses()\"\r\n>\r\n @for (item of items; track item.index) {\r\n
|
|
11224
|
+
args: [{ standalone: false, selector: 'ard-checkbox-list', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n class=\"ard-checkbox-list\"\r\n [ngClass]=\"ngClasses()\"\r\n>\r\n @for (item of items; track item.index) {\r\n <div\r\n class=\"ard-checkbox-list__item\"\r\n [class.ard-item-highlighted]=\"item.highlighted\"\r\n [class.ard-item-disabled]=\"item.disabled\"\r\n [class.ard-item-selected]=\"item.selected\"\r\n (mouseover)=\"onItemHighlight(item)\"\r\n (mouseleave)=\"onItemBlur()\"\r\n (click)=\"toggleItem(item)\"\r\n >\r\n <div class=\"ard-focus-overlay\"></div>\r\n <ard-checkbox\r\n [selected]=\"item.selected\"\r\n [disabled]=\"item.disabled\"\r\n [color]=\"color()\"\r\n [htmlId]=\"htmlId() + item.index\"\r\n [tabIndex]=\"tabIndex()\"\r\n (focus)=\"onFocus($event)\"\r\n (focus)=\"onItemFocus(item)\"\r\n (blur)=\"onBlur($event)\"\r\n (blur)=\"onItemBlur()\"\r\n (select)=\"selectItem(item)\"\r\n (unselect)=\"unselectItem(item)\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <ng-template\r\n _ard-tmp-repository\r\n [checkboxTmp]=\"checkboxTemplate()\"\r\n />\r\n </ard-checkbox>\r\n <label [for]=\"htmlId() + item.index\">\r\n <ng-template\r\n #defaultLabelTemplate\r\n let-label=\"label\"\r\n >\r\n {{ label }}\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"labelTemplate()?.template || defaultLabelTemplate\"\r\n [ngTemplateOutletContext]=\"labelContextGenerator()(item)\"\r\n />\r\n </label>\r\n </div>\r\n }\r\n</div>\r\n" }]
|
|
11235
11225
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
11236
11226
|
type: Inject,
|
|
11237
11227
|
args: [ARD_CHECKBOX_LIST_DEFAULTS]
|
|
@@ -13055,7 +13045,7 @@ class ArdiumTablePaginationComponent extends _FocusableComponentBase {
|
|
|
13055
13045
|
this._emitPageEvent();
|
|
13056
13046
|
}
|
|
13057
13047
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumTablePaginationComponent, deps: [{ token: ARD_TABLE_PAGINATION_DEFAULTS }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
13058
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: ArdiumTablePaginationComponent, isStandalone: false, selector: "ard-table-pagination", inputs: { totalItems: { classPropertyName: "totalItems", publicName: "totalItems", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, itemsPerPage: { classPropertyName: "itemsPerPage", publicName: "itemsPerPage", isSignal: true, isRequired: false, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, useFirstLastButtons: { classPropertyName: "useFirstLastButtons", publicName: "useFirstLastButtons", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, itemsPerPageText: { classPropertyName: "itemsPerPageText", publicName: "itemsPerPageText", isSignal: true, isRequired: false, transformFunction: null }, currentItemsFormatFn: { classPropertyName: "currentItemsFormatFn", publicName: "currentItemsFormatFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemsPerPage: "itemsPerPageChange", page: "pageChange", itemsPerPageChangeEvent: "itemsPerPageChange", pageChangeEvent: "pageChange" }, usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"ard-pagination\"\r\n [ngClass]=\"ngClasses()\"\r\n>\r\n <div class=\"ard-pagination__items-per-page\">\r\n <div class=\"ard-pagination__text\">{{ itemsPerPageText() }}</div>\r\n <ard-select\r\n [items]=\"options()\"\r\n [compact]=\"compact()\"\r\n [value]=\"itemsPerPage()\"\r\n autoHighlightFirst=\"false\"\r\n [disabled]=\"disabled()\"\r\n (valueChange)=\"onItemsPerPageChange($event[0])\"\r\n clearable=\"false\"\r\n />\r\n </div>\r\n <div class=\"ard-pagination__current-page\">\r\n <div class=\"ard-pagination__text\">\r\n {{ currentItemsFormatFn()(getCurrentItemsContext()) }}\r\n </div>\r\n <div class=\"ard-pagination__buttons\">\r\n @if (useFirstLastButtons()) {\r\n <ard-icon-button\r\n [color]=\"color()\"\r\n [compact]=\"compact()\"\r\n [disabled]=\"disabled() || firstPageDisabled()\"\r\n (click)=\"onFirstPage()\"\r\n >\r\n <ard-icon>first page</ard-icon>\r\n </ard-icon-button>\r\n }\r\n <ard-icon-button\r\n [color]=\"color()\"\r\n [compact]=\"compact()\"\r\n [disabled]=\"disabled() || firstPageDisabled()\"\r\n (click)=\"onPrevPage()\"\r\n >\r\n <ard-icon>navigate before</ard-icon>\r\n </ard-icon-button>\r\n <ard-icon-button\r\n [color]=\"color()\"\r\n [compact]=\"compact()\"\r\n [disabled]=\"disabled() || lastPageDisabled()\"\r\n (click)=\"onNextPage()\"\r\n >\r\n <ard-icon>navigate next</ard-icon>\r\n </ard-icon-button>\r\n @if (useFirstLastButtons()) {\r\n <ard-icon-button\r\n [color]=\"color()\"\r\n [compact]=\"compact()\"\r\n [disabled]=\"disabled() || lastPageDisabled()\"\r\n (click)=\"onLastPage()\"\r\n >\r\n <ard-icon>last page</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ArdiumSelectComponent, selector: "ard-select", inputs: ["valueFrom", "labelFrom", "disabledFrom", "groupLabelFrom", "groupDisabledFrom", "childrenFrom", "placeholder", "searchPlaceholder", "clearButtonTitle", "dropdownPosition", "noItemsFoundText", "addCustomOptionText", "loadingPlaceholderText", "searchInputId", "inputAttrs", "isLoading", "itemsAlreadyGrouped", "invertDisabled", "noGroupActions", "autoHighlightFirst", "autoFocus", "keepOpen", "hideSelected", "noBackspaceClear", "
|
|
13048
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: ArdiumTablePaginationComponent, isStandalone: false, selector: "ard-table-pagination", inputs: { totalItems: { classPropertyName: "totalItems", publicName: "totalItems", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, itemsPerPage: { classPropertyName: "itemsPerPage", publicName: "itemsPerPage", isSignal: true, isRequired: false, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, useFirstLastButtons: { classPropertyName: "useFirstLastButtons", publicName: "useFirstLastButtons", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, itemsPerPageText: { classPropertyName: "itemsPerPageText", publicName: "itemsPerPageText", isSignal: true, isRequired: false, transformFunction: null }, currentItemsFormatFn: { classPropertyName: "currentItemsFormatFn", publicName: "currentItemsFormatFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemsPerPage: "itemsPerPageChange", page: "pageChange", itemsPerPageChangeEvent: "itemsPerPageChange", pageChangeEvent: "pageChange" }, usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"ard-pagination\"\r\n [ngClass]=\"ngClasses()\"\r\n>\r\n <div class=\"ard-pagination__items-per-page\">\r\n <div class=\"ard-pagination__text\">{{ itemsPerPageText() }}</div>\r\n <ard-select\r\n [items]=\"options()\"\r\n [compact]=\"compact()\"\r\n [value]=\"itemsPerPage()\"\r\n autoHighlightFirst=\"false\"\r\n [disabled]=\"disabled()\"\r\n (valueChange)=\"onItemsPerPageChange($event[0])\"\r\n clearable=\"false\"\r\n />\r\n </div>\r\n <div class=\"ard-pagination__current-page\">\r\n <div class=\"ard-pagination__text\">\r\n {{ currentItemsFormatFn()(getCurrentItemsContext()) }}\r\n </div>\r\n <div class=\"ard-pagination__buttons\">\r\n @if (useFirstLastButtons()) {\r\n <ard-icon-button\r\n [color]=\"color()\"\r\n [compact]=\"compact()\"\r\n [disabled]=\"disabled() || firstPageDisabled()\"\r\n (click)=\"onFirstPage()\"\r\n >\r\n <ard-icon>first page</ard-icon>\r\n </ard-icon-button>\r\n }\r\n <ard-icon-button\r\n [color]=\"color()\"\r\n [compact]=\"compact()\"\r\n [disabled]=\"disabled() || firstPageDisabled()\"\r\n (click)=\"onPrevPage()\"\r\n >\r\n <ard-icon>navigate before</ard-icon>\r\n </ard-icon-button>\r\n <ard-icon-button\r\n [color]=\"color()\"\r\n [compact]=\"compact()\"\r\n [disabled]=\"disabled() || lastPageDisabled()\"\r\n (click)=\"onNextPage()\"\r\n >\r\n <ard-icon>navigate next</ard-icon>\r\n </ard-icon-button>\r\n @if (useFirstLastButtons()) {\r\n <ard-icon-button\r\n [color]=\"color()\"\r\n [compact]=\"compact()\"\r\n [disabled]=\"disabled() || lastPageDisabled()\"\r\n (click)=\"onLastPage()\"\r\n >\r\n <ard-icon>last page</ard-icon>\r\n </ard-icon-button>\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ArdiumSelectComponent, selector: "ard-select", inputs: ["valueFrom", "labelFrom", "disabledFrom", "groupLabelFrom", "groupDisabledFrom", "childrenFrom", "placeholder", "searchPlaceholder", "clearButtonTitle", "dropdownPosition", "noItemsFoundText", "addCustomOptionText", "loadingPlaceholderText", "searchInputId", "inputAttrs", "isLoading", "itemsAlreadyGrouped", "invertDisabled", "noGroupActions", "autoHighlightFirst", "autoFocus", "keepOpen", "hideSelected", "noBackspaceClear", "searchCaseSensitive", "keepSearchAfterSelect", "maxSelectedItems", "itemDisplayLimit", "searchFn", "compareWith", "appearance", "variant", "compact", "dropdownAppearance", "dropdownVariant", "items", "multiselectable", "clearable", "searchable", "addCustom", "value", "isOpen", "dropdownPanelWidth", "dropdownPanelHeight", "dropdownPanelMinWidth", "dropdownPanelMinHeight", "dropdownPanelMaxWidth", "dropdownPanelMaxHeight"], outputs: ["valueChange", "add", "failedToAdd", "remove", "clear", "open", "close", "scroll", "scrollToEnd", "search", "isOpenChange"] }, { kind: "component", type: ArdiumIconButtonComponent, selector: "ard-icon-button", inputs: ["wrapperClasses", "type", "color", "lightColoring", "compact", "pointerEventsWhenDisabled"] }, { kind: "component", type: ArdiumIconComponent, selector: "ard-icon", inputs: ["ariaLabel", "icon", "filled", "weight", "grade", "opticalSize"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
13059
13049
|
}
|
|
13060
13050
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumTablePaginationComponent, decorators: [{
|
|
13061
13051
|
type: Component,
|