@indigina/ui-kit 1.1.594 → 1.1.595
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.
|
@@ -10251,9 +10251,21 @@ const getTimeZoneOffset = (userTimeZone, column) => {
|
|
|
10251
10251
|
return 'UTC';
|
|
10252
10252
|
};
|
|
10253
10253
|
const removeFilterPrefix = (value) => value.split('$filter=')[1];
|
|
10254
|
+
const hasEffectiveFilterValue = (value) => {
|
|
10255
|
+
if (value === null || value === undefined) {
|
|
10256
|
+
return false;
|
|
10257
|
+
}
|
|
10258
|
+
if (typeof value === 'string') {
|
|
10259
|
+
return value.trim().length > 0;
|
|
10260
|
+
}
|
|
10261
|
+
if (Array.isArray(value)) {
|
|
10262
|
+
return value.length > 0;
|
|
10263
|
+
}
|
|
10264
|
+
return true;
|
|
10265
|
+
};
|
|
10254
10266
|
const filterEmptyValues = (filters) => ({
|
|
10255
10267
|
logic: filters?.logic ?? KitFilterLogic.AND,
|
|
10256
|
-
filters: filters?.filters.filter(item => noValueRequiredFilterOperators.includes(item.operator) || (item.value
|
|
10268
|
+
filters: filters?.filters.filter(item => noValueRequiredFilterOperators.includes(item.operator) || hasEffectiveFilterValue(item.value)) ?? [],
|
|
10257
10269
|
});
|
|
10258
10270
|
const normalizeGuidFilter = (filter) => {
|
|
10259
10271
|
const guidFormat = /'((\{)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}(\})?)'/g;
|
|
@@ -10324,16 +10336,30 @@ const getValueFilters = (value) => {
|
|
|
10324
10336
|
});
|
|
10325
10337
|
};
|
|
10326
10338
|
const kitBuildOdataFilter = (filter, columns) => removeFilterPrefix(normalizeGuidFilter(kitDataStateToODataString({ filter }, true, columns)));
|
|
10339
|
+
const isEffectiveFilterValue = (cleanedFilter) => cleanedFilter.filters.length > 0;
|
|
10340
|
+
const buildFilterByType = (filter, cleanedFilter) => {
|
|
10341
|
+
if (!isEffectiveFilterValue(cleanedFilter)) {
|
|
10342
|
+
return null;
|
|
10343
|
+
}
|
|
10344
|
+
return {
|
|
10345
|
+
...cleanedFilter,
|
|
10346
|
+
field: filter.field,
|
|
10347
|
+
...(filter.type === KitFilterType.CUSTOM_INPUT
|
|
10348
|
+
? { isCustomField: true }
|
|
10349
|
+
: {}),
|
|
10350
|
+
};
|
|
10351
|
+
};
|
|
10327
10352
|
const kitBuildFilters = (filters) => ({
|
|
10328
10353
|
logic: KitFilterLogic.AND,
|
|
10329
|
-
filters: filters.
|
|
10354
|
+
filters: filters.reduce((acc, filter) => {
|
|
10330
10355
|
const cleanedFilter = filterEmptyValues(filter.value);
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10356
|
+
const normalizedFilter = buildFilterByType(filter, cleanedFilter);
|
|
10357
|
+
if (!normalizedFilter) {
|
|
10358
|
+
return acc;
|
|
10359
|
+
}
|
|
10360
|
+
acc.push(normalizedFilter);
|
|
10361
|
+
return acc;
|
|
10362
|
+
}, []),
|
|
10337
10363
|
});
|
|
10338
10364
|
|
|
10339
10365
|
const kitFormatStringForSearch = (inputString) => {
|
|
@@ -13838,21 +13864,24 @@ class KitGridUrlStateService {
|
|
|
13838
13864
|
};
|
|
13839
13865
|
}
|
|
13840
13866
|
setGridStateToUrl(state, defaultColumns = state?.columns ?? []) {
|
|
13841
|
-
const queryParams =
|
|
13842
|
-
skip: state?.skip,
|
|
13843
|
-
take: state?.take,
|
|
13844
|
-
search: state?.search,
|
|
13845
|
-
sort: JSON.stringify(state?.sort),
|
|
13846
|
-
filter: JSON.stringify(state?.filter),
|
|
13847
|
-
columns: JSON.stringify(buildGridViewColumns(defaultColumns)),
|
|
13848
|
-
archive: state?.archive,
|
|
13849
|
-
};
|
|
13867
|
+
const queryParams = this.buildGridQueryParams(state, defaultColumns);
|
|
13850
13868
|
this.router.navigate([], {
|
|
13851
13869
|
relativeTo: this.activatedRoute,
|
|
13852
13870
|
queryParams,
|
|
13853
13871
|
queryParamsHandling: 'merge',
|
|
13854
13872
|
});
|
|
13855
13873
|
}
|
|
13874
|
+
replaceGridStateInUrl(state, defaultColumns = state?.columns ?? []) {
|
|
13875
|
+
const queryParams = this.buildGridQueryParams(state, defaultColumns);
|
|
13876
|
+
const urlTree = this.router.createUrlTree([], {
|
|
13877
|
+
relativeTo: this.activatedRoute,
|
|
13878
|
+
queryParams: {
|
|
13879
|
+
...this.activatedRoute.snapshot.queryParams,
|
|
13880
|
+
...queryParams,
|
|
13881
|
+
},
|
|
13882
|
+
});
|
|
13883
|
+
this.location.replaceState(this.router.serializeUrl(urlTree));
|
|
13884
|
+
}
|
|
13856
13885
|
getFiltersVisible(filterDetailsSetting) {
|
|
13857
13886
|
const filterDetailsParam = this.activatedRoute.snapshot.queryParams['filtersDetails'];
|
|
13858
13887
|
const isFilterHiddenByParam = filterDetailsParam === 'true';
|
|
@@ -13870,6 +13899,17 @@ class KitGridUrlStateService {
|
|
|
13870
13899
|
});
|
|
13871
13900
|
this.location.replaceState(this.router.serializeUrl(urlTree));
|
|
13872
13901
|
}
|
|
13902
|
+
buildGridQueryParams(state, defaultColumns) {
|
|
13903
|
+
return {
|
|
13904
|
+
skip: state?.skip,
|
|
13905
|
+
take: state?.take,
|
|
13906
|
+
search: state?.search,
|
|
13907
|
+
sort: JSON.stringify(state?.sort),
|
|
13908
|
+
filter: JSON.stringify(state?.filter),
|
|
13909
|
+
columns: JSON.stringify(buildGridViewColumns(defaultColumns)),
|
|
13910
|
+
archive: state?.archive,
|
|
13911
|
+
};
|
|
13912
|
+
}
|
|
13873
13913
|
}
|
|
13874
13914
|
|
|
13875
13915
|
class FetchGridViews extends KitAbstractPayloadAction {
|
|
@@ -14768,14 +14808,13 @@ class KitFilterCheckboxComponent {
|
|
|
14768
14808
|
this.kitTooltipPosition = KitTooltipPosition;
|
|
14769
14809
|
this.kitPillTheme = KitPillTheme;
|
|
14770
14810
|
this.kitTextboxSize = KitTextboxSize;
|
|
14811
|
+
this.popupToggleRafId = null;
|
|
14771
14812
|
effect(() => this.allSelected.set(this.groupedItems().every(item => item.checked)));
|
|
14772
14813
|
}
|
|
14773
14814
|
ngOnInit() {
|
|
14774
14815
|
this.initializeSelectedValues();
|
|
14775
14816
|
this.updateItemsState();
|
|
14776
|
-
|
|
14777
|
-
requestAnimationFrame(() => this.onPopupToggle());
|
|
14778
|
-
}
|
|
14817
|
+
this.openPopupOnInit();
|
|
14779
14818
|
}
|
|
14780
14819
|
ngOnChanges({ filter }) {
|
|
14781
14820
|
if (!filter?.isFirstChange()) {
|
|
@@ -14783,6 +14822,12 @@ class KitFilterCheckboxComponent {
|
|
|
14783
14822
|
this.updateItemsState();
|
|
14784
14823
|
}
|
|
14785
14824
|
}
|
|
14825
|
+
ngOnDestroy() {
|
|
14826
|
+
if (this.popupToggleRafId !== null) {
|
|
14827
|
+
cancelAnimationFrame(this.popupToggleRafId);
|
|
14828
|
+
this.popupToggleRafId = null;
|
|
14829
|
+
}
|
|
14830
|
+
}
|
|
14786
14831
|
removeFilter() {
|
|
14787
14832
|
this.popup()?.close();
|
|
14788
14833
|
this.filterRemoved.emit();
|
|
@@ -14800,7 +14845,7 @@ class KitFilterCheckboxComponent {
|
|
|
14800
14845
|
this.selectedValues.set(checkedItems);
|
|
14801
14846
|
}
|
|
14802
14847
|
onPopupToggle() {
|
|
14803
|
-
|
|
14848
|
+
this.popup()?.toggle();
|
|
14804
14849
|
}
|
|
14805
14850
|
close() {
|
|
14806
14851
|
this.updateItemsState();
|
|
@@ -14897,6 +14942,15 @@ class KitFilterCheckboxComponent {
|
|
|
14897
14942
|
checked: this.selectedValues().some(selectedValue => selectedValue.value === item.value) ?? false,
|
|
14898
14943
|
})));
|
|
14899
14944
|
}
|
|
14945
|
+
openPopupOnInit() {
|
|
14946
|
+
if (!this.showPopupOnInit() || this.selectedValues().length > 0) {
|
|
14947
|
+
return;
|
|
14948
|
+
}
|
|
14949
|
+
this.popupToggleRafId = requestAnimationFrame(() => {
|
|
14950
|
+
this.popupToggleRafId = null;
|
|
14951
|
+
this.onPopupToggle();
|
|
14952
|
+
});
|
|
14953
|
+
}
|
|
14900
14954
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: KitFilterCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
14901
14955
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: KitFilterCheckboxComponent, isStandalone: true, selector: "kit-filter-checkbox", inputs: { filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: true, transformFunction: null }, translateKeyPrefix: { classPropertyName: "translateKeyPrefix", publicName: "translateKeyPrefix", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, showPopupOnInit: { classPropertyName: "showPopupOnInit", publicName: "showPopupOnInit", isSignal: true, isRequired: false, transformFunction: null }, guidField: { classPropertyName: "guidField", publicName: "guidField", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { items: "itemsChange", filterRemoved: "filterRemoved", filterChanged: "filterChanged" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: ["toggleButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "popupContent", first: true, predicate: ["popupContent"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "popup", first: true, predicate: ["popup"], descendants: true, read: KitPopupComponent, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"kit-filter-checkbox\">\n <kit-pill #toggleButton\n [selectable]=\"!filter().readonly\"\n [selected]=\"popup.isPopupOpen\"\n [removable]=\"!filter().readonly && (filter().removable ?? true)\"\n [theme]=\"filter().readonly && kitPillTheme.BLUE || kitPillTheme.DEFAULT\"\n (removed)=\"removeFilter()\"\n (clicked)=\"onPopupToggle()\">\n {{ filter().title | translate }}:\n @if (allSelected()) {\n <div class=\"kit-filter-checkbox-tooltip\"\n kitTooltip\n kitTooltipFilter=\".kit-filter-checkbox-tooltip\"\n [kitTooltipPosition]=\"kitTooltipPosition.RIGHT\"\n [kitTooltipTemplateRef]=\"tooltipTemplate\">\n {{ 'kit.filters.all' | translate }}\n </div>\n } @else if (displayedValues.length > 1) {\n <div class=\"kit-filter-checkbox-tooltip\"\n kitTooltip\n kitTooltipFilter=\".kit-filter-checkbox-tooltip\"\n [kitTooltipPosition]=\"kitTooltipPosition.RIGHT\"\n [kitTooltipTemplateRef]=\"tooltipTemplate\">\n <span class=\"kit-filter-checkbox-single-item\">{{ displayedValues[0] }}</span>\n <span class=\"kit-filter-checkbox-tooltip-count\">+{{ displayedValues.length - 1 }}</span>\n </div>\n } @else {\n <span class=\"kit-filter-checkbox-single-item\">{{ displayedValues[0] ?? '' }}</span>\n }\n </kit-pill>\n</div>\n\n<kit-popup #popup\n popupClass=\"kit-filter-checkbox-popup\"\n [anchor]=\"anchor()\"\n [content]=\"content\"\n [showFooter]=\"true\"\n [applyButtonLabel]=\"'kit.filters.apply' | translate\"\n [cancelButtonLabel]=\"'kit.filters.clear' | translate\"\n [closePopupOnCancel]=\"false\"\n (applyAction)=\"applyFilter()\"\n (cancelAction)=\"clearAllFilters()\"\n (closed)=\"close()\">\n</kit-popup>\n\n<ng-template #content>\n <div class=\"popup-search\"\n [hidden]=\"!isContentOverflowing && !searchTerm()\">\n <kit-textbox [placeholder]=\"'kit.filters.search' | translate\"\n [size]=\"kitTextboxSize.SMALL\"\n [defaultValue]=\"searchTerm()\"\n (changed)=\"searchTerm.set($event)\"\n ></kit-textbox>\n </div>\n\n <div #popupContent\n class=\"popup-content\">\n @if (!searchTerm()) {\n <kit-checkbox class=\"checkbox-item\"\n [label]=\"'kit.filters.all' | translate\"\n [(ngModel)]=\"allSelected\"\n (changed)=\"toggleAll($event)\">\n </kit-checkbox>\n }\n\n @for (item of visibleItems(); track $index) {\n <kit-checkbox class=\"checkbox-item\"\n [label]=\"buildTranslateKey(item.title) | translate\"\n [(ngModel)]=\"item.checked\"\n (changed)=\"onChange($event, item.value)\"\n ></kit-checkbox>\n }\n\n @if (!visibleItems().length) {\n {{ ('kit.filters.noDataFound' | translate) }}\n }\n </div>\n</ng-template>\n\n<ng-template #tooltipTemplate>\n @for (item of (displayedValues.length > 1 && !allSelected() ? displayedValues.slice(1) : displayedValues); track item) {\n <div class=\"kit-filter-checkbox-tooltip-item\">{{ item }}</div>\n }\n</ng-template>\n", styles: [".kit-filter-checkbox-tooltip{display:flex;align-items:center;gap:3px}.kit-filter-checkbox-tooltip-count{color:var(--ui-kit-color-main)}.kit-filter-checkbox-tooltip-item{color:var(--ui-kit-color-grey-10);font-size:12px;font-weight:500;line-height:20px}.kit-filter-checkbox-single-item{display:block;max-width:180px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}::ng-deep .kit-filter-checkbox-popup .popup-search{margin-bottom:5px;padding-bottom:15px;border-bottom:1px solid var(--ui-kit-color-grey-11)}::ng-deep .kit-filter-checkbox-popup .popup-content{width:172px;max-height:400px;overflow-y:auto}::ng-deep .kit-filter-checkbox-popup .popup-content::-webkit-scrollbar{width:4px;height:4px}::ng-deep .kit-filter-checkbox-popup .popup-content::-webkit-scrollbar-thumb{background-color:var(--ui-kit-color-grey-17);border-radius:2px}::ng-deep .kit-filter-checkbox-popup .popup-content::-webkit-scrollbar-thumb:hover{background-color:var(--ui-kit-color-grey-10)}::ng-deep .kit-filter-checkbox-popup .checkbox-item{display:block;padding:6px 0}\n"], dependencies: [{ kind: "component", type: KitPillComponent, selector: "kit-pill", inputs: ["removable", "selectable", "selected", "type", "theme", "icon", "iconType"], outputs: ["clicked", "removed"] }, { kind: "component", type: KitCheckboxComponent, selector: "kit-checkbox", inputs: ["label", "disabled", "checked", "readonly", "state", "messageIcon", "messageText", "indeterminate"], outputs: ["changed"] }, { kind: "directive", type: KitTooltipDirective, selector: "[kitTooltip]", inputs: ["kitTooltipPosition", "kitTooltipFilter", "kitTooltipTemplateRef", "kitTooltipVisible", "kitTooltipOffset"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: KitPopupComponent, selector: "kit-popup", inputs: ["anchor", "content", "closeOnOutsideClick", "showFooter", "cancelButtonLabel", "applyButtonLabel", "isApplyButtonDisabled", "positionMode", "popupClass", "closePopupOnCancel", "extraInsideSelectors"], outputs: ["cancelAction", "applyAction", "opened", "closed"] }, { kind: "component", type: KitTextboxComponent, selector: "kit-textbox", inputs: ["placeholder", "label", "labelTooltip", "defaultValue", "messageIcon", "messageText", "messageTemplate", "disabled", "maxlength", "state", "size", "icon", "clearButton", "showStateIcon", "readonly", "customStateIcon", "type"], outputs: ["defaultValueChange", "disabledChange", "blured", "focused", "changed"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
14902
14956
|
}
|
|
@@ -14917,6 +14971,8 @@ class KitFilterCustomInputComponent {
|
|
|
14917
14971
|
constructor() {
|
|
14918
14972
|
this.filter = input.required(/* @ts-ignore */
|
|
14919
14973
|
...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
|
|
14974
|
+
this.showPopupOnInit = input(true, /* @ts-ignore */
|
|
14975
|
+
...(ngDevMode ? [{ debugName: "showPopupOnInit" }] : /* istanbul ignore next */ []));
|
|
14920
14976
|
this.filterRemoved = output();
|
|
14921
14977
|
this.filterChanged = output();
|
|
14922
14978
|
this.anchor = viewChild.required('toggleButton', { ...(ngDevMode ? { debugName: "anchor" } : /* istanbul ignore next */ {}), read: ElementRef });
|
|
@@ -14931,7 +14987,7 @@ class KitFilterCustomInputComponent {
|
|
|
14931
14987
|
}
|
|
14932
14988
|
ngOnInit() {
|
|
14933
14989
|
this.initializeValue();
|
|
14934
|
-
this.
|
|
14990
|
+
this.openPopupOnInit();
|
|
14935
14991
|
}
|
|
14936
14992
|
ngOnDestroy() {
|
|
14937
14993
|
if (this.rafId) {
|
|
@@ -14983,16 +15039,17 @@ class KitFilterCustomInputComponent {
|
|
|
14983
15039
|
this.inputValue.set(value);
|
|
14984
15040
|
}
|
|
14985
15041
|
}
|
|
14986
|
-
|
|
14987
|
-
if (!this.selectedValue()) {
|
|
14988
|
-
|
|
14989
|
-
this.rafId = null;
|
|
14990
|
-
this.onPopupToggle();
|
|
14991
|
-
});
|
|
15042
|
+
openPopupOnInit() {
|
|
15043
|
+
if (!this.showPopupOnInit() || this.selectedValue()) {
|
|
15044
|
+
return;
|
|
14992
15045
|
}
|
|
15046
|
+
this.rafId = requestAnimationFrame(() => {
|
|
15047
|
+
this.rafId = null;
|
|
15048
|
+
this.onPopupToggle();
|
|
15049
|
+
});
|
|
14993
15050
|
}
|
|
14994
15051
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: KitFilterCustomInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
14995
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.1", type: KitFilterCustomInputComponent, isStandalone: true, selector: "kit-filter-custom-input", inputs: { filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { filterRemoved: "filterRemoved", filterChanged: "filterChanged" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: ["toggleButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "popup", first: true, predicate: ["popup"], descendants: true, read: KitPopupComponent, isSignal: true }], ngImport: i0, template: "<kit-pill #toggleButton\n [selectable]=\"!filter().readonly\"\n [selected]=\"popup.isPopupOpen\"\n [removable]=\"!filter().readonly && (filter().removable ?? true)\"\n [theme]=\"filter().readonly && kitPillTheme.BLUE || kitPillTheme.DEFAULT\"\n (removed)=\"removeFilter()\"\n (clicked)=\"onPopupToggle()\">\n {{ filter().title | translate }}:\n <kit-truncate-text class=\"kit-custom-input-selected-values\">\n {{ selectedValue() }}\n </kit-truncate-text>\n</kit-pill>\n\n<kit-popup #popup\n popupClass=\"kit-filter-input-popup\"\n [anchor]=\"anchor()\"\n [content]=\"content\"\n [showFooter]=\"true\"\n [applyButtonLabel]=\"'kit.filters.apply' | translate\"\n [cancelButtonLabel]=\"'kit.filters.clear' | translate\"\n [closePopupOnCancel]=\"false\"\n (applyAction)=\"applyFilter()\"\n (cancelAction)=\"clearAllFilters()\"\n (closed)=\"close()\">\n</kit-popup>\n\n<ng-template #content>\n <div class=\"popup-content\">\n <kit-textbox [size]=\"kitTextboxSize.SMALL\"\n [defaultValue]=\"inputValue()\"\n (changed)=\"onValueChange($event)\"\n (keydown.enter)=\"onEnterKey()\"\n ></kit-textbox>\n </div>\n</ng-template>\n", styles: [".kit-custom-input-selected-values{max-width:180px}::ng-deep .kit-filter-input-popup .popup-content{width:296px;box-sizing:border-box}\n"], dependencies: [{ kind: "component", type: KitPillComponent, selector: "kit-pill", inputs: ["removable", "selectable", "selected", "type", "theme", "icon", "iconType"], outputs: ["clicked", "removed"] }, { kind: "component", type: KitPopupComponent, selector: "kit-popup", inputs: ["anchor", "content", "closeOnOutsideClick", "showFooter", "cancelButtonLabel", "applyButtonLabel", "isApplyButtonDisabled", "positionMode", "popupClass", "closePopupOnCancel", "extraInsideSelectors"], outputs: ["cancelAction", "applyAction", "opened", "closed"] }, { kind: "component", type: KitTextboxComponent, selector: "kit-textbox", inputs: ["placeholder", "label", "labelTooltip", "defaultValue", "messageIcon", "messageText", "messageTemplate", "disabled", "maxlength", "state", "size", "icon", "clearButton", "showStateIcon", "readonly", "customStateIcon", "type"], outputs: ["defaultValueChange", "disabledChange", "blured", "focused", "changed"] }, { kind: "component", type: KitTruncateTextComponent, selector: "kit-truncate-text", inputs: ["tooltipText", "lines", "innerHtml"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
15052
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.1", type: KitFilterCustomInputComponent, isStandalone: true, selector: "kit-filter-custom-input", inputs: { filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: true, transformFunction: null }, showPopupOnInit: { classPropertyName: "showPopupOnInit", publicName: "showPopupOnInit", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterRemoved: "filterRemoved", filterChanged: "filterChanged" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: ["toggleButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "popup", first: true, predicate: ["popup"], descendants: true, read: KitPopupComponent, isSignal: true }], ngImport: i0, template: "<kit-pill #toggleButton\n [selectable]=\"!filter().readonly\"\n [selected]=\"popup.isPopupOpen\"\n [removable]=\"!filter().readonly && (filter().removable ?? true)\"\n [theme]=\"filter().readonly && kitPillTheme.BLUE || kitPillTheme.DEFAULT\"\n (removed)=\"removeFilter()\"\n (clicked)=\"onPopupToggle()\">\n {{ filter().title | translate }}:\n <kit-truncate-text class=\"kit-custom-input-selected-values\">\n {{ selectedValue() }}\n </kit-truncate-text>\n</kit-pill>\n\n<kit-popup #popup\n popupClass=\"kit-filter-input-popup\"\n [anchor]=\"anchor()\"\n [content]=\"content\"\n [showFooter]=\"true\"\n [applyButtonLabel]=\"'kit.filters.apply' | translate\"\n [cancelButtonLabel]=\"'kit.filters.clear' | translate\"\n [closePopupOnCancel]=\"false\"\n (applyAction)=\"applyFilter()\"\n (cancelAction)=\"clearAllFilters()\"\n (closed)=\"close()\">\n</kit-popup>\n\n<ng-template #content>\n <div class=\"popup-content\">\n <kit-textbox [size]=\"kitTextboxSize.SMALL\"\n [defaultValue]=\"inputValue()\"\n (changed)=\"onValueChange($event)\"\n (keydown.enter)=\"onEnterKey()\"\n ></kit-textbox>\n </div>\n</ng-template>\n", styles: [".kit-custom-input-selected-values{max-width:180px}::ng-deep .kit-filter-input-popup .popup-content{width:296px;box-sizing:border-box}\n"], dependencies: [{ kind: "component", type: KitPillComponent, selector: "kit-pill", inputs: ["removable", "selectable", "selected", "type", "theme", "icon", "iconType"], outputs: ["clicked", "removed"] }, { kind: "component", type: KitPopupComponent, selector: "kit-popup", inputs: ["anchor", "content", "closeOnOutsideClick", "showFooter", "cancelButtonLabel", "applyButtonLabel", "isApplyButtonDisabled", "positionMode", "popupClass", "closePopupOnCancel", "extraInsideSelectors"], outputs: ["cancelAction", "applyAction", "opened", "closed"] }, { kind: "component", type: KitTextboxComponent, selector: "kit-textbox", inputs: ["placeholder", "label", "labelTooltip", "defaultValue", "messageIcon", "messageText", "messageTemplate", "disabled", "maxlength", "state", "size", "icon", "clearButton", "showStateIcon", "readonly", "customStateIcon", "type"], outputs: ["defaultValueChange", "disabledChange", "blured", "focused", "changed"] }, { kind: "component", type: KitTruncateTextComponent, selector: "kit-truncate-text", inputs: ["tooltipText", "lines", "innerHtml"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
14996
15053
|
}
|
|
14997
15054
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: KitFilterCustomInputComponent, decorators: [{
|
|
14998
15055
|
type: Component,
|
|
@@ -15003,13 +15060,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
15003
15060
|
TranslatePipe,
|
|
15004
15061
|
KitTruncateTextComponent,
|
|
15005
15062
|
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<kit-pill #toggleButton\n [selectable]=\"!filter().readonly\"\n [selected]=\"popup.isPopupOpen\"\n [removable]=\"!filter().readonly && (filter().removable ?? true)\"\n [theme]=\"filter().readonly && kitPillTheme.BLUE || kitPillTheme.DEFAULT\"\n (removed)=\"removeFilter()\"\n (clicked)=\"onPopupToggle()\">\n {{ filter().title | translate }}:\n <kit-truncate-text class=\"kit-custom-input-selected-values\">\n {{ selectedValue() }}\n </kit-truncate-text>\n</kit-pill>\n\n<kit-popup #popup\n popupClass=\"kit-filter-input-popup\"\n [anchor]=\"anchor()\"\n [content]=\"content\"\n [showFooter]=\"true\"\n [applyButtonLabel]=\"'kit.filters.apply' | translate\"\n [cancelButtonLabel]=\"'kit.filters.clear' | translate\"\n [closePopupOnCancel]=\"false\"\n (applyAction)=\"applyFilter()\"\n (cancelAction)=\"clearAllFilters()\"\n (closed)=\"close()\">\n</kit-popup>\n\n<ng-template #content>\n <div class=\"popup-content\">\n <kit-textbox [size]=\"kitTextboxSize.SMALL\"\n [defaultValue]=\"inputValue()\"\n (changed)=\"onValueChange($event)\"\n (keydown.enter)=\"onEnterKey()\"\n ></kit-textbox>\n </div>\n</ng-template>\n", styles: [".kit-custom-input-selected-values{max-width:180px}::ng-deep .kit-filter-input-popup .popup-content{width:296px;box-sizing:border-box}\n"] }]
|
|
15006
|
-
}], propDecorators: { filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: true }] }], filterRemoved: [{ type: i0.Output, args: ["filterRemoved"] }], filterChanged: [{ type: i0.Output, args: ["filterChanged"] }], anchor: [{ type: i0.ViewChild, args: ['toggleButton', { ...{ read: ElementRef }, isSignal: true }] }], popup: [{ type: i0.ViewChild, args: ['popup', { ...{ read: KitPopupComponent }, isSignal: true }] }] } });
|
|
15063
|
+
}], propDecorators: { filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: true }] }], showPopupOnInit: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPopupOnInit", required: false }] }], filterRemoved: [{ type: i0.Output, args: ["filterRemoved"] }], filterChanged: [{ type: i0.Output, args: ["filterChanged"] }], anchor: [{ type: i0.ViewChild, args: ['toggleButton', { ...{ read: ElementRef }, isSignal: true }] }], popup: [{ type: i0.ViewChild, args: ['popup', { ...{ read: KitPopupComponent }, isSignal: true }] }] } });
|
|
15007
15064
|
|
|
15008
15065
|
class KitFilterDateComponent {
|
|
15009
15066
|
constructor() {
|
|
15010
15067
|
this.store = inject(Store);
|
|
15011
15068
|
this.filter = input.required(/* @ts-ignore */
|
|
15012
15069
|
...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
|
|
15070
|
+
this.showPopupOnInit = input(true, /* @ts-ignore */
|
|
15071
|
+
...(ngDevMode ? [{ debugName: "showPopupOnInit" }] : /* istanbul ignore next */ []));
|
|
15013
15072
|
this.useUserTimeZone = input(false, /* @ts-ignore */
|
|
15014
15073
|
...(ngDevMode ? [{ debugName: "useUserTimeZone" }] : /* istanbul ignore next */ []));
|
|
15015
15074
|
this.useLocalTimeZone = input(false, /* @ts-ignore */
|
|
@@ -15029,7 +15088,7 @@ class KitFilterDateComponent {
|
|
|
15029
15088
|
...(ngDevMode ? [{ debugName: "endDate" }] : /* istanbul ignore next */ []));
|
|
15030
15089
|
this.dateRange = signal(undefined, /* @ts-ignore */
|
|
15031
15090
|
...(ngDevMode ? [{ debugName: "dateRange" }] : /* istanbul ignore next */ []));
|
|
15032
|
-
this.selectedValues = signal(
|
|
15091
|
+
this.selectedValues = signal(null, /* @ts-ignore */
|
|
15033
15092
|
...(ngDevMode ? [{ debugName: "selectedValues" }] : /* istanbul ignore next */ []));
|
|
15034
15093
|
this.pillDateFormat = 'dd/MM/yy';
|
|
15035
15094
|
this.kitPillTheme = KitPillTheme;
|
|
@@ -15088,15 +15147,12 @@ class KitFilterDateComponent {
|
|
|
15088
15147
|
}
|
|
15089
15148
|
ngOnInit() {
|
|
15090
15149
|
this.initializeSelectedValues();
|
|
15091
|
-
this.
|
|
15150
|
+
this.openPopupOnInit();
|
|
15092
15151
|
this.addOutsideClickListener();
|
|
15093
15152
|
}
|
|
15094
15153
|
ngOnDestroy() {
|
|
15095
15154
|
this.removeOutsideClickListener();
|
|
15096
|
-
|
|
15097
|
-
cancelAnimationFrame(this.rafId);
|
|
15098
|
-
this.rafId = null;
|
|
15099
|
-
}
|
|
15155
|
+
this.cancelPendingAnimationFrame();
|
|
15100
15156
|
}
|
|
15101
15157
|
removeFilter() {
|
|
15102
15158
|
this.popup()?.close();
|
|
@@ -15106,15 +15162,15 @@ class KitFilterDateComponent {
|
|
|
15106
15162
|
this.popup()?.toggle();
|
|
15107
15163
|
}
|
|
15108
15164
|
close() {
|
|
15109
|
-
|
|
15165
|
+
const selectedValues = this.selectedValues();
|
|
15166
|
+
if (!selectedValues?.start && !selectedValues?.end) {
|
|
15110
15167
|
this.startDate.set(undefined);
|
|
15111
15168
|
this.endDate.set(undefined);
|
|
15112
15169
|
this.dateRange.set(undefined);
|
|
15113
15170
|
return;
|
|
15114
15171
|
}
|
|
15115
|
-
|
|
15116
|
-
this.
|
|
15117
|
-
this.endDate.set(endFilter?.value);
|
|
15172
|
+
this.startDate.set(selectedValues.start);
|
|
15173
|
+
this.endDate.set(selectedValues.end);
|
|
15118
15174
|
}
|
|
15119
15175
|
onFromDateChange(date) {
|
|
15120
15176
|
this.dateRange.set(undefined);
|
|
@@ -15167,9 +15223,14 @@ class KitFilterDateComponent {
|
|
|
15167
15223
|
this.endDate.set(endDate);
|
|
15168
15224
|
this.dateRange.set(range);
|
|
15169
15225
|
this.applyFilter();
|
|
15226
|
+
this.popup()?.close();
|
|
15170
15227
|
}
|
|
15171
15228
|
initializeSelectedValues() {
|
|
15172
15229
|
const filterValue = this.filter().value?.filters ?? null;
|
|
15230
|
+
if (!filterValue?.length) {
|
|
15231
|
+
this.selectedValues.set(null);
|
|
15232
|
+
return;
|
|
15233
|
+
}
|
|
15173
15234
|
this.selectedValues.set({
|
|
15174
15235
|
start: filterValue?.[0]?.value,
|
|
15175
15236
|
end: filterValue?.[1]?.value,
|
|
@@ -15178,12 +15239,14 @@ class KitFilterDateComponent {
|
|
|
15178
15239
|
this.endDate.set(this.selectedValues()?.end);
|
|
15179
15240
|
this.dateRange.set(this.filter().value?.dateRange);
|
|
15180
15241
|
}
|
|
15181
|
-
|
|
15182
|
-
if (!this.
|
|
15183
|
-
|
|
15184
|
-
this.onPopupToggle();
|
|
15185
|
-
});
|
|
15242
|
+
openPopupOnInit() {
|
|
15243
|
+
if (!this.showPopupOnInit() || this.selectedValues()) {
|
|
15244
|
+
return;
|
|
15186
15245
|
}
|
|
15246
|
+
this.rafId = requestAnimationFrame(() => {
|
|
15247
|
+
this.rafId = null;
|
|
15248
|
+
this.onPopupToggle();
|
|
15249
|
+
});
|
|
15187
15250
|
}
|
|
15188
15251
|
addOutsideClickListener() {
|
|
15189
15252
|
document.addEventListener('mousedown', this.onDocumentMouseDown, true);
|
|
@@ -15222,8 +15285,15 @@ class KitFilterDateComponent {
|
|
|
15222
15285
|
}
|
|
15223
15286
|
return {};
|
|
15224
15287
|
}
|
|
15288
|
+
cancelPendingAnimationFrame() {
|
|
15289
|
+
if (this.rafId === null) {
|
|
15290
|
+
return;
|
|
15291
|
+
}
|
|
15292
|
+
cancelAnimationFrame(this.rafId);
|
|
15293
|
+
this.rafId = null;
|
|
15294
|
+
}
|
|
15225
15295
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: KitFilterDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15226
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: KitFilterDateComponent, isStandalone: true, selector: "kit-filter-date", inputs: { filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: true, transformFunction: null }, useUserTimeZone: { classPropertyName: "useUserTimeZone", publicName: "useUserTimeZone", isSignal: true, isRequired: false, transformFunction: null }, useLocalTimeZone: { classPropertyName: "useLocalTimeZone", publicName: "useLocalTimeZone", isSignal: true, isRequired: false, transformFunction: null }, dateFilterConstraint: { classPropertyName: "dateFilterConstraint", publicName: "dateFilterConstraint", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterRemoved: "filterRemoved", filterChanged: "filterChanged" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: ["toggleButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "popup", first: true, predicate: ["popup"], descendants: true, read: KitPopupComponent, isSignal: true }], ngImport: i0, template: "<div class=\"kit-filter-date\">\n <kit-pill #toggleButton\n [selectable]=\"!filter().readonly\"\n [selected]=\"popup.isPopupOpen\"\n [removable]=\"!filter().readonly && (filter().removable ?? true)\"\n [theme]=\"filter().readonly && kitPillTheme.BLUE || kitPillTheme.DEFAULT\"\n (removed)=\"removeFilter()\"\n (clicked)=\"onPopupToggle()\">\n {{ filter().title | translate }}:\n @if (
|
|
15296
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: KitFilterDateComponent, isStandalone: true, selector: "kit-filter-date", inputs: { filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: true, transformFunction: null }, showPopupOnInit: { classPropertyName: "showPopupOnInit", publicName: "showPopupOnInit", isSignal: true, isRequired: false, transformFunction: null }, useUserTimeZone: { classPropertyName: "useUserTimeZone", publicName: "useUserTimeZone", isSignal: true, isRequired: false, transformFunction: null }, useLocalTimeZone: { classPropertyName: "useLocalTimeZone", publicName: "useLocalTimeZone", isSignal: true, isRequired: false, transformFunction: null }, dateFilterConstraint: { classPropertyName: "dateFilterConstraint", publicName: "dateFilterConstraint", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterRemoved: "filterRemoved", filterChanged: "filterChanged" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: ["toggleButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "popup", first: true, predicate: ["popup"], descendants: true, read: KitPopupComponent, isSignal: true }], ngImport: i0, template: "<div class=\"kit-filter-date\">\n <kit-pill #toggleButton\n [selectable]=\"!filter().readonly\"\n [selected]=\"popup.isPopupOpen\"\n [removable]=\"!filter().readonly && (filter().removable ?? true)\"\n [theme]=\"filter().readonly && kitPillTheme.BLUE || kitPillTheme.DEFAULT\"\n (removed)=\"removeFilter()\"\n (clicked)=\"onPopupToggle()\">\n {{ filter().title | translate }}:\n @if (localStartDate() || localEndDate()) {\n {{ localStartDate() | date: pillDateFormat }}\n @if (localStartDate() && localEndDate()) {\n -\n }\n {{ localEndDate() | date: pillDateFormat }}\n }\n </kit-pill>\n</div>\n\n<kit-popup #popup\n popupClass=\"kit-filter-date-popup\"\n [anchor]=\"anchor()\"\n [content]=\"content\"\n [closeOnOutsideClick]=\"false\"\n [showFooter]=\"true\"\n [applyButtonLabel]=\"'kit.filters.apply' | translate\"\n [cancelButtonLabel]=\"'kit.filters.clear' | translate\"\n [closePopupOnCancel]=\"false\"\n (applyAction)=\"applyFilter()\"\n (cancelAction)=\"clearAllFilters()\"\n (closed)=\"close()\">\n</kit-popup>\n\n<ng-template #content>\n <div class=\"popup-actions\">\n <kit-button [kind]=\"kitButtonKind.SMALL\"\n [type]=\"kitButtonType.GHOST\"\n [label]=\"'kit.filters.today' | translate\"\n [active]=\"dateRange() === kitFilterDateRange.TODAY\"\n (clicked)=\"selectDateRange(kitFilterDateRange.TODAY)\" />\n <kit-button [kind]=\"kitButtonKind.SMALL\"\n [type]=\"kitButtonType.GHOST\"\n [label]=\"'kit.filters.yesterday' | translate\"\n [active]=\"dateRange() === kitFilterDateRange.YESTERDAY\"\n (clicked)=\"selectDateRange(kitFilterDateRange.YESTERDAY)\" />\n <kit-button [kind]=\"kitButtonKind.SMALL\"\n [type]=\"kitButtonType.GHOST\"\n [label]=\"'kit.filters.lastWeek' | translate\"\n [active]=\"dateRange() === kitFilterDateRange.LAST_WEEK\"\n (clicked)=\"selectDateRange(kitFilterDateRange.LAST_WEEK)\" />\n <kit-button [kind]=\"kitButtonKind.SMALL\"\n [type]=\"kitButtonType.GHOST\"\n [label]=\"'kit.filters.lastMonth' | translate\"\n [active]=\"dateRange() === kitFilterDateRange.LAST_MONTH\"\n (clicked)=\"selectDateRange(kitFilterDateRange.LAST_MONTH)\" />\n </div>\n <div class=\"popup-content\">\n <div class=\"date-input\">\n <kit-datepicker [placeholder]=\"'kit.filters.chooseDateFrom' | translate\"\n [defaultDate]=\"localStartDate()\"\n [min]=\"minDateConstraint()\"\n [max]=\"localEndDate()\"\n (changed)=\"onFromDateChange($event)\"\n (keydown.enter)=\"onEnterKey()\"\n ></kit-datepicker>\n <kit-datepicker [placeholder]=\"'kit.filters.chooseDateTo' | translate\"\n [defaultDate]=\"localEndDate()\"\n [min]=\"localStartDate()\"\n [max]=\"maxDateConstraint()\"\n (changed)=\"onToDateChange($event)\"\n (keydown.enter)=\"onEnterKey()\"\n ></kit-datepicker>\n </div>\n </div>\n</ng-template>\n", styles: ["::ng-deep .kit-filter-date-popup{min-width:296px}::ng-deep .kit-filter-date-popup .popup-content{box-sizing:border-box}::ng-deep .kit-filter-date-popup .popup-actions{display:flex;justify-content:space-between;gap:8px;margin-bottom:15px}::ng-deep .kit-filter-date-popup .date-input{display:flex;flex-direction:column;width:100%;gap:10px}\n"], dependencies: [{ kind: "component", type: KitPillComponent, selector: "kit-pill", inputs: ["removable", "selectable", "selected", "type", "theme", "icon", "iconType"], outputs: ["clicked", "removed"] }, { kind: "component", type: KitDatepickerComponent, selector: "kit-datepicker", inputs: ["placeholder", "label", "labelTooltip", "defaultDate", "disabled", "format", "min", "max", "messageIcon", "messageText", "size", "readonly"], outputs: ["defaultDateChange", "disabledChange", "changed"] }, { kind: "component", type: KitPopupComponent, selector: "kit-popup", inputs: ["anchor", "content", "closeOnOutsideClick", "showFooter", "cancelButtonLabel", "applyButtonLabel", "isApplyButtonDisabled", "positionMode", "popupClass", "closePopupOnCancel", "extraInsideSelectors"], outputs: ["cancelAction", "applyAction", "opened", "closed"] }, { kind: "component", type: KitButtonComponent, selector: "kit-button", inputs: ["disabled", "label", "type", "icon", "iconType", "kind", "state", "iconPosition", "buttonClass", "active"], outputs: ["clicked"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
15227
15297
|
}
|
|
15228
15298
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: KitFilterDateComponent, decorators: [{
|
|
15229
15299
|
type: Component,
|
|
@@ -15234,14 +15304,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
15234
15304
|
DatePipe,
|
|
15235
15305
|
KitPopupComponent,
|
|
15236
15306
|
KitButtonComponent,
|
|
15237
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"kit-filter-date\">\n <kit-pill #toggleButton\n [selectable]=\"!filter().readonly\"\n [selected]=\"popup.isPopupOpen\"\n [removable]=\"!filter().readonly && (filter().removable ?? true)\"\n [theme]=\"filter().readonly && kitPillTheme.BLUE || kitPillTheme.DEFAULT\"\n (removed)=\"removeFilter()\"\n (clicked)=\"onPopupToggle()\">\n {{ filter().title | translate }}:\n @if (
|
|
15238
|
-
}], propDecorators: { filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: true }] }], useUserTimeZone: [{ type: i0.Input, args: [{ isSignal: true, alias: "useUserTimeZone", required: false }] }], useLocalTimeZone: [{ type: i0.Input, args: [{ isSignal: true, alias: "useLocalTimeZone", required: false }] }], dateFilterConstraint: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateFilterConstraint", required: false }] }], filterRemoved: [{ type: i0.Output, args: ["filterRemoved"] }], filterChanged: [{ type: i0.Output, args: ["filterChanged"] }], anchor: [{ type: i0.ViewChild, args: ['toggleButton', { ...{ read: ElementRef }, isSignal: true }] }], popup: [{ type: i0.ViewChild, args: ['popup', { ...{ read: KitPopupComponent }, isSignal: true }] }] } });
|
|
15307
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"kit-filter-date\">\n <kit-pill #toggleButton\n [selectable]=\"!filter().readonly\"\n [selected]=\"popup.isPopupOpen\"\n [removable]=\"!filter().readonly && (filter().removable ?? true)\"\n [theme]=\"filter().readonly && kitPillTheme.BLUE || kitPillTheme.DEFAULT\"\n (removed)=\"removeFilter()\"\n (clicked)=\"onPopupToggle()\">\n {{ filter().title | translate }}:\n @if (localStartDate() || localEndDate()) {\n {{ localStartDate() | date: pillDateFormat }}\n @if (localStartDate() && localEndDate()) {\n -\n }\n {{ localEndDate() | date: pillDateFormat }}\n }\n </kit-pill>\n</div>\n\n<kit-popup #popup\n popupClass=\"kit-filter-date-popup\"\n [anchor]=\"anchor()\"\n [content]=\"content\"\n [closeOnOutsideClick]=\"false\"\n [showFooter]=\"true\"\n [applyButtonLabel]=\"'kit.filters.apply' | translate\"\n [cancelButtonLabel]=\"'kit.filters.clear' | translate\"\n [closePopupOnCancel]=\"false\"\n (applyAction)=\"applyFilter()\"\n (cancelAction)=\"clearAllFilters()\"\n (closed)=\"close()\">\n</kit-popup>\n\n<ng-template #content>\n <div class=\"popup-actions\">\n <kit-button [kind]=\"kitButtonKind.SMALL\"\n [type]=\"kitButtonType.GHOST\"\n [label]=\"'kit.filters.today' | translate\"\n [active]=\"dateRange() === kitFilterDateRange.TODAY\"\n (clicked)=\"selectDateRange(kitFilterDateRange.TODAY)\" />\n <kit-button [kind]=\"kitButtonKind.SMALL\"\n [type]=\"kitButtonType.GHOST\"\n [label]=\"'kit.filters.yesterday' | translate\"\n [active]=\"dateRange() === kitFilterDateRange.YESTERDAY\"\n (clicked)=\"selectDateRange(kitFilterDateRange.YESTERDAY)\" />\n <kit-button [kind]=\"kitButtonKind.SMALL\"\n [type]=\"kitButtonType.GHOST\"\n [label]=\"'kit.filters.lastWeek' | translate\"\n [active]=\"dateRange() === kitFilterDateRange.LAST_WEEK\"\n (clicked)=\"selectDateRange(kitFilterDateRange.LAST_WEEK)\" />\n <kit-button [kind]=\"kitButtonKind.SMALL\"\n [type]=\"kitButtonType.GHOST\"\n [label]=\"'kit.filters.lastMonth' | translate\"\n [active]=\"dateRange() === kitFilterDateRange.LAST_MONTH\"\n (clicked)=\"selectDateRange(kitFilterDateRange.LAST_MONTH)\" />\n </div>\n <div class=\"popup-content\">\n <div class=\"date-input\">\n <kit-datepicker [placeholder]=\"'kit.filters.chooseDateFrom' | translate\"\n [defaultDate]=\"localStartDate()\"\n [min]=\"minDateConstraint()\"\n [max]=\"localEndDate()\"\n (changed)=\"onFromDateChange($event)\"\n (keydown.enter)=\"onEnterKey()\"\n ></kit-datepicker>\n <kit-datepicker [placeholder]=\"'kit.filters.chooseDateTo' | translate\"\n [defaultDate]=\"localEndDate()\"\n [min]=\"localStartDate()\"\n [max]=\"maxDateConstraint()\"\n (changed)=\"onToDateChange($event)\"\n (keydown.enter)=\"onEnterKey()\"\n ></kit-datepicker>\n </div>\n </div>\n</ng-template>\n", styles: ["::ng-deep .kit-filter-date-popup{min-width:296px}::ng-deep .kit-filter-date-popup .popup-content{box-sizing:border-box}::ng-deep .kit-filter-date-popup .popup-actions{display:flex;justify-content:space-between;gap:8px;margin-bottom:15px}::ng-deep .kit-filter-date-popup .date-input{display:flex;flex-direction:column;width:100%;gap:10px}\n"] }]
|
|
15308
|
+
}], propDecorators: { filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: true }] }], showPopupOnInit: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPopupOnInit", required: false }] }], useUserTimeZone: [{ type: i0.Input, args: [{ isSignal: true, alias: "useUserTimeZone", required: false }] }], useLocalTimeZone: [{ type: i0.Input, args: [{ isSignal: true, alias: "useLocalTimeZone", required: false }] }], dateFilterConstraint: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateFilterConstraint", required: false }] }], filterRemoved: [{ type: i0.Output, args: ["filterRemoved"] }], filterChanged: [{ type: i0.Output, args: ["filterChanged"] }], anchor: [{ type: i0.ViewChild, args: ['toggleButton', { ...{ read: ElementRef }, isSignal: true }] }], popup: [{ type: i0.ViewChild, args: ['popup', { ...{ read: KitPopupComponent }, isSignal: true }] }] } });
|
|
15239
15309
|
|
|
15240
15310
|
class KitFilterInputComponent {
|
|
15241
15311
|
constructor() {
|
|
15242
15312
|
this.translateService = inject(TranslateService);
|
|
15243
15313
|
this.filter = input.required(/* @ts-ignore */
|
|
15244
15314
|
...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
|
|
15315
|
+
this.showPopupOnInit = input(true, /* @ts-ignore */
|
|
15316
|
+
...(ngDevMode ? [{ debugName: "showPopupOnInit" }] : /* istanbul ignore next */ []));
|
|
15245
15317
|
this.filterInputType = input.required(/* @ts-ignore */
|
|
15246
15318
|
...(ngDevMode ? [{ debugName: "filterInputType" }] : /* istanbul ignore next */ []));
|
|
15247
15319
|
this.filterRemoved = output();
|
|
@@ -15276,7 +15348,7 @@ class KitFilterInputComponent {
|
|
|
15276
15348
|
}
|
|
15277
15349
|
ngOnInit() {
|
|
15278
15350
|
this.initializeSelectedValues();
|
|
15279
|
-
this.
|
|
15351
|
+
this.openPopupOnInit();
|
|
15280
15352
|
}
|
|
15281
15353
|
ngOnDestroy() {
|
|
15282
15354
|
this.cancelPendingAnimationFrame('popupToggleRafId');
|
|
@@ -15373,13 +15445,14 @@ class KitFilterInputComponent {
|
|
|
15373
15445
|
],
|
|
15374
15446
|
}));
|
|
15375
15447
|
}
|
|
15376
|
-
|
|
15377
|
-
if (!this.selectedValues()) {
|
|
15378
|
-
|
|
15379
|
-
this.popupToggleRafId = null;
|
|
15380
|
-
this.onPopupToggle();
|
|
15381
|
-
});
|
|
15448
|
+
openPopupOnInit() {
|
|
15449
|
+
if (!this.showPopupOnInit() || this.selectedValues()) {
|
|
15450
|
+
return;
|
|
15382
15451
|
}
|
|
15452
|
+
this.popupToggleRafId = requestAnimationFrame(() => {
|
|
15453
|
+
this.popupToggleRafId = null;
|
|
15454
|
+
this.onPopupToggle();
|
|
15455
|
+
});
|
|
15383
15456
|
}
|
|
15384
15457
|
scheduleFocusFirstInput() {
|
|
15385
15458
|
this.cancelPendingAnimationFrame('focusRafId');
|
|
@@ -15432,7 +15505,7 @@ class KitFilterInputComponent {
|
|
|
15432
15505
|
this.focusRafId = null;
|
|
15433
15506
|
}
|
|
15434
15507
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: KitFilterInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15435
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: KitFilterInputComponent, isStandalone: true, selector: "kit-filter-input", inputs: { filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: true, transformFunction: null }, filterInputType: { classPropertyName: "filterInputType", publicName: "filterInputType", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { filterRemoved: "filterRemoved", filterChanged: "filterChanged" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: ["toggleButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "textboxComponents", predicate: KitTextboxComponent, descendants: true, isSignal: true }, { propertyName: "numericTextboxComponents", predicate: KitNumericTextboxComponent, descendants: true, isSignal: true }, { propertyName: "popup", first: true, predicate: ["popup"], descendants: true, read: KitPopupComponent, isSignal: true }], ngImport: i0, template: "<kit-pill #toggleButton\n [selectable]=\"!filter().readonly\"\n [selected]=\"popup.isPopupOpen\"\n [removable]=\"!filter().readonly && (filter().removable ?? true)\"\n [theme]=\"filter().readonly && kitPillTheme.BLUE || kitPillTheme.DEFAULT\"\n (removed)=\"removeFilter()\"\n (clicked)=\"onPopupToggle()\">\n {{ filter().title | translate }}:\n @if (selectedValues()?.filters; as selectedFilters) {\n <kit-truncate-text class=\"kit-filter-input-selected-values\">\n @for (filter of selectedFilters; track $index) {\n {{ getSelectedFilterText(filter) }}\n\n @if ($index === 0) {\n {{ getSelectedLogicText(selectedValues()) }}\n }\n }\n </kit-truncate-text>\n }\n</kit-pill>\n\n<kit-popup #popup\n popupClass=\"kit-filter-input-popup\"\n [anchor]=\"anchor()\"\n [content]=\"content\"\n [showFooter]=\"true\"\n [applyButtonLabel]=\"'kit.filters.apply' | translate\"\n [cancelButtonLabel]=\"'kit.filters.clear' | translate\"\n [isApplyButtonDisabled]=\"applyButtonDisabled\"\n [closePopupOnCancel]=\"false\"\n [extraInsideSelectors]=\"['.kit-dropdown-popup']\"\n (opened)=\"onPopupOpened()\"\n (applyAction)=\"applyFilter()\"\n (cancelAction)=\"clearAllFilters()\"\n (closed)=\"close()\">\n</kit-popup>\n\n<ng-template #content>\n <div class=\"popup-content\">\n @for (item of filterItems().filters; track $index) {\n <div class=\"filter-item\">\n <kit-dropdown [items]=\"getFilterOperatorDropdownItems()\"\n [size]=\"kitDropdownSize.SMALL\"\n [selectedItem]=\"$any(item.operator)\"\n (selected)=\"onOperatorSelect($event.value, $index)\"\n ></kit-dropdown>\n <div class=\"filter-controls\">\n @switch (filterInputType()) {\n @case (kitFilterType.TEXT) {\n <kit-textbox class=\"filter-item-value\"\n [size]=\"kitTextboxSize.SMALL\"\n [defaultValue]=\"item.value\"\n [disabled]=\"isFilterValueTextboxDisabled($index)\"\n (changed)=\"onValueChange($event, $index)\"\n (keydown.enter)=\"onEnterKey()\"\n ></kit-textbox>\n }\n @case (kitFilterType.NUMERIC) {\n <kit-numeric-textbox class=\"filter-item-value\"\n format=\"#.###\"\n [size]=\"kitNumericTextboxSize.SMALL\"\n [defaultValue]=\"item.value\"\n [min]=\"0\"\n [max]=\"maxIntegerValue\"\n [disabled]=\"isFilterValueTextboxDisabled($index)\"\n (changed)=\"onValueChange($event, $index)\"\n (keydown.enter)=\"onEnterKey()\"\n ></kit-numeric-textbox>\n }\n }\n @if ($index === 0) {\n <kit-dropdown class=\"logic-selector\"\n [selectedItem]=\"filterItems().logic\"\n [items]=\"filterLogicDropdownItems\"\n [size]=\"kitDropdownSize.SMALL\"\n (selected)=\"onLogicChange($event.value)\"\n ></kit-dropdown>\n }\n </div>\n </div>\n }\n </div>\n</ng-template>\n", styles: [".kit-filter-input-selected-values{max-width:180px}::ng-deep .kit-filter-input-popup .popup-content{display:flex;flex-direction:column;gap:10px;width:296px;box-sizing:border-box}::ng-deep .kit-filter-input-popup .filter-item{display:flex;flex-direction:column;gap:10px}::ng-deep .kit-filter-input-popup .filter-item-value{flex:1}::ng-deep .kit-filter-input-popup .filter-controls{display:flex;gap:10px}::ng-deep .kit-filter-input-popup .logic-selector{flex-shrink:0;width:100px}\n"], dependencies: [{ kind: "component", type: KitDropdownComponent, selector: "kit-dropdown", inputs: ["items", "selectedItem", "label", "disabled", "messageIcon", "messageText", "invalid", "defaultItem", "listHeight", "hideDefaultItem", "toggleIcon", "popupSettings", "isValuePrimitive", "footerTemplate", "noDataTemplate", "readonly", "size"], outputs: ["selectedItemChange", "disabledChange", "selected"] }, { kind: "component", type: KitPillComponent, selector: "kit-pill", inputs: ["removable", "selectable", "selected", "type", "theme", "icon", "iconType"], outputs: ["clicked", "removed"] }, { kind: "component", type: KitPopupComponent, selector: "kit-popup", inputs: ["anchor", "content", "closeOnOutsideClick", "showFooter", "cancelButtonLabel", "applyButtonLabel", "isApplyButtonDisabled", "positionMode", "popupClass", "closePopupOnCancel", "extraInsideSelectors"], outputs: ["cancelAction", "applyAction", "opened", "closed"] }, { kind: "component", type: KitTextboxComponent, selector: "kit-textbox", inputs: ["placeholder", "label", "labelTooltip", "defaultValue", "messageIcon", "messageText", "messageTemplate", "disabled", "maxlength", "state", "size", "icon", "clearButton", "showStateIcon", "readonly", "customStateIcon", "type"], outputs: ["defaultValueChange", "disabledChange", "blured", "focused", "changed"] }, { kind: "component", type: KitNumericTextboxComponent, selector: "kit-numeric-textbox", inputs: ["placeholder", "label", "defaultValue", "decimals", "min", "max", "maxlength", "messageIcon", "messageText", "disabled", "format", "state", "icon", "size", "showStateIcon", "readonly"], outputs: ["defaultValueChange", "disabledChange", "blured", "changed"] }, { kind: "component", type: KitTruncateTextComponent, selector: "kit-truncate-text", inputs: ["tooltipText", "lines", "innerHtml"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
15508
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: KitFilterInputComponent, isStandalone: true, selector: "kit-filter-input", inputs: { filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: true, transformFunction: null }, showPopupOnInit: { classPropertyName: "showPopupOnInit", publicName: "showPopupOnInit", isSignal: true, isRequired: false, transformFunction: null }, filterInputType: { classPropertyName: "filterInputType", publicName: "filterInputType", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { filterRemoved: "filterRemoved", filterChanged: "filterChanged" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: ["toggleButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "textboxComponents", predicate: KitTextboxComponent, descendants: true, isSignal: true }, { propertyName: "numericTextboxComponents", predicate: KitNumericTextboxComponent, descendants: true, isSignal: true }, { propertyName: "popup", first: true, predicate: ["popup"], descendants: true, read: KitPopupComponent, isSignal: true }], ngImport: i0, template: "<kit-pill #toggleButton\n [selectable]=\"!filter().readonly\"\n [selected]=\"popup.isPopupOpen\"\n [removable]=\"!filter().readonly && (filter().removable ?? true)\"\n [theme]=\"filter().readonly && kitPillTheme.BLUE || kitPillTheme.DEFAULT\"\n (removed)=\"removeFilter()\"\n (clicked)=\"onPopupToggle()\">\n {{ filter().title | translate }}:\n @if (selectedValues()?.filters; as selectedFilters) {\n <kit-truncate-text class=\"kit-filter-input-selected-values\">\n @for (filter of selectedFilters; track $index) {\n {{ getSelectedFilterText(filter) }}\n\n @if ($index === 0) {\n {{ getSelectedLogicText(selectedValues()) }}\n }\n }\n </kit-truncate-text>\n }\n</kit-pill>\n\n<kit-popup #popup\n popupClass=\"kit-filter-input-popup\"\n [anchor]=\"anchor()\"\n [content]=\"content\"\n [showFooter]=\"true\"\n [applyButtonLabel]=\"'kit.filters.apply' | translate\"\n [cancelButtonLabel]=\"'kit.filters.clear' | translate\"\n [isApplyButtonDisabled]=\"applyButtonDisabled\"\n [closePopupOnCancel]=\"false\"\n [extraInsideSelectors]=\"['.kit-dropdown-popup']\"\n (opened)=\"onPopupOpened()\"\n (applyAction)=\"applyFilter()\"\n (cancelAction)=\"clearAllFilters()\"\n (closed)=\"close()\">\n</kit-popup>\n\n<ng-template #content>\n <div class=\"popup-content\">\n @for (item of filterItems().filters; track $index) {\n <div class=\"filter-item\">\n <kit-dropdown [items]=\"getFilterOperatorDropdownItems()\"\n [size]=\"kitDropdownSize.SMALL\"\n [selectedItem]=\"$any(item.operator)\"\n (selected)=\"onOperatorSelect($event.value, $index)\"\n ></kit-dropdown>\n <div class=\"filter-controls\">\n @switch (filterInputType()) {\n @case (kitFilterType.TEXT) {\n <kit-textbox class=\"filter-item-value\"\n [size]=\"kitTextboxSize.SMALL\"\n [defaultValue]=\"item.value\"\n [disabled]=\"isFilterValueTextboxDisabled($index)\"\n (changed)=\"onValueChange($event, $index)\"\n (keydown.enter)=\"onEnterKey()\"\n ></kit-textbox>\n }\n @case (kitFilterType.NUMERIC) {\n <kit-numeric-textbox class=\"filter-item-value\"\n format=\"#.###\"\n [size]=\"kitNumericTextboxSize.SMALL\"\n [defaultValue]=\"item.value\"\n [min]=\"0\"\n [max]=\"maxIntegerValue\"\n [disabled]=\"isFilterValueTextboxDisabled($index)\"\n (changed)=\"onValueChange($event, $index)\"\n (keydown.enter)=\"onEnterKey()\"\n ></kit-numeric-textbox>\n }\n }\n @if ($index === 0) {\n <kit-dropdown class=\"logic-selector\"\n [selectedItem]=\"filterItems().logic\"\n [items]=\"filterLogicDropdownItems\"\n [size]=\"kitDropdownSize.SMALL\"\n (selected)=\"onLogicChange($event.value)\"\n ></kit-dropdown>\n }\n </div>\n </div>\n }\n </div>\n</ng-template>\n", styles: [".kit-filter-input-selected-values{max-width:180px}::ng-deep .kit-filter-input-popup .popup-content{display:flex;flex-direction:column;gap:10px;width:296px;box-sizing:border-box}::ng-deep .kit-filter-input-popup .filter-item{display:flex;flex-direction:column;gap:10px}::ng-deep .kit-filter-input-popup .filter-item-value{flex:1}::ng-deep .kit-filter-input-popup .filter-controls{display:flex;gap:10px}::ng-deep .kit-filter-input-popup .logic-selector{flex-shrink:0;width:100px}\n"], dependencies: [{ kind: "component", type: KitDropdownComponent, selector: "kit-dropdown", inputs: ["items", "selectedItem", "label", "disabled", "messageIcon", "messageText", "invalid", "defaultItem", "listHeight", "hideDefaultItem", "toggleIcon", "popupSettings", "isValuePrimitive", "footerTemplate", "noDataTemplate", "readonly", "size"], outputs: ["selectedItemChange", "disabledChange", "selected"] }, { kind: "component", type: KitPillComponent, selector: "kit-pill", inputs: ["removable", "selectable", "selected", "type", "theme", "icon", "iconType"], outputs: ["clicked", "removed"] }, { kind: "component", type: KitPopupComponent, selector: "kit-popup", inputs: ["anchor", "content", "closeOnOutsideClick", "showFooter", "cancelButtonLabel", "applyButtonLabel", "isApplyButtonDisabled", "positionMode", "popupClass", "closePopupOnCancel", "extraInsideSelectors"], outputs: ["cancelAction", "applyAction", "opened", "closed"] }, { kind: "component", type: KitTextboxComponent, selector: "kit-textbox", inputs: ["placeholder", "label", "labelTooltip", "defaultValue", "messageIcon", "messageText", "messageTemplate", "disabled", "maxlength", "state", "size", "icon", "clearButton", "showStateIcon", "readonly", "customStateIcon", "type"], outputs: ["defaultValueChange", "disabledChange", "blured", "focused", "changed"] }, { kind: "component", type: KitNumericTextboxComponent, selector: "kit-numeric-textbox", inputs: ["placeholder", "label", "defaultValue", "decimals", "min", "max", "maxlength", "messageIcon", "messageText", "disabled", "format", "state", "icon", "size", "showStateIcon", "readonly"], outputs: ["defaultValueChange", "disabledChange", "blured", "changed"] }, { kind: "component", type: KitTruncateTextComponent, selector: "kit-truncate-text", inputs: ["tooltipText", "lines", "innerHtml"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
15436
15509
|
}
|
|
15437
15510
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: KitFilterInputComponent, decorators: [{
|
|
15438
15511
|
type: Component,
|
|
@@ -15445,7 +15518,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
15445
15518
|
KitNumericTextboxComponent,
|
|
15446
15519
|
KitTruncateTextComponent,
|
|
15447
15520
|
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<kit-pill #toggleButton\n [selectable]=\"!filter().readonly\"\n [selected]=\"popup.isPopupOpen\"\n [removable]=\"!filter().readonly && (filter().removable ?? true)\"\n [theme]=\"filter().readonly && kitPillTheme.BLUE || kitPillTheme.DEFAULT\"\n (removed)=\"removeFilter()\"\n (clicked)=\"onPopupToggle()\">\n {{ filter().title | translate }}:\n @if (selectedValues()?.filters; as selectedFilters) {\n <kit-truncate-text class=\"kit-filter-input-selected-values\">\n @for (filter of selectedFilters; track $index) {\n {{ getSelectedFilterText(filter) }}\n\n @if ($index === 0) {\n {{ getSelectedLogicText(selectedValues()) }}\n }\n }\n </kit-truncate-text>\n }\n</kit-pill>\n\n<kit-popup #popup\n popupClass=\"kit-filter-input-popup\"\n [anchor]=\"anchor()\"\n [content]=\"content\"\n [showFooter]=\"true\"\n [applyButtonLabel]=\"'kit.filters.apply' | translate\"\n [cancelButtonLabel]=\"'kit.filters.clear' | translate\"\n [isApplyButtonDisabled]=\"applyButtonDisabled\"\n [closePopupOnCancel]=\"false\"\n [extraInsideSelectors]=\"['.kit-dropdown-popup']\"\n (opened)=\"onPopupOpened()\"\n (applyAction)=\"applyFilter()\"\n (cancelAction)=\"clearAllFilters()\"\n (closed)=\"close()\">\n</kit-popup>\n\n<ng-template #content>\n <div class=\"popup-content\">\n @for (item of filterItems().filters; track $index) {\n <div class=\"filter-item\">\n <kit-dropdown [items]=\"getFilterOperatorDropdownItems()\"\n [size]=\"kitDropdownSize.SMALL\"\n [selectedItem]=\"$any(item.operator)\"\n (selected)=\"onOperatorSelect($event.value, $index)\"\n ></kit-dropdown>\n <div class=\"filter-controls\">\n @switch (filterInputType()) {\n @case (kitFilterType.TEXT) {\n <kit-textbox class=\"filter-item-value\"\n [size]=\"kitTextboxSize.SMALL\"\n [defaultValue]=\"item.value\"\n [disabled]=\"isFilterValueTextboxDisabled($index)\"\n (changed)=\"onValueChange($event, $index)\"\n (keydown.enter)=\"onEnterKey()\"\n ></kit-textbox>\n }\n @case (kitFilterType.NUMERIC) {\n <kit-numeric-textbox class=\"filter-item-value\"\n format=\"#.###\"\n [size]=\"kitNumericTextboxSize.SMALL\"\n [defaultValue]=\"item.value\"\n [min]=\"0\"\n [max]=\"maxIntegerValue\"\n [disabled]=\"isFilterValueTextboxDisabled($index)\"\n (changed)=\"onValueChange($event, $index)\"\n (keydown.enter)=\"onEnterKey()\"\n ></kit-numeric-textbox>\n }\n }\n @if ($index === 0) {\n <kit-dropdown class=\"logic-selector\"\n [selectedItem]=\"filterItems().logic\"\n [items]=\"filterLogicDropdownItems\"\n [size]=\"kitDropdownSize.SMALL\"\n (selected)=\"onLogicChange($event.value)\"\n ></kit-dropdown>\n }\n </div>\n </div>\n }\n </div>\n</ng-template>\n", styles: [".kit-filter-input-selected-values{max-width:180px}::ng-deep .kit-filter-input-popup .popup-content{display:flex;flex-direction:column;gap:10px;width:296px;box-sizing:border-box}::ng-deep .kit-filter-input-popup .filter-item{display:flex;flex-direction:column;gap:10px}::ng-deep .kit-filter-input-popup .filter-item-value{flex:1}::ng-deep .kit-filter-input-popup .filter-controls{display:flex;gap:10px}::ng-deep .kit-filter-input-popup .logic-selector{flex-shrink:0;width:100px}\n"] }]
|
|
15448
|
-
}], propDecorators: { filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: true }] }], filterInputType: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterInputType", required: true }] }], filterRemoved: [{ type: i0.Output, args: ["filterRemoved"] }], filterChanged: [{ type: i0.Output, args: ["filterChanged"] }], anchor: [{ type: i0.ViewChild, args: ['toggleButton', { ...{ read: ElementRef }, isSignal: true }] }], textboxComponents: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => KitTextboxComponent), { isSignal: true }] }], numericTextboxComponents: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => KitNumericTextboxComponent), { isSignal: true }] }], popup: [{ type: i0.ViewChild, args: ['popup', { ...{ read: KitPopupComponent }, isSignal: true }] }] } });
|
|
15521
|
+
}], propDecorators: { filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: true }] }], showPopupOnInit: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPopupOnInit", required: false }] }], filterInputType: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterInputType", required: true }] }], filterRemoved: [{ type: i0.Output, args: ["filterRemoved"] }], filterChanged: [{ type: i0.Output, args: ["filterChanged"] }], anchor: [{ type: i0.ViewChild, args: ['toggleButton', { ...{ read: ElementRef }, isSignal: true }] }], textboxComponents: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => KitTextboxComponent), { isSignal: true }] }], numericTextboxComponents: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => KitNumericTextboxComponent), { isSignal: true }] }], popup: [{ type: i0.ViewChild, args: ['popup', { ...{ read: KitPopupComponent }, isSignal: true }] }] } });
|
|
15449
15522
|
|
|
15450
15523
|
class KitFilterNullCheckComponent {
|
|
15451
15524
|
constructor() {
|
|
@@ -15478,14 +15551,10 @@ class KitFilterNullCheckComponent {
|
|
|
15478
15551
|
{ label: this.notNullLabel(), value: KitFilterOperator.IS_NOT_NULL, checked: false },
|
|
15479
15552
|
]);
|
|
15480
15553
|
this.initializeSelectedOption();
|
|
15481
|
-
|
|
15482
|
-
this.rafId = requestAnimationFrame(() => {
|
|
15483
|
-
this.onPopupToggle();
|
|
15484
|
-
});
|
|
15485
|
-
}
|
|
15554
|
+
this.openPopupOnInit();
|
|
15486
15555
|
}
|
|
15487
15556
|
ngOnDestroy() {
|
|
15488
|
-
if (this.rafId) {
|
|
15557
|
+
if (this.rafId !== null) {
|
|
15489
15558
|
cancelAnimationFrame(this.rafId);
|
|
15490
15559
|
this.rafId = null;
|
|
15491
15560
|
}
|
|
@@ -15509,7 +15578,7 @@ class KitFilterNullCheckComponent {
|
|
|
15509
15578
|
this.filterChanged.emit(filter);
|
|
15510
15579
|
}
|
|
15511
15580
|
onPopupToggle() {
|
|
15512
|
-
|
|
15581
|
+
this.popup()?.toggle();
|
|
15513
15582
|
}
|
|
15514
15583
|
close() {
|
|
15515
15584
|
if (!this.filter().value && !this.selectedOption()) {
|
|
@@ -15541,6 +15610,15 @@ class KitFilterNullCheckComponent {
|
|
|
15541
15610
|
const option = this.options().find(opt => opt.value === currentFilter.operator);
|
|
15542
15611
|
this.onOptionChange(option ?? this.options()[0]);
|
|
15543
15612
|
}
|
|
15613
|
+
openPopupOnInit() {
|
|
15614
|
+
if (!this.showPopupOnInit() || this.selectedOption()) {
|
|
15615
|
+
return;
|
|
15616
|
+
}
|
|
15617
|
+
this.rafId = requestAnimationFrame(() => {
|
|
15618
|
+
this.rafId = null;
|
|
15619
|
+
this.onPopupToggle();
|
|
15620
|
+
});
|
|
15621
|
+
}
|
|
15544
15622
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: KitFilterNullCheckComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15545
15623
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.1", type: KitFilterNullCheckComponent, isStandalone: true, selector: "kit-filter-null-check", inputs: { filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: true, transformFunction: null }, nullLabel: { classPropertyName: "nullLabel", publicName: "nullLabel", isSignal: true, isRequired: false, transformFunction: null }, notNullLabel: { classPropertyName: "notNullLabel", publicName: "notNullLabel", isSignal: true, isRequired: false, transformFunction: null }, showPopupOnInit: { classPropertyName: "showPopupOnInit", publicName: "showPopupOnInit", isSignal: true, isRequired: false, transformFunction: null }, selectedOption: { classPropertyName: "selectedOption", publicName: "selectedOption", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterRemoved: "filterRemoved", filterChanged: "filterChanged", selectedOption: "selectedOptionChange", options: "optionsChange" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: ["toggleButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "popup", first: true, predicate: ["popup"], descendants: true, read: KitPopupComponent, isSignal: true }], ngImport: i0, template: "<div class=\"kit-filter-null\">\n <kit-pill #toggleButton\n [selectable]=\"!filter().readonly\"\n [selected]=\"popup.isPopupOpen\"\n [removable]=\"!filter().readonly && (filter().removable ?? true)\"\n [theme]=\"filter().readonly && kitPillTheme.BLUE || kitPillTheme.DEFAULT\"\n (removed)=\"removeFilter()\"\n (clicked)=\"onPopupToggle()\">\n {{ filter().title | translate }}: {{ selectedOption()?.label }}\n </kit-pill>\n</div>\n\n<kit-popup #popup\n popupClass=\"kit-filter-null-popup\"\n [anchor]=\"anchor()\"\n [content]=\"content\"\n [showFooter]=\"true\"\n [applyButtonLabel]=\"'kit.filters.apply' | translate\"\n [cancelButtonLabel]=\"'kit.filters.clear' | translate\"\n [closePopupOnCancel]=\"false\"\n (applyAction)=\"applyFilter()\"\n (cancelAction)=\"clearFilter()\"\n (closed)=\"close()\">\n</kit-popup>\n\n<ng-template #content>\n <div class=\"popup-content\">\n <kit-radio-button [items]=\"options()\"\n (changed)=\"onRadioButtonChange($event)\"\n ></kit-radio-button>\n </div>\n</ng-template>\n", styles: ["::ng-deep .kit-filter-null-popup .popup-content{width:172px}::ng-deep .kit-filter-null-popup .kit-radio-button .kit-radio-button-items{flex-direction:column;gap:0}\n"], dependencies: [{ kind: "component", type: KitPillComponent, selector: "kit-pill", inputs: ["removable", "selectable", "selected", "type", "theme", "icon", "iconType"], outputs: ["clicked", "removed"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: KitPopupComponent, selector: "kit-popup", inputs: ["anchor", "content", "closeOnOutsideClick", "showFooter", "cancelButtonLabel", "applyButtonLabel", "isApplyButtonDisabled", "positionMode", "popupClass", "closePopupOnCancel", "extraInsideSelectors"], outputs: ["cancelAction", "applyAction", "opened", "closed"] }, { kind: "component", type: KitRadioButtonComponent, selector: "kit-radio-button", inputs: ["items", "label", "name", "readonly", "type", "value", "checked", "icon", "disabled"], outputs: ["checkedChange", "disabledChange", "changed"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
15546
15624
|
}
|
|
@@ -15564,6 +15642,8 @@ class KitFilterRadioComponent {
|
|
|
15564
15642
|
...(ngDevMode ? [{ debugName: "translateKeyPrefix" }] : /* istanbul ignore next */ []));
|
|
15565
15643
|
this.items = model([], /* @ts-ignore */
|
|
15566
15644
|
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
15645
|
+
this.showPopupOnInit = input(true, /* @ts-ignore */
|
|
15646
|
+
...(ngDevMode ? [{ debugName: "showPopupOnInit" }] : /* istanbul ignore next */ []));
|
|
15567
15647
|
this.filterRemoved = output();
|
|
15568
15648
|
this.filterChanged = output();
|
|
15569
15649
|
this.anchor = viewChild.required('toggleButton', { ...(ngDevMode ? { debugName: "anchor" } : /* istanbul ignore next */ {}), read: ElementRef });
|
|
@@ -15573,11 +15653,18 @@ class KitFilterRadioComponent {
|
|
|
15573
15653
|
this.radioButtonValue = signal(null, /* @ts-ignore */
|
|
15574
15654
|
...(ngDevMode ? [{ debugName: "radioButtonValue" }] : /* istanbul ignore next */ []));
|
|
15575
15655
|
this.kitPillTheme = KitPillTheme;
|
|
15656
|
+
this.popupToggleRafId = null;
|
|
15576
15657
|
}
|
|
15577
15658
|
ngOnInit() {
|
|
15578
15659
|
this.initializeSelectedValue();
|
|
15579
15660
|
this.updateItemsState();
|
|
15580
|
-
this.
|
|
15661
|
+
this.openPopupOnInit();
|
|
15662
|
+
}
|
|
15663
|
+
ngOnDestroy() {
|
|
15664
|
+
if (this.popupToggleRafId !== null) {
|
|
15665
|
+
cancelAnimationFrame(this.popupToggleRafId);
|
|
15666
|
+
this.popupToggleRafId = null;
|
|
15667
|
+
}
|
|
15581
15668
|
}
|
|
15582
15669
|
get selectedFilterValue() {
|
|
15583
15670
|
return this.selectedValue()?.filters[0].value;
|
|
@@ -15661,13 +15748,17 @@ class KitFilterRadioComponent {
|
|
|
15661
15748
|
checked: this.selectedFilterValue === item.value,
|
|
15662
15749
|
})));
|
|
15663
15750
|
}
|
|
15664
|
-
|
|
15665
|
-
if (!this.selectedValue()) {
|
|
15666
|
-
|
|
15751
|
+
openPopupOnInit() {
|
|
15752
|
+
if (!this.showPopupOnInit() || this.selectedValue()) {
|
|
15753
|
+
return;
|
|
15667
15754
|
}
|
|
15755
|
+
this.popupToggleRafId = requestAnimationFrame(() => {
|
|
15756
|
+
this.popupToggleRafId = null;
|
|
15757
|
+
this.onPopupToggle();
|
|
15758
|
+
});
|
|
15668
15759
|
}
|
|
15669
15760
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: KitFilterRadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15670
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: KitFilterRadioComponent, isStandalone: true, selector: "kit-filter-radio", inputs: { filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: true, transformFunction: null }, translateKeyPrefix: { classPropertyName: "translateKeyPrefix", publicName: "translateKeyPrefix", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { items: "itemsChange", filterRemoved: "filterRemoved", filterChanged: "filterChanged" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: ["toggleButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "popup", first: true, predicate: ["popup"], descendants: true, read: KitPopupComponent, isSignal: true }], ngImport: i0, template: "<div class=\"kit-filter-radio\">\n <kit-pill #toggleButton\n [selectable]=\"!filter().readonly\"\n [selected]=\"popup.isPopupOpen\"\n [removable]=\"!filter().readonly && (filter().removable ?? true)\"\n [theme]=\"filter().readonly && kitPillTheme.BLUE || kitPillTheme.DEFAULT\"\n (removed)=\"removeFilter()\"\n (clicked)=\"onPopupToggle()\">\n {{ filter().title | translate }}:\n @if (hasSelectedFilters(selectedFilterValue)) {\n <kit-truncate-text class=\"kit-filter-radio-selected-values\">\n {{ getSelectedFilterText(selectedFilterValue) | translate }}\n </kit-truncate-text>\n }\n </kit-pill>\n</div>\n\n<kit-popup #popup\n popupClass=\"kit-filter-radio-popup\"\n [anchor]=\"anchor()\"\n [content]=\"content\"\n [showFooter]=\"true\"\n [applyButtonLabel]=\"'kit.filters.apply' | translate\"\n [cancelButtonLabel]=\"'kit.filters.clear' | translate\"\n [closePopupOnCancel]=\"false\"\n (applyAction)=\"applyFilter()\"\n (cancelAction)=\"clearAllFilters()\"\n (closed)=\"close()\">\n</kit-popup>\n\n<ng-template #content>\n <div class=\"popup-content\">\n <kit-radio-button [items]=\"buildRadioButtonItems(items())\"\n (changed)=\"onRadioButtonChange($event)\"\n ></kit-radio-button>\n </div>\n</ng-template>\n", styles: [".kit-filter-radio-selected-values{max-width:180px}::ng-deep .kit-filter-radio-popup .popup-content{width:172px;max-height:400px;overflow-y:auto}::ng-deep .kit-filter-radio-popup .kit-radio-button .kit-radio-button-items{flex-direction:column;gap:0}\n"], dependencies: [{ kind: "component", type: KitPillComponent, selector: "kit-pill", inputs: ["removable", "selectable", "selected", "type", "theme", "icon", "iconType"], outputs: ["clicked", "removed"] }, { kind: "component", type: KitPopupComponent, selector: "kit-popup", inputs: ["anchor", "content", "closeOnOutsideClick", "showFooter", "cancelButtonLabel", "applyButtonLabel", "isApplyButtonDisabled", "positionMode", "popupClass", "closePopupOnCancel", "extraInsideSelectors"], outputs: ["cancelAction", "applyAction", "opened", "closed"] }, { kind: "component", type: KitRadioButtonComponent, selector: "kit-radio-button", inputs: ["items", "label", "name", "readonly", "type", "value", "checked", "icon", "disabled"], outputs: ["checkedChange", "disabledChange", "changed"] }, { kind: "component", type: KitTruncateTextComponent, selector: "kit-truncate-text", inputs: ["tooltipText", "lines", "innerHtml"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
15761
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: KitFilterRadioComponent, isStandalone: true, selector: "kit-filter-radio", inputs: { filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: true, transformFunction: null }, translateKeyPrefix: { classPropertyName: "translateKeyPrefix", publicName: "translateKeyPrefix", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, showPopupOnInit: { classPropertyName: "showPopupOnInit", publicName: "showPopupOnInit", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { items: "itemsChange", filterRemoved: "filterRemoved", filterChanged: "filterChanged" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: ["toggleButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "popup", first: true, predicate: ["popup"], descendants: true, read: KitPopupComponent, isSignal: true }], ngImport: i0, template: "<div class=\"kit-filter-radio\">\n <kit-pill #toggleButton\n [selectable]=\"!filter().readonly\"\n [selected]=\"popup.isPopupOpen\"\n [removable]=\"!filter().readonly && (filter().removable ?? true)\"\n [theme]=\"filter().readonly && kitPillTheme.BLUE || kitPillTheme.DEFAULT\"\n (removed)=\"removeFilter()\"\n (clicked)=\"onPopupToggle()\">\n {{ filter().title | translate }}:\n @if (hasSelectedFilters(selectedFilterValue)) {\n <kit-truncate-text class=\"kit-filter-radio-selected-values\">\n {{ getSelectedFilterText(selectedFilterValue) | translate }}\n </kit-truncate-text>\n }\n </kit-pill>\n</div>\n\n<kit-popup #popup\n popupClass=\"kit-filter-radio-popup\"\n [anchor]=\"anchor()\"\n [content]=\"content\"\n [showFooter]=\"true\"\n [applyButtonLabel]=\"'kit.filters.apply' | translate\"\n [cancelButtonLabel]=\"'kit.filters.clear' | translate\"\n [closePopupOnCancel]=\"false\"\n (applyAction)=\"applyFilter()\"\n (cancelAction)=\"clearAllFilters()\"\n (closed)=\"close()\">\n</kit-popup>\n\n<ng-template #content>\n <div class=\"popup-content\">\n <kit-radio-button [items]=\"buildRadioButtonItems(items())\"\n (changed)=\"onRadioButtonChange($event)\"\n ></kit-radio-button>\n </div>\n</ng-template>\n", styles: [".kit-filter-radio-selected-values{max-width:180px}::ng-deep .kit-filter-radio-popup .popup-content{width:172px;max-height:400px;overflow-y:auto}::ng-deep .kit-filter-radio-popup .kit-radio-button .kit-radio-button-items{flex-direction:column;gap:0}\n"], dependencies: [{ kind: "component", type: KitPillComponent, selector: "kit-pill", inputs: ["removable", "selectable", "selected", "type", "theme", "icon", "iconType"], outputs: ["clicked", "removed"] }, { kind: "component", type: KitPopupComponent, selector: "kit-popup", inputs: ["anchor", "content", "closeOnOutsideClick", "showFooter", "cancelButtonLabel", "applyButtonLabel", "isApplyButtonDisabled", "positionMode", "popupClass", "closePopupOnCancel", "extraInsideSelectors"], outputs: ["cancelAction", "applyAction", "opened", "closed"] }, { kind: "component", type: KitRadioButtonComponent, selector: "kit-radio-button", inputs: ["items", "label", "name", "readonly", "type", "value", "checked", "icon", "disabled"], outputs: ["checkedChange", "disabledChange", "changed"] }, { kind: "component", type: KitTruncateTextComponent, selector: "kit-truncate-text", inputs: ["tooltipText", "lines", "innerHtml"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
15671
15762
|
}
|
|
15672
15763
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: KitFilterRadioComponent, decorators: [{
|
|
15673
15764
|
type: Component,
|
|
@@ -15678,7 +15769,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
15678
15769
|
KitRadioButtonComponent,
|
|
15679
15770
|
KitTruncateTextComponent,
|
|
15680
15771
|
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"kit-filter-radio\">\n <kit-pill #toggleButton\n [selectable]=\"!filter().readonly\"\n [selected]=\"popup.isPopupOpen\"\n [removable]=\"!filter().readonly && (filter().removable ?? true)\"\n [theme]=\"filter().readonly && kitPillTheme.BLUE || kitPillTheme.DEFAULT\"\n (removed)=\"removeFilter()\"\n (clicked)=\"onPopupToggle()\">\n {{ filter().title | translate }}:\n @if (hasSelectedFilters(selectedFilterValue)) {\n <kit-truncate-text class=\"kit-filter-radio-selected-values\">\n {{ getSelectedFilterText(selectedFilterValue) | translate }}\n </kit-truncate-text>\n }\n </kit-pill>\n</div>\n\n<kit-popup #popup\n popupClass=\"kit-filter-radio-popup\"\n [anchor]=\"anchor()\"\n [content]=\"content\"\n [showFooter]=\"true\"\n [applyButtonLabel]=\"'kit.filters.apply' | translate\"\n [cancelButtonLabel]=\"'kit.filters.clear' | translate\"\n [closePopupOnCancel]=\"false\"\n (applyAction)=\"applyFilter()\"\n (cancelAction)=\"clearAllFilters()\"\n (closed)=\"close()\">\n</kit-popup>\n\n<ng-template #content>\n <div class=\"popup-content\">\n <kit-radio-button [items]=\"buildRadioButtonItems(items())\"\n (changed)=\"onRadioButtonChange($event)\"\n ></kit-radio-button>\n </div>\n</ng-template>\n", styles: [".kit-filter-radio-selected-values{max-width:180px}::ng-deep .kit-filter-radio-popup .popup-content{width:172px;max-height:400px;overflow-y:auto}::ng-deep .kit-filter-radio-popup .kit-radio-button .kit-radio-button-items{flex-direction:column;gap:0}\n"] }]
|
|
15681
|
-
}], propDecorators: { filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: true }] }], translateKeyPrefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "translateKeyPrefix", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }, { type: i0.Output, args: ["itemsChange"] }], filterRemoved: [{ type: i0.Output, args: ["filterRemoved"] }], filterChanged: [{ type: i0.Output, args: ["filterChanged"] }], anchor: [{ type: i0.ViewChild, args: ['toggleButton', { ...{ read: ElementRef }, isSignal: true }] }], popup: [{ type: i0.ViewChild, args: ['popup', { ...{ read: KitPopupComponent }, isSignal: true }] }] } });
|
|
15772
|
+
}], propDecorators: { filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: true }] }], translateKeyPrefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "translateKeyPrefix", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }, { type: i0.Output, args: ["itemsChange"] }], showPopupOnInit: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPopupOnInit", required: false }] }], filterRemoved: [{ type: i0.Output, args: ["filterRemoved"] }], filterChanged: [{ type: i0.Output, args: ["filterChanged"] }], anchor: [{ type: i0.ViewChild, args: ['toggleButton', { ...{ read: ElementRef }, isSignal: true }] }], popup: [{ type: i0.ViewChild, args: ['popup', { ...{ read: KitPopupComponent }, isSignal: true }] }] } });
|
|
15682
15773
|
|
|
15683
15774
|
class KitFilterSelectorComponent {
|
|
15684
15775
|
constructor() {
|
|
@@ -15744,14 +15835,20 @@ class KitGridFiltersComponent {
|
|
|
15744
15835
|
.filter(item => !this.excludedColumns().includes(item.field))
|
|
15745
15836
|
.map(item => this.buildFilterSelectorItem(item, this.filters())), /* @ts-ignore */
|
|
15746
15837
|
...(ngDevMode ? [{ debugName: "filterSelectorItems" }] : /* istanbul ignore next */ []));
|
|
15838
|
+
this.filterToAutoOpen = signal(null, /* @ts-ignore */
|
|
15839
|
+
...(ngDevMode ? [{ debugName: "filterToAutoOpen" }] : /* istanbul ignore next */ []));
|
|
15747
15840
|
}
|
|
15748
15841
|
addFilter(item) {
|
|
15842
|
+
this.filterToAutoOpen.set(item.field);
|
|
15749
15843
|
this.store.dispatch(new AddGridFilter({
|
|
15750
15844
|
title: item.title,
|
|
15751
15845
|
field: item.field,
|
|
15752
15846
|
type: item.filterType,
|
|
15753
15847
|
value: null,
|
|
15754
|
-
}))
|
|
15848
|
+
})).subscribe(() => {
|
|
15849
|
+
this.kitGridUrlStateService.replaceGridStateInUrl(this.store.selectSnapshot(KIT_GRID_STATE_TOKEN));
|
|
15850
|
+
});
|
|
15851
|
+
requestAnimationFrame(() => this.filterToAutoOpen.set(null));
|
|
15755
15852
|
}
|
|
15756
15853
|
removeFilter(field) {
|
|
15757
15854
|
this.store.dispatch(new RemoveGridFilter(field)).subscribe(() => {
|
|
@@ -15791,17 +15888,11 @@ class KitGridFiltersComponent {
|
|
|
15791
15888
|
getDateFilterConstraint(filter) {
|
|
15792
15889
|
return this.columns().find(col => col.field === filter.field)?.dateFilterConstraint;
|
|
15793
15890
|
}
|
|
15794
|
-
getCheckboxFilterItems(field) {
|
|
15795
|
-
return this.filterListConfig()[field].items.map(item => ({
|
|
15796
|
-
...item,
|
|
15797
|
-
value: String(item.value),
|
|
15798
|
-
}));
|
|
15799
|
-
}
|
|
15800
15891
|
isFilterSelectorItemDisabled(item, filters) {
|
|
15801
15892
|
return filters.some(filter => filter.field === item.field || filter.field === item.apiField);
|
|
15802
15893
|
}
|
|
15803
15894
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: KitGridFiltersComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15804
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: KitGridFiltersComponent, isStandalone: true, selector: "kit-grid-filters", inputs: { excludedColumns: { classPropertyName: "excludedColumns", publicName: "excludedColumns", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, filterListConfig: { classPropertyName: "filterListConfig", publicName: "filterListConfig", isSignal: true, isRequired: true, transformFunction: null }, useLocalTimeZone: { classPropertyName: "useLocalTimeZone", publicName: "useLocalTimeZone", isSignal: true, isRequired: false, transformFunction: null }, nullLabel: { classPropertyName: "nullLabel", publicName: "nullLabel", isSignal: true, isRequired: false, transformFunction: null }, notNullLabel: { classPropertyName: "notNullLabel", publicName: "notNullLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChanged: "filterChanged" }, ngImport: i0, template: "<div class=\"kit-grid-filters\">\n @for (item of filters(); track item) {\n @switch (item.type) {\n @case (kitFilterType.CHECKBOX) {\n <kit-filter-checkbox [filter]=\"item\"\n [items]=\"
|
|
15895
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: KitGridFiltersComponent, isStandalone: true, selector: "kit-grid-filters", inputs: { excludedColumns: { classPropertyName: "excludedColumns", publicName: "excludedColumns", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, filterListConfig: { classPropertyName: "filterListConfig", publicName: "filterListConfig", isSignal: true, isRequired: true, transformFunction: null }, useLocalTimeZone: { classPropertyName: "useLocalTimeZone", publicName: "useLocalTimeZone", isSignal: true, isRequired: false, transformFunction: null }, nullLabel: { classPropertyName: "nullLabel", publicName: "nullLabel", isSignal: true, isRequired: false, transformFunction: null }, notNullLabel: { classPropertyName: "notNullLabel", publicName: "notNullLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChanged: "filterChanged" }, ngImport: i0, template: "<div class=\"kit-grid-filters\">\n @for (item of filters(); track item.field) {\n @switch (item.type) {\n @case (kitFilterType.CHECKBOX) {\n <kit-filter-checkbox [filter]=\"item\"\n [items]=\"filterListConfig()[item.field].items\"\n [translateKeyPrefix]=\"filterListConfig()[item.field].translateKeyPrefix\"\n [showPopupOnInit]=\"filterToAutoOpen() === item.field\"\n (filterRemoved)=\"removeFilter(item.field)\"\n (filterChanged)=\"applyFilter(item, $event)\"\n ></kit-filter-checkbox>\n }\n @case (kitFilterType.GUID) {\n <kit-filter-checkbox [filter]=\"item\"\n [items]=\"filterListConfig()[item.field].items\"\n [guidField]=\"filterListConfig()[item.field].guidField ?? ''\"\n [showPopupOnInit]=\"filterToAutoOpen() === item.field\"\n (filterRemoved)=\"removeFilter(item.field)\"\n (filterChanged)=\"applyFilter(item, $event)\"\n ></kit-filter-checkbox>\n }\n @case (kitFilterType.RADIO) {\n <kit-filter-radio [filter]=\"item\"\n [items]=\"filterListConfig()?.[item.field].items\"\n [translateKeyPrefix]=\"filterListConfig()?.[item.field].translateKeyPrefix\"\n [showPopupOnInit]=\"filterToAutoOpen() === item.field\"\n (filterRemoved)=\"removeFilter(item.field)\"\n (filterChanged)=\"applyFilter(item, $event)\"\n ></kit-filter-radio>\n }\n @case (kitFilterType.DATE) {\n <kit-filter-date [filter]=\"item\"\n [showPopupOnInit]=\"filterToAutoOpen() === item.field\"\n [useLocalTimeZone]=\"useLocalTimeZone() || isLocalDateColumn(item)\"\n [useUserTimeZone]=\"useUserTimeZone(item)\"\n [dateFilterConstraint]=\"getDateFilterConstraint(item)\"\n (filterRemoved)=\"removeFilter(item.field)\"\n (filterChanged)=\"applyFilter(item, $event)\"\n ></kit-filter-date>\n }\n @case (kitFilterType.TEXT) {\n <kit-filter-input [filterInputType]=\"kitFilterType.TEXT\"\n [filter]=\"item\"\n [showPopupOnInit]=\"filterToAutoOpen() === item.field\"\n (filterRemoved)=\"removeFilter(item.field)\"\n (filterChanged)=\"applyFilter(item, $event)\"\n ></kit-filter-input>\n }\n @case (kitFilterType.NUMERIC) {\n <kit-filter-input [filterInputType]=\"kitFilterType.NUMERIC\"\n [filter]=\"item\"\n [showPopupOnInit]=\"filterToAutoOpen() === item.field\"\n (filterRemoved)=\"removeFilter(item.field)\"\n (filterChanged)=\"applyFilter(item, $event)\"\n ></kit-filter-input>\n }\n @case (kitFilterType.NULL) {\n <kit-filter-null-check [filter]=\"item\"\n [nullLabel]=\"nullLabel()\"\n [notNullLabel]=\"notNullLabel()\"\n [showPopupOnInit]=\"filterToAutoOpen() === item.field\"\n (filterRemoved)=\"removeFilter(item.field)\"\n (filterChanged)=\"applyFilter(item, $event)\"\n ></kit-filter-null-check>\n }\n @case (kitFilterType.CUSTOM_INPUT) {\n <kit-filter-custom-input [filter]=\"item\"\n [showPopupOnInit]=\"filterToAutoOpen() === item.field\"\n (filterRemoved)=\"removeFilter(item.field)\"\n (filterChanged)=\"applyFilter(item, $event)\"\n ></kit-filter-custom-input>\n }\n }\n }\n\n <kit-filter-selector [items]=\"filterSelectorItems()\"\n (itemSelected)=\"addFilter($event)\"\n ></kit-filter-selector>\n</div>\n", styles: [".kit-grid-filters{display:flex;flex-wrap:wrap;gap:10px}::ng-deep .kit-pill-content{white-space:nowrap}\n"], dependencies: [{ kind: "component", type: KitFilterSelectorComponent, selector: "kit-filter-selector", inputs: ["items"], outputs: ["itemSelected"] }, { kind: "component", type: KitFilterCheckboxComponent, selector: "kit-filter-checkbox", inputs: ["filter", "translateKeyPrefix", "items", "showPopupOnInit", "guidField"], outputs: ["itemsChange", "filterRemoved", "filterChanged"] }, { kind: "component", type: KitFilterDateComponent, selector: "kit-filter-date", inputs: ["filter", "showPopupOnInit", "useUserTimeZone", "useLocalTimeZone", "dateFilterConstraint"], outputs: ["filterRemoved", "filterChanged"] }, { kind: "component", type: KitFilterRadioComponent, selector: "kit-filter-radio", inputs: ["filter", "translateKeyPrefix", "items", "showPopupOnInit"], outputs: ["itemsChange", "filterRemoved", "filterChanged"] }, { kind: "component", type: KitFilterInputComponent, selector: "kit-filter-input", inputs: ["filter", "showPopupOnInit", "filterInputType"], outputs: ["filterRemoved", "filterChanged"] }, { kind: "component", type: KitFilterNullCheckComponent, selector: "kit-filter-null-check", inputs: ["filter", "nullLabel", "notNullLabel", "showPopupOnInit", "selectedOption", "options"], outputs: ["filterRemoved", "filterChanged", "selectedOptionChange", "optionsChange"] }, { kind: "component", type: KitFilterCustomInputComponent, selector: "kit-filter-custom-input", inputs: ["filter", "showPopupOnInit"], outputs: ["filterRemoved", "filterChanged"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
15805
15896
|
}
|
|
15806
15897
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: KitGridFiltersComponent, decorators: [{
|
|
15807
15898
|
type: Component,
|
|
@@ -15813,7 +15904,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
15813
15904
|
KitFilterInputComponent,
|
|
15814
15905
|
KitFilterNullCheckComponent,
|
|
15815
15906
|
KitFilterCustomInputComponent,
|
|
15816
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"kit-grid-filters\">\n @for (item of filters(); track item) {\n @switch (item.type) {\n @case (kitFilterType.CHECKBOX) {\n <kit-filter-checkbox [filter]=\"item\"\n [items]=\"
|
|
15907
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"kit-grid-filters\">\n @for (item of filters(); track item.field) {\n @switch (item.type) {\n @case (kitFilterType.CHECKBOX) {\n <kit-filter-checkbox [filter]=\"item\"\n [items]=\"filterListConfig()[item.field].items\"\n [translateKeyPrefix]=\"filterListConfig()[item.field].translateKeyPrefix\"\n [showPopupOnInit]=\"filterToAutoOpen() === item.field\"\n (filterRemoved)=\"removeFilter(item.field)\"\n (filterChanged)=\"applyFilter(item, $event)\"\n ></kit-filter-checkbox>\n }\n @case (kitFilterType.GUID) {\n <kit-filter-checkbox [filter]=\"item\"\n [items]=\"filterListConfig()[item.field].items\"\n [guidField]=\"filterListConfig()[item.field].guidField ?? ''\"\n [showPopupOnInit]=\"filterToAutoOpen() === item.field\"\n (filterRemoved)=\"removeFilter(item.field)\"\n (filterChanged)=\"applyFilter(item, $event)\"\n ></kit-filter-checkbox>\n }\n @case (kitFilterType.RADIO) {\n <kit-filter-radio [filter]=\"item\"\n [items]=\"filterListConfig()?.[item.field].items\"\n [translateKeyPrefix]=\"filterListConfig()?.[item.field].translateKeyPrefix\"\n [showPopupOnInit]=\"filterToAutoOpen() === item.field\"\n (filterRemoved)=\"removeFilter(item.field)\"\n (filterChanged)=\"applyFilter(item, $event)\"\n ></kit-filter-radio>\n }\n @case (kitFilterType.DATE) {\n <kit-filter-date [filter]=\"item\"\n [showPopupOnInit]=\"filterToAutoOpen() === item.field\"\n [useLocalTimeZone]=\"useLocalTimeZone() || isLocalDateColumn(item)\"\n [useUserTimeZone]=\"useUserTimeZone(item)\"\n [dateFilterConstraint]=\"getDateFilterConstraint(item)\"\n (filterRemoved)=\"removeFilter(item.field)\"\n (filterChanged)=\"applyFilter(item, $event)\"\n ></kit-filter-date>\n }\n @case (kitFilterType.TEXT) {\n <kit-filter-input [filterInputType]=\"kitFilterType.TEXT\"\n [filter]=\"item\"\n [showPopupOnInit]=\"filterToAutoOpen() === item.field\"\n (filterRemoved)=\"removeFilter(item.field)\"\n (filterChanged)=\"applyFilter(item, $event)\"\n ></kit-filter-input>\n }\n @case (kitFilterType.NUMERIC) {\n <kit-filter-input [filterInputType]=\"kitFilterType.NUMERIC\"\n [filter]=\"item\"\n [showPopupOnInit]=\"filterToAutoOpen() === item.field\"\n (filterRemoved)=\"removeFilter(item.field)\"\n (filterChanged)=\"applyFilter(item, $event)\"\n ></kit-filter-input>\n }\n @case (kitFilterType.NULL) {\n <kit-filter-null-check [filter]=\"item\"\n [nullLabel]=\"nullLabel()\"\n [notNullLabel]=\"notNullLabel()\"\n [showPopupOnInit]=\"filterToAutoOpen() === item.field\"\n (filterRemoved)=\"removeFilter(item.field)\"\n (filterChanged)=\"applyFilter(item, $event)\"\n ></kit-filter-null-check>\n }\n @case (kitFilterType.CUSTOM_INPUT) {\n <kit-filter-custom-input [filter]=\"item\"\n [showPopupOnInit]=\"filterToAutoOpen() === item.field\"\n (filterRemoved)=\"removeFilter(item.field)\"\n (filterChanged)=\"applyFilter(item, $event)\"\n ></kit-filter-custom-input>\n }\n }\n }\n\n <kit-filter-selector [items]=\"filterSelectorItems()\"\n (itemSelected)=\"addFilter($event)\"\n ></kit-filter-selector>\n</div>\n", styles: [".kit-grid-filters{display:flex;flex-wrap:wrap;gap:10px}::ng-deep .kit-pill-content{white-space:nowrap}\n"] }]
|
|
15817
15908
|
}], propDecorators: { excludedColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "excludedColumns", required: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], filterListConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterListConfig", required: true }] }], useLocalTimeZone: [{ type: i0.Input, args: [{ isSignal: true, alias: "useLocalTimeZone", required: false }] }], nullLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nullLabel", required: false }] }], notNullLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "notNullLabel", required: false }] }], filterChanged: [{ type: i0.Output, args: ["filterChanged"] }] } });
|
|
15818
15909
|
|
|
15819
15910
|
class KitGridFiltersToggleComponent {
|