@ardium-ui/ui 5.0.0-alpha.25 → 5.0.0-alpha.26
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 +391 -398
- package/fesm2022/ardium-ui-ui.mjs.map +1 -1
- package/lib/_internal/item-storages/dropdown-item-storage.d.ts +13 -14
- 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 -7
- package/lib/select/select.types.d.ts +4 -2
- 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
|
-
|
|
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)));
|
|
2692
2727
|
this._valueToWriteAfterItemsLoad = signal(undefined);
|
|
2693
2728
|
this._wasValueWriteDeferred = signal(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,20 @@ class ItemStorage {
|
|
|
2713
2748
|
this._items.set(items.map((item, index) => {
|
|
2714
2749
|
return this._setItemsMapFn(item, index, areItemsPrimitive);
|
|
2715
2750
|
}));
|
|
2716
|
-
|
|
2717
|
-
this._filteredItems.set(this._items());
|
|
2718
|
-
//add items to groups
|
|
2719
|
-
this._populateGroups();
|
|
2751
|
+
this._updateItems(item => ({ ...item, filtered: true }));
|
|
2720
2752
|
//write value if it was
|
|
2721
2753
|
const toWrite = this._valueToWriteAfterItemsLoad();
|
|
2722
2754
|
if (toWrite !== undefined) {
|
|
2723
2755
|
this.handleWriteValue(toWrite);
|
|
2724
2756
|
}
|
|
2725
2757
|
}
|
|
2758
|
+
updateItemFromOptionComponent(itemValue, updatedItem) {
|
|
2759
|
+
const item = this.findItemByValue(itemValue);
|
|
2760
|
+
if (!item)
|
|
2761
|
+
return;
|
|
2762
|
+
const index = item.index;
|
|
2763
|
+
this._items.setAt(index, { ...item, ...updatedItem });
|
|
2764
|
+
}
|
|
2726
2765
|
_addSingleItem(item) {
|
|
2727
2766
|
const isItemPrimitive = isPrimitive(item);
|
|
2728
2767
|
//map a primitive item to a usable object
|
|
@@ -2730,13 +2769,11 @@ class ItemStorage {
|
|
|
2730
2769
|
item = this._primitiveItemsMapFn(item);
|
|
2731
2770
|
}
|
|
2732
2771
|
//map the item to create data bindings
|
|
2733
|
-
const ardOption = this._setItemsMapFn(item, (this.
|
|
2772
|
+
const ardOption = this._setItemsMapFn(item, (this.items().last()?.index ?? 0) + 1, isItemPrimitive);
|
|
2734
2773
|
//push the item into all items
|
|
2735
|
-
this._items.
|
|
2774
|
+
this._items.push(ardOption);
|
|
2736
2775
|
//add all items to filter array
|
|
2737
|
-
this.
|
|
2738
|
-
//add item to groups
|
|
2739
|
-
this._populateGroups();
|
|
2776
|
+
this._updateItems(item => ({ ...item, filtered: true }));
|
|
2740
2777
|
return ardOption;
|
|
2741
2778
|
}
|
|
2742
2779
|
_primitiveItemsMapFn(item) {
|
|
@@ -2775,15 +2812,16 @@ class ItemStorage {
|
|
|
2775
2812
|
_setItemsMapFn(rawItemData, index, areItemsPrimitive) {
|
|
2776
2813
|
if (areItemsPrimitive) {
|
|
2777
2814
|
return {
|
|
2778
|
-
itemData:
|
|
2815
|
+
itemData: rawItemData,
|
|
2779
2816
|
index: index,
|
|
2780
|
-
value:
|
|
2781
|
-
label:
|
|
2782
|
-
disabled:
|
|
2783
|
-
|
|
2784
|
-
|
|
2817
|
+
value: rawItemData.value,
|
|
2818
|
+
label: rawItemData.value?.toString?.() ?? String(rawItemData.value),
|
|
2819
|
+
disabled: false,
|
|
2820
|
+
filtered: true,
|
|
2821
|
+
selected: false,
|
|
2822
|
+
highlighted: false,
|
|
2785
2823
|
group: undefined,
|
|
2786
|
-
highlighted_recently:
|
|
2824
|
+
highlighted_recently: false,
|
|
2787
2825
|
};
|
|
2788
2826
|
}
|
|
2789
2827
|
//get value
|
|
@@ -2815,55 +2853,28 @@ class ItemStorage {
|
|
|
2815
2853
|
}
|
|
2816
2854
|
}
|
|
2817
2855
|
return {
|
|
2818
|
-
itemData:
|
|
2856
|
+
itemData: rawItemData,
|
|
2819
2857
|
index: index,
|
|
2820
|
-
value:
|
|
2821
|
-
label:
|
|
2822
|
-
disabled:
|
|
2858
|
+
value: value,
|
|
2859
|
+
label: label?.toString?.() ?? String(label),
|
|
2860
|
+
disabled: disabled,
|
|
2823
2861
|
group: group,
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2862
|
+
filtered: true,
|
|
2863
|
+
selected: false,
|
|
2864
|
+
highlighted: false,
|
|
2865
|
+
highlighted_recently: false,
|
|
2827
2866
|
};
|
|
2828
2867
|
}
|
|
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
2868
|
_createEmptyGroupMap() {
|
|
2858
2869
|
return new Map([
|
|
2859
2870
|
[
|
|
2860
2871
|
undefined,
|
|
2861
2872
|
{
|
|
2862
|
-
label:
|
|
2863
|
-
children:
|
|
2864
|
-
disabled:
|
|
2865
|
-
selected:
|
|
2866
|
-
highlighted:
|
|
2873
|
+
label: '',
|
|
2874
|
+
children: [],
|
|
2875
|
+
disabled: false,
|
|
2876
|
+
selected: false,
|
|
2877
|
+
highlighted: false,
|
|
2867
2878
|
},
|
|
2868
2879
|
],
|
|
2869
2880
|
]);
|
|
@@ -2879,7 +2890,7 @@ class ItemStorage {
|
|
|
2879
2890
|
}
|
|
2880
2891
|
handleWriteValue(ngModel) {
|
|
2881
2892
|
//defer writing the value if no options are yet loaded
|
|
2882
|
-
if (!this._wasValueWriteDeferred() && this.
|
|
2893
|
+
if (!this._wasValueWriteDeferred() && this.items().length === 0) {
|
|
2883
2894
|
this._valueToWriteAfterItemsLoad.set(ngModel);
|
|
2884
2895
|
return;
|
|
2885
2896
|
}
|
|
@@ -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,15 +3559,21 @@ 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, {
|
|
3574
|
+
this.noBackspaceClear = input(this._DEFAULTS.noBackspaceClear, {
|
|
3575
|
+
transform: v => coerceBooleanProperty(v),
|
|
3576
|
+
});
|
|
3599
3577
|
this.sortMultipleValues = input(this._DEFAULTS.sortMultipleValues, {
|
|
3600
3578
|
transform: v => coerceBooleanProperty(v),
|
|
3601
3579
|
});
|
|
@@ -3649,7 +3627,9 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3649
3627
|
return variant;
|
|
3650
3628
|
});
|
|
3651
3629
|
//! attribute and/or class setters/getters
|
|
3652
|
-
this.multiselectable = input(this._DEFAULTS.multiselectable, {
|
|
3630
|
+
this.multiselectable = input(this._DEFAULTS.multiselectable, {
|
|
3631
|
+
transform: v => coerceBooleanProperty(v),
|
|
3632
|
+
});
|
|
3653
3633
|
this.clearable = input(this._DEFAULTS.clearable, { transform: v => coerceBooleanProperty(v) });
|
|
3654
3634
|
this.searchable = input(this._DEFAULTS.searchable, { transform: v => coerceBooleanProperty(v) });
|
|
3655
3635
|
this.filtered = computed(() => this.searchable() && this.searchTerm() !== '');
|
|
@@ -3669,7 +3649,6 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3669
3649
|
this.shouldShowAddCustom = computed(() => this.addCustom() !== false && this.searchTerm().length > 0 && this.itemStorage.isNoItemsFound());
|
|
3670
3650
|
this.valueChange = output();
|
|
3671
3651
|
//! output events
|
|
3672
|
-
this.changeEvent = output({ alias: 'change' });
|
|
3673
3652
|
this.addEvent = output({ alias: 'add' });
|
|
3674
3653
|
this.failedToAddEvent = output({ alias: 'failedToAdd' });
|
|
3675
3654
|
this.removeEvent = output({ alias: 'remove' });
|
|
@@ -3699,6 +3678,34 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3699
3678
|
this.itemDisplayLimitTemplate = contentChild(ArdItemDisplayLimitTemplateDirective);
|
|
3700
3679
|
this.prefixTemplate = contentChild(ArdSelectPrefixTemplateDirective);
|
|
3701
3680
|
this.suffixTemplate = contentChild(ArdSelectSuffixTemplateDirective);
|
|
3681
|
+
//! context providers
|
|
3682
|
+
this.optionContextGenerator = computed(() => item => ({
|
|
3683
|
+
$implicit: item,
|
|
3684
|
+
item,
|
|
3685
|
+
index: item.index,
|
|
3686
|
+
value: item.value,
|
|
3687
|
+
label: item.label,
|
|
3688
|
+
selected: item.selected,
|
|
3689
|
+
highlighted: item.highlighted,
|
|
3690
|
+
itemData: item.itemData,
|
|
3691
|
+
group: item.group,
|
|
3692
|
+
disabled: item.disabled,
|
|
3693
|
+
highlighted_recently: item.highlighted_recently,
|
|
3694
|
+
}));
|
|
3695
|
+
this.valueContextGenerator = computed(() => item => ({
|
|
3696
|
+
...this.optionContextGenerator()(item),
|
|
3697
|
+
unselect: () => {
|
|
3698
|
+
this.unselectItem(item);
|
|
3699
|
+
},
|
|
3700
|
+
}));
|
|
3701
|
+
this.groupContextGenerator = computed(() => group => ({
|
|
3702
|
+
$implicit: group,
|
|
3703
|
+
group,
|
|
3704
|
+
label: group.label,
|
|
3705
|
+
disabled: group.disabled,
|
|
3706
|
+
selectedChildrenCount: group.children.filter(v => v.selected).length,
|
|
3707
|
+
totalChildrenCount: group.children.length,
|
|
3708
|
+
}));
|
|
3702
3709
|
this.getStatsContext = computed(() => ({
|
|
3703
3710
|
totalItems: this.totalItems(),
|
|
3704
3711
|
foundItems: this.foundItems(),
|
|
@@ -3739,6 +3746,9 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3739
3746
|
this.overlay = inject(Overlay);
|
|
3740
3747
|
this.viewContainerRef = inject(ViewContainerRef);
|
|
3741
3748
|
this.scrollStrategyOpts = inject(ScrollStrategyOptions);
|
|
3749
|
+
//! dropdown overlay
|
|
3750
|
+
this.dropdownHost = viewChild.required('dropdownHost');
|
|
3751
|
+
this.dropdownTemplate = viewChild.required('dropdownTemplate');
|
|
3742
3752
|
this.dropdownPanelWidth = input(this._DEFAULTS.dropdownPanelWidth, {
|
|
3743
3753
|
transform: transformDropdownPanelSize,
|
|
3744
3754
|
});
|
|
@@ -3798,18 +3808,16 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3798
3808
|
.pipe(takeUntil(changedOrDestroyed))
|
|
3799
3809
|
.subscribe(option => {
|
|
3800
3810
|
setTimeout(() => {
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
label: option.label || item.label(),
|
|
3811
|
+
this.itemStorage.updateItemFromOptionComponent(option.oldValue ?? option.value, {
|
|
3812
|
+
disabled: option.disabled,
|
|
3813
|
+
label: option.label || undefined,
|
|
3814
|
+
value: option.value,
|
|
3815
|
+
itemData: {
|
|
3816
|
+
label: option.label,
|
|
3808
3817
|
value: option.value,
|
|
3809
3818
|
disabled: option.disabled,
|
|
3810
|
-
}
|
|
3811
|
-
}
|
|
3812
|
-
this.detectChanges();
|
|
3819
|
+
},
|
|
3820
|
+
});
|
|
3813
3821
|
}, 0);
|
|
3814
3822
|
});
|
|
3815
3823
|
};
|
|
@@ -3854,7 +3862,6 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3854
3862
|
_emitChange() {
|
|
3855
3863
|
const value = this.multiselectable() ? this.itemStorage.value() : this.itemStorage.value()[0];
|
|
3856
3864
|
this._onChangeRegistered?.(value);
|
|
3857
|
-
this.changeEvent.emit(value);
|
|
3858
3865
|
this.valueChange.emit(value);
|
|
3859
3866
|
}
|
|
3860
3867
|
_onTouched() {
|
|
@@ -3874,36 +3881,10 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3874
3881
|
get value() {
|
|
3875
3882
|
return this.itemStorage.value;
|
|
3876
3883
|
}
|
|
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
3884
|
_createOverlay() {
|
|
3904
3885
|
const strategy = this.overlay
|
|
3905
3886
|
.position()
|
|
3906
|
-
.flexibleConnectedTo(this.dropdownHost)
|
|
3887
|
+
.flexibleConnectedTo(this.dropdownHost())
|
|
3907
3888
|
.withFlexibleDimensions(false)
|
|
3908
3889
|
.withPositions([
|
|
3909
3890
|
{
|
|
@@ -3943,7 +3924,7 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3943
3924
|
maxHeight: this.dropdownPanelMaxHeight() ?? undefined,
|
|
3944
3925
|
});
|
|
3945
3926
|
this.dropdownOverlay = this.overlay.create(config);
|
|
3946
|
-
const portal = new TemplatePortal(this.dropdownTemplate, this.viewContainerRef);
|
|
3927
|
+
const portal = new TemplatePortal(this.dropdownTemplate(), this.viewContainerRef);
|
|
3947
3928
|
this.dropdownOverlay.attach(portal);
|
|
3948
3929
|
this.setOverlaySize();
|
|
3949
3930
|
}
|
|
@@ -3956,7 +3937,7 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
3956
3937
|
setOverlaySize() {
|
|
3957
3938
|
if (!this.dropdownOverlay)
|
|
3958
3939
|
return;
|
|
3959
|
-
const rect = this.dropdownHost.nativeElement.getBoundingClientRect();
|
|
3940
|
+
const rect = this.dropdownHost().nativeElement.getBoundingClientRect();
|
|
3960
3941
|
this.dropdownOverlay.updateSize({ width: rect.width });
|
|
3961
3942
|
}
|
|
3962
3943
|
onWindowResize() {
|
|
@@ -4017,7 +3998,8 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
4017
3998
|
}
|
|
4018
3999
|
//! item selection handlers
|
|
4019
4000
|
toggleItem(item) {
|
|
4020
|
-
|
|
4001
|
+
// don't use itemStorage.toggleItem() - we need to emit different events for select/unselect
|
|
4002
|
+
if (item.selected) {
|
|
4021
4003
|
this.unselectItem(item);
|
|
4022
4004
|
return;
|
|
4023
4005
|
}
|
|
@@ -4056,14 +4038,14 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
4056
4038
|
}
|
|
4057
4039
|
}
|
|
4058
4040
|
_clearAllItems() {
|
|
4059
|
-
const cleared = this.itemStorage.clearAllSelected(
|
|
4041
|
+
const cleared = this.itemStorage.clearAllSelected();
|
|
4060
4042
|
this.focus();
|
|
4061
4043
|
this.clearEvent.emit();
|
|
4062
4044
|
this.removeEvent.emit(cleared);
|
|
4063
4045
|
this._emitChange();
|
|
4064
4046
|
}
|
|
4065
4047
|
_clearLastItem() {
|
|
4066
|
-
const clearedValue = this.itemStorage.clearLastSelected().value
|
|
4048
|
+
const clearedValue = this.itemStorage.clearLastSelected().value;
|
|
4067
4049
|
this.focus();
|
|
4068
4050
|
this.removeEvent.emit([clearedValue]);
|
|
4069
4051
|
this._emitChange();
|
|
@@ -4094,7 +4076,7 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
4094
4076
|
}
|
|
4095
4077
|
onItemClick(option, event) {
|
|
4096
4078
|
event.stopPropagation();
|
|
4097
|
-
if (this.clearable())
|
|
4079
|
+
if (this.clearable() || this.multiselectable())
|
|
4098
4080
|
this.toggleItem(option);
|
|
4099
4081
|
else
|
|
4100
4082
|
this.selectItem(option);
|
|
@@ -4103,11 +4085,11 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
4103
4085
|
onGroupClick(group) {
|
|
4104
4086
|
if (!this.multiselectable() || this.noGroupActions())
|
|
4105
4087
|
return;
|
|
4106
|
-
if (group.children
|
|
4107
|
-
this.unselectItem(...group.children
|
|
4088
|
+
if (group.children.every(o => o.selected)) {
|
|
4089
|
+
this.unselectItem(...group.children);
|
|
4108
4090
|
return;
|
|
4109
4091
|
}
|
|
4110
|
-
this.selectItem(...group.children
|
|
4092
|
+
this.selectItem(...group.children);
|
|
4111
4093
|
this._isClickedWithin.set(true);
|
|
4112
4094
|
}
|
|
4113
4095
|
handleClearButtonClick(event) {
|
|
@@ -4248,9 +4230,10 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
4248
4230
|
async _onEnterPress(event) {
|
|
4249
4231
|
event.preventDefault();
|
|
4250
4232
|
let shouldClose = true;
|
|
4233
|
+
console.log('enter pressed', this.itemStorage.highlightedItems());
|
|
4251
4234
|
//select the currently highlighted option
|
|
4252
4235
|
if (this.isOpen() && this.firstHighlightedItem()) {
|
|
4253
|
-
if (this.clearable() && this.itemStorage.highlightedItems().every(item => item.selected)) {
|
|
4236
|
+
if ((this.clearable() || this.multiselectable()) && this.itemStorage.highlightedItems().every(item => item.selected)) {
|
|
4254
4237
|
this.unselectItem(...this.itemStorage.highlightedItems());
|
|
4255
4238
|
}
|
|
4256
4239
|
else {
|
|
@@ -4262,8 +4245,9 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
4262
4245
|
await this.addCustomOption(this.searchTerm());
|
|
4263
4246
|
}
|
|
4264
4247
|
//in case of no action, open the dropdown (or keep it open)
|
|
4265
|
-
else
|
|
4248
|
+
else {
|
|
4266
4249
|
shouldClose = false;
|
|
4250
|
+
}
|
|
4267
4251
|
if (!this.keepOpen() && shouldClose) {
|
|
4268
4252
|
this.itemStorage.clearAllHighlights();
|
|
4269
4253
|
this.close();
|
|
@@ -4338,7 +4322,7 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
4338
4322
|
this.itemStorage.highlightAllItems();
|
|
4339
4323
|
}
|
|
4340
4324
|
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 }, sortMultipleValues: { classPropertyName: "sortMultipleValues", publicName: "sortMultipleValues", 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",
|
|
4325
|
+
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 }, sortMultipleValues: { classPropertyName: "sortMultipleValues", publicName: "sortMultipleValues", 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
4326
|
{
|
|
4343
4327
|
provide: NG_VALUE_ACCESSOR,
|
|
4344
4328
|
useExisting: forwardRef(() => ArdiumSelectComponent),
|
|
@@ -4348,7 +4332,7 @@ class ArdiumSelectComponent extends _FormFieldComponentBase {
|
|
|
4348
4332
|
provide: ARD_FORM_FIELD_CONTROL,
|
|
4349
4333
|
useExisting: ArdiumSelectComponent,
|
|
4350
4334
|
},
|
|
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 }); }
|
|
4335
|
+
], 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
4336
|
}
|
|
4353
4337
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumSelectComponent, decorators: [{
|
|
4354
4338
|
type: Component,
|
|
@@ -4362,7 +4346,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
4362
4346
|
provide: ARD_FORM_FIELD_CONTROL,
|
|
4363
4347
|
useExisting: ArdiumSelectComponent,
|
|
4364
4348
|
},
|
|
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"] }]
|
|
4349
|
+
], 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
4350
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
4367
4351
|
type: Inject,
|
|
4368
4352
|
args: [ARD_SELECT_DEFAULTS]
|
|
@@ -4376,12 +4360,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
4376
4360
|
args: [ArdiumOptionComponent]
|
|
4377
4361
|
}], value: [{
|
|
4378
4362
|
type: Input
|
|
4379
|
-
}], dropdownHost: [{
|
|
4380
|
-
type: ViewChild,
|
|
4381
|
-
args: ['dropdownHost', { read: ElementRef }]
|
|
4382
|
-
}], dropdownTemplate: [{
|
|
4383
|
-
type: ViewChild,
|
|
4384
|
-
args: ['dropdownTemplate', { read: TemplateRef }]
|
|
4385
4363
|
}], onWindowResize: [{
|
|
4386
4364
|
type: HostListener,
|
|
4387
4365
|
args: ['window:resize']
|
|
@@ -9110,46 +9088,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
9110
9088
|
class SimpleItemStorage {
|
|
9111
9089
|
constructor(_ardParentComp) {
|
|
9112
9090
|
this._ardParentComp = _ardParentComp;
|
|
9113
|
-
this._items =
|
|
9114
|
-
this._highlightedItems = signal([]);
|
|
9115
|
-
this._selectedItems = signal([]);
|
|
9091
|
+
this._items = arraySignal([]);
|
|
9116
9092
|
/**
|
|
9117
9093
|
* Gets all items.
|
|
9118
9094
|
*/
|
|
9119
|
-
this.items = this._items
|
|
9095
|
+
this.items = computed(() => [...this._items()]);
|
|
9120
9096
|
/**
|
|
9121
|
-
* Gets all currently
|
|
9097
|
+
* Gets all currently selected items.
|
|
9122
9098
|
*/
|
|
9123
|
-
this.
|
|
9099
|
+
this.selectedItems = computed(() => this.items().filter(item => item.selected));
|
|
9124
9100
|
/**
|
|
9125
|
-
* Gets all currently
|
|
9101
|
+
* Gets all currently highlighted items.
|
|
9126
9102
|
*/
|
|
9127
|
-
this.
|
|
9103
|
+
this.highlightedItems = computed(() => this.items().filter(item => item.highlighted));
|
|
9128
9104
|
/**
|
|
9129
9105
|
* Gets the values of the currently selected items.
|
|
9130
9106
|
*/
|
|
9131
|
-
this.value = computed(() => this._itemsToValue(this.
|
|
9107
|
+
this.value = computed(() => this._itemsToValue(this.selectedItems()));
|
|
9132
9108
|
/**
|
|
9133
9109
|
* Returns true if at least one item is highlighted, otherwise false.
|
|
9134
9110
|
*/
|
|
9135
|
-
this.isAnyItemHighlighted = computed(() => this.
|
|
9111
|
+
this.isAnyItemHighlighted = computed(() => this.highlightedItems().length > 0);
|
|
9112
|
+
/**
|
|
9113
|
+
* Finds all highlightable items. An item is considered highlightable if it is **not** disabled.
|
|
9114
|
+
* @returns An array of all highlightable items.
|
|
9115
|
+
*/
|
|
9116
|
+
this._highlightableItems = computed(() => this.items().filter(item => !item.disabled && (this.isItemLimitReached() ? item.selected : true)));
|
|
9117
|
+
this.itemsLeftUntilLimit = computed(() => this._ardParentComp.multiselectable() && isDefined(this._ardParentComp.maxSelectedItems())
|
|
9118
|
+
? this._ardParentComp.maxSelectedItems() - this.selectedItems().length
|
|
9119
|
+
: 1);
|
|
9136
9120
|
/**
|
|
9137
9121
|
* 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
9122
|
*
|
|
9139
9123
|
* **TLDR**: true if `maxSelectedItems` is defined and the number of selected items matches that value.
|
|
9140
9124
|
*/
|
|
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()));
|
|
9125
|
+
this.isItemLimitReached = computed(() => this.itemsLeftUntilLimit() <= 0);
|
|
9126
|
+
this._areItemsInitialized = false;
|
|
9127
|
+
this._valueBeforeItemsSet = null;
|
|
9153
9128
|
}
|
|
9154
9129
|
/**
|
|
9155
9130
|
* Maps an array of items into their values.
|
|
@@ -9157,7 +9132,21 @@ class SimpleItemStorage {
|
|
|
9157
9132
|
* @returns An array of item values.
|
|
9158
9133
|
*/
|
|
9159
9134
|
_itemsToValue(items) {
|
|
9160
|
-
return items.map(item => item.value
|
|
9135
|
+
return items.map(item => item.value);
|
|
9136
|
+
}
|
|
9137
|
+
_updateItems(updateFn) {
|
|
9138
|
+
this._items.map(updateFn);
|
|
9139
|
+
}
|
|
9140
|
+
_updateItemsFromArray(updateFn, itemsToUpdate) {
|
|
9141
|
+
this._items.update(items => {
|
|
9142
|
+
for (const itemToUpdate of itemsToUpdate) {
|
|
9143
|
+
const item = items[itemToUpdate.index];
|
|
9144
|
+
if (item) {
|
|
9145
|
+
items[itemToUpdate.index] = updateFn(item);
|
|
9146
|
+
}
|
|
9147
|
+
}
|
|
9148
|
+
return items;
|
|
9149
|
+
});
|
|
9161
9150
|
}
|
|
9162
9151
|
/**
|
|
9163
9152
|
* Sets the component's items. Takes into account the values defined by the parent component for `valueFrom`, `labelFrom`, and `disabledFrom`.
|
|
@@ -9165,6 +9154,7 @@ class SimpleItemStorage {
|
|
|
9165
9154
|
* @returns true if at least one of the items is of primitive type, otherwise false.
|
|
9166
9155
|
*/
|
|
9167
9156
|
setItems(items) {
|
|
9157
|
+
this._areItemsInitialized = true;
|
|
9168
9158
|
let areItemsPrimitive = false;
|
|
9169
9159
|
if (items.some(isPrimitive)) {
|
|
9170
9160
|
items = items.map(this._primitiveItemsMapFn);
|
|
@@ -9173,6 +9163,10 @@ class SimpleItemStorage {
|
|
|
9173
9163
|
this._items.set(items.map((item, index) => {
|
|
9174
9164
|
return this._setItemsMapFn(item, index, areItemsPrimitive);
|
|
9175
9165
|
}));
|
|
9166
|
+
if (this._valueBeforeItemsSet !== null) {
|
|
9167
|
+
this.writeValue(this._valueBeforeItemsSet);
|
|
9168
|
+
this._valueBeforeItemsSet = null;
|
|
9169
|
+
}
|
|
9176
9170
|
}
|
|
9177
9171
|
_primitiveItemsMapFn(item) {
|
|
9178
9172
|
return { value: item };
|
|
@@ -9180,13 +9174,13 @@ class SimpleItemStorage {
|
|
|
9180
9174
|
_setItemsMapFn(rawItemData, index, areItemsPrimitive) {
|
|
9181
9175
|
if (areItemsPrimitive) {
|
|
9182
9176
|
return {
|
|
9183
|
-
itemData:
|
|
9177
|
+
itemData: rawItemData,
|
|
9184
9178
|
index: index,
|
|
9185
|
-
value:
|
|
9186
|
-
label:
|
|
9187
|
-
disabled:
|
|
9188
|
-
selected:
|
|
9189
|
-
highlighted:
|
|
9179
|
+
value: rawItemData.value,
|
|
9180
|
+
label: rawItemData.value?.toString?.() ?? String(rawItemData.value),
|
|
9181
|
+
disabled: false,
|
|
9182
|
+
selected: false,
|
|
9183
|
+
highlighted: false,
|
|
9190
9184
|
};
|
|
9191
9185
|
}
|
|
9192
9186
|
//get value
|
|
@@ -9203,13 +9197,13 @@ class SimpleItemStorage {
|
|
|
9203
9197
|
}
|
|
9204
9198
|
//return
|
|
9205
9199
|
return {
|
|
9206
|
-
itemData:
|
|
9200
|
+
itemData: rawItemData,
|
|
9207
9201
|
index: index,
|
|
9208
|
-
value:
|
|
9209
|
-
label:
|
|
9210
|
-
disabled:
|
|
9211
|
-
selected:
|
|
9212
|
-
highlighted:
|
|
9202
|
+
value: value,
|
|
9203
|
+
label: label?.toString?.() ?? String(label),
|
|
9204
|
+
disabled: disabled,
|
|
9205
|
+
selected: false,
|
|
9206
|
+
highlighted: false,
|
|
9213
9207
|
};
|
|
9214
9208
|
}
|
|
9215
9209
|
/**
|
|
@@ -9217,6 +9211,10 @@ class SimpleItemStorage {
|
|
|
9217
9211
|
* @param ngModel The value of the ngModel to set.
|
|
9218
9212
|
*/
|
|
9219
9213
|
writeValue(ngModel) {
|
|
9214
|
+
if (!this._areItemsInitialized) {
|
|
9215
|
+
this._valueBeforeItemsSet = ngModel;
|
|
9216
|
+
return;
|
|
9217
|
+
}
|
|
9220
9218
|
this._forceUnselectAll();
|
|
9221
9219
|
if (!this._validateWriteValue(ngModel))
|
|
9222
9220
|
return;
|
|
@@ -9282,12 +9280,12 @@ class SimpleItemStorage {
|
|
|
9282
9280
|
let findBy;
|
|
9283
9281
|
const cmpFn = this._ardParentComp.compareWith();
|
|
9284
9282
|
if (isDefined(cmpFn)) {
|
|
9285
|
-
findBy = item => cmpFn(valueToFind, item.value
|
|
9283
|
+
findBy = item => cmpFn(valueToFind, item.value);
|
|
9286
9284
|
}
|
|
9287
9285
|
else {
|
|
9288
|
-
findBy = item => item.value
|
|
9286
|
+
findBy = item => item.value === valueToFind;
|
|
9289
9287
|
}
|
|
9290
|
-
return this.
|
|
9288
|
+
return this.items().find(item => findBy(item));
|
|
9291
9289
|
}
|
|
9292
9290
|
/**
|
|
9293
9291
|
* Unselects all selected items.
|
|
@@ -9296,27 +9294,15 @@ class SimpleItemStorage {
|
|
|
9296
9294
|
* @returns An array of items cleared, mapped to only their values.
|
|
9297
9295
|
*/
|
|
9298
9296
|
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;
|
|
9297
|
+
return this.unselectItem(...this.selectedItems());
|
|
9309
9298
|
}
|
|
9310
9299
|
/**
|
|
9311
9300
|
* Unselects all selected items, no matter what the component settings are.
|
|
9312
9301
|
* @returns An array of items cleared, mapped to only their values.
|
|
9313
9302
|
*/
|
|
9314
9303
|
_forceUnselectAll() {
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
}
|
|
9318
|
-
const ret = this._itemsToValue(this._selectedItems());
|
|
9319
|
-
this._selectedItems.set([]);
|
|
9304
|
+
const ret = this.value();
|
|
9305
|
+
this._updateItems(item => ({ ...item, selected: false }));
|
|
9320
9306
|
return ret;
|
|
9321
9307
|
}
|
|
9322
9308
|
/**
|
|
@@ -9333,25 +9319,31 @@ class SimpleItemStorage {
|
|
|
9333
9319
|
if (this.isItemLimitReached()) {
|
|
9334
9320
|
return [[], [], this._itemsToValue(items)];
|
|
9335
9321
|
}
|
|
9336
|
-
|
|
9337
|
-
if (!this._ardParentComp.multiselectable()) {
|
|
9338
|
-
unselected = this._forceUnselectAll();
|
|
9339
|
-
}
|
|
9322
|
+
const itemsLeftUntilLimit = this.itemsLeftUntilLimit();
|
|
9340
9323
|
let itemsSelectedCount = 0;
|
|
9341
|
-
const
|
|
9324
|
+
const newItemsArray = [...this.items()];
|
|
9342
9325
|
for (const item of items) {
|
|
9343
9326
|
itemsSelectedCount++;
|
|
9344
|
-
if (item.selected
|
|
9327
|
+
if (item.selected)
|
|
9345
9328
|
continue;
|
|
9346
|
-
if (
|
|
9329
|
+
if (itemsSelectedCount > itemsLeftUntilLimit) {
|
|
9347
9330
|
break;
|
|
9348
9331
|
}
|
|
9349
|
-
item.selected
|
|
9350
|
-
|
|
9332
|
+
newItemsArray[item.index] = { ...item, selected: true };
|
|
9333
|
+
}
|
|
9334
|
+
const itemsUnselected = this._ardParentComp.multiselectable()
|
|
9335
|
+
? []
|
|
9336
|
+
: this.selectedItems().filter(item => !items.find(v => v.value === item.value));
|
|
9337
|
+
for (const item of itemsUnselected) {
|
|
9338
|
+
newItemsArray[item.index] = { ...item, selected: false };
|
|
9339
|
+
}
|
|
9340
|
+
const itemsSelected = items.slice(0, itemsSelectedCount);
|
|
9341
|
+
const itemsFailedToSelect = items.slice(itemsSelectedCount);
|
|
9342
|
+
const isAnyNewItemToBeSelected = !!itemsSelected.find(item => !this.selectedItems().find(v => v.value === item.value));
|
|
9343
|
+
if (isAnyNewItemToBeSelected) {
|
|
9344
|
+
this._items.set(newItemsArray);
|
|
9351
9345
|
}
|
|
9352
|
-
this.
|
|
9353
|
-
const itemsFailedToSelect = items.slice(itemsSelectedCount - 1);
|
|
9354
|
-
return [this._itemsToValue(itemsSelected), unselected, this._itemsToValue(itemsFailedToSelect)];
|
|
9346
|
+
return [this._itemsToValue(itemsSelected), this._itemsToValue(itemsUnselected), this._itemsToValue(itemsFailedToSelect)];
|
|
9355
9347
|
}
|
|
9356
9348
|
/**
|
|
9357
9349
|
*
|
|
@@ -9359,27 +9351,28 @@ class SimpleItemStorage {
|
|
|
9359
9351
|
* @returns An array of items unselected, mapped to only their values.
|
|
9360
9352
|
*/
|
|
9361
9353
|
unselectItem(...items) {
|
|
9362
|
-
let
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9354
|
+
let shouldKeepFirstSelected = this._ardParentComp.isValueRequired();
|
|
9355
|
+
const unselectedItems = [];
|
|
9356
|
+
this._updateItemsFromArray(item => {
|
|
9357
|
+
if (item.selected && shouldKeepFirstSelected) {
|
|
9358
|
+
shouldKeepFirstSelected = false;
|
|
9359
|
+
return item;
|
|
9367
9360
|
}
|
|
9368
|
-
if (
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
|
|
9373
|
-
|
|
9361
|
+
if (item.selected) {
|
|
9362
|
+
unselectedItems.push(item);
|
|
9363
|
+
}
|
|
9364
|
+
return {
|
|
9365
|
+
...item,
|
|
9366
|
+
selected: false,
|
|
9367
|
+
};
|
|
9368
|
+
}, items);
|
|
9369
|
+
return this._itemsToValue(unselectedItems);
|
|
9374
9370
|
}
|
|
9375
9371
|
/**
|
|
9376
9372
|
* Unhighlights all currently highlighted items.
|
|
9377
9373
|
*/
|
|
9378
9374
|
unhighlightAll() {
|
|
9379
|
-
|
|
9380
|
-
item.highlighted.set(false);
|
|
9381
|
-
}
|
|
9382
|
-
this._highlightedItems.set([]);
|
|
9375
|
+
this._updateItems(item => ({ ...item, highlighted: false }));
|
|
9383
9376
|
}
|
|
9384
9377
|
/**
|
|
9385
9378
|
* Highlights the given item, while unhighlighting all other items. Does nothing when the item is disabled.
|
|
@@ -9387,7 +9380,7 @@ class SimpleItemStorage {
|
|
|
9387
9380
|
* @returns The highlighted item.
|
|
9388
9381
|
*/
|
|
9389
9382
|
highlightSingleItem(item) {
|
|
9390
|
-
if (!item || item.disabled
|
|
9383
|
+
if (!item || item.disabled)
|
|
9391
9384
|
return null;
|
|
9392
9385
|
this.unhighlightAll();
|
|
9393
9386
|
return this.highlightItem(item);
|
|
@@ -9398,10 +9391,7 @@ class SimpleItemStorage {
|
|
|
9398
9391
|
* @returns The last highlighted item.
|
|
9399
9392
|
*/
|
|
9400
9393
|
highlightItem(...items) {
|
|
9401
|
-
|
|
9402
|
-
item.highlighted.set(true);
|
|
9403
|
-
}
|
|
9404
|
-
this._highlightedItems.update(v => [...v, ...items]);
|
|
9394
|
+
this._updateItemsFromArray(item => ({ ...item, highlighted: true }), items);
|
|
9405
9395
|
return items.last();
|
|
9406
9396
|
}
|
|
9407
9397
|
/**
|
|
@@ -9409,12 +9399,7 @@ class SimpleItemStorage {
|
|
|
9409
9399
|
* @param items A rest operator array of items to be unhighlighted.
|
|
9410
9400
|
*/
|
|
9411
9401
|
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()));
|
|
9402
|
+
this._updateItemsFromArray(item => ({ ...item, highlighted: false }), items);
|
|
9418
9403
|
}
|
|
9419
9404
|
/**
|
|
9420
9405
|
* Highlights the first item out of all items.
|
|
@@ -9422,7 +9407,7 @@ class SimpleItemStorage {
|
|
|
9422
9407
|
*/
|
|
9423
9408
|
highlightFirstItem() {
|
|
9424
9409
|
this.unhighlightAll();
|
|
9425
|
-
const itemToHighlight = this.
|
|
9410
|
+
const itemToHighlight = this._highlightableItems().first();
|
|
9426
9411
|
return this.highlightItem(itemToHighlight);
|
|
9427
9412
|
}
|
|
9428
9413
|
/**
|
|
@@ -9431,14 +9416,14 @@ class SimpleItemStorage {
|
|
|
9431
9416
|
*/
|
|
9432
9417
|
highlightLastItem() {
|
|
9433
9418
|
this.unhighlightAll();
|
|
9434
|
-
const itemToHighlight = this.
|
|
9419
|
+
const itemToHighlight = this._highlightableItems().last();
|
|
9435
9420
|
return this.highlightItem(itemToHighlight);
|
|
9436
9421
|
}
|
|
9437
9422
|
/**
|
|
9438
9423
|
* Highlights all non-disabled items.
|
|
9439
9424
|
*/
|
|
9440
9425
|
highlightAllItems() {
|
|
9441
|
-
const itemsToHighlight = this.
|
|
9426
|
+
const itemsToHighlight = this._highlightableItems();
|
|
9442
9427
|
this.highlightItem(...itemsToHighlight);
|
|
9443
9428
|
}
|
|
9444
9429
|
/**
|
|
@@ -9454,7 +9439,7 @@ class SimpleItemStorage {
|
|
|
9454
9439
|
return this.highlightFirstItem();
|
|
9455
9440
|
}
|
|
9456
9441
|
const currentItem = this.highlightedItems().last();
|
|
9457
|
-
const itemsWithoutDisabled = this._items().filter(item => !item.disabled
|
|
9442
|
+
const itemsWithoutDisabled = this._items().filter(item => !item.disabled && (!this.isItemLimitReached() || item.selected));
|
|
9458
9443
|
const currentIndexInItems = itemsWithoutDisabled.findIndex(item => item.index === currentItem.index);
|
|
9459
9444
|
let nextItemIndex = currentIndexInItems + offset;
|
|
9460
9445
|
if (nextItemIndex >= itemsWithoutDisabled.length) {
|
|
@@ -9465,7 +9450,7 @@ class SimpleItemStorage {
|
|
|
9465
9450
|
}
|
|
9466
9451
|
const itemToHighlight = itemsWithoutDisabled[nextItemIndex];
|
|
9467
9452
|
if (hasShift && this._ardParentComp.multiselectable()) {
|
|
9468
|
-
if (itemToHighlight.highlighted
|
|
9453
|
+
if (itemToHighlight.highlighted) {
|
|
9469
9454
|
this.unhighlightItem(currentItem);
|
|
9470
9455
|
}
|
|
9471
9456
|
return this.highlightItem(itemToHighlight);
|
|
@@ -9498,13 +9483,17 @@ class _SelectableListComponentBase extends _FormFieldComponentBase {
|
|
|
9498
9483
|
this.disabledFrom = input(this._DEFAULTS.disabledFrom);
|
|
9499
9484
|
this.compareWith = input(this._DEFAULTS.compareWith);
|
|
9500
9485
|
//! multiselectable
|
|
9501
|
-
this.multiselectable = input(this._DEFAULTS.multiselectable, {
|
|
9486
|
+
this.multiselectable = input(this._DEFAULTS.multiselectable, {
|
|
9487
|
+
transform: v => coerceBooleanProperty(v),
|
|
9488
|
+
});
|
|
9502
9489
|
this.singleselectable = computed(() => !this.multiselectable());
|
|
9503
9490
|
//! require value
|
|
9504
9491
|
this.requireValue = input(this._DEFAULTS.requireValue, { transform: v => coerceBooleanProperty(v) });
|
|
9505
9492
|
this.isValueRequired = computed(() => this.requireValue() || !this.multiselectable());
|
|
9506
9493
|
//! coerced properties
|
|
9507
|
-
this.invertDisabled = input(this._DEFAULTS.invertDisabled, {
|
|
9494
|
+
this.invertDisabled = input(this._DEFAULTS.invertDisabled, {
|
|
9495
|
+
transform: v => coerceBooleanProperty(v),
|
|
9496
|
+
});
|
|
9508
9497
|
this.maxSelectedItems = input(this._DEFAULTS.maxSelectedItems, {
|
|
9509
9498
|
transform: v => coerceNumberProperty(v, undefined),
|
|
9510
9499
|
});
|
|
@@ -9516,9 +9505,20 @@ class _SelectableListComponentBase extends _FormFieldComponentBase {
|
|
|
9516
9505
|
this.highlightedItems = computed(() => this.itemStorage.highlightedItems());
|
|
9517
9506
|
this.firstHighlightedItem = computed(() => this.highlightedItems()?.first());
|
|
9518
9507
|
this.isItemLimitReached = computed(() => this.itemStorage.isItemLimitReached());
|
|
9508
|
+
//! context providers
|
|
9509
|
+
this.optionContextGenerator = computed(() => item => ({
|
|
9510
|
+
$implicit: item,
|
|
9511
|
+
item,
|
|
9512
|
+
index: item.index,
|
|
9513
|
+
value: item.value,
|
|
9514
|
+
label: item.label,
|
|
9515
|
+
selected: item.selected,
|
|
9516
|
+
highlighted: item.highlighted,
|
|
9517
|
+
itemData: item.itemData,
|
|
9518
|
+
disabled: item.disabled,
|
|
9519
|
+
}));
|
|
9519
9520
|
this.valueChange = output();
|
|
9520
9521
|
//! output events
|
|
9521
|
-
this.changeEvent = output({ alias: 'change' });
|
|
9522
9522
|
this.addEvent = output({ alias: 'add' });
|
|
9523
9523
|
this.removeEvent = output({ alias: 'remove' });
|
|
9524
9524
|
//! highligh-related
|
|
@@ -9555,7 +9555,6 @@ class _SelectableListComponentBase extends _FormFieldComponentBase {
|
|
|
9555
9555
|
_emitChange() {
|
|
9556
9556
|
const value = this.singleselectable() ? this.itemStorage.value()[0] : this.itemStorage.value();
|
|
9557
9557
|
this._onChangeRegistered?.(value);
|
|
9558
|
-
this.changeEvent.emit(value);
|
|
9559
9558
|
this.valueChange.emit(value);
|
|
9560
9559
|
}
|
|
9561
9560
|
_onTouched() {
|
|
@@ -9577,14 +9576,6 @@ class _SelectableListComponentBase extends _FormFieldComponentBase {
|
|
|
9577
9576
|
if (!this.touched())
|
|
9578
9577
|
this.lastBlurTimestamp.set(Date.now());
|
|
9579
9578
|
}
|
|
9580
|
-
//! context providers
|
|
9581
|
-
getOptionContext(item) {
|
|
9582
|
-
return {
|
|
9583
|
-
$implicit: item,
|
|
9584
|
-
item,
|
|
9585
|
-
itemData: item.itemData(),
|
|
9586
|
-
};
|
|
9587
|
-
}
|
|
9588
9579
|
//! value input & output
|
|
9589
9580
|
set value(newValue) {
|
|
9590
9581
|
if (this.multiselectable() && !Array.isArray(newValue))
|
|
@@ -9593,7 +9584,7 @@ class _SelectableListComponentBase extends _FormFieldComponentBase {
|
|
|
9593
9584
|
}
|
|
9594
9585
|
//! item selection handlers
|
|
9595
9586
|
toggleItem(item) {
|
|
9596
|
-
if (item.selected
|
|
9587
|
+
if (item.selected) {
|
|
9597
9588
|
if (this.singleselectable())
|
|
9598
9589
|
return;
|
|
9599
9590
|
this.unselectItem(item);
|
|
@@ -9712,7 +9703,7 @@ class _SelectableListComponentBase extends _FormFieldComponentBase {
|
|
|
9712
9703
|
this.itemStorage.highlightAllItems();
|
|
9713
9704
|
}
|
|
9714
9705
|
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",
|
|
9706
|
+
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
9707
|
}
|
|
9717
9708
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: _SelectableListComponentBase, decorators: [{
|
|
9718
9709
|
type: Directive
|
|
@@ -9881,7 +9872,7 @@ class ArdiumSegmentComponent extends _SelectableListComponentBase {
|
|
|
9881
9872
|
provide: ARD_FORM_FIELD_CONTROL,
|
|
9882
9873
|
useExisting: ArdiumSegmentComponent,
|
|
9883
9874
|
},
|
|
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
|
|
9875
|
+
], 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
9876
|
}
|
|
9886
9877
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumSegmentComponent, decorators: [{
|
|
9887
9878
|
type: Component,
|
|
@@ -9895,7 +9886,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
9895
9886
|
provide: ARD_FORM_FIELD_CONTROL,
|
|
9896
9887
|
useExisting: ArdiumSegmentComponent,
|
|
9897
9888
|
},
|
|
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
|
|
9889
|
+
], 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
9890
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
9900
9891
|
type: Inject,
|
|
9901
9892
|
args: [ARD_SEGMENT_DEFAULTS]
|
|
@@ -11138,9 +11129,9 @@ class ArdiumCheckboxListComponent extends _NgModelComponentBase {
|
|
|
11138
11129
|
this._componentId = '300';
|
|
11139
11130
|
this._componentName = 'checkbox-list';
|
|
11140
11131
|
this._itemStorage = new SimpleItemStorage(this);
|
|
11141
|
-
this.valueFrom = input(this.
|
|
11142
|
-
this.labelFrom = input(this.
|
|
11143
|
-
this.disabledFrom = input(this.
|
|
11132
|
+
this.valueFrom = input(this._DEFAULTS.valueFrom);
|
|
11133
|
+
this.labelFrom = input(this._DEFAULTS.labelFrom);
|
|
11134
|
+
this.disabledFrom = input(this._DEFAULTS.disabledFrom);
|
|
11144
11135
|
this.compareWith = input(this._DEFAULTS.compareWith);
|
|
11145
11136
|
this.invertDisabled = input(this._DEFAULTS.invertDisabled, {
|
|
11146
11137
|
transform: v => coerceBooleanProperty(v),
|
|
@@ -11154,11 +11145,21 @@ class ArdiumCheckboxListComponent extends _NgModelComponentBase {
|
|
|
11154
11145
|
this.compact = input(this._DEFAULTS.compact, { transform: v => coerceBooleanProperty(v) });
|
|
11155
11146
|
this.ngClasses = computed(() => [`ard-color-${this.color()}`, `ard-align-${this.align()}`, this.compact() ? 'ard-compact' : ''].join(' '));
|
|
11156
11147
|
this.valueChange = output();
|
|
11157
|
-
this.changeEvent = output({ alias: 'change' });
|
|
11158
11148
|
this._isViewInit = false;
|
|
11159
11149
|
//! templates
|
|
11160
11150
|
this.checkboxTemplate = contentChild(ArdCheckboxListCheckboxTemplateDirective);
|
|
11161
11151
|
this.labelTemplate = contentChild(ArdCheckboxListLabelTemplateDirective);
|
|
11152
|
+
this.labelContextGenerator = computed(() => item => ({
|
|
11153
|
+
$implicit: item,
|
|
11154
|
+
item,
|
|
11155
|
+
index: item.index,
|
|
11156
|
+
value: item.value,
|
|
11157
|
+
label: item.label,
|
|
11158
|
+
selected: item.selected,
|
|
11159
|
+
highlighted: item.highlighted,
|
|
11160
|
+
itemData: item.itemData,
|
|
11161
|
+
disabled: item.disabled,
|
|
11162
|
+
}));
|
|
11162
11163
|
}
|
|
11163
11164
|
get _htmlIdHostAttribute() {
|
|
11164
11165
|
return this.htmlId();
|
|
@@ -11192,7 +11193,6 @@ class ArdiumCheckboxListComponent extends _NgModelComponentBase {
|
|
|
11192
11193
|
_emitChange() {
|
|
11193
11194
|
const v = this.value;
|
|
11194
11195
|
this._onChangeRegistered?.(v);
|
|
11195
|
-
this.changeEvent.emit(v);
|
|
11196
11196
|
this.valueChange.emit(v);
|
|
11197
11197
|
}
|
|
11198
11198
|
onItemHighlight(v) {
|
|
@@ -11213,25 +11213,18 @@ class ArdiumCheckboxListComponent extends _NgModelComponentBase {
|
|
|
11213
11213
|
this._emitChange();
|
|
11214
11214
|
}
|
|
11215
11215
|
toggleItem(v) {
|
|
11216
|
-
if (v.selected
|
|
11216
|
+
if (v.selected) {
|
|
11217
11217
|
this.unselectItem(v);
|
|
11218
11218
|
return;
|
|
11219
11219
|
}
|
|
11220
11220
|
this.selectItem(v);
|
|
11221
11221
|
}
|
|
11222
|
-
getLabelContext(item) {
|
|
11223
|
-
return {
|
|
11224
|
-
$implicit: item,
|
|
11225
|
-
item,
|
|
11226
|
-
itemData: item.itemData(),
|
|
11227
|
-
};
|
|
11228
|
-
}
|
|
11229
11222
|
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"
|
|
11223
|
+
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
11224
|
}
|
|
11232
11225
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumCheckboxListComponent, decorators: [{
|
|
11233
11226
|
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
|
|
11227
|
+
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
11228
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
11236
11229
|
type: Inject,
|
|
11237
11230
|
args: [ARD_CHECKBOX_LIST_DEFAULTS]
|
|
@@ -13055,7 +13048,7 @@ class ArdiumTablePaginationComponent extends _FocusableComponentBase {
|
|
|
13055
13048
|
this._emitPageEvent();
|
|
13056
13049
|
}
|
|
13057
13050
|
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", "sortMultipleValues", "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", "
|
|
13051
|
+
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", "sortMultipleValues", "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
13052
|
}
|
|
13060
13053
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ArdiumTablePaginationComponent, decorators: [{
|
|
13061
13054
|
type: Component,
|