@siemens/element-ng 49.4.0 → 49.5.0
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/siemens-element-ng-chat-messages.mjs +4 -4
- package/fesm2022/siemens-element-ng-chat-messages.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-datatable.mjs +1 -1
- package/fesm2022/siemens-element-ng-datatable.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-date-range-filter.mjs +13 -18
- package/fesm2022/siemens-element-ng-date-range-filter.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-datepicker.mjs +35 -5
- package/fesm2022/siemens-element-ng-datepicker.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-file-uploader.mjs +2 -2
- package/fesm2022/siemens-element-ng-file-uploader.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-filtered-search.mjs +123 -91
- package/fesm2022/siemens-element-ng-filtered-search.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-formly.mjs +1 -1
- package/fesm2022/siemens-element-ng-formly.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-list-details.mjs +1 -1
- package/fesm2022/siemens-element-ng-list-details.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-loading-spinner.mjs +2 -2
- package/fesm2022/siemens-element-ng-loading-spinner.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-markdown-renderer.mjs +2 -2
- package/fesm2022/siemens-element-ng-markdown-renderer.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-modal.mjs +6 -17
- package/fesm2022/siemens-element-ng-modal.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-navbar-vertical-next.mjs +702 -0
- package/fesm2022/siemens-element-ng-navbar-vertical-next.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-number-input.mjs +2 -2
- package/fesm2022/siemens-element-ng-number-input.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-side-panel.mjs +2 -2
- package/fesm2022/siemens-element-ng-side-panel.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tooltip.mjs +2 -2
- package/fesm2022/siemens-element-ng-tooltip.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tree-view.mjs +11 -8
- package/fesm2022/siemens-element-ng-tree-view.mjs.map +1 -1
- package/navbar-vertical-next/package.json +4 -0
- package/package.json +7 -3
- package/types/siemens-element-ng-filtered-search.d.ts +12 -10
- package/types/siemens-element-ng-markdown-renderer.d.ts +1 -1
- package/types/siemens-element-ng-navbar-vertical-next.d.ts +264 -0
- package/types/siemens-element-ng-tree-view.d.ts +1 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, model, output, viewChild, computed, ChangeDetectionStrategy, Component, signal, Directive, inject, LOCALE_ID, DestroyRef, untracked, booleanAttribute, ElementRef, viewChildren, NgModule } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
|
|
4
|
-
import * as i1 from '@angular/forms';
|
|
5
|
-
import { FormsModule } from '@angular/forms';
|
|
6
4
|
import { elementCancel, elementSearch } from '@siemens/element-icons';
|
|
7
5
|
import { isRTL } from '@siemens/element-ng/common';
|
|
8
6
|
import { addIcons, SiIconComponent } from '@siemens/element-ng/icon';
|
|
9
|
-
import { SiTypeaheadDirective } from '@siemens/element-ng/typeahead';
|
|
10
7
|
import { SiTranslatePipe, injectSiTranslateService, t } from '@siemens/element-translate-ng/translate';
|
|
11
|
-
import { BehaviorSubject, switchMap, of, Subject } from 'rxjs';
|
|
8
|
+
import { BehaviorSubject, switchMap, of, Subject, merge } from 'rxjs';
|
|
12
9
|
import { debounceTime, map, tap, first } from 'rxjs/operators';
|
|
13
10
|
import { formatDate, DatePipe } from '@angular/common';
|
|
14
11
|
import { isValid, SiDatepickerOverlayDirective, getDatepickerFormat, getNamedFormat, SiDatepickerDirective } from '@siemens/element-ng/datepicker';
|
|
12
|
+
import * as i1 from '@angular/forms';
|
|
13
|
+
import { FormsModule } from '@angular/forms';
|
|
14
|
+
import { SiTypeaheadDirective } from '@siemens/element-ng/typeahead';
|
|
15
15
|
import { CdkMonitorFocus } from '@angular/cdk/a11y';
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -53,6 +53,85 @@ const getISODateString = (date, format, locale) => {
|
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
58
|
+
* SPDX-License-Identifier: MIT
|
|
59
|
+
*/
|
|
60
|
+
class SiFilteredSearchInputComponent {
|
|
61
|
+
static criterionRegex = /(.+?):(.*)$/;
|
|
62
|
+
dataSource = input.required(...(ngDevMode ? [{ debugName: "dataSource" }] : []));
|
|
63
|
+
typeaheadOptionsLimit = input.required(...(ngDevMode ? [{ debugName: "typeaheadOptionsLimit" }] : []));
|
|
64
|
+
optionsInScrollableView = input.required(...(ngDevMode ? [{ debugName: "optionsInScrollableView" }] : []));
|
|
65
|
+
disabled = input.required(...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
66
|
+
placeholder = input.required(...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
67
|
+
searchLabel = input.required(...(ngDevMode ? [{ debugName: "searchLabel" }] : []));
|
|
68
|
+
searchValue = model.required(...(ngDevMode ? [{ debugName: "searchValue" }] : []));
|
|
69
|
+
freeTextCriterion = input.required(...(ngDevMode ? [{ debugName: "freeTextCriterion" }] : []));
|
|
70
|
+
maxCriteriaReached = input.required(...(ngDevMode ? [{ debugName: "maxCriteriaReached" }] : []));
|
|
71
|
+
allowFreeText = input.required(...(ngDevMode ? [{ debugName: "allowFreeText" }] : []));
|
|
72
|
+
searchForFreeTextLabel = input.required(...(ngDevMode ? [{ debugName: "searchForFreeTextLabel" }] : []));
|
|
73
|
+
disableSelectionByColonAndSemicolon = input.required(...(ngDevMode ? [{ debugName: "disableSelectionByColonAndSemicolon" }] : []));
|
|
74
|
+
onlySelectValue = input.required(...(ngDevMode ? [{ debugName: "onlySelectValue" }] : []));
|
|
75
|
+
createCriterion = output();
|
|
76
|
+
createCriterionByName = output();
|
|
77
|
+
backspaceOverflow = output();
|
|
78
|
+
createFreeTextPill = output();
|
|
79
|
+
inputFocus = output();
|
|
80
|
+
enterSubmit = output();
|
|
81
|
+
inputElement = viewChild.required('freeTextInputElement');
|
|
82
|
+
/** Public method to focus the input element */
|
|
83
|
+
focus() {
|
|
84
|
+
this.inputElement().nativeElement.focus();
|
|
85
|
+
}
|
|
86
|
+
typeaheadCreateOption = computed(() => this.freeTextCriterion() && !this.maxCriteriaReached() && this.allowFreeText()
|
|
87
|
+
? this.searchForFreeTextLabel()
|
|
88
|
+
: undefined, ...(ngDevMode ? [{ debugName: "typeaheadCreateOption" }] : []));
|
|
89
|
+
freeTextBackspaceHandler(event) {
|
|
90
|
+
if (!event.target.value) {
|
|
91
|
+
this.backspaceOverflow.emit();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
freeTextInputHandler(event) {
|
|
95
|
+
const value = event.target.value;
|
|
96
|
+
const match = value.match(SiFilteredSearchInputComponent.criterionRegex);
|
|
97
|
+
if (!this.disableSelectionByColonAndSemicolon() && !this.onlySelectValue() && match) {
|
|
98
|
+
const criterionName = match[1];
|
|
99
|
+
this.inputElement().nativeElement.value = '';
|
|
100
|
+
this.searchValue.set('');
|
|
101
|
+
this.createCriterionByName.emit({ criterionName: criterionName, value: match[2] });
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
this.searchValue.set(value);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
freeTextBlurHandler() {
|
|
108
|
+
queueMicrotask(() => {
|
|
109
|
+
if (this.freeTextCriterion() && this.searchValue().length > 0) {
|
|
110
|
+
this.createFreeTextPill.emit(this.searchValue());
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
typeaheadOnSelectCriterionHandler(event) {
|
|
115
|
+
const criterion = event;
|
|
116
|
+
// Removes the focus border before creating a new criterion to prevent the impression of jumping content.
|
|
117
|
+
this.inputElement().nativeElement.blur();
|
|
118
|
+
this.createCriterion.emit({ criterion });
|
|
119
|
+
this.searchValue.set('');
|
|
120
|
+
}
|
|
121
|
+
createFreeTextPillHandler(query) {
|
|
122
|
+
this.createFreeTextPill.emit(query);
|
|
123
|
+
this.searchValue.set('');
|
|
124
|
+
}
|
|
125
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiFilteredSearchInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
126
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.8", type: SiFilteredSearchInputComponent, isStandalone: true, selector: "si-filtered-search-input", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, typeaheadOptionsLimit: { classPropertyName: "typeaheadOptionsLimit", publicName: "typeaheadOptionsLimit", isSignal: true, isRequired: true, transformFunction: null }, optionsInScrollableView: { classPropertyName: "optionsInScrollableView", publicName: "optionsInScrollableView", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: true, transformFunction: null }, searchLabel: { classPropertyName: "searchLabel", publicName: "searchLabel", isSignal: true, isRequired: true, transformFunction: null }, searchValue: { classPropertyName: "searchValue", publicName: "searchValue", isSignal: true, isRequired: true, transformFunction: null }, freeTextCriterion: { classPropertyName: "freeTextCriterion", publicName: "freeTextCriterion", isSignal: true, isRequired: true, transformFunction: null }, maxCriteriaReached: { classPropertyName: "maxCriteriaReached", publicName: "maxCriteriaReached", isSignal: true, isRequired: true, transformFunction: null }, allowFreeText: { classPropertyName: "allowFreeText", publicName: "allowFreeText", isSignal: true, isRequired: true, transformFunction: null }, searchForFreeTextLabel: { classPropertyName: "searchForFreeTextLabel", publicName: "searchForFreeTextLabel", isSignal: true, isRequired: true, transformFunction: null }, disableSelectionByColonAndSemicolon: { classPropertyName: "disableSelectionByColonAndSemicolon", publicName: "disableSelectionByColonAndSemicolon", isSignal: true, isRequired: true, transformFunction: null }, onlySelectValue: { classPropertyName: "onlySelectValue", publicName: "onlySelectValue", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { searchValue: "searchValueChange", createCriterion: "createCriterion", createCriterionByName: "createCriterionByName", backspaceOverflow: "backspaceOverflow", createFreeTextPill: "createFreeTextPill", inputFocus: "inputFocus", enterSubmit: "enterSubmit" }, host: { classAttribute: "w-100" }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["freeTextInputElement"], descendants: true, isSignal: true }], ngImport: i0, template: "<input\n #freeTextInputElement\n type=\"text\"\n class=\"value-input ps-2 me-2 w-100\"\n typeaheadOptionField=\"translatedLabel\"\n typeaheadClearValueOnSelect\n [siTypeahead]=\"dataSource()\"\n [typeaheadMinLength]=\"0\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit()\"\n [typeaheadScrollable]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionsInScrollableView()\"\n [typeaheadAutoSelectIndex]=\"searchValue() ? 0 : -1\"\n [typeaheadCreateOption]=\"typeaheadCreateOption()\"\n [disabled]=\"disabled()\"\n [placeholder]=\"placeholder()\"\n [attr.aria-label]=\"searchLabel() | translate\"\n [value]=\"searchValue()\"\n (focus)=\"inputFocus.emit()\"\n (input)=\"freeTextInputHandler($event)\"\n (blur)=\"freeTextBlurHandler()\"\n (keydown.backspace)=\"freeTextBackspaceHandler($event)\"\n (keydown.enter)=\"enterSubmit.emit()\"\n (typeaheadOnSelect)=\"typeaheadOnSelectCriterionHandler($event.option)\"\n (typeaheadOnCreateOption)=\"createFreeTextPillHandler($event)\"\n/>\n", styles: ["input{background:transparent;border:0;padding-block:0}input:hover::placeholder{opacity:1}:host-context(si-filtered-search-value + :host) input::placeholder{color:transparent}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: SiTypeaheadDirective, selector: "[siTypeahead]", inputs: ["siTypeahead", "typeaheadProcess", "typeaheadScrollable", "typeaheadOptionsInScrollableView", "typeaheadOptionsLimit", "typeaheadScrollableAdditionalHeight", "typeaheadAutoSelectIndex", "typeaheadCloseOnEsc", "typeaheadClearValueOnSelect", "typeaheadWaitMs", "typeaheadMinLength", "typeaheadOptionField", "typeaheadMultiSelect", "typeaheadTokenize", "typeaheadMatchAllTokens", "typeaheadItemTemplate", "typeaheadSkipSortingMatches", "typeaheadAutocompleteListLabel", "typeaheadFullWidth", "typeaheadScrollStrategy", "typeaheadCreateOption"], outputs: ["typeaheadOnInput", "typeaheadOnSelect", "typeaheadOnFullMatch", "typeaheadOpenChange", "typeaheadOnCreateOption"], exportAs: ["si-typeahead"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
127
|
+
}
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiFilteredSearchInputComponent, decorators: [{
|
|
129
|
+
type: Component,
|
|
130
|
+
args: [{ selector: 'si-filtered-search-input', imports: [FormsModule, SiTypeaheadDirective, SiTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
131
|
+
class: 'w-100'
|
|
132
|
+
}, template: "<input\n #freeTextInputElement\n type=\"text\"\n class=\"value-input ps-2 me-2 w-100\"\n typeaheadOptionField=\"translatedLabel\"\n typeaheadClearValueOnSelect\n [siTypeahead]=\"dataSource()\"\n [typeaheadMinLength]=\"0\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit()\"\n [typeaheadScrollable]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionsInScrollableView()\"\n [typeaheadAutoSelectIndex]=\"searchValue() ? 0 : -1\"\n [typeaheadCreateOption]=\"typeaheadCreateOption()\"\n [disabled]=\"disabled()\"\n [placeholder]=\"placeholder()\"\n [attr.aria-label]=\"searchLabel() | translate\"\n [value]=\"searchValue()\"\n (focus)=\"inputFocus.emit()\"\n (input)=\"freeTextInputHandler($event)\"\n (blur)=\"freeTextBlurHandler()\"\n (keydown.backspace)=\"freeTextBackspaceHandler($event)\"\n (keydown.enter)=\"enterSubmit.emit()\"\n (typeaheadOnSelect)=\"typeaheadOnSelectCriterionHandler($event.option)\"\n (typeaheadOnCreateOption)=\"createFreeTextPillHandler($event)\"\n/>\n", styles: ["input{background:transparent;border:0;padding-block:0}input:hover::placeholder{opacity:1}:host-context(si-filtered-search-value + :host) input::placeholder{color:transparent}\n"] }]
|
|
133
|
+
}], propDecorators: { dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: true }] }], typeaheadOptionsLimit: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadOptionsLimit", required: true }] }], optionsInScrollableView: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsInScrollableView", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: true }] }], searchLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchLabel", required: true }] }], searchValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchValue", required: true }] }, { type: i0.Output, args: ["searchValueChange"] }], freeTextCriterion: [{ type: i0.Input, args: [{ isSignal: true, alias: "freeTextCriterion", required: true }] }], maxCriteriaReached: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxCriteriaReached", required: true }] }], allowFreeText: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowFreeText", required: true }] }], searchForFreeTextLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchForFreeTextLabel", required: true }] }], disableSelectionByColonAndSemicolon: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSelectionByColonAndSemicolon", required: true }] }], onlySelectValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "onlySelectValue", required: true }] }], createCriterion: [{ type: i0.Output, args: ["createCriterion"] }], createCriterionByName: [{ type: i0.Output, args: ["createCriterionByName"] }], backspaceOverflow: [{ type: i0.Output, args: ["backspaceOverflow"] }], createFreeTextPill: [{ type: i0.Output, args: ["createFreeTextPill"] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], enterSubmit: [{ type: i0.Output, args: ["enterSubmit"] }], inputElement: [{ type: i0.ViewChild, args: ['freeTextInputElement', { isSignal: true }] }] } });
|
|
134
|
+
|
|
56
135
|
/**
|
|
57
136
|
* Copyright (c) Siemens 2016 - 2026
|
|
58
137
|
* SPDX-License-Identifier: MIT
|
|
@@ -365,7 +444,7 @@ class SiFilteredSearchTypeaheadComponent extends SiFilteredSearchOptionValueBase
|
|
|
365
444
|
this.buildOptionValue();
|
|
366
445
|
}
|
|
367
446
|
valueChange(newValue) {
|
|
368
|
-
if (typeof newValue === 'string') {
|
|
447
|
+
if (typeof newValue === 'string' && this.criterionValue().value !== newValue) {
|
|
369
448
|
const match = newValue.match(/(.+?);(.*)$/);
|
|
370
449
|
let value;
|
|
371
450
|
if (!this.disableSelectionByColonAndSemicolon() && match) {
|
|
@@ -383,13 +462,7 @@ class SiFilteredSearchTypeaheadComponent extends SiFilteredSearchOptionValueBase
|
|
|
383
462
|
valueTypeaheadFullMatch(match) {
|
|
384
463
|
const option = match.option;
|
|
385
464
|
this.optionValue.set(option);
|
|
386
|
-
|
|
387
|
-
// In case of a fullMatch, we should check if the value is different from label.
|
|
388
|
-
// If it is different, we must emit another event using the value instead of the label.
|
|
389
|
-
// TODO: prevent the emit of the label matching the option. This is currently not possible due to the order events.
|
|
390
|
-
if (option.value !== option.translatedLabel) {
|
|
391
|
-
this.criterionValue.update(v => ({ ...v, value: option.value }));
|
|
392
|
-
}
|
|
465
|
+
this.criterionValue.update(v => ({ ...v, value: option.value }));
|
|
393
466
|
}
|
|
394
467
|
valueTypeaheadSelect(match) {
|
|
395
468
|
this.valueTypeaheadFullMatch(match);
|
|
@@ -421,13 +494,13 @@ class SiFilteredSearchTypeaheadComponent extends SiFilteredSearchOptionValueBase
|
|
|
421
494
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiFilteredSearchTypeaheadComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
422
495
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiFilteredSearchTypeaheadComponent, isStandalone: true, selector: "si-filtered-search-typeahead", providers: [
|
|
423
496
|
{ provide: SiFilteredSearchValueBase, useExisting: SiFilteredSearchTypeaheadComponent }
|
|
424
|
-
], viewQueries: [{ propertyName: "valueInput", first: true, predicate: ["valueInput"], descendants: true, isSignal: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "@let value = criterionValue().value;\n@if (!active()) {\n <div\n class=\"criterion-value-text focus-inside px-4\"\n [tabindex]=\"disabled() ? -1 : 0\"\n (keydown.enter)=\"editValue.emit()\"\n (click)=\"editValue.emit()\"\n >\n @let optionValue = this.optionValue();\n @if (optionValue) {\n {{ optionValue.label ?? optionValue.value | translate }}\n } @else {\n {{ value }}\n }\n </div>\n} @else {\n <input\n #valueInput\n typeaheadOptionField=\"translatedLabel\"\n class=\"px-4 py-0 border-0 focus-inside\"\n typeaheadScrollable\n [type]=\"inputType()\"\n [step]=\"step()\"\n [
|
|
497
|
+
], viewQueries: [{ propertyName: "valueInput", first: true, predicate: ["valueInput"], descendants: true, isSignal: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "@let value = criterionValue().value;\n@if (!active()) {\n <div\n class=\"criterion-value-text focus-inside px-4\"\n [tabindex]=\"disabled() ? -1 : 0\"\n (keydown.enter)=\"editValue.emit()\"\n (click)=\"editValue.emit()\"\n >\n @let optionValue = this.optionValue();\n @if (optionValue) {\n {{ optionValue.label ?? optionValue.value | translate }}\n } @else {\n {{ value }}\n }\n </div>\n} @else {\n <input\n #valueInput\n typeaheadOptionField=\"translatedLabel\"\n class=\"px-4 py-0 border-0 focus-inside\"\n typeaheadScrollable\n [type]=\"inputType()\"\n [step]=\"step()\"\n [value]=\"valueLabel()\"\n [siTypeahead]=\"options() ?? []\"\n [typeaheadProcess]=\"!onlySelectValue()\"\n [typeaheadMinLength]=\"0\"\n [typeaheadOptionsLimit]=\"maxCriteriaOptions()\"\n [typeaheadAutoSelectIndex]=\"value?.length ? 0 : -1\"\n [readOnly]=\"onlySelectValue() || definition().onlySelectValue\"\n [typeaheadOptionsInScrollableView]=\"optionsInScrollableView()\"\n [attr.aria-label]=\"searchLabel() | translate\"\n (keydown)=\"valueFilterKeys($event)\"\n (keydown.backspace)=\"valueBackspace()\"\n (keydown.enter)=\"valueEnter()\"\n (typeaheadOnInput)=\"valueChange($event)\"\n (typeaheadOnFullMatch)=\"valueTypeaheadFullMatch($event)\"\n (typeaheadOnSelect)=\"valueTypeaheadSelect($event)\"\n />\n}\n", styles: ["input{background:transparent;-moz-appearance:textfield}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}\n"], dependencies: [{ kind: "directive", type: SiTypeaheadDirective, selector: "[siTypeahead]", inputs: ["siTypeahead", "typeaheadProcess", "typeaheadScrollable", "typeaheadOptionsInScrollableView", "typeaheadOptionsLimit", "typeaheadScrollableAdditionalHeight", "typeaheadAutoSelectIndex", "typeaheadCloseOnEsc", "typeaheadClearValueOnSelect", "typeaheadWaitMs", "typeaheadMinLength", "typeaheadOptionField", "typeaheadMultiSelect", "typeaheadTokenize", "typeaheadMatchAllTokens", "typeaheadItemTemplate", "typeaheadSkipSortingMatches", "typeaheadAutocompleteListLabel", "typeaheadFullWidth", "typeaheadScrollStrategy", "typeaheadCreateOption"], outputs: ["typeaheadOnInput", "typeaheadOnSelect", "typeaheadOnFullMatch", "typeaheadOpenChange", "typeaheadOnCreateOption"], exportAs: ["si-typeahead"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
425
498
|
}
|
|
426
499
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiFilteredSearchTypeaheadComponent, decorators: [{
|
|
427
500
|
type: Component,
|
|
428
|
-
args: [{ selector: 'si-filtered-search-typeahead', imports: [SiTypeaheadDirective,
|
|
501
|
+
args: [{ selector: 'si-filtered-search-typeahead', imports: [SiTypeaheadDirective, SiTranslatePipe], providers: [
|
|
429
502
|
{ provide: SiFilteredSearchValueBase, useExisting: SiFilteredSearchTypeaheadComponent }
|
|
430
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let value = criterionValue().value;\n@if (!active()) {\n <div\n class=\"criterion-value-text focus-inside px-4\"\n [tabindex]=\"disabled() ? -1 : 0\"\n (keydown.enter)=\"editValue.emit()\"\n (click)=\"editValue.emit()\"\n >\n @let optionValue = this.optionValue();\n @if (optionValue) {\n {{ optionValue.label ?? optionValue.value | translate }}\n } @else {\n {{ value }}\n }\n </div>\n} @else {\n <input\n #valueInput\n typeaheadOptionField=\"translatedLabel\"\n class=\"px-4 py-0 border-0 focus-inside\"\n typeaheadScrollable\n [type]=\"inputType()\"\n [step]=\"step()\"\n [
|
|
503
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let value = criterionValue().value;\n@if (!active()) {\n <div\n class=\"criterion-value-text focus-inside px-4\"\n [tabindex]=\"disabled() ? -1 : 0\"\n (keydown.enter)=\"editValue.emit()\"\n (click)=\"editValue.emit()\"\n >\n @let optionValue = this.optionValue();\n @if (optionValue) {\n {{ optionValue.label ?? optionValue.value | translate }}\n } @else {\n {{ value }}\n }\n </div>\n} @else {\n <input\n #valueInput\n typeaheadOptionField=\"translatedLabel\"\n class=\"px-4 py-0 border-0 focus-inside\"\n typeaheadScrollable\n [type]=\"inputType()\"\n [step]=\"step()\"\n [value]=\"valueLabel()\"\n [siTypeahead]=\"options() ?? []\"\n [typeaheadProcess]=\"!onlySelectValue()\"\n [typeaheadMinLength]=\"0\"\n [typeaheadOptionsLimit]=\"maxCriteriaOptions()\"\n [typeaheadAutoSelectIndex]=\"value?.length ? 0 : -1\"\n [readOnly]=\"onlySelectValue() || definition().onlySelectValue\"\n [typeaheadOptionsInScrollableView]=\"optionsInScrollableView()\"\n [attr.aria-label]=\"searchLabel() | translate\"\n (keydown)=\"valueFilterKeys($event)\"\n (keydown.backspace)=\"valueBackspace()\"\n (keydown.enter)=\"valueEnter()\"\n (typeaheadOnInput)=\"valueChange($event)\"\n (typeaheadOnFullMatch)=\"valueTypeaheadFullMatch($event)\"\n (typeaheadOnSelect)=\"valueTypeaheadSelect($event)\"\n />\n}\n", styles: ["input{background:transparent;-moz-appearance:textfield}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}\n"] }]
|
|
431
504
|
}], propDecorators: { valueInput: [{ type: i0.ViewChild, args: ['valueInput', { isSignal: true }] }] } });
|
|
432
505
|
|
|
433
506
|
/**
|
|
@@ -565,7 +638,7 @@ class SiFilteredSearchValueComponent {
|
|
|
565
638
|
}
|
|
566
639
|
}
|
|
567
640
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiFilteredSearchValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
568
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiFilteredSearchValueComponent, isStandalone: true, selector: "si-filtered-search-value", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, definition: { classPropertyName: "definition", publicName: "definition", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: true, transformFunction: null }, onlySelectValue: { classPropertyName: "onlySelectValue", publicName: "onlySelectValue", isSignal: true, isRequired: true, transformFunction: null }, maxCriteriaOptions: { classPropertyName: "maxCriteriaOptions", publicName: "maxCriteriaOptions", isSignal: true, isRequired: true, transformFunction: null }, optionsInScrollableView: { classPropertyName: "optionsInScrollableView", publicName: "optionsInScrollableView", isSignal: true, isRequired: true, transformFunction: null }, clearButtonLabel: { classPropertyName: "clearButtonLabel", publicName: "clearButtonLabel", isSignal: true, isRequired: true, transformFunction: null }, lazyValueProvider: { classPropertyName: "lazyValueProvider", publicName: "lazyValueProvider", isSignal: true, isRequired: false, transformFunction: null }, searchDebounceTime: { classPropertyName: "searchDebounceTime", publicName: "searchDebounceTime", isSignal: true, isRequired: true, transformFunction: null }, itemCountText: { classPropertyName: "itemCountText", publicName: "itemCountText", isSignal: true, isRequired: true, transformFunction: null }, disableSelectionByColonAndSemicolon: { classPropertyName: "disableSelectionByColonAndSemicolon", publicName: "disableSelectionByColonAndSemicolon", isSignal: true, isRequired: true, transformFunction: null }, searchLabel: { classPropertyName: "searchLabel", publicName: "searchLabel", isSignal: true, isRequired: true, transformFunction: null }, invalidCriterion: { classPropertyName: "invalidCriterion", publicName: "invalidCriterion", isSignal: true, isRequired: true, transformFunction: null }, isStrictOrOnlySelectValue: { classPropertyName: "isStrictOrOnlySelectValue", publicName: "isStrictOrOnlySelectValue", isSignal: true, isRequired: true, transformFunction: null }, editOnCreation: { classPropertyName: "editOnCreation", publicName: "editOnCreation", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { value: "valueChange", deleteCriterion: "deleteCriterion", submitCriterion: "submitCriterion" }, viewQueries: [{ propertyName: "operatorInput", first: true, predicate: ["operatorInput"], descendants: true, isSignal: true }, { propertyName: "valueInput", first: true, predicate: SiFilteredSearchValueBase, descendants: true, isSignal: true }], ngImport: i0, template: "<div\n cdkMonitorSubtreeFocus\n class=\"criteria pill-group\"\n [class.disabled]=\"disabled()\"\n [attr.aria-disabled]=\"disabled()\"\n [class.invalid-criterion]=\"invalidCriterion()\"\n (cdkFocusChange)=\"focusChange($event)\"\n>\n @if (type() !== 'free-text') {\n <div class=\"pill pill-interactive criterion-label si-h5\" (click)=\"edit()\">\n {{ definition().label | translate }}\n </div>\n }\n @if (definition().operators?.length) {\n <div class=\"pill pill-interactive px-0 criterion-operator-section\">\n <!-- criterion operator input -->\n @if (active()) {\n <input\n #operatorInput\n type=\"text\"\n class=\"focus-inside operator-input py-0 border-0\"\n [siTypeahead]=\"definition().operators!\"\n [typeaheadProcess]=\"false\"\n [typeaheadAutoSelectIndex]=\"selectedOperatorIndex()\"\n [typeaheadMinLength]=\"0\"\n [typeaheadOptionsLimit]=\"0\"\n [readOnly]=\"false\"\n [typeaheadScrollable]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionsInScrollableView()\"\n [attr.aria-label]=\"searchLabel() | translate\"\n [attr.size]=\"longestOperatorLength()\"\n [ngModel]=\"value().operator\"\n (ngModelChange)=\"operatorUpdate($event)\"\n (keydown.backspace)=\"operatorBackspace()\"\n (keydown.enter)=\"operatorEnter()\"\n (typeaheadOnSelect)=\"operatorEnter()\"\n (blur)=\"operatorBlur()\"\n />\n } @else {\n <!-- criterion operator field -->\n <div\n class=\"criterion-operator-text px-2 focus-inside\"\n [tabindex]=\"!disabled() ? 0 : -1\"\n (keydown.enter)=\"edit('operator')\"\n (click)=\"edit('operator')\"\n >\n {{ value().operator }}\n </div>\n }\n </div>\n }\n @switch (type()) {\n @case ('free-text') {\n <si-filtered-search-free-text\n [definition]=\"definition()\"\n [disabled]=\"disabled()\"\n [searchLabel]=\"searchLabel()\"\n [(active)]=\"active\"\n [(criterionValue)]=\"value\"\n (backspaceOverflow)=\"backspaceOverflow()\"\n (editValue)=\"edit('value')\"\n (submitValue)=\"submitCriterion.emit($event)\"\n (activeChange)=\"freeTextActiveChange($event)\"\n />\n }\n @case ('date') {\n <si-filtered-search-date-value\n [definition]=\"definition()\"\n [disabled]=\"disabled()\"\n [searchLabel]=\"searchLabel()\"\n [(active)]=\"active\"\n [(criterionValue)]=\"value\"\n (backspaceOverflow)=\"backspaceOverflow()\"\n (editValue)=\"edit('value')\"\n (submitValue)=\"submitCriterion.emit($event)\"\n />\n }\n @case ('multi-select') {\n <si-filtered-search-multi-select\n [definition]=\"definition()\"\n [disabled]=\"disabled()\"\n [searchLabel]=\"searchLabel()\"\n [searchDebounceTime]=\"searchDebounceTime()\"\n [onlySelectValue]=\"onlySelectValue()\"\n [optionsInScrollableView]=\"optionsInScrollableView()\"\n [maxCriteriaOptions]=\"maxCriteriaOptions()\"\n [lazyValueProvider]=\"lazyValueProvider()\"\n [itemCountText]=\"itemCountText()\"\n [isStrictOrOnlySelectValue]=\"isStrictOrOnlySelectValue()\"\n [disableSelectionByColonAndSemicolon]=\"disableSelectionByColonAndSemicolon()\"\n [(active)]=\"active\"\n [(criterionValue)]=\"value\"\n (backspaceOverflow)=\"backspaceOverflow()\"\n (editValue)=\"edit('value')\"\n (submitValue)=\"submitCriterion.emit($event)\"\n />\n }\n @case ('typeahead') {\n <si-filtered-search-typeahead\n [definition]=\"definition()\"\n [disabled]=\"disabled()\"\n [searchLabel]=\"searchLabel()\"\n [searchDebounceTime]=\"searchDebounceTime()\"\n [onlySelectValue]=\"onlySelectValue()\"\n [optionsInScrollableView]=\"optionsInScrollableView()\"\n [maxCriteriaOptions]=\"maxCriteriaOptions()\"\n [lazyValueProvider]=\"lazyValueProvider()\"\n [isStrictOrOnlySelectValue]=\"isStrictOrOnlySelectValue()\"\n [disableSelectionByColonAndSemicolon]=\"disableSelectionByColonAndSemicolon()\"\n [(active)]=\"active\"\n [(criterionValue)]=\"value\"\n (backspaceOverflow)=\"backspaceOverflow()\"\n (editValue)=\"edit('value')\"\n (submitValue)=\"submitCriterion.emit($event)\"\n />\n }\n }\n <div class=\"pill px-0 ms-n1\">\n <button\n type=\"button\"\n class=\"btn btn-circle btn-sm btn-ghost focus-inside\"\n [attr.aria-label]=\"clearButtonLabel() | translate\"\n [disabled]=\"disabled()\"\n (click)=\"clear()\"\n (mousedown)=\"$event.preventDefault()\"\n >\n <si-icon [icon]=\"icons.elementCancel\" />\n </button>\n </div>\n</div>\n", styles: [":host-context(.disabled) input,:host-context(.disabled) ::placeholder{color:var(--element-text-disabled)}.pill{background:var(--filter-pill-background-color)}.criteria{display:flex;cursor:pointer;white-space:nowrap;border-radius:12px}.criteria.invalid-criterion{box-shadow:0 0 0 1px var(--element-status-danger)}.criteria:not(.invalid-criterion) .invalid-criterion{box-shadow:inset 0 0 0 1px var(--element-status-danger)}.criteria.disabled{cursor:inherit;pointer-events:none}.operator-input{background:var(--filter-pill-background-color);padding-inline:4px;inline-size:calc(1ch + 8px)}input{background:transparent}\n"], dependencies: [{ kind: "directive", type: CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: ["cdkFocusChange"], exportAs: ["cdkMonitorFocus"] }, { kind: "directive", type: SiTypeaheadDirective, selector: "[siTypeahead]", inputs: ["siTypeahead", "typeaheadProcess", "typeaheadScrollable", "typeaheadOptionsInScrollableView", "typeaheadOptionsLimit", "typeaheadScrollableAdditionalHeight", "typeaheadAutoSelectIndex", "typeaheadCloseOnEsc", "typeaheadClearValueOnSelect", "typeaheadWaitMs", "typeaheadMinLength", "typeaheadOptionField", "typeaheadMultiSelect", "typeaheadTokenize", "typeaheadMatchAllTokens", "typeaheadItemTemplate", "typeaheadSkipSortingMatches", "typeaheadAutocompleteListLabel", "typeaheadFullWidth", "typeaheadScrollStrategy", "typeaheadCreateOption"], outputs: ["typeaheadOnInput", "typeaheadOnSelect", "typeaheadOnFullMatch", "typeaheadOpenChange", "typeaheadOnCreateOption"], exportAs: ["si-typeahead"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: SiFilteredSearchDateValueComponent, selector: "si-filtered-search-date-value" }, { kind: "component", type: SiFilteredSearchFreeTextComponent, selector: "si-filtered-search-free-text" }, { kind: "component", type: SiFilteredSearchTypeaheadComponent, selector: "si-filtered-search-typeahead" }, { kind: "component", type: SiFilteredSearchMultiSelectComponent, selector: "si-filtered-search-multi-select", inputs: ["itemCountText"] }, { kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
641
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiFilteredSearchValueComponent, isStandalone: true, selector: "si-filtered-search-value", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, definition: { classPropertyName: "definition", publicName: "definition", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: true, transformFunction: null }, onlySelectValue: { classPropertyName: "onlySelectValue", publicName: "onlySelectValue", isSignal: true, isRequired: true, transformFunction: null }, maxCriteriaOptions: { classPropertyName: "maxCriteriaOptions", publicName: "maxCriteriaOptions", isSignal: true, isRequired: true, transformFunction: null }, optionsInScrollableView: { classPropertyName: "optionsInScrollableView", publicName: "optionsInScrollableView", isSignal: true, isRequired: true, transformFunction: null }, clearButtonLabel: { classPropertyName: "clearButtonLabel", publicName: "clearButtonLabel", isSignal: true, isRequired: true, transformFunction: null }, lazyValueProvider: { classPropertyName: "lazyValueProvider", publicName: "lazyValueProvider", isSignal: true, isRequired: false, transformFunction: null }, searchDebounceTime: { classPropertyName: "searchDebounceTime", publicName: "searchDebounceTime", isSignal: true, isRequired: true, transformFunction: null }, itemCountText: { classPropertyName: "itemCountText", publicName: "itemCountText", isSignal: true, isRequired: true, transformFunction: null }, disableSelectionByColonAndSemicolon: { classPropertyName: "disableSelectionByColonAndSemicolon", publicName: "disableSelectionByColonAndSemicolon", isSignal: true, isRequired: true, transformFunction: null }, searchLabel: { classPropertyName: "searchLabel", publicName: "searchLabel", isSignal: true, isRequired: true, transformFunction: null }, invalidCriterion: { classPropertyName: "invalidCriterion", publicName: "invalidCriterion", isSignal: true, isRequired: true, transformFunction: null }, isStrictOrOnlySelectValue: { classPropertyName: "isStrictOrOnlySelectValue", publicName: "isStrictOrOnlySelectValue", isSignal: true, isRequired: true, transformFunction: null }, editOnCreation: { classPropertyName: "editOnCreation", publicName: "editOnCreation", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { value: "valueChange", deleteCriterion: "deleteCriterion", submitCriterion: "submitCriterion" }, viewQueries: [{ propertyName: "operatorInput", first: true, predicate: ["operatorInput"], descendants: true, isSignal: true }, { propertyName: "valueInput", first: true, predicate: SiFilteredSearchValueBase, descendants: true, isSignal: true }], ngImport: i0, template: "<div\n cdkMonitorSubtreeFocus\n class=\"criteria pill-group\"\n [class.disabled]=\"disabled()\"\n [attr.aria-disabled]=\"disabled()\"\n [class.invalid-criterion]=\"invalidCriterion()\"\n (cdkFocusChange)=\"focusChange($event)\"\n>\n @if (type() !== 'free-text') {\n <div class=\"pill pill-interactive criterion-label si-h5\" (click)=\"edit()\">\n {{ definition().label | translate }}\n </div>\n }\n @if (definition().operators?.length) {\n <div class=\"pill pill-interactive px-0 criterion-operator-section\">\n <!-- criterion operator input -->\n @if (active()) {\n <input\n #operatorInput\n type=\"text\"\n class=\"focus-inside operator-input py-0 border-0\"\n [siTypeahead]=\"definition().operators!\"\n [typeaheadProcess]=\"false\"\n [typeaheadAutoSelectIndex]=\"selectedOperatorIndex()\"\n [typeaheadMinLength]=\"0\"\n [typeaheadOptionsLimit]=\"0\"\n [readOnly]=\"false\"\n [typeaheadScrollable]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionsInScrollableView()\"\n [attr.aria-label]=\"searchLabel() | translate\"\n [attr.size]=\"longestOperatorLength()\"\n [ngModel]=\"value().operator\"\n (ngModelChange)=\"operatorUpdate($event)\"\n (keydown.backspace)=\"operatorBackspace()\"\n (keydown.enter)=\"operatorEnter()\"\n (typeaheadOnSelect)=\"operatorEnter()\"\n (blur)=\"operatorBlur()\"\n />\n } @else {\n <!-- criterion operator field -->\n <div\n class=\"criterion-operator-text px-2 focus-inside\"\n [tabindex]=\"!disabled() ? 0 : -1\"\n (keydown.enter)=\"edit('operator')\"\n (click)=\"edit('operator')\"\n >\n {{ value().operator }}\n </div>\n }\n </div>\n }\n @switch (type()) {\n @case ('free-text') {\n <si-filtered-search-free-text\n [definition]=\"definition()\"\n [disabled]=\"disabled()\"\n [searchLabel]=\"searchLabel()\"\n [(active)]=\"active\"\n [(criterionValue)]=\"value\"\n (backspaceOverflow)=\"backspaceOverflow()\"\n (editValue)=\"edit('value')\"\n (submitValue)=\"submitCriterion.emit($event)\"\n (activeChange)=\"freeTextActiveChange($event)\"\n />\n }\n @case ('date') {\n <si-filtered-search-date-value\n [definition]=\"definition()\"\n [disabled]=\"disabled()\"\n [searchLabel]=\"searchLabel()\"\n [(active)]=\"active\"\n [(criterionValue)]=\"value\"\n (backspaceOverflow)=\"backspaceOverflow()\"\n (editValue)=\"edit('value')\"\n (submitValue)=\"submitCriterion.emit($event)\"\n />\n }\n @case ('multi-select') {\n <si-filtered-search-multi-select\n [definition]=\"definition()\"\n [disabled]=\"disabled()\"\n [searchLabel]=\"searchLabel()\"\n [searchDebounceTime]=\"searchDebounceTime()\"\n [onlySelectValue]=\"onlySelectValue()\"\n [optionsInScrollableView]=\"optionsInScrollableView()\"\n [maxCriteriaOptions]=\"maxCriteriaOptions()\"\n [lazyValueProvider]=\"lazyValueProvider()\"\n [itemCountText]=\"itemCountText()\"\n [isStrictOrOnlySelectValue]=\"isStrictOrOnlySelectValue()\"\n [disableSelectionByColonAndSemicolon]=\"disableSelectionByColonAndSemicolon()\"\n [(active)]=\"active\"\n [(criterionValue)]=\"value\"\n (backspaceOverflow)=\"backspaceOverflow()\"\n (editValue)=\"edit('value')\"\n (submitValue)=\"submitCriterion.emit($event)\"\n />\n }\n @case ('typeahead') {\n <si-filtered-search-typeahead\n [definition]=\"definition()\"\n [disabled]=\"disabled()\"\n [searchLabel]=\"searchLabel()\"\n [searchDebounceTime]=\"searchDebounceTime()\"\n [onlySelectValue]=\"onlySelectValue()\"\n [optionsInScrollableView]=\"optionsInScrollableView()\"\n [maxCriteriaOptions]=\"maxCriteriaOptions()\"\n [lazyValueProvider]=\"lazyValueProvider()\"\n [isStrictOrOnlySelectValue]=\"isStrictOrOnlySelectValue()\"\n [disableSelectionByColonAndSemicolon]=\"disableSelectionByColonAndSemicolon()\"\n [(active)]=\"active\"\n [(criterionValue)]=\"value\"\n (backspaceOverflow)=\"backspaceOverflow()\"\n (editValue)=\"edit('value')\"\n (submitValue)=\"submitCriterion.emit($event)\"\n />\n }\n }\n <div class=\"pill px-0 ms-n1\">\n <button\n type=\"button\"\n class=\"btn btn-circle btn-sm btn-ghost focus-inside\"\n [attr.aria-label]=\"clearButtonLabel() | translate\"\n [disabled]=\"disabled()\"\n (click)=\"clear()\"\n (mousedown)=\"$event.preventDefault()\"\n >\n <si-icon [icon]=\"icons.elementCancel\" />\n </button>\n </div>\n</div>\n", styles: [".pill{background:var(--filter-pill-background-color)}.criteria{display:flex;cursor:pointer;white-space:nowrap;border-radius:12px}.criteria.invalid-criterion{box-shadow:0 0 0 1px var(--element-status-danger)}.criteria:not(.invalid-criterion) .invalid-criterion{box-shadow:inset 0 0 0 1px var(--element-status-danger)}.criteria.disabled{cursor:inherit;pointer-events:none}.operator-input{background:var(--filter-pill-background-color);padding-inline:4px;inline-size:calc(1ch + 8px)}input{background:transparent}\n"], dependencies: [{ kind: "directive", type: CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: ["cdkFocusChange"], exportAs: ["cdkMonitorFocus"] }, { kind: "directive", type: SiTypeaheadDirective, selector: "[siTypeahead]", inputs: ["siTypeahead", "typeaheadProcess", "typeaheadScrollable", "typeaheadOptionsInScrollableView", "typeaheadOptionsLimit", "typeaheadScrollableAdditionalHeight", "typeaheadAutoSelectIndex", "typeaheadCloseOnEsc", "typeaheadClearValueOnSelect", "typeaheadWaitMs", "typeaheadMinLength", "typeaheadOptionField", "typeaheadMultiSelect", "typeaheadTokenize", "typeaheadMatchAllTokens", "typeaheadItemTemplate", "typeaheadSkipSortingMatches", "typeaheadAutocompleteListLabel", "typeaheadFullWidth", "typeaheadScrollStrategy", "typeaheadCreateOption"], outputs: ["typeaheadOnInput", "typeaheadOnSelect", "typeaheadOnFullMatch", "typeaheadOpenChange", "typeaheadOnCreateOption"], exportAs: ["si-typeahead"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: SiFilteredSearchDateValueComponent, selector: "si-filtered-search-date-value" }, { kind: "component", type: SiFilteredSearchFreeTextComponent, selector: "si-filtered-search-free-text" }, { kind: "component", type: SiFilteredSearchTypeaheadComponent, selector: "si-filtered-search-typeahead" }, { kind: "component", type: SiFilteredSearchMultiSelectComponent, selector: "si-filtered-search-multi-select", inputs: ["itemCountText"] }, { kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
569
642
|
}
|
|
570
643
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiFilteredSearchValueComponent, decorators: [{
|
|
571
644
|
type: Component,
|
|
@@ -579,7 +652,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
579
652
|
SiFilteredSearchTypeaheadComponent,
|
|
580
653
|
SiFilteredSearchMultiSelectComponent,
|
|
581
654
|
SiIconComponent
|
|
582
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n cdkMonitorSubtreeFocus\n class=\"criteria pill-group\"\n [class.disabled]=\"disabled()\"\n [attr.aria-disabled]=\"disabled()\"\n [class.invalid-criterion]=\"invalidCriterion()\"\n (cdkFocusChange)=\"focusChange($event)\"\n>\n @if (type() !== 'free-text') {\n <div class=\"pill pill-interactive criterion-label si-h5\" (click)=\"edit()\">\n {{ definition().label | translate }}\n </div>\n }\n @if (definition().operators?.length) {\n <div class=\"pill pill-interactive px-0 criterion-operator-section\">\n <!-- criterion operator input -->\n @if (active()) {\n <input\n #operatorInput\n type=\"text\"\n class=\"focus-inside operator-input py-0 border-0\"\n [siTypeahead]=\"definition().operators!\"\n [typeaheadProcess]=\"false\"\n [typeaheadAutoSelectIndex]=\"selectedOperatorIndex()\"\n [typeaheadMinLength]=\"0\"\n [typeaheadOptionsLimit]=\"0\"\n [readOnly]=\"false\"\n [typeaheadScrollable]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionsInScrollableView()\"\n [attr.aria-label]=\"searchLabel() | translate\"\n [attr.size]=\"longestOperatorLength()\"\n [ngModel]=\"value().operator\"\n (ngModelChange)=\"operatorUpdate($event)\"\n (keydown.backspace)=\"operatorBackspace()\"\n (keydown.enter)=\"operatorEnter()\"\n (typeaheadOnSelect)=\"operatorEnter()\"\n (blur)=\"operatorBlur()\"\n />\n } @else {\n <!-- criterion operator field -->\n <div\n class=\"criterion-operator-text px-2 focus-inside\"\n [tabindex]=\"!disabled() ? 0 : -1\"\n (keydown.enter)=\"edit('operator')\"\n (click)=\"edit('operator')\"\n >\n {{ value().operator }}\n </div>\n }\n </div>\n }\n @switch (type()) {\n @case ('free-text') {\n <si-filtered-search-free-text\n [definition]=\"definition()\"\n [disabled]=\"disabled()\"\n [searchLabel]=\"searchLabel()\"\n [(active)]=\"active\"\n [(criterionValue)]=\"value\"\n (backspaceOverflow)=\"backspaceOverflow()\"\n (editValue)=\"edit('value')\"\n (submitValue)=\"submitCriterion.emit($event)\"\n (activeChange)=\"freeTextActiveChange($event)\"\n />\n }\n @case ('date') {\n <si-filtered-search-date-value\n [definition]=\"definition()\"\n [disabled]=\"disabled()\"\n [searchLabel]=\"searchLabel()\"\n [(active)]=\"active\"\n [(criterionValue)]=\"value\"\n (backspaceOverflow)=\"backspaceOverflow()\"\n (editValue)=\"edit('value')\"\n (submitValue)=\"submitCriterion.emit($event)\"\n />\n }\n @case ('multi-select') {\n <si-filtered-search-multi-select\n [definition]=\"definition()\"\n [disabled]=\"disabled()\"\n [searchLabel]=\"searchLabel()\"\n [searchDebounceTime]=\"searchDebounceTime()\"\n [onlySelectValue]=\"onlySelectValue()\"\n [optionsInScrollableView]=\"optionsInScrollableView()\"\n [maxCriteriaOptions]=\"maxCriteriaOptions()\"\n [lazyValueProvider]=\"lazyValueProvider()\"\n [itemCountText]=\"itemCountText()\"\n [isStrictOrOnlySelectValue]=\"isStrictOrOnlySelectValue()\"\n [disableSelectionByColonAndSemicolon]=\"disableSelectionByColonAndSemicolon()\"\n [(active)]=\"active\"\n [(criterionValue)]=\"value\"\n (backspaceOverflow)=\"backspaceOverflow()\"\n (editValue)=\"edit('value')\"\n (submitValue)=\"submitCriterion.emit($event)\"\n />\n }\n @case ('typeahead') {\n <si-filtered-search-typeahead\n [definition]=\"definition()\"\n [disabled]=\"disabled()\"\n [searchLabel]=\"searchLabel()\"\n [searchDebounceTime]=\"searchDebounceTime()\"\n [onlySelectValue]=\"onlySelectValue()\"\n [optionsInScrollableView]=\"optionsInScrollableView()\"\n [maxCriteriaOptions]=\"maxCriteriaOptions()\"\n [lazyValueProvider]=\"lazyValueProvider()\"\n [isStrictOrOnlySelectValue]=\"isStrictOrOnlySelectValue()\"\n [disableSelectionByColonAndSemicolon]=\"disableSelectionByColonAndSemicolon()\"\n [(active)]=\"active\"\n [(criterionValue)]=\"value\"\n (backspaceOverflow)=\"backspaceOverflow()\"\n (editValue)=\"edit('value')\"\n (submitValue)=\"submitCriterion.emit($event)\"\n />\n }\n }\n <div class=\"pill px-0 ms-n1\">\n <button\n type=\"button\"\n class=\"btn btn-circle btn-sm btn-ghost focus-inside\"\n [attr.aria-label]=\"clearButtonLabel() | translate\"\n [disabled]=\"disabled()\"\n (click)=\"clear()\"\n (mousedown)=\"$event.preventDefault()\"\n >\n <si-icon [icon]=\"icons.elementCancel\" />\n </button>\n </div>\n</div>\n", styles: ["
|
|
655
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n cdkMonitorSubtreeFocus\n class=\"criteria pill-group\"\n [class.disabled]=\"disabled()\"\n [attr.aria-disabled]=\"disabled()\"\n [class.invalid-criterion]=\"invalidCriterion()\"\n (cdkFocusChange)=\"focusChange($event)\"\n>\n @if (type() !== 'free-text') {\n <div class=\"pill pill-interactive criterion-label si-h5\" (click)=\"edit()\">\n {{ definition().label | translate }}\n </div>\n }\n @if (definition().operators?.length) {\n <div class=\"pill pill-interactive px-0 criterion-operator-section\">\n <!-- criterion operator input -->\n @if (active()) {\n <input\n #operatorInput\n type=\"text\"\n class=\"focus-inside operator-input py-0 border-0\"\n [siTypeahead]=\"definition().operators!\"\n [typeaheadProcess]=\"false\"\n [typeaheadAutoSelectIndex]=\"selectedOperatorIndex()\"\n [typeaheadMinLength]=\"0\"\n [typeaheadOptionsLimit]=\"0\"\n [readOnly]=\"false\"\n [typeaheadScrollable]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionsInScrollableView()\"\n [attr.aria-label]=\"searchLabel() | translate\"\n [attr.size]=\"longestOperatorLength()\"\n [ngModel]=\"value().operator\"\n (ngModelChange)=\"operatorUpdate($event)\"\n (keydown.backspace)=\"operatorBackspace()\"\n (keydown.enter)=\"operatorEnter()\"\n (typeaheadOnSelect)=\"operatorEnter()\"\n (blur)=\"operatorBlur()\"\n />\n } @else {\n <!-- criterion operator field -->\n <div\n class=\"criterion-operator-text px-2 focus-inside\"\n [tabindex]=\"!disabled() ? 0 : -1\"\n (keydown.enter)=\"edit('operator')\"\n (click)=\"edit('operator')\"\n >\n {{ value().operator }}\n </div>\n }\n </div>\n }\n @switch (type()) {\n @case ('free-text') {\n <si-filtered-search-free-text\n [definition]=\"definition()\"\n [disabled]=\"disabled()\"\n [searchLabel]=\"searchLabel()\"\n [(active)]=\"active\"\n [(criterionValue)]=\"value\"\n (backspaceOverflow)=\"backspaceOverflow()\"\n (editValue)=\"edit('value')\"\n (submitValue)=\"submitCriterion.emit($event)\"\n (activeChange)=\"freeTextActiveChange($event)\"\n />\n }\n @case ('date') {\n <si-filtered-search-date-value\n [definition]=\"definition()\"\n [disabled]=\"disabled()\"\n [searchLabel]=\"searchLabel()\"\n [(active)]=\"active\"\n [(criterionValue)]=\"value\"\n (backspaceOverflow)=\"backspaceOverflow()\"\n (editValue)=\"edit('value')\"\n (submitValue)=\"submitCriterion.emit($event)\"\n />\n }\n @case ('multi-select') {\n <si-filtered-search-multi-select\n [definition]=\"definition()\"\n [disabled]=\"disabled()\"\n [searchLabel]=\"searchLabel()\"\n [searchDebounceTime]=\"searchDebounceTime()\"\n [onlySelectValue]=\"onlySelectValue()\"\n [optionsInScrollableView]=\"optionsInScrollableView()\"\n [maxCriteriaOptions]=\"maxCriteriaOptions()\"\n [lazyValueProvider]=\"lazyValueProvider()\"\n [itemCountText]=\"itemCountText()\"\n [isStrictOrOnlySelectValue]=\"isStrictOrOnlySelectValue()\"\n [disableSelectionByColonAndSemicolon]=\"disableSelectionByColonAndSemicolon()\"\n [(active)]=\"active\"\n [(criterionValue)]=\"value\"\n (backspaceOverflow)=\"backspaceOverflow()\"\n (editValue)=\"edit('value')\"\n (submitValue)=\"submitCriterion.emit($event)\"\n />\n }\n @case ('typeahead') {\n <si-filtered-search-typeahead\n [definition]=\"definition()\"\n [disabled]=\"disabled()\"\n [searchLabel]=\"searchLabel()\"\n [searchDebounceTime]=\"searchDebounceTime()\"\n [onlySelectValue]=\"onlySelectValue()\"\n [optionsInScrollableView]=\"optionsInScrollableView()\"\n [maxCriteriaOptions]=\"maxCriteriaOptions()\"\n [lazyValueProvider]=\"lazyValueProvider()\"\n [isStrictOrOnlySelectValue]=\"isStrictOrOnlySelectValue()\"\n [disableSelectionByColonAndSemicolon]=\"disableSelectionByColonAndSemicolon()\"\n [(active)]=\"active\"\n [(criterionValue)]=\"value\"\n (backspaceOverflow)=\"backspaceOverflow()\"\n (editValue)=\"edit('value')\"\n (submitValue)=\"submitCriterion.emit($event)\"\n />\n }\n }\n <div class=\"pill px-0 ms-n1\">\n <button\n type=\"button\"\n class=\"btn btn-circle btn-sm btn-ghost focus-inside\"\n [attr.aria-label]=\"clearButtonLabel() | translate\"\n [disabled]=\"disabled()\"\n (click)=\"clear()\"\n (mousedown)=\"$event.preventDefault()\"\n >\n <si-icon [icon]=\"icons.elementCancel\" />\n </button>\n </div>\n</div>\n", styles: [".pill{background:var(--filter-pill-background-color)}.criteria{display:flex;cursor:pointer;white-space:nowrap;border-radius:12px}.criteria.invalid-criterion{box-shadow:0 0 0 1px var(--element-status-danger)}.criteria:not(.invalid-criterion) .invalid-criterion{box-shadow:inset 0 0 0 1px var(--element-status-danger)}.criteria.disabled{cursor:inherit;pointer-events:none}.operator-input{background:var(--filter-pill-background-color);padding-inline:4px;inline-size:calc(1ch + 8px)}input{background:transparent}\n"] }]
|
|
583
656
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }, { type: i0.Output, args: ["valueChange"] }], definition: [{ type: i0.Input, args: [{ isSignal: true, alias: "definition", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: true }] }], onlySelectValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "onlySelectValue", required: true }] }], maxCriteriaOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxCriteriaOptions", required: true }] }], optionsInScrollableView: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsInScrollableView", required: true }] }], clearButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearButtonLabel", required: true }] }], lazyValueProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyValueProvider", required: false }] }], searchDebounceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchDebounceTime", required: true }] }], itemCountText: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemCountText", required: true }] }], disableSelectionByColonAndSemicolon: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSelectionByColonAndSemicolon", required: true }] }], searchLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchLabel", required: true }] }], invalidCriterion: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidCriterion", required: true }] }], isStrictOrOnlySelectValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "isStrictOrOnlySelectValue", required: true }] }], editOnCreation: [{ type: i0.Input, args: [{ isSignal: true, alias: "editOnCreation", required: true }] }], deleteCriterion: [{ type: i0.Output, args: ["deleteCriterion"] }], submitCriterion: [{ type: i0.Output, args: ["submitCriterion"] }], operatorInput: [{ type: i0.ViewChild, args: ['operatorInput', { isSignal: true }] }], valueInput: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SiFilteredSearchValueBase), { isSignal: true }] }] } });
|
|
584
657
|
|
|
585
658
|
/**
|
|
@@ -587,7 +660,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
587
660
|
* SPDX-License-Identifier: MIT
|
|
588
661
|
*/
|
|
589
662
|
class SiFilteredSearchComponent {
|
|
590
|
-
static criterionRegex = /(.+?):(.*)$/;
|
|
591
663
|
/**
|
|
592
664
|
* Output callback event that provides an object describing the
|
|
593
665
|
* selected criteria and additional filter text.
|
|
@@ -806,7 +878,7 @@ class SiFilteredSearchComponent {
|
|
|
806
878
|
* ```
|
|
807
879
|
*/
|
|
808
880
|
interceptDisplayedCriteria = output();
|
|
809
|
-
|
|
881
|
+
freeTextInput = viewChild.required(SiFilteredSearchInputComponent);
|
|
810
882
|
scrollContainer = viewChild.required('scrollContainer', { read: ElementRef });
|
|
811
883
|
valueComponents = viewChildren(SiFilteredSearchValueComponent, ...(ngDevMode ? [{ debugName: "valueComponents" }] : []));
|
|
812
884
|
dataSource;
|
|
@@ -816,14 +888,12 @@ class SiFilteredSearchComponent {
|
|
|
816
888
|
/** Internal criteria model */
|
|
817
889
|
internalCriterionDefinitions = [];
|
|
818
890
|
icons = addIcons({ elementCancel, elementSearch });
|
|
819
|
-
/** Used to trigger a renewed search */
|
|
820
|
-
typeaheadInputChange = new BehaviorSubject('');
|
|
821
891
|
/** Used to debounce the Search emissions */
|
|
822
892
|
searchEmitQueue = new Subject();
|
|
823
893
|
destroyRef = inject(DestroyRef);
|
|
824
|
-
cdRef = inject(ChangeDetectorRef);
|
|
825
894
|
translateService = injectSiTranslateService();
|
|
826
895
|
locale = inject(LOCALE_ID).toString();
|
|
896
|
+
freeTextFocused = new Subject();
|
|
827
897
|
allowFreeTextCache = signal(true, ...(ngDevMode ? [{ debugName: "allowFreeTextCache" }] : []));
|
|
828
898
|
// Angular also calls ngOnChanges if we emitted a change and then two-way-databinding writes back our own change.
|
|
829
899
|
// We use this to ensure that we do not write our own change back to the input.
|
|
@@ -857,6 +927,7 @@ class SiFilteredSearchComponent {
|
|
|
857
927
|
};
|
|
858
928
|
}, ...(ngDevMode ? [{ debugName: "internalFreeTextCriterion" }] : []));
|
|
859
929
|
constructor() {
|
|
930
|
+
const typeaheadInputChange = merge(toObservable(this.searchValue), this.freeTextFocused.pipe(map(() => this.searchValue())));
|
|
860
931
|
const criteriaRestrictions = toObservable(computed(() => ({
|
|
861
932
|
maxCriteria: this.maxCriteria(),
|
|
862
933
|
values: this.values(),
|
|
@@ -864,7 +935,7 @@ class SiFilteredSearchComponent {
|
|
|
864
935
|
})));
|
|
865
936
|
this.dataSource = toObservable(this.lazyCriterionProvider).pipe(switchMap(lazyCriterionProvider => {
|
|
866
937
|
if (lazyCriterionProvider) {
|
|
867
|
-
return
|
|
938
|
+
return typeaheadInputChange.pipe(switchMap(value => this.lazyCriterionProvider()(value, this.searchCriteria()).pipe(debounceTime(this.lazyLoadingDebounceTime()), map(result => this.getCriteriaToDisplayFromSubscription(result)))));
|
|
868
939
|
}
|
|
869
940
|
else {
|
|
870
941
|
return criteriaRestrictions.pipe(map(({ maxCriteria, values, exclusiveCriteria }) => this.getFilteredTypeaheadCriteria(maxCriteria, values, exclusiveCriteria)));
|
|
@@ -883,9 +954,6 @@ class SiFilteredSearchComponent {
|
|
|
883
954
|
if ((changes.searchCriteria && this.searchCriteria() !== this.lastEmittedSearchCriteria) ||
|
|
884
955
|
changes.criteria) {
|
|
885
956
|
this.initValue();
|
|
886
|
-
// Update typeahead since the criteria input can change while the free text input is focused.
|
|
887
|
-
// This is necessary since the criteria are set as a result of an API call response.
|
|
888
|
-
this.typeaheadInputChange.next(this.freeTextInputElement().nativeElement.value ?? '');
|
|
889
957
|
}
|
|
890
958
|
}
|
|
891
959
|
ngOnInit() {
|
|
@@ -962,7 +1030,6 @@ class SiFilteredSearchComponent {
|
|
|
962
1030
|
this.values.set([]);
|
|
963
1031
|
this.searchValue.set('');
|
|
964
1032
|
this.emitChangeEvent();
|
|
965
|
-
this.typeaheadInputChange.next(this.searchValue());
|
|
966
1033
|
this.submit();
|
|
967
1034
|
}
|
|
968
1035
|
deleteCriterion(index, event) {
|
|
@@ -975,16 +1042,14 @@ class SiFilteredSearchComponent {
|
|
|
975
1042
|
this.valueComponents().forEach(component => {
|
|
976
1043
|
component.closeOverlay();
|
|
977
1044
|
});
|
|
978
|
-
this.cdRef.detectChanges();
|
|
979
1045
|
this.values.update(v => v.filter((_, i) => i !== index));
|
|
980
1046
|
this.emitChangeEvent();
|
|
981
1047
|
if (this.values().length !== index) {
|
|
982
1048
|
this.valueComponents()[index + 1].edit('value');
|
|
983
1049
|
}
|
|
984
1050
|
else {
|
|
985
|
-
this.
|
|
1051
|
+
this.freeTextInput().focus();
|
|
986
1052
|
}
|
|
987
|
-
this.typeaheadInputChange.next(this.searchValue());
|
|
988
1053
|
if (event?.triggerSearch) {
|
|
989
1054
|
this.submit();
|
|
990
1055
|
}
|
|
@@ -994,15 +1059,6 @@ class SiFilteredSearchComponent {
|
|
|
994
1059
|
this.doSearch.emit(this.searchCriteria());
|
|
995
1060
|
}
|
|
996
1061
|
}
|
|
997
|
-
typeaheadOnSelectCriterion(event) {
|
|
998
|
-
const criterion = event;
|
|
999
|
-
// Removes the focus border before creating a new criterion to prevent the impression of jumping content.
|
|
1000
|
-
this.freeTextInputElement().nativeElement.blur();
|
|
1001
|
-
this.addCriterion(criterion);
|
|
1002
|
-
// The user selected a criterion so we remove the free text search value and add the criterion.
|
|
1003
|
-
this.typeaheadInputChange.next('');
|
|
1004
|
-
this.searchValue.set('');
|
|
1005
|
-
}
|
|
1006
1062
|
validateCriterionLabel(criterion) {
|
|
1007
1063
|
if (!this.strictCriterionOrValue()) {
|
|
1008
1064
|
return true;
|
|
@@ -1106,54 +1162,32 @@ class SiFilteredSearchComponent {
|
|
|
1106
1162
|
const scrollDirection = isRTL() ? -1 : 1;
|
|
1107
1163
|
const position = scrollDirection * this.scrollContainer().nativeElement.scrollWidth;
|
|
1108
1164
|
this.scrollContainer().nativeElement.scrollLeft = position;
|
|
1109
|
-
this.
|
|
1165
|
+
this.freeTextFocused.next();
|
|
1110
1166
|
}
|
|
1111
|
-
freeTextBackspace(
|
|
1112
|
-
if
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
valueComponents[valueComponents.length - 1].edit('value');
|
|
1117
|
-
}
|
|
1167
|
+
freeTextBackspace() {
|
|
1168
|
+
// edit last criterion if a user presses backspace in empty search input.
|
|
1169
|
+
const valueComponents = this.valueComponents();
|
|
1170
|
+
if (valueComponents.length) {
|
|
1171
|
+
valueComponents[valueComponents.length - 1].edit('value');
|
|
1118
1172
|
}
|
|
1119
1173
|
}
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
const match = value.match(SiFilteredSearchComponent.criterionRegex);
|
|
1123
|
-
if (!this.disableSelectionByColonAndSemicolon() && !this.onlySelectValue() && match) {
|
|
1124
|
-
const criterionName = match[1];
|
|
1125
|
-
if (this.searchValue() === '') {
|
|
1126
|
-
// The value was empty before, so we must make angular detect a change here.
|
|
1127
|
-
// Otherwise, the entire value which was pasted will remain in the input.
|
|
1128
|
-
// This happens if the user pasts something like: 'key:value'
|
|
1129
|
-
this.searchValue.set(value);
|
|
1130
|
-
this.cdRef.detectChanges();
|
|
1131
|
-
}
|
|
1132
|
-
this.searchValue.set('');
|
|
1133
|
-
const nameLowerCase = criterionName.toLocaleLowerCase();
|
|
1134
|
-
const criterion = this.internalCriterionDefinitions.find(ic => ic.translatedLabel.toLocaleLowerCase() === nameLowerCase) ?? {
|
|
1135
|
-
name: criterionName,
|
|
1136
|
-
label: criterionName,
|
|
1137
|
-
translatedLabel: criterionName
|
|
1138
|
-
};
|
|
1139
|
-
this.typeaheadInputChange.next('');
|
|
1140
|
-
this.addCriterion(criterion, match[2]);
|
|
1141
|
-
}
|
|
1142
|
-
else {
|
|
1143
|
-
this.searchValue.set(value);
|
|
1144
|
-
// Only emit a change event if free text pills are not enabled and the free text search is enabled.
|
|
1145
|
-
if (!this.disableFreeTextSearch() && !this.freeTextCriterion()) {
|
|
1146
|
-
this.emitChangeEvent();
|
|
1147
|
-
}
|
|
1148
|
-
this.typeaheadInputChange.next(value);
|
|
1149
|
-
}
|
|
1174
|
+
onCreateCriterion(event) {
|
|
1175
|
+
this.addCriterion(event.criterion, event.value);
|
|
1150
1176
|
}
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1177
|
+
onCreateCriterionByName(event) {
|
|
1178
|
+
const nameLowerCase = event.criterionName.toLocaleLowerCase();
|
|
1179
|
+
const criterion = this.internalCriterionDefinitions.find(ic => ic.translatedLabel.toLocaleLowerCase() === nameLowerCase) ?? {
|
|
1180
|
+
name: event.criterionName,
|
|
1181
|
+
label: event.criterionName,
|
|
1182
|
+
translatedLabel: event.criterionName
|
|
1183
|
+
};
|
|
1184
|
+
this.addCriterion(criterion, event.value);
|
|
1185
|
+
}
|
|
1186
|
+
onSearchValueChange(value) {
|
|
1187
|
+
// Only emit a change event if free text pills are not enabled and the free text search is enabled.
|
|
1188
|
+
if (value && !this.disableFreeTextSearch() && !this.freeTextCriterion()) {
|
|
1189
|
+
this.emitChangeEvent();
|
|
1190
|
+
}
|
|
1157
1191
|
}
|
|
1158
1192
|
valueChange(value, criterion) {
|
|
1159
1193
|
criterion.value = value;
|
|
@@ -1166,7 +1200,7 @@ class SiFilteredSearchComponent {
|
|
|
1166
1200
|
}
|
|
1167
1201
|
else {
|
|
1168
1202
|
this.searchValue.set(event?.freeText ?? this.searchValue());
|
|
1169
|
-
this.
|
|
1203
|
+
this.freeTextInput().focus();
|
|
1170
1204
|
}
|
|
1171
1205
|
}
|
|
1172
1206
|
updateAndEmitSearchCriteria() {
|
|
@@ -1195,25 +1229,23 @@ class SiFilteredSearchComponent {
|
|
|
1195
1229
|
config: freeTextDefinition
|
|
1196
1230
|
}
|
|
1197
1231
|
]);
|
|
1198
|
-
this.searchValue.set('');
|
|
1199
1232
|
this.emitChangeEvent();
|
|
1200
1233
|
}
|
|
1201
1234
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiFilteredSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1202
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiFilteredSearchComponent, isStandalone: true, selector: "si-filtered-search", inputs: { doSearchOnInputChange: { classPropertyName: "doSearchOnInputChange", publicName: "doSearchOnInputChange", isSignal: true, isRequired: false, transformFunction: null }, lazyCriterionProvider: { classPropertyName: "lazyCriterionProvider", publicName: "lazyCriterionProvider", isSignal: true, isRequired: false, transformFunction: null }, lazyValueProvider: { classPropertyName: "lazyValueProvider", publicName: "lazyValueProvider", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, strictCriterion: { classPropertyName: "strictCriterion", publicName: "strictCriterion", isSignal: true, isRequired: false, transformFunction: null }, strictValue: { classPropertyName: "strictValue", publicName: "strictValue", isSignal: true, isRequired: false, transformFunction: null }, onlySelectValue: { classPropertyName: "onlySelectValue", publicName: "onlySelectValue", isSignal: true, isRequired: false, transformFunction: null }, lazyLoadingDebounceTime: { classPropertyName: "lazyLoadingDebounceTime", publicName: "lazyLoadingDebounceTime", isSignal: true, isRequired: false, transformFunction: null }, searchDebounceTime: { classPropertyName: "searchDebounceTime", publicName: "searchDebounceTime", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, optionsInScrollableView: { classPropertyName: "optionsInScrollableView", publicName: "optionsInScrollableView", isSignal: true, isRequired: false, transformFunction: null }, searchCriteria: { classPropertyName: "searchCriteria", publicName: "searchCriteria", isSignal: true, isRequired: false, transformFunction: null }, criteria: { classPropertyName: "criteria", publicName: "criteria", isSignal: true, isRequired: false, transformFunction: null }, exclusiveCriteria: { classPropertyName: "exclusiveCriteria", publicName: "exclusiveCriteria", isSignal: true, isRequired: false, transformFunction: null }, maxCriteria: { classPropertyName: "maxCriteria", publicName: "maxCriteria", isSignal: true, isRequired: false, transformFunction: null }, maxCriteriaOptions: { classPropertyName: "maxCriteriaOptions", publicName: "maxCriteriaOptions", isSignal: true, isRequired: false, transformFunction: null }, searchLabel: { classPropertyName: "searchLabel", publicName: "searchLabel", isSignal: true, isRequired: false, transformFunction: null }, clearButtonLabel: { classPropertyName: "clearButtonLabel", publicName: "clearButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, submitButtonLabel: { classPropertyName: "submitButtonLabel", publicName: "submitButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, itemCountText: { classPropertyName: "itemCountText", publicName: "itemCountText", isSignal: true, isRequired: false, transformFunction: null }, colorVariant: { classPropertyName: "colorVariant", publicName: "colorVariant", isSignal: true, isRequired: false, transformFunction: null }, disableFreeTextSearch: { classPropertyName: "disableFreeTextSearch", publicName: "disableFreeTextSearch", isSignal: true, isRequired: false, transformFunction: null }, typeaheadOptionsLimit: { classPropertyName: "typeaheadOptionsLimit", publicName: "typeaheadOptionsLimit", isSignal: true, isRequired: false, transformFunction: null }, disableSelectionByColonAndSemicolon: { classPropertyName: "disableSelectionByColonAndSemicolon", publicName: "disableSelectionByColonAndSemicolon", isSignal: true, isRequired: false, transformFunction: null }, freeTextCriterion: { classPropertyName: "freeTextCriterion", publicName: "freeTextCriterion", isSignal: true, isRequired: false, transformFunction: null }, searchForFreeTextLabel: { classPropertyName: "searchForFreeTextLabel", publicName: "searchForFreeTextLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { doSearch: "doSearch", searchCriteria: "searchCriteriaChange", interceptDisplayedCriteria: "interceptDisplayedCriteria" }, host: { properties: { "class.disabled": "disabled()", "class.dark-background": "colorVariant() === 'base-0'" } }, viewQueries: [{ propertyName: "freeTextInputElement", first: true, predicate: ["freeTextInputElement"], descendants: true, isSignal: true }, { propertyName: "scrollContainer", first: true, predicate: ["scrollContainer"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "valueComponents", predicate: SiFilteredSearchValueComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div\n #scrollContainer\n class=\"search-container d-flex align-items-center overflow-auto py-2 w-100 ps-2 pe-2\"\n>\n @for (criterion of values(); track criterion) {\n <si-filtered-search-value\n [editOnCreation]=\"autoEditCriteria\"\n [definition]=\"criterion.config\"\n [value]=\"criterion.value\"\n [invalidCriterion]=\"!validateCriterionLabel(criterion.config)\"\n [disabled]=\"disabled()\"\n [clearButtonLabel]=\"clearButtonLabel()\"\n [disableSelectionByColonAndSemicolon]=\"disableSelectionByColonAndSemicolon()\"\n [isStrictOrOnlySelectValue]=\"isStrictOrOnlySelectValue()\"\n [itemCountText]=\"itemCountText()\"\n [lazyValueProvider]=\"lazyValueProvider()\"\n [maxCriteriaOptions]=\"maxCriteriaOptions()\"\n [optionsInScrollableView]=\"optionsInScrollableView()\"\n [searchLabel]=\"searchLabel()\"\n [onlySelectValue]=\"onlySelectValue()\"\n [searchDebounceTime]=\"searchDebounceTime()\"\n (submitCriterion)=\"focusNext($index, $event)\"\n (deleteCriterion)=\"deleteCriterion($index, $event)\"\n (valueChange)=\"valueChange($event, criterion)\"\n />\n }\n <!-- criterion input -->\n <input\n #freeTextInputElement\n type=\"text\"\n class=\"value-input ps-2 me-2 flex-grow-1\"\n typeaheadOptionField=\"translatedLabel\"\n typeaheadClearValueOnSelect\n [siTypeahead]=\"dataSource\"\n [typeaheadMinLength]=\"0\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit()\"\n [typeaheadScrollable]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionsInScrollableView()\"\n [typeaheadAutoSelectIndex]=\"searchValue() ? 0 : -1\"\n [typeaheadCreateOption]=\"\n freeTextCriterion() &&\n (!maxCriteria() || values().length < maxCriteria()!) &&\n allowFreeTextCache()\n ? searchForFreeTextLabel()\n : undefined\n \"\n [disabled]=\"disabled()\"\n [placeholder]=\"placeholder()\"\n [attr.aria-label]=\"searchLabel() | translate\"\n [value]=\"searchValue()\"\n (focus)=\"freeTextFocus()\"\n (input)=\"freeTextInput($event)\"\n (blur)=\"freeTextBlur()\"\n (keydown.backspace)=\"freeTextBackspace($event)\"\n (keydown.enter)=\"submit()\"\n (typeaheadOnSelect)=\"typeaheadOnSelectCriterion($event.option)\"\n (typeaheadOnCreateOption)=\"createFreeTextPill($event)\"\n />\n</div>\n<!-- clear all searchCriteria -->\n@if (values().length || searchValue().length) {\n <div class=\"clear-button-container\">\n <button\n type=\"button\"\n class=\"btn btn-icon btn-sm btn-ghost mx-2\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"clearButtonLabel() | translate\"\n (click)=\"deleteAllCriteria($event)\"\n >\n <si-icon [icon]=\"icons.elementCancel\" />\n </button>\n </div>\n}\n\n@if (!disabled()) {\n <button\n type=\"button\"\n class=\"search-button btn btn-icon btn-sm btn-secondary focus-inside\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"submitButtonLabel() | translate\"\n (click)=\"submit()\"\n >\n <si-icon [icon]=\"icons.elementSearch\" />\n </button>\n}\n", styles: [":host{--search-bar-icon-color: var(--element-text-primary);--input-background-color: var(--element-base-1);--input-background-hover-color: var(--element-base-1);--filter-search-background-color: var(--element-base-1);--filter-pill-background-color: var(--element-base-4)}:host.dark-background{--input-background-color: var(--element-base-4);--input-background-hover-color: var(--element-ui-4);--filter-search-background-color: var(--element-base-4);--filter-pill-background-color: var(--element-base-1)}:host{display:flex;align-items:center;line-height:24px;min-inline-size:0}:host.disabled{color:var(--element-text-disabled)}:host.disabled input,:host.disabled ::placeholder{color:var(--element-text-disabled)}:host si-filtered-search-value+input::placeholder{color:transparent}.search-container{border-start-start-radius:4px;border-end-start-radius:4px;background-color:var(--filter-search-background-color);gap:4px}input{background:transparent;border:0;padding-block:0}input:hover::placeholder{opacity:1}:host(.disabled) input::placeholder{opacity:var(--element-action-disabled-opacity)}.clear-button-container{display:flex;align-items:flex-start;align-self:stretch;padding-block:4px;background-color:var(--filter-search-background-color)}.search-button{align-self:stretch;background-color:var(--filter-search-background-color);border:0;border-radius:0;border-end-end-radius:4px;border-start-end-radius:4px;margin-block:0;margin-inline:1px 0;block-size:auto;inline-size:auto;padding-inline:4px!important}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "directive", type: SiTypeaheadDirective, selector: "[siTypeahead]", inputs: ["siTypeahead", "typeaheadProcess", "typeaheadScrollable", "typeaheadOptionsInScrollableView", "typeaheadOptionsLimit", "typeaheadScrollableAdditionalHeight", "typeaheadAutoSelectIndex", "typeaheadCloseOnEsc", "typeaheadClearValueOnSelect", "typeaheadWaitMs", "typeaheadMinLength", "typeaheadOptionField", "typeaheadMultiSelect", "typeaheadTokenize", "typeaheadMatchAllTokens", "typeaheadItemTemplate", "typeaheadSkipSortingMatches", "typeaheadAutocompleteListLabel", "typeaheadFullWidth", "typeaheadScrollStrategy", "typeaheadCreateOption"], outputs: ["typeaheadOnInput", "typeaheadOnSelect", "typeaheadOnFullMatch", "typeaheadOpenChange", "typeaheadOnCreateOption"], exportAs: ["si-typeahead"] }, { kind: "component", type: SiFilteredSearchValueComponent, selector: "si-filtered-search-value", inputs: ["value", "definition", "disabled", "onlySelectValue", "maxCriteriaOptions", "optionsInScrollableView", "clearButtonLabel", "lazyValueProvider", "searchDebounceTime", "itemCountText", "disableSelectionByColonAndSemicolon", "searchLabel", "invalidCriterion", "isStrictOrOnlySelectValue", "editOnCreation"], outputs: ["valueChange", "deleteCriterion", "submitCriterion"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
1235
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiFilteredSearchComponent, isStandalone: true, selector: "si-filtered-search", inputs: { doSearchOnInputChange: { classPropertyName: "doSearchOnInputChange", publicName: "doSearchOnInputChange", isSignal: true, isRequired: false, transformFunction: null }, lazyCriterionProvider: { classPropertyName: "lazyCriterionProvider", publicName: "lazyCriterionProvider", isSignal: true, isRequired: false, transformFunction: null }, lazyValueProvider: { classPropertyName: "lazyValueProvider", publicName: "lazyValueProvider", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, strictCriterion: { classPropertyName: "strictCriterion", publicName: "strictCriterion", isSignal: true, isRequired: false, transformFunction: null }, strictValue: { classPropertyName: "strictValue", publicName: "strictValue", isSignal: true, isRequired: false, transformFunction: null }, onlySelectValue: { classPropertyName: "onlySelectValue", publicName: "onlySelectValue", isSignal: true, isRequired: false, transformFunction: null }, lazyLoadingDebounceTime: { classPropertyName: "lazyLoadingDebounceTime", publicName: "lazyLoadingDebounceTime", isSignal: true, isRequired: false, transformFunction: null }, searchDebounceTime: { classPropertyName: "searchDebounceTime", publicName: "searchDebounceTime", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, optionsInScrollableView: { classPropertyName: "optionsInScrollableView", publicName: "optionsInScrollableView", isSignal: true, isRequired: false, transformFunction: null }, searchCriteria: { classPropertyName: "searchCriteria", publicName: "searchCriteria", isSignal: true, isRequired: false, transformFunction: null }, criteria: { classPropertyName: "criteria", publicName: "criteria", isSignal: true, isRequired: false, transformFunction: null }, exclusiveCriteria: { classPropertyName: "exclusiveCriteria", publicName: "exclusiveCriteria", isSignal: true, isRequired: false, transformFunction: null }, maxCriteria: { classPropertyName: "maxCriteria", publicName: "maxCriteria", isSignal: true, isRequired: false, transformFunction: null }, maxCriteriaOptions: { classPropertyName: "maxCriteriaOptions", publicName: "maxCriteriaOptions", isSignal: true, isRequired: false, transformFunction: null }, searchLabel: { classPropertyName: "searchLabel", publicName: "searchLabel", isSignal: true, isRequired: false, transformFunction: null }, clearButtonLabel: { classPropertyName: "clearButtonLabel", publicName: "clearButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, submitButtonLabel: { classPropertyName: "submitButtonLabel", publicName: "submitButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, itemCountText: { classPropertyName: "itemCountText", publicName: "itemCountText", isSignal: true, isRequired: false, transformFunction: null }, colorVariant: { classPropertyName: "colorVariant", publicName: "colorVariant", isSignal: true, isRequired: false, transformFunction: null }, disableFreeTextSearch: { classPropertyName: "disableFreeTextSearch", publicName: "disableFreeTextSearch", isSignal: true, isRequired: false, transformFunction: null }, typeaheadOptionsLimit: { classPropertyName: "typeaheadOptionsLimit", publicName: "typeaheadOptionsLimit", isSignal: true, isRequired: false, transformFunction: null }, disableSelectionByColonAndSemicolon: { classPropertyName: "disableSelectionByColonAndSemicolon", publicName: "disableSelectionByColonAndSemicolon", isSignal: true, isRequired: false, transformFunction: null }, freeTextCriterion: { classPropertyName: "freeTextCriterion", publicName: "freeTextCriterion", isSignal: true, isRequired: false, transformFunction: null }, searchForFreeTextLabel: { classPropertyName: "searchForFreeTextLabel", publicName: "searchForFreeTextLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { doSearch: "doSearch", searchCriteria: "searchCriteriaChange", interceptDisplayedCriteria: "interceptDisplayedCriteria" }, host: { properties: { "class.disabled": "disabled()", "class.dark-background": "colorVariant() === 'base-0'" } }, viewQueries: [{ propertyName: "freeTextInput", first: true, predicate: SiFilteredSearchInputComponent, descendants: true, isSignal: true }, { propertyName: "scrollContainer", first: true, predicate: ["scrollContainer"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "valueComponents", predicate: SiFilteredSearchValueComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div\n #scrollContainer\n class=\"search-container d-flex align-items-center overflow-auto py-2 w-100 ps-2 pe-2\"\n>\n @for (criterion of values(); track criterion) {\n <si-filtered-search-value\n [editOnCreation]=\"autoEditCriteria\"\n [definition]=\"criterion.config\"\n [value]=\"criterion.value\"\n [invalidCriterion]=\"!validateCriterionLabel(criterion.config)\"\n [disabled]=\"disabled()\"\n [clearButtonLabel]=\"clearButtonLabel()\"\n [disableSelectionByColonAndSemicolon]=\"disableSelectionByColonAndSemicolon()\"\n [isStrictOrOnlySelectValue]=\"isStrictOrOnlySelectValue()\"\n [itemCountText]=\"itemCountText()\"\n [lazyValueProvider]=\"lazyValueProvider()\"\n [maxCriteriaOptions]=\"maxCriteriaOptions()\"\n [optionsInScrollableView]=\"optionsInScrollableView()\"\n [searchLabel]=\"searchLabel()\"\n [onlySelectValue]=\"onlySelectValue()\"\n [searchDebounceTime]=\"searchDebounceTime()\"\n (submitCriterion)=\"focusNext($index, $event)\"\n (deleteCriterion)=\"deleteCriterion($index, $event)\"\n (valueChange)=\"valueChange($event, criterion)\"\n />\n }\n <!-- criterion input -->\n <si-filtered-search-input\n [dataSource]=\"dataSource\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit()\"\n [optionsInScrollableView]=\"optionsInScrollableView()\"\n [disabled]=\"disabled()\"\n [placeholder]=\"placeholder()\"\n [searchLabel]=\"searchLabel()\"\n [freeTextCriterion]=\"!!freeTextCriterion()\"\n [maxCriteriaReached]=\"!!maxCriteria() && values().length >= maxCriteria()!\"\n [allowFreeText]=\"allowFreeTextCache()\"\n [searchForFreeTextLabel]=\"searchForFreeTextLabel()\"\n [disableSelectionByColonAndSemicolon]=\"disableSelectionByColonAndSemicolon()\"\n [onlySelectValue]=\"onlySelectValue()\"\n [(searchValue)]=\"searchValue\"\n (createCriterion)=\"onCreateCriterion($event)\"\n (createCriterionByName)=\"onCreateCriterionByName($event)\"\n (backspaceOverflow)=\"freeTextBackspace()\"\n (createFreeTextPill)=\"createFreeTextPill($event)\"\n (searchValueChange)=\"onSearchValueChange($event)\"\n (inputFocus)=\"freeTextFocus()\"\n (enterSubmit)=\"submit()\"\n />\n</div>\n<!-- clear all searchCriteria -->\n@if (values().length || searchValue().length) {\n <div class=\"clear-button-container\">\n <button\n type=\"button\"\n class=\"btn btn-icon btn-sm btn-ghost mx-2\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"clearButtonLabel() | translate\"\n (click)=\"deleteAllCriteria($event)\"\n >\n <si-icon [icon]=\"icons.elementCancel\" />\n </button>\n </div>\n}\n\n@if (!disabled()) {\n <button\n type=\"button\"\n class=\"search-button btn btn-icon btn-sm btn-secondary focus-inside\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"submitButtonLabel() | translate\"\n (click)=\"submit()\"\n >\n <si-icon [icon]=\"icons.elementSearch\" />\n </button>\n}\n", styles: [":host{--search-bar-icon-color: var(--element-text-primary);--input-background-color: var(--element-base-1);--input-background-hover-color: var(--element-base-1);--filter-search-background-color: var(--element-base-1);--filter-pill-background-color: var(--element-base-4)}:host.dark-background{--input-background-color: var(--element-base-4);--input-background-hover-color: var(--element-ui-4);--filter-search-background-color: var(--element-base-4);--filter-pill-background-color: var(--element-base-1)}:host{display:flex;align-items:center;line-height:24px;min-inline-size:0}:host.disabled{color:var(--element-text-disabled)}.search-container{border-start-start-radius:4px;border-end-start-radius:4px;background-color:var(--filter-search-background-color);gap:4px}.clear-button-container{display:flex;align-items:flex-start;align-self:stretch;padding-block:4px;background-color:var(--filter-search-background-color)}.search-button{align-self:stretch;background-color:var(--filter-search-background-color);border:0;border-radius:0;border-end-end-radius:4px;border-start-end-radius:4px;margin-block:0;margin-inline:1px 0;block-size:auto;inline-size:auto;padding-inline:4px!important}\n"], dependencies: [{ kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "component", type: SiFilteredSearchInputComponent, selector: "si-filtered-search-input", inputs: ["dataSource", "typeaheadOptionsLimit", "optionsInScrollableView", "disabled", "placeholder", "searchLabel", "searchValue", "freeTextCriterion", "maxCriteriaReached", "allowFreeText", "searchForFreeTextLabel", "disableSelectionByColonAndSemicolon", "onlySelectValue"], outputs: ["searchValueChange", "createCriterion", "createCriterionByName", "backspaceOverflow", "createFreeTextPill", "inputFocus", "enterSubmit"] }, { kind: "component", type: SiFilteredSearchValueComponent, selector: "si-filtered-search-value", inputs: ["value", "definition", "disabled", "onlySelectValue", "maxCriteriaOptions", "optionsInScrollableView", "clearButtonLabel", "lazyValueProvider", "searchDebounceTime", "itemCountText", "disableSelectionByColonAndSemicolon", "searchLabel", "invalidCriterion", "isStrictOrOnlySelectValue", "editOnCreation"], outputs: ["valueChange", "deleteCriterion", "submitCriterion"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
1203
1236
|
}
|
|
1204
1237
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiFilteredSearchComponent, decorators: [{
|
|
1205
1238
|
type: Component,
|
|
1206
1239
|
args: [{ selector: 'si-filtered-search', imports: [
|
|
1207
|
-
FormsModule,
|
|
1208
1240
|
SiIconComponent,
|
|
1209
|
-
SiTypeaheadDirective,
|
|
1210
1241
|
SiTranslatePipe,
|
|
1242
|
+
SiFilteredSearchInputComponent,
|
|
1211
1243
|
SiFilteredSearchValueComponent
|
|
1212
1244
|
], host: {
|
|
1213
1245
|
'[class.disabled]': 'disabled()',
|
|
1214
1246
|
'[class.dark-background]': "colorVariant() === 'base-0'"
|
|
1215
|
-
}, template: "<div\n #scrollContainer\n class=\"search-container d-flex align-items-center overflow-auto py-2 w-100 ps-2 pe-2\"\n>\n @for (criterion of values(); track criterion) {\n <si-filtered-search-value\n [editOnCreation]=\"autoEditCriteria\"\n [definition]=\"criterion.config\"\n [value]=\"criterion.value\"\n [invalidCriterion]=\"!validateCriterionLabel(criterion.config)\"\n [disabled]=\"disabled()\"\n [clearButtonLabel]=\"clearButtonLabel()\"\n [disableSelectionByColonAndSemicolon]=\"disableSelectionByColonAndSemicolon()\"\n [isStrictOrOnlySelectValue]=\"isStrictOrOnlySelectValue()\"\n [itemCountText]=\"itemCountText()\"\n [lazyValueProvider]=\"lazyValueProvider()\"\n [maxCriteriaOptions]=\"maxCriteriaOptions()\"\n [optionsInScrollableView]=\"optionsInScrollableView()\"\n [searchLabel]=\"searchLabel()\"\n [onlySelectValue]=\"onlySelectValue()\"\n [searchDebounceTime]=\"searchDebounceTime()\"\n (submitCriterion)=\"focusNext($index, $event)\"\n (deleteCriterion)=\"deleteCriterion($index, $event)\"\n (valueChange)=\"valueChange($event, criterion)\"\n />\n }\n <!-- criterion input -->\n <
|
|
1216
|
-
}], ctorParameters: () => [], propDecorators: { doSearch: [{ type: i0.Output, args: ["doSearch"] }], doSearchOnInputChange: [{ type: i0.Input, args: [{ isSignal: true, alias: "doSearchOnInputChange", required: false }] }], lazyCriterionProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyCriterionProvider", required: false }] }], lazyValueProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyValueProvider", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], strictCriterion: [{ type: i0.Input, args: [{ isSignal: true, alias: "strictCriterion", required: false }] }], strictValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "strictValue", required: false }] }], onlySelectValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "onlySelectValue", required: false }] }], lazyLoadingDebounceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyLoadingDebounceTime", required: false }] }], searchDebounceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchDebounceTime", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], optionsInScrollableView: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsInScrollableView", required: false }] }], searchCriteria: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchCriteria", required: false }] }, { type: i0.Output, args: ["searchCriteriaChange"] }], criteria: [{ type: i0.Input, args: [{ isSignal: true, alias: "criteria", required: false }] }], exclusiveCriteria: [{ type: i0.Input, args: [{ isSignal: true, alias: "exclusiveCriteria", required: false }] }], maxCriteria: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxCriteria", required: false }] }], maxCriteriaOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxCriteriaOptions", required: false }] }], searchLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchLabel", required: false }] }], clearButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearButtonLabel", required: false }] }], submitButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "submitButtonLabel", required: false }] }], itemCountText: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemCountText", required: false }] }], colorVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "colorVariant", required: false }] }], disableFreeTextSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableFreeTextSearch", required: false }] }], typeaheadOptionsLimit: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadOptionsLimit", required: false }] }], disableSelectionByColonAndSemicolon: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSelectionByColonAndSemicolon", required: false }] }], freeTextCriterion: [{ type: i0.Input, args: [{ isSignal: true, alias: "freeTextCriterion", required: false }] }], searchForFreeTextLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchForFreeTextLabel", required: false }] }], interceptDisplayedCriteria: [{ type: i0.Output, args: ["interceptDisplayedCriteria"] }],
|
|
1247
|
+
}, template: "<div\n #scrollContainer\n class=\"search-container d-flex align-items-center overflow-auto py-2 w-100 ps-2 pe-2\"\n>\n @for (criterion of values(); track criterion) {\n <si-filtered-search-value\n [editOnCreation]=\"autoEditCriteria\"\n [definition]=\"criterion.config\"\n [value]=\"criterion.value\"\n [invalidCriterion]=\"!validateCriterionLabel(criterion.config)\"\n [disabled]=\"disabled()\"\n [clearButtonLabel]=\"clearButtonLabel()\"\n [disableSelectionByColonAndSemicolon]=\"disableSelectionByColonAndSemicolon()\"\n [isStrictOrOnlySelectValue]=\"isStrictOrOnlySelectValue()\"\n [itemCountText]=\"itemCountText()\"\n [lazyValueProvider]=\"lazyValueProvider()\"\n [maxCriteriaOptions]=\"maxCriteriaOptions()\"\n [optionsInScrollableView]=\"optionsInScrollableView()\"\n [searchLabel]=\"searchLabel()\"\n [onlySelectValue]=\"onlySelectValue()\"\n [searchDebounceTime]=\"searchDebounceTime()\"\n (submitCriterion)=\"focusNext($index, $event)\"\n (deleteCriterion)=\"deleteCriterion($index, $event)\"\n (valueChange)=\"valueChange($event, criterion)\"\n />\n }\n <!-- criterion input -->\n <si-filtered-search-input\n [dataSource]=\"dataSource\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit()\"\n [optionsInScrollableView]=\"optionsInScrollableView()\"\n [disabled]=\"disabled()\"\n [placeholder]=\"placeholder()\"\n [searchLabel]=\"searchLabel()\"\n [freeTextCriterion]=\"!!freeTextCriterion()\"\n [maxCriteriaReached]=\"!!maxCriteria() && values().length >= maxCriteria()!\"\n [allowFreeText]=\"allowFreeTextCache()\"\n [searchForFreeTextLabel]=\"searchForFreeTextLabel()\"\n [disableSelectionByColonAndSemicolon]=\"disableSelectionByColonAndSemicolon()\"\n [onlySelectValue]=\"onlySelectValue()\"\n [(searchValue)]=\"searchValue\"\n (createCriterion)=\"onCreateCriterion($event)\"\n (createCriterionByName)=\"onCreateCriterionByName($event)\"\n (backspaceOverflow)=\"freeTextBackspace()\"\n (createFreeTextPill)=\"createFreeTextPill($event)\"\n (searchValueChange)=\"onSearchValueChange($event)\"\n (inputFocus)=\"freeTextFocus()\"\n (enterSubmit)=\"submit()\"\n />\n</div>\n<!-- clear all searchCriteria -->\n@if (values().length || searchValue().length) {\n <div class=\"clear-button-container\">\n <button\n type=\"button\"\n class=\"btn btn-icon btn-sm btn-ghost mx-2\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"clearButtonLabel() | translate\"\n (click)=\"deleteAllCriteria($event)\"\n >\n <si-icon [icon]=\"icons.elementCancel\" />\n </button>\n </div>\n}\n\n@if (!disabled()) {\n <button\n type=\"button\"\n class=\"search-button btn btn-icon btn-sm btn-secondary focus-inside\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"submitButtonLabel() | translate\"\n (click)=\"submit()\"\n >\n <si-icon [icon]=\"icons.elementSearch\" />\n </button>\n}\n", styles: [":host{--search-bar-icon-color: var(--element-text-primary);--input-background-color: var(--element-base-1);--input-background-hover-color: var(--element-base-1);--filter-search-background-color: var(--element-base-1);--filter-pill-background-color: var(--element-base-4)}:host.dark-background{--input-background-color: var(--element-base-4);--input-background-hover-color: var(--element-ui-4);--filter-search-background-color: var(--element-base-4);--filter-pill-background-color: var(--element-base-1)}:host{display:flex;align-items:center;line-height:24px;min-inline-size:0}:host.disabled{color:var(--element-text-disabled)}.search-container{border-start-start-radius:4px;border-end-start-radius:4px;background-color:var(--filter-search-background-color);gap:4px}.clear-button-container{display:flex;align-items:flex-start;align-self:stretch;padding-block:4px;background-color:var(--filter-search-background-color)}.search-button{align-self:stretch;background-color:var(--filter-search-background-color);border:0;border-radius:0;border-end-end-radius:4px;border-start-end-radius:4px;margin-block:0;margin-inline:1px 0;block-size:auto;inline-size:auto;padding-inline:4px!important}\n"] }]
|
|
1248
|
+
}], ctorParameters: () => [], propDecorators: { doSearch: [{ type: i0.Output, args: ["doSearch"] }], doSearchOnInputChange: [{ type: i0.Input, args: [{ isSignal: true, alias: "doSearchOnInputChange", required: false }] }], lazyCriterionProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyCriterionProvider", required: false }] }], lazyValueProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyValueProvider", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], strictCriterion: [{ type: i0.Input, args: [{ isSignal: true, alias: "strictCriterion", required: false }] }], strictValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "strictValue", required: false }] }], onlySelectValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "onlySelectValue", required: false }] }], lazyLoadingDebounceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyLoadingDebounceTime", required: false }] }], searchDebounceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchDebounceTime", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], optionsInScrollableView: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsInScrollableView", required: false }] }], searchCriteria: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchCriteria", required: false }] }, { type: i0.Output, args: ["searchCriteriaChange"] }], criteria: [{ type: i0.Input, args: [{ isSignal: true, alias: "criteria", required: false }] }], exclusiveCriteria: [{ type: i0.Input, args: [{ isSignal: true, alias: "exclusiveCriteria", required: false }] }], maxCriteria: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxCriteria", required: false }] }], maxCriteriaOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxCriteriaOptions", required: false }] }], searchLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchLabel", required: false }] }], clearButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearButtonLabel", required: false }] }], submitButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "submitButtonLabel", required: false }] }], itemCountText: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemCountText", required: false }] }], colorVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "colorVariant", required: false }] }], disableFreeTextSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableFreeTextSearch", required: false }] }], typeaheadOptionsLimit: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadOptionsLimit", required: false }] }], disableSelectionByColonAndSemicolon: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSelectionByColonAndSemicolon", required: false }] }], freeTextCriterion: [{ type: i0.Input, args: [{ isSignal: true, alias: "freeTextCriterion", required: false }] }], searchForFreeTextLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchForFreeTextLabel", required: false }] }], interceptDisplayedCriteria: [{ type: i0.Output, args: ["interceptDisplayedCriteria"] }], freeTextInput: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SiFilteredSearchInputComponent), { isSignal: true }] }], scrollContainer: [{ type: i0.ViewChild, args: ['scrollContainer', { ...{ read: ElementRef }, isSignal: true }] }], valueComponents: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => SiFilteredSearchValueComponent), { isSignal: true }] }] } });
|
|
1217
1249
|
|
|
1218
1250
|
/**
|
|
1219
1251
|
* Copyright (c) Siemens 2016 - 2026
|