@quadrel-enterprise-ui/framework 20.26.2 → 20.27.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/quadrel-enterprise-ui-framework.mjs +273 -49
- package/fesm2022/quadrel-enterprise-ui-framework.mjs.map +1 -1
- package/index.d.ts +177 -50
- package/package.json +1 -1
- package/src/assets/i18n/de.json +2 -0
- package/src/assets/i18n/en.json +2 -2
- package/src/assets/i18n/fr.json +2 -2
- package/src/assets/i18n/it.json +2 -2
|
@@ -3,7 +3,7 @@ import { inject, ElementRef, Directive, InjectionToken, HostBinding, Input, View
|
|
|
3
3
|
import { Dialog, DialogRef, DialogModule } from '@angular/cdk/dialog';
|
|
4
4
|
import * as i1 from '@angular/common';
|
|
5
5
|
import { CommonModule, NgFor, NgIf, NgClass, NgTemplateOutlet, AsyncPipe } from '@angular/common';
|
|
6
|
-
import { BehaviorSubject, pairwise, from, switchMap, map as map$1, Subject, throwError, of, ReplaySubject, merge, fromEvent, isObservable, NEVER, Observable, EMPTY, shareReplay, Subscription, distinctUntilChanged as distinctUntilChanged$1, debounce, timer, startWith as startWith$1, debounceTime as debounceTime$1, takeUntil as takeUntil$1, firstValueFrom, combineLatest, concat, take as take$1,
|
|
6
|
+
import { BehaviorSubject, pairwise, from, switchMap, map as map$1, Subject, throwError, of, ReplaySubject, merge, fromEvent, isObservable, NEVER, Observable, EMPTY, shareReplay, Subscription, distinctUntilChanged as distinctUntilChanged$1, debounce, timer, startWith as startWith$1, debounceTime as debounceTime$1, takeUntil as takeUntil$1, firstValueFrom, combineLatest, concat, take as take$1, tap as tap$1, delay, first, scan, queueScheduler, filter as filter$1, concatMap as concatMap$1, exhaustMap, finalize, forkJoin, delayWhen, combineLatestWith, withLatestFrom as withLatestFrom$1, async } from 'rxjs';
|
|
7
7
|
import { map, takeUntil, take, filter, catchError, debounceTime, startWith, distinctUntilChanged, concatMap, skip, tap, auditTime, withLatestFrom, observeOn, switchMap as switchMap$1, pairwise as pairwise$1, mergeMap, delay as delay$1 } from 'rxjs/operators';
|
|
8
8
|
import { v4 } from 'uuid';
|
|
9
9
|
import * as i3 from '@ngx-translate/core';
|
|
@@ -2739,6 +2739,7 @@ class QdMockFilterItemDateRangeComponent {
|
|
|
2739
2739
|
get dataTestId() {
|
|
2740
2740
|
return this.testId;
|
|
2741
2741
|
}
|
|
2742
|
+
open() { }
|
|
2742
2743
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdMockFilterItemDateRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2743
2744
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdMockFilterItemDateRangeComponent, isStandalone: false, selector: "qd-filter-item-date-range", inputs: { filterId: "filterId", categoryIndex: "categoryIndex", itemIndex: "itemIndex", timePickerConfig: "timePickerConfig", testId: ["data-test-id", "testId"] }, host: { properties: { "attr.data-test-id": "this.dataTestId" } }, ngImport: i0, template: 'filterId: {{filterId}}, categoryIndex: {{categoryIndex}}, itemIndex: {{itemIndex}}, timePickerConfig: {{timePickerConfig | json}}', isInline: true, dependencies: [{ kind: "pipe", type: i1.JsonPipe, name: "json" }] });
|
|
2744
2745
|
}
|
|
@@ -2891,6 +2892,7 @@ class QdMockFilterService {
|
|
|
2891
2892
|
postBodyWithEmptyDefaultSubjects = [];
|
|
2892
2893
|
categoryByIdSubject = [];
|
|
2893
2894
|
itemByIdSubject = [];
|
|
2895
|
+
loadingSubject = [];
|
|
2894
2896
|
initializeFilterState() {
|
|
2895
2897
|
return;
|
|
2896
2898
|
}
|
|
@@ -2903,6 +2905,8 @@ class QdMockFilterService {
|
|
|
2903
2905
|
setFilterSelection = jest.fn();
|
|
2904
2906
|
updateItem = jest.fn();
|
|
2905
2907
|
setItemIsActive = jest.fn();
|
|
2908
|
+
clearCategorySelection = jest.fn();
|
|
2909
|
+
setItemsLoading = jest.fn();
|
|
2906
2910
|
selectFilterDataById$ = jest.fn();
|
|
2907
2911
|
getQueryString$(filterId) {
|
|
2908
2912
|
return this.getQueryStringSubject(filterId).asObservable();
|
|
@@ -2925,6 +2929,11 @@ class QdMockFilterService {
|
|
|
2925
2929
|
getItemById$(filterId) {
|
|
2926
2930
|
return this.itemByIdSubject[filterId].asObservable();
|
|
2927
2931
|
}
|
|
2932
|
+
getItemsLoading$(filterId) {
|
|
2933
|
+
if (!this.loadingSubject[filterId])
|
|
2934
|
+
this.loadingSubject[filterId] = new BehaviorSubject(false);
|
|
2935
|
+
return this.loadingSubject[filterId].asObservable();
|
|
2936
|
+
}
|
|
2928
2937
|
getQueryStringSubject(filterId) {
|
|
2929
2938
|
if (!this.queryStringSubjects[filterId])
|
|
2930
2939
|
this.queryStringSubjects[filterId] = new Subject();
|
|
@@ -2960,6 +2969,11 @@ class QdMockFilterService {
|
|
|
2960
2969
|
this.itemByIdSubject[filterId] = new BehaviorSubject(null);
|
|
2961
2970
|
this.itemByIdSubject[filterId].next(value);
|
|
2962
2971
|
}
|
|
2972
|
+
emitLoading(value, filterId) {
|
|
2973
|
+
if (!this.loadingSubject[filterId])
|
|
2974
|
+
this.loadingSubject[filterId] = new BehaviorSubject(false);
|
|
2975
|
+
this.loadingSubject[filterId].next(value);
|
|
2976
|
+
}
|
|
2963
2977
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdMockFilterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2964
2978
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdMockFilterService });
|
|
2965
2979
|
}
|
|
@@ -8128,6 +8142,20 @@ class QdPopoverOnClickDirective {
|
|
|
8128
8142
|
this.runSizingAndOpen(popover);
|
|
8129
8143
|
}));
|
|
8130
8144
|
}
|
|
8145
|
+
/**
|
|
8146
|
+
* Re-aligns an open overlay with its origin element.
|
|
8147
|
+
*
|
|
8148
|
+
* The connected position is only recomputed on scroll/resize, not when a
|
|
8149
|
+
* layout reflow moves the origin (e.g. a chip or action buttons appearing in
|
|
8150
|
+
* the host). Call this after such a reflow to keep the overlay attached to the
|
|
8151
|
+
* host. Deferred by one frame so the new layout is measured, and a no-op while
|
|
8152
|
+
* the overlay is detached, so it stays cheap to call on discrete events.
|
|
8153
|
+
*/
|
|
8154
|
+
updatePosition() {
|
|
8155
|
+
if (!this.overlayRef?.hasAttached())
|
|
8156
|
+
return;
|
|
8157
|
+
requestAnimationFrame(() => this.overlayRef.updatePosition());
|
|
8158
|
+
}
|
|
8131
8159
|
close() {
|
|
8132
8160
|
if (!this.overlayRef?.hasAttached())
|
|
8133
8161
|
return;
|
|
@@ -9455,11 +9483,11 @@ class QdFilterFormItemsComponent {
|
|
|
9455
9483
|
this.filterValueChange.emit($event);
|
|
9456
9484
|
}
|
|
9457
9485
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdFilterFormItemsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9458
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdFilterFormItemsComponent, isStandalone: false, selector: "qd-filter-form-items", inputs: { inputFilterValue: "inputFilterValue", testId: ["data-test-id", "testId"] }, outputs: { filterValueChange: "filterValueChange" }, host: { classAttribute: "qd-filter-form-items" }, ngImport: i0, template: "<qd-icon [icon]=\"'
|
|
9486
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdFilterFormItemsComponent, isStandalone: false, selector: "qd-filter-form-items", inputs: { inputFilterValue: "inputFilterValue", testId: ["data-test-id", "testId"] }, outputs: { filterValueChange: "filterValueChange" }, host: { classAttribute: "qd-filter-form-items" }, ngImport: i0, template: "<qd-icon [icon]=\"'filter'\" class=\"qd-filter-form-items__filter-magnifier\"></qd-icon>\n\n<input\n type=\"text\"\n class=\"qd-filter-form-items__filter\"\n [(ngModel)]=\"filterValue\"\n (ngModelChange)=\"changeValue($event)\"\n [attr.data-test-id]=\"testId + '-filter-items'\"\n [qdAutofocus]=\"true\"\n autocomplete=\"off\"\n/>\n", styles: [".qd-filter-form-items__filter{width:100%;height:2.25rem;padding:0 .75rem 0 2.375rem;border:none;border-bottom:.0625rem solid rgb(213,213,213);margin-bottom:.5rem;background:#fff;color:#171717}.qd-filter-form-items__filter:focus,.qd-filter-form-items__filter:hover,.qd-filter-form-items__filter:active{border:none;background:#f5f5f5;outline:none}.qd-filter-form-items__filter:hover,.qd-filter-form-items__filter:active{border-bottom:.125rem solid rgb(23,23,23)}.qd-filter-form-items__filter:focus{border-bottom:.125rem solid rgb(0,102,153)}.qd-filter-form-items__filter-magnifier{position:absolute;padding:.625rem 0 .625rem .9375rem}.qd-filter-form-items__filter-magnifier .qd-icon{color:#757575}\n"], dependencies: [{ kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: QdAutofocusDirective, selector: "[qdAutofocus]", inputs: ["qdAutofocus"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }] });
|
|
9459
9487
|
}
|
|
9460
9488
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdFilterFormItemsComponent, decorators: [{
|
|
9461
9489
|
type: Component,
|
|
9462
|
-
args: [{ selector: 'qd-filter-form-items', host: { class: 'qd-filter-form-items' }, standalone: false, template: "<qd-icon [icon]=\"'
|
|
9490
|
+
args: [{ selector: 'qd-filter-form-items', host: { class: 'qd-filter-form-items' }, standalone: false, template: "<qd-icon [icon]=\"'filter'\" class=\"qd-filter-form-items__filter-magnifier\"></qd-icon>\n\n<input\n type=\"text\"\n class=\"qd-filter-form-items__filter\"\n [(ngModel)]=\"filterValue\"\n (ngModelChange)=\"changeValue($event)\"\n [attr.data-test-id]=\"testId + '-filter-items'\"\n [qdAutofocus]=\"true\"\n autocomplete=\"off\"\n/>\n", styles: [".qd-filter-form-items__filter{width:100%;height:2.25rem;padding:0 .75rem 0 2.375rem;border:none;border-bottom:.0625rem solid rgb(213,213,213);margin-bottom:.5rem;background:#fff;color:#171717}.qd-filter-form-items__filter:focus,.qd-filter-form-items__filter:hover,.qd-filter-form-items__filter:active{border:none;background:#f5f5f5;outline:none}.qd-filter-form-items__filter:hover,.qd-filter-form-items__filter:active{border-bottom:.125rem solid rgb(23,23,23)}.qd-filter-form-items__filter:focus{border-bottom:.125rem solid rgb(0,102,153)}.qd-filter-form-items__filter-magnifier{position:absolute;padding:.625rem 0 .625rem .9375rem}.qd-filter-form-items__filter-magnifier .qd-icon{color:#757575}\n"] }]
|
|
9463
9491
|
}], propDecorators: { inputFilterValue: [{
|
|
9464
9492
|
type: Input
|
|
9465
9493
|
}], testId: [{
|
|
@@ -12291,6 +12319,11 @@ class QdDatepickerComponent {
|
|
|
12291
12319
|
setDisabledState(disabled) {
|
|
12292
12320
|
this.disabled = disabled;
|
|
12293
12321
|
}
|
|
12322
|
+
open() {
|
|
12323
|
+
if (this.disabled)
|
|
12324
|
+
return;
|
|
12325
|
+
this.popover?.open();
|
|
12326
|
+
}
|
|
12294
12327
|
handleUpdatedDate($rawValue) {
|
|
12295
12328
|
const $event = this.extractInputStringValue($rawValue);
|
|
12296
12329
|
if ($event === '') {
|
|
@@ -12526,7 +12559,7 @@ class QdDatepickerComponent {
|
|
|
12526
12559
|
useValue: true
|
|
12527
12560
|
},
|
|
12528
12561
|
QdFormsActionEmitterService
|
|
12529
|
-
], viewQueries: [{ propertyName: "popover", first: true, predicate: ["qdPopoverOnClick"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<qd-form-label\n [label]=\"label\"\n [readonly]=\"readonly\"\n [viewonly]=\"viewonly\"\n [control]=\"control\"\n [tooltip]=\"config?.tooltip\"\n [data-test-id]=\"testId\"\n></qd-form-label>\n\n<qd-input\n *ngIf=\"!readonly && !viewonly\"\n [value]=\"config?.timePicker && displayedDateTime ? displayedDateTime : displayedDate\"\n (valueChange)=\"config?.timePicker ? handleUpdatedDateTime($event) : handleUpdatedDate($event)\"\n [config]=\"{ disabled, readonly, viewonly, placeholder: config?.placeholder }\"\n [isError]=\"hasError\"\n>\n <button\n type=\"button\"\n class=\"datepicker-toggle\"\n qdIconButton\n [qdPopoverOnClick]=\"disabled ? null : calendar\"\n [qdPopoverMaxWidth]=\"332\"\n qdPopoverCloseStrategy=\"onOutsideClick\"\n #qdPopoverOnClick=\"qdPopoverOnClick\"\n >\n <qd-icon [icon]=\"'calendar'\"></qd-icon>\n </button>\n</qd-input>\n\n<ng-template #calendar>\n <qd-calendar\n [selectedDate]=\"config?.timePicker && displayedDateTime ? displayedDateTime : displayedDate\"\n [language]=\"language\"\n [disabledDates]=\"config?.disabledDates\"\n (selectedChange)=\"handleUpdatedDate($event)\"\n ></qd-calendar>\n <qd-dropdown\n class=\"timepicker-dropdown\"\n *ngIf=\"timePicker\"\n [value]=\"displayedTime\"\n (valueChange)=\"handleUpdatedTime($event)\"\n [config]=\"timePicker\"\n [qdPopoverMaxHeight]=\"300\"\n ></qd-dropdown>\n</ng-template>\n\n<qd-form-hint\n *ngIf=\"!readonly && !viewonly && (hint || hasError)\"\n [hint]=\"hint\"\n [control]=\"control\"\n [hasError]=\"hasError\"\n [hintAction]=\"hintAction\"\n [data-test-id]=\"testId\"\n></qd-form-hint>\n\n<qd-form-readonly\n *ngIf=\"readonly\"\n [values]=\"[displayedDate]\"\n [readonlyAction]=\"readonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-readonly>\n\n<qd-form-viewonly\n *ngIf=\"viewonly\"\n [values]=\"[displayedDate]\"\n [viewonlyAction]=\"viewonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-viewonly>\n", styles: ["qd-datepicker{position:relative;display:block;width:100%;margin-bottom:.75rem}qd-datepicker .calendar{padding:1rem}qd-datepicker .calendar mat-calendar{display:block}qd-datepicker .datepicker-toggle{background-color:unset}qd-datepicker:not(.qd-datepicker-calendar-only) qd-input{height:2.25rem;margin-bottom:.375rem!important}qd-datepicker:not(.qd-datepicker-calendar-only) qd-input .qd-form-label,qd-datepicker:not(.qd-datepicker-calendar-only) qd-input .qd-form-hint{display:none}qd-datepicker .qd-form-disabled .datepicker-toggle{color:#979797;cursor:default}qd-datepicker.qd-datepicker-calendar-only{margin-bottom:0}qd-datepicker.qd-datepicker-calendar-only qd-input{margin:0}qd-datepicker.qd-datepicker-calendar-only .qd-form-label,qd-datepicker.qd-datepicker-calendar-only .qd-form-hint,qd-datepicker.qd-datepicker-calendar-only .qd-input-input input{display:none}qd-datepicker.qd-datepicker-calendar-only .qd-input-input{height:initial!important;padding:0!important;border:none!important;margin:0!important}qd-datepicker.qd-datepicker-calendar-only .qd-input-suffix{margin-left:0!important}.timepicker-dropdown{margin:.75rem}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { kind: "directive", type: QdPopoverOnClickDirective, selector: "[qdPopoverOnClick]", inputs: ["qdPopoverOnClick", "positionStrategy", "qdPopoverCloseStrategy", "qdPopoverDisabled", "qdPopoverStopPropagation", "qdPopoverBackgroundColor", "qdPopoverMaxHeight", "qdPopoverMinWidth", "qdPopoverMaxWidth", "qdPopoverAutoSize", "qdPopoverEnableKeyControl"], outputs: ["opened", "closed"], exportAs: ["qdPopoverOnClick"] }, { kind: "component", type: QdCalendarComponent, selector: "qd-calendar", inputs: ["selectedDate", "language", "disabledDates"], outputs: ["selectedChange"] }, { kind: "component", type: QdDropdownComponent, selector: "qd-dropdown", inputs: ["value", "id", "formControlName", "config", "data-test-id", "qdPopoverMaxHeight", "dense"], outputs: ["valueChange", "enterClick", "clickHint", "clickReadonly", "clickViewonly", "optionsResolved"] }, { kind: "component", type: QdFormHintComponent, selector: "qd-form-hint", inputs: ["hint", "control", "hasError", "hintAction", "data-test-id"] }, { kind: "component", type: QdFormLabelComponent, selector: "qd-form-label", inputs: ["label", "isDisabled", "readonly", "viewonly", "control", "tooltip", "data-test-id"] }, { kind: "component", type: QdFormReadonlyComponent, selector: "qd-form-readonly", inputs: ["values", "readonlyAction", "data-test-id"] }, { kind: "component", type: QdFormViewonlyComponent, selector: "qd-form-viewonly", inputs: ["values", "viewonlyAction", "data-test-id"] }, { kind: "component", type: QdInputComponent, selector: "qd-input", inputs: ["formControlName", "value", "config", "isError", "data-test-id"], outputs: ["valueChange", "enterClick", "clickClear", "clickHint", "clickReadonly", "clickViewonly", "optionsResolved"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
12562
|
+
], viewQueries: [{ propertyName: "popover", first: true, predicate: ["qdPopoverOnClick"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<qd-form-label\n [label]=\"label\"\n [readonly]=\"readonly\"\n [viewonly]=\"viewonly\"\n [control]=\"control\"\n [tooltip]=\"config?.tooltip\"\n [data-test-id]=\"testId\"\n></qd-form-label>\n\n<qd-input\n *ngIf=\"!readonly && !viewonly\"\n [value]=\"config?.timePicker && displayedDateTime ? displayedDateTime : displayedDate\"\n (valueChange)=\"config?.timePicker ? handleUpdatedDateTime($event) : handleUpdatedDate($event)\"\n [config]=\"{ disabled, readonly, viewonly, placeholder: config?.placeholder }\"\n [isError]=\"hasError\"\n>\n <button\n type=\"button\"\n class=\"datepicker-toggle\"\n qdIconButton\n [qdPopoverOnClick]=\"disabled ? null : calendar\"\n [qdPopoverMaxWidth]=\"332\"\n qdPopoverCloseStrategy=\"onOutsideClick\"\n #qdPopoverOnClick=\"qdPopoverOnClick\"\n >\n <qd-icon [icon]=\"'calendar'\"></qd-icon>\n </button>\n</qd-input>\n\n<ng-template #calendar>\n <qd-calendar\n [selectedDate]=\"config?.timePicker && displayedDateTime ? displayedDateTime : displayedDate\"\n [language]=\"language\"\n [disabledDates]=\"config?.disabledDates\"\n (selectedChange)=\"handleUpdatedDate($event)\"\n ></qd-calendar>\n <qd-dropdown\n class=\"timepicker-dropdown\"\n *ngIf=\"timePicker\"\n [value]=\"displayedTime\"\n (valueChange)=\"handleUpdatedTime($event)\"\n [config]=\"timePicker\"\n [qdPopoverMaxHeight]=\"300\"\n ></qd-dropdown>\n</ng-template>\n\n<qd-form-hint\n *ngIf=\"!readonly && !viewonly && (hint || hasError)\"\n [hint]=\"hint\"\n [control]=\"control\"\n [hasError]=\"hasError\"\n [hintAction]=\"hintAction\"\n [data-test-id]=\"testId\"\n></qd-form-hint>\n\n<qd-form-readonly\n *ngIf=\"readonly\"\n [values]=\"[displayedDate]\"\n [readonlyAction]=\"readonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-readonly>\n\n<qd-form-viewonly\n *ngIf=\"viewonly\"\n [values]=\"[displayedDate]\"\n [viewonlyAction]=\"viewonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-viewonly>\n", styles: ["qd-datepicker{position:relative;display:block;width:100%;margin-bottom:.75rem}qd-datepicker .calendar{padding:1rem}qd-datepicker .calendar mat-calendar{display:block}qd-datepicker .datepicker-toggle{background-color:unset;color:inherit}qd-datepicker:not(.qd-datepicker-calendar-only) qd-input{height:2.25rem;margin-bottom:.375rem!important}qd-datepicker:not(.qd-datepicker-calendar-only) qd-input .qd-form-label,qd-datepicker:not(.qd-datepicker-calendar-only) qd-input .qd-form-hint{display:none}qd-datepicker .qd-form-disabled .datepicker-toggle{color:#979797;cursor:default}qd-datepicker.qd-datepicker-calendar-only{margin-bottom:0}qd-datepicker.qd-datepicker-calendar-only qd-input{margin:0}qd-datepicker.qd-datepicker-calendar-only .qd-form-label,qd-datepicker.qd-datepicker-calendar-only .qd-form-hint,qd-datepicker.qd-datepicker-calendar-only .qd-input-input input{display:none}qd-datepicker.qd-datepicker-calendar-only .qd-input-input{height:initial!important;padding:0!important;border:none!important;margin:0!important}qd-datepicker.qd-datepicker-calendar-only .qd-input-suffix{margin-left:0!important}.timepicker-dropdown{margin:.75rem}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { kind: "directive", type: QdPopoverOnClickDirective, selector: "[qdPopoverOnClick]", inputs: ["qdPopoverOnClick", "positionStrategy", "qdPopoverCloseStrategy", "qdPopoverDisabled", "qdPopoverStopPropagation", "qdPopoverBackgroundColor", "qdPopoverMaxHeight", "qdPopoverMinWidth", "qdPopoverMaxWidth", "qdPopoverAutoSize", "qdPopoverEnableKeyControl"], outputs: ["opened", "closed"], exportAs: ["qdPopoverOnClick"] }, { kind: "component", type: QdCalendarComponent, selector: "qd-calendar", inputs: ["selectedDate", "language", "disabledDates"], outputs: ["selectedChange"] }, { kind: "component", type: QdDropdownComponent, selector: "qd-dropdown", inputs: ["value", "id", "formControlName", "config", "data-test-id", "qdPopoverMaxHeight", "dense"], outputs: ["valueChange", "enterClick", "clickHint", "clickReadonly", "clickViewonly", "optionsResolved"] }, { kind: "component", type: QdFormHintComponent, selector: "qd-form-hint", inputs: ["hint", "control", "hasError", "hintAction", "data-test-id"] }, { kind: "component", type: QdFormLabelComponent, selector: "qd-form-label", inputs: ["label", "isDisabled", "readonly", "viewonly", "control", "tooltip", "data-test-id"] }, { kind: "component", type: QdFormReadonlyComponent, selector: "qd-form-readonly", inputs: ["values", "readonlyAction", "data-test-id"] }, { kind: "component", type: QdFormViewonlyComponent, selector: "qd-form-viewonly", inputs: ["values", "viewonlyAction", "data-test-id"] }, { kind: "component", type: QdInputComponent, selector: "qd-input", inputs: ["formControlName", "value", "config", "isError", "data-test-id"], outputs: ["valueChange", "enterClick", "clickClear", "clickHint", "clickReadonly", "clickViewonly", "optionsResolved"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
12530
12563
|
}
|
|
12531
12564
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdDatepickerComponent, decorators: [{
|
|
12532
12565
|
type: Component,
|
|
@@ -12541,7 +12574,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
12541
12574
|
useValue: true
|
|
12542
12575
|
},
|
|
12543
12576
|
QdFormsActionEmitterService
|
|
12544
|
-
], standalone: false, template: "<qd-form-label\n [label]=\"label\"\n [readonly]=\"readonly\"\n [viewonly]=\"viewonly\"\n [control]=\"control\"\n [tooltip]=\"config?.tooltip\"\n [data-test-id]=\"testId\"\n></qd-form-label>\n\n<qd-input\n *ngIf=\"!readonly && !viewonly\"\n [value]=\"config?.timePicker && displayedDateTime ? displayedDateTime : displayedDate\"\n (valueChange)=\"config?.timePicker ? handleUpdatedDateTime($event) : handleUpdatedDate($event)\"\n [config]=\"{ disabled, readonly, viewonly, placeholder: config?.placeholder }\"\n [isError]=\"hasError\"\n>\n <button\n type=\"button\"\n class=\"datepicker-toggle\"\n qdIconButton\n [qdPopoverOnClick]=\"disabled ? null : calendar\"\n [qdPopoverMaxWidth]=\"332\"\n qdPopoverCloseStrategy=\"onOutsideClick\"\n #qdPopoverOnClick=\"qdPopoverOnClick\"\n >\n <qd-icon [icon]=\"'calendar'\"></qd-icon>\n </button>\n</qd-input>\n\n<ng-template #calendar>\n <qd-calendar\n [selectedDate]=\"config?.timePicker && displayedDateTime ? displayedDateTime : displayedDate\"\n [language]=\"language\"\n [disabledDates]=\"config?.disabledDates\"\n (selectedChange)=\"handleUpdatedDate($event)\"\n ></qd-calendar>\n <qd-dropdown\n class=\"timepicker-dropdown\"\n *ngIf=\"timePicker\"\n [value]=\"displayedTime\"\n (valueChange)=\"handleUpdatedTime($event)\"\n [config]=\"timePicker\"\n [qdPopoverMaxHeight]=\"300\"\n ></qd-dropdown>\n</ng-template>\n\n<qd-form-hint\n *ngIf=\"!readonly && !viewonly && (hint || hasError)\"\n [hint]=\"hint\"\n [control]=\"control\"\n [hasError]=\"hasError\"\n [hintAction]=\"hintAction\"\n [data-test-id]=\"testId\"\n></qd-form-hint>\n\n<qd-form-readonly\n *ngIf=\"readonly\"\n [values]=\"[displayedDate]\"\n [readonlyAction]=\"readonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-readonly>\n\n<qd-form-viewonly\n *ngIf=\"viewonly\"\n [values]=\"[displayedDate]\"\n [viewonlyAction]=\"viewonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-viewonly>\n", styles: ["qd-datepicker{position:relative;display:block;width:100%;margin-bottom:.75rem}qd-datepicker .calendar{padding:1rem}qd-datepicker .calendar mat-calendar{display:block}qd-datepicker .datepicker-toggle{background-color:unset}qd-datepicker:not(.qd-datepicker-calendar-only) qd-input{height:2.25rem;margin-bottom:.375rem!important}qd-datepicker:not(.qd-datepicker-calendar-only) qd-input .qd-form-label,qd-datepicker:not(.qd-datepicker-calendar-only) qd-input .qd-form-hint{display:none}qd-datepicker .qd-form-disabled .datepicker-toggle{color:#979797;cursor:default}qd-datepicker.qd-datepicker-calendar-only{margin-bottom:0}qd-datepicker.qd-datepicker-calendar-only qd-input{margin:0}qd-datepicker.qd-datepicker-calendar-only .qd-form-label,qd-datepicker.qd-datepicker-calendar-only .qd-form-hint,qd-datepicker.qd-datepicker-calendar-only .qd-input-input input{display:none}qd-datepicker.qd-datepicker-calendar-only .qd-input-input{height:initial!important;padding:0!important;border:none!important;margin:0!important}qd-datepicker.qd-datepicker-calendar-only .qd-input-suffix{margin-left:0!important}.timepicker-dropdown{margin:.75rem}\n"] }]
|
|
12577
|
+
], standalone: false, template: "<qd-form-label\n [label]=\"label\"\n [readonly]=\"readonly\"\n [viewonly]=\"viewonly\"\n [control]=\"control\"\n [tooltip]=\"config?.tooltip\"\n [data-test-id]=\"testId\"\n></qd-form-label>\n\n<qd-input\n *ngIf=\"!readonly && !viewonly\"\n [value]=\"config?.timePicker && displayedDateTime ? displayedDateTime : displayedDate\"\n (valueChange)=\"config?.timePicker ? handleUpdatedDateTime($event) : handleUpdatedDate($event)\"\n [config]=\"{ disabled, readonly, viewonly, placeholder: config?.placeholder }\"\n [isError]=\"hasError\"\n>\n <button\n type=\"button\"\n class=\"datepicker-toggle\"\n qdIconButton\n [qdPopoverOnClick]=\"disabled ? null : calendar\"\n [qdPopoverMaxWidth]=\"332\"\n qdPopoverCloseStrategy=\"onOutsideClick\"\n #qdPopoverOnClick=\"qdPopoverOnClick\"\n >\n <qd-icon [icon]=\"'calendar'\"></qd-icon>\n </button>\n</qd-input>\n\n<ng-template #calendar>\n <qd-calendar\n [selectedDate]=\"config?.timePicker && displayedDateTime ? displayedDateTime : displayedDate\"\n [language]=\"language\"\n [disabledDates]=\"config?.disabledDates\"\n (selectedChange)=\"handleUpdatedDate($event)\"\n ></qd-calendar>\n <qd-dropdown\n class=\"timepicker-dropdown\"\n *ngIf=\"timePicker\"\n [value]=\"displayedTime\"\n (valueChange)=\"handleUpdatedTime($event)\"\n [config]=\"timePicker\"\n [qdPopoverMaxHeight]=\"300\"\n ></qd-dropdown>\n</ng-template>\n\n<qd-form-hint\n *ngIf=\"!readonly && !viewonly && (hint || hasError)\"\n [hint]=\"hint\"\n [control]=\"control\"\n [hasError]=\"hasError\"\n [hintAction]=\"hintAction\"\n [data-test-id]=\"testId\"\n></qd-form-hint>\n\n<qd-form-readonly\n *ngIf=\"readonly\"\n [values]=\"[displayedDate]\"\n [readonlyAction]=\"readonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-readonly>\n\n<qd-form-viewonly\n *ngIf=\"viewonly\"\n [values]=\"[displayedDate]\"\n [viewonlyAction]=\"viewonlyAction\"\n [data-test-id]=\"testId\"\n></qd-form-viewonly>\n", styles: ["qd-datepicker{position:relative;display:block;width:100%;margin-bottom:.75rem}qd-datepicker .calendar{padding:1rem}qd-datepicker .calendar mat-calendar{display:block}qd-datepicker .datepicker-toggle{background-color:unset;color:inherit}qd-datepicker:not(.qd-datepicker-calendar-only) qd-input{height:2.25rem;margin-bottom:.375rem!important}qd-datepicker:not(.qd-datepicker-calendar-only) qd-input .qd-form-label,qd-datepicker:not(.qd-datepicker-calendar-only) qd-input .qd-form-hint{display:none}qd-datepicker .qd-form-disabled .datepicker-toggle{color:#979797;cursor:default}qd-datepicker.qd-datepicker-calendar-only{margin-bottom:0}qd-datepicker.qd-datepicker-calendar-only qd-input{margin:0}qd-datepicker.qd-datepicker-calendar-only .qd-form-label,qd-datepicker.qd-datepicker-calendar-only .qd-form-hint,qd-datepicker.qd-datepicker-calendar-only .qd-input-input input{display:none}qd-datepicker.qd-datepicker-calendar-only .qd-input-input{height:initial!important;padding:0!important;border:none!important;margin:0!important}qd-datepicker.qd-datepicker-calendar-only .qd-input-suffix{margin-left:0!important}.timepicker-dropdown{margin:.75rem}\n"] }]
|
|
12545
12578
|
}], propDecorators: { config: [{
|
|
12546
12579
|
type: Input
|
|
12547
12580
|
}], formControlName: [{
|
|
@@ -20729,6 +20762,7 @@ const updateCategoryTranslation = createAction('[QdUi Filter] updateCategoryTran
|
|
|
20729
20762
|
const setFilterSelection = createAction('[QdUi Filter] setFilterSelection', props());
|
|
20730
20763
|
const setCategoryFilter = createAction('[QdUi Filter] setCategoryFilter', props());
|
|
20731
20764
|
const resetCategoryFilter = createAction('[QdUi Filter] resetCategoryFilter', props());
|
|
20765
|
+
const clearCategorySelection = createAction('[QdUi Filter] clearCategorySelection', props());
|
|
20732
20766
|
const QdFilterActions = {
|
|
20733
20767
|
initFilterState,
|
|
20734
20768
|
updateItem,
|
|
@@ -20739,7 +20773,8 @@ const QdFilterActions = {
|
|
|
20739
20773
|
updateCategoryTranslation,
|
|
20740
20774
|
setFilterSelection,
|
|
20741
20775
|
setCategoryFilter,
|
|
20742
|
-
resetCategoryFilter
|
|
20776
|
+
resetCategoryFilter,
|
|
20777
|
+
clearCategorySelection
|
|
20743
20778
|
};
|
|
20744
20779
|
|
|
20745
20780
|
function validateFilterSelection(filterSelection, filterCategories, selectionSource) {
|
|
@@ -20861,6 +20896,12 @@ const _filterReducer = createReducer(initialState$2, on(QdFilterActions.initFilt
|
|
|
20861
20896
|
...state,
|
|
20862
20897
|
[filterId]: resetCategoryFilter$1(state[filterId], categoryIndex)
|
|
20863
20898
|
};
|
|
20899
|
+
}), on(QdFilterActions.clearCategorySelection, (state, { filterId, categoryIndex }) => {
|
|
20900
|
+
const newCategory = getNewCategory(state, filterId, categoryIndex);
|
|
20901
|
+
newCategory.items.forEach((item) => {
|
|
20902
|
+
item.active = false;
|
|
20903
|
+
});
|
|
20904
|
+
return updateStateWithNewCategory(state, filterId, categoryIndex, newCategory);
|
|
20864
20905
|
}));
|
|
20865
20906
|
function filterReducer(state, action) {
|
|
20866
20907
|
return _filterReducer(state, action);
|
|
@@ -20990,6 +21031,7 @@ class QdFilterService {
|
|
|
20990
21031
|
queryStringSubjects = [];
|
|
20991
21032
|
filterUrlParameterSubjects = [];
|
|
20992
21033
|
postBodySubjects = [];
|
|
21034
|
+
itemsLoadingSubjects = {};
|
|
20993
21035
|
getItems$(filterId, categoryIndex) {
|
|
20994
21036
|
return this.store.select(QdFilterSelector.selectItems, {
|
|
20995
21037
|
filterId,
|
|
@@ -21071,6 +21113,9 @@ class QdFilterService {
|
|
|
21071
21113
|
categoryIndex
|
|
21072
21114
|
});
|
|
21073
21115
|
}
|
|
21116
|
+
getItemsLoading$(filterId, categoryIndex) {
|
|
21117
|
+
return this.getItemsLoadingSubject(filterId, categoryIndex).asObservable();
|
|
21118
|
+
}
|
|
21074
21119
|
getFilterCategoryValue$(filterId, categoryIndex) {
|
|
21075
21120
|
return this.store.select(QdFilterSelector.selectFilterCategoryValue, {
|
|
21076
21121
|
filterId,
|
|
@@ -21151,6 +21196,21 @@ class QdFilterService {
|
|
|
21151
21196
|
categoryIndex
|
|
21152
21197
|
}));
|
|
21153
21198
|
}
|
|
21199
|
+
clearCategorySelection(filterId, categoryIndex) {
|
|
21200
|
+
this.store.dispatch(QdFilterActions.clearCategorySelection({
|
|
21201
|
+
filterId,
|
|
21202
|
+
categoryIndex
|
|
21203
|
+
}));
|
|
21204
|
+
}
|
|
21205
|
+
setItemsLoading(filterId, categoryIndex, loading) {
|
|
21206
|
+
this.getItemsLoadingSubject(filterId, categoryIndex).next(loading);
|
|
21207
|
+
}
|
|
21208
|
+
getItemsLoadingSubject(filterId, categoryIndex) {
|
|
21209
|
+
const key = `${filterId}-${categoryIndex}`;
|
|
21210
|
+
if (!this.itemsLoadingSubjects[key])
|
|
21211
|
+
this.itemsLoadingSubjects[key] = new BehaviorSubject(false);
|
|
21212
|
+
return this.itemsLoadingSubjects[key];
|
|
21213
|
+
}
|
|
21154
21214
|
getQueryStringSubject(filterId) {
|
|
21155
21215
|
if (!this.queryStringSubjects[filterId])
|
|
21156
21216
|
this.queryStringSubjects[filterId] = new ReplaySubject(1);
|
|
@@ -21207,11 +21267,11 @@ class QdFilterItemBooleanComponent {
|
|
|
21207
21267
|
this.filterService.setItemIsActive(this.filterId, this.categoryIndex, this.itemIndex, value === this.itemData);
|
|
21208
21268
|
}
|
|
21209
21269
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdFilterItemBooleanComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
21210
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdFilterItemBooleanComponent, isStandalone: false, selector: "qd-filter-item-boolean", inputs: { filterId: "filterId", categoryIndex: "categoryIndex", itemIndex: "itemIndex", i18n: "i18n", testId: ["data-test-id", "testId"] }, host: { properties: { "attr.data-test-id": "this.dataTestId" } }, ngImport: i0, template: "<qd-checkbox\n [inputData]=\"{ value: itemData, i18n: i18n || '', disabled: false }\"\n [value]=\"active ? itemData : null\"\n (valueChange)=\"clickToggle($event)\"\n qdRwdDisabled\n [data-test-id]=\"testId\"\n [attr.data-test-id]=\"testId + '-checkbox'\"\n></qd-checkbox>\n", styles: [":host{position:relative;display:flex;flex-wrap:wrap-reverse;margin:0 .75rem;line-height:2.125rem}:host ::ng-deep .qd-checkbox,:host ::ng-deep .qd-checkbox__label,:host ::ng-deep .qd-checkbox__caption{padding:0!important;border:0;margin:0!important}:host ::ng-deep .qd-
|
|
21270
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdFilterItemBooleanComponent, isStandalone: false, selector: "qd-filter-item-boolean", inputs: { filterId: "filterId", categoryIndex: "categoryIndex", itemIndex: "itemIndex", i18n: "i18n", testId: ["data-test-id", "testId"] }, host: { properties: { "attr.data-test-id": "this.dataTestId" } }, ngImport: i0, template: "<qd-checkbox\n [inputData]=\"{ value: itemData, i18n: i18n || '', disabled: false }\"\n [value]=\"active ? itemData : null\"\n (valueChange)=\"clickToggle($event)\"\n qdRwdDisabled\n [data-test-id]=\"testId\"\n [attr.data-test-id]=\"testId + '-checkbox'\"\n></qd-checkbox>\n", styles: [":host{position:relative;display:flex;flex-wrap:wrap-reverse;margin:0 .75rem;line-height:2.125rem}:host ::ng-deep .qd-checkbox,:host ::ng-deep .qd-checkbox__label,:host ::ng-deep .qd-checkbox__caption{padding:0!important;border:0;margin:0!important}:host ::ng-deep .qd-checkbox__label{color:#757575!important}:host ::ng-deep .qd-checkbox__label:hover,:host ::ng-deep .qd-checkbox__label:focus,:host ::ng-deep .qd-checkbox__label:active{color:#171717!important}:host ::ng-deep .qd-checkbox__indicator{margin-right:.5rem!important}\n"], dependencies: [{ kind: "directive", type: QdRwdDisabledDirective, selector: "[qdRwdDisabled]" }, { kind: "component", type: QdCheckboxComponent, selector: "qd-checkbox", inputs: ["inputData", "value", "data-test-id", "disabled", "hasAutofocus"], outputs: ["valueChange"] }] });
|
|
21211
21271
|
}
|
|
21212
21272
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdFilterItemBooleanComponent, decorators: [{
|
|
21213
21273
|
type: Component,
|
|
21214
|
-
args: [{ selector: 'qd-filter-item-boolean', standalone: false, template: "<qd-checkbox\n [inputData]=\"{ value: itemData, i18n: i18n || '', disabled: false }\"\n [value]=\"active ? itemData : null\"\n (valueChange)=\"clickToggle($event)\"\n qdRwdDisabled\n [data-test-id]=\"testId\"\n [attr.data-test-id]=\"testId + '-checkbox'\"\n></qd-checkbox>\n", styles: [":host{position:relative;display:flex;flex-wrap:wrap-reverse;margin:0 .75rem;line-height:2.125rem}:host ::ng-deep .qd-checkbox,:host ::ng-deep .qd-checkbox__label,:host ::ng-deep .qd-checkbox__caption{padding:0!important;border:0;margin:0!important}:host ::ng-deep .qd-
|
|
21274
|
+
args: [{ selector: 'qd-filter-item-boolean', standalone: false, template: "<qd-checkbox\n [inputData]=\"{ value: itemData, i18n: i18n || '', disabled: false }\"\n [value]=\"active ? itemData : null\"\n (valueChange)=\"clickToggle($event)\"\n qdRwdDisabled\n [data-test-id]=\"testId\"\n [attr.data-test-id]=\"testId + '-checkbox'\"\n></qd-checkbox>\n", styles: [":host{position:relative;display:flex;flex-wrap:wrap-reverse;margin:0 .75rem;line-height:2.125rem}:host ::ng-deep .qd-checkbox,:host ::ng-deep .qd-checkbox__label,:host ::ng-deep .qd-checkbox__caption{padding:0!important;border:0;margin:0!important}:host ::ng-deep .qd-checkbox__label{color:#757575!important}:host ::ng-deep .qd-checkbox__label:hover,:host ::ng-deep .qd-checkbox__label:focus,:host ::ng-deep .qd-checkbox__label:active{color:#171717!important}:host ::ng-deep .qd-checkbox__indicator{margin-right:.5rem!important}\n"] }]
|
|
21215
21275
|
}], propDecorators: { filterId: [{
|
|
21216
21276
|
type: Input
|
|
21217
21277
|
}], categoryIndex: [{
|
|
@@ -21273,6 +21333,7 @@ class QdFilterItemFreeTextComponent {
|
|
|
21273
21333
|
get value() {
|
|
21274
21334
|
return (this.item && this.item.item) || '';
|
|
21275
21335
|
}
|
|
21336
|
+
inputValue = '';
|
|
21276
21337
|
_destroyed$ = new Subject();
|
|
21277
21338
|
ngOnInit() {
|
|
21278
21339
|
this.filterService
|
|
@@ -21293,24 +21354,27 @@ class QdFilterItemFreeTextComponent {
|
|
|
21293
21354
|
this._destroyed$.complete();
|
|
21294
21355
|
}
|
|
21295
21356
|
handleValueChange(value) {
|
|
21296
|
-
|
|
21357
|
+
this.inputValue = value;
|
|
21358
|
+
if (!this.isInstantFiltering && value !== '') {
|
|
21297
21359
|
this.filterService.updateItem(this.filterId, this.categoryIndex, this.itemIndex, value);
|
|
21298
21360
|
}
|
|
21299
21361
|
}
|
|
21300
21362
|
handleEnter($event) {
|
|
21301
|
-
if (this.isInstantFiltering)
|
|
21302
|
-
this.
|
|
21363
|
+
if (this.isInstantFiltering && $event !== '') {
|
|
21364
|
+
this.filterService.updateItem(this.filterId, this.categoryIndex, this.itemIndex, $event);
|
|
21365
|
+
}
|
|
21303
21366
|
this.enterClick.emit();
|
|
21367
|
+
this.inputValue = '';
|
|
21304
21368
|
}
|
|
21305
21369
|
handleReset() {
|
|
21306
21370
|
this.filterService.updateItem(this.filterId, this.categoryIndex, this.itemIndex, '');
|
|
21307
21371
|
}
|
|
21308
21372
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdFilterItemFreeTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
21309
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdFilterItemFreeTextComponent, isStandalone: false, selector: "qd-filter-item-free-text", inputs: { filterId: "filterId", isInstantFiltering: "isInstantFiltering", categoryIndex: "categoryIndex", itemIndex: "itemIndex", testId: ["data-test-id", "testId"] }, outputs: { enterClick: "enterClick" }, host: { properties: { "attr.data-test-id": "this.dataTestId" }, classAttribute: "qd-filter__item-free-text" }, ngImport: i0, template: "<qd-input\n [value]=\"
|
|
21373
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdFilterItemFreeTextComponent, isStandalone: false, selector: "qd-filter-item-free-text", inputs: { filterId: "filterId", isInstantFiltering: "isInstantFiltering", categoryIndex: "categoryIndex", itemIndex: "itemIndex", testId: ["data-test-id", "testId"] }, outputs: { enterClick: "enterClick" }, host: { properties: { "attr.data-test-id": "this.dataTestId" }, classAttribute: "qd-filter__item-free-text" }, ngImport: i0, template: "<qd-input\n [value]=\"inputValue\"\n (valueChange)=\"handleValueChange($event)\"\n (enterClick)=\"handleEnter($event)\"\n [config]=\"{ placeholder: { i18n: i18n }, viewonly: false }\"\n [data-test-id]=\"testId\"\n></qd-input>\n", styles: [":host ::ng-deep qd-input{width:10.25rem;max-width:12.5rem;height:2.125rem;margin-bottom:0!important}:host ::ng-deep qd-input .qd-form-label,:host ::ng-deep qd-input .qd-form-hint{display:none}:host ::ng-deep qd-input .qd-form-label,:host ::ng-deep qd-input .qd-input-input,:host ::ng-deep qd-input .qd-form-hint{margin-bottom:0!important}:host ::ng-deep qd-input .qd-input-input{height:2.125rem!important;border-color:transparent!important}:host ::ng-deep qd-input .qd-input-input input::placeholder{color:#757575!important}:host:hover ::ng-deep qd-input .qd-input-input input::placeholder{color:#171717!important}\n"], dependencies: [{ kind: "component", type: QdInputComponent, selector: "qd-input", inputs: ["formControlName", "value", "config", "isError", "data-test-id"], outputs: ["valueChange", "enterClick", "clickClear", "clickHint", "clickReadonly", "clickViewonly", "optionsResolved"] }] });
|
|
21310
21374
|
}
|
|
21311
21375
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdFilterItemFreeTextComponent, decorators: [{
|
|
21312
21376
|
type: Component,
|
|
21313
|
-
args: [{ selector: 'qd-filter-item-free-text', host: { class: 'qd-filter__item-free-text' }, standalone: false, template: "<qd-input\n [value]=\"
|
|
21377
|
+
args: [{ selector: 'qd-filter-item-free-text', host: { class: 'qd-filter__item-free-text' }, standalone: false, template: "<qd-input\n [value]=\"inputValue\"\n (valueChange)=\"handleValueChange($event)\"\n (enterClick)=\"handleEnter($event)\"\n [config]=\"{ placeholder: { i18n: i18n }, viewonly: false }\"\n [data-test-id]=\"testId\"\n></qd-input>\n", styles: [":host ::ng-deep qd-input{width:10.25rem;max-width:12.5rem;height:2.125rem;margin-bottom:0!important}:host ::ng-deep qd-input .qd-form-label,:host ::ng-deep qd-input .qd-form-hint{display:none}:host ::ng-deep qd-input .qd-form-label,:host ::ng-deep qd-input .qd-input-input,:host ::ng-deep qd-input .qd-form-hint{margin-bottom:0!important}:host ::ng-deep qd-input .qd-input-input{height:2.125rem!important;border-color:transparent!important}:host ::ng-deep qd-input .qd-input-input input::placeholder{color:#757575!important}:host:hover ::ng-deep qd-input .qd-input-input input::placeholder{color:#171717!important}\n"] }]
|
|
21314
21378
|
}], propDecorators: { filterId: [{
|
|
21315
21379
|
type: Input
|
|
21316
21380
|
}], isInstantFiltering: [{
|
|
@@ -21391,6 +21455,7 @@ class QdFilterItemDateComponent {
|
|
|
21391
21455
|
get dataTestId() {
|
|
21392
21456
|
return this.testId;
|
|
21393
21457
|
}
|
|
21458
|
+
datepicker;
|
|
21394
21459
|
datepickerConfig = { viewonly: false };
|
|
21395
21460
|
item;
|
|
21396
21461
|
_destroyed$ = new Subject();
|
|
@@ -21409,6 +21474,9 @@ class QdFilterItemDateComponent {
|
|
|
21409
21474
|
handleClickTimePlaceholder($event) {
|
|
21410
21475
|
this.clickTimePlaceholder.emit($event);
|
|
21411
21476
|
}
|
|
21477
|
+
open() {
|
|
21478
|
+
this.datepicker?.open();
|
|
21479
|
+
}
|
|
21412
21480
|
subscribeGetItem() {
|
|
21413
21481
|
this.filterService
|
|
21414
21482
|
.getItemById$(this.filterId, this.categoryIndex, this.itemIndex)
|
|
@@ -21416,7 +21484,7 @@ class QdFilterItemDateComponent {
|
|
|
21416
21484
|
.subscribe();
|
|
21417
21485
|
}
|
|
21418
21486
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdFilterItemDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
21419
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdFilterItemDateComponent, isStandalone: false, selector: "qd-filter-item-date", inputs: { filterId: "filterId", categoryIndex: "categoryIndex", itemIndex: "itemIndex", timePickerConfig: "timePickerConfig", testId: ["data-test-id", "testId"] }, outputs: { clickTimePlaceholder: "clickTimePlaceholder" }, host: { properties: { "attr.data-test-id": "this.dataTestId" }, classAttribute: "qd-filter__item-date" }, ngImport: i0, template: "<qd-datepicker\n [(value)]=\"item\"\n (valueChange)=\"handleDateChange($event)\"\n (clickTimePlaceholder)=\"handleClickTimePlaceholder($event)\"\n [hasCalendarOnly]=\"true\"\n [config]=\"datepickerConfig\"\n></qd-datepicker>\n", styles: [":host qd-datepicker{padding-top:.125rem;margin-left:.25rem}:host ::ng-deep+.qd-chip.filter{margin-left:.1875rem!important}\n"], dependencies: [{ kind: "component", type: QdDatepickerComponent, selector: "qd-datepicker", inputs: ["config", "formControlName", "value", "hasCalendarOnly", "data-test-id"], outputs: ["valueChange", "clickTimePlaceholder", "clickHint", "clickReadonly", "clickViewonly"] }] });
|
|
21487
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdFilterItemDateComponent, isStandalone: false, selector: "qd-filter-item-date", inputs: { filterId: "filterId", categoryIndex: "categoryIndex", itemIndex: "itemIndex", timePickerConfig: "timePickerConfig", testId: ["data-test-id", "testId"] }, outputs: { clickTimePlaceholder: "clickTimePlaceholder" }, host: { properties: { "attr.data-test-id": "this.dataTestId" }, classAttribute: "qd-filter__item-date" }, viewQueries: [{ propertyName: "datepicker", first: true, predicate: QdDatepickerComponent, descendants: true }], ngImport: i0, template: "<qd-datepicker\n [(value)]=\"item\"\n (valueChange)=\"handleDateChange($event)\"\n (clickTimePlaceholder)=\"handleClickTimePlaceholder($event)\"\n [hasCalendarOnly]=\"true\"\n [config]=\"datepickerConfig\"\n></qd-datepicker>\n", styles: [":host qd-datepicker{padding-top:.125rem;margin-left:.25rem}:host ::ng-deep+.qd-chip.filter{margin-left:.1875rem!important}\n"], dependencies: [{ kind: "component", type: QdDatepickerComponent, selector: "qd-datepicker", inputs: ["config", "formControlName", "value", "hasCalendarOnly", "data-test-id"], outputs: ["valueChange", "clickTimePlaceholder", "clickHint", "clickReadonly", "clickViewonly"] }] });
|
|
21420
21488
|
}
|
|
21421
21489
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdFilterItemDateComponent, decorators: [{
|
|
21422
21490
|
type: Component,
|
|
@@ -21437,6 +21505,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
21437
21505
|
}], dataTestId: [{
|
|
21438
21506
|
type: HostBinding,
|
|
21439
21507
|
args: ['attr.data-test-id']
|
|
21508
|
+
}], datepicker: [{
|
|
21509
|
+
type: ViewChild,
|
|
21510
|
+
args: [QdDatepickerComponent]
|
|
21440
21511
|
}] } });
|
|
21441
21512
|
|
|
21442
21513
|
// @ts-strict-ignore
|
|
@@ -21471,11 +21542,11 @@ class QdFilterItemDateCategoryComponent {
|
|
|
21471
21542
|
this.item$ = this.filterService.getItemById$(this.filterId, this.categoryIndex, this.itemIndex);
|
|
21472
21543
|
}
|
|
21473
21544
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdFilterItemDateCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
21474
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdFilterItemDateCategoryComponent, isStandalone: false, selector: "qd-filter-category-date", inputs: { filterId: "filterId", categoryIndex: "categoryIndex", timePickerConfig: "timePickerConfig", testId: ["data-test-id", "testId"] }, host: { classAttribute: "qd-filter__category-date" }, ngImport: i0, template: "{{ this.i18n$ | async | translate }}
|
|
21545
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdFilterItemDateCategoryComponent, isStandalone: false, selector: "qd-filter-category-date", inputs: { filterId: "filterId", categoryIndex: "categoryIndex", timePickerConfig: "timePickerConfig", testId: ["data-test-id", "testId"] }, host: { classAttribute: "qd-filter__category-date" }, ngImport: i0, template: "<span\n class=\"qd-filter__date-label\"\n (click)=\"dateItem.open(); $event.stopPropagation()\"\n [attr.data-test-id]=\"testId + '-label'\"\n>\n {{ this.i18n$ | async | translate }} {{ \"i18n.qd.filter.date.on\" | translate }}\n</span>\n\n<qd-filter-item-date\n #dateItem\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"itemIndex\"\n [data-test-id]=\"testId + '-item'\"\n [timePickerConfig]=\"timePickerConfig\"\n (clickTimePlaceholder)=\"handleClickTimePlaceholder($event)\"\n></qd-filter-item-date>\n\n<qd-chip\n *ngIf=\"(item$ | async)?.active && (item$ | async)?.item\"\n [state]=\"'filter'\"\n [close]=\"true\"\n (closeClickEmitter)=\"removeItem($event)\"\n [data]=\"itemIndex\"\n [data-test-id]=\"testId + '-selected-chip-' + (item$ | async).item\"\n>\n {{ (item$ | async).item | localeDate : !!timePickerConfig : timePlaceholderSelected | async }}\n</qd-chip>\n", styles: [":host{display:flex;align-items:center;padding-right:.75rem;padding-left:.75rem;color:#757575;cursor:default;line-height:2.125rem}:host:hover{color:#171717}:host .qd-filter__date-label{cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: QdChipComponent, selector: "qd-chip", inputs: ["state", "close", "data", "data-test-id"], outputs: ["closeClickEmitter"] }, { kind: "component", type: QdFilterItemDateComponent, selector: "qd-filter-item-date", inputs: ["filterId", "categoryIndex", "itemIndex", "timePickerConfig", "data-test-id"], outputs: ["clickTimePlaceholder"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "pipe", type: LocaleDatePipe, name: "localeDate" }] });
|
|
21475
21546
|
}
|
|
21476
21547
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdFilterItemDateCategoryComponent, decorators: [{
|
|
21477
21548
|
type: Component,
|
|
21478
|
-
args: [{ selector: 'qd-filter-category-date', host: { class: 'qd-filter__category-date' }, standalone: false, template: "{{ this.i18n$ | async | translate }}
|
|
21549
|
+
args: [{ selector: 'qd-filter-category-date', host: { class: 'qd-filter__category-date' }, standalone: false, template: "<span\n class=\"qd-filter__date-label\"\n (click)=\"dateItem.open(); $event.stopPropagation()\"\n [attr.data-test-id]=\"testId + '-label'\"\n>\n {{ this.i18n$ | async | translate }} {{ \"i18n.qd.filter.date.on\" | translate }}\n</span>\n\n<qd-filter-item-date\n #dateItem\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"itemIndex\"\n [data-test-id]=\"testId + '-item'\"\n [timePickerConfig]=\"timePickerConfig\"\n (clickTimePlaceholder)=\"handleClickTimePlaceholder($event)\"\n></qd-filter-item-date>\n\n<qd-chip\n *ngIf=\"(item$ | async)?.active && (item$ | async)?.item\"\n [state]=\"'filter'\"\n [close]=\"true\"\n (closeClickEmitter)=\"removeItem($event)\"\n [data]=\"itemIndex\"\n [data-test-id]=\"testId + '-selected-chip-' + (item$ | async).item\"\n>\n {{ (item$ | async).item | localeDate : !!timePickerConfig : timePlaceholderSelected | async }}\n</qd-chip>\n", styles: [":host{display:flex;align-items:center;padding-right:.75rem;padding-left:.75rem;color:#757575;cursor:default;line-height:2.125rem}:host:hover{color:#171717}:host .qd-filter__date-label{cursor:pointer}\n"] }]
|
|
21479
21550
|
}], propDecorators: { filterId: [{
|
|
21480
21551
|
type: Input
|
|
21481
21552
|
}], categoryIndex: [{
|
|
@@ -21505,6 +21576,10 @@ class QdFilterItemDateRangeComponent {
|
|
|
21505
21576
|
get dataTestId() {
|
|
21506
21577
|
return this.testId;
|
|
21507
21578
|
}
|
|
21579
|
+
datepicker;
|
|
21580
|
+
open() {
|
|
21581
|
+
this.datepicker?.open();
|
|
21582
|
+
}
|
|
21508
21583
|
get minDate$() {
|
|
21509
21584
|
return this.filterService.getMinDate$(this.filterId, this.categoryIndex, this.itemIndex);
|
|
21510
21585
|
}
|
|
@@ -21558,7 +21633,7 @@ class QdFilterItemDateRangeComponent {
|
|
|
21558
21633
|
};
|
|
21559
21634
|
}
|
|
21560
21635
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdFilterItemDateRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
21561
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdFilterItemDateRangeComponent, isStandalone: false, selector: "qd-filter-item-date-range", inputs: { filterId: "filterId", categoryIndex: "categoryIndex", itemIndex: "itemIndex", timePickerConfig: "timePickerConfig", testId: ["data-test-id", "testId"] }, outputs: { clickTimePlaceholder: "clickTimePlaceholder" }, host: { properties: { "attr.class": "this.itemClassName", "attr.data-test-id": "this.dataTestId" } }, ngImport: i0, template: "<qd-datepicker\n [config]=\"config\"\n [(value)]=\"item\"\n (valueChange)=\"handleDateChange($event)\"\n (clickTimePlaceholder)=\"handleClickTimePlaceholder($event)\"\n [hasCalendarOnly]=\"true\"\n></qd-datepicker>\n", styles: [":host input{width:0!important;height:0!important;border:none!important}:host.qd-filter__item-date-range--0 ::ng-deep+.qd-chip.filter{margin-right:.25rem;margin-left:.1875rem!important}:host.qd-filter__item-date-range--1 ::ng-deep+.qd-chip.filter{margin-left:.1875rem!important}\n"], dependencies: [{ kind: "component", type: QdDatepickerComponent, selector: "qd-datepicker", inputs: ["config", "formControlName", "value", "hasCalendarOnly", "data-test-id"], outputs: ["valueChange", "clickTimePlaceholder", "clickHint", "clickReadonly", "clickViewonly"] }] });
|
|
21636
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdFilterItemDateRangeComponent, isStandalone: false, selector: "qd-filter-item-date-range", inputs: { filterId: "filterId", categoryIndex: "categoryIndex", itemIndex: "itemIndex", timePickerConfig: "timePickerConfig", testId: ["data-test-id", "testId"] }, outputs: { clickTimePlaceholder: "clickTimePlaceholder" }, host: { properties: { "attr.class": "this.itemClassName", "attr.data-test-id": "this.dataTestId" } }, viewQueries: [{ propertyName: "datepicker", first: true, predicate: QdDatepickerComponent, descendants: true }], ngImport: i0, template: "<qd-datepicker\n [config]=\"config\"\n [(value)]=\"item\"\n (valueChange)=\"handleDateChange($event)\"\n (clickTimePlaceholder)=\"handleClickTimePlaceholder($event)\"\n [hasCalendarOnly]=\"true\"\n></qd-datepicker>\n", styles: [":host input{width:0!important;height:0!important;border:none!important}:host.qd-filter__item-date-range--0 ::ng-deep+.qd-chip.filter{margin-right:.25rem;margin-left:.1875rem!important}:host.qd-filter__item-date-range--1 ::ng-deep+.qd-chip.filter{margin-left:.1875rem!important}\n"], dependencies: [{ kind: "component", type: QdDatepickerComponent, selector: "qd-datepicker", inputs: ["config", "formControlName", "value", "hasCalendarOnly", "data-test-id"], outputs: ["valueChange", "clickTimePlaceholder", "clickHint", "clickReadonly", "clickViewonly"] }] });
|
|
21562
21637
|
}
|
|
21563
21638
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdFilterItemDateRangeComponent, decorators: [{
|
|
21564
21639
|
type: Component,
|
|
@@ -21582,6 +21657,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
21582
21657
|
}], dataTestId: [{
|
|
21583
21658
|
type: HostBinding,
|
|
21584
21659
|
args: ['attr.data-test-id']
|
|
21660
|
+
}], datepicker: [{
|
|
21661
|
+
type: ViewChild,
|
|
21662
|
+
args: [QdDatepickerComponent]
|
|
21585
21663
|
}] } });
|
|
21586
21664
|
|
|
21587
21665
|
// @ts-strict-ignore
|
|
@@ -21611,6 +21689,10 @@ class QdFilterItemDateRangeCategoryComponent {
|
|
|
21611
21689
|
? { ...this.timePickerConfig, label: { i18n: 'i18n.qd.filter.dateRange.end' } }
|
|
21612
21690
|
: undefined;
|
|
21613
21691
|
}
|
|
21692
|
+
openItem(itemRef, event) {
|
|
21693
|
+
itemRef.open();
|
|
21694
|
+
event.stopPropagation();
|
|
21695
|
+
}
|
|
21614
21696
|
removeItem(itemIndex) {
|
|
21615
21697
|
this.filterService.updateItem(this.filterId, this.categoryIndex, itemIndex, '');
|
|
21616
21698
|
this.filterService.setItemIsActive(this.filterId, this.categoryIndex, itemIndex, false);
|
|
@@ -21630,11 +21712,11 @@ class QdFilterItemDateRangeCategoryComponent {
|
|
|
21630
21712
|
this[targetMember] = this.filterService.getItemById$(this.filterId, this.categoryIndex, index);
|
|
21631
21713
|
}
|
|
21632
21714
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdFilterItemDateRangeCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
21633
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdFilterItemDateRangeCategoryComponent, isStandalone: false, selector: "qd-filter-category-date-range", inputs: { filterId: "filterId", categoryIndex: "categoryIndex", testId: ["data-test-id", "testId"], timePickerConfig: "timePickerConfig" }, host: { classAttribute: "qd-filter__category-date-range" }, ngImport: i0, template: "{{ this.i18n$ | async | translate }}\n\n<span class=\"qd-filter__date-range__group\">\n <span class=\"qd-filter__item-date-range__label\">{{
|
|
21715
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdFilterItemDateRangeCategoryComponent, isStandalone: false, selector: "qd-filter-category-date-range", inputs: { filterId: "filterId", categoryIndex: "categoryIndex", testId: ["data-test-id", "testId"], timePickerConfig: "timePickerConfig" }, host: { classAttribute: "qd-filter__category-date-range" }, ngImport: i0, template: "{{ this.i18n$ | async | translate }}\n\n<span class=\"qd-filter__date-range__group\">\n <span class=\"qd-filter__item-date-range__label\" (click)=\"openItem(fromItemRef, $event)\">{{\n \"i18n.qd.filter.dateRange.from\" | translate\n }}</span>\n\n <qd-filter-item-date-range\n #fromItemRef\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"fromItemIndex\"\n [data-test-id]=\"testId + '-item-date-from'\"\n [timePickerConfig]=\"fromItemTimePickerConfig\"\n (clickTimePlaceholder)=\"handleFromTimePlaceholderClicked($event)\"\n ></qd-filter-item-date-range>\n\n <qd-chip\n *ngIf=\"(fromItem$ | async)?.active && (fromItem$ | async)?.item\"\n [state]=\"'filter'\"\n [close]=\"true\"\n (closeClickEmitter)=\"removeItem($event)\"\n [data]=\"fromItemIndex\"\n [data-test-id]=\"testId + '-selected-chip-' + (fromItem$ | async).item\"\n >\n {{ (fromItem$ | async).item | localeDate : !!timePickerConfig : fromItemTimePlaceholderClicked | async }}\n </qd-chip>\n</span>\n\n<span class=\"qd-filter__date-range__group\">\n <span class=\"qd-filter__item-date-range__label\" (click)=\"openItem(untilItemRef, $event)\">{{\n \"i18n.qd.filter.dateRange.until\" | translate\n }}</span>\n\n <qd-filter-item-date-range\n #untilItemRef\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"untilItemIndex\"\n [data-test-id]=\"testId + '-item-date-until'\"\n [timePickerConfig]=\"untilItemTimePickerConfig\"\n (clickTimePlaceholder)=\"handleUntilTimePlaceholderClicked($event)\"\n ></qd-filter-item-date-range>\n\n <qd-chip\n *ngIf=\"(untilItem$ | async)?.active && (untilItem$ | async)?.item\"\n [state]=\"'filter'\"\n [close]=\"true\"\n (closeClickEmitter)=\"removeItem($event)\"\n [data]=\"untilItemIndex\"\n [data-test-id]=\"testId + '-selected-chip-' + (untilItem$ | async).item\"\n >\n {{ (untilItem$ | async).item | localeDate : !!timePickerConfig : untilItemTimePlaceholderClicked | async }}\n </qd-chip>\n</span>\n", styles: [":host{display:flex;flex-wrap:wrap;align-items:center;padding-right:.75rem;padding-left:.75rem;color:#757575;cursor:default;line-height:2.125rem}:host:hover{color:#171717}:host .qd-filter__item-date-range__label{margin-left:.25rem;cursor:pointer}:host .qd-filter__date-range__group{display:flex;align-items:center}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: QdChipComponent, selector: "qd-chip", inputs: ["state", "close", "data", "data-test-id"], outputs: ["closeClickEmitter"] }, { kind: "component", type: QdFilterItemDateRangeComponent, selector: "qd-filter-item-date-range", inputs: ["filterId", "categoryIndex", "itemIndex", "timePickerConfig", "data-test-id"], outputs: ["clickTimePlaceholder"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "pipe", type: LocaleDatePipe, name: "localeDate" }] });
|
|
21634
21716
|
}
|
|
21635
21717
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdFilterItemDateRangeCategoryComponent, decorators: [{
|
|
21636
21718
|
type: Component,
|
|
21637
|
-
args: [{ selector: 'qd-filter-category-date-range', host: { class: 'qd-filter__category-date-range' }, standalone: false, template: "{{ this.i18n$ | async | translate }}\n\n<span class=\"qd-filter__date-range__group\">\n <span class=\"qd-filter__item-date-range__label\">{{
|
|
21719
|
+
args: [{ selector: 'qd-filter-category-date-range', host: { class: 'qd-filter__category-date-range' }, standalone: false, template: "{{ this.i18n$ | async | translate }}\n\n<span class=\"qd-filter__date-range__group\">\n <span class=\"qd-filter__item-date-range__label\" (click)=\"openItem(fromItemRef, $event)\">{{\n \"i18n.qd.filter.dateRange.from\" | translate\n }}</span>\n\n <qd-filter-item-date-range\n #fromItemRef\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"fromItemIndex\"\n [data-test-id]=\"testId + '-item-date-from'\"\n [timePickerConfig]=\"fromItemTimePickerConfig\"\n (clickTimePlaceholder)=\"handleFromTimePlaceholderClicked($event)\"\n ></qd-filter-item-date-range>\n\n <qd-chip\n *ngIf=\"(fromItem$ | async)?.active && (fromItem$ | async)?.item\"\n [state]=\"'filter'\"\n [close]=\"true\"\n (closeClickEmitter)=\"removeItem($event)\"\n [data]=\"fromItemIndex\"\n [data-test-id]=\"testId + '-selected-chip-' + (fromItem$ | async).item\"\n >\n {{ (fromItem$ | async).item | localeDate : !!timePickerConfig : fromItemTimePlaceholderClicked | async }}\n </qd-chip>\n</span>\n\n<span class=\"qd-filter__date-range__group\">\n <span class=\"qd-filter__item-date-range__label\" (click)=\"openItem(untilItemRef, $event)\">{{\n \"i18n.qd.filter.dateRange.until\" | translate\n }}</span>\n\n <qd-filter-item-date-range\n #untilItemRef\n [filterId]=\"filterId\"\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"untilItemIndex\"\n [data-test-id]=\"testId + '-item-date-until'\"\n [timePickerConfig]=\"untilItemTimePickerConfig\"\n (clickTimePlaceholder)=\"handleUntilTimePlaceholderClicked($event)\"\n ></qd-filter-item-date-range>\n\n <qd-chip\n *ngIf=\"(untilItem$ | async)?.active && (untilItem$ | async)?.item\"\n [state]=\"'filter'\"\n [close]=\"true\"\n (closeClickEmitter)=\"removeItem($event)\"\n [data]=\"untilItemIndex\"\n [data-test-id]=\"testId + '-selected-chip-' + (untilItem$ | async).item\"\n >\n {{ (untilItem$ | async).item | localeDate : !!timePickerConfig : untilItemTimePlaceholderClicked | async }}\n </qd-chip>\n</span>\n", styles: [":host{display:flex;flex-wrap:wrap;align-items:center;padding-right:.75rem;padding-left:.75rem;color:#757575;cursor:default;line-height:2.125rem}:host:hover{color:#171717}:host .qd-filter__item-date-range__label{margin-left:.25rem;cursor:pointer}:host .qd-filter__date-range__group{display:flex;align-items:center}\n"] }]
|
|
21638
21720
|
}], propDecorators: { filterId: [{
|
|
21639
21721
|
type: Input
|
|
21640
21722
|
}], categoryIndex: [{
|
|
@@ -21760,6 +21842,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
21760
21842
|
|
|
21761
21843
|
class QdFilterItemSelectCategoryComponent {
|
|
21762
21844
|
filterService = inject(QdFilterService);
|
|
21845
|
+
breakpointService = inject(QdBreakpointService);
|
|
21846
|
+
isMobile$ = this.breakpointService.isViewportBelow('md');
|
|
21763
21847
|
filterId;
|
|
21764
21848
|
categoryIndex;
|
|
21765
21849
|
testId;
|
|
@@ -21771,15 +21855,34 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
21771
21855
|
items;
|
|
21772
21856
|
dependsOn = [];
|
|
21773
21857
|
showSelectButton$;
|
|
21858
|
+
itemsLoading$;
|
|
21774
21859
|
positionStrategy = [
|
|
21775
21860
|
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: -1 },
|
|
21776
21861
|
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', weight: 0.8, offsetY: 1 }
|
|
21777
21862
|
];
|
|
21778
21863
|
maxFlyoutHeight = 378;
|
|
21779
21864
|
_destroyRef = inject(DestroyRef);
|
|
21865
|
+
frozenSelectedKeys = [];
|
|
21866
|
+
frozenUnselectedKeys = [];
|
|
21780
21867
|
get closeButton() {
|
|
21781
21868
|
return this.type === 'multiSelect';
|
|
21782
21869
|
}
|
|
21870
|
+
get activeItemCount() {
|
|
21871
|
+
return this.items?.filter(item => item.active).length ?? 0;
|
|
21872
|
+
}
|
|
21873
|
+
get selectedDropdownEntries() {
|
|
21874
|
+
return this.toEntries(this.frozenSelectedKeys);
|
|
21875
|
+
}
|
|
21876
|
+
get unselectedDropdownEntries() {
|
|
21877
|
+
return this.toEntries(this.frozenUnselectedKeys);
|
|
21878
|
+
}
|
|
21879
|
+
get showSelectedSeparator() {
|
|
21880
|
+
return (this.selectedDropdownEntries.some(entry => !entry.item.hidden) &&
|
|
21881
|
+
this.unselectedDropdownEntries.some(entry => !entry.item.hidden));
|
|
21882
|
+
}
|
|
21883
|
+
get hasNoVisibleItems() {
|
|
21884
|
+
return (this.items ?? []).every(item => item.hidden);
|
|
21885
|
+
}
|
|
21783
21886
|
get buttonClassName() {
|
|
21784
21887
|
return `
|
|
21785
21888
|
qd-filter__category-button
|
|
@@ -21798,9 +21901,11 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
21798
21901
|
this.initCategorySubscription();
|
|
21799
21902
|
this.initItemsSubscription();
|
|
21800
21903
|
this.initShowSelectButton();
|
|
21904
|
+
this.itemsLoading$ = this.filterService.getItemsLoading$(this.filterId, this.categoryIndex);
|
|
21801
21905
|
}
|
|
21802
21906
|
onLayerOpened() {
|
|
21803
21907
|
this.open = true;
|
|
21908
|
+
this.freezeDropdownOrder();
|
|
21804
21909
|
}
|
|
21805
21910
|
onLayerClosed() {
|
|
21806
21911
|
this.open = false;
|
|
@@ -21812,6 +21917,27 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
21812
21917
|
this.filterService.setItemIsActive(this.filterId, this.categoryIndex, itemIndex, false);
|
|
21813
21918
|
this.filterService.resetCategoryFilter(this.filterId, this.categoryIndex);
|
|
21814
21919
|
}
|
|
21920
|
+
clearAll() {
|
|
21921
|
+
this.filterService.clearCategorySelection(this.filterId, this.categoryIndex);
|
|
21922
|
+
this.filterService.resetCategoryFilter(this.filterId, this.categoryIndex);
|
|
21923
|
+
}
|
|
21924
|
+
trackByItem(_index, entry) {
|
|
21925
|
+
return entry.item.item;
|
|
21926
|
+
}
|
|
21927
|
+
freezeDropdownOrder() {
|
|
21928
|
+
const items = this.items ?? [];
|
|
21929
|
+
this.frozenSelectedKeys = items.filter(item => item.active).map(item => item.item);
|
|
21930
|
+
this.frozenUnselectedKeys = items.filter(item => !item.active).map(item => item.item);
|
|
21931
|
+
}
|
|
21932
|
+
toEntries(keys) {
|
|
21933
|
+
const items = this.items ?? [];
|
|
21934
|
+
return keys
|
|
21935
|
+
.map(key => {
|
|
21936
|
+
const itemIndex = items.findIndex(item => item.item === key);
|
|
21937
|
+
return { item: items[itemIndex], itemIndex };
|
|
21938
|
+
})
|
|
21939
|
+
.filter(entry => !!entry.item);
|
|
21940
|
+
}
|
|
21815
21941
|
changeValue($event) {
|
|
21816
21942
|
this.filterService.hideShowItems(this.filterId, this.categoryIndex, $event);
|
|
21817
21943
|
this.filterService.setCategoryFilter(this.filterId, this.categoryIndex, $event);
|
|
@@ -21831,7 +21957,19 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
21831
21957
|
this.filterService
|
|
21832
21958
|
.getItems$(this.filterId, this.categoryIndex)
|
|
21833
21959
|
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
21834
|
-
.subscribe(items =>
|
|
21960
|
+
.subscribe(items => {
|
|
21961
|
+
const itemSetChanged = !this.haveSameItemKeys(this.items, items);
|
|
21962
|
+
this.items = items;
|
|
21963
|
+
if (this.open && itemSetChanged)
|
|
21964
|
+
this.freezeDropdownOrder();
|
|
21965
|
+
this.popoverDirective?.updatePosition();
|
|
21966
|
+
});
|
|
21967
|
+
}
|
|
21968
|
+
haveSameItemKeys(previous, next) {
|
|
21969
|
+
const previousItems = previous ?? [];
|
|
21970
|
+
const nextItems = next ?? [];
|
|
21971
|
+
return (previousItems.length === nextItems.length &&
|
|
21972
|
+
previousItems.every((item, index) => item.item === nextItems[index].item));
|
|
21835
21973
|
}
|
|
21836
21974
|
initShowSelectButton() {
|
|
21837
21975
|
const category$ = this.filterService
|
|
@@ -21853,11 +21991,11 @@ class QdFilterItemSelectCategoryComponent {
|
|
|
21853
21991
|
}));
|
|
21854
21992
|
}
|
|
21855
21993
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdFilterItemSelectCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
21856
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdFilterItemSelectCategoryComponent, isStandalone: false, selector: "qd-filter-category-select", inputs: { filterId: "filterId", categoryIndex: "categoryIndex", testId: ["data-test-id", "testId"] }, host: { classAttribute: "qd-filter__category-select" }, viewQueries: [{ propertyName: "popoverDirective", first: true, predicate: QdPopoverOnClickDirective, descendants: true }], ngImport: i0, template: "<div\n *ngIf=\"showSelectButton$ | async\"\n [class]=\"buttonClassName\"\n [qdPopoverOnClick]=\"filterLayer\"\n [qdPopoverCloseStrategy]=\"'onOutsideClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverMaxHeight]=\"maxFlyoutHeight\"\n [positionStrategy]=\"positionStrategy\"\n (opened)=\"onLayerOpened()\"\n (closed)=\"onLayerClosed()\"\n [attr.data-test-id]=\"testId + '-select-button'\"\n>\n <qd-icon\n *ngIf=\"!open\"\n [icon]=\"'ctrlDown'\"\n [class]=\"'qd-filter__category-icon qd-filter__category-icon--closed'\"\n [attr.data-test-id]=\"testId + '-closed'\"\n ></qd-icon>\n <qd-icon\n *ngIf=\"open\"\n [icon]=\"'ctrlTop'\"\n [class]=\"'qd-filter__category-icon qd-filter__category-icon--open'\"\n [attr.data-test-id]=\"testId + '-opened'\"\n ></qd-icon>\n\n <div class=\"qd-filter__category-button-caption\">\n <span>\n {{ i18n | translate }}\n </span>\n </div>\n\n <ng-container *ngTemplateOutlet=\"SelectedChip\"></ng-container>\n</div>\n\n<ng-template #filterLayer>\n <div [class]=\"layerContentClassName\">\n <qd-icon\n *ngIf=\"closeButton\"\n [class]=\"'qd-filter__category-layer-close'\"\n (click)=\"closeLayer()\"\n [icon]=\"'
|
|
21994
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdFilterItemSelectCategoryComponent, isStandalone: false, selector: "qd-filter-category-select", inputs: { filterId: "filterId", categoryIndex: "categoryIndex", testId: ["data-test-id", "testId"] }, host: { classAttribute: "qd-filter__category-select" }, viewQueries: [{ propertyName: "popoverDirective", first: true, predicate: QdPopoverOnClickDirective, descendants: true }], ngImport: i0, template: "<div\n *ngIf=\"showSelectButton$ | async\"\n [class]=\"buttonClassName\"\n [qdPopoverOnClick]=\"filterLayer\"\n [qdPopoverCloseStrategy]=\"'onOutsideClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverMaxHeight]=\"maxFlyoutHeight\"\n [positionStrategy]=\"positionStrategy\"\n (opened)=\"onLayerOpened()\"\n (closed)=\"onLayerClosed()\"\n [attr.data-test-id]=\"testId + '-select-button'\"\n>\n <qd-icon\n *ngIf=\"!open\"\n [icon]=\"'ctrlDown'\"\n [class]=\"'qd-filter__category-icon qd-filter__category-icon--closed'\"\n [attr.data-test-id]=\"testId + '-closed'\"\n ></qd-icon>\n <qd-icon\n *ngIf=\"open\"\n [icon]=\"'ctrlTop'\"\n [class]=\"'qd-filter__category-icon qd-filter__category-icon--open'\"\n [attr.data-test-id]=\"testId + '-opened'\"\n ></qd-icon>\n\n <div class=\"qd-filter__category-button-caption\">\n <span>\n {{ i18n | translate }}\n </span>\n </div>\n\n <ng-container *ngIf=\"(isMobile$ | async) && type === 'multiSelect'; else desktopChips\">\n <qd-chip\n *ngIf=\"activeItemCount > 0\"\n [state]=\"'filter'\"\n [close]=\"true\"\n (closeClickEmitter)=\"clearAll()\"\n [data-test-id]=\"testId + '-selected-chip-count'\"\n >{{ activeItemCount }}</qd-chip\n >\n </ng-container>\n <ng-template #desktopChips>\n <ng-container *ngTemplateOutlet=\"SelectedChip\"></ng-container>\n </ng-template>\n</div>\n\n<ng-template #filterLayer>\n <div [class]=\"layerContentClassName\">\n <qd-icon\n *ngIf=\"closeButton\"\n [class]=\"'qd-filter__category-layer-close'\"\n (click)=\"closeLayer()\"\n [icon]=\"'ctrlTop'\"\n [attr.data-test-id]=\"testId + '-layer-close'\"\n ></qd-icon>\n\n <ng-container *ngIf=\"itemsLoading$ | async; else categoryContent\" [ngTemplateOutlet]=\"loadingState\"></ng-container>\n\n <ng-template #categoryContent>\n <ng-container [ngSwitch]=\"type\">\n <ng-container *ngSwitchCase=\"'multiSelect'\">\n <qd-filter-form-items\n *ngIf=\"filter\"\n [inputFilterValue]=\"filterCategoryValue$ | async\"\n (filterValueChange)=\"changeValue($event)\"\n [data-test-id]=\"testId\"\n ></qd-filter-form-items>\n\n <div class=\"qd-filter__category-layer-items\">\n <ng-container\n *ngFor=\"let entry of selectedDropdownEntries; trackBy: trackByItem\"\n [ngTemplateOutlet]=\"multiSelectItem\"\n [ngTemplateOutletContext]=\"{ item: entry.item, itemIndex: entry.itemIndex }\"\n ></ng-container>\n\n <div\n *ngIf=\"showSelectedSeparator\"\n class=\"qd-filter__category-layer-separator\"\n [attr.data-test-id]=\"testId + '-selected-separator'\"\n ></div>\n\n <ng-container\n *ngFor=\"let entry of unselectedDropdownEntries; trackBy: trackByItem\"\n [ngTemplateOutlet]=\"multiSelectItem\"\n [ngTemplateOutletContext]=\"{ item: entry.item, itemIndex: entry.itemIndex }\"\n ></ng-container>\n\n <ng-container *ngIf=\"hasNoVisibleItems\" [ngTemplateOutlet]=\"emptyState\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'singleSelect'\">\n <qd-filter-form-items\n *ngIf=\"filter\"\n [inputFilterValue]=\"filterCategoryValue$ | async\"\n (filterValueChange)=\"changeValue($event)\"\n [data-test-id]=\"testId\"\n ></qd-filter-form-items>\n\n <div class=\"qd-filter__category-layer-items\">\n <ng-container *ngFor=\"let item of items; let itemIndex = index\">\n <qd-filter-item-single-select\n *ngIf=\"!item.hidden\"\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"itemIndex\"\n (closeEventEmitter)=\"closeLayer()\"\n [filterId]=\"filterId\"\n [data-test-id]=\"testId + '-item-' + itemIndex + '-' + item.item\"\n >\n </qd-filter-item-single-select>\n </ng-container>\n\n <ng-container *ngIf=\"hasNoVisibleItems\" [ngTemplateOutlet]=\"emptyState\"></ng-container>\n </div>\n </ng-container>\n </ng-container>\n </ng-template>\n </div>\n</ng-template>\n\n<ng-template #emptyState>\n <p class=\"qd-filter__category-layer-empty\" [attr.data-test-id]=\"testId + '-no-results'\">\n {{ \"i18n.qd.filter.noResults\" | translate }}\n </p>\n</ng-template>\n\n<ng-template #loadingState>\n <p class=\"qd-filter__category-layer-loading\" [attr.data-test-id]=\"testId + '-items-loading'\">\n {{ \"i18n.qd.filter.loading\" | translate }}\n </p>\n</ng-template>\n\n<ng-template #multiSelectItem let-item=\"item\" let-itemIndex=\"itemIndex\">\n <qd-filter-item-multi-select\n *ngIf=\"!item.hidden\"\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"itemIndex\"\n [filterId]=\"filterId\"\n [data-test-id]=\"testId + '-item-' + itemIndex + '-' + item.item\"\n ></qd-filter-item-multi-select>\n</ng-template>\n\n<ng-template #SelectedChip>\n <ng-container *ngFor=\"let item of items; let itemIndex = index\">\n <!-- TODO: Add tooltip-->\n <qd-chip\n *ngIf=\"item.active\"\n [state]=\"'filter'\"\n [close]=\"true\"\n (closeClickEmitter)=\"close($event)\"\n [data]=\"itemIndex\"\n [data-test-id]=\"testId + '-selected-chip-' + item.item\"\n >{{ item.i18n | translate }}</qd-chip\n >\n </ng-container>\n</ng-template>\n", styles: ["::ng-deep .qd-filter__category-layer{position:relative;display:flex;overflow:hidden;min-width:16.25rem;max-width:56.25rem;height:100%;flex-direction:column;padding:0;border:.0625rem solid rgb(151,151,151);background:#fff;box-shadow:#d5d5d5 .125rem .25rem .4375rem}::ng-deep .qd-filter__category-layer .qd-filter-form-items__filter{flex-shrink:0;margin-bottom:0}::ng-deep .qd-filter__category-layer .qd-checkbox__label{display:flex;height:2.5rem}::ng-deep .qd-filter__category-layer .qd-checkbox__indicator,::ng-deep .qd-filter__category-layer .qd-radio-buttons__indicator{transform:translateY(-.0625rem)}::ng-deep .qd-filter__category-layer-items{flex:1;overflow-y:auto}::ng-deep .qd-filter__category-layer-separator{height:.0625rem;flex-shrink:0;background:#d5d5d5}::ng-deep .qd-filter__category-layer-empty,::ng-deep .qd-filter__category-layer-loading{padding:0 .9375rem;margin:0;color:#757575;font-size:.875rem;line-height:2.5rem}::ng-deep .qd-filter__category-layer-container{position:relative}::ng-deep .qd-filter__category-layer-close{position:absolute;z-index:1;top:.5rem;right:1rem;color:#757575;cursor:pointer}::ng-deep .qd-filter__category-layer-close:before{position:absolute;content:\"\";inset:-.5rem}::ng-deep .qd-filter__category-layer-close:hover,::ng-deep .qd-filter__category-layer-close:focus{color:#171717}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: QdChipComponent, selector: "qd-chip", inputs: ["state", "close", "data", "data-test-id"], outputs: ["closeClickEmitter"] }, { kind: "component", type: QdFilterFormItemsComponent, selector: "qd-filter-form-items", inputs: ["inputFilterValue", "data-test-id"], outputs: ["filterValueChange"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { kind: "directive", type: QdPopoverOnClickDirective, selector: "[qdPopoverOnClick]", inputs: ["qdPopoverOnClick", "positionStrategy", "qdPopoverCloseStrategy", "qdPopoverDisabled", "qdPopoverStopPropagation", "qdPopoverBackgroundColor", "qdPopoverMaxHeight", "qdPopoverMinWidth", "qdPopoverMaxWidth", "qdPopoverAutoSize", "qdPopoverEnableKeyControl"], outputs: ["opened", "closed"], exportAs: ["qdPopoverOnClick"] }, { kind: "component", type: QdFilterItemMultiSelectComponent, selector: "qd-filter-item-multi-select", inputs: ["filterId", "categoryIndex", "itemIndex", "data-test-id"] }, { kind: "component", type: QdFilterItemSingleSelectComponent, selector: "qd-filter-item-single-select", inputs: ["filterId", "categoryIndex", "itemIndex", "data-test-id"], outputs: ["closeEventEmitter"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
21857
21995
|
}
|
|
21858
21996
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdFilterItemSelectCategoryComponent, decorators: [{
|
|
21859
21997
|
type: Component,
|
|
21860
|
-
args: [{ selector: 'qd-filter-category-select', host: { class: 'qd-filter__category-select' }, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div\n *ngIf=\"showSelectButton$ | async\"\n [class]=\"buttonClassName\"\n [qdPopoverOnClick]=\"filterLayer\"\n [qdPopoverCloseStrategy]=\"'onOutsideClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverMaxHeight]=\"maxFlyoutHeight\"\n [positionStrategy]=\"positionStrategy\"\n (opened)=\"onLayerOpened()\"\n (closed)=\"onLayerClosed()\"\n [attr.data-test-id]=\"testId + '-select-button'\"\n>\n <qd-icon\n *ngIf=\"!open\"\n [icon]=\"'ctrlDown'\"\n [class]=\"'qd-filter__category-icon qd-filter__category-icon--closed'\"\n [attr.data-test-id]=\"testId + '-closed'\"\n ></qd-icon>\n <qd-icon\n *ngIf=\"open\"\n [icon]=\"'ctrlTop'\"\n [class]=\"'qd-filter__category-icon qd-filter__category-icon--open'\"\n [attr.data-test-id]=\"testId + '-opened'\"\n ></qd-icon>\n\n <div class=\"qd-filter__category-button-caption\">\n <span>\n {{ i18n | translate }}\n </span>\n </div>\n\n <ng-container *ngTemplateOutlet=\"SelectedChip\"></ng-container>\n</div>\n\n<ng-template #filterLayer>\n <div [class]=\"layerContentClassName\">\n <qd-icon\n *ngIf=\"closeButton\"\n [class]=\"'qd-filter__category-layer-close'\"\n (click)=\"closeLayer()\"\n [icon]=\"'
|
|
21998
|
+
args: [{ selector: 'qd-filter-category-select', host: { class: 'qd-filter__category-select' }, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div\n *ngIf=\"showSelectButton$ | async\"\n [class]=\"buttonClassName\"\n [qdPopoverOnClick]=\"filterLayer\"\n [qdPopoverCloseStrategy]=\"'onOutsideClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverMaxHeight]=\"maxFlyoutHeight\"\n [positionStrategy]=\"positionStrategy\"\n (opened)=\"onLayerOpened()\"\n (closed)=\"onLayerClosed()\"\n [attr.data-test-id]=\"testId + '-select-button'\"\n>\n <qd-icon\n *ngIf=\"!open\"\n [icon]=\"'ctrlDown'\"\n [class]=\"'qd-filter__category-icon qd-filter__category-icon--closed'\"\n [attr.data-test-id]=\"testId + '-closed'\"\n ></qd-icon>\n <qd-icon\n *ngIf=\"open\"\n [icon]=\"'ctrlTop'\"\n [class]=\"'qd-filter__category-icon qd-filter__category-icon--open'\"\n [attr.data-test-id]=\"testId + '-opened'\"\n ></qd-icon>\n\n <div class=\"qd-filter__category-button-caption\">\n <span>\n {{ i18n | translate }}\n </span>\n </div>\n\n <ng-container *ngIf=\"(isMobile$ | async) && type === 'multiSelect'; else desktopChips\">\n <qd-chip\n *ngIf=\"activeItemCount > 0\"\n [state]=\"'filter'\"\n [close]=\"true\"\n (closeClickEmitter)=\"clearAll()\"\n [data-test-id]=\"testId + '-selected-chip-count'\"\n >{{ activeItemCount }}</qd-chip\n >\n </ng-container>\n <ng-template #desktopChips>\n <ng-container *ngTemplateOutlet=\"SelectedChip\"></ng-container>\n </ng-template>\n</div>\n\n<ng-template #filterLayer>\n <div [class]=\"layerContentClassName\">\n <qd-icon\n *ngIf=\"closeButton\"\n [class]=\"'qd-filter__category-layer-close'\"\n (click)=\"closeLayer()\"\n [icon]=\"'ctrlTop'\"\n [attr.data-test-id]=\"testId + '-layer-close'\"\n ></qd-icon>\n\n <ng-container *ngIf=\"itemsLoading$ | async; else categoryContent\" [ngTemplateOutlet]=\"loadingState\"></ng-container>\n\n <ng-template #categoryContent>\n <ng-container [ngSwitch]=\"type\">\n <ng-container *ngSwitchCase=\"'multiSelect'\">\n <qd-filter-form-items\n *ngIf=\"filter\"\n [inputFilterValue]=\"filterCategoryValue$ | async\"\n (filterValueChange)=\"changeValue($event)\"\n [data-test-id]=\"testId\"\n ></qd-filter-form-items>\n\n <div class=\"qd-filter__category-layer-items\">\n <ng-container\n *ngFor=\"let entry of selectedDropdownEntries; trackBy: trackByItem\"\n [ngTemplateOutlet]=\"multiSelectItem\"\n [ngTemplateOutletContext]=\"{ item: entry.item, itemIndex: entry.itemIndex }\"\n ></ng-container>\n\n <div\n *ngIf=\"showSelectedSeparator\"\n class=\"qd-filter__category-layer-separator\"\n [attr.data-test-id]=\"testId + '-selected-separator'\"\n ></div>\n\n <ng-container\n *ngFor=\"let entry of unselectedDropdownEntries; trackBy: trackByItem\"\n [ngTemplateOutlet]=\"multiSelectItem\"\n [ngTemplateOutletContext]=\"{ item: entry.item, itemIndex: entry.itemIndex }\"\n ></ng-container>\n\n <ng-container *ngIf=\"hasNoVisibleItems\" [ngTemplateOutlet]=\"emptyState\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'singleSelect'\">\n <qd-filter-form-items\n *ngIf=\"filter\"\n [inputFilterValue]=\"filterCategoryValue$ | async\"\n (filterValueChange)=\"changeValue($event)\"\n [data-test-id]=\"testId\"\n ></qd-filter-form-items>\n\n <div class=\"qd-filter__category-layer-items\">\n <ng-container *ngFor=\"let item of items; let itemIndex = index\">\n <qd-filter-item-single-select\n *ngIf=\"!item.hidden\"\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"itemIndex\"\n (closeEventEmitter)=\"closeLayer()\"\n [filterId]=\"filterId\"\n [data-test-id]=\"testId + '-item-' + itemIndex + '-' + item.item\"\n >\n </qd-filter-item-single-select>\n </ng-container>\n\n <ng-container *ngIf=\"hasNoVisibleItems\" [ngTemplateOutlet]=\"emptyState\"></ng-container>\n </div>\n </ng-container>\n </ng-container>\n </ng-template>\n </div>\n</ng-template>\n\n<ng-template #emptyState>\n <p class=\"qd-filter__category-layer-empty\" [attr.data-test-id]=\"testId + '-no-results'\">\n {{ \"i18n.qd.filter.noResults\" | translate }}\n </p>\n</ng-template>\n\n<ng-template #loadingState>\n <p class=\"qd-filter__category-layer-loading\" [attr.data-test-id]=\"testId + '-items-loading'\">\n {{ \"i18n.qd.filter.loading\" | translate }}\n </p>\n</ng-template>\n\n<ng-template #multiSelectItem let-item=\"item\" let-itemIndex=\"itemIndex\">\n <qd-filter-item-multi-select\n *ngIf=\"!item.hidden\"\n [categoryIndex]=\"categoryIndex\"\n [itemIndex]=\"itemIndex\"\n [filterId]=\"filterId\"\n [data-test-id]=\"testId + '-item-' + itemIndex + '-' + item.item\"\n ></qd-filter-item-multi-select>\n</ng-template>\n\n<ng-template #SelectedChip>\n <ng-container *ngFor=\"let item of items; let itemIndex = index\">\n <!-- TODO: Add tooltip-->\n <qd-chip\n *ngIf=\"item.active\"\n [state]=\"'filter'\"\n [close]=\"true\"\n (closeClickEmitter)=\"close($event)\"\n [data]=\"itemIndex\"\n [data-test-id]=\"testId + '-selected-chip-' + item.item\"\n >{{ item.i18n | translate }}</qd-chip\n >\n </ng-container>\n</ng-template>\n", styles: ["::ng-deep .qd-filter__category-layer{position:relative;display:flex;overflow:hidden;min-width:16.25rem;max-width:56.25rem;height:100%;flex-direction:column;padding:0;border:.0625rem solid rgb(151,151,151);background:#fff;box-shadow:#d5d5d5 .125rem .25rem .4375rem}::ng-deep .qd-filter__category-layer .qd-filter-form-items__filter{flex-shrink:0;margin-bottom:0}::ng-deep .qd-filter__category-layer .qd-checkbox__label{display:flex;height:2.5rem}::ng-deep .qd-filter__category-layer .qd-checkbox__indicator,::ng-deep .qd-filter__category-layer .qd-radio-buttons__indicator{transform:translateY(-.0625rem)}::ng-deep .qd-filter__category-layer-items{flex:1;overflow-y:auto}::ng-deep .qd-filter__category-layer-separator{height:.0625rem;flex-shrink:0;background:#d5d5d5}::ng-deep .qd-filter__category-layer-empty,::ng-deep .qd-filter__category-layer-loading{padding:0 .9375rem;margin:0;color:#757575;font-size:.875rem;line-height:2.5rem}::ng-deep .qd-filter__category-layer-container{position:relative}::ng-deep .qd-filter__category-layer-close{position:absolute;z-index:1;top:.5rem;right:1rem;color:#757575;cursor:pointer}::ng-deep .qd-filter__category-layer-close:before{position:absolute;content:\"\";inset:-.5rem}::ng-deep .qd-filter__category-layer-close:hover,::ng-deep .qd-filter__category-layer-close:focus{color:#171717}\n"] }]
|
|
21861
21999
|
}], propDecorators: { filterId: [{
|
|
21862
22000
|
type: Input
|
|
21863
22001
|
}], categoryIndex: [{
|
|
@@ -22108,11 +22246,17 @@ class QdDependentFiltersService {
|
|
|
22108
22246
|
return this.categories.filter(category => category.hasOwnProperty('dependsOn'));
|
|
22109
22247
|
}
|
|
22110
22248
|
resolveItemsWhenDependsOnCategoriesChange(dependentCategory) {
|
|
22249
|
+
const dependentCategoryIndex = this.categories.indexOf(dependentCategory);
|
|
22111
22250
|
return combineLatest(dependentCategory.dependsOn.map(dependsOnCategory => this.filterService.getCategoryById$(this.filterId, this.categories.findIndex(({ category }) => category === dependsOnCategory)))).pipe(distinctUntilChanged(isEqual), switchMap(parentCategories => {
|
|
22112
22251
|
const allParentsActive = parentCategories.every((parent) => Array.isArray(parent.items) && parent.items.some(item => item.active));
|
|
22113
|
-
if (!allParentsActive)
|
|
22252
|
+
if (!allParentsActive) {
|
|
22253
|
+
this.filterService.setItemsLoading(this.filterId, dependentCategoryIndex, false);
|
|
22114
22254
|
return of([]);
|
|
22115
|
-
|
|
22255
|
+
}
|
|
22256
|
+
this.filterService.setItemsLoading(this.filterId, dependentCategoryIndex, true);
|
|
22257
|
+
return dependentCategory
|
|
22258
|
+
.itemsResolver(parentCategories)
|
|
22259
|
+
.pipe(tap$1(() => this.filterService.setItemsLoading(this.filterId, dependentCategoryIndex, false)));
|
|
22116
22260
|
}));
|
|
22117
22261
|
}
|
|
22118
22262
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdDependentFiltersService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -22124,43 +22268,123 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
22124
22268
|
|
|
22125
22269
|
// @ts-strict-ignore
|
|
22126
22270
|
/**
|
|
22127
|
-
*
|
|
22271
|
+
* **QdFilterComponent** lets users build and apply a filter with several categories over a data set.
|
|
22272
|
+
*
|
|
22273
|
+
* #### **Features**
|
|
22274
|
+
*
|
|
22275
|
+
* - **Category types**: single and multi select dropdowns, a boolean toggle, date and date-time pickers, date and date-time ranges, and free text. A select dropdown can also show a filter field that narrows the item list.
|
|
22276
|
+
* - **Outputs**: react to the applied selection through the query-string and post-body outputs, or read the current selection at any time.
|
|
22277
|
+
* - **Multi-staging**: chain categories so one stage loads its items from the selection of another.
|
|
22278
|
+
* - **URL sync**: the selection is kept in the URL, so a view can be shared, bookmarked, and reopened.
|
|
22279
|
+
*
|
|
22280
|
+
* #### **Quick start**
|
|
22281
|
+
*
|
|
22282
|
+
* **1. Add the filter to the template**
|
|
22283
|
+
*
|
|
22284
|
+
* ```html
|
|
22285
|
+
* <qd-filter
|
|
22286
|
+
* [filterData]="myFilterConfig"
|
|
22287
|
+
* (queryStringOutput)="callBackendWithQueryString($event)"
|
|
22288
|
+
* (postBodyOutput)="callBackendWithResultObject($event)"
|
|
22289
|
+
* ></qd-filter>
|
|
22290
|
+
* ```
|
|
22291
|
+
*
|
|
22292
|
+
* **2. Define the config in your component**
|
|
22293
|
+
*
|
|
22294
|
+
* ```typescript
|
|
22295
|
+
* myFilterConfig: QdFilterConfigData = {
|
|
22296
|
+
* categories: [
|
|
22297
|
+
* {
|
|
22298
|
+
* type: 'singleSelect',
|
|
22299
|
+
* category: 'controlObject',
|
|
22300
|
+
* i18n: 'i18n.my.category.controlObject',
|
|
22301
|
+
* items: [
|
|
22302
|
+
* { item: 'vehicle', i18n: 'i18n.my.item.vehicle', active: true },
|
|
22303
|
+
* { item: 'article', i18n: 'i18n.my.item.article' }
|
|
22304
|
+
* ],
|
|
22305
|
+
* filter: true
|
|
22306
|
+
* },
|
|
22307
|
+
* {
|
|
22308
|
+
* type: 'multiSelect',
|
|
22309
|
+
* category: 'enrollmentCountry',
|
|
22310
|
+
* i18n: 'i18n.my.category.enrollmentCountry',
|
|
22311
|
+
* items: [
|
|
22312
|
+
* { item: 'de', i18n: 'i18n.my.item.de' },
|
|
22313
|
+
* { item: 'ch', i18n: 'i18n.my.item.ch' }
|
|
22314
|
+
* ]
|
|
22315
|
+
* }
|
|
22316
|
+
* ],
|
|
22317
|
+
* uid: 'overview-filter'
|
|
22318
|
+
* };
|
|
22319
|
+
* ```
|
|
22320
|
+
*
|
|
22321
|
+
* The `filterData` input is the only configuration. It holds the categories and the behavior flags.
|
|
22128
22322
|
*
|
|
22129
|
-
*
|
|
22130
|
-
* - **Filter**: Name of the component.
|
|
22131
|
-
* - **Categories**: A list of one or more different categories.
|
|
22132
|
-
* - **Items**: A list with one or more items belongs to a parent category.
|
|
22323
|
+
* #### **Category types**
|
|
22133
22324
|
*
|
|
22134
|
-
*
|
|
22325
|
+
* A category sets its type to one of: singleSelect, multiSelect, boolean, date, dateTime,
|
|
22326
|
+
* dateRange, dateTimeRange or freeText. Single and multi select show a dropdown, boolean is a
|
|
22327
|
+
* toggle, the date types open a picker (the date-time variants add a time picker), and free text
|
|
22328
|
+
* is a text field applied on enter.
|
|
22135
22329
|
*
|
|
22136
|
-
*
|
|
22137
|
-
*
|
|
22138
|
-
* the applied filters as an url string with an encoded *filter* parameter. The `(postBodyOutput)`
|
|
22139
|
-
* yields an object containing the categories and active items.
|
|
22330
|
+
* On a single or multi select you can add a filter field above the items with `filter: true` to
|
|
22331
|
+
* narrow the item list. It has no effect on the other types.
|
|
22140
22332
|
*
|
|
22141
|
-
*
|
|
22142
|
-
*
|
|
22333
|
+
* #### **Filter selection**
|
|
22334
|
+
*
|
|
22335
|
+
* Listen to the outputs to react when the user applies the filter. The query-string output gives
|
|
22336
|
+
* the selection as a URL string (for example filter=...); the post-body output gives it as an
|
|
22337
|
+
* object with the active categories and their values.
|
|
22338
|
+
*
|
|
22339
|
+
* The outputs fire when the user applies the filter, on reset (only when a preselection exists),
|
|
22340
|
+
* when the last active item is removed, and on load if a category starts active.
|
|
22341
|
+
*
|
|
22342
|
+
* To read the selection without waiting for an apply, call `getCurrentQueryString` or
|
|
22343
|
+
* `getCurrentPostBody`, or subscribe to `getFilterChanges$` for a continuous stream.
|
|
22344
|
+
*
|
|
22345
|
+
* #### **Multi-staging filters**
|
|
22346
|
+
*
|
|
22347
|
+
* To chain categories, give one a `dependsOn` list and an `itemsResolver`. In `dependsOn` you
|
|
22348
|
+
* name the parent categories. The resolver receives the active parents and returns the items for
|
|
22349
|
+
* this stage.
|
|
22350
|
+
*
|
|
22351
|
+
* ```typescript
|
|
22352
|
+
* const cityCategory: QdDependentFilterCategory = {
|
|
22353
|
+
* type: 'multiSelect',
|
|
22354
|
+
* category: 'city',
|
|
22355
|
+
* i18n: 'i18n.my.category.city',
|
|
22356
|
+
* dependsOn: ['country'],
|
|
22357
|
+
* itemsResolver: ([country]) =>
|
|
22358
|
+
* loadCitiesFor(country.items.filter(item => item.active)),
|
|
22359
|
+
* filter: true
|
|
22360
|
+
* };
|
|
22361
|
+
* ```
|
|
22143
22362
|
*
|
|
22144
|
-
*
|
|
22363
|
+
* The stage appears once every parent has an active item. While its items load, the open
|
|
22364
|
+
* dropdown shows a loading text instead of the list. If the resolver returns nothing, the list
|
|
22365
|
+
* stays empty. Multi-staging works only for single and multi select categories.
|
|
22145
22366
|
*
|
|
22146
|
-
*
|
|
22147
|
-
* a uid in the filter data config.
|
|
22367
|
+
* #### **URL synchronization**
|
|
22148
22368
|
*
|
|
22149
|
-
*
|
|
22369
|
+
* The filter keeps its selection in the URL filter parameter: it is saved when the selection
|
|
22370
|
+
* changes and read back when the page opens, so a user can share or bookmark the URL and return
|
|
22371
|
+
* to the same filter.
|
|
22150
22372
|
*
|
|
22151
|
-
*
|
|
22152
|
-
*
|
|
22153
|
-
* Always when one of these categories change the `itemsResolver` will be called with the list
|
|
22154
|
-
* of categories given in `dependsOn`. The `itemsResolver` can also be defined in the config where `dependsOn`
|
|
22155
|
-
* is also defined.
|
|
22373
|
+
* This is on by default. With more than one filter in a view, only one may own the URL, so set
|
|
22374
|
+
* `connectWithRouter` to false on every other filter.
|
|
22156
22375
|
*
|
|
22157
|
-
*
|
|
22158
|
-
* the corresponding filter stage won't be rendered.
|
|
22376
|
+
* #### **Preserve filter state**
|
|
22159
22377
|
*
|
|
22160
|
-
*
|
|
22378
|
+
* Give the config a stable `uid` to keep the selection while the user moves around the app, for
|
|
22379
|
+
* example from an overview to a detail page and back. The selection is restored the next time a
|
|
22380
|
+
* filter with the same `uid` is shown.
|
|
22161
22381
|
*
|
|
22162
|
-
*
|
|
22382
|
+
* #### **Reset behavior**
|
|
22163
22383
|
*
|
|
22384
|
+
* An item set to active is a preselection. The reset button reads "Reset" when there is no
|
|
22385
|
+
* preselection, and "Back to preselection" when the config starts with active items. It restores
|
|
22386
|
+
* the initial state. With instant filtering (`isInstantFiltering`) the apply and reset buttons
|
|
22387
|
+
* are hidden and the filter applies on every change.
|
|
22164
22388
|
*/
|
|
22165
22389
|
class QdFilterComponent {
|
|
22166
22390
|
filterService = inject(QdFilterService);
|