@coolon/angular-ui-powerups 16.1.0-alpha.278 → 16.1.0-alpha.280
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/esm2022/lib/components/forms/abstract-input.component.mjs +15 -3
- package/esm2022/lib/components/forms/checkbox-input/checkbox-input.component.mjs +3 -3
- package/esm2022/lib/components/forms/select-input/select-input.component.mjs +71 -15
- package/esm2022/lib/interaction/components/input-activities/select-input-activity.mjs +1 -1
- package/fesm2022/coolon-angular-ui-powerups.mjs +85 -17
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/forms/abstract-input.component.d.ts +8 -1
- package/lib/components/forms/select-input/select-input.component.d.ts +42 -9
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { ObserversModule } from '@angular/cdk/observers';
|
|
|
2
2
|
import * as i1$1 from '@angular/common';
|
|
3
3
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { inject, ViewContainerRef, Directive, ElementRef, Inject, Host, Optional, Input, HostListener, InjectionToken, ChangeDetectorRef, NgZone, Injectable, Pipe, NgModule, Component, ContentChild, HostBinding, ChangeDetectionStrategy, ViewEncapsulation, ViewChild, ViewChildren, EventEmitter, Output, Self, ContentChildren, ComponentRef, Injector, PLATFORM_ID, SkipSelf } from '@angular/core';
|
|
5
|
+
import { inject, ViewContainerRef, Directive, ElementRef, Inject, Host, Optional, Input, HostListener, InjectionToken, ChangeDetectorRef, NgZone, Injectable, Pipe, NgModule, Component, ContentChild, HostBinding, ChangeDetectionStrategy, ViewEncapsulation, ViewChild, ViewChildren, EventEmitter, Output, Self, isDevMode, ContentChildren, ComponentRef, Injector, PLATFORM_ID, SkipSelf } from '@angular/core';
|
|
6
6
|
import * as i2$5 from '@angular/forms';
|
|
7
7
|
import { FormsModule } from '@angular/forms';
|
|
8
8
|
import * as i4 from '@angular/material/form-field';
|
|
@@ -2211,6 +2211,16 @@ class AbstractInputComponent extends DisposableComponent {
|
|
|
2211
2211
|
get enabled$() {
|
|
2212
2212
|
return this._enabled$.readonly$;
|
|
2213
2213
|
}
|
|
2214
|
+
/**
|
|
2215
|
+
* The inverse of {@link enabled$}, for a caller whose model already reads as a reason to disable -
|
|
2216
|
+
* "no groups to choose from", say. Hand-inverting such a model at the call site reads correctly
|
|
2217
|
+
* and behaves backwards, and nothing in the template says which way it runs; bind it as it is.
|
|
2218
|
+
* A nil model restores the default (the form value's own enabled state).
|
|
2219
|
+
*/
|
|
2220
|
+
set disable$(condition$) {
|
|
2221
|
+
const { chain } = Dsl.disposeWith(this);
|
|
2222
|
+
this._enabled$.setDelegate(condition$ ? chain(condition$).mapWithNil(disabled => !disabled) : undefined);
|
|
2223
|
+
}
|
|
2214
2224
|
// Note: I don't need to use delegates here as I never subscribe to the commands models
|
|
2215
2225
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
2216
2226
|
focusCommand;
|
|
@@ -2404,7 +2414,7 @@ class AbstractInputComponent extends DisposableComponent {
|
|
|
2404
2414
|
return i18nValue?.startsWith("missing key") ? undefined : i18nValue;
|
|
2405
2415
|
}
|
|
2406
2416
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: AbstractInputComponent, deps: [{ token: INPUT_TOKEN_HACK }], target: i0.ɵɵFactoryTarget.Component });
|
|
2407
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: AbstractInputComponent, selector: "ng-component", inputs: { i18n$: "i18n$", i18n: "i18n", _label: ["label", "_label"], userFloatLabel: ["floatLabel", "userFloatLabel"], _hint: ["hint", "_hint"], _placeholder: ["placeholder", "_placeholder"], dense: "dense", enabled$: "enabled$", focusCommand: ["command.focus", "focusCommand"], blurCommand: ["command.blur", "blurCommand"], enterCommand: ["command.enter", "enterCommand"], escapeCommand: ["command.escape", "escapeCommand"], clickCommand: ["command.click", "clickCommand"] }, outputs: { focus: "focus", blur: "blur", enterKey: "enterKey", escapeKey: "escapeKey" }, host: { listeners: { "click": "notifyClick()", "focusin": "notifyFocusIn()", "focusout": "notifyFocusOut()" }, properties: { "class.dense": "this.dense", "class": "this.baseClassName", "class.disabled": "this.disabled", "class.aup-has-subscript": "this.hasInlineMessage" } }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
2417
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: AbstractInputComponent, selector: "ng-component", inputs: { i18n$: "i18n$", i18n: "i18n", _label: ["label", "_label"], userFloatLabel: ["floatLabel", "userFloatLabel"], _hint: ["hint", "_hint"], _placeholder: ["placeholder", "_placeholder"], dense: "dense", enabled$: "enabled$", disable$: "disable$", focusCommand: ["command.focus", "focusCommand"], blurCommand: ["command.blur", "blurCommand"], enterCommand: ["command.enter", "enterCommand"], escapeCommand: ["command.escape", "escapeCommand"], clickCommand: ["command.click", "clickCommand"] }, outputs: { focus: "focus", blur: "blur", enterKey: "enterKey", escapeKey: "escapeKey" }, host: { listeners: { "click": "notifyClick()", "focusin": "notifyFocusIn()", "focusout": "notifyFocusOut()" }, properties: { "class.dense": "this.dense", "class": "this.baseClassName", "class.disabled": "this.disabled", "class.aup-has-subscript": "this.hasInlineMessage" } }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
2408
2418
|
}
|
|
2409
2419
|
__decorate([
|
|
2410
2420
|
Proxify(),
|
|
@@ -2443,6 +2453,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImpor
|
|
|
2443
2453
|
type: Input
|
|
2444
2454
|
}], enabled$: [{
|
|
2445
2455
|
type: Input
|
|
2456
|
+
}], disable$: [{
|
|
2457
|
+
type: Input
|
|
2446
2458
|
}], focusCommand: [{
|
|
2447
2459
|
type: Input,
|
|
2448
2460
|
args: ['command.focus']
|
|
@@ -2735,11 +2747,11 @@ class CheckboxInputComponent extends AbstractValueInputComponent {
|
|
|
2735
2747
|
this.componentValue$.value = $event.checked;
|
|
2736
2748
|
}
|
|
2737
2749
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: CheckboxInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2738
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: CheckboxInputComponent, selector: "aup-checkbox-input", inputs: { color: "color", labelPosition: "labelPosition" }, usesInheritance: true, ngImport: i0, template: "<!-- TODO: add focus binding -->\n<!-- NOTE: using [(ngModel)] affects how material renders the component and makes it harder to test
|
|
2750
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: CheckboxInputComponent, selector: "aup-checkbox-input", inputs: { color: "color", labelPosition: "labelPosition" }, usesInheritance: true, ngImport: i0, template: "<!-- TODO: add focus binding -->\n<!-- NOTE: using [(ngModel)] affects how material renders the component and makes it harder to test\n so we're using [checked] and (change).\n The `?? false` is part of that: an optional boolean model holds undefined until something sets\n it, and a nil bound value renders the same but makes Angular drop the binding's dev-mode\n ng-reflect attribute entirely, which is what several test harnesses read. Coerced here for the\n view only \u2014 the model keeps whatever it holds. -->\n<mat-checkbox\n [checked]=\"componentValue$.value ?? false\"\n (change)=\"select($event)\"\n [color]=\"color\"\n [labelPosition]=\"labelPosition\"\n [disabled]=\"!isEnabled()\"\n>{{ label }}<!--\n The icon lives inside the label rather than as a sibling: :host is a column flex, so a sibling\n would stack underneath and add the very height dense mode exists to avoid.\n--><span class=\"aup-validation-icon\" *ngIf=\"popupMessage\"><aup-icon data-cy=\"validation-icon\"\n [icon]=\"popupIcon\" [ngClass]=\"popupSeverityClass\"\n [aupTooltip]=\"popupMessage\" aupTooltipPosition=\"above\"></aup-icon></span>\n</mat-checkbox>\n<!--\n The wrapper has to persist for the grid collapse to have something to animate \u2014 the messages\n themselves come and go with *ngIf. inlineHintText/inlineError are already null when dense, so\n no !dense guard is needed.\n-->\n<div class=\"aup-subscript\">\n <mat-hint *ngIf=\"inlineHintText\" [ngClass]=\"inlineHintClass\">{{inlineHintText}}</mat-hint>\n <mat-error *ngIf=\"inlineError\">{{inlineError}}</mat-error>\n</div>\n", styles: [":host{display:inline-flex;flex-direction:column;padding:10px 0 0}:host.dense{padding:4px 0 2px}.aup-subscript{display:grid;grid-template-rows:0fr}.aup-subscript>*{overflow:hidden}:host(.aup-has-subscript) .aup-subscript{grid-template-rows:1fr;transition:grid-template-rows .15s ease-out}@media (prefers-reduced-motion: reduce){:host(.aup-has-subscript) .aup-subscript{transition:none}}mat-hint,mat-error{animation:aup-subscript-message-in .15s ease-out;padding-top:4px;margin-left:24px;font-size:12px;font-weight:400;line-height:13.5px}@media (prefers-reduced-motion: reduce){mat-hint,mat-error{animation:none}}aup-icon.aup-error,aup-icon.aup-warning,aup-icon.aup-info{--aup-icon-size: 16px;vertical-align:text-bottom}span.aup-validation-icon{display:inline-block;overflow:hidden;vertical-align:text-bottom;animation:aup-validation-icon-in .15s ease-out}span.aup-validation-icon aup-icon{margin-left:4px}@media (prefers-reduced-motion: reduce){span.aup-validation-icon{animation:none}}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: AupTooltipDirective, selector: "[aupTooltip]", inputs: ["aupTooltip", "aupTooltipPosition", "aupTooltipPositionAtOrigin", "aupTooltipDisabled", "aupTooltipShowDelay", "aupTooltipHideDelay", "aupTooltipTouchGestures", "aupTooltipClass"], exportAs: ["aupTooltip"] }, { kind: "component", type: i2$6.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: IconComponent, selector: "aup-icon", inputs: ["icon"] }] });
|
|
2739
2751
|
}
|
|
2740
2752
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: CheckboxInputComponent, decorators: [{
|
|
2741
2753
|
type: Component,
|
|
2742
|
-
args: [{ selector: 'aup-checkbox-input', template: "<!-- TODO: add focus binding -->\n<!-- NOTE: using [(ngModel)] affects how material renders the component and makes it harder to test
|
|
2754
|
+
args: [{ selector: 'aup-checkbox-input', template: "<!-- TODO: add focus binding -->\n<!-- NOTE: using [(ngModel)] affects how material renders the component and makes it harder to test\n so we're using [checked] and (change).\n The `?? false` is part of that: an optional boolean model holds undefined until something sets\n it, and a nil bound value renders the same but makes Angular drop the binding's dev-mode\n ng-reflect attribute entirely, which is what several test harnesses read. Coerced here for the\n view only \u2014 the model keeps whatever it holds. -->\n<mat-checkbox\n [checked]=\"componentValue$.value ?? false\"\n (change)=\"select($event)\"\n [color]=\"color\"\n [labelPosition]=\"labelPosition\"\n [disabled]=\"!isEnabled()\"\n>{{ label }}<!--\n The icon lives inside the label rather than as a sibling: :host is a column flex, so a sibling\n would stack underneath and add the very height dense mode exists to avoid.\n--><span class=\"aup-validation-icon\" *ngIf=\"popupMessage\"><aup-icon data-cy=\"validation-icon\"\n [icon]=\"popupIcon\" [ngClass]=\"popupSeverityClass\"\n [aupTooltip]=\"popupMessage\" aupTooltipPosition=\"above\"></aup-icon></span>\n</mat-checkbox>\n<!--\n The wrapper has to persist for the grid collapse to have something to animate \u2014 the messages\n themselves come and go with *ngIf. inlineHintText/inlineError are already null when dense, so\n no !dense guard is needed.\n-->\n<div class=\"aup-subscript\">\n <mat-hint *ngIf=\"inlineHintText\" [ngClass]=\"inlineHintClass\">{{inlineHintText}}</mat-hint>\n <mat-error *ngIf=\"inlineError\">{{inlineError}}</mat-error>\n</div>\n", styles: [":host{display:inline-flex;flex-direction:column;padding:10px 0 0}:host.dense{padding:4px 0 2px}.aup-subscript{display:grid;grid-template-rows:0fr}.aup-subscript>*{overflow:hidden}:host(.aup-has-subscript) .aup-subscript{grid-template-rows:1fr;transition:grid-template-rows .15s ease-out}@media (prefers-reduced-motion: reduce){:host(.aup-has-subscript) .aup-subscript{transition:none}}mat-hint,mat-error{animation:aup-subscript-message-in .15s ease-out;padding-top:4px;margin-left:24px;font-size:12px;font-weight:400;line-height:13.5px}@media (prefers-reduced-motion: reduce){mat-hint,mat-error{animation:none}}aup-icon.aup-error,aup-icon.aup-warning,aup-icon.aup-info{--aup-icon-size: 16px;vertical-align:text-bottom}span.aup-validation-icon{display:inline-block;overflow:hidden;vertical-align:text-bottom;animation:aup-validation-icon-in .15s ease-out}span.aup-validation-icon aup-icon{margin-left:4px}@media (prefers-reduced-motion: reduce){span.aup-validation-icon{animation:none}}\n"] }]
|
|
2743
2755
|
}], ctorParameters: function () { return []; }, propDecorators: { color: [{
|
|
2744
2756
|
type: Input
|
|
2745
2757
|
}], labelPosition: [{
|
|
@@ -3000,9 +3012,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImpor
|
|
|
3000
3012
|
* <aup-select-input [value$]="myModel" [options]="myOptions" [searchable]="true"
|
|
3001
3013
|
* searchPlaceholder="Find a hero…" noResultsText="No heros match"></aup-select-input>
|
|
3002
3014
|
* A search box is rendered at the top of the dropdown panel and filters the options client side on
|
|
3003
|
-
*
|
|
3004
|
-
*
|
|
3005
|
-
*
|
|
3015
|
+
* the rows {@link optionSearchText} returns - by default the single row optionLabelFormat produces.
|
|
3016
|
+
* An option that renders more than optionLabelFormat through #optionTemplate must return every row
|
|
3017
|
+
* it shows, or the user can read text the search cannot find:
|
|
3018
|
+
*
|
|
3019
|
+
* <aup-select-input ... [searchable]="true" [optionSearchText]="hero => [hero.name, hero.alias]">
|
|
3020
|
+
* <ng-template #optionTemplate let-hero>{{hero.name}}<br>{{hero.alias}}</ng-template>
|
|
3021
|
+
* </aup-select-input>
|
|
3022
|
+
*
|
|
3023
|
+
* Rows are matched one at a time, so a term cannot straddle two of them. In development mode a
|
|
3024
|
+
* searchable select with an #optionTemplate and neither optionSearchText nor filterFactory warns.
|
|
3025
|
+
* Override {@link filterFactory} only for matching that is genuinely different - fuzzy, tokenised,
|
|
3026
|
+
* remote. Bind {@link searchText$} to observe or pre-seed the text (it is cleared whenever the panel
|
|
3027
|
+
* closes). The nil option is never filtered - it is a clear-the-selection affordance, not a data
|
|
3028
|
+
* option.
|
|
3006
3029
|
*/
|
|
3007
3030
|
class SelectInputComponent extends AbstractValueInputComponent {
|
|
3008
3031
|
/** Keys the search box hands back to MatSelect's key manager instead of consuming itself. */
|
|
@@ -3014,7 +3037,12 @@ class SelectInputComponent extends AbstractValueInputComponent {
|
|
|
3014
3037
|
get options() { return this.#options_accessor_storage; }
|
|
3015
3038
|
set options(value) { this.#options_accessor_storage = value; }
|
|
3016
3039
|
optionLabel;
|
|
3017
|
-
allowNil;
|
|
3040
|
+
#allowNil$_accessor_storage = proxify((ValueModel));
|
|
3041
|
+
get allowNil$() { return this.#allowNil$_accessor_storage; }
|
|
3042
|
+
set allowNil$(value) { this.#allowNil$_accessor_storage = value; }
|
|
3043
|
+
#allowNil_accessor_storage;
|
|
3044
|
+
get allowNil() { return this.#allowNil_accessor_storage; }
|
|
3045
|
+
set allowNil(value) { this.#allowNil_accessor_storage = value; }
|
|
3018
3046
|
selectedOptionTemplateRef;
|
|
3019
3047
|
optionTemplateRef;
|
|
3020
3048
|
nilOptionTemplateRef;
|
|
@@ -3029,21 +3057,28 @@ class SelectInputComponent extends AbstractValueInputComponent {
|
|
|
3029
3057
|
/** Bindable so a host can pre-seed or observe the search text. Cleared when the panel closes. */
|
|
3030
3058
|
get searchText$() { return this.#searchText$_accessor_storage; }
|
|
3031
3059
|
set searchText$(value) { this.#searchText$_accessor_storage = value; }
|
|
3060
|
+
defaultOptionSearchText = (option) => this.optionLabelFormat(option);
|
|
3061
|
+
/**
|
|
3062
|
+
* The text the default filter searches, one entry per row the option renders. Defaults to the
|
|
3063
|
+
* single row optionLabelFormat produces. Return every row an #optionTemplate shows - a second line
|
|
3064
|
+
* the search cannot see is the bug this input exists to prevent. Nil entries are skipped and
|
|
3065
|
+
* non-strings are matched by their text.
|
|
3066
|
+
*/
|
|
3067
|
+
optionSearchText = this.defaultOptionSearchText;
|
|
3032
3068
|
/**
|
|
3033
3069
|
* NOTE: deliberately NOT the AutocompleteInputComponent default - there an empty filter matches
|
|
3034
3070
|
* nothing, here it must match everything or the panel opens blank. It also guards a nil or
|
|
3035
|
-
* non-string
|
|
3071
|
+
* non-string row, which the autocomplete version does not.
|
|
3036
3072
|
*/
|
|
3037
|
-
|
|
3073
|
+
defaultFilterFactory = (filterText) => {
|
|
3038
3074
|
const needle = isString(filterText) ? filterText.trim().toLowerCase() : '';
|
|
3039
3075
|
if (isEmpty(needle)) {
|
|
3040
3076
|
return () => true;
|
|
3041
3077
|
}
|
|
3042
|
-
return (option) =>
|
|
3043
|
-
const label = this.optionLabelFormat(option);
|
|
3044
|
-
return !isNil(label) && String(label).toLowerCase().includes(needle);
|
|
3045
|
-
};
|
|
3078
|
+
return (option) => this.searchRows(option).some(row => row.includes(needle));
|
|
3046
3079
|
};
|
|
3080
|
+
/** Escape hatch for matching that is genuinely different; the default consults {@link optionSearchText}. */
|
|
3081
|
+
filterFactory = this.defaultFilterFactory;
|
|
3047
3082
|
isNil$;
|
|
3048
3083
|
id$ = new MutableValueModel();
|
|
3049
3084
|
cookedOptions$;
|
|
@@ -3092,6 +3127,27 @@ class SelectInputComponent extends AbstractValueInputComponent {
|
|
|
3092
3127
|
select(item) {
|
|
3093
3128
|
this.id$.value = this.delegatedIdentityOf(item);
|
|
3094
3129
|
}
|
|
3130
|
+
/** Lower-cased, nil-free rows for one option. Matched row by row so a term cannot straddle two. */
|
|
3131
|
+
searchRows(option) {
|
|
3132
|
+
const rows = (this.optionSearchText ?? this.defaultOptionSearchText)(option);
|
|
3133
|
+
const list = Array.isArray(rows) ? rows : [rows];
|
|
3134
|
+
return list
|
|
3135
|
+
.filter(row => !isNil(row))
|
|
3136
|
+
.map(row => String(row).toLowerCase());
|
|
3137
|
+
}
|
|
3138
|
+
/**
|
|
3139
|
+
* The trap this guards is silent in production: the option renders text the search box cannot
|
|
3140
|
+
* reach, and the user's search for what they can plainly see finds nothing.
|
|
3141
|
+
*/
|
|
3142
|
+
ngAfterContentInit() {
|
|
3143
|
+
const usesDefaultMatching = this.optionSearchText === this.defaultOptionSearchText
|
|
3144
|
+
&& this.filterFactory === this.defaultFilterFactory;
|
|
3145
|
+
if (isDevMode() && this.searchable && this.optionTemplateRef && usesDefaultMatching) {
|
|
3146
|
+
console.warn('aup-select-input: searchable with an #optionTemplate but neither optionSearchText nor '
|
|
3147
|
+
+ 'filterFactory is set, so the search only sees optionLabelFormat and text the template renders '
|
|
3148
|
+
+ 'may be unsearchable. Bind optionSearchText to return every row the template shows.');
|
|
3149
|
+
}
|
|
3150
|
+
}
|
|
3095
3151
|
/**
|
|
3096
3152
|
* True when the option is only in {@link panelOptions$} to keep MatSelect's selection model
|
|
3097
3153
|
* populated. The template renders it disabled and display:none.
|
|
@@ -3235,7 +3291,7 @@ class SelectInputComponent extends AbstractValueInputComponent {
|
|
|
3235
3291
|
});
|
|
3236
3292
|
}
|
|
3237
3293
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: SelectInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3238
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: SelectInputComponent, selector: "aup-select-input", inputs: { options$: "options$", options: "options", optionLabel: "optionLabel", allowNil: "allowNil", optionLabelFormat: "optionLabelFormat", searchable: "searchable", searchPlaceholder: "searchPlaceholder", noResultsText: "noResultsText", searchText$: "searchText$", filterFactory: "filterFactory" }, queries: [{ propertyName: "selectedOptionTemplateRef", first: true, predicate: ["selectedOptionTemplate"], descendants: true }, { propertyName: "optionTemplateRef", first: true, predicate: ["optionTemplate"], descendants: true }, { propertyName: "nilOptionTemplateRef", first: true, predicate: ["nilOptionTemplate"], descendants: true }], viewQueries: [{ propertyName: "searchInputRef", first: true, predicate: ["searchInput"], descendants: true }, { propertyName: "matSelect", first: true, predicate: MatSelect, descendants: true }], usesInheritance: true, ngImport: i0, template: "<mat-form-field [floatLabel]=\"floatLabel\" subscriptSizing=\"dynamic\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [ngModel]=\"componentValue$.value\"\n (ngModelChange)=\"select($event)\"\n [disabled]=\"!enabled$.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n\n <!--\n TODO: dave has a scenario where the selected item isn't rendering that I can't reproduce so we explicity render it..\n It typically happens because the ngModel value isn't the one contained in the list - this means our source model\n identifyOf function has changed and our id$/lookup$/componentValue$ are out of sync.\n We get around this for now by explicity rendering the component value.\n Please Note: I haven't been able to reproduce this\n -->\n <mat-select-trigger *ngIf=\"!selectedOptionTemplateRef\">\n {{optionLabelFormat(componentValue$.value)}}\n </mat-select-trigger>\n\n <mat-select-trigger *ngIf=\"selectedOptionTemplateRef\">\n <ng-container [ngTemplateOutlet]=\"selectedOptionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: componentValue$.value}\"></ng-container>\n </mat-select-trigger>\n\n <div class=\"aup-select-search\" *ngIf=\"searchable\"\n (keydown)=\"onSearchKeydown($event)\"\n (click)=\"$event.stopPropagation()\">\n <aup-icon class=\"aup-select-search__icon\" icon=\"mat:search\"></aup-icon>\n <!--\n Deliberately a bare input: matInput outside a mat-form-field is a MatFormFieldControl with no\n host, and aup-search-input drags in a whole form field (label slot, subscript row,\n .aup-input-component density) that has no business inside a dropdown panel.\n [value]/(input) rather than ngModel avoids a missing-name error inside a host <form>.\n -->\n <input #searchInput type=\"text\" class=\"aup-select-search__input\"\n data-cy=\"select-search\"\n autocomplete=\"off\"\n [placeholder]=\"searchPlaceholder\"\n [attr.aria-label]=\"searchPlaceholder\"\n [value]=\"searchText$.value || ''\"\n (input)=\"onSearchInput($event)\">\n <button type=\"button\" class=\"aup-select-search__clear\" tabindex=\"-1\"\n *ngIf=\"searchText$.value\" data-cy=\"select-search-clear\"\n (click)=\"clearSearch()\">\n <aup-icon icon=\"mat:close\"></aup-icon>\n </button>\n </div>\n\n <!--\n Deliberately outside the filter: the nil option is a clear-the-selection affordance, not one of\n the data options, so it stays available while searching (and keeps MatSelect._canOpen() happy).\n -->\n <mat-option *ngIf=\"allowNil\">\n <ng-container *ngIf=\"!nilOptionTemplateRef\">{{placeholder}}</ng-container>\n <ng-container *ngIf=\"nilOptionTemplateRef\" [ngTemplateOutlet]=\"nilOptionTemplateRef\"></ng-container>\n </mat-option>\n <mat-option *ngFor=\"let option of panelOptions$.value; trackBy: trackByIdentity;let i = index\"\n [value]=\"option\"\n [disabled]=\"isHiddenOption(option)\"\n [class.aup-select-option--filtered]=\"isHiddenOption(option)\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(option)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: option, index: i }\"\n >\n </ng-container>\n </mat-option>\n <!--\n A plain div, NOT a mat-option: a mat-option here would be selectable, and would keep\n MatSelect._canOpen() satisfied with a row that means \"nothing\".\n -->\n <div class=\"aup-select-search__no-results\" data-cy=\"select-no-results\"\n *ngIf=\"searchable && noMatches$.value\">{{noResultsText}}</div>\n <ng-content select=\"[select-option-footer]\"></ng-content>\n </mat-select>\n <mat-hint *ngIf=\"inlineHintText\" [ngClass]=\"inlineHintClass\">{{inlineHintText}}</mat-hint>\n <mat-error *ngIf=\"inlineError\">{{inlineError}}</mat-error>\n <span matSuffix class=\"aup-validation-icon\" *ngIf=\"popupMessage\">\n <aup-icon data-cy=\"validation-icon\"\n [icon]=\"popupIcon\" [ngClass]=\"popupSeverityClass\"\n [aupTooltip]=\"popupMessage\" aupTooltipPosition=\"above\"></aup-icon>\n </span>\n</mat-form-field>\n<div class=\"width-strut\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <div class=\"item\" *ngFor=\"let item of cookedOptions$.value\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(item)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: 0 }\"\n >\n </ng-container>\n </div>\n</div>\n", styles: [":host{display:inline-block}mat-form-field{width:100%}.width-strut{display:block;height:0;max-height:0;width:auto;visibility:hidden;overflow:hidden;padding-right:35px}.width-strut mat-label{font-size:75%}.width-strut>.item{font-size:16px;padding-left:0}.aup-select-search{position:sticky;top:-8px;z-index:1;display:flex;align-items:center;gap:4px;margin:-8px 0 4px;padding:8px 12px;background:var(--mat-select-panel-background-color, #fff);border-bottom:1px solid rgba(0,0,0,.12)}.aup-select-search .aup-select-search__input{flex:1 1 auto;min-width:0;border:none;outline:none;background:transparent;font:inherit;color:inherit}.aup-select-search .aup-select-search__clear{flex:0 0 auto;display:inline-flex;padding:0;border:none;background:transparent;cursor:pointer;color:inherit}.aup-select-search__no-results{padding:8px 16px;opacity:.6;font-style:italic}mat-option.aup-select-option--filtered{display:none}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i4$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "panelWidth", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "directive", type: i4$1.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: AupTooltipDirective, selector: "[aupTooltip]", inputs: ["aupTooltip", "aupTooltipPosition", "aupTooltipPositionAtOrigin", "aupTooltipDisabled", "aupTooltipShowDelay", "aupTooltipHideDelay", "aupTooltipTouchGestures", "aupTooltipClass"], exportAs: ["aupTooltip"] }, { kind: "directive", type: FocusBindingDirective, selector: "[pectinFocusBinding]", inputs: ["pectinFocusBinding", "focusBindingTarget"] }, { kind: "component", type: IconComponent, selector: "aup-icon", inputs: ["icon"] }] });
|
|
3294
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: SelectInputComponent, selector: "aup-select-input", inputs: { options$: "options$", options: "options", optionLabel: "optionLabel", allowNil$: "allowNil$", allowNil: "allowNil", optionLabelFormat: "optionLabelFormat", searchable: "searchable", searchPlaceholder: "searchPlaceholder", noResultsText: "noResultsText", searchText$: "searchText$", optionSearchText: "optionSearchText", filterFactory: "filterFactory" }, queries: [{ propertyName: "selectedOptionTemplateRef", first: true, predicate: ["selectedOptionTemplate"], descendants: true }, { propertyName: "optionTemplateRef", first: true, predicate: ["optionTemplate"], descendants: true }, { propertyName: "nilOptionTemplateRef", first: true, predicate: ["nilOptionTemplate"], descendants: true }], viewQueries: [{ propertyName: "searchInputRef", first: true, predicate: ["searchInput"], descendants: true }, { propertyName: "matSelect", first: true, predicate: MatSelect, descendants: true }], usesInheritance: true, ngImport: i0, template: "<mat-form-field [floatLabel]=\"floatLabel\" subscriptSizing=\"dynamic\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [ngModel]=\"componentValue$.value\"\n (ngModelChange)=\"select($event)\"\n [disabled]=\"!enabled$.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n\n <!--\n TODO: dave has a scenario where the selected item isn't rendering that I can't reproduce so we explicity render it..\n It typically happens because the ngModel value isn't the one contained in the list - this means our source model\n identifyOf function has changed and our id$/lookup$/componentValue$ are out of sync.\n We get around this for now by explicity rendering the component value.\n Please Note: I haven't been able to reproduce this\n -->\n <mat-select-trigger *ngIf=\"!selectedOptionTemplateRef\">\n {{optionLabelFormat(componentValue$.value)}}\n </mat-select-trigger>\n\n <mat-select-trigger *ngIf=\"selectedOptionTemplateRef\">\n <ng-container [ngTemplateOutlet]=\"selectedOptionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: componentValue$.value}\"></ng-container>\n </mat-select-trigger>\n\n <div class=\"aup-select-search\" *ngIf=\"searchable\"\n (keydown)=\"onSearchKeydown($event)\"\n (click)=\"$event.stopPropagation()\">\n <aup-icon class=\"aup-select-search__icon\" icon=\"mat:search\"></aup-icon>\n <!--\n Deliberately a bare input: matInput outside a mat-form-field is a MatFormFieldControl with no\n host, and aup-search-input drags in a whole form field (label slot, subscript row,\n .aup-input-component density) that has no business inside a dropdown panel.\n [value]/(input) rather than ngModel avoids a missing-name error inside a host <form>.\n -->\n <input #searchInput type=\"text\" class=\"aup-select-search__input\"\n data-cy=\"select-search\"\n autocomplete=\"off\"\n [placeholder]=\"searchPlaceholder\"\n [attr.aria-label]=\"searchPlaceholder\"\n [value]=\"searchText$.value || ''\"\n (input)=\"onSearchInput($event)\">\n <button type=\"button\" class=\"aup-select-search__clear\" tabindex=\"-1\"\n *ngIf=\"searchText$.value\" data-cy=\"select-search-clear\"\n (click)=\"clearSearch()\">\n <aup-icon icon=\"mat:close\"></aup-icon>\n </button>\n </div>\n\n <!--\n Deliberately outside the filter: the nil option is a clear-the-selection affordance, not one of\n the data options, so it stays available while searching (and keeps MatSelect._canOpen() happy).\n -->\n <mat-option *ngIf=\"allowNil$.value\">\n <ng-container *ngIf=\"!nilOptionTemplateRef\">{{placeholder}}</ng-container>\n <ng-container *ngIf=\"nilOptionTemplateRef\" [ngTemplateOutlet]=\"nilOptionTemplateRef\"></ng-container>\n </mat-option>\n <mat-option *ngFor=\"let option of panelOptions$.value; trackBy: trackByIdentity;let i = index\"\n [value]=\"option\"\n [disabled]=\"isHiddenOption(option)\"\n [class.aup-select-option--filtered]=\"isHiddenOption(option)\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(option)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: option, index: i }\"\n >\n </ng-container>\n </mat-option>\n <!--\n A plain div, NOT a mat-option: a mat-option here would be selectable, and would keep\n MatSelect._canOpen() satisfied with a row that means \"nothing\".\n -->\n <div class=\"aup-select-search__no-results\" data-cy=\"select-no-results\"\n *ngIf=\"searchable && noMatches$.value\">{{noResultsText}}</div>\n <ng-content select=\"[select-option-footer]\"></ng-content>\n </mat-select>\n <mat-hint *ngIf=\"inlineHintText\" [ngClass]=\"inlineHintClass\">{{inlineHintText}}</mat-hint>\n <mat-error *ngIf=\"inlineError\">{{inlineError}}</mat-error>\n <span matSuffix class=\"aup-validation-icon\" *ngIf=\"popupMessage\">\n <aup-icon data-cy=\"validation-icon\"\n [icon]=\"popupIcon\" [ngClass]=\"popupSeverityClass\"\n [aupTooltip]=\"popupMessage\" aupTooltipPosition=\"above\"></aup-icon>\n </span>\n</mat-form-field>\n<div class=\"width-strut\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <div class=\"item\" *ngFor=\"let item of cookedOptions$.value\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(item)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: 0 }\"\n >\n </ng-container>\n </div>\n</div>\n", styles: [":host{display:inline-block}mat-form-field{width:100%}.width-strut{display:block;height:0;max-height:0;width:auto;visibility:hidden;overflow:hidden;padding-right:35px}.width-strut mat-label{font-size:75%}.width-strut>.item{font-size:16px;padding-left:0}.aup-select-search{position:sticky;top:-8px;z-index:1;display:flex;align-items:center;gap:4px;margin:-8px 0 4px;padding:8px 12px;background:var(--mat-select-panel-background-color, #fff);border-bottom:1px solid rgba(0,0,0,.12)}.aup-select-search .aup-select-search__input{flex:1 1 auto;min-width:0;border:none;outline:none;background:transparent;font:inherit;color:inherit}.aup-select-search .aup-select-search__clear{flex:0 0 auto;display:inline-flex;padding:0;border:none;background:transparent;cursor:pointer;color:inherit}.aup-select-search__no-results{padding:8px 16px;opacity:.6;font-style:italic}mat-option.aup-select-option--filtered{display:none}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i4$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "panelWidth", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "directive", type: i4$1.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: AupTooltipDirective, selector: "[aupTooltip]", inputs: ["aupTooltip", "aupTooltipPosition", "aupTooltipPositionAtOrigin", "aupTooltipDisabled", "aupTooltipShowDelay", "aupTooltipHideDelay", "aupTooltipTouchGestures", "aupTooltipClass"], exportAs: ["aupTooltip"] }, { kind: "directive", type: FocusBindingDirective, selector: "[pectinFocusBinding]", inputs: ["pectinFocusBinding", "focusBindingTarget"] }, { kind: "component", type: IconComponent, selector: "aup-icon", inputs: ["icon"] }] });
|
|
3239
3295
|
}
|
|
3240
3296
|
__decorate([
|
|
3241
3297
|
Proxify(),
|
|
@@ -3245,19 +3301,29 @@ __decorate([
|
|
|
3245
3301
|
StoreInListModel(),
|
|
3246
3302
|
__metadata("design:type", Array)
|
|
3247
3303
|
], SelectInputComponent.prototype, "options", null);
|
|
3304
|
+
__decorate([
|
|
3305
|
+
Proxify(),
|
|
3306
|
+
__metadata("design:type", Object)
|
|
3307
|
+
], SelectInputComponent.prototype, "allowNil$", null);
|
|
3308
|
+
__decorate([
|
|
3309
|
+
StoreInValueModel(),
|
|
3310
|
+
__metadata("design:type", Boolean)
|
|
3311
|
+
], SelectInputComponent.prototype, "allowNil", null);
|
|
3248
3312
|
__decorate([
|
|
3249
3313
|
Proxify(),
|
|
3250
3314
|
__metadata("design:type", Object)
|
|
3251
3315
|
], SelectInputComponent.prototype, "searchText$", null);
|
|
3252
3316
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: SelectInputComponent, decorators: [{
|
|
3253
3317
|
type: Component,
|
|
3254
|
-
args: [{ selector: 'aup-select-input', template: "<mat-form-field [floatLabel]=\"floatLabel\" subscriptSizing=\"dynamic\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [ngModel]=\"componentValue$.value\"\n (ngModelChange)=\"select($event)\"\n [disabled]=\"!enabled$.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n\n <!--\n TODO: dave has a scenario where the selected item isn't rendering that I can't reproduce so we explicity render it..\n It typically happens because the ngModel value isn't the one contained in the list - this means our source model\n identifyOf function has changed and our id$/lookup$/componentValue$ are out of sync.\n We get around this for now by explicity rendering the component value.\n Please Note: I haven't been able to reproduce this\n -->\n <mat-select-trigger *ngIf=\"!selectedOptionTemplateRef\">\n {{optionLabelFormat(componentValue$.value)}}\n </mat-select-trigger>\n\n <mat-select-trigger *ngIf=\"selectedOptionTemplateRef\">\n <ng-container [ngTemplateOutlet]=\"selectedOptionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: componentValue$.value}\"></ng-container>\n </mat-select-trigger>\n\n <div class=\"aup-select-search\" *ngIf=\"searchable\"\n (keydown)=\"onSearchKeydown($event)\"\n (click)=\"$event.stopPropagation()\">\n <aup-icon class=\"aup-select-search__icon\" icon=\"mat:search\"></aup-icon>\n <!--\n Deliberately a bare input: matInput outside a mat-form-field is a MatFormFieldControl with no\n host, and aup-search-input drags in a whole form field (label slot, subscript row,\n .aup-input-component density) that has no business inside a dropdown panel.\n [value]/(input) rather than ngModel avoids a missing-name error inside a host <form>.\n -->\n <input #searchInput type=\"text\" class=\"aup-select-search__input\"\n data-cy=\"select-search\"\n autocomplete=\"off\"\n [placeholder]=\"searchPlaceholder\"\n [attr.aria-label]=\"searchPlaceholder\"\n [value]=\"searchText$.value || ''\"\n (input)=\"onSearchInput($event)\">\n <button type=\"button\" class=\"aup-select-search__clear\" tabindex=\"-1\"\n *ngIf=\"searchText$.value\" data-cy=\"select-search-clear\"\n (click)=\"clearSearch()\">\n <aup-icon icon=\"mat:close\"></aup-icon>\n </button>\n </div>\n\n <!--\n Deliberately outside the filter: the nil option is a clear-the-selection affordance, not one of\n the data options, so it stays available while searching (and keeps MatSelect._canOpen() happy).\n -->\n <mat-option *ngIf=\"allowNil\">\n <ng-container *ngIf=\"!nilOptionTemplateRef\">{{placeholder}}</ng-container>\n <ng-container *ngIf=\"nilOptionTemplateRef\" [ngTemplateOutlet]=\"nilOptionTemplateRef\"></ng-container>\n </mat-option>\n <mat-option *ngFor=\"let option of panelOptions$.value; trackBy: trackByIdentity;let i = index\"\n [value]=\"option\"\n [disabled]=\"isHiddenOption(option)\"\n [class.aup-select-option--filtered]=\"isHiddenOption(option)\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(option)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: option, index: i }\"\n >\n </ng-container>\n </mat-option>\n <!--\n A plain div, NOT a mat-option: a mat-option here would be selectable, and would keep\n MatSelect._canOpen() satisfied with a row that means \"nothing\".\n -->\n <div class=\"aup-select-search__no-results\" data-cy=\"select-no-results\"\n *ngIf=\"searchable && noMatches$.value\">{{noResultsText}}</div>\n <ng-content select=\"[select-option-footer]\"></ng-content>\n </mat-select>\n <mat-hint *ngIf=\"inlineHintText\" [ngClass]=\"inlineHintClass\">{{inlineHintText}}</mat-hint>\n <mat-error *ngIf=\"inlineError\">{{inlineError}}</mat-error>\n <span matSuffix class=\"aup-validation-icon\" *ngIf=\"popupMessage\">\n <aup-icon data-cy=\"validation-icon\"\n [icon]=\"popupIcon\" [ngClass]=\"popupSeverityClass\"\n [aupTooltip]=\"popupMessage\" aupTooltipPosition=\"above\"></aup-icon>\n </span>\n</mat-form-field>\n<div class=\"width-strut\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <div class=\"item\" *ngFor=\"let item of cookedOptions$.value\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(item)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: 0 }\"\n >\n </ng-container>\n </div>\n</div>\n", styles: [":host{display:inline-block}mat-form-field{width:100%}.width-strut{display:block;height:0;max-height:0;width:auto;visibility:hidden;overflow:hidden;padding-right:35px}.width-strut mat-label{font-size:75%}.width-strut>.item{font-size:16px;padding-left:0}.aup-select-search{position:sticky;top:-8px;z-index:1;display:flex;align-items:center;gap:4px;margin:-8px 0 4px;padding:8px 12px;background:var(--mat-select-panel-background-color, #fff);border-bottom:1px solid rgba(0,0,0,.12)}.aup-select-search .aup-select-search__input{flex:1 1 auto;min-width:0;border:none;outline:none;background:transparent;font:inherit;color:inherit}.aup-select-search .aup-select-search__clear{flex:0 0 auto;display:inline-flex;padding:0;border:none;background:transparent;cursor:pointer;color:inherit}.aup-select-search__no-results{padding:8px 16px;opacity:.6;font-style:italic}mat-option.aup-select-option--filtered{display:none}\n"] }]
|
|
3318
|
+
args: [{ selector: 'aup-select-input', template: "<mat-form-field [floatLabel]=\"floatLabel\" subscriptSizing=\"dynamic\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [ngModel]=\"componentValue$.value\"\n (ngModelChange)=\"select($event)\"\n [disabled]=\"!enabled$.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n\n <!--\n TODO: dave has a scenario where the selected item isn't rendering that I can't reproduce so we explicity render it..\n It typically happens because the ngModel value isn't the one contained in the list - this means our source model\n identifyOf function has changed and our id$/lookup$/componentValue$ are out of sync.\n We get around this for now by explicity rendering the component value.\n Please Note: I haven't been able to reproduce this\n -->\n <mat-select-trigger *ngIf=\"!selectedOptionTemplateRef\">\n {{optionLabelFormat(componentValue$.value)}}\n </mat-select-trigger>\n\n <mat-select-trigger *ngIf=\"selectedOptionTemplateRef\">\n <ng-container [ngTemplateOutlet]=\"selectedOptionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: componentValue$.value}\"></ng-container>\n </mat-select-trigger>\n\n <div class=\"aup-select-search\" *ngIf=\"searchable\"\n (keydown)=\"onSearchKeydown($event)\"\n (click)=\"$event.stopPropagation()\">\n <aup-icon class=\"aup-select-search__icon\" icon=\"mat:search\"></aup-icon>\n <!--\n Deliberately a bare input: matInput outside a mat-form-field is a MatFormFieldControl with no\n host, and aup-search-input drags in a whole form field (label slot, subscript row,\n .aup-input-component density) that has no business inside a dropdown panel.\n [value]/(input) rather than ngModel avoids a missing-name error inside a host <form>.\n -->\n <input #searchInput type=\"text\" class=\"aup-select-search__input\"\n data-cy=\"select-search\"\n autocomplete=\"off\"\n [placeholder]=\"searchPlaceholder\"\n [attr.aria-label]=\"searchPlaceholder\"\n [value]=\"searchText$.value || ''\"\n (input)=\"onSearchInput($event)\">\n <button type=\"button\" class=\"aup-select-search__clear\" tabindex=\"-1\"\n *ngIf=\"searchText$.value\" data-cy=\"select-search-clear\"\n (click)=\"clearSearch()\">\n <aup-icon icon=\"mat:close\"></aup-icon>\n </button>\n </div>\n\n <!--\n Deliberately outside the filter: the nil option is a clear-the-selection affordance, not one of\n the data options, so it stays available while searching (and keeps MatSelect._canOpen() happy).\n -->\n <mat-option *ngIf=\"allowNil$.value\">\n <ng-container *ngIf=\"!nilOptionTemplateRef\">{{placeholder}}</ng-container>\n <ng-container *ngIf=\"nilOptionTemplateRef\" [ngTemplateOutlet]=\"nilOptionTemplateRef\"></ng-container>\n </mat-option>\n <mat-option *ngFor=\"let option of panelOptions$.value; trackBy: trackByIdentity;let i = index\"\n [value]=\"option\"\n [disabled]=\"isHiddenOption(option)\"\n [class.aup-select-option--filtered]=\"isHiddenOption(option)\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(option)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: option, index: i }\"\n >\n </ng-container>\n </mat-option>\n <!--\n A plain div, NOT a mat-option: a mat-option here would be selectable, and would keep\n MatSelect._canOpen() satisfied with a row that means \"nothing\".\n -->\n <div class=\"aup-select-search__no-results\" data-cy=\"select-no-results\"\n *ngIf=\"searchable && noMatches$.value\">{{noResultsText}}</div>\n <ng-content select=\"[select-option-footer]\"></ng-content>\n </mat-select>\n <mat-hint *ngIf=\"inlineHintText\" [ngClass]=\"inlineHintClass\">{{inlineHintText}}</mat-hint>\n <mat-error *ngIf=\"inlineError\">{{inlineError}}</mat-error>\n <span matSuffix class=\"aup-validation-icon\" *ngIf=\"popupMessage\">\n <aup-icon data-cy=\"validation-icon\"\n [icon]=\"popupIcon\" [ngClass]=\"popupSeverityClass\"\n [aupTooltip]=\"popupMessage\" aupTooltipPosition=\"above\"></aup-icon>\n </span>\n</mat-form-field>\n<div class=\"width-strut\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <div class=\"item\" *ngFor=\"let item of cookedOptions$.value\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(item)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: 0 }\"\n >\n </ng-container>\n </div>\n</div>\n", styles: [":host{display:inline-block}mat-form-field{width:100%}.width-strut{display:block;height:0;max-height:0;width:auto;visibility:hidden;overflow:hidden;padding-right:35px}.width-strut mat-label{font-size:75%}.width-strut>.item{font-size:16px;padding-left:0}.aup-select-search{position:sticky;top:-8px;z-index:1;display:flex;align-items:center;gap:4px;margin:-8px 0 4px;padding:8px 12px;background:var(--mat-select-panel-background-color, #fff);border-bottom:1px solid rgba(0,0,0,.12)}.aup-select-search .aup-select-search__input{flex:1 1 auto;min-width:0;border:none;outline:none;background:transparent;font:inherit;color:inherit}.aup-select-search .aup-select-search__clear{flex:0 0 auto;display:inline-flex;padding:0;border:none;background:transparent;cursor:pointer;color:inherit}.aup-select-search__no-results{padding:8px 16px;opacity:.6;font-style:italic}mat-option.aup-select-option--filtered{display:none}\n"] }]
|
|
3255
3319
|
}], ctorParameters: function () { return []; }, propDecorators: { options$: [{
|
|
3256
3320
|
type: Input
|
|
3257
3321
|
}], options: [{
|
|
3258
3322
|
type: Input
|
|
3259
3323
|
}], optionLabel: [{
|
|
3260
3324
|
type: Input
|
|
3325
|
+
}], allowNil$: [{
|
|
3326
|
+
type: Input
|
|
3261
3327
|
}], allowNil: [{
|
|
3262
3328
|
type: Input
|
|
3263
3329
|
}], selectedOptionTemplateRef: [{
|
|
@@ -3279,6 +3345,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImpor
|
|
|
3279
3345
|
type: Input
|
|
3280
3346
|
}], searchText$: [{
|
|
3281
3347
|
type: Input
|
|
3348
|
+
}], optionSearchText: [{
|
|
3349
|
+
type: Input
|
|
3282
3350
|
}], filterFactory: [{
|
|
3283
3351
|
type: Input
|
|
3284
3352
|
}], searchInputRef: [{
|
|
@@ -13136,7 +13204,7 @@ class SelectInputActivity extends InputActivity {
|
|
|
13136
13204
|
[confirmFace]="confirmFace"
|
|
13137
13205
|
[cancelFace]="cancelFace"
|
|
13138
13206
|
></aup-activity-actions>
|
|
13139
|
-
`, isInline: true, styles: [":host{--activity-actions-gap: 0}:host .aup-input-component{flex:1}:host[layout=inline]{padding-right:0}:host[layout=block]{padding-bottom:0}\n"], dependencies: [{ kind: "component", type: SelectInputComponent, selector: "aup-select-input", inputs: ["options$", "options", "optionLabel", "allowNil", "optionLabelFormat", "searchable", "searchPlaceholder", "noResultsText", "searchText$", "filterFactory"] }, { kind: "component", type: ActivityActionsComponent, selector: "aup-activity-actions", inputs: ["confirmCommand", "cancelCommand", "faces", "confirmFace", "cancelFace", "style", "layout", "align", "alignContent"] }] });
|
|
13207
|
+
`, isInline: true, styles: [":host{--activity-actions-gap: 0}:host .aup-input-component{flex:1}:host[layout=inline]{padding-right:0}:host[layout=block]{padding-bottom:0}\n"], dependencies: [{ kind: "component", type: SelectInputComponent, selector: "aup-select-input", inputs: ["options$", "options", "optionLabel", "allowNil$", "allowNil", "optionLabelFormat", "searchable", "searchPlaceholder", "noResultsText", "searchText$", "optionSearchText", "filterFactory"] }, { kind: "component", type: ActivityActionsComponent, selector: "aup-activity-actions", inputs: ["confirmCommand", "cancelCommand", "faces", "confirmFace", "cancelFace", "style", "layout", "align", "alignContent"] }] });
|
|
13140
13208
|
}
|
|
13141
13209
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: SelectInputActivity, decorators: [{
|
|
13142
13210
|
type: Component,
|