@siemens/element-ng 48.0.3 → 48.2.0-rc.1
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/README.md +9 -0
- package/accordion/index.d.ts +2 -1
- package/avatar/index.d.ts +3 -4
- package/card/index.d.ts +68 -29
- package/circle-status/index.d.ts +2 -1
- package/common/index.d.ts +11 -0
- package/dashboard/index.d.ts +6 -1
- package/datepicker/index.d.ts +32 -32
- package/fesm2022/siemens-element-ng-accordion.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-avatar.mjs +32 -36
- package/fesm2022/siemens-element-ng-avatar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-breadcrumb.mjs +2 -2
- package/fesm2022/siemens-element-ng-breadcrumb.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-card.mjs +103 -37
- package/fesm2022/siemens-element-ng-card.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-circle-status.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-column-selection-dialog.mjs +2 -2
- package/fesm2022/siemens-element-ng-column-selection-dialog.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-common.mjs +6 -0
- package/fesm2022/siemens-element-ng-common.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-connection-strength.mjs +2 -2
- package/fesm2022/siemens-element-ng-connection-strength.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-content-action-bar.mjs +2 -2
- package/fesm2022/siemens-element-ng-content-action-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-dashboard.mjs +34 -35
- package/fesm2022/siemens-element-ng-dashboard.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-datatable.mjs +5 -0
- package/fesm2022/siemens-element-ng-datatable.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-date-range-filter.mjs +1 -1
- package/fesm2022/siemens-element-ng-date-range-filter.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-datepicker.mjs +176 -142
- package/fesm2022/siemens-element-ng-datepicker.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-file-uploader.mjs +9 -2
- package/fesm2022/siemens-element-ng-file-uploader.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-filter-bar.mjs +5 -5
- package/fesm2022/siemens-element-ng-filter-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-filtered-search.mjs +34 -13
- package/fesm2022/siemens-element-ng-filtered-search.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-form.mjs +7 -1
- package/fesm2022/siemens-element-ng-form.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-formly.mjs +18 -18
- package/fesm2022/siemens-element-ng-formly.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-inline-notification.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-ip-input.mjs +38 -0
- package/fesm2022/siemens-element-ng-ip-input.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-language-switcher.mjs +1 -1
- package/fesm2022/siemens-element-ng-language-switcher.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-list-details.mjs +9 -4
- package/fesm2022/siemens-element-ng-list-details.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-main-detail-container.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-navbar-vertical.mjs +16 -3
- package/fesm2022/siemens-element-ng-navbar-vertical.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-notification-item.mjs +71 -0
- package/fesm2022/siemens-element-ng-notification-item.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-pagination.mjs +2 -2
- package/fesm2022/siemens-element-ng-pagination.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-photo-upload.mjs +1 -1
- package/fesm2022/siemens-element-ng-photo-upload.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-progressbar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-resize-observer.mjs +0 -1
- package/fesm2022/siemens-element-ng-resize-observer.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-result-details-list.mjs +5 -0
- package/fesm2022/siemens-element-ng-result-details-list.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-search-bar.mjs +14 -4
- package/fesm2022/siemens-element-ng-search-bar.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-sort-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-split.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-status-bar.mjs +2 -2
- package/fesm2022/siemens-element-ng-status-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tabs-legacy.mjs +2 -2
- package/fesm2022/siemens-element-ng-tabs-legacy.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tabs.mjs +45 -12
- package/fesm2022/siemens-element-ng-tabs.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tooltip.mjs +5 -6
- package/fesm2022/siemens-element-ng-tooltip.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-translate.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tree-view.mjs +4 -4
- package/fesm2022/siemens-element-ng-tree-view.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-typeahead.mjs +329 -257
- package/fesm2022/siemens-element-ng-typeahead.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-wizard.mjs.map +1 -1
- package/file-uploader/index.d.ts +3 -1
- package/filter-bar/index.d.ts +13 -5
- package/form/index.d.ts +28 -29
- package/inline-notification/index.d.ts +3 -2
- package/ip-input/index.d.ts +42 -4
- package/landing-page/index.d.ts +3 -2
- package/language-switcher/index.d.ts +3 -1
- package/list-details/index.d.ts +2 -0
- package/main-detail-container/index.d.ts +4 -4
- package/navbar/index.d.ts +1 -1
- package/notification-item/index.d.ts +141 -0
- package/notification-item/package.json +3 -0
- package/package.json +19 -11
- package/progressbar/index.d.ts +3 -3
- package/result-details-list/index.d.ts +4 -2
- package/schematics/collection.json +28 -0
- package/schematics/ng-add/index.js +16 -0
- package/schematics/ng-add/schema.json +16 -0
- package/schematics/scss-import-to-siemens-migration/index.js +101 -0
- package/schematics/scss-import-to-siemens-migration/schema.json +16 -0
- package/schematics/scss-import-to-siemens-migration/style-mappings.js +46 -0
- package/schematics/simpl-siemens-migration/index.js +17 -0
- package/schematics/simpl-siemens-migration/schema.json +16 -0
- package/schematics/ts-import-to-siemens-migration/index.js +118 -0
- package/schematics/ts-import-to-siemens-migration/mappings/charts-ng-mappings.js +70 -0
- package/schematics/ts-import-to-siemens-migration/mappings/dashboards-ng-mappings.js +52 -0
- package/schematics/ts-import-to-siemens-migration/mappings/element-ng-mappings.js +651 -0
- package/schematics/ts-import-to-siemens-migration/mappings/element-translate-ng-mappings.js +21 -0
- package/schematics/ts-import-to-siemens-migration/mappings/index.js +9 -0
- package/schematics/ts-import-to-siemens-migration/mappings/maps-ng-mappings.js +46 -0
- package/schematics/ts-import-to-siemens-migration/model.js +4 -0
- package/schematics/ts-import-to-siemens-migration/schema.json +16 -0
- package/schematics/utils/index.js +8 -0
- package/schematics/utils/project-utils.js +75 -0
- package/schematics/utils/schematics-file-system.js +22 -0
- package/schematics/utils/testing.js +41 -0
- package/schematics/utils/ts-utils.js +99 -0
- package/search-bar/index.d.ts +11 -1
- package/select/index.d.ts +7 -5
- package/sort-bar/index.d.ts +3 -3
- package/split/index.d.ts +3 -2
- package/status-bar/index.d.ts +3 -2
- package/tabs/index.d.ts +15 -1
- package/template-i18n.json +8 -0
- package/tooltip/index.d.ts +1 -1
- package/translate/index.d.ts +8 -0
- package/tree-view/index.d.ts +4 -4
- package/typeahead/index.d.ts +85 -4
- package/wizard/index.d.ts +2 -1
|
@@ -6,7 +6,7 @@ import { isRTL } from '@siemens/element-ng/common';
|
|
|
6
6
|
import { addIcons, elementCancel, SiIconComponent, elementSearch } from '@siemens/element-ng/icon';
|
|
7
7
|
import { SiTypeaheadDirective } from '@siemens/element-ng/typeahead';
|
|
8
8
|
import * as i1$1 from '@siemens/element-translate-ng/translate';
|
|
9
|
-
import { SiTranslatePipe,
|
|
9
|
+
import { SiTranslatePipe, injectSiTranslateService, SiTranslateModule, t } from '@siemens/element-translate-ng/translate';
|
|
10
10
|
import { BehaviorSubject, switchMap, of, Subject } from 'rxjs';
|
|
11
11
|
import { debounceTime, map, tap, first, takeUntil } from 'rxjs/operators';
|
|
12
12
|
import { formatDate, DatePipe } from '@angular/common';
|
|
@@ -154,13 +154,13 @@ class SiFilteredSearchDateValueComponent extends SiFilteredSearchValueBase {
|
|
|
154
154
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SiFilteredSearchDateValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
155
155
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: SiFilteredSearchDateValueComponent, isStandalone: true, selector: "si-filtered-search-date-value", providers: [
|
|
156
156
|
{ provide: SiFilteredSearchValueBase, useExisting: SiFilteredSearchDateValueComponent }
|
|
157
|
-
], viewQueries: [{ propertyName: "valueInput", first: true, predicate: ["valueInput"], descendants: true, isSignal: true }, { propertyName: "datepickerOverlay", first: true, predicate: SiDatepickerOverlayDirective, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@let dateValue = criterionValue().dateValue;\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 @if (!validFormat()) {\n <!-- DatePipe throws an error if the date is invalid, so we have to do it on our own. -->\n <!-- We may should have a better solution here. Ideally we would keep the broken string so that a user can fix it later. -->\n
|
|
157
|
+
], viewQueries: [{ propertyName: "valueInput", first: true, predicate: ["valueInput"], descendants: true, isSignal: true }, { propertyName: "datepickerOverlay", first: true, predicate: SiDatepickerOverlayDirective, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@let dateValue = criterionValue().dateValue;\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 @if (!validFormat()) {\n <!-- DatePipe throws an error if the date is invalid, so we have to do it on our own. -->\n <!-- We may should have a better solution here. Ideally we would keep the broken string so that a user can fix it later. -->\n\n {{ $any(dateValue)?.toString() }}\n } @else if (!disableTime() || definition().validationType === 'date-time') {\n {{ dateValue | date: dateFormat() }}\n } @else {\n {{ dateValue | date: shortDateFormat }}\n }\n </div>\n} @else {\n <input\n #valueInput\n type=\"text\"\n siDatepicker\n class=\"px-4 py-0 border-0 focus-inside\"\n [attr.aria-label]=\"searchLabel() | translate\"\n [siDatepickerConfig]=\"dateConfig()\"\n [ngModel]=\"dateValue\"\n (keydown.backspace)=\"valueBackspace()\"\n (keydown.enter)=\"valueEnter()\"\n (siDatepickerDisabledTime)=\"disableTime.set($event)\"\n (ngModelChange)=\"valueDateSelect($event)\"\n />\n}\n", styles: ["input{background:transparent}\n"], dependencies: [{ kind: "pipe", type: DatePipe, name: "date" }, { 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: "directive", type: SiDatepickerDirective, selector: "[siDatepicker]", inputs: ["autoClose"], exportAs: ["siDatepicker"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
158
158
|
}
|
|
159
159
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SiFilteredSearchDateValueComponent, decorators: [{
|
|
160
160
|
type: Component,
|
|
161
161
|
args: [{ selector: 'si-filtered-search-date-value', imports: [DatePipe, FormsModule, SiDatepickerDirective, SiTranslatePipe], providers: [
|
|
162
162
|
{ provide: SiFilteredSearchValueBase, useExisting: SiFilteredSearchDateValueComponent }
|
|
163
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let dateValue = criterionValue().dateValue;\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 @if (!validFormat()) {\n <!-- DatePipe throws an error if the date is invalid, so we have to do it on our own. -->\n <!-- We may should have a better solution here. Ideally we would keep the broken string so that a user can fix it later. -->\n
|
|
163
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let dateValue = criterionValue().dateValue;\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 @if (!validFormat()) {\n <!-- DatePipe throws an error if the date is invalid, so we have to do it on our own. -->\n <!-- We may should have a better solution here. Ideally we would keep the broken string so that a user can fix it later. -->\n\n {{ $any(dateValue)?.toString() }}\n } @else if (!disableTime() || definition().validationType === 'date-time') {\n {{ dateValue | date: dateFormat() }}\n } @else {\n {{ dateValue | date: shortDateFormat }}\n }\n </div>\n} @else {\n <input\n #valueInput\n type=\"text\"\n siDatepicker\n class=\"px-4 py-0 border-0 focus-inside\"\n [attr.aria-label]=\"searchLabel() | translate\"\n [siDatepickerConfig]=\"dateConfig()\"\n [ngModel]=\"dateValue\"\n (keydown.backspace)=\"valueBackspace()\"\n (keydown.enter)=\"valueEnter()\"\n (siDatepickerDisabledTime)=\"disableTime.set($event)\"\n (ngModelChange)=\"valueDateSelect($event)\"\n />\n}\n", styles: ["input{background:transparent}\n"] }]
|
|
164
164
|
}], ctorParameters: () => [] });
|
|
165
165
|
|
|
166
166
|
/**
|
|
@@ -178,7 +178,7 @@ class SiFilteredSearchOptionValueBase extends SiFilteredSearchValueBase {
|
|
|
178
178
|
isStrictOrOnlySelectValue = input.required();
|
|
179
179
|
inputChange = new BehaviorSubject('');
|
|
180
180
|
destroyRef = inject(DestroyRef);
|
|
181
|
-
translateService =
|
|
181
|
+
translateService = injectSiTranslateService();
|
|
182
182
|
inputType = computed(() => this.definition().validationType === 'integer' || this.definition().validationType === 'float'
|
|
183
183
|
? 'number'
|
|
184
184
|
: 'text');
|
|
@@ -271,12 +271,9 @@ class SiFilteredSearchMultiSelectComponent extends SiFilteredSearchOptionValueBa
|
|
|
271
271
|
}
|
|
272
272
|
buildOptions() {
|
|
273
273
|
const translatedOptions = super.buildOptions();
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
else {
|
|
278
|
-
return translatedOptions;
|
|
279
|
-
}
|
|
274
|
+
return translatedOptions?.pipe(switchMap(options => this.selectionChange.pipe(tap(value => {
|
|
275
|
+
selectOptions(options, value);
|
|
276
|
+
}), map(() => options))));
|
|
280
277
|
}
|
|
281
278
|
processTypeaheadOptions(options) {
|
|
282
279
|
const value = this.criterionValue().value;
|
|
@@ -294,13 +291,13 @@ class SiFilteredSearchMultiSelectComponent extends SiFilteredSearchOptionValueBa
|
|
|
294
291
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SiFilteredSearchMultiSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
295
292
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: SiFilteredSearchMultiSelectComponent, isStandalone: true, selector: "si-filtered-search-multi-select", inputs: { itemCountText: { classPropertyName: "itemCountText", publicName: "itemCountText", isSignal: true, isRequired: true, transformFunction: null } }, providers: [
|
|
296
293
|
{ provide: SiFilteredSearchValueBase, useExisting: SiFilteredSearchMultiSelectComponent }
|
|
297
|
-
], 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 @if (!!value && hasMultiSelections()) {\n {{ itemCountText() | translate: { itemCount: value.length } }}\n } @else if (optionValue()[0]) {\n {{ optionValue()[0].label ?? optionValue()[0].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 typeaheadMultiSelect\n [type]=\"inputType()\"\n [step]=\"step()\"\n [siTypeahead]=\"options() ?? []\"\n [typeaheadMinLength]=\"0\"\n [typeaheadOptionsLimit]=\"maxCriteriaOptions()\"\n [readOnly]=\"readonly() || onlySelectValue()\"\n [typeaheadOptionsInScrollableView]=\"optionsInScrollableView()\"\n [attr.aria-label]=\"searchLabel() | translate\"\n (keydown.backspace)=\"valueBackspace()\"\n (keydown.enter)=\"valueEnter()\"\n (typeaheadOnSelect)=\"valueTypeaheadSelect($event)\"\n />\n}\n", styles: ["input{background:transparent}\n"], dependencies: [{ kind: "ngmodule", type: SiTranslateModule }, { kind: "pipe", type: i1$1.SiTranslatePipe, name: "translate" }, { 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"], outputs: ["typeaheadOnInput", "typeaheadOnSelect", "typeaheadOnFullMatch", "typeaheadOpenChange"], exportAs: ["si-typeahead"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
294
|
+
], 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 @if (!!value && hasMultiSelections()) {\n {{ itemCountText() | translate: { itemCount: value.length } }}\n } @else if (optionValue()[0]) {\n {{ optionValue()[0].label ?? optionValue()[0].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 typeaheadMultiSelect\n [type]=\"inputType()\"\n [step]=\"step()\"\n [siTypeahead]=\"options() ?? []\"\n [typeaheadMinLength]=\"0\"\n [typeaheadOptionsLimit]=\"maxCriteriaOptions()\"\n [readOnly]=\"readonly() || onlySelectValue()\"\n [typeaheadOptionsInScrollableView]=\"optionsInScrollableView()\"\n [attr.aria-label]=\"searchLabel() | translate\"\n (keydown.backspace)=\"valueBackspace()\"\n (keydown.enter)=\"valueEnter()\"\n (typeaheadOnSelect)=\"valueTypeaheadSelect($event)\"\n (typeaheadOnInput)=\"inputChange.next($event)\"\n />\n}\n", styles: ["input{background:transparent}\n"], dependencies: [{ kind: "ngmodule", type: SiTranslateModule }, { kind: "pipe", type: i1$1.SiTranslatePipe, name: "translate" }, { 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"], outputs: ["typeaheadOnInput", "typeaheadOnSelect", "typeaheadOnFullMatch", "typeaheadOpenChange"], exportAs: ["si-typeahead"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
298
295
|
}
|
|
299
296
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SiFilteredSearchMultiSelectComponent, decorators: [{
|
|
300
297
|
type: Component,
|
|
301
298
|
args: [{ selector: 'si-filtered-search-multi-select', imports: [SiTranslateModule, SiTypeaheadDirective], providers: [
|
|
302
299
|
{ provide: SiFilteredSearchValueBase, useExisting: SiFilteredSearchMultiSelectComponent }
|
|
303
|
-
], 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 @if (!!value && hasMultiSelections()) {\n {{ itemCountText() | translate: { itemCount: value.length } }}\n } @else if (optionValue()[0]) {\n {{ optionValue()[0].label ?? optionValue()[0].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 typeaheadMultiSelect\n [type]=\"inputType()\"\n [step]=\"step()\"\n [siTypeahead]=\"options() ?? []\"\n [typeaheadMinLength]=\"0\"\n [typeaheadOptionsLimit]=\"maxCriteriaOptions()\"\n [readOnly]=\"readonly() || onlySelectValue()\"\n [typeaheadOptionsInScrollableView]=\"optionsInScrollableView()\"\n [attr.aria-label]=\"searchLabel() | translate\"\n (keydown.backspace)=\"valueBackspace()\"\n (keydown.enter)=\"valueEnter()\"\n (typeaheadOnSelect)=\"valueTypeaheadSelect($event)\"\n />\n}\n", styles: ["input{background:transparent}\n"] }]
|
|
300
|
+
], 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 @if (!!value && hasMultiSelections()) {\n {{ itemCountText() | translate: { itemCount: value.length } }}\n } @else if (optionValue()[0]) {\n {{ optionValue()[0].label ?? optionValue()[0].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 typeaheadMultiSelect\n [type]=\"inputType()\"\n [step]=\"step()\"\n [siTypeahead]=\"options() ?? []\"\n [typeaheadMinLength]=\"0\"\n [typeaheadOptionsLimit]=\"maxCriteriaOptions()\"\n [readOnly]=\"readonly() || onlySelectValue()\"\n [typeaheadOptionsInScrollableView]=\"optionsInScrollableView()\"\n [attr.aria-label]=\"searchLabel() | translate\"\n (keydown.backspace)=\"valueBackspace()\"\n (keydown.enter)=\"valueEnter()\"\n (typeaheadOnSelect)=\"valueTypeaheadSelect($event)\"\n (typeaheadOnInput)=\"inputChange.next($event)\"\n />\n}\n", styles: ["input{background:transparent}\n"] }]
|
|
304
301
|
}] });
|
|
305
302
|
|
|
306
303
|
/**
|
|
@@ -310,10 +307,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
310
307
|
class SiFilteredSearchTypeaheadComponent extends SiFilteredSearchOptionValueBase {
|
|
311
308
|
valueInput = viewChild('valueInput');
|
|
312
309
|
optionValue = signal(undefined);
|
|
310
|
+
// This must be a separate signal as it should only emit when the actual empty state changes.
|
|
311
|
+
inputEmpty = computed(() => !this.criterionValue().value);
|
|
313
312
|
// This MUST only be updated if the active state changes.
|
|
314
313
|
// Otherwise, user values might be overridden.
|
|
315
314
|
// It is only used to pass the initial input value if the user starts editing the input.
|
|
316
315
|
valueLabel = computed(() => {
|
|
316
|
+
// This is needed for the clear button.
|
|
317
|
+
// But we cannot subscribe to the value changes itself, as those would cause to many updates.
|
|
318
|
+
if (this.inputEmpty()) {
|
|
319
|
+
return '';
|
|
320
|
+
}
|
|
317
321
|
if (this.active()) {
|
|
318
322
|
const option = untracked(() => this.optionValue());
|
|
319
323
|
if (option) {
|
|
@@ -325,6 +329,11 @@ class SiFilteredSearchTypeaheadComponent extends SiFilteredSearchOptionValueBase
|
|
|
325
329
|
}
|
|
326
330
|
return '';
|
|
327
331
|
});
|
|
332
|
+
ngOnChanges(changes) {
|
|
333
|
+
if (changes.criterionValue && this.criterionValue().value !== this.optionValue()?.value) {
|
|
334
|
+
this.optionValue.set(undefined);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
328
337
|
ngOnInit() {
|
|
329
338
|
this.inputChange.next(this.criterionValue().value ?? '');
|
|
330
339
|
this.buildOptionValue();
|
|
@@ -387,7 +396,7 @@ class SiFilteredSearchTypeaheadComponent extends SiFilteredSearchOptionValueBase
|
|
|
387
396
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SiFilteredSearchTypeaheadComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
388
397
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: SiFilteredSearchTypeaheadComponent, isStandalone: true, selector: "si-filtered-search-typeahead", providers: [
|
|
389
398
|
{ provide: SiFilteredSearchValueBase, useExisting: SiFilteredSearchTypeaheadComponent }
|
|
390
|
-
], viewQueries: [{ propertyName: "valueInput", first: true, predicate: ["valueInput"], descendants: true, isSignal: true }], usesInheritance: 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 [ngModel]=\"valueLabel()\"\n [siTypeahead]=\"options() ?? []\"\n [typeaheadProcess]=\"!onlySelectValue()\"\n [typeaheadMinLength]=\"0\"\n [typeaheadOptionsLimit]=\"maxCriteriaOptions()\"\n [typeaheadAutoSelectIndex]=\"value?.length ? 0 : -1\"\n [readOnly]=\"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 (ngModelChange)=\"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"], outputs: ["typeaheadOnInput", "typeaheadOnSelect", "typeaheadOnFullMatch", "typeaheadOpenChange"], 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: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
399
|
+
], 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 [ngModel]=\"valueLabel()\"\n [siTypeahead]=\"options() ?? []\"\n [typeaheadProcess]=\"!onlySelectValue()\"\n [typeaheadMinLength]=\"0\"\n [typeaheadOptionsLimit]=\"maxCriteriaOptions()\"\n [typeaheadAutoSelectIndex]=\"value?.length ? 0 : -1\"\n [readOnly]=\"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 (ngModelChange)=\"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"], outputs: ["typeaheadOnInput", "typeaheadOnSelect", "typeaheadOnFullMatch", "typeaheadOpenChange"], 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: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
391
400
|
}
|
|
392
401
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SiFilteredSearchTypeaheadComponent, decorators: [{
|
|
393
402
|
type: Component,
|
|
@@ -453,6 +462,11 @@ class SiFilteredSearchValueComponent {
|
|
|
453
462
|
this.edit();
|
|
454
463
|
}
|
|
455
464
|
}
|
|
465
|
+
closeOverlay() {
|
|
466
|
+
if (this.active()) {
|
|
467
|
+
this.active.set(false);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
456
470
|
edit(field) {
|
|
457
471
|
if (this.readonly()) {
|
|
458
472
|
return;
|
|
@@ -889,6 +903,13 @@ class SiFilteredSearchComponent {
|
|
|
889
903
|
if (this.isReadOnly()) {
|
|
890
904
|
return;
|
|
891
905
|
}
|
|
906
|
+
// Close any active overlays before deleting the criterion
|
|
907
|
+
// This could happen in case when user has opened a multiselect pill
|
|
908
|
+
// and then clicks on clear button of other pill.
|
|
909
|
+
this.valueComponents().forEach(component => {
|
|
910
|
+
component.closeOverlay();
|
|
911
|
+
});
|
|
912
|
+
this.cdRef.detectChanges();
|
|
892
913
|
this.values = this.values.filter(v => v.value !== criterion);
|
|
893
914
|
this.emitChangeEvent();
|
|
894
915
|
this.allowedCriteriaCache = undefined;
|