@mediusinc/mng-commons 7.4.0 → 8.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -62
- package/fesm2022/mediusinc-mng-commons-core.mjs +159 -302
- package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-filter.mjs +3 -9
- package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form-api.mjs +4 -4
- package/fesm2022/mediusinc-mng-commons-form-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form.mjs +285 -203
- package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-model.mjs +2 -5
- package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table-api.mjs +1 -0
- package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
- package/fesm2022/{mediusinc-mng-commons-table-column-toggle.component-BS5xvoDR.mjs → mediusinc-mng-commons-table-column-toggle.component-BHIzrUZz.mjs} +14 -12
- package/fesm2022/mediusinc-mng-commons-table-column-toggle.component-BHIzrUZz.mjs.map +1 -0
- package/fesm2022/{mediusinc-mng-commons-table-mediusinc-mng-commons-table-BfEYZG7s.mjs → mediusinc-mng-commons-table-mediusinc-mng-commons-table-BPgwJRZk.mjs} +558 -522
- package/fesm2022/mediusinc-mng-commons-table-mediusinc-mng-commons-table-BPgwJRZk.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-table.mjs +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +10 -75
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview.mjs +460 -326
- package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons.mjs.map +1 -1
- package/i18n/en.json +1 -1
- package/i18n/sl.json +2 -2
- package/package.json +11 -24
- package/types/mediusinc-mng-commons-core.d.ts +55 -115
- package/types/mediusinc-mng-commons-filter.d.ts +4 -8
- package/types/mediusinc-mng-commons-form-api.d.ts +7 -7
- package/types/mediusinc-mng-commons-form.d.ts +11 -11
- package/types/mediusinc-mng-commons-table-api.d.ts +2 -2
- package/types/mediusinc-mng-commons-table.d.ts +21 -25
- package/types/mediusinc-mng-commons-tableview-api.d.ts +9 -51
- package/types/mediusinc-mng-commons-tableview.d.ts +9 -15
- package/fesm2022/mediusinc-mng-commons-model-class.mjs +0 -97
- package/fesm2022/mediusinc-mng-commons-model-class.mjs.map +0 -1
- package/fesm2022/mediusinc-mng-commons-table-api-class.mjs +0 -204
- package/fesm2022/mediusinc-mng-commons-table-api-class.mjs.map +0 -1
- package/fesm2022/mediusinc-mng-commons-table-column-toggle.component-BS5xvoDR.mjs.map +0 -1
- package/fesm2022/mediusinc-mng-commons-table-mediusinc-mng-commons-table-BfEYZG7s.mjs.map +0 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api-class.mjs +0 -374
- package/fesm2022/mediusinc-mng-commons-tableview-api-class.mjs.map +0 -1
- package/model/class/README.md +0 -8
- package/table/api/class/README.md +0 -10
- package/tableview/api/class/README.md +0 -13
- package/types/mediusinc-mng-commons-model-class.d.ts +0 -25
- package/types/mediusinc-mng-commons-table-api-class.d.ts +0 -77
- package/types/mediusinc-mng-commons-tableview-api-class.d.ts +0 -141
|
@@ -1,45 +1,43 @@
|
|
|
1
|
-
import { trigger, transition, style, animate } from '@angular/animations';
|
|
2
1
|
import { NgTemplateOutlet, NgClass, getCurrencySymbol, DecimalPipe, CurrencyPipe, DatePipe, AsyncPipe } from '@angular/common';
|
|
3
2
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { forwardRef, input, booleanAttribute, model, signal, computed, ViewEncapsulation,
|
|
3
|
+
import { forwardRef, input, booleanAttribute, model, signal, computed, ViewEncapsulation, Component, Injectable, inject, untracked, viewChild, ElementRef, LOCALE_ID, Injector, Pipe, output, InjectionToken, Directive, contentChildren, afterNextRender, HostListener, DestroyRef, viewChildren } from '@angular/core';
|
|
5
4
|
import { takeUntilDestroyed, toObservable, toSignal, outputFromObservable } from '@angular/core/rxjs-interop';
|
|
6
5
|
import * as i1 from '@angular/forms';
|
|
7
6
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
8
7
|
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import * as i1$1 from '
|
|
16
|
-
import { TableModule, Table, TableCheckbox, TableRadioButton } from '
|
|
17
|
-
import { ToggleSwitch } from '
|
|
18
|
-
import { ZIndexUtils } from 'primeng/utils';
|
|
8
|
+
import { DomHandler } from '@openng/optimus-ui/dom';
|
|
9
|
+
import { InputGroup } from '@openng/optimus-ui/inputgroup';
|
|
10
|
+
import { InputGroupAddon } from '@openng/optimus-ui/inputgroupaddon';
|
|
11
|
+
import { InputNumber } from '@openng/optimus-ui/inputnumber';
|
|
12
|
+
import { InputText } from '@openng/optimus-ui/inputtext';
|
|
13
|
+
import { Popover } from '@openng/optimus-ui/popover';
|
|
14
|
+
import * as i1$1 from '@openng/optimus-ui/table';
|
|
15
|
+
import { TableModule, Table, TableCheckbox, TableRadioButton } from '@openng/optimus-ui/table';
|
|
16
|
+
import { ToggleSwitch } from '@openng/optimus-ui/toggleswitch';
|
|
19
17
|
import { Subject, debounceTime, distinctUntilChanged, ReplaySubject, take, switchMap, NEVER, BehaviorSubject, combineLatest, skip, of, filter } from 'rxjs';
|
|
20
|
-
import { FilterMatchMode, dateToIsoString, angularDateFormatHasTime, angularDateFormatHasSeconds,
|
|
18
|
+
import { FilterMatchMode, dateToIsoString, angularDateFormatHasTime, angularDateFormatHasSeconds, fromAngularDateFormatToOptimus, fromAngularNumberFormatToFractions, effectWithDeps, getI18nTypePropertyKey, RerenderDirective, GetterPipe, TemplatePipe, JsonPathPipe, ComponentDirective, BooleanPipe, EnumPipe, isMac, TemplateDirective, findTemplateByName, getI18nErrorParams, getI18nForError, toastMessage, CommonsService, COMMONS_MODULE_CONFIG_IT, toObservable as toObservable$1, objectDeepEquals, CommonsStorageService, LoggerService, booleanOrUndefinedAttribute, mergeDataListParamsWithDefaults, fromTableLoadToDataListParams, fromSubscribeError, getErrorLogLevel, fromUrlQueryToDataListParams, dataListParamsToUrlQuery, I18nPropertyPipe, ClassMapPipe, CommonsFeatureTypeEnum } from '@mediusinc/mng-commons/core';
|
|
21
19
|
import { FilterTypeEnum, FilterDescriptor, FilterLookupTypeEnum, FilterLookupDescriptor, FilterDisplayTypeEnum } from '@mediusinc/mng-commons/filter';
|
|
22
20
|
import { InputTrimDirective, DateRangeComponent, AutocompleteComponent, DropdownComponent, NumberRangeComponent, AutocompleteTemplateDirective, DropdownTemplateDirective, DateRangeTemplateDirective, NumberRangeTemplateDirective, DatetimePickerComponent, LookupLabelResolutionService } from '@mediusinc/mng-commons/form';
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
21
|
+
import { PrimeTemplate, MessageService } from '@openng/optimus-ui/api';
|
|
22
|
+
import { Chip } from '@openng/optimus-ui/chip';
|
|
23
|
+
import { MultiSelect } from '@openng/optimus-ui/multiselect';
|
|
24
|
+
import { ToggleButton } from '@openng/optimus-ui/togglebutton';
|
|
25
|
+
import { ButtonDirective } from '@openng/optimus-ui/button';
|
|
26
|
+
import { Tooltip } from '@openng/optimus-ui/tooltip';
|
|
28
27
|
import { ColumnDisplayTypeEnum, tableDescriptor, TableDynamicDescriptorInst, TablePaginationModeEnum, TableSizeEnum } from '@mediusinc/mng-commons/table/api';
|
|
29
|
-
import { Divider } from '
|
|
30
|
-
import { Menu } from '
|
|
31
|
-
import { Tag, TagModule } from '
|
|
32
|
-
import { Checkbox } from '
|
|
33
|
-
import { Message } from '
|
|
28
|
+
import { Divider } from '@openng/optimus-ui/divider';
|
|
29
|
+
import { Menu } from '@openng/optimus-ui/menu';
|
|
30
|
+
import { Tag, TagModule } from '@openng/optimus-ui/tag';
|
|
31
|
+
import { Checkbox } from '@openng/optimus-ui/checkbox';
|
|
32
|
+
import { Message } from '@openng/optimus-ui/message';
|
|
34
33
|
import { lookupDataProvider } from '@mediusinc/mng-commons/form/api';
|
|
35
|
-
import { IconField } from '
|
|
36
|
-
import { InputIcon } from '
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import { SplitButton } from 'primeng/splitbutton';
|
|
34
|
+
import { IconField } from '@openng/optimus-ui/iconfield';
|
|
35
|
+
import { InputIcon } from '@openng/optimus-ui/inputicon';
|
|
36
|
+
import { Skeleton } from '@openng/optimus-ui/skeleton';
|
|
37
|
+
import { SplitButton } from '@openng/optimus-ui/splitbutton';
|
|
40
38
|
import { Router, ActivatedRoute, NavigationStart, NavigationEnd, NavigationCancel, NavigationError } from '@angular/router';
|
|
41
39
|
import { getI18nForModel } from '@mediusinc/mng-commons/model';
|
|
42
|
-
import {
|
|
40
|
+
import { Optimus } from '@openng/optimus-ui/config';
|
|
43
41
|
|
|
44
42
|
const VALUE_ACCESSOR = {
|
|
45
43
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -54,16 +52,24 @@ class TableFilterInputMultiValueComponent {
|
|
|
54
52
|
this.onChangeFn = () => { };
|
|
55
53
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
56
54
|
this.onTouchedFn = () => { };
|
|
57
|
-
this.filterType = input(
|
|
58
|
-
|
|
59
|
-
this.
|
|
60
|
-
this.
|
|
61
|
-
|
|
62
|
-
this.
|
|
63
|
-
|
|
64
|
-
this.
|
|
65
|
-
this.
|
|
66
|
-
|
|
55
|
+
this.filterType = input(/* @ts-ignore */
|
|
56
|
+
...(ngDevMode ? [undefined, { debugName: "filterType" }] : /* istanbul ignore next */ []));
|
|
57
|
+
this.enableCaseSensitive = input(false, { ...(ngDevMode ? { debugName: "enableCaseSensitive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
58
|
+
this.caseSensitiveModel = model(/* @ts-ignore */
|
|
59
|
+
...(ngDevMode ? [undefined, { debugName: "caseSensitiveModel" }] : /* istanbul ignore next */ []));
|
|
60
|
+
this.inputTrim = input(/* @ts-ignore */
|
|
61
|
+
...(ngDevMode ? [undefined, { debugName: "inputTrim" }] : /* istanbul ignore next */ []));
|
|
62
|
+
this.disabledInput = input(false, { ...(ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {}), alias: 'disabled', transform: booleanAttribute });
|
|
63
|
+
this.className = input(/* @ts-ignore */
|
|
64
|
+
...(ngDevMode ? [undefined, { debugName: "className" }] : /* istanbul ignore next */ []));
|
|
65
|
+
this._disabled = signal(false, /* @ts-ignore */
|
|
66
|
+
...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
67
|
+
this.disabled = computed(() => this.disabledInput() || this._disabled(), /* @ts-ignore */
|
|
68
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
69
|
+
this.value = signal([], /* @ts-ignore */
|
|
70
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
71
|
+
this.stringValues = computed(() => this.value().map(v => String(v)), /* @ts-ignore */
|
|
72
|
+
...(ngDevMode ? [{ debugName: "stringValues" }] : /* istanbul ignore next */ []));
|
|
67
73
|
}
|
|
68
74
|
registerOnChange(fn) {
|
|
69
75
|
this.onChangeFn = fn;
|
|
@@ -78,7 +84,7 @@ class TableFilterInputMultiValueComponent {
|
|
|
78
84
|
this.onTouchedFn();
|
|
79
85
|
}
|
|
80
86
|
onPanelShow(event) {
|
|
81
|
-
//
|
|
87
|
+
// This event type mixup is present in Optimus UI, so use the element when available.
|
|
82
88
|
const motionEvent = event;
|
|
83
89
|
motionEvent.element?.querySelector('input')?.focus();
|
|
84
90
|
}
|
|
@@ -126,82 +132,82 @@ class TableFilterInputMultiValueComponent {
|
|
|
126
132
|
this.value.set(values);
|
|
127
133
|
this.onChangeFn(this.value());
|
|
128
134
|
}
|
|
129
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
130
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
135
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableFilterInputMultiValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
136
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: TableFilterInputMultiValueComponent, isStandalone: true, selector: "mng-table-filter-input-multi-value", inputs: { filterType: { classPropertyName: "filterType", publicName: "filterType", isSignal: true, isRequired: false, transformFunction: null }, enableCaseSensitive: { classPropertyName: "enableCaseSensitive", publicName: "enableCaseSensitive", isSignal: true, isRequired: false, transformFunction: null }, caseSensitiveModel: { classPropertyName: "caseSensitiveModel", publicName: "caseSensitiveModel", isSignal: true, isRequired: false, transformFunction: null }, inputTrim: { classPropertyName: "inputTrim", publicName: "inputTrim", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { caseSensitiveModel: "caseSensitiveModelChange" }, providers: [VALUE_ACCESSOR], ngImport: i0, template: "<p-inputgroup>\n <p-multiSelect\n [ngModel]=\"value()\"\n (ngModelChange)=\"value.set($event)\"\n [options]=\"value()\"\n [showToggleAll]=\"false\"\n [filter]=\"false\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [maxSelectedLabels]=\"1\"\n [selectedItemsLabel]=\"'mngDropdown.multiselectOverMaxDisplayLimit' | translate\"\n [selectAll]=\"false\"\n [disabled]=\"disabled()\"\n (onPanelShow)=\"onPanelShow($event)\"\n [class]=\"className()\"\n display=\"chip\"\n appendTo=\"body\"\n required=\"true\"\n panelStyleClass=\"table-filter-input-multi-value-panel p-2 flex flex-col gap-2 w-full max-w-72\">\n <ng-template pTemplate=\"header\">\n @if (filterType() === FilterTypeEnum.String) {\n <input\n type=\"text\"\n pInputText\n class=\"mng-filter-string w-full\"\n [disabled]=\"disabled()\"\n (keydown.enter)=\"onValueChange($event); $event.preventDefault()\"\n (keydown.tab)=\"onValueChange($event)\"\n (blur)=\"onValueChange($event)\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [mngInputTrim]=\"inputTrim()\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-filter-number\"\n [disabled]=\"disabled()\"\n (keydown.enter)=\"onValueNumberChange($event); $event.preventDefault()\"\n (keydown.tab)=\"onValueNumberChange($event)\"\n (onBlur)=\"onValueNumberChange($event)\"\n [placeholder]=\"'mngFilter.value' | translate\"\n useGrouping=\"false\"\n required=\"true\" />\n }\n </ng-template>\n <ng-template pTemplate=\"footer\">\n <div class=\"flex flex-wrap gap-1 overflow-auto\">\n @if (value().length) {\n @for (val of stringValues(); track val; let i = $index) {\n <p-chip [label]=\"val\" removable (onRemove)=\"removeValue(i)\" />\n }\n } @else {\n <span class=\"p-1\">{{ 'mngFilter.noValues' | translate }}</span>\n }\n </div>\n </ng-template>\n </p-multiSelect>\n @if (filterType() === FilterTypeEnum.String && enableCaseSensitive()) {\n <p-toggle-button\n [ngModel]=\"caseSensitiveModel()\"\n (ngModelChange)=\"caseSensitiveModel.set($event)\"\n [disabled]=\"disabled()\"\n name=\"caseSensitive\"\n class=\"mng-button-xs mng-toggle-button-addon-right\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n }\n</p-inputgroup>\n", styles: [".table-filter-input-multi-value-panel .p-multiselect-list-container,.table-filter-input-multi-value-panel .p-multiselect-header{display:none!important}.p-datatable-header mng-table-filter-input-multi-value{font-size:1rem!important}\n"], dependencies: [{ kind: "component", type: Chip, selector: "p-chip", inputs: ["label", "icon", "image", "alt", "styleClass", "disabled", "removable", "removeIcon", "chipProps"], outputs: ["onRemove", "onImageError"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "autocomplete", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "component", type: MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "styleClass", "panelStyle", "panelStyleClass", "inputId", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "dataKey", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "placeholder", "options", "filterValue", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect", "size", "variant", "fluid", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "directive", type: PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: InputGroup, selector: "p-inputgroup, p-inputGroup, p-input-group", inputs: ["styleClass"] }, { kind: "directive", type: InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "component", type: ToggleButton, selector: "p-toggleButton, p-togglebutton, p-toggle-button", inputs: ["onLabel", "offLabel", "onIcon", "offIcon", "ariaLabel", "ariaLabelledBy", "styleClass", "inputId", "tabindex", "iconPos", "autofocus", "size", "allowEmpty", "fluid"], outputs: ["onChange"] }, { kind: "directive", type: InputTrimDirective, selector: "[mngInputTrim]", inputs: ["mngInputTrim"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
131
137
|
}
|
|
132
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
138
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableFilterInputMultiValueComponent, decorators: [{
|
|
133
139
|
type: Component,
|
|
134
|
-
args: [{ selector: 'mng-table-filter-input-multi-value', providers: [VALUE_ACCESSOR], imports: [Chip, FormsModule, InputNumber, MultiSelect, PrimeTemplate, TranslatePipe, InputGroup, InputText, ToggleButton, InputTrimDirective],
|
|
140
|
+
args: [{ selector: 'mng-table-filter-input-multi-value', providers: [VALUE_ACCESSOR], imports: [Chip, FormsModule, InputNumber, MultiSelect, PrimeTemplate, TranslatePipe, InputGroup, InputText, ToggleButton, InputTrimDirective], encapsulation: ViewEncapsulation.None, template: "<p-inputgroup>\n <p-multiSelect\n [ngModel]=\"value()\"\n (ngModelChange)=\"value.set($event)\"\n [options]=\"value()\"\n [showToggleAll]=\"false\"\n [filter]=\"false\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [maxSelectedLabels]=\"1\"\n [selectedItemsLabel]=\"'mngDropdown.multiselectOverMaxDisplayLimit' | translate\"\n [selectAll]=\"false\"\n [disabled]=\"disabled()\"\n (onPanelShow)=\"onPanelShow($event)\"\n [class]=\"className()\"\n display=\"chip\"\n appendTo=\"body\"\n required=\"true\"\n panelStyleClass=\"table-filter-input-multi-value-panel p-2 flex flex-col gap-2 w-full max-w-72\">\n <ng-template pTemplate=\"header\">\n @if (filterType() === FilterTypeEnum.String) {\n <input\n type=\"text\"\n pInputText\n class=\"mng-filter-string w-full\"\n [disabled]=\"disabled()\"\n (keydown.enter)=\"onValueChange($event); $event.preventDefault()\"\n (keydown.tab)=\"onValueChange($event)\"\n (blur)=\"onValueChange($event)\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [mngInputTrim]=\"inputTrim()\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-filter-number\"\n [disabled]=\"disabled()\"\n (keydown.enter)=\"onValueNumberChange($event); $event.preventDefault()\"\n (keydown.tab)=\"onValueNumberChange($event)\"\n (onBlur)=\"onValueNumberChange($event)\"\n [placeholder]=\"'mngFilter.value' | translate\"\n useGrouping=\"false\"\n required=\"true\" />\n }\n </ng-template>\n <ng-template pTemplate=\"footer\">\n <div class=\"flex flex-wrap gap-1 overflow-auto\">\n @if (value().length) {\n @for (val of stringValues(); track val; let i = $index) {\n <p-chip [label]=\"val\" removable (onRemove)=\"removeValue(i)\" />\n }\n } @else {\n <span class=\"p-1\">{{ 'mngFilter.noValues' | translate }}</span>\n }\n </div>\n </ng-template>\n </p-multiSelect>\n @if (filterType() === FilterTypeEnum.String && enableCaseSensitive()) {\n <p-toggle-button\n [ngModel]=\"caseSensitiveModel()\"\n (ngModelChange)=\"caseSensitiveModel.set($event)\"\n [disabled]=\"disabled()\"\n name=\"caseSensitive\"\n class=\"mng-button-xs mng-toggle-button-addon-right\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n }\n</p-inputgroup>\n", styles: [".table-filter-input-multi-value-panel .p-multiselect-list-container,.table-filter-input-multi-value-panel .p-multiselect-header{display:none!important}.p-datatable-header mng-table-filter-input-multi-value{font-size:1rem!important}\n"] }]
|
|
135
141
|
}], propDecorators: { filterType: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterType", required: false }] }], enableCaseSensitive: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableCaseSensitive", required: false }] }], caseSensitiveModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "caseSensitiveModel", required: false }] }, { type: i0.Output, args: ["caseSensitiveModelChange"] }], inputTrim: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputTrim", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }] } });
|
|
136
142
|
|
|
137
|
-
function filterGenerateMatchModeOptions(
|
|
143
|
+
function filterGenerateMatchModeOptions(optimusConfig, descriptor, cmpSerCfg) {
|
|
138
144
|
let options = undefined;
|
|
139
145
|
if (descriptor == null || descriptor.filterType === FilterTypeEnum.String) {
|
|
140
146
|
options = [
|
|
141
|
-
{ value: FilterMatchMode.Contains, label:
|
|
142
|
-
{ value: FilterMatchMode.NotContains, label:
|
|
143
|
-
{ value: FilterMatchMode.Equals, label:
|
|
144
|
-
{ value: FilterMatchMode.NotEquals, label:
|
|
147
|
+
{ value: FilterMatchMode.Contains, label: optimusConfig.getTranslation(FilterMatchMode.Contains) },
|
|
148
|
+
{ value: FilterMatchMode.NotContains, label: optimusConfig.getTranslation(FilterMatchMode.NotContains) },
|
|
149
|
+
{ value: FilterMatchMode.Equals, label: optimusConfig.getTranslation(FilterMatchMode.Equals) },
|
|
150
|
+
{ value: FilterMatchMode.NotEquals, label: optimusConfig.getTranslation(FilterMatchMode.NotEquals) },
|
|
145
151
|
...(descriptor?.isGenericFilter && descriptor?.genericValueProvider != null
|
|
146
152
|
? []
|
|
147
153
|
: [
|
|
148
|
-
{ value: FilterMatchMode.In, label:
|
|
149
|
-
{ value: FilterMatchMode.NotIn, label:
|
|
154
|
+
{ value: FilterMatchMode.In, label: optimusConfig.getTranslation(FilterMatchMode.In) },
|
|
155
|
+
{ value: FilterMatchMode.NotIn, label: optimusConfig.getTranslation(FilterMatchMode.NotIn) }
|
|
150
156
|
]),
|
|
151
|
-
{ value: FilterMatchMode.StartsWith, label:
|
|
152
|
-
{ value: FilterMatchMode.EndsWith, label:
|
|
157
|
+
{ value: FilterMatchMode.StartsWith, label: optimusConfig.getTranslation(FilterMatchMode.StartsWith) },
|
|
158
|
+
{ value: FilterMatchMode.EndsWith, label: optimusConfig.getTranslation(FilterMatchMode.EndsWith) }
|
|
153
159
|
];
|
|
154
160
|
}
|
|
155
161
|
else if (descriptor.filterType === FilterTypeEnum.Boolean) {
|
|
156
|
-
options = [{ value: FilterMatchMode.Equals, label:
|
|
162
|
+
options = [{ value: FilterMatchMode.Equals, label: optimusConfig.getTranslation(FilterMatchMode.Equals) }];
|
|
157
163
|
}
|
|
158
164
|
else if (descriptor.filterType === FilterTypeEnum.Number) {
|
|
159
165
|
options = [
|
|
160
|
-
{ value: FilterMatchMode.Equals, label:
|
|
161
|
-
{ value: FilterMatchMode.NotEquals, label:
|
|
162
|
-
{ value: FilterMatchMode.LessThan, label:
|
|
163
|
-
{ value: FilterMatchMode.LessThanOrEqualTo, label:
|
|
164
|
-
{ value: FilterMatchMode.GreaterThan, label:
|
|
165
|
-
{ value: FilterMatchMode.GreaterThanOrEqualTo, label:
|
|
166
|
-
{ value: FilterMatchMode.Between, label:
|
|
166
|
+
{ value: FilterMatchMode.Equals, label: optimusConfig.getTranslation(FilterMatchMode.Equals) },
|
|
167
|
+
{ value: FilterMatchMode.NotEquals, label: optimusConfig.getTranslation(FilterMatchMode.NotEquals) },
|
|
168
|
+
{ value: FilterMatchMode.LessThan, label: optimusConfig.getTranslation(FilterMatchMode.LessThan) },
|
|
169
|
+
{ value: FilterMatchMode.LessThanOrEqualTo, label: optimusConfig.getTranslation(FilterMatchMode.LessThanOrEqualTo) },
|
|
170
|
+
{ value: FilterMatchMode.GreaterThan, label: optimusConfig.getTranslation(FilterMatchMode.GreaterThan) },
|
|
171
|
+
{ value: FilterMatchMode.GreaterThanOrEqualTo, label: optimusConfig.getTranslation(FilterMatchMode.GreaterThanOrEqualTo) },
|
|
172
|
+
{ value: FilterMatchMode.Between, label: optimusConfig.getTranslation(FilterMatchMode.Between) },
|
|
167
173
|
...(descriptor.displayFormat === undefined
|
|
168
174
|
? [
|
|
169
|
-
{ value: FilterMatchMode.In, label:
|
|
170
|
-
{ value: FilterMatchMode.NotIn, label:
|
|
175
|
+
{ value: FilterMatchMode.In, label: optimusConfig.getTranslation(FilterMatchMode.In) },
|
|
176
|
+
{ value: FilterMatchMode.NotIn, label: optimusConfig.getTranslation(FilterMatchMode.NotIn) }
|
|
171
177
|
]
|
|
172
178
|
: [])
|
|
173
179
|
];
|
|
174
180
|
}
|
|
175
181
|
else if (descriptor.filterType === FilterTypeEnum.Lookup || descriptor.filterType === FilterTypeEnum.LookupEnum) {
|
|
176
182
|
options = [
|
|
177
|
-
{ value: FilterMatchMode.Equals, label:
|
|
178
|
-
{ value: FilterMatchMode.NotEquals, label:
|
|
179
|
-
{ value: FilterMatchMode.In, label:
|
|
180
|
-
{ value: FilterMatchMode.NotIn, label:
|
|
183
|
+
{ value: FilterMatchMode.Equals, label: optimusConfig.getTranslation(FilterMatchMode.Equals) },
|
|
184
|
+
{ value: FilterMatchMode.NotEquals, label: optimusConfig.getTranslation(FilterMatchMode.NotEquals) },
|
|
185
|
+
{ value: FilterMatchMode.In, label: optimusConfig.getTranslation(FilterMatchMode.In) },
|
|
186
|
+
{ value: FilterMatchMode.NotIn, label: optimusConfig.getTranslation(FilterMatchMode.NotIn) }
|
|
181
187
|
];
|
|
182
188
|
}
|
|
183
189
|
else if (descriptor.filterType === FilterTypeEnum.Date) {
|
|
184
190
|
if (!descriptor.datePickerShowTime && !descriptor.dateValueNoTime && !cmpSerCfg?.filtersDateOnlyDisabled) {
|
|
185
191
|
options = [
|
|
186
|
-
{ value: FilterMatchMode.Equals, label:
|
|
187
|
-
{ value: FilterMatchMode.NotEquals, label:
|
|
188
|
-
{ value: FilterMatchMode.LessThanOrEqualTo, label:
|
|
189
|
-
{ value: FilterMatchMode.GreaterThanOrEqualTo, label:
|
|
190
|
-
{ value: FilterMatchMode.Between, label:
|
|
192
|
+
{ value: FilterMatchMode.Equals, label: optimusConfig.getTranslation(FilterMatchMode.Equals) },
|
|
193
|
+
{ value: FilterMatchMode.NotEquals, label: optimusConfig.getTranslation(FilterMatchMode.NotEquals) },
|
|
194
|
+
{ value: FilterMatchMode.LessThanOrEqualTo, label: optimusConfig.getTranslation(FilterMatchMode.LessThanOrEqualTo) },
|
|
195
|
+
{ value: FilterMatchMode.GreaterThanOrEqualTo, label: optimusConfig.getTranslation(FilterMatchMode.GreaterThanOrEqualTo) },
|
|
196
|
+
{ value: FilterMatchMode.Between, label: optimusConfig.getTranslation(FilterMatchMode.Between) }
|
|
191
197
|
];
|
|
192
198
|
}
|
|
193
199
|
else {
|
|
194
200
|
options = [
|
|
195
|
-
{ value: FilterMatchMode.Equals, label:
|
|
196
|
-
{ value: FilterMatchMode.LessThanOrEqualTo, label:
|
|
197
|
-
{ value: FilterMatchMode.GreaterThanOrEqualTo, label:
|
|
198
|
-
{ value: FilterMatchMode.Between, label:
|
|
201
|
+
{ value: FilterMatchMode.Equals, label: optimusConfig.getTranslation(FilterMatchMode.Equals) },
|
|
202
|
+
{ value: FilterMatchMode.LessThanOrEqualTo, label: optimusConfig.getTranslation(FilterMatchMode.LessThanOrEqualTo) },
|
|
203
|
+
{ value: FilterMatchMode.GreaterThanOrEqualTo, label: optimusConfig.getTranslation(FilterMatchMode.GreaterThanOrEqualTo) },
|
|
204
|
+
{ value: FilterMatchMode.Between, label: optimusConfig.getTranslation(FilterMatchMode.Between) }
|
|
199
205
|
];
|
|
200
206
|
}
|
|
201
207
|
}
|
|
202
|
-
options?.push({ value: FilterMatchMode.Exists, label:
|
|
208
|
+
options?.push({ value: FilterMatchMode.Exists, label: optimusConfig.getTranslation(FilterMatchMode.Exists) }, { value: FilterMatchMode.DoesNotExist, label: optimusConfig.getTranslation(FilterMatchMode.DoesNotExist) });
|
|
203
209
|
if (descriptor?.matchModes) {
|
|
204
|
-
options = descriptor.matchModes.map(mm => ({ value: mm, label:
|
|
210
|
+
options = descriptor.matchModes.map(mm => ({ value: mm, label: optimusConfig.getTranslation(mm) }));
|
|
205
211
|
}
|
|
206
212
|
return options || [];
|
|
207
213
|
}
|
|
@@ -249,9 +255,10 @@ function filterSetStateOnChange(filter, matchMode, value, filterType, filterDate
|
|
|
249
255
|
// display value for calendar cannot be string, convert to date
|
|
250
256
|
displayValue = Array.isArray(displayValue)
|
|
251
257
|
? displayValue.map(v => (!(v instanceof Date) ? new Date(v) : v))
|
|
252
|
-
:
|
|
253
|
-
|
|
254
|
-
|
|
258
|
+
: // eslint-disable-next-line sonarjs/no-nested-conditional
|
|
259
|
+
displayValue instanceof Date
|
|
260
|
+
? displayValue
|
|
261
|
+
: new Date(displayValue);
|
|
255
262
|
}
|
|
256
263
|
if (filterType === FilterTypeEnum.Boolean && displayValue != null && typeof displayValue !== 'boolean') {
|
|
257
264
|
displayValue = (typeof displayValue === 'string' && displayValue.toLowerCase() === 'true') || displayValue === 1;
|
|
@@ -307,6 +314,7 @@ function filterSetStateOnDisplayChange(filter, displayMatchMode, displayValue, f
|
|
|
307
314
|
}
|
|
308
315
|
else if (displayMatchMode === FilterMatchMode.Between) {
|
|
309
316
|
if (Array.isArray(value) && value.length === 2 && value.every(i => i instanceof Date || typeof i === 'string' || typeof i === 'number')) {
|
|
317
|
+
// eslint-disable-next-line sonarjs/use-type-alias
|
|
310
318
|
const fromDate = new Date(value[0]);
|
|
311
319
|
let toDate = new Date(value[1]);
|
|
312
320
|
if (filterAreDatesEqual(fromDate, toDate, filterDateCfg)) {
|
|
@@ -340,9 +348,10 @@ function filterSetStateOnDisplayChange(filter, displayMatchMode, displayValue, f
|
|
|
340
348
|
value =
|
|
341
349
|
value == null
|
|
342
350
|
? value
|
|
343
|
-
:
|
|
344
|
-
|
|
345
|
-
|
|
351
|
+
: // eslint-disable-next-line sonarjs/no-nested-conditional
|
|
352
|
+
Array.isArray(value)
|
|
353
|
+
? value.filter(i => i != null).map(i => dateToIsoString(i, convertDateType, convertDateTimeOpts))
|
|
354
|
+
: dateToIsoString(value, convertDateType, convertDateTimeOpts);
|
|
346
355
|
}
|
|
347
356
|
if (matchMode === FilterMatchMode.Exists || matchMode === FilterMatchMode.DoesNotExist) {
|
|
348
357
|
value = null;
|
|
@@ -360,6 +369,7 @@ function filterAreDatesEqual(fromDate, toDate, filterDateCfg) {
|
|
|
360
369
|
const startDate = dateToIsoString(fromDate);
|
|
361
370
|
const endDate = dateToIsoString(toDate);
|
|
362
371
|
// 2020-11-02T11:12:12.000
|
|
372
|
+
// eslint-disable-next-line sonarjs/no-nested-conditional
|
|
363
373
|
const cmpLength = filterDateCfg?.showTime ? (filterDateCfg?.showSeconds ? 19 : 16) : 10;
|
|
364
374
|
return startDate.substring(0, cmpLength) === endDate.substring(0, cmpLength);
|
|
365
375
|
}
|
|
@@ -400,6 +410,7 @@ function filterAdjustDisplayValueOnMatchModeChange(matchMode, value) {
|
|
|
400
410
|
}
|
|
401
411
|
}
|
|
402
412
|
if (matchMode === FilterMatchMode.In || matchMode === FilterMatchMode.NotIn) {
|
|
413
|
+
// eslint-disable-next-line sonarjs/no-nested-conditional
|
|
403
414
|
return Array.isArray(value) ? value : value == null ? [] : [value];
|
|
404
415
|
}
|
|
405
416
|
return Array.isArray(value) && value.length > 0 ? value[0] : value;
|
|
@@ -414,7 +425,8 @@ function filterGetDateConfig(descriptor, serCfg) {
|
|
|
414
425
|
valueUtc: descriptor.dateValueUtc ?? serCfg?.dateTimeInUtc,
|
|
415
426
|
valueNoTimezone: descriptor.dateValueNoTimezone ?? !serCfg?.dateTimeWithTimezone,
|
|
416
427
|
valueNoMillis: !serCfg?.dateTimeWithMillis,
|
|
417
|
-
format: descriptor.datePickerFormat ??
|
|
428
|
+
format: descriptor.datePickerFormat ??
|
|
429
|
+
(descriptor.displayFormatApplyToField && descriptor.displayFormat ? fromAngularDateFormatToOptimus(descriptor.displayFormat) : undefined),
|
|
418
430
|
showTime: showTime,
|
|
419
431
|
showSeconds: showTime &&
|
|
420
432
|
(descriptor.datePickerShowSeconds ?? (descriptor.displayFormatApplyToField && descriptor.displayFormat ? angularDateFormatHasSeconds(descriptor.displayFormat) : false))
|
|
@@ -463,10 +475,10 @@ function isFilterValueBlank(value) {
|
|
|
463
475
|
}
|
|
464
476
|
|
|
465
477
|
class ADataListService {
|
|
466
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
467
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
478
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ADataListService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
479
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ADataListService }); }
|
|
468
480
|
}
|
|
469
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
481
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ADataListService, decorators: [{
|
|
470
482
|
type: Injectable
|
|
471
483
|
}] });
|
|
472
484
|
|
|
@@ -477,14 +489,18 @@ class FilterService {
|
|
|
477
489
|
#tableFilterState;
|
|
478
490
|
constructor() {
|
|
479
491
|
this.#tableData = inject((ADataListService));
|
|
480
|
-
this.#config = signal(undefined,
|
|
481
|
-
|
|
492
|
+
this.#config = signal(undefined, /* @ts-ignore */
|
|
493
|
+
...(ngDevMode ? [{ debugName: "#config" }] : /* istanbul ignore next */ []));
|
|
494
|
+
this.#state = signal(undefined, /* @ts-ignore */
|
|
495
|
+
...(ngDevMode ? [{ debugName: "#state" }] : /* istanbul ignore next */ []));
|
|
482
496
|
this.state = this.#state.asReadonly();
|
|
483
|
-
this.isActive = computed(() => this.state()?.matchMode === FilterMatchMode.Exists || this.state()?.matchMode === FilterMatchMode.DoesNotExist || !isFilterValueBlank(this.state()?.value),
|
|
497
|
+
this.isActive = computed(() => this.state()?.matchMode === FilterMatchMode.Exists || this.state()?.matchMode === FilterMatchMode.DoesNotExist || !isFilterValueBlank(this.state()?.value), /* @ts-ignore */
|
|
498
|
+
...(ngDevMode ? [{ debugName: "isActive" }] : /* istanbul ignore next */ []));
|
|
484
499
|
this.#tableFilterState = computed(() => {
|
|
485
500
|
const property = this.#config()?.descriptor.property;
|
|
486
501
|
return property ? this.#tableData.filterStates()?.[property] : undefined;
|
|
487
|
-
},
|
|
502
|
+
}, /* @ts-ignore */
|
|
503
|
+
...(ngDevMode ? [{ debugName: "#tableFilterState" }] : /* istanbul ignore next */ []));
|
|
488
504
|
effectWithDeps([this.#config], ([config]) => this.#updateStateIfRequired(config, this.state(), this.#tableFilterState(), false));
|
|
489
505
|
effectWithDeps([this.#tableFilterState], ([currTableFilterState]) => this.#updateStateIfRequired(this.#config(), this.state(), currTableFilterState, false));
|
|
490
506
|
}
|
|
@@ -549,32 +565,18 @@ class FilterService {
|
|
|
549
565
|
currTableFilterState.matchMode ?? state?.matchMode, currTableFilterState.value, untracked(() => config.descriptor.filterType), untracked(() => config.dateConfig)), updateTable);
|
|
550
566
|
}
|
|
551
567
|
}
|
|
552
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
553
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
568
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: FilterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
569
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: FilterService }); }
|
|
554
570
|
}
|
|
555
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
571
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: FilterService, decorators: [{
|
|
556
572
|
type: Injectable
|
|
557
573
|
}], ctorParameters: () => [] });
|
|
558
574
|
|
|
559
575
|
/**
|
|
560
576
|
* Cannot be on push change detection strategy because of filter updates triggered from route which causes to force update values in force metadata
|
|
561
|
-
* and these must be propagated through to this component and beyond to
|
|
577
|
+
* and these must be propagated through to this component and beyond to Optimus UI.
|
|
562
578
|
*/
|
|
563
579
|
class TableFilterComponent {
|
|
564
|
-
#el;
|
|
565
|
-
#renderer;
|
|
566
|
-
#overlayService;
|
|
567
|
-
#cd;
|
|
568
|
-
#document;
|
|
569
|
-
#window;
|
|
570
|
-
#overlaySubscription;
|
|
571
|
-
#overlay;
|
|
572
|
-
#scrollHandler;
|
|
573
|
-
#documentClickListener;
|
|
574
|
-
#documentResizeListener;
|
|
575
|
-
#resetSubscription;
|
|
576
|
-
#selfClick;
|
|
577
|
-
#overlayEventListener;
|
|
578
580
|
#numericValueFromModelChange;
|
|
579
581
|
#dateDebounceSubject;
|
|
580
582
|
constructor() {
|
|
@@ -582,28 +584,28 @@ class TableFilterComponent {
|
|
|
582
584
|
this.lookupTypeAutocomplete = FilterLookupTypeEnum.Autocomplete;
|
|
583
585
|
this.FilterTypeEnum = FilterTypeEnum;
|
|
584
586
|
this.FilterMatchMode = FilterMatchMode;
|
|
585
|
-
this.#el = inject(ElementRef);
|
|
586
|
-
this.#renderer = inject(Renderer2);
|
|
587
|
-
this.#overlayService = inject(OverlayService);
|
|
588
|
-
this.#cd = inject(ChangeDetectorRef);
|
|
589
587
|
this.filter = inject(FilterService);
|
|
590
|
-
this
|
|
591
|
-
|
|
592
|
-
this.
|
|
593
|
-
|
|
594
|
-
this.showFilterIcon = input(false, { ...(ngDevMode ? { debugName: "showFilterIcon" } : {}), transform: booleanAttribute });
|
|
595
|
-
this.showTitleAsPlaceholder = input(false, { ...(ngDevMode ? { debugName: "showTitleAsPlaceholder" } : {}), transform: booleanAttribute });
|
|
596
|
-
this.descriptorAsLookup = computed(() => this.config().descriptor instanceof FilterLookupDescriptor ? this.config().descriptor : undefined,
|
|
597
|
-
|
|
598
|
-
this.
|
|
599
|
-
|
|
600
|
-
this.
|
|
588
|
+
this.config = input.required(/* @ts-ignore */
|
|
589
|
+
...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
|
|
590
|
+
this.model = input.required(/* @ts-ignore */
|
|
591
|
+
...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
|
|
592
|
+
this.showFilterIcon = input(false, { ...(ngDevMode ? { debugName: "showFilterIcon" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
593
|
+
this.showTitleAsPlaceholder = input(false, { ...(ngDevMode ? { debugName: "showTitleAsPlaceholder" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
594
|
+
this.descriptorAsLookup = computed(() => this.config().descriptor instanceof FilterLookupDescriptor ? this.config().descriptor : undefined, /* @ts-ignore */
|
|
595
|
+
...(ngDevMode ? [{ debugName: "descriptorAsLookup" }] : /* istanbul ignore next */ []));
|
|
596
|
+
this.icon = viewChild('icon', /* @ts-ignore */
|
|
597
|
+
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
598
|
+
this.matchModes = computed(() => this.config().matchModes, /* @ts-ignore */
|
|
599
|
+
...(ngDevMode ? [{ debugName: "matchModes" }] : /* istanbul ignore next */ []));
|
|
600
|
+
this.isInputDisabled = computed(() => this.filter.state()?.matchMode === FilterMatchMode.Exists || this.filter.state()?.matchMode === FilterMatchMode.DoesNotExist, /* @ts-ignore */
|
|
601
|
+
...(ngDevMode ? [{ debugName: "isInputDisabled" }] : /* istanbul ignore next */ []));
|
|
601
602
|
// display configs
|
|
602
603
|
this.isMultiselect = computed(() => {
|
|
603
604
|
const ft = this.filter.state();
|
|
604
605
|
const matchMode = ft?.displayMatchMode ?? this.config().defaultMatchMode;
|
|
605
606
|
return (matchMode === FilterMatchMode.In || matchMode === FilterMatchMode.NotIn) && (ft?.displayValue == null || Array.isArray(ft.displayValue));
|
|
606
|
-
},
|
|
607
|
+
}, /* @ts-ignore */
|
|
608
|
+
...(ngDevMode ? [{ debugName: "isMultiselect" }] : /* istanbul ignore next */ []));
|
|
607
609
|
this.placeholderKey = computed(() => {
|
|
608
610
|
const descriptor = this.config().descriptor;
|
|
609
611
|
let defaultPlaceholderKey = 'mngTable.typeToFilter';
|
|
@@ -620,11 +622,16 @@ class TableFilterComponent {
|
|
|
620
622
|
defaultPlaceholderKey = 'mngTable.selectToFilter';
|
|
621
623
|
}
|
|
622
624
|
return this.showTitleAsPlaceholder() ? this.#getPropertyLabelKey(this.config().descriptor) : defaultPlaceholderKey;
|
|
623
|
-
},
|
|
625
|
+
}, /* @ts-ignore */
|
|
626
|
+
...(ngDevMode ? [{ debugName: "placeholderKey" }] : /* istanbul ignore next */ []));
|
|
624
627
|
this.booleanOptions = [
|
|
625
628
|
{ label: 'general.yes', value: true },
|
|
626
629
|
{ label: 'general.no', value: false }
|
|
627
630
|
];
|
|
631
|
+
this.popover = viewChild('popover', /* @ts-ignore */
|
|
632
|
+
...(ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []));
|
|
633
|
+
this.popoverContent = viewChild('popoverContent', /* @ts-ignore */
|
|
634
|
+
...(ngDevMode ? [{ debugName: "popoverContent" }] : /* istanbul ignore next */ []));
|
|
628
635
|
this.#numericValueFromModelChange = null;
|
|
629
636
|
this.#dateDebounceSubject = new Subject();
|
|
630
637
|
effectWithDeps([this.config], ([config]) => {
|
|
@@ -632,15 +639,6 @@ class TableFilterComponent {
|
|
|
632
639
|
});
|
|
633
640
|
this.#dateDebounceSubject.pipe(debounceTime(500), distinctUntilChanged(), takeUntilDestroyed()).subscribe(v => this.filter.setDisplayValue(v));
|
|
634
641
|
}
|
|
635
|
-
ngOnDestroy() {
|
|
636
|
-
if (this.#overlay) {
|
|
637
|
-
this.#renderer.appendChild(this.#el.nativeElement, this.#overlay);
|
|
638
|
-
ZIndexUtils.clear(this.#overlay);
|
|
639
|
-
this.#onOverlayHide();
|
|
640
|
-
}
|
|
641
|
-
this.#resetSubscription?.unsubscribe();
|
|
642
|
-
this.#overlaySubscription?.unsubscribe();
|
|
643
|
-
}
|
|
644
642
|
onTextModelChange(event) {
|
|
645
643
|
const value = event.target.value;
|
|
646
644
|
if (value === '') {
|
|
@@ -696,7 +694,7 @@ class TableFilterComponent {
|
|
|
696
694
|
}
|
|
697
695
|
onMatchModeChange(displayMatchMode) {
|
|
698
696
|
this.filter.setMatchMode(displayMatchMode);
|
|
699
|
-
this
|
|
697
|
+
this.popover()?.hide();
|
|
700
698
|
}
|
|
701
699
|
onMatchModeKeyDown(event) {
|
|
702
700
|
const item = event.target;
|
|
@@ -731,73 +729,36 @@ class TableFilterComponent {
|
|
|
731
729
|
return;
|
|
732
730
|
}
|
|
733
731
|
this.filter.clear();
|
|
734
|
-
this
|
|
732
|
+
this.popover()?.hide();
|
|
735
733
|
}
|
|
736
|
-
toggleMenu(event) {
|
|
737
|
-
this.
|
|
734
|
+
toggleMenu(event, icon) {
|
|
735
|
+
this.popover()?.toggle(event, icon);
|
|
738
736
|
event.stopPropagation();
|
|
739
737
|
}
|
|
740
|
-
onToggleButtonKeyDown(event) {
|
|
738
|
+
onToggleButtonKeyDown(event, icon) {
|
|
741
739
|
switch (event.key) {
|
|
742
740
|
case 'Escape':
|
|
743
741
|
case 'Tab':
|
|
744
|
-
this.
|
|
742
|
+
this.popover()?.hide();
|
|
745
743
|
break;
|
|
746
744
|
case 'ArrowDown':
|
|
747
|
-
if (this.
|
|
748
|
-
const
|
|
749
|
-
if (
|
|
750
|
-
focusable
|
|
745
|
+
if (this.popover()?.overlayVisible) {
|
|
746
|
+
const target = this.popoverContent()?.nativeElement;
|
|
747
|
+
if (target) {
|
|
748
|
+
const focusable = DomHandler.getFocusableElements(target);
|
|
749
|
+
if (focusable && focusable.length > 0) {
|
|
750
|
+
focusable[0].focus();
|
|
751
|
+
}
|
|
751
752
|
}
|
|
752
753
|
event.preventDefault();
|
|
753
754
|
}
|
|
754
755
|
else if (event.altKey) {
|
|
755
|
-
this.
|
|
756
|
+
this.popover()?.show(event, icon);
|
|
756
757
|
event.preventDefault();
|
|
757
758
|
}
|
|
758
759
|
break;
|
|
759
760
|
}
|
|
760
761
|
}
|
|
761
|
-
onEscape() {
|
|
762
|
-
this.overlayVisible.set(false);
|
|
763
|
-
}
|
|
764
|
-
onContentClick() {
|
|
765
|
-
this.#selfClick = true;
|
|
766
|
-
}
|
|
767
|
-
// onOverlayAnimationStart(event: AnimationEvent) {
|
|
768
|
-
onOverlayAnimationStart(event) {
|
|
769
|
-
switch (event.toState) {
|
|
770
|
-
case 'visible':
|
|
771
|
-
this.#overlay = event.element;
|
|
772
|
-
this.#renderer.appendChild(this.#document.body, this.#overlay);
|
|
773
|
-
// instead of following (commented) line, we use the one below to set z-index of overlay to 1000 (which is primeNG default)
|
|
774
|
-
// ZIndexUtils.set('overlay', this.#overlay, this.#tableMetadata.primeConfig.zIndex.overlay);
|
|
775
|
-
ZIndexUtils.set('overlay', this.#overlay, 1000);
|
|
776
|
-
DomHandler.absolutePosition(this.#overlay, this.icon()?.nativeElement);
|
|
777
|
-
this.#bindDocumentClickListener();
|
|
778
|
-
this.#bindDocumentResizeListener();
|
|
779
|
-
this.#bindScrollListener();
|
|
780
|
-
this.#overlayEventListener = (e) => {
|
|
781
|
-
if (this.#overlay && this.#overlay.contains(e.target)) {
|
|
782
|
-
this.#selfClick = true;
|
|
783
|
-
}
|
|
784
|
-
};
|
|
785
|
-
this.#overlaySubscription = this.#overlayService.clickObservable.subscribe(this.#overlayEventListener);
|
|
786
|
-
break;
|
|
787
|
-
case 'void':
|
|
788
|
-
this.#onOverlayHide();
|
|
789
|
-
this.#overlaySubscription?.unsubscribe();
|
|
790
|
-
break;
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
// onOverlayAnimationEnd(event: AnimationEvent) {
|
|
794
|
-
onOverlayAnimationEnd(event) {
|
|
795
|
-
switch (event.toState) {
|
|
796
|
-
case 'void':
|
|
797
|
-
ZIndexUtils.clear(event.element);
|
|
798
|
-
break;
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
762
|
#findNextMenuModeItem(item) {
|
|
802
763
|
const nextItem = item.nextElementSibling;
|
|
803
764
|
if (nextItem)
|
|
@@ -812,74 +773,6 @@ class TableFilterComponent {
|
|
|
812
773
|
else
|
|
813
774
|
return item.parentElement?.lastElementChild;
|
|
814
775
|
}
|
|
815
|
-
#isOutsideClicked(event) {
|
|
816
|
-
return !(this.#overlay?.isSameNode(event.target) ||
|
|
817
|
-
this.#overlay?.contains(event.target) ||
|
|
818
|
-
this.icon()?.nativeElement.isSameNode(event.target) ||
|
|
819
|
-
this.icon()?.nativeElement.contains(event.target) ||
|
|
820
|
-
DomHandler.hasClass(event.target, 'p-column-filter-add-button') ||
|
|
821
|
-
DomHandler.hasClass(event.target.parentElement, 'p-column-filter-add-button') ||
|
|
822
|
-
DomHandler.hasClass(event.target, 'p-column-filter-remove-button') ||
|
|
823
|
-
DomHandler.hasClass(event.target.parentElement, 'p-column-filter-remove-button'));
|
|
824
|
-
}
|
|
825
|
-
#bindDocumentClickListener() {
|
|
826
|
-
if (!this.#documentClickListener) {
|
|
827
|
-
const documentTarget = this.#el ? this.#el.nativeElement.ownerDocument : 'document';
|
|
828
|
-
this.#documentClickListener = this.#renderer.listen(documentTarget, 'click', event => {
|
|
829
|
-
if (this.overlayVisible() && !this.#selfClick && this.#isOutsideClicked(event)) {
|
|
830
|
-
this.#hideOverlay();
|
|
831
|
-
}
|
|
832
|
-
this.#selfClick = false;
|
|
833
|
-
});
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
#unbindDocumentClickListener() {
|
|
837
|
-
if (this.#documentClickListener) {
|
|
838
|
-
this.#documentClickListener();
|
|
839
|
-
this.#documentClickListener = null;
|
|
840
|
-
this.#selfClick = false;
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
#bindDocumentResizeListener() {
|
|
844
|
-
if (!this.#documentResizeListener) {
|
|
845
|
-
this.#documentResizeListener = this.#renderer.listen(this.#window, 'resize', () => {
|
|
846
|
-
if (this.overlayVisible() && !DomHandler.isTouchDevice()) {
|
|
847
|
-
this.#hideOverlay();
|
|
848
|
-
}
|
|
849
|
-
});
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
#unbindDocumentResizeListener() {
|
|
853
|
-
if (this.#documentResizeListener) {
|
|
854
|
-
this.#documentResizeListener();
|
|
855
|
-
this.#documentResizeListener = null;
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
#bindScrollListener() {
|
|
859
|
-
if (!this.#scrollHandler) {
|
|
860
|
-
this.#scrollHandler = new ConnectedOverlayScrollHandler(this.icon()?.nativeElement, () => {
|
|
861
|
-
if (this.overlayVisible()) {
|
|
862
|
-
this.#hideOverlay();
|
|
863
|
-
}
|
|
864
|
-
});
|
|
865
|
-
}
|
|
866
|
-
this.#scrollHandler.bindScrollListener();
|
|
867
|
-
}
|
|
868
|
-
#unbindScrollListener() {
|
|
869
|
-
if (this.#scrollHandler) {
|
|
870
|
-
this.#scrollHandler.unbindScrollListener();
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
#hideOverlay() {
|
|
874
|
-
this.overlayVisible.set(false);
|
|
875
|
-
this.#cd.markForCheck();
|
|
876
|
-
}
|
|
877
|
-
#onOverlayHide() {
|
|
878
|
-
this.#unbindDocumentClickListener();
|
|
879
|
-
this.#unbindDocumentResizeListener();
|
|
880
|
-
this.#unbindScrollListener();
|
|
881
|
-
this.#overlay = null;
|
|
882
|
-
}
|
|
883
776
|
#getPropertyLabelKey(filterDescriptor) {
|
|
884
777
|
let labelKey;
|
|
885
778
|
if (filterDescriptor.title !== undefined && !filterDescriptor.titleUseModelBase) {
|
|
@@ -890,15 +783,10 @@ class TableFilterComponent {
|
|
|
890
783
|
}
|
|
891
784
|
return labelKey;
|
|
892
785
|
}
|
|
893
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
894
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: TableFilterComponent, isStandalone: true, selector: "mng-table-filter", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null }, showFilterIcon: { classPropertyName: "showFilterIcon", publicName: "showFilterIcon", isSignal: true, isRequired: false, transformFunction: null }, showTitleAsPlaceholder: { classPropertyName: "showTitleAsPlaceholder", publicName: "showTitleAsPlaceholder", isSignal: true, isRequired: false, transformFunction: null } }, providers: [FilterService], viewQueries: [{ propertyName: "icon", first: true, predicate: ["icon"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex items-center\">\n @let requiredFilterMissing = config().descriptor.isRequired && !filter.isActive();\n @let placeholder = (placeholderKey() | translate) + (config().descriptor.isRequired ? ' *' : '');\n <div\n class=\"flex items-center [&_p-inputgroup-addon]:p-0!\"\n [class.mng-filter-active]=\"filter.isActive()\"\n [class.[&_*]:border-red-500!]=\"requiredFilterMissing\"\n [class.mng-filter-required]=\"requiredFilterMissing\">\n @switch (config().descriptor.filterType) {\n @case (FilterTypeEnum.Number) {\n @if (filter.state()?.displayMatchMode === FilterMatchMode.Between) {\n <mng-number-range\n vertical=\"true\"\n className=\"mng-filter-number\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onNumericModelChange($event)\"\n (keyDown)=\"onNumericInputKeyDown($event)\"\n [placeholder]=\"placeholder\"\n [useGrouping]=\"config().descriptor.numberUseGrouping\"\n [minFractionDigits]=\"config().numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"config().numberConfig?.fractionsMax\"\n [disabled]=\"isInputDisabled()\"\n [templates]=\"showFilterIcon() ? [numberRangePrependIcon] : []\" />\n } @else {\n <p-inputgroup>\n @if (showFilterIcon()) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </p-inputgroup-addon>\n }\n @if (filter.state()?.displayMatchMode === FilterMatchMode.In || filter.state()?.displayMatchMode === FilterMatchMode.NotIn) {\n <mng-table-filter-input-multi-value\n name=\"value\"\n [className]=\"showFilterIcon() ? 'rounded-tl-none! rounded-bl-none!' : ''\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onNumericMultiModelChange($event)\"\n [filterType]=\"config().descriptor.filterType\"\n [disabled]=\"isInputDisabled()\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-filter-number\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onNumericModelChange($event)\"\n (onKeyDown)=\"onNumericInputKeyDown($event)\"\n [placeholder]=\"placeholder\"\n [useGrouping]=\"config().descriptor.numberUseGrouping\"\n [minFractionDigits]=\"config().numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"config().numberConfig?.fractionsMax\"\n [disabled]=\"isInputDisabled()\" />\n }\n </p-inputgroup>\n }\n }\n\n @case (FilterTypeEnum.Boolean) {\n <mng-dropdown\n optionsLabelProperty=\"label\"\n optionsValueProperty=\"value\"\n [ngModel]=\"filter.state()?.displayValue\"\n [options]=\"booleanOptions\"\n [optionsLabelTranslate]=\"true\"\n [placeholder]=\"placeholder\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"booleanFilter($event)\"\n [templates]=\"showFilterIcon() ? [dropdownPrependIcon] : []\">\n </mng-dropdown>\n }\n @case (FilterTypeEnum.Date) {\n @if (filter.state()?.displayMatchMode === FilterMatchMode.Between) {\n <mng-date-range\n vertical=\"true\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onDateFilterModelChange($event)\"\n [inputStyleClass]=\"showFilterIcon() ? '!rounded-s-none' : ''\"\n [showTime]=\"config().dateConfig?.showTime ?? false\"\n [showSeconds]=\"config().dateConfig?.showSeconds ?? false\"\n [dateFormat]=\"config().dateConfig?.format\"\n [placeholder]=\"placeholder\"\n [disabled]=\"isInputDisabled()\"\n [templates]=\"showFilterIcon() ? [dateRangePrependIcon] : []\" />\n } @else {\n <p-inputgroup>\n @if (showFilterIcon()) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </p-inputgroup-addon>\n }\n <mng-datetime-picker\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onDateFilterModelChange($event)\"\n [inputStyleClass]=\"showFilterIcon() ? '!rounded-s-none' : ''\"\n [placeholder]=\"placeholder\"\n showIcon=\"true\"\n [time]=\"config().dateConfig?.showTime ?? false\"\n [seconds]=\"config().dateConfig?.showSeconds ?? false\"\n [milliseconds]=\"config().dateConfig?.showMilliseconds ?? false\"\n [primeTimePicker]=\"config().dateConfig?.primeTimePicker ?? false\"\n [timeSelect]=\"config().dateConfig?.timeSelect ?? true\"\n [timeSelectInterval]=\"config().dateConfig?.timeSelectInterval ?? 60\"\n [dateFormat]=\"config().dateConfig?.format\"\n required=\"true\" />\n </p-inputgroup>\n }\n }\n @case (FilterTypeEnum.Lookup) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\" />\n }\n @case (FilterTypeEnum.LookupEnum) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\" />\n }\n @default {\n <p-inputgroup>\n @if (showFilterIcon()) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </p-inputgroup-addon>\n }\n @if (filter.state()?.displayMatchMode === FilterMatchMode.In || filter.state()?.displayMatchMode === FilterMatchMode.NotIn) {\n <mng-table-filter-input-multi-value\n name=\"value\"\n [className]=\"showFilterIcon() ? 'rounded-tl-none! rounded-bl-none!' : ''\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onTextMultiModelChange($event)\"\n [filterType]=\"config().descriptor.filterType\"\n [inputTrim]=\"config().descriptor.trimOption\"\n [disabled]=\"isInputDisabled()\" />\n } @else {\n <input\n type=\"text\"\n pInputText\n class=\"mng-filter-string\"\n [value]=\"filter.state()?.displayValue ?? ''\"\n [disabled]=\"isInputDisabled()\"\n (input)=\"onTextModelChange($event)\"\n (keydown.enter)=\"onTextInputEnterKeyDown($event)\"\n [attr.placeholder]=\"placeholder\"\n [mngInputTrim]=\"config().descriptor.trimOption\" />\n }\n </p-inputgroup>\n }\n }\n\n <ng-template #lookupFilter>\n @if (descriptorAsLookup(); as lookup) {\n @switch (lookup.lookupType) {\n @case (lookupTypeAutocomplete) {\n <mng-autocomplete\n [ngModel]=\"filter.state()?.displayValue\"\n [dataProvider]=\"lookup.dataProvider\"\n [optionsTrackProperty]=\"lookup.optionsValueProperty\"\n [optionsValueProperty]=\"lookup.optionsValueProperty\"\n [optionsLabelProperty]=\"lookup.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookup.optionsLabelTranslate\"\n [multiselect]=\"isMultiselect()\"\n [autoClear]=\"lookup.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookup.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookup.inlineSearch ?? false\"\n [allowInput]=\"lookup.allowInput ?? false\"\n [placeholder]=\"placeholder\"\n [className]=\"lookup.className\"\n [dropdownClassName]=\"lookup.dropdownClassName\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"autocompleteFilter($event)\"\n [searchTrim]=\"config().descriptor.trimOption\"\n [templates]=\"showFilterIcon() ? [autocompletePrependIcon] : []\">\n </mng-autocomplete>\n }\n @case (lookupTypeDropdown) {\n <mng-dropdown\n *mngRerender=\"isMultiselect()\"\n [ngModel]=\"filter.state()?.displayValue\"\n [dataProvider]=\"lookup.dataProvider\"\n [optionsValueProperty]=\"lookup.optionsValueProperty\"\n [optionsLabelProperty]=\"lookup.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookup.optionsLabelTranslate\"\n [inlineSearch]=\"lookup.inlineSearch\"\n [allowInput]=\"lookup.allowInput\"\n [multiselect]=\"isMultiselect()\"\n [placeholder]=\"placeholder\"\n [className]=\"lookup.className\"\n [dropdownClassName]=\"lookup.dropdownClassName\"\n [showClear]=\"false\"\n [changeValueOnBlur]=\"isMultiselect()\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"dropdownFilter($event)\"\n [templates]=\"showFilterIcon() ? [dropdownPrependIcon] : []\">\n </mng-dropdown>\n }\n }\n }\n </ng-template>\n\n <ng-template mngAutocompleteTemplate name=\"prepend\" #autocompletePrependIcon=\"mngAutocompleteTemplate\">\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </ng-template>\n <ng-template mngDropdownTemplate name=\"prepend\" #dropdownPrependIcon=\"mngDropdownTemplate\">\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </ng-template>\n <ng-template mngDateRangeTemplate name=\"prepend\" #dateRangePrependIcon=\"mngDateRangeTemplate\">\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </ng-template>\n <ng-template mngNumberRangeTemplate name=\"prepend\" #numberRangePrependIcon=\"mngNumberRangeTemplate\">\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </ng-template>\n\n <ng-template #iconTemplate>\n <button\n #icon\n class=\"mng-filter-options mng-filter-icon cursor-pointer pi pi-filter w-full h-full rounded-tl-md rounded-bl-md\"\n (click)=\"toggleMenu($event)\"\n (keydown)=\"onToggleButtonKeyDown($event)\"></button>\n </ng-template>\n\n @if (overlayVisible()) {\n <div\n class=\"p-datatable-filter-overlay\"\n (click)=\"onContentClick()\"\n [@overlayAnimation]=\"'visible'\"\n (@overlayAnimation.start)=\"onOverlayAnimationStart($event)\"\n (@overlayAnimation.done)=\"onOverlayAnimationEnd($event)\"\n (keydown.escape)=\"onEscape()\">\n <ul class=\"p-datatable-filter-constraint-list\">\n @for (matchMode of matchModes(); track matchMode; let i = $index) {\n <li\n class=\"p-datatable-filter-constraint\"\n [class.p-datatable-filter-constraint-selected]=\"matchMode.value === filter.state()?.displayMatchMode\"\n (click)=\"onMatchModeChange(matchMode.value)\"\n (keydown)=\"onMatchModeKeyDown($event)\"\n (keydown.enter)=\"onMatchModeChange(matchMode.value)\"\n [attr.tabindex]=\"i === 0 ? '0' : null\">\n {{ matchMode.label }}\n </li>\n }\n @if (config().descriptor.filterType === FilterTypeEnum.String) {\n <li class=\"p-datatable-filter-constraint-separator\" (keydown)=\"onMatchModeKeyDown($event)\"></li>\n <li\n class=\"p-datatable-filter-constraint\"\n (click)=\"onCaseSensitivityToggle()\"\n (keydown)=\"onMatchModeKeyDown($event)\"\n (keydown.enter)=\"onCaseSensitivityToggle()\">\n <div class=\"flex items-center\">\n <span class=\"mr-2\"> {{ 'mngFilter.caseSensitive' | translate }} </span>\n <p-toggle-switch [ngModel]=\"filter.state()?.caseSensitive || false\" class=\"ml-auto pointer-events-none\"></p-toggle-switch>\n </div>\n </li>\n }\n <li class=\"p-datatable-filter-constraint-separator\" (keydown)=\"onMatchModeKeyDown($event)\"></li>\n <li\n class=\"p-datatable-filter-constraint\"\n [class.p-disabled]=\"!filter.isActive()\"\n (click)=\"clear()\"\n (keydown)=\"onMatchModeKeyDown($event)\"\n (keydown.enter)=\"clear()\">\n {{ 'mngPrime.noFilter' | translate }}\n </li>\n </ul>\n </div>\n }\n </div>\n\n @if (!showFilterIcon()) {\n <button\n #icon\n class=\"mng-filter-options cursor-pointer ml-1\"\n [ngClass]=\"{\n 'text-primary': filter.isActive(),\n 'text-slate-400': !filter.isActive()\n }\"\n (click)=\"toggleMenu($event)\"\n (keydown)=\"onToggleButtonKeyDown($event)\">\n <i class=\"pi pi-ellipsis-v\"></i>\n </button>\n }\n</div>\n", styles: ["mng-table-filter{--filter-active-bg: var(--color-primary-50);--filter-active-color: var(--color-primary-600)}mng-table-filter .mng-filter-string{min-width:135px}mng-table-filter .mng-filter-number{min-width:165px}mng-table-filter .mng-filter-date{min-width:170px}mng-table-filter .mng-filter-boolean{min-width:80px}mng-table-filter .mng-filter-lookup,mng-table-filter .mng-filter-lookupenum{min-width:180px}mng-table-filter .mng-filter-required{position:relative}mng-table-filter p-tag.mng-filter-required{border:1px solid var(--color-red-500)}mng-table-filter .mng-filter-required:after{content:\"\";position:absolute;top:0;right:0;width:1rem;height:1rem;background-color:var(--color-red-500);z-index:1;clip-path:polygon(0 0,100% 0,100% 100%,0 0);border-top-right-radius:var(--p-inputgroup-addon-border-radius)}mng-table-filter .mng-filter-icon{color:var(--p-inputgroup-addon-color)}mng-table-filter .mng-filter-icon:hover{background:var(--p-select-filled-hover-background)}mng-table-filter .mng-filter-active *{border-color:var(--filter-active-color)!important}mng-table-filter .mng-filter-active p-inputgroup-addon,mng-table-filter .mng-filter-active input,mng-table-filter .mng-filter-active p-select,mng-table-filter .mng-filter-active p-multiselect,mng-table-filter .mng-filter-active .p-autocomplete-input-multiple{background:var(--filter-active-bg)}mng-table-filter .mng-filter-active .mng-filter-icon{color:var(--filter-active-color)}:root[class*=app-dark] mng-table-filter{--filter-active-bg: var(--p-surface-800);--filter-active-color: var(--p-surface-400)}\n"], dependencies: [{ kind: "ngmodule", type: TableModule }, { kind: "component", type: DateRangeComponent, selector: "mng-date-range", inputs: ["placeholder", "showTime", "showSeconds", "milliseconds", "primeTimePicker", "timeSelect", "timeSelectInterval", "dateFormat", "className", "inputStyleClass", "required", "disabled", "vertical", "templates"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: AutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "optionsTrackProperty", "optionsValueProperty", "optionsLabelProperty", "optionsLabelTranslate", "inlineSearch", "openOnFocus", "multiselect", "placeholder", "className", "dropdownClassName", "showClear", "autoClear", "selectFirst", "allowInput", "searchTrim", "disabled", "templates"], outputs: ["valueChange", "blur"] }, { kind: "component", type: DropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "options", "optionsTrackProperty", "optionsLabelProperty", "optionsLabelTranslate", "optionsValueProperty", "optionsDisabledProperty", "multiselect", "placeholder", "showClear", "selectFirstItem", "className", "dropdownClassName", "changeValueOnBlur", "loading", "disabled", "allowInput", "appendTo", "templates", "inlineSearch", "searchTrim"], outputs: ["valueChange", "blur"] }, { kind: "component", type: InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "autocomplete", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "directive", type: InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "directive", type: InputTrimDirective, selector: "[mngInputTrim]", inputs: ["mngInputTrim"] }, { kind: "component", type: NumberRangeComponent, selector: "mng-number-range", inputs: ["placeholder", "useGrouping", "minFractionDigits", "maxFractionDigits", "required", "disabled", "vertical", "templates", "className"], outputs: ["keyDown"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RerenderDirective, selector: "[mngRerender]", inputs: ["mngRerender"] }, { kind: "component", type: InputGroup, selector: "p-inputgroup, p-inputGroup, p-input-group", inputs: ["styleClass"] }, { kind: "component", type: InputGroupAddon, selector: "p-inputgroup-addon, p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ToggleSwitch, selector: "p-toggleswitch, p-toggleSwitch, p-toggle-switch", inputs: ["styleClass", "tabindex", "inputId", "readonly", "trueValue", "falseValue", "ariaLabel", "size", "ariaLabelledBy", "autofocus"], outputs: ["onChange"] }, { kind: "directive", type: AutocompleteTemplateDirective, selector: "[mngAutocompleteTemplate]", inputs: ["name"], exportAs: ["mngAutocompleteTemplate"] }, { kind: "directive", type: DropdownTemplateDirective, selector: "[mngDropdownTemplate]", inputs: ["name"], exportAs: ["mngDropdownTemplate"] }, { kind: "directive", type: DateRangeTemplateDirective, selector: "[mngDateRangeTemplate]", inputs: ["name"], exportAs: ["mngDateRangeTemplate"] }, { kind: "directive", type: NumberRangeTemplateDirective, selector: "[mngNumberRangeTemplate]", inputs: ["name"], exportAs: ["mngNumberRangeTemplate"] }, { kind: "component", type: DatetimePickerComponent, selector: "mng-datetime-picker", inputs: ["templates", "time", "timeSelect", "timeSelectInterval", "seconds", "milliseconds", "primeTimePicker", "dateFormat", "placeholder", "minDate", "maxDate", "disabled", "showIcon", "showButtonBar", "showClear", "className", "panelStyleClass", "inputStyleClass", "dateRange"], outputs: ["blur"] }, { kind: "component", type: TableFilterInputMultiValueComponent, selector: "mng-table-filter-input-multi-value", inputs: ["filterType", "enableCaseSensitive", "caseSensitiveModel", "inputTrim", "disabled", "className"], outputs: ["caseSensitiveModelChange"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], animations: [
|
|
895
|
-
trigger('overlayAnimation', [
|
|
896
|
-
transition(':enter', [style({ opacity: 0, transform: 'scaleY(0.8)' }), animate('.12s cubic-bezier(0, 0, 0.2, 1)')]),
|
|
897
|
-
transition(':leave', [animate('.1s linear', style({ opacity: 0 }))])
|
|
898
|
-
])
|
|
899
|
-
], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
786
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
787
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: TableFilterComponent, isStandalone: true, selector: "mng-table-filter", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null }, showFilterIcon: { classPropertyName: "showFilterIcon", publicName: "showFilterIcon", isSignal: true, isRequired: false, transformFunction: null }, showTitleAsPlaceholder: { classPropertyName: "showTitleAsPlaceholder", publicName: "showTitleAsPlaceholder", isSignal: true, isRequired: false, transformFunction: null } }, providers: [FilterService], viewQueries: [{ propertyName: "icon", first: true, predicate: ["icon"], descendants: true, isSignal: true }, { propertyName: "popover", first: true, predicate: ["popover"], descendants: true, isSignal: true }, { propertyName: "popoverContent", first: true, predicate: ["popoverContent"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex items-center\">\n @let requiredFilterMissing = config().descriptor.isRequired && !filter.isActive();\n @let placeholder = (placeholderKey() | translate) + (config().descriptor.isRequired ? ' *' : '');\n <div\n class=\"flex items-center [&_p-inputgroup-addon]:p-0!\"\n [class.mng-filter-active]=\"filter.isActive()\"\n [class.[&_*]:border-red-500!]=\"requiredFilterMissing\"\n [class.mng-filter-required]=\"requiredFilterMissing\">\n @switch (config().descriptor.filterType) {\n @case (FilterTypeEnum.Number) {\n @if (filter.state()?.displayMatchMode === FilterMatchMode.Between) {\n <mng-number-range\n vertical=\"true\"\n className=\"mng-filter-number\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onNumericModelChange($event)\"\n (keyDown)=\"onNumericInputKeyDown($event)\"\n [placeholder]=\"placeholder\"\n [useGrouping]=\"config().descriptor.numberUseGrouping\"\n [minFractionDigits]=\"config().numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"config().numberConfig?.fractionsMax\"\n [disabled]=\"isInputDisabled()\"\n [templates]=\"showFilterIcon() ? [numberRangePrependIcon] : []\" />\n } @else {\n <p-inputgroup>\n @if (showFilterIcon()) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </p-inputgroup-addon>\n }\n @if (filter.state()?.displayMatchMode === FilterMatchMode.In || filter.state()?.displayMatchMode === FilterMatchMode.NotIn) {\n <mng-table-filter-input-multi-value\n name=\"value\"\n [className]=\"showFilterIcon() ? 'rounded-tl-none! rounded-bl-none!' : ''\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onNumericMultiModelChange($event)\"\n [filterType]=\"config().descriptor.filterType\"\n [disabled]=\"isInputDisabled()\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-filter-number\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onNumericModelChange($event)\"\n (onKeyDown)=\"onNumericInputKeyDown($event)\"\n [placeholder]=\"placeholder\"\n [useGrouping]=\"config().descriptor.numberUseGrouping\"\n [minFractionDigits]=\"config().numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"config().numberConfig?.fractionsMax\"\n [disabled]=\"isInputDisabled()\" />\n }\n </p-inputgroup>\n }\n }\n\n @case (FilterTypeEnum.Boolean) {\n <mng-dropdown\n optionsLabelProperty=\"label\"\n optionsValueProperty=\"value\"\n [ngModel]=\"filter.state()?.displayValue\"\n [options]=\"booleanOptions\"\n [optionsLabelTranslate]=\"true\"\n [placeholder]=\"placeholder\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"booleanFilter($event)\"\n [templates]=\"showFilterIcon() ? [dropdownPrependIcon] : []\">\n </mng-dropdown>\n }\n @case (FilterTypeEnum.Date) {\n @if (filter.state()?.displayMatchMode === FilterMatchMode.Between) {\n <mng-date-range\n vertical=\"true\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onDateFilterModelChange($event)\"\n [inputStyleClass]=\"showFilterIcon() ? '!rounded-s-none' : ''\"\n [showTime]=\"config().dateConfig?.showTime ?? false\"\n [showSeconds]=\"config().dateConfig?.showSeconds ?? false\"\n [dateFormat]=\"config().dateConfig?.format\"\n [placeholder]=\"placeholder\"\n [disabled]=\"isInputDisabled()\"\n [templates]=\"showFilterIcon() ? [dateRangePrependIcon] : []\" />\n } @else {\n <p-inputgroup>\n @if (showFilterIcon()) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </p-inputgroup-addon>\n }\n <mng-datetime-picker\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onDateFilterModelChange($event)\"\n [inputStyleClass]=\"showFilterIcon() ? '!rounded-s-none' : ''\"\n [placeholder]=\"placeholder\"\n showIcon=\"true\"\n [time]=\"config().dateConfig?.showTime ?? false\"\n [seconds]=\"config().dateConfig?.showSeconds ?? false\"\n [milliseconds]=\"config().dateConfig?.showMilliseconds ?? false\"\n [optimusTimePicker]=\"config().dateConfig?.optimusTimePicker ?? false\"\n [timeSelect]=\"config().dateConfig?.timeSelect ?? true\"\n [timeSelectInterval]=\"config().dateConfig?.timeSelectInterval ?? 60\"\n [dateFormat]=\"config().dateConfig?.format\"\n required=\"true\" />\n </p-inputgroup>\n }\n }\n @case (FilterTypeEnum.Lookup) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\" />\n }\n @case (FilterTypeEnum.LookupEnum) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\" />\n }\n @default {\n <p-inputgroup>\n @if (showFilterIcon()) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </p-inputgroup-addon>\n }\n @if (filter.state()?.displayMatchMode === FilterMatchMode.In || filter.state()?.displayMatchMode === FilterMatchMode.NotIn) {\n <mng-table-filter-input-multi-value\n name=\"value\"\n [className]=\"showFilterIcon() ? 'rounded-tl-none! rounded-bl-none!' : ''\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onTextMultiModelChange($event)\"\n [filterType]=\"config().descriptor.filterType\"\n [inputTrim]=\"config().descriptor.trimOption\"\n [disabled]=\"isInputDisabled()\" />\n } @else {\n <input\n type=\"text\"\n pInputText\n class=\"mng-filter-string\"\n [value]=\"filter.state()?.displayValue ?? ''\"\n [disabled]=\"isInputDisabled()\"\n (input)=\"onTextModelChange($event)\"\n (keydown.enter)=\"onTextInputEnterKeyDown($event)\"\n [attr.placeholder]=\"placeholder\"\n [mngInputTrim]=\"config().descriptor.trimOption\" />\n }\n </p-inputgroup>\n }\n }\n\n <ng-template #lookupFilter>\n @if (descriptorAsLookup(); as lookup) {\n @switch (lookup.lookupType) {\n @case (lookupTypeAutocomplete) {\n <mng-autocomplete\n [ngModel]=\"filter.state()?.displayValue\"\n [dataProvider]=\"lookup.dataProvider\"\n [optionsTrackProperty]=\"lookup.optionsValueProperty\"\n [optionsValueProperty]=\"lookup.optionsValueProperty\"\n [optionsLabelProperty]=\"lookup.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookup.optionsLabelTranslate\"\n [multiselect]=\"isMultiselect()\"\n [autoClear]=\"lookup.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookup.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookup.inlineSearch ?? false\"\n [allowInput]=\"lookup.allowInput ?? false\"\n [placeholder]=\"placeholder\"\n [className]=\"lookup.className\"\n [dropdownClassName]=\"lookup.dropdownClassName\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"autocompleteFilter($event)\"\n [searchTrim]=\"config().descriptor.trimOption\"\n [templates]=\"showFilterIcon() ? [autocompletePrependIcon] : []\">\n </mng-autocomplete>\n }\n @case (lookupTypeDropdown) {\n <mng-dropdown\n *mngRerender=\"isMultiselect()\"\n [ngModel]=\"filter.state()?.displayValue\"\n [dataProvider]=\"lookup.dataProvider\"\n [optionsValueProperty]=\"lookup.optionsValueProperty\"\n [optionsLabelProperty]=\"lookup.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookup.optionsLabelTranslate\"\n [inlineSearch]=\"lookup.inlineSearch\"\n [allowInput]=\"lookup.allowInput\"\n [multiselect]=\"isMultiselect()\"\n [placeholder]=\"placeholder\"\n [className]=\"lookup.className\"\n [dropdownClassName]=\"lookup.dropdownClassName\"\n [showClear]=\"false\"\n [changeValueOnBlur]=\"isMultiselect()\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"dropdownFilter($event)\"\n [templates]=\"showFilterIcon() ? [dropdownPrependIcon] : []\">\n </mng-dropdown>\n }\n }\n }\n </ng-template>\n\n <ng-template mngAutocompleteTemplate name=\"prepend\" #autocompletePrependIcon=\"mngAutocompleteTemplate\">\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </ng-template>\n <ng-template mngDropdownTemplate name=\"prepend\" #dropdownPrependIcon=\"mngDropdownTemplate\">\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </ng-template>\n <ng-template mngDateRangeTemplate name=\"prepend\" #dateRangePrependIcon=\"mngDateRangeTemplate\">\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </ng-template>\n <ng-template mngNumberRangeTemplate name=\"prepend\" #numberRangePrependIcon=\"mngNumberRangeTemplate\">\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </ng-template>\n\n <ng-template #iconTemplate>\n <button\n #icon\n class=\"mng-filter-options mng-filter-icon cursor-pointer pi pi-filter w-full h-full rounded-tl-md rounded-bl-md\"\n (click)=\"toggleMenu($event, icon)\"\n (keydown)=\"onToggleButtonKeyDown($event, icon)\"></button>\n </ng-template>\n\n <p-popover styleClass=\"p-datatable-filter-overlay mng-filter-constraint-list-overlay\" #popover>\n <ul #popoverContent class=\"p-datatable-filter-constraint-list\">\n @for (matchMode of matchModes(); track matchMode; let i = $index) {\n <li\n class=\"p-datatable-filter-constraint\"\n [class.p-datatable-filter-constraint-selected]=\"matchMode.value === filter.state()?.displayMatchMode\"\n (click)=\"onMatchModeChange(matchMode.value)\"\n (keydown)=\"onMatchModeKeyDown($event)\"\n (keydown.enter)=\"this.onMatchModeChange(matchMode.value)\"\n [attr.tabindex]=\"i === 0 ? '0' : null\">\n {{ matchMode.label }}\n </li>\n }\n @if (config().descriptor.filterType === FilterTypeEnum.String) {\n <li class=\"p-datatable-filter-constraint-separator\" (keydown)=\"onMatchModeKeyDown($event)\"></li>\n <li\n class=\"p-datatable-filter-constraint\"\n (click)=\"onCaseSensitivityToggle()\"\n (keydown)=\"onMatchModeKeyDown($event)\"\n (keydown.enter)=\"onCaseSensitivityToggle()\">\n <div class=\"flex items-center\">\n <span class=\"mr-2\"> {{ 'mngFilter.caseSensitive' | translate }} </span>\n <p-toggle-switch [ngModel]=\"filter.state()?.caseSensitive || false\" class=\"ml-auto pointer-events-none\"></p-toggle-switch>\n </div>\n </li>\n }\n <li class=\"p-datatable-filter-constraint-separator\" (keydown)=\"onMatchModeKeyDown($event)\"></li>\n <li\n class=\"p-datatable-filter-constraint\"\n [class.p-disabled]=\"!filter.isActive()\"\n (click)=\"clear()\"\n (keydown)=\"onMatchModeKeyDown($event)\"\n (keydown.enter)=\"clear()\">\n {{ 'optimus.noFilter' | translate }}\n </li>\n </ul>\n </p-popover>\n </div>\n\n @if (!showFilterIcon()) {\n <button\n #icon\n class=\"mng-filter-options cursor-pointer ml-1\"\n [ngClass]=\"{\n 'text-primary': filter.isActive(),\n 'text-slate-400': !filter.isActive()\n }\"\n (click)=\"toggleMenu($event, icon)\"\n (keydown)=\"onToggleButtonKeyDown($event, icon)\">\n <i class=\"pi pi-ellipsis-v\"></i>\n </button>\n }\n</div>\n", styles: ["mng-table-filter{--filter-active-bg: var(--color-primary-50);--filter-active-color: var(--color-primary-600)}mng-table-filter .mng-filter-string{min-width:135px}mng-table-filter .mng-filter-number{min-width:165px}mng-table-filter .mng-filter-date{min-width:170px}mng-table-filter .mng-filter-boolean{min-width:80px}mng-table-filter .mng-filter-lookup,mng-table-filter .mng-filter-lookupenum{min-width:180px}mng-table-filter .mng-filter-required{position:relative}mng-table-filter p-tag.mng-filter-required{border:1px solid var(--color-red-500)}mng-table-filter .mng-filter-required:after{content:\"\";position:absolute;top:0;right:0;width:1rem;height:1rem;background-color:var(--color-red-500);z-index:1;clip-path:polygon(0 0,100% 0,100% 100%,0 0);border-top-right-radius:var(--p-inputgroup-addon-border-radius)}mng-table-filter .mng-filter-icon{color:var(--p-inputgroup-addon-color)}mng-table-filter .mng-filter-icon:hover{background:var(--p-select-filled-hover-background)}mng-table-filter .mng-filter-active *{border-color:var(--filter-active-color)!important}mng-table-filter .mng-filter-active p-inputgroup-addon,mng-table-filter .mng-filter-active input,mng-table-filter .mng-filter-active p-select,mng-table-filter .mng-filter-active p-multiselect,mng-table-filter .mng-filter-active .p-autocomplete-input-multiple{background:var(--filter-active-bg)}mng-table-filter .mng-filter-active .mng-filter-icon{color:var(--filter-active-color)}:root[class*=app-dark] mng-table-filter{--filter-active-bg: var(--p-surface-800);--filter-active-color: var(--p-surface-400)}.mng-filter-constraint-list-overlay>.p-popover-content{padding:0}\n"], dependencies: [{ kind: "ngmodule", type: TableModule }, { kind: "component", type: DateRangeComponent, selector: "mng-date-range", inputs: ["placeholder", "showTime", "showSeconds", "milliseconds", "optimusTimePicker", "timeSelect", "timeSelectInterval", "dateFormat", "className", "inputStyleClass", "required", "disabled", "vertical", "templates"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: AutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "optionsTrackProperty", "optionsValueProperty", "optionsLabelProperty", "optionsLabelTranslate", "inlineSearch", "openOnFocus", "multiselect", "placeholder", "className", "dropdownClassName", "showClear", "autoClear", "selectFirst", "allowInput", "searchTrim", "disabled", "templates"], outputs: ["valueChange", "blur"] }, { kind: "component", type: DropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "options", "optionsTrackProperty", "optionsLabelProperty", "optionsLabelTranslate", "optionsValueProperty", "optionsDisabledProperty", "multiselect", "placeholder", "showClear", "selectFirstItem", "className", "dropdownClassName", "changeValueOnBlur", "loading", "disabled", "allowInput", "appendTo", "templates", "inlineSearch", "searchTrim"], outputs: ["valueChange", "blur"] }, { kind: "component", type: InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "autocomplete", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "directive", type: InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "directive", type: InputTrimDirective, selector: "[mngInputTrim]", inputs: ["mngInputTrim"] }, { kind: "component", type: NumberRangeComponent, selector: "mng-number-range", inputs: ["placeholder", "useGrouping", "minFractionDigits", "maxFractionDigits", "required", "disabled", "vertical", "templates", "className"], outputs: ["keyDown"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RerenderDirective, selector: "[mngRerender]", inputs: ["mngRerender"] }, { kind: "component", type: InputGroup, selector: "p-inputgroup, p-inputGroup, p-input-group", inputs: ["styleClass"] }, { kind: "component", type: InputGroupAddon, selector: "p-inputgroup-addon, p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ToggleSwitch, selector: "p-toggleswitch, p-toggleSwitch, p-toggle-switch", inputs: ["styleClass", "tabindex", "inputId", "readonly", "trueValue", "falseValue", "ariaLabel", "size", "ariaLabelledBy", "autofocus"], outputs: ["onChange"] }, { kind: "directive", type: AutocompleteTemplateDirective, selector: "[mngAutocompleteTemplate]", inputs: ["name"], exportAs: ["mngAutocompleteTemplate"] }, { kind: "directive", type: DropdownTemplateDirective, selector: "[mngDropdownTemplate]", inputs: ["name"], exportAs: ["mngDropdownTemplate"] }, { kind: "directive", type: DateRangeTemplateDirective, selector: "[mngDateRangeTemplate]", inputs: ["name"], exportAs: ["mngDateRangeTemplate"] }, { kind: "directive", type: NumberRangeTemplateDirective, selector: "[mngNumberRangeTemplate]", inputs: ["name"], exportAs: ["mngNumberRangeTemplate"] }, { kind: "component", type: DatetimePickerComponent, selector: "mng-datetime-picker", inputs: ["templates", "time", "timeSelect", "timeSelectInterval", "seconds", "milliseconds", "optimusTimePicker", "dateFormat", "placeholder", "minDate", "maxDate", "disabled", "showIcon", "showButtonBar", "showClear", "className", "panelStyleClass", "inputStyleClass", "dateRange"], outputs: ["blur"] }, { kind: "component", type: Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: TableFilterInputMultiValueComponent, selector: "mng-table-filter-input-multi-value", inputs: ["filterType", "enableCaseSensitive", "caseSensitiveModel", "inputTrim", "disabled", "className"], outputs: ["caseSensitiveModelChange"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
900
788
|
}
|
|
901
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
789
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableFilterComponent, decorators: [{
|
|
902
790
|
type: Component,
|
|
903
791
|
args: [{ selector: 'mng-table-filter', imports: [
|
|
904
792
|
TableModule,
|
|
@@ -922,14 +810,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
922
810
|
DateRangeTemplateDirective,
|
|
923
811
|
NumberRangeTemplateDirective,
|
|
924
812
|
DatetimePickerComponent,
|
|
813
|
+
Popover,
|
|
925
814
|
TableFilterInputMultiValueComponent
|
|
926
|
-
], animations: [
|
|
927
|
-
|
|
928
|
-
transition(':enter', [style({ opacity: 0, transform: 'scaleY(0.8)' }), animate('.12s cubic-bezier(0, 0, 0.2, 1)')]),
|
|
929
|
-
transition(':leave', [animate('.1s linear', style({ opacity: 0 }))])
|
|
930
|
-
])
|
|
931
|
-
], providers: [FilterService], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex items-center\">\n @let requiredFilterMissing = config().descriptor.isRequired && !filter.isActive();\n @let placeholder = (placeholderKey() | translate) + (config().descriptor.isRequired ? ' *' : '');\n <div\n class=\"flex items-center [&_p-inputgroup-addon]:p-0!\"\n [class.mng-filter-active]=\"filter.isActive()\"\n [class.[&_*]:border-red-500!]=\"requiredFilterMissing\"\n [class.mng-filter-required]=\"requiredFilterMissing\">\n @switch (config().descriptor.filterType) {\n @case (FilterTypeEnum.Number) {\n @if (filter.state()?.displayMatchMode === FilterMatchMode.Between) {\n <mng-number-range\n vertical=\"true\"\n className=\"mng-filter-number\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onNumericModelChange($event)\"\n (keyDown)=\"onNumericInputKeyDown($event)\"\n [placeholder]=\"placeholder\"\n [useGrouping]=\"config().descriptor.numberUseGrouping\"\n [minFractionDigits]=\"config().numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"config().numberConfig?.fractionsMax\"\n [disabled]=\"isInputDisabled()\"\n [templates]=\"showFilterIcon() ? [numberRangePrependIcon] : []\" />\n } @else {\n <p-inputgroup>\n @if (showFilterIcon()) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </p-inputgroup-addon>\n }\n @if (filter.state()?.displayMatchMode === FilterMatchMode.In || filter.state()?.displayMatchMode === FilterMatchMode.NotIn) {\n <mng-table-filter-input-multi-value\n name=\"value\"\n [className]=\"showFilterIcon() ? 'rounded-tl-none! rounded-bl-none!' : ''\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onNumericMultiModelChange($event)\"\n [filterType]=\"config().descriptor.filterType\"\n [disabled]=\"isInputDisabled()\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-filter-number\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onNumericModelChange($event)\"\n (onKeyDown)=\"onNumericInputKeyDown($event)\"\n [placeholder]=\"placeholder\"\n [useGrouping]=\"config().descriptor.numberUseGrouping\"\n [minFractionDigits]=\"config().numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"config().numberConfig?.fractionsMax\"\n [disabled]=\"isInputDisabled()\" />\n }\n </p-inputgroup>\n }\n }\n\n @case (FilterTypeEnum.Boolean) {\n <mng-dropdown\n optionsLabelProperty=\"label\"\n optionsValueProperty=\"value\"\n [ngModel]=\"filter.state()?.displayValue\"\n [options]=\"booleanOptions\"\n [optionsLabelTranslate]=\"true\"\n [placeholder]=\"placeholder\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"booleanFilter($event)\"\n [templates]=\"showFilterIcon() ? [dropdownPrependIcon] : []\">\n </mng-dropdown>\n }\n @case (FilterTypeEnum.Date) {\n @if (filter.state()?.displayMatchMode === FilterMatchMode.Between) {\n <mng-date-range\n vertical=\"true\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onDateFilterModelChange($event)\"\n [inputStyleClass]=\"showFilterIcon() ? '!rounded-s-none' : ''\"\n [showTime]=\"config().dateConfig?.showTime ?? false\"\n [showSeconds]=\"config().dateConfig?.showSeconds ?? false\"\n [dateFormat]=\"config().dateConfig?.format\"\n [placeholder]=\"placeholder\"\n [disabled]=\"isInputDisabled()\"\n [templates]=\"showFilterIcon() ? [dateRangePrependIcon] : []\" />\n } @else {\n <p-inputgroup>\n @if (showFilterIcon()) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </p-inputgroup-addon>\n }\n <mng-datetime-picker\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onDateFilterModelChange($event)\"\n [inputStyleClass]=\"showFilterIcon() ? '!rounded-s-none' : ''\"\n [placeholder]=\"placeholder\"\n showIcon=\"true\"\n [time]=\"config().dateConfig?.showTime ?? false\"\n [seconds]=\"config().dateConfig?.showSeconds ?? false\"\n [milliseconds]=\"config().dateConfig?.showMilliseconds ?? false\"\n [primeTimePicker]=\"config().dateConfig?.primeTimePicker ?? false\"\n [timeSelect]=\"config().dateConfig?.timeSelect ?? true\"\n [timeSelectInterval]=\"config().dateConfig?.timeSelectInterval ?? 60\"\n [dateFormat]=\"config().dateConfig?.format\"\n required=\"true\" />\n </p-inputgroup>\n }\n }\n @case (FilterTypeEnum.Lookup) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\" />\n }\n @case (FilterTypeEnum.LookupEnum) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\" />\n }\n @default {\n <p-inputgroup>\n @if (showFilterIcon()) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </p-inputgroup-addon>\n }\n @if (filter.state()?.displayMatchMode === FilterMatchMode.In || filter.state()?.displayMatchMode === FilterMatchMode.NotIn) {\n <mng-table-filter-input-multi-value\n name=\"value\"\n [className]=\"showFilterIcon() ? 'rounded-tl-none! rounded-bl-none!' : ''\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onTextMultiModelChange($event)\"\n [filterType]=\"config().descriptor.filterType\"\n [inputTrim]=\"config().descriptor.trimOption\"\n [disabled]=\"isInputDisabled()\" />\n } @else {\n <input\n type=\"text\"\n pInputText\n class=\"mng-filter-string\"\n [value]=\"filter.state()?.displayValue ?? ''\"\n [disabled]=\"isInputDisabled()\"\n (input)=\"onTextModelChange($event)\"\n (keydown.enter)=\"onTextInputEnterKeyDown($event)\"\n [attr.placeholder]=\"placeholder\"\n [mngInputTrim]=\"config().descriptor.trimOption\" />\n }\n </p-inputgroup>\n }\n }\n\n <ng-template #lookupFilter>\n @if (descriptorAsLookup(); as lookup) {\n @switch (lookup.lookupType) {\n @case (lookupTypeAutocomplete) {\n <mng-autocomplete\n [ngModel]=\"filter.state()?.displayValue\"\n [dataProvider]=\"lookup.dataProvider\"\n [optionsTrackProperty]=\"lookup.optionsValueProperty\"\n [optionsValueProperty]=\"lookup.optionsValueProperty\"\n [optionsLabelProperty]=\"lookup.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookup.optionsLabelTranslate\"\n [multiselect]=\"isMultiselect()\"\n [autoClear]=\"lookup.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookup.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookup.inlineSearch ?? false\"\n [allowInput]=\"lookup.allowInput ?? false\"\n [placeholder]=\"placeholder\"\n [className]=\"lookup.className\"\n [dropdownClassName]=\"lookup.dropdownClassName\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"autocompleteFilter($event)\"\n [searchTrim]=\"config().descriptor.trimOption\"\n [templates]=\"showFilterIcon() ? [autocompletePrependIcon] : []\">\n </mng-autocomplete>\n }\n @case (lookupTypeDropdown) {\n <mng-dropdown\n *mngRerender=\"isMultiselect()\"\n [ngModel]=\"filter.state()?.displayValue\"\n [dataProvider]=\"lookup.dataProvider\"\n [optionsValueProperty]=\"lookup.optionsValueProperty\"\n [optionsLabelProperty]=\"lookup.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookup.optionsLabelTranslate\"\n [inlineSearch]=\"lookup.inlineSearch\"\n [allowInput]=\"lookup.allowInput\"\n [multiselect]=\"isMultiselect()\"\n [placeholder]=\"placeholder\"\n [className]=\"lookup.className\"\n [dropdownClassName]=\"lookup.dropdownClassName\"\n [showClear]=\"false\"\n [changeValueOnBlur]=\"isMultiselect()\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"dropdownFilter($event)\"\n [templates]=\"showFilterIcon() ? [dropdownPrependIcon] : []\">\n </mng-dropdown>\n }\n }\n }\n </ng-template>\n\n <ng-template mngAutocompleteTemplate name=\"prepend\" #autocompletePrependIcon=\"mngAutocompleteTemplate\">\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </ng-template>\n <ng-template mngDropdownTemplate name=\"prepend\" #dropdownPrependIcon=\"mngDropdownTemplate\">\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </ng-template>\n <ng-template mngDateRangeTemplate name=\"prepend\" #dateRangePrependIcon=\"mngDateRangeTemplate\">\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </ng-template>\n <ng-template mngNumberRangeTemplate name=\"prepend\" #numberRangePrependIcon=\"mngNumberRangeTemplate\">\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </ng-template>\n\n <ng-template #iconTemplate>\n <button\n #icon\n class=\"mng-filter-options mng-filter-icon cursor-pointer pi pi-filter w-full h-full rounded-tl-md rounded-bl-md\"\n (click)=\"toggleMenu($event)\"\n (keydown)=\"onToggleButtonKeyDown($event)\"></button>\n </ng-template>\n\n @if (overlayVisible()) {\n <div\n class=\"p-datatable-filter-overlay\"\n (click)=\"onContentClick()\"\n [@overlayAnimation]=\"'visible'\"\n (@overlayAnimation.start)=\"onOverlayAnimationStart($event)\"\n (@overlayAnimation.done)=\"onOverlayAnimationEnd($event)\"\n (keydown.escape)=\"onEscape()\">\n <ul class=\"p-datatable-filter-constraint-list\">\n @for (matchMode of matchModes(); track matchMode; let i = $index) {\n <li\n class=\"p-datatable-filter-constraint\"\n [class.p-datatable-filter-constraint-selected]=\"matchMode.value === filter.state()?.displayMatchMode\"\n (click)=\"onMatchModeChange(matchMode.value)\"\n (keydown)=\"onMatchModeKeyDown($event)\"\n (keydown.enter)=\"onMatchModeChange(matchMode.value)\"\n [attr.tabindex]=\"i === 0 ? '0' : null\">\n {{ matchMode.label }}\n </li>\n }\n @if (config().descriptor.filterType === FilterTypeEnum.String) {\n <li class=\"p-datatable-filter-constraint-separator\" (keydown)=\"onMatchModeKeyDown($event)\"></li>\n <li\n class=\"p-datatable-filter-constraint\"\n (click)=\"onCaseSensitivityToggle()\"\n (keydown)=\"onMatchModeKeyDown($event)\"\n (keydown.enter)=\"onCaseSensitivityToggle()\">\n <div class=\"flex items-center\">\n <span class=\"mr-2\"> {{ 'mngFilter.caseSensitive' | translate }} </span>\n <p-toggle-switch [ngModel]=\"filter.state()?.caseSensitive || false\" class=\"ml-auto pointer-events-none\"></p-toggle-switch>\n </div>\n </li>\n }\n <li class=\"p-datatable-filter-constraint-separator\" (keydown)=\"onMatchModeKeyDown($event)\"></li>\n <li\n class=\"p-datatable-filter-constraint\"\n [class.p-disabled]=\"!filter.isActive()\"\n (click)=\"clear()\"\n (keydown)=\"onMatchModeKeyDown($event)\"\n (keydown.enter)=\"clear()\">\n {{ 'mngPrime.noFilter' | translate }}\n </li>\n </ul>\n </div>\n }\n </div>\n\n @if (!showFilterIcon()) {\n <button\n #icon\n class=\"mng-filter-options cursor-pointer ml-1\"\n [ngClass]=\"{\n 'text-primary': filter.isActive(),\n 'text-slate-400': !filter.isActive()\n }\"\n (click)=\"toggleMenu($event)\"\n (keydown)=\"onToggleButtonKeyDown($event)\">\n <i class=\"pi pi-ellipsis-v\"></i>\n </button>\n }\n</div>\n", styles: ["mng-table-filter{--filter-active-bg: var(--color-primary-50);--filter-active-color: var(--color-primary-600)}mng-table-filter .mng-filter-string{min-width:135px}mng-table-filter .mng-filter-number{min-width:165px}mng-table-filter .mng-filter-date{min-width:170px}mng-table-filter .mng-filter-boolean{min-width:80px}mng-table-filter .mng-filter-lookup,mng-table-filter .mng-filter-lookupenum{min-width:180px}mng-table-filter .mng-filter-required{position:relative}mng-table-filter p-tag.mng-filter-required{border:1px solid var(--color-red-500)}mng-table-filter .mng-filter-required:after{content:\"\";position:absolute;top:0;right:0;width:1rem;height:1rem;background-color:var(--color-red-500);z-index:1;clip-path:polygon(0 0,100% 0,100% 100%,0 0);border-top-right-radius:var(--p-inputgroup-addon-border-radius)}mng-table-filter .mng-filter-icon{color:var(--p-inputgroup-addon-color)}mng-table-filter .mng-filter-icon:hover{background:var(--p-select-filled-hover-background)}mng-table-filter .mng-filter-active *{border-color:var(--filter-active-color)!important}mng-table-filter .mng-filter-active p-inputgroup-addon,mng-table-filter .mng-filter-active input,mng-table-filter .mng-filter-active p-select,mng-table-filter .mng-filter-active p-multiselect,mng-table-filter .mng-filter-active .p-autocomplete-input-multiple{background:var(--filter-active-bg)}mng-table-filter .mng-filter-active .mng-filter-icon{color:var(--filter-active-color)}:root[class*=app-dark] mng-table-filter{--filter-active-bg: var(--p-surface-800);--filter-active-color: var(--p-surface-400)}\n"] }]
|
|
932
|
-
}], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: true }] }], showFilterIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFilterIcon", required: false }] }], showTitleAsPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTitleAsPlaceholder", required: false }] }], icon: [{ type: i0.ViewChild, args: ['icon', { isSignal: true }] }] } });
|
|
815
|
+
], providers: [FilterService], encapsulation: ViewEncapsulation.None, template: "<div class=\"flex items-center\">\n @let requiredFilterMissing = config().descriptor.isRequired && !filter.isActive();\n @let placeholder = (placeholderKey() | translate) + (config().descriptor.isRequired ? ' *' : '');\n <div\n class=\"flex items-center [&_p-inputgroup-addon]:p-0!\"\n [class.mng-filter-active]=\"filter.isActive()\"\n [class.[&_*]:border-red-500!]=\"requiredFilterMissing\"\n [class.mng-filter-required]=\"requiredFilterMissing\">\n @switch (config().descriptor.filterType) {\n @case (FilterTypeEnum.Number) {\n @if (filter.state()?.displayMatchMode === FilterMatchMode.Between) {\n <mng-number-range\n vertical=\"true\"\n className=\"mng-filter-number\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onNumericModelChange($event)\"\n (keyDown)=\"onNumericInputKeyDown($event)\"\n [placeholder]=\"placeholder\"\n [useGrouping]=\"config().descriptor.numberUseGrouping\"\n [minFractionDigits]=\"config().numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"config().numberConfig?.fractionsMax\"\n [disabled]=\"isInputDisabled()\"\n [templates]=\"showFilterIcon() ? [numberRangePrependIcon] : []\" />\n } @else {\n <p-inputgroup>\n @if (showFilterIcon()) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </p-inputgroup-addon>\n }\n @if (filter.state()?.displayMatchMode === FilterMatchMode.In || filter.state()?.displayMatchMode === FilterMatchMode.NotIn) {\n <mng-table-filter-input-multi-value\n name=\"value\"\n [className]=\"showFilterIcon() ? 'rounded-tl-none! rounded-bl-none!' : ''\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onNumericMultiModelChange($event)\"\n [filterType]=\"config().descriptor.filterType\"\n [disabled]=\"isInputDisabled()\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-filter-number\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onNumericModelChange($event)\"\n (onKeyDown)=\"onNumericInputKeyDown($event)\"\n [placeholder]=\"placeholder\"\n [useGrouping]=\"config().descriptor.numberUseGrouping\"\n [minFractionDigits]=\"config().numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"config().numberConfig?.fractionsMax\"\n [disabled]=\"isInputDisabled()\" />\n }\n </p-inputgroup>\n }\n }\n\n @case (FilterTypeEnum.Boolean) {\n <mng-dropdown\n optionsLabelProperty=\"label\"\n optionsValueProperty=\"value\"\n [ngModel]=\"filter.state()?.displayValue\"\n [options]=\"booleanOptions\"\n [optionsLabelTranslate]=\"true\"\n [placeholder]=\"placeholder\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"booleanFilter($event)\"\n [templates]=\"showFilterIcon() ? [dropdownPrependIcon] : []\">\n </mng-dropdown>\n }\n @case (FilterTypeEnum.Date) {\n @if (filter.state()?.displayMatchMode === FilterMatchMode.Between) {\n <mng-date-range\n vertical=\"true\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onDateFilterModelChange($event)\"\n [inputStyleClass]=\"showFilterIcon() ? '!rounded-s-none' : ''\"\n [showTime]=\"config().dateConfig?.showTime ?? false\"\n [showSeconds]=\"config().dateConfig?.showSeconds ?? false\"\n [dateFormat]=\"config().dateConfig?.format\"\n [placeholder]=\"placeholder\"\n [disabled]=\"isInputDisabled()\"\n [templates]=\"showFilterIcon() ? [dateRangePrependIcon] : []\" />\n } @else {\n <p-inputgroup>\n @if (showFilterIcon()) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </p-inputgroup-addon>\n }\n <mng-datetime-picker\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onDateFilterModelChange($event)\"\n [inputStyleClass]=\"showFilterIcon() ? '!rounded-s-none' : ''\"\n [placeholder]=\"placeholder\"\n showIcon=\"true\"\n [time]=\"config().dateConfig?.showTime ?? false\"\n [seconds]=\"config().dateConfig?.showSeconds ?? false\"\n [milliseconds]=\"config().dateConfig?.showMilliseconds ?? false\"\n [optimusTimePicker]=\"config().dateConfig?.optimusTimePicker ?? false\"\n [timeSelect]=\"config().dateConfig?.timeSelect ?? true\"\n [timeSelectInterval]=\"config().dateConfig?.timeSelectInterval ?? 60\"\n [dateFormat]=\"config().dateConfig?.format\"\n required=\"true\" />\n </p-inputgroup>\n }\n }\n @case (FilterTypeEnum.Lookup) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\" />\n }\n @case (FilterTypeEnum.LookupEnum) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\" />\n }\n @default {\n <p-inputgroup>\n @if (showFilterIcon()) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </p-inputgroup-addon>\n }\n @if (filter.state()?.displayMatchMode === FilterMatchMode.In || filter.state()?.displayMatchMode === FilterMatchMode.NotIn) {\n <mng-table-filter-input-multi-value\n name=\"value\"\n [className]=\"showFilterIcon() ? 'rounded-tl-none! rounded-bl-none!' : ''\"\n [ngModel]=\"filter.state()?.displayValue\"\n (ngModelChange)=\"onTextMultiModelChange($event)\"\n [filterType]=\"config().descriptor.filterType\"\n [inputTrim]=\"config().descriptor.trimOption\"\n [disabled]=\"isInputDisabled()\" />\n } @else {\n <input\n type=\"text\"\n pInputText\n class=\"mng-filter-string\"\n [value]=\"filter.state()?.displayValue ?? ''\"\n [disabled]=\"isInputDisabled()\"\n (input)=\"onTextModelChange($event)\"\n (keydown.enter)=\"onTextInputEnterKeyDown($event)\"\n [attr.placeholder]=\"placeholder\"\n [mngInputTrim]=\"config().descriptor.trimOption\" />\n }\n </p-inputgroup>\n }\n }\n\n <ng-template #lookupFilter>\n @if (descriptorAsLookup(); as lookup) {\n @switch (lookup.lookupType) {\n @case (lookupTypeAutocomplete) {\n <mng-autocomplete\n [ngModel]=\"filter.state()?.displayValue\"\n [dataProvider]=\"lookup.dataProvider\"\n [optionsTrackProperty]=\"lookup.optionsValueProperty\"\n [optionsValueProperty]=\"lookup.optionsValueProperty\"\n [optionsLabelProperty]=\"lookup.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookup.optionsLabelTranslate\"\n [multiselect]=\"isMultiselect()\"\n [autoClear]=\"lookup.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookup.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookup.inlineSearch ?? false\"\n [allowInput]=\"lookup.allowInput ?? false\"\n [placeholder]=\"placeholder\"\n [className]=\"lookup.className\"\n [dropdownClassName]=\"lookup.dropdownClassName\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"autocompleteFilter($event)\"\n [searchTrim]=\"config().descriptor.trimOption\"\n [templates]=\"showFilterIcon() ? [autocompletePrependIcon] : []\">\n </mng-autocomplete>\n }\n @case (lookupTypeDropdown) {\n <mng-dropdown\n *mngRerender=\"isMultiselect()\"\n [ngModel]=\"filter.state()?.displayValue\"\n [dataProvider]=\"lookup.dataProvider\"\n [optionsValueProperty]=\"lookup.optionsValueProperty\"\n [optionsLabelProperty]=\"lookup.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookup.optionsLabelTranslate\"\n [inlineSearch]=\"lookup.inlineSearch\"\n [allowInput]=\"lookup.allowInput\"\n [multiselect]=\"isMultiselect()\"\n [placeholder]=\"placeholder\"\n [className]=\"lookup.className\"\n [dropdownClassName]=\"lookup.dropdownClassName\"\n [showClear]=\"false\"\n [changeValueOnBlur]=\"isMultiselect()\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"dropdownFilter($event)\"\n [templates]=\"showFilterIcon() ? [dropdownPrependIcon] : []\">\n </mng-dropdown>\n }\n }\n }\n </ng-template>\n\n <ng-template mngAutocompleteTemplate name=\"prepend\" #autocompletePrependIcon=\"mngAutocompleteTemplate\">\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </ng-template>\n <ng-template mngDropdownTemplate name=\"prepend\" #dropdownPrependIcon=\"mngDropdownTemplate\">\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </ng-template>\n <ng-template mngDateRangeTemplate name=\"prepend\" #dateRangePrependIcon=\"mngDateRangeTemplate\">\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </ng-template>\n <ng-template mngNumberRangeTemplate name=\"prepend\" #numberRangePrependIcon=\"mngNumberRangeTemplate\">\n <ng-container *ngTemplateOutlet=\"iconTemplate\"></ng-container>\n </ng-template>\n\n <ng-template #iconTemplate>\n <button\n #icon\n class=\"mng-filter-options mng-filter-icon cursor-pointer pi pi-filter w-full h-full rounded-tl-md rounded-bl-md\"\n (click)=\"toggleMenu($event, icon)\"\n (keydown)=\"onToggleButtonKeyDown($event, icon)\"></button>\n </ng-template>\n\n <p-popover styleClass=\"p-datatable-filter-overlay mng-filter-constraint-list-overlay\" #popover>\n <ul #popoverContent class=\"p-datatable-filter-constraint-list\">\n @for (matchMode of matchModes(); track matchMode; let i = $index) {\n <li\n class=\"p-datatable-filter-constraint\"\n [class.p-datatable-filter-constraint-selected]=\"matchMode.value === filter.state()?.displayMatchMode\"\n (click)=\"onMatchModeChange(matchMode.value)\"\n (keydown)=\"onMatchModeKeyDown($event)\"\n (keydown.enter)=\"this.onMatchModeChange(matchMode.value)\"\n [attr.tabindex]=\"i === 0 ? '0' : null\">\n {{ matchMode.label }}\n </li>\n }\n @if (config().descriptor.filterType === FilterTypeEnum.String) {\n <li class=\"p-datatable-filter-constraint-separator\" (keydown)=\"onMatchModeKeyDown($event)\"></li>\n <li\n class=\"p-datatable-filter-constraint\"\n (click)=\"onCaseSensitivityToggle()\"\n (keydown)=\"onMatchModeKeyDown($event)\"\n (keydown.enter)=\"onCaseSensitivityToggle()\">\n <div class=\"flex items-center\">\n <span class=\"mr-2\"> {{ 'mngFilter.caseSensitive' | translate }} </span>\n <p-toggle-switch [ngModel]=\"filter.state()?.caseSensitive || false\" class=\"ml-auto pointer-events-none\"></p-toggle-switch>\n </div>\n </li>\n }\n <li class=\"p-datatable-filter-constraint-separator\" (keydown)=\"onMatchModeKeyDown($event)\"></li>\n <li\n class=\"p-datatable-filter-constraint\"\n [class.p-disabled]=\"!filter.isActive()\"\n (click)=\"clear()\"\n (keydown)=\"onMatchModeKeyDown($event)\"\n (keydown.enter)=\"clear()\">\n {{ 'optimus.noFilter' | translate }}\n </li>\n </ul>\n </p-popover>\n </div>\n\n @if (!showFilterIcon()) {\n <button\n #icon\n class=\"mng-filter-options cursor-pointer ml-1\"\n [ngClass]=\"{\n 'text-primary': filter.isActive(),\n 'text-slate-400': !filter.isActive()\n }\"\n (click)=\"toggleMenu($event, icon)\"\n (keydown)=\"onToggleButtonKeyDown($event, icon)\">\n <i class=\"pi pi-ellipsis-v\"></i>\n </button>\n }\n</div>\n", styles: ["mng-table-filter{--filter-active-bg: var(--color-primary-50);--filter-active-color: var(--color-primary-600)}mng-table-filter .mng-filter-string{min-width:135px}mng-table-filter .mng-filter-number{min-width:165px}mng-table-filter .mng-filter-date{min-width:170px}mng-table-filter .mng-filter-boolean{min-width:80px}mng-table-filter .mng-filter-lookup,mng-table-filter .mng-filter-lookupenum{min-width:180px}mng-table-filter .mng-filter-required{position:relative}mng-table-filter p-tag.mng-filter-required{border:1px solid var(--color-red-500)}mng-table-filter .mng-filter-required:after{content:\"\";position:absolute;top:0;right:0;width:1rem;height:1rem;background-color:var(--color-red-500);z-index:1;clip-path:polygon(0 0,100% 0,100% 100%,0 0);border-top-right-radius:var(--p-inputgroup-addon-border-radius)}mng-table-filter .mng-filter-icon{color:var(--p-inputgroup-addon-color)}mng-table-filter .mng-filter-icon:hover{background:var(--p-select-filled-hover-background)}mng-table-filter .mng-filter-active *{border-color:var(--filter-active-color)!important}mng-table-filter .mng-filter-active p-inputgroup-addon,mng-table-filter .mng-filter-active input,mng-table-filter .mng-filter-active p-select,mng-table-filter .mng-filter-active p-multiselect,mng-table-filter .mng-filter-active .p-autocomplete-input-multiple{background:var(--filter-active-bg)}mng-table-filter .mng-filter-active .mng-filter-icon{color:var(--filter-active-color)}:root[class*=app-dark] mng-table-filter{--filter-active-bg: var(--p-surface-800);--filter-active-color: var(--p-surface-400)}.mng-filter-constraint-list-overlay>.p-popover-content{padding:0}\n"] }]
|
|
816
|
+
}], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: true }] }], showFilterIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFilterIcon", required: false }] }], showTitleAsPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTitleAsPlaceholder", required: false }] }], icon: [{ type: i0.ViewChild, args: ['icon', { isSignal: true }] }], popover: [{ type: i0.ViewChild, args: ['popover', { isSignal: true }] }], popoverContent: [{ type: i0.ViewChild, args: ['popoverContent', { isSignal: true }] }] } });
|
|
933
817
|
|
|
934
818
|
var filter_component = /*#__PURE__*/Object.freeze({
|
|
935
819
|
__proto__: null,
|
|
@@ -952,16 +836,20 @@ class TableColumnValueComponent {
|
|
|
952
836
|
this.getterPipe = new GetterPipe();
|
|
953
837
|
this.templatePipe = new TemplatePipe();
|
|
954
838
|
this.jsonPathPipe = new JsonPathPipe();
|
|
955
|
-
this.descriptor = input.required(
|
|
956
|
-
|
|
957
|
-
this.
|
|
839
|
+
this.descriptor = input.required(/* @ts-ignore */
|
|
840
|
+
...(ngDevMode ? [{ debugName: "descriptor" }] : /* istanbul ignore next */ []));
|
|
841
|
+
this.item = input.required(/* @ts-ignore */
|
|
842
|
+
...(ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []));
|
|
843
|
+
this.styleMaxWidth = computed(() => this.descriptor().maxWidth ?? null, /* @ts-ignore */
|
|
844
|
+
...(ngDevMode ? [{ debugName: "styleMaxWidth" }] : /* istanbul ignore next */ []));
|
|
958
845
|
this.className = computed(() => {
|
|
959
846
|
let className = 'nowrap';
|
|
960
847
|
if (this.descriptor().columnDisplayType === ColumnDisplayTypeEnum.String && this.descriptor().isMultiline) {
|
|
961
848
|
className += ' multiline';
|
|
962
849
|
}
|
|
963
850
|
return className;
|
|
964
|
-
},
|
|
851
|
+
}, /* @ts-ignore */
|
|
852
|
+
...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
965
853
|
this.value = computed(() => {
|
|
966
854
|
let value = this.jsonPathPipe.transform(this.item(), `$.${this.descriptor().property}`);
|
|
967
855
|
if (typeof this.descriptor().getter === 'function') {
|
|
@@ -971,14 +859,16 @@ class TableColumnValueComponent {
|
|
|
971
859
|
value = this.templatePipe.transform(value, this.descriptor().template);
|
|
972
860
|
}
|
|
973
861
|
return value;
|
|
974
|
-
},
|
|
862
|
+
}, /* @ts-ignore */
|
|
863
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
975
864
|
this.currency = computed(() => {
|
|
976
865
|
if (this.descriptor().columnDisplayType === ColumnDisplayTypeEnum.Currency) {
|
|
977
866
|
return this.descriptor().currencyProperty ? this.item()[this.descriptor().currencyProperty] : (this.descriptor().currencyCode ?? 'EUR');
|
|
978
867
|
}
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
this.hasCopyToClipboard = computed(() => this.descriptor().hasCopyToClipboard && this.value() != null,
|
|
868
|
+
}, /* @ts-ignore */
|
|
869
|
+
...(ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []));
|
|
870
|
+
this.hasCopyToClipboard = computed(() => this.descriptor().hasCopyToClipboard && this.value() != null, /* @ts-ignore */
|
|
871
|
+
...(ngDevMode ? [{ debugName: "hasCopyToClipboard" }] : /* istanbul ignore next */ []));
|
|
982
872
|
this.componentInputs = computed(() => {
|
|
983
873
|
const inputs = {
|
|
984
874
|
value: this.value(),
|
|
@@ -989,7 +879,8 @@ class TableColumnValueComponent {
|
|
|
989
879
|
return { ...inputs, ...this.descriptor().customComponentInputs };
|
|
990
880
|
}
|
|
991
881
|
return inputs;
|
|
992
|
-
},
|
|
882
|
+
}, /* @ts-ignore */
|
|
883
|
+
...(ngDevMode ? [{ debugName: "componentInputs" }] : /* istanbul ignore next */ []));
|
|
993
884
|
this.getCurrencySymbol = getCurrencySymbol;
|
|
994
885
|
}
|
|
995
886
|
copyToClipboard(event) {
|
|
@@ -1004,12 +895,12 @@ class TableColumnValueComponent {
|
|
|
1004
895
|
const message = this.translate.instant('mngTable.copyNotificationMessage', { value });
|
|
1005
896
|
this.messageService.add({ severity: 'info', summary: title, detail: message });
|
|
1006
897
|
}
|
|
1007
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1008
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
898
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableColumnValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
899
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: TableColumnValueComponent, isStandalone: true, selector: "mng-table-column-value", inputs: { descriptor: { classPropertyName: "descriptor", publicName: "descriptor", isSignal: true, isRequired: true, transformFunction: null }, item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class": "className()", "style.max-width.px": "styleMaxWidth()" } }, ngImport: i0, template: "@if (descriptor().localizationExistsProperty && !item()[descriptor().localizationExistsProperty!]) {\n <i class=\"pi pi-exclamation-circle\" [pTooltip]=\"'mngTable.translationMissing' | translate\"></i>\n}\n@switch (descriptor().columnDisplayType) {\n @case (columnDisplayTypeString) {\n @if (descriptor().hasValueAsTooltip) {\n <span [pTooltip]=\"value()\" tooltipPosition=\"left\">{{ value() }}</span>\n } @else {\n {{ value() }}\n }\n }\n @case (columnDisplayTypeHtml) {\n <span [innerHTML]=\"value()\"></span>\n }\n @case (columnDisplayTypeNumber) {\n {{ (descriptor().numberUseGrouping ?? true) ? (value() | number: descriptor().displayFormat : descriptor().locale) : value() }}\n }\n @case (columnDisplayTypeCurrency) {\n @if (descriptor().numberUseGrouping ?? true) {\n {{ value() | currency: currency() : descriptor().currencyDisplay : descriptor().displayFormat : descriptor().locale }}\n } @else {\n @let currencyValue = getCurrencySymbol(currency() ?? '', descriptor().currencyDisplay === 'symbol' ? 'wide' : 'narrow', descriptor().locale);\n {{ value() }} {{ currencyValue }}\n }\n }\n @case (columnDisplayTypeDate) {\n {{ value() | date: descriptor().displayFormat }}\n }\n @case (columnDisplayTypeBoolean) {\n @if (descriptor().booleanAsIcon) {\n <i [class]=\"value() | mngBoolean: descriptor().booleanYes : descriptor().booleanNo : true\"></i>\n } @else {\n {{ value() | mngBoolean: descriptor().booleanYes : descriptor().booleanNo | translate }}\n }\n }\n @case (columnDisplayTypeEnum) {\n {{ value() | mngEnum: descriptor().enum | translate }}\n }\n @case (columnDisplayTypeComponent) {\n <ng-container [mngComponent]=\"descriptor().customComponentType!\" [inputs]=\"componentInputs()\"></ng-container>\n }\n}\n@if (hasCopyToClipboard()) {\n <div class=\"help-buttons\">\n <button pButton type=\"button\" icon=\"pi pi-copy\" severity=\"info\" rounded=\"true\" size=\"small\" (click)=\"copyToClipboard($event)\"></button>\n </div>\n}\n", styles: [":host{display:inline-block;overflow:hidden}:host.nowrap{white-space:nowrap;text-overflow:ellipsis}:host.multiline{white-space:pre-wrap;word-wrap:break-word}.help-buttons{display:none;position:absolute;right:0;top:50%;transform:translateY(-50%)}.help-buttons .p-button{height:1.9rem;width:1.9rem;padding:0}\n"], dependencies: [{ kind: "directive", type: ComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "injectionToken", "inputs", "attachToHost", "parentInjector"], outputs: ["instanceCreated"] }, { kind: "directive", type: ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "directive", type: Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: BooleanPipe, name: "mngBoolean" }, { kind: "pipe", type: EnumPipe, name: "mngEnum" }, { kind: "pipe", type: DecimalPipe, name: "number" }, { kind: "pipe", type: CurrencyPipe, name: "currency" }, { kind: "pipe", type: DatePipe, name: "date" }] }); }
|
|
1009
900
|
}
|
|
1010
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
901
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableColumnValueComponent, decorators: [{
|
|
1011
902
|
type: Component,
|
|
1012
|
-
args: [{ selector: 'mng-table-column-value', imports: [TranslatePipe, BooleanPipe, EnumPipe, ComponentDirective, DecimalPipe, CurrencyPipe, DatePipe, ButtonDirective, Tooltip],
|
|
903
|
+
args: [{ selector: 'mng-table-column-value', imports: [TranslatePipe, BooleanPipe, EnumPipe, ComponentDirective, DecimalPipe, CurrencyPipe, DatePipe, ButtonDirective, Tooltip], host: { '[class]': 'className()', '[style.max-width.px]': 'styleMaxWidth()' }, template: "@if (descriptor().localizationExistsProperty && !item()[descriptor().localizationExistsProperty!]) {\n <i class=\"pi pi-exclamation-circle\" [pTooltip]=\"'mngTable.translationMissing' | translate\"></i>\n}\n@switch (descriptor().columnDisplayType) {\n @case (columnDisplayTypeString) {\n @if (descriptor().hasValueAsTooltip) {\n <span [pTooltip]=\"value()\" tooltipPosition=\"left\">{{ value() }}</span>\n } @else {\n {{ value() }}\n }\n }\n @case (columnDisplayTypeHtml) {\n <span [innerHTML]=\"value()\"></span>\n }\n @case (columnDisplayTypeNumber) {\n {{ (descriptor().numberUseGrouping ?? true) ? (value() | number: descriptor().displayFormat : descriptor().locale) : value() }}\n }\n @case (columnDisplayTypeCurrency) {\n @if (descriptor().numberUseGrouping ?? true) {\n {{ value() | currency: currency() : descriptor().currencyDisplay : descriptor().displayFormat : descriptor().locale }}\n } @else {\n @let currencyValue = getCurrencySymbol(currency() ?? '', descriptor().currencyDisplay === 'symbol' ? 'wide' : 'narrow', descriptor().locale);\n {{ value() }} {{ currencyValue }}\n }\n }\n @case (columnDisplayTypeDate) {\n {{ value() | date: descriptor().displayFormat }}\n }\n @case (columnDisplayTypeBoolean) {\n @if (descriptor().booleanAsIcon) {\n <i [class]=\"value() | mngBoolean: descriptor().booleanYes : descriptor().booleanNo : true\"></i>\n } @else {\n {{ value() | mngBoolean: descriptor().booleanYes : descriptor().booleanNo | translate }}\n }\n }\n @case (columnDisplayTypeEnum) {\n {{ value() | mngEnum: descriptor().enum | translate }}\n }\n @case (columnDisplayTypeComponent) {\n <ng-container [mngComponent]=\"descriptor().customComponentType!\" [inputs]=\"componentInputs()\"></ng-container>\n }\n}\n@if (hasCopyToClipboard()) {\n <div class=\"help-buttons\">\n <button pButton type=\"button\" icon=\"pi pi-copy\" severity=\"info\" rounded=\"true\" size=\"small\" (click)=\"copyToClipboard($event)\"></button>\n </div>\n}\n", styles: [":host{display:inline-block;overflow:hidden}:host.nowrap{white-space:nowrap;text-overflow:ellipsis}:host.multiline{white-space:pre-wrap;word-wrap:break-word}.help-buttons{display:none;position:absolute;right:0;top:50%;transform:translateY(-50%)}.help-buttons .p-button{height:1.9rem;width:1.9rem;padding:0}\n"] }]
|
|
1013
904
|
}], propDecorators: { descriptor: [{ type: i0.Input, args: [{ isSignal: true, alias: "descriptor", required: true }] }], item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }] } });
|
|
1014
905
|
|
|
1015
906
|
class FilterValuePipe {
|
|
@@ -1111,10 +1002,10 @@ class FilterValuePipe {
|
|
|
1111
1002
|
this.subscription?.unsubscribe();
|
|
1112
1003
|
this.subject.complete();
|
|
1113
1004
|
}
|
|
1114
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1115
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
1005
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: FilterValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1006
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: FilterValuePipe, isStandalone: true, name: "mngFilterValue" }); }
|
|
1116
1007
|
}
|
|
1117
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1008
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: FilterValuePipe, decorators: [{
|
|
1118
1009
|
type: Pipe,
|
|
1119
1010
|
args: [{
|
|
1120
1011
|
name: 'mngFilterValue',
|
|
@@ -1126,18 +1017,27 @@ class TableFilterActiveTagComponent {
|
|
|
1126
1017
|
constructor() {
|
|
1127
1018
|
this.translateService = inject(TranslateService);
|
|
1128
1019
|
this.FilterMatchMode = FilterMatchMode;
|
|
1129
|
-
this.model = input.required(
|
|
1130
|
-
|
|
1020
|
+
this.model = input.required(/* @ts-ignore */
|
|
1021
|
+
...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
|
|
1022
|
+
this.filter = input.required(/* @ts-ignore */
|
|
1023
|
+
...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
|
|
1131
1024
|
this.edit = output();
|
|
1132
1025
|
this.remove = output();
|
|
1133
1026
|
this.toggleDisabled = output();
|
|
1134
|
-
this.label = computed(() => this.getPropertyLabelKey(this.filter().config.descriptor),
|
|
1135
|
-
|
|
1136
|
-
this.
|
|
1137
|
-
|
|
1138
|
-
this.
|
|
1139
|
-
|
|
1140
|
-
this.
|
|
1027
|
+
this.label = computed(() => this.getPropertyLabelKey(this.filter().config.descriptor), /* @ts-ignore */
|
|
1028
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1029
|
+
this.matchMode = computed(() => this.filter().displayMatchMode, /* @ts-ignore */
|
|
1030
|
+
...(ngDevMode ? [{ debugName: "matchMode" }] : /* istanbul ignore next */ []));
|
|
1031
|
+
this.matchModeSymbol = computed(() => `mngFilterActiveTag.matchMode.${this.matchMode()}`, /* @ts-ignore */
|
|
1032
|
+
...(ngDevMode ? [{ debugName: "matchModeSymbol" }] : /* istanbul ignore next */ []));
|
|
1033
|
+
this.value = computed(() => this.filter().displayValue, /* @ts-ignore */
|
|
1034
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1035
|
+
this.isActive = computed(() => this.filter()?.matchMode === FilterMatchMode.Exists || this.filter()?.matchMode === FilterMatchMode.DoesNotExist || !isFilterValueBlank(this.value()), /* @ts-ignore */
|
|
1036
|
+
...(ngDevMode ? [{ debugName: "isActive" }] : /* istanbul ignore next */ []));
|
|
1037
|
+
this.menuItems = signal([], /* @ts-ignore */
|
|
1038
|
+
...(ngDevMode ? [{ debugName: "menuItems" }] : /* istanbul ignore next */ []));
|
|
1039
|
+
this.tagMenu = viewChild.required(Menu, /* @ts-ignore */
|
|
1040
|
+
...(ngDevMode ? [{ debugName: "tagMenu" }] : /* istanbul ignore next */ []));
|
|
1141
1041
|
}
|
|
1142
1042
|
onRemove(event) {
|
|
1143
1043
|
event.stopPropagation();
|
|
@@ -1197,12 +1097,12 @@ class TableFilterActiveTagComponent {
|
|
|
1197
1097
|
}
|
|
1198
1098
|
return labelKey;
|
|
1199
1099
|
}
|
|
1200
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1201
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1100
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableFilterActiveTagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1101
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: TableFilterActiveTagComponent, isStandalone: true, selector: "mng-table-filter-active-tag", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { edit: "edit", remove: "remove", toggleDisabled: "toggleDisabled" }, viewQueries: [{ propertyName: "tagMenu", first: true, predicate: Menu, descendants: true, isSignal: true }], ngImport: i0, template: "<p-tag\n [class.opacity-70]=\"filter().disabled\"\n severity=\"secondary\"\n styleClass=\"mr-1 mng-tag-outlined\"\n [class.mng-filter-required]=\"!isActive() && filter().config.descriptor.isRequired\">\n <div class=\"flex relative items-center gap-2 p-1 cursor-pointer\" (click)=\"openTagMenu($event)\">\n <span>{{ label() | translate }}</span>\n @if (matchMode() === FilterMatchMode.Between) {\n <span class=\"font-semibold\">{{ value()?.[0] | mngFilterValue: filter().config.descriptor | async }}</span>\n <span class=\"text-primary\">{{ matchModeSymbol() | translate }}</span>\n <span class=\"font-semibold\">{{ value()?.[1] | mngFilterValue: filter().config.descriptor | async }}</span>\n } @else {\n <span class=\"text-primary\">{{ matchModeSymbol() | translate }}</span>\n <span class=\"font-semibold\">{{ value() | mngFilterValue: filter().config.descriptor | async }}</span>\n @if (filter().caseSensitive) {\n <small class=\"border-solid border rounded px-1 text-primary-400\">Aa</small>\n }\n }\n <p-divider layout=\"vertical\" class=\"!p-0 !mx-[3px]\" />\n\n @if (isActive()) {\n <span class=\"pi pi-times text-xs\" (click)=\"onRemove($event)\"></span>\n }\n\n @if (filter().disabled) {\n <p-divider layout=\"horizontal\" class=\"!absolute left-0 !m-0 border-t opacity-50\"></p-divider>\n }\n </div>\n</p-tag>\n<p-menu [popup]=\"true\" [model]=\"menuItems()\" appendTo=\"body\"></p-menu>\n", styles: ["mng-table-filter-active-tag.p-tag.p-tag-secondary.mng-tag-outlined{background-color:unset;border:1px solid var(--mng-tag-secondary-outlined-border)}\n"], dependencies: [{ kind: "component", type: Tag, selector: "p-tag", inputs: ["styleClass", "severity", "value", "icon", "rounded"] }, { kind: "component", type: Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaLabel", "ariaLabelledBy", "id", "tabindex", "appendTo", "motionOptions"], outputs: ["onShow", "onHide", "onBlur", "onFocus"] }, { kind: "component", type: Divider, selector: "p-divider", inputs: ["styleClass", "layout", "type", "align"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: FilterValuePipe, name: "mngFilterValue" }, { kind: "pipe", type: AsyncPipe, name: "async" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1202
1102
|
}
|
|
1203
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableFilterActiveTagComponent, decorators: [{
|
|
1204
1104
|
type: Component,
|
|
1205
|
-
args: [{ selector: 'mng-table-filter-active-tag', imports: [TranslatePipe, FilterValuePipe, AsyncPipe, Tag, Menu, Divider],
|
|
1105
|
+
args: [{ selector: 'mng-table-filter-active-tag', imports: [TranslatePipe, FilterValuePipe, AsyncPipe, Tag, Menu, Divider], encapsulation: ViewEncapsulation.None, template: "<p-tag\n [class.opacity-70]=\"filter().disabled\"\n severity=\"secondary\"\n styleClass=\"mr-1 mng-tag-outlined\"\n [class.mng-filter-required]=\"!isActive() && filter().config.descriptor.isRequired\">\n <div class=\"flex relative items-center gap-2 p-1 cursor-pointer\" (click)=\"openTagMenu($event)\">\n <span>{{ label() | translate }}</span>\n @if (matchMode() === FilterMatchMode.Between) {\n <span class=\"font-semibold\">{{ value()?.[0] | mngFilterValue: filter().config.descriptor | async }}</span>\n <span class=\"text-primary\">{{ matchModeSymbol() | translate }}</span>\n <span class=\"font-semibold\">{{ value()?.[1] | mngFilterValue: filter().config.descriptor | async }}</span>\n } @else {\n <span class=\"text-primary\">{{ matchModeSymbol() | translate }}</span>\n <span class=\"font-semibold\">{{ value() | mngFilterValue: filter().config.descriptor | async }}</span>\n @if (filter().caseSensitive) {\n <small class=\"border-solid border rounded px-1 text-primary-400\">Aa</small>\n }\n }\n <p-divider layout=\"vertical\" class=\"!p-0 !mx-[3px]\" />\n\n @if (isActive()) {\n <span class=\"pi pi-times text-xs\" (click)=\"onRemove($event)\"></span>\n }\n\n @if (filter().disabled) {\n <p-divider layout=\"horizontal\" class=\"!absolute left-0 !m-0 border-t opacity-50\"></p-divider>\n }\n </div>\n</p-tag>\n<p-menu [popup]=\"true\" [model]=\"menuItems()\" appendTo=\"body\"></p-menu>\n", styles: ["mng-table-filter-active-tag.p-tag.p-tag-secondary.mng-tag-outlined{background-color:unset;border:1px solid var(--mng-tag-secondary-outlined-border)}\n"] }]
|
|
1206
1106
|
}], propDecorators: { model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: true }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: true }] }], edit: [{ type: i0.Output, args: ["edit"] }], remove: [{ type: i0.Output, args: ["remove"] }], toggleDisabled: [{ type: i0.Output, args: ["toggleDisabled"] }], tagMenu: [{ type: i0.ViewChild, args: [i0.forwardRef(() => Menu), { isSignal: true }] }] } });
|
|
1207
1107
|
|
|
1208
1108
|
var filterActiveTag_component = /*#__PURE__*/Object.freeze({
|
|
@@ -1218,15 +1118,23 @@ class TableFilterFormComponent {
|
|
|
1218
1118
|
this.FilterMatchMode = FilterMatchMode;
|
|
1219
1119
|
this.elementRef = inject(ElementRef);
|
|
1220
1120
|
this.translate = inject(TranslateService);
|
|
1221
|
-
this.title = input(
|
|
1222
|
-
|
|
1223
|
-
this.
|
|
1224
|
-
|
|
1225
|
-
this.
|
|
1226
|
-
|
|
1227
|
-
this.
|
|
1228
|
-
|
|
1229
|
-
this.
|
|
1121
|
+
this.title = input(/* @ts-ignore */
|
|
1122
|
+
...(ngDevMode ? [undefined, { debugName: "title" }] : /* istanbul ignore next */ []));
|
|
1123
|
+
this.metadata = input.required(/* @ts-ignore */
|
|
1124
|
+
...(ngDevMode ? [{ debugName: "metadata" }] : /* istanbul ignore next */ []));
|
|
1125
|
+
this.genericDescriptor = input(/* @ts-ignore */
|
|
1126
|
+
...(ngDevMode ? [undefined, { debugName: "genericDescriptor" }] : /* istanbul ignore next */ []));
|
|
1127
|
+
this.model = input.required(/* @ts-ignore */
|
|
1128
|
+
...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
|
|
1129
|
+
this.filter = input(/* @ts-ignore */
|
|
1130
|
+
...(ngDevMode ? [undefined, { debugName: "filter" }] : /* istanbul ignore next */ []));
|
|
1131
|
+
this.overlay = input(/* @ts-ignore */
|
|
1132
|
+
...(ngDevMode ? [undefined, { debugName: "overlay" }] : /* istanbul ignore next */ []));
|
|
1133
|
+
this.disabledProperties = input([], /* @ts-ignore */
|
|
1134
|
+
...(ngDevMode ? [{ debugName: "disabledProperties" }] : /* istanbul ignore next */ []));
|
|
1135
|
+
this.enableCaseSensitive = input(true, /* @ts-ignore */
|
|
1136
|
+
...(ngDevMode ? [{ debugName: "enableCaseSensitive" }] : /* istanbul ignore next */ []));
|
|
1137
|
+
this.propertySearch = input(false, { ...(ngDevMode ? { debugName: "propertySearch" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1230
1138
|
this.apply = output();
|
|
1231
1139
|
this.propertyOptionsWithTranslations = computed(() => {
|
|
1232
1140
|
const disabledProperties = this.disabledProperties();
|
|
@@ -1238,11 +1146,13 @@ class TableFilterFormComponent {
|
|
|
1238
1146
|
disabled: !filter && disabledProperties.includes(d.descriptor.property)
|
|
1239
1147
|
};
|
|
1240
1148
|
}) ?? []);
|
|
1241
|
-
},
|
|
1149
|
+
}, /* @ts-ignore */
|
|
1150
|
+
...(ngDevMode ? [{ debugName: "propertyOptionsWithTranslations" }] : /* istanbul ignore next */ []));
|
|
1242
1151
|
this.selectedFilterMetadata = computed(() => {
|
|
1243
1152
|
const property = this.propertyModel();
|
|
1244
1153
|
return this.metadata().find(d => d.descriptor.property === property);
|
|
1245
|
-
},
|
|
1154
|
+
}, /* @ts-ignore */
|
|
1155
|
+
...(ngDevMode ? [{ debugName: "selectedFilterMetadata" }] : /* istanbul ignore next */ []));
|
|
1246
1156
|
// change value lookup function to include the property name of the generic filter
|
|
1247
1157
|
this.genericValueDataProvider = computed(() => {
|
|
1248
1158
|
const genericValueProvider = this.genericDescriptor()?.valueLookup;
|
|
@@ -1262,8 +1172,9 @@ class TableFilterFormComponent {
|
|
|
1262
1172
|
return lookupFn(params, service, search);
|
|
1263
1173
|
});
|
|
1264
1174
|
}
|
|
1265
|
-
return;
|
|
1266
|
-
},
|
|
1175
|
+
return undefined;
|
|
1176
|
+
}, /* @ts-ignore */
|
|
1177
|
+
...(ngDevMode ? [{ debugName: "genericValueDataProvider" }] : /* istanbul ignore next */ []));
|
|
1267
1178
|
this.selectedDescriptorAsLookup = computed(() => {
|
|
1268
1179
|
const filterDescriptor = this.selectedFilterMetadata()?.descriptor;
|
|
1269
1180
|
return filterDescriptor !== undefined &&
|
|
@@ -1271,18 +1182,28 @@ class TableFilterFormComponent {
|
|
|
1271
1182
|
(filterDescriptor.filterType === FilterTypeEnum.Lookup || filterDescriptor.filterType === FilterTypeEnum.LookupEnum)
|
|
1272
1183
|
? filterDescriptor
|
|
1273
1184
|
: undefined;
|
|
1274
|
-
},
|
|
1275
|
-
|
|
1276
|
-
this.
|
|
1277
|
-
|
|
1185
|
+
}, /* @ts-ignore */
|
|
1186
|
+
...(ngDevMode ? [{ debugName: "selectedDescriptorAsLookup" }] : /* istanbul ignore next */ []));
|
|
1187
|
+
this.isEdit = computed(() => this.filter() != null, /* @ts-ignore */
|
|
1188
|
+
...(ngDevMode ? [{ debugName: "isEdit" }] : /* istanbul ignore next */ []));
|
|
1189
|
+
this.formSubmitted = signal(false, /* @ts-ignore */
|
|
1190
|
+
...(ngDevMode ? [{ debugName: "formSubmitted" }] : /* istanbul ignore next */ []));
|
|
1191
|
+
this.formErrorMessage = signal([], /* @ts-ignore */
|
|
1192
|
+
...(ngDevMode ? [{ debugName: "formErrorMessage" }] : /* istanbul ignore next */ []));
|
|
1278
1193
|
// UI utilities
|
|
1279
|
-
this.filterForm = viewChild.required('filterForm'
|
|
1194
|
+
this.filterForm = viewChild.required('filterForm', /* @ts-ignore */
|
|
1195
|
+
...(ngDevMode ? [{ debugName: "filterForm" }] : /* istanbul ignore next */ []));
|
|
1280
1196
|
// Filter form model and form utilities
|
|
1281
|
-
this.propertyModel = signal(null,
|
|
1282
|
-
|
|
1283
|
-
this.
|
|
1284
|
-
|
|
1285
|
-
this.
|
|
1197
|
+
this.propertyModel = signal(null, /* @ts-ignore */
|
|
1198
|
+
...(ngDevMode ? [{ debugName: "propertyModel" }] : /* istanbul ignore next */ []));
|
|
1199
|
+
this.matchModeModel = signal(null, /* @ts-ignore */
|
|
1200
|
+
...(ngDevMode ? [{ debugName: "matchModeModel" }] : /* istanbul ignore next */ []));
|
|
1201
|
+
this.valueModel = signal(null, /* @ts-ignore */
|
|
1202
|
+
...(ngDevMode ? [{ debugName: "valueModel" }] : /* istanbul ignore next */ []));
|
|
1203
|
+
this.caseSensitiveModel = signal(false, /* @ts-ignore */
|
|
1204
|
+
...(ngDevMode ? [{ debugName: "caseSensitiveModel" }] : /* istanbul ignore next */ []));
|
|
1205
|
+
this.isMultiselect = computed(() => this.matchModeModel() === FilterMatchMode.In || this.matchModeModel() === FilterMatchMode.NotIn, /* @ts-ignore */
|
|
1206
|
+
...(ngDevMode ? [{ debugName: "isMultiselect" }] : /* istanbul ignore next */ []));
|
|
1286
1207
|
this.addFilterShortcutText = isMac() ? '⌘ + /' : 'Ctrl + /';
|
|
1287
1208
|
effectWithDeps([this.filter], ([edit]) => {
|
|
1288
1209
|
if (edit) {
|
|
@@ -1381,10 +1302,10 @@ class TableFilterFormComponent {
|
|
|
1381
1302
|
}
|
|
1382
1303
|
return labelKey;
|
|
1383
1304
|
}
|
|
1384
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1385
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: TableFilterFormComponent, isStandalone: true, selector: "mng-table-filter-form", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, metadata: { classPropertyName: "metadata", publicName: "metadata", isSignal: true, isRequired: true, transformFunction: null }, genericDescriptor: { classPropertyName: "genericDescriptor", publicName: "genericDescriptor", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, overlay: { classPropertyName: "overlay", publicName: "overlay", isSignal: true, isRequired: false, transformFunction: null }, disabledProperties: { classPropertyName: "disabledProperties", publicName: "disabledProperties", isSignal: true, isRequired: false, transformFunction: null }, enableCaseSensitive: { classPropertyName: "enableCaseSensitive", publicName: "enableCaseSensitive", isSignal: true, isRequired: false, transformFunction: null }, propertySearch: { classPropertyName: "propertySearch", publicName: "propertySearch", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { apply: "apply" }, host: { classAttribute: "flex grow" }, viewQueries: [{ propertyName: "filterForm", first: true, predicate: ["filterForm"], descendants: true, isSignal: true }], ngImport: i0, template: "<div>\n <div class=\"flex items-center gap-2\">\n <h5>{{ filter() ? ('mngFilter.titleEdit' | translate) : ('mngFilter.titleAdd' | translate) }}</h5>\n @if (!filter()) {\n <div class=\"text-sm opacity-50 font-normal self-start pt-[2px]\">( {{ addFilterShortcutText }} )</div>\n }\n </div>\n <form #filterForm=\"ngForm\" (ngSubmit)=\"onFormSubmit(filterForm)\" class=\"flex flex-col items-baseline lg:flex-row gap-4\">\n <div class=\"w-full lg:w-auto\">\n <mng-dropdown\n name=\"property\"\n id=\"property\"\n tabindex=\"1\"\n #propertyControl=\"ngModel\"\n [(ngModel)]=\"propertyModel\"\n [options]=\"propertyOptionsWithTranslations()\"\n optionsValueProperty=\"property\"\n optionsDisabledProperty=\"disabled\"\n optionsLabelProperty=\"label\"\n [placeholder]=\"'mngFilter.property' | translate\"\n [optionsLabelTranslate]=\"!propertySearch()\"\n [inlineSearch]=\"propertySearch()\"\n required=\"true\"\n className=\"w-full\"\n [disabled]=\"isEdit()\"\n [appendTo]=\"null\" />\n </div>\n <div class=\"w-full lg:w-auto\">\n <mng-dropdown\n name=\"matchMode\"\n id=\"matchMode\"\n [(ngModel)]=\"matchModeModel\"\n className=\"w-full\"\n [options]=\"selectedFilterMetadata()?.matchModes ?? []\"\n [placeholder]=\"'mngFilter.matchMode' | translate\"\n [disabled]=\"!propertyControl.value\"\n class=\"self-end\"\n required=\"true\"\n [appendTo]=\"null\" />\n </div>\n @if (!(matchModeModel() === FilterMatchMode.Exists || matchModeModel() === FilterMatchMode.DoesNotExist)) {\n <div class=\"w-full lg:w-auto flex flex-col\">\n @switch (selectedFilterMetadata()?.descriptor?.filterType) {\n @case (FilterTypeEnum.Number) {\n @if (matchModeModel() === FilterMatchMode.In || matchModeModel() === FilterMatchMode.NotIn) {\n <mng-table-filter-input-multi-value\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [filterType]=\"selectedFilterMetadata()?.descriptor?.filterType\"\n [disabled]=\"!matchModeModel()\" />\n } @else if (matchModeModel() === FilterMatchMode.Between) {\n <mng-number-range\n className=\"mng-filter-number\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedFilterMetadata()?.descriptor?.numberUseGrouping ?? false\"\n [minFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMax\"\n required=\"true\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-filter-number\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [styleClass]=\"'w-full'\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedFilterMetadata()?.descriptor?.numberUseGrouping\"\n [minFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMax\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\" />\n }\n }\n\n @case (FilterTypeEnum.Boolean) {\n <p-checkbox [(ngModel)]=\"valueModel\" [disabled]=\"!matchModeModel()\" name=\"value\" binary=\"true\" required=\"true\" />\n }\n @case (FilterTypeEnum.Date) {\n @if (matchModeModel() === FilterMatchMode.Between) {\n <mng-date-range\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n vertical=\"true\"\n [showTime]=\"selectedFilterMetadata()?.dateConfig?.showTime\"\n [showSeconds]=\"selectedFilterMetadata()?.dateConfig?.showSeconds\"\n [milliseconds]=\"selectedFilterMetadata()?.dateConfig?.showMilliseconds\"\n [primeTimePicker]=\"selectedFilterMetadata()?.dateConfig?.primeTimePicker\"\n [timeSelect]=\"selectedFilterMetadata()?.dateConfig?.timeSelect\"\n [timeSelectInterval]=\"selectedFilterMetadata()?.dateConfig?.timeSelectInterval\"\n [dateFormat]=\"selectedFilterMetadata()?.dateConfig?.format\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\" />\n } @else {\n <mng-datetime-picker\n name=\"value\"\n className=\"w-full\"\n [(ngModel)]=\"valueModel\"\n [placeholder]=\"'mngFilter.value' | translate\"\n showIcon=\"true\"\n [time]=\"selectedFilterMetadata()?.dateConfig?.showTime\"\n [seconds]=\"selectedFilterMetadata()?.dateConfig?.showSeconds\"\n [milliseconds]=\"selectedFilterMetadata()?.dateConfig?.showMilliseconds\"\n [primeTimePicker]=\"selectedFilterMetadata()?.dateConfig?.primeTimePicker\"\n [timeSelect]=\"selectedFilterMetadata()?.dateConfig?.timeSelect\"\n [timeSelectInterval]=\"selectedFilterMetadata()?.dateConfig?.timeSelectInterval\"\n [dateFormat]=\"selectedFilterMetadata()?.dateConfig?.format\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\" />\n }\n }\n @case (FilterTypeEnum.Lookup) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\"></ng-container>\n }\n @case (FilterTypeEnum.LookupEnum) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\"></ng-container>\n }\n @default {\n @if (selectedFilterMetadata()?.descriptor?.genericValueProvider && genericValueDataProvider()) {\n <div class=\"flex\">\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"genericValueDataProvider()\"\n [className]=\"selectedFilterMetadata()?.descriptor?.className + ' ' + (enableCaseSensitive() ? 'rounded-r-none!' : '')\"\n [dropdownClassName]=\"selectedFilterMetadata()?.descriptor?.dropdownClassName\"\n [placeholder]=\"valueModel() ? undefined : ('mngFilter.value' | translate)\"\n allowInput=\"true\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\" />\n @if (enableCaseSensitive()) {\n <p-toggle-button\n [(ngModel)]=\"caseSensitiveModel\"\n [disabled]=\"!matchModeModel()\"\n name=\"caseSensitive\"\n styleClass=\"mng-button-xs mng-toggle-button-addon-right\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n }\n </div>\n } @else if (matchModeModel() === FilterMatchMode.In || matchModeModel() === FilterMatchMode.NotIn) {\n <mng-table-filter-input-multi-value\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [filterType]=\"selectedFilterMetadata()?.descriptor?.filterType\"\n [enableCaseSensitive]=\"enableCaseSensitive()\"\n [(caseSensitiveModel)]=\"caseSensitiveModel\"\n [inputTrim]=\"selectedFilterMetadata()?.descriptor?.trimOption\"\n [disabled]=\"!matchModeModel()\" />\n } @else {\n <div class=\"flex\">\n <input\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n type=\"text\"\n pInputText\n class=\"mng-filter-string w-full\"\n [class.rounded-r-none!]=\"enableCaseSensitive()\"\n [attr.placeholder]=\"'mngFilter.value' | translate\"\n [mngInputTrim]=\"selectedFilterMetadata()?.descriptor?.trimOption\"\n [disabled]=\"!matchModeModel()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\" />\n @if (enableCaseSensitive()) {\n <p-toggle-button\n [(ngModel)]=\"caseSensitiveModel\"\n [disabled]=\"!matchModeModel()\"\n name=\"caseSensitive\"\n styleClass=\"mng-button-xs mng-toggle-button-addon-right\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n }\n </div>\n }\n }\n }\n <ng-template #lookupFilter>\n @if (selectedDescriptorAsLookup(); as lookupFilterDescriptor) {\n @switch (lookupFilterDescriptor.lookupType) {\n @case (lookupTypeAutocomplete) {\n <mng-autocomplete\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"lookupFilterDescriptor.dataProvider\"\n [optionsTrackProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsValueProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsLabelProperty]=\"lookupFilterDescriptor.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookupFilterDescriptor.optionsLabelTranslate\"\n [multiselect]=\"isMultiselect()\"\n [autoClear]=\"lookupFilterDescriptor.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookupFilterDescriptor.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookupFilterDescriptor.inlineSearch ?? false\"\n [allowInput]=\"lookupFilterDescriptor.allowInput ?? false\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [className]=\"lookupFilterDescriptor.className\"\n [dropdownClassName]=\"lookupFilterDescriptor.dropdownClassName\"\n [searchTrim]=\"selectedFilterMetadata()?.descriptor?.trimOption\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\">\n </mng-autocomplete>\n }\n @case (lookupTypeDropdown) {\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"lookupFilterDescriptor.dataProvider\"\n [optionsValueProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsLabelProperty]=\"lookupFilterDescriptor.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookupFilterDescriptor.optionsLabelTranslate\"\n [inlineSearch]=\"lookupFilterDescriptor.inlineSearch ?? false\"\n [allowInput]=\"lookupFilterDescriptor.allowInput ?? false\"\n [multiselect]=\"isMultiselect()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [className]=\"lookupFilterDescriptor.className + ' w-full'\"\n [dropdownClassName]=\"lookupFilterDescriptor.dropdownClassName\"\n showClear=\"false\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\">\n </mng-dropdown>\n }\n }\n } @else if (selectedFilterMetadata()?.descriptor?.isGenericFilter && genericValueDataProvider()) {\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"genericValueDataProvider()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n showClear=\"false\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\">\n </mng-dropdown>\n }\n </ng-template>\n </div>\n }\n <div class=\"flex justify-end\">\n <button pButton type=\"submit\" class=\"mng-filter-submit-button self-end\">\n {{ (filter() ? 'general.apply' : 'general.add') | translate }}\n </button>\n </div>\n </form>\n @if (formSubmitted() && filterForm.invalid) {\n @for (message of formErrorMessage(); track message) {\n <p-message [severity]=\"message.severity\" [text]=\"message.detail\" [icon]=\"message.icon\" styleClass=\"mt-2\" />\n }\n }\n</div>\n", styles: [".mng-toggle-button-addon-right{border-color:var(--p-select-border-color)!important;border-left:none!important;border-top-left-radius:0!important;border-bottom-left-radius:0!important;min-width:35px}.mng-toggle-button-addon-right .p-togglebutton-content{padding-left:.25rem;padding-right:.25rem}\n"], dependencies: [{ kind: "component", type: DropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "options", "optionsTrackProperty", "optionsLabelProperty", "optionsLabelTranslate", "optionsValueProperty", "optionsDisabledProperty", "multiselect", "placeholder", "showClear", "selectFirstItem", "className", "dropdownClassName", "changeValueOnBlur", "loading", "disabled", "allowInput", "appendTo", "templates", "inlineSearch", "searchTrim"], outputs: ["valueChange", "blur"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: InputTrimDirective, selector: "[mngInputTrim]", inputs: ["mngInputTrim"] }, { kind: "component", type: NumberRangeComponent, selector: "mng-number-range", inputs: ["placeholder", "useGrouping", "minFractionDigits", "maxFractionDigits", "required", "disabled", "vertical", "templates", "className"], outputs: ["keyDown"] }, { kind: "component", type: InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "autocomplete", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "component", type: DateRangeComponent, selector: "mng-date-range", inputs: ["placeholder", "showTime", "showSeconds", "milliseconds", "primeTimePicker", "timeSelect", "timeSelectInterval", "dateFormat", "className", "inputStyleClass", "required", "disabled", "vertical", "templates"] }, { kind: "component", type: AutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "optionsTrackProperty", "optionsValueProperty", "optionsLabelProperty", "optionsLabelTranslate", "inlineSearch", "openOnFocus", "multiselect", "placeholder", "className", "dropdownClassName", "showClear", "autoClear", "selectFirst", "allowInput", "searchTrim", "disabled", "templates"], outputs: ["valueChange", "blur"] }, { kind: "component", type: Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["hostName", "value", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "inputStyle", "styleClass", "inputClass", "indeterminate", "formControl", "checkboxIcon", "readonly", "autofocus", "trueValue", "falseValue", "variant", "size"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "directive", type: InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ToggleButton, selector: "p-toggleButton, p-togglebutton, p-toggle-button", inputs: ["onLabel", "offLabel", "onIcon", "offIcon", "ariaLabel", "ariaLabelledBy", "styleClass", "inputId", "tabindex", "iconPos", "autofocus", "size", "allowEmpty", "fluid"], outputs: ["onChange"] }, { kind: "directive", type: ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "component", type: DatetimePickerComponent, selector: "mng-datetime-picker", inputs: ["templates", "time", "timeSelect", "timeSelectInterval", "seconds", "milliseconds", "primeTimePicker", "dateFormat", "placeholder", "minDate", "maxDate", "disabled", "showIcon", "showButtonBar", "showClear", "className", "panelStyleClass", "inputStyleClass", "dateRange"], outputs: ["blur"] }, { kind: "component", type: TableFilterInputMultiValueComponent, selector: "mng-table-filter-input-multi-value", inputs: ["filterType", "enableCaseSensitive", "caseSensitiveModel", "inputTrim", "disabled", "className"], outputs: ["caseSensitiveModelChange"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1305
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableFilterFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1306
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: TableFilterFormComponent, isStandalone: true, selector: "mng-table-filter-form", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, metadata: { classPropertyName: "metadata", publicName: "metadata", isSignal: true, isRequired: true, transformFunction: null }, genericDescriptor: { classPropertyName: "genericDescriptor", publicName: "genericDescriptor", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, overlay: { classPropertyName: "overlay", publicName: "overlay", isSignal: true, isRequired: false, transformFunction: null }, disabledProperties: { classPropertyName: "disabledProperties", publicName: "disabledProperties", isSignal: true, isRequired: false, transformFunction: null }, enableCaseSensitive: { classPropertyName: "enableCaseSensitive", publicName: "enableCaseSensitive", isSignal: true, isRequired: false, transformFunction: null }, propertySearch: { classPropertyName: "propertySearch", publicName: "propertySearch", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { apply: "apply" }, host: { classAttribute: "flex grow" }, viewQueries: [{ propertyName: "filterForm", first: true, predicate: ["filterForm"], descendants: true, isSignal: true }], ngImport: i0, template: "<div>\n <div class=\"flex items-center gap-2\">\n <h5>{{ filter() ? ('mngFilter.titleEdit' | translate) : ('mngFilter.titleAdd' | translate) }}</h5>\n @if (!filter()) {\n <div class=\"text-sm opacity-50 font-normal self-start pt-[2px]\">( {{ addFilterShortcutText }} )</div>\n }\n </div>\n <form #filterForm=\"ngForm\" (ngSubmit)=\"onFormSubmit(filterForm)\" class=\"flex flex-col items-baseline lg:flex-row gap-4\">\n <div class=\"w-full lg:w-auto\">\n <mng-dropdown\n name=\"property\"\n id=\"property\"\n tabindex=\"1\"\n #propertyControl=\"ngModel\"\n [(ngModel)]=\"propertyModel\"\n [options]=\"propertyOptionsWithTranslations()\"\n optionsValueProperty=\"property\"\n optionsDisabledProperty=\"disabled\"\n optionsLabelProperty=\"label\"\n [placeholder]=\"'mngFilter.property' | translate\"\n [optionsLabelTranslate]=\"!propertySearch()\"\n [inlineSearch]=\"propertySearch()\"\n required=\"true\"\n className=\"w-full\"\n [disabled]=\"isEdit()\"\n [appendTo]=\"null\" />\n </div>\n <div class=\"w-full lg:w-auto\">\n <mng-dropdown\n name=\"matchMode\"\n id=\"matchMode\"\n [(ngModel)]=\"matchModeModel\"\n className=\"w-full\"\n [options]=\"selectedFilterMetadata()?.matchModes ?? []\"\n [placeholder]=\"'mngFilter.matchMode' | translate\"\n [disabled]=\"!propertyControl.value\"\n class=\"self-end\"\n required=\"true\"\n [appendTo]=\"null\" />\n </div>\n @if (!(matchModeModel() === FilterMatchMode.Exists || matchModeModel() === FilterMatchMode.DoesNotExist)) {\n <div class=\"w-full lg:w-auto flex flex-col\">\n @switch (selectedFilterMetadata()?.descriptor?.filterType) {\n @case (FilterTypeEnum.Number) {\n @if (matchModeModel() === FilterMatchMode.In || matchModeModel() === FilterMatchMode.NotIn) {\n <mng-table-filter-input-multi-value\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [filterType]=\"selectedFilterMetadata()?.descriptor?.filterType\"\n [disabled]=\"!matchModeModel()\" />\n } @else if (matchModeModel() === FilterMatchMode.Between) {\n <mng-number-range\n className=\"mng-filter-number\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedFilterMetadata()?.descriptor?.numberUseGrouping ?? false\"\n [minFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMax\"\n required=\"true\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-filter-number\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [styleClass]=\"'w-full'\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedFilterMetadata()?.descriptor?.numberUseGrouping\"\n [minFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMax\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\" />\n }\n }\n\n @case (FilterTypeEnum.Boolean) {\n <p-checkbox [(ngModel)]=\"valueModel\" [disabled]=\"!matchModeModel()\" name=\"value\" binary=\"true\" required=\"true\" />\n }\n @case (FilterTypeEnum.Date) {\n @if (matchModeModel() === FilterMatchMode.Between) {\n <mng-date-range\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n vertical=\"true\"\n [showTime]=\"selectedFilterMetadata()?.dateConfig?.showTime\"\n [showSeconds]=\"selectedFilterMetadata()?.dateConfig?.showSeconds\"\n [milliseconds]=\"selectedFilterMetadata()?.dateConfig?.showMilliseconds\"\n [optimusTimePicker]=\"selectedFilterMetadata()?.dateConfig?.optimusTimePicker\"\n [timeSelect]=\"selectedFilterMetadata()?.dateConfig?.timeSelect\"\n [timeSelectInterval]=\"selectedFilterMetadata()?.dateConfig?.timeSelectInterval\"\n [dateFormat]=\"selectedFilterMetadata()?.dateConfig?.format\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\" />\n } @else {\n <mng-datetime-picker\n name=\"value\"\n className=\"w-full\"\n [(ngModel)]=\"valueModel\"\n [placeholder]=\"'mngFilter.value' | translate\"\n showIcon=\"true\"\n [time]=\"selectedFilterMetadata()?.dateConfig?.showTime\"\n [seconds]=\"selectedFilterMetadata()?.dateConfig?.showSeconds\"\n [milliseconds]=\"selectedFilterMetadata()?.dateConfig?.showMilliseconds\"\n [optimusTimePicker]=\"selectedFilterMetadata()?.dateConfig?.optimusTimePicker\"\n [timeSelect]=\"selectedFilterMetadata()?.dateConfig?.timeSelect\"\n [timeSelectInterval]=\"selectedFilterMetadata()?.dateConfig?.timeSelectInterval\"\n [dateFormat]=\"selectedFilterMetadata()?.dateConfig?.format\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\" />\n }\n }\n @case (FilterTypeEnum.Lookup) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\"></ng-container>\n }\n @case (FilterTypeEnum.LookupEnum) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\"></ng-container>\n }\n @default {\n @if (selectedFilterMetadata()?.descriptor?.genericValueProvider && genericValueDataProvider()) {\n <div class=\"flex\">\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"genericValueDataProvider()\"\n [className]=\"selectedFilterMetadata()?.descriptor?.className + ' ' + (enableCaseSensitive() ? 'rounded-r-none!' : '')\"\n [dropdownClassName]=\"selectedFilterMetadata()?.descriptor?.dropdownClassName\"\n [placeholder]=\"valueModel() ? undefined : ('mngFilter.value' | translate)\"\n allowInput=\"true\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\" />\n @if (enableCaseSensitive()) {\n <p-toggle-button\n [(ngModel)]=\"caseSensitiveModel\"\n [disabled]=\"!matchModeModel()\"\n name=\"caseSensitive\"\n styleClass=\"mng-button-xs mng-toggle-button-addon-right\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n }\n </div>\n } @else if (matchModeModel() === FilterMatchMode.In || matchModeModel() === FilterMatchMode.NotIn) {\n <mng-table-filter-input-multi-value\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [filterType]=\"selectedFilterMetadata()?.descriptor?.filterType\"\n [enableCaseSensitive]=\"enableCaseSensitive()\"\n [(caseSensitiveModel)]=\"caseSensitiveModel\"\n [inputTrim]=\"selectedFilterMetadata()?.descriptor?.trimOption\"\n [disabled]=\"!matchModeModel()\" />\n } @else {\n <div class=\"flex\">\n <input\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n type=\"text\"\n pInputText\n class=\"mng-filter-string w-full\"\n [class.rounded-r-none!]=\"enableCaseSensitive()\"\n [attr.placeholder]=\"'mngFilter.value' | translate\"\n [mngInputTrim]=\"selectedFilterMetadata()?.descriptor?.trimOption\"\n [disabled]=\"!matchModeModel()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\" />\n @if (enableCaseSensitive()) {\n <p-toggle-button\n [(ngModel)]=\"caseSensitiveModel\"\n [disabled]=\"!matchModeModel()\"\n name=\"caseSensitive\"\n styleClass=\"mng-button-xs mng-toggle-button-addon-right\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n }\n </div>\n }\n }\n }\n <ng-template #lookupFilter>\n @if (selectedDescriptorAsLookup(); as lookupFilterDescriptor) {\n @switch (lookupFilterDescriptor.lookupType) {\n @case (lookupTypeAutocomplete) {\n <mng-autocomplete\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"lookupFilterDescriptor.dataProvider\"\n [optionsTrackProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsValueProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsLabelProperty]=\"lookupFilterDescriptor.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookupFilterDescriptor.optionsLabelTranslate\"\n [multiselect]=\"isMultiselect()\"\n [autoClear]=\"lookupFilterDescriptor.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookupFilterDescriptor.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookupFilterDescriptor.inlineSearch ?? false\"\n [allowInput]=\"lookupFilterDescriptor.allowInput ?? false\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [className]=\"lookupFilterDescriptor.className\"\n [dropdownClassName]=\"lookupFilterDescriptor.dropdownClassName\"\n [searchTrim]=\"selectedFilterMetadata()?.descriptor?.trimOption\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\">\n </mng-autocomplete>\n }\n @case (lookupTypeDropdown) {\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"lookupFilterDescriptor.dataProvider\"\n [optionsValueProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsLabelProperty]=\"lookupFilterDescriptor.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookupFilterDescriptor.optionsLabelTranslate\"\n [inlineSearch]=\"lookupFilterDescriptor.inlineSearch ?? false\"\n [allowInput]=\"lookupFilterDescriptor.allowInput ?? false\"\n [multiselect]=\"isMultiselect()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [className]=\"lookupFilterDescriptor.className + ' w-full'\"\n [dropdownClassName]=\"lookupFilterDescriptor.dropdownClassName\"\n showClear=\"false\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\">\n </mng-dropdown>\n }\n }\n } @else if (selectedFilterMetadata()?.descriptor?.isGenericFilter && genericValueDataProvider()) {\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"genericValueDataProvider()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n showClear=\"false\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\">\n </mng-dropdown>\n }\n </ng-template>\n </div>\n }\n <div class=\"flex justify-end\">\n <button pButton type=\"submit\" class=\"mng-filter-submit-button self-end\">\n {{ (filter() ? 'general.apply' : 'general.add') | translate }}\n </button>\n </div>\n </form>\n @if (formSubmitted() && filterForm.invalid) {\n @for (message of formErrorMessage(); track message) {\n <p-message [severity]=\"message.severity\" [text]=\"message.detail\" [icon]=\"message.icon\" styleClass=\"mt-2\" />\n }\n }\n</div>\n", styles: [".mng-toggle-button-addon-right{border-color:var(--p-select-border-color)!important;border-left:none!important;border-top-left-radius:0!important;border-bottom-left-radius:0!important;min-width:35px}.mng-toggle-button-addon-right .p-togglebutton-content{padding-left:.25rem;padding-right:.25rem}\n"], dependencies: [{ kind: "component", type: DropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "options", "optionsTrackProperty", "optionsLabelProperty", "optionsLabelTranslate", "optionsValueProperty", "optionsDisabledProperty", "multiselect", "placeholder", "showClear", "selectFirstItem", "className", "dropdownClassName", "changeValueOnBlur", "loading", "disabled", "allowInput", "appendTo", "templates", "inlineSearch", "searchTrim"], outputs: ["valueChange", "blur"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: InputTrimDirective, selector: "[mngInputTrim]", inputs: ["mngInputTrim"] }, { kind: "component", type: NumberRangeComponent, selector: "mng-number-range", inputs: ["placeholder", "useGrouping", "minFractionDigits", "maxFractionDigits", "required", "disabled", "vertical", "templates", "className"], outputs: ["keyDown"] }, { kind: "component", type: InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "autocomplete", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "component", type: DateRangeComponent, selector: "mng-date-range", inputs: ["placeholder", "showTime", "showSeconds", "milliseconds", "optimusTimePicker", "timeSelect", "timeSelectInterval", "dateFormat", "className", "inputStyleClass", "required", "disabled", "vertical", "templates"] }, { kind: "component", type: AutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "optionsTrackProperty", "optionsValueProperty", "optionsLabelProperty", "optionsLabelTranslate", "inlineSearch", "openOnFocus", "multiselect", "placeholder", "className", "dropdownClassName", "showClear", "autoClear", "selectFirst", "allowInput", "searchTrim", "disabled", "templates"], outputs: ["valueChange", "blur"] }, { kind: "component", type: Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["hostName", "value", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "inputStyle", "styleClass", "inputClass", "indeterminate", "formControl", "checkboxIcon", "readonly", "autofocus", "trueValue", "falseValue", "variant", "size"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "directive", type: InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ToggleButton, selector: "p-toggleButton, p-togglebutton, p-toggle-button", inputs: ["onLabel", "offLabel", "onIcon", "offIcon", "ariaLabel", "ariaLabelledBy", "styleClass", "inputId", "tabindex", "iconPos", "autofocus", "size", "allowEmpty", "fluid"], outputs: ["onChange"] }, { kind: "directive", type: ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "component", type: DatetimePickerComponent, selector: "mng-datetime-picker", inputs: ["templates", "time", "timeSelect", "timeSelectInterval", "seconds", "milliseconds", "optimusTimePicker", "dateFormat", "placeholder", "minDate", "maxDate", "disabled", "showIcon", "showButtonBar", "showClear", "className", "panelStyleClass", "inputStyleClass", "dateRange"], outputs: ["blur"] }, { kind: "component", type: TableFilterInputMultiValueComponent, selector: "mng-table-filter-input-multi-value", inputs: ["filterType", "enableCaseSensitive", "caseSensitiveModel", "inputTrim", "disabled", "className"], outputs: ["caseSensitiveModelChange"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1386
1307
|
}
|
|
1387
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1308
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableFilterFormComponent, decorators: [{
|
|
1388
1309
|
type: Component,
|
|
1389
1310
|
args: [{ selector: 'mng-table-filter-form', imports: [
|
|
1390
1311
|
DropdownComponent,
|
|
@@ -1403,16 +1324,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
1403
1324
|
ButtonDirective,
|
|
1404
1325
|
DatetimePickerComponent,
|
|
1405
1326
|
TableFilterInputMultiValueComponent
|
|
1406
|
-
],
|
|
1327
|
+
], host: {
|
|
1407
1328
|
class: 'flex grow'
|
|
1408
|
-
}, encapsulation: ViewEncapsulation.None, template: "<div>\n <div class=\"flex items-center gap-2\">\n <h5>{{ filter() ? ('mngFilter.titleEdit' | translate) : ('mngFilter.titleAdd' | translate) }}</h5>\n @if (!filter()) {\n <div class=\"text-sm opacity-50 font-normal self-start pt-[2px]\">( {{ addFilterShortcutText }} )</div>\n }\n </div>\n <form #filterForm=\"ngForm\" (ngSubmit)=\"onFormSubmit(filterForm)\" class=\"flex flex-col items-baseline lg:flex-row gap-4\">\n <div class=\"w-full lg:w-auto\">\n <mng-dropdown\n name=\"property\"\n id=\"property\"\n tabindex=\"1\"\n #propertyControl=\"ngModel\"\n [(ngModel)]=\"propertyModel\"\n [options]=\"propertyOptionsWithTranslations()\"\n optionsValueProperty=\"property\"\n optionsDisabledProperty=\"disabled\"\n optionsLabelProperty=\"label\"\n [placeholder]=\"'mngFilter.property' | translate\"\n [optionsLabelTranslate]=\"!propertySearch()\"\n [inlineSearch]=\"propertySearch()\"\n required=\"true\"\n className=\"w-full\"\n [disabled]=\"isEdit()\"\n [appendTo]=\"null\" />\n </div>\n <div class=\"w-full lg:w-auto\">\n <mng-dropdown\n name=\"matchMode\"\n id=\"matchMode\"\n [(ngModel)]=\"matchModeModel\"\n className=\"w-full\"\n [options]=\"selectedFilterMetadata()?.matchModes ?? []\"\n [placeholder]=\"'mngFilter.matchMode' | translate\"\n [disabled]=\"!propertyControl.value\"\n class=\"self-end\"\n required=\"true\"\n [appendTo]=\"null\" />\n </div>\n @if (!(matchModeModel() === FilterMatchMode.Exists || matchModeModel() === FilterMatchMode.DoesNotExist)) {\n <div class=\"w-full lg:w-auto flex flex-col\">\n @switch (selectedFilterMetadata()?.descriptor?.filterType) {\n @case (FilterTypeEnum.Number) {\n @if (matchModeModel() === FilterMatchMode.In || matchModeModel() === FilterMatchMode.NotIn) {\n <mng-table-filter-input-multi-value\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [filterType]=\"selectedFilterMetadata()?.descriptor?.filterType\"\n [disabled]=\"!matchModeModel()\" />\n } @else if (matchModeModel() === FilterMatchMode.Between) {\n <mng-number-range\n className=\"mng-filter-number\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedFilterMetadata()?.descriptor?.numberUseGrouping ?? false\"\n [minFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMax\"\n required=\"true\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-filter-number\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [styleClass]=\"'w-full'\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedFilterMetadata()?.descriptor?.numberUseGrouping\"\n [minFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMax\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\" />\n }\n }\n\n @case (FilterTypeEnum.Boolean) {\n <p-checkbox [(ngModel)]=\"valueModel\" [disabled]=\"!matchModeModel()\" name=\"value\" binary=\"true\" required=\"true\" />\n }\n @case (FilterTypeEnum.Date) {\n @if (matchModeModel() === FilterMatchMode.Between) {\n <mng-date-range\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n vertical=\"true\"\n [showTime]=\"selectedFilterMetadata()?.dateConfig?.showTime\"\n [showSeconds]=\"selectedFilterMetadata()?.dateConfig?.showSeconds\"\n [milliseconds]=\"selectedFilterMetadata()?.dateConfig?.showMilliseconds\"\n [primeTimePicker]=\"selectedFilterMetadata()?.dateConfig?.primeTimePicker\"\n [timeSelect]=\"selectedFilterMetadata()?.dateConfig?.timeSelect\"\n [timeSelectInterval]=\"selectedFilterMetadata()?.dateConfig?.timeSelectInterval\"\n [dateFormat]=\"selectedFilterMetadata()?.dateConfig?.format\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\" />\n } @else {\n <mng-datetime-picker\n name=\"value\"\n className=\"w-full\"\n [(ngModel)]=\"valueModel\"\n [placeholder]=\"'mngFilter.value' | translate\"\n showIcon=\"true\"\n [time]=\"selectedFilterMetadata()?.dateConfig?.showTime\"\n [seconds]=\"selectedFilterMetadata()?.dateConfig?.showSeconds\"\n [milliseconds]=\"selectedFilterMetadata()?.dateConfig?.showMilliseconds\"\n [primeTimePicker]=\"selectedFilterMetadata()?.dateConfig?.primeTimePicker\"\n [timeSelect]=\"selectedFilterMetadata()?.dateConfig?.timeSelect\"\n [timeSelectInterval]=\"selectedFilterMetadata()?.dateConfig?.timeSelectInterval\"\n [dateFormat]=\"selectedFilterMetadata()?.dateConfig?.format\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\" />\n }\n }\n @case (FilterTypeEnum.Lookup) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\"></ng-container>\n }\n @case (FilterTypeEnum.LookupEnum) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\"></ng-container>\n }\n @default {\n @if (selectedFilterMetadata()?.descriptor?.genericValueProvider && genericValueDataProvider()) {\n <div class=\"flex\">\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"genericValueDataProvider()\"\n [className]=\"selectedFilterMetadata()?.descriptor?.className + ' ' + (enableCaseSensitive() ? 'rounded-r-none!' : '')\"\n [dropdownClassName]=\"selectedFilterMetadata()?.descriptor?.dropdownClassName\"\n [placeholder]=\"valueModel() ? undefined : ('mngFilter.value' | translate)\"\n allowInput=\"true\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\" />\n @if (enableCaseSensitive()) {\n <p-toggle-button\n [(ngModel)]=\"caseSensitiveModel\"\n [disabled]=\"!matchModeModel()\"\n name=\"caseSensitive\"\n styleClass=\"mng-button-xs mng-toggle-button-addon-right\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n }\n </div>\n } @else if (matchModeModel() === FilterMatchMode.In || matchModeModel() === FilterMatchMode.NotIn) {\n <mng-table-filter-input-multi-value\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [filterType]=\"selectedFilterMetadata()?.descriptor?.filterType\"\n [enableCaseSensitive]=\"enableCaseSensitive()\"\n [(caseSensitiveModel)]=\"caseSensitiveModel\"\n [inputTrim]=\"selectedFilterMetadata()?.descriptor?.trimOption\"\n [disabled]=\"!matchModeModel()\" />\n } @else {\n <div class=\"flex\">\n <input\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n type=\"text\"\n pInputText\n class=\"mng-filter-string w-full\"\n [class.rounded-r-none!]=\"enableCaseSensitive()\"\n [attr.placeholder]=\"'mngFilter.value' | translate\"\n [mngInputTrim]=\"selectedFilterMetadata()?.descriptor?.trimOption\"\n [disabled]=\"!matchModeModel()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\" />\n @if (enableCaseSensitive()) {\n <p-toggle-button\n [(ngModel)]=\"caseSensitiveModel\"\n [disabled]=\"!matchModeModel()\"\n name=\"caseSensitive\"\n styleClass=\"mng-button-xs mng-toggle-button-addon-right\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n }\n </div>\n }\n }\n }\n <ng-template #lookupFilter>\n @if (selectedDescriptorAsLookup(); as lookupFilterDescriptor) {\n @switch (lookupFilterDescriptor.lookupType) {\n @case (lookupTypeAutocomplete) {\n <mng-autocomplete\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"lookupFilterDescriptor.dataProvider\"\n [optionsTrackProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsValueProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsLabelProperty]=\"lookupFilterDescriptor.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookupFilterDescriptor.optionsLabelTranslate\"\n [multiselect]=\"isMultiselect()\"\n [autoClear]=\"lookupFilterDescriptor.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookupFilterDescriptor.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookupFilterDescriptor.inlineSearch ?? false\"\n [allowInput]=\"lookupFilterDescriptor.allowInput ?? false\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [className]=\"lookupFilterDescriptor.className\"\n [dropdownClassName]=\"lookupFilterDescriptor.dropdownClassName\"\n [searchTrim]=\"selectedFilterMetadata()?.descriptor?.trimOption\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\">\n </mng-autocomplete>\n }\n @case (lookupTypeDropdown) {\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"lookupFilterDescriptor.dataProvider\"\n [optionsValueProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsLabelProperty]=\"lookupFilterDescriptor.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookupFilterDescriptor.optionsLabelTranslate\"\n [inlineSearch]=\"lookupFilterDescriptor.inlineSearch ?? false\"\n [allowInput]=\"lookupFilterDescriptor.allowInput ?? false\"\n [multiselect]=\"isMultiselect()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [className]=\"lookupFilterDescriptor.className + ' w-full'\"\n [dropdownClassName]=\"lookupFilterDescriptor.dropdownClassName\"\n showClear=\"false\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\">\n </mng-dropdown>\n }\n }\n } @else if (selectedFilterMetadata()?.descriptor?.isGenericFilter && genericValueDataProvider()) {\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"genericValueDataProvider()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n showClear=\"false\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\">\n </mng-dropdown>\n }\n </ng-template>\n </div>\n }\n <div class=\"flex justify-end\">\n <button pButton type=\"submit\" class=\"mng-filter-submit-button self-end\">\n {{ (filter() ? 'general.apply' : 'general.add') | translate }}\n </button>\n </div>\n </form>\n @if (formSubmitted() && filterForm.invalid) {\n @for (message of formErrorMessage(); track message) {\n <p-message [severity]=\"message.severity\" [text]=\"message.detail\" [icon]=\"message.icon\" styleClass=\"mt-2\" />\n }\n }\n</div>\n", styles: [".mng-toggle-button-addon-right{border-color:var(--p-select-border-color)!important;border-left:none!important;border-top-left-radius:0!important;border-bottom-left-radius:0!important;min-width:35px}.mng-toggle-button-addon-right .p-togglebutton-content{padding-left:.25rem;padding-right:.25rem}\n"] }]
|
|
1329
|
+
}, encapsulation: ViewEncapsulation.None, template: "<div>\n <div class=\"flex items-center gap-2\">\n <h5>{{ filter() ? ('mngFilter.titleEdit' | translate) : ('mngFilter.titleAdd' | translate) }}</h5>\n @if (!filter()) {\n <div class=\"text-sm opacity-50 font-normal self-start pt-[2px]\">( {{ addFilterShortcutText }} )</div>\n }\n </div>\n <form #filterForm=\"ngForm\" (ngSubmit)=\"onFormSubmit(filterForm)\" class=\"flex flex-col items-baseline lg:flex-row gap-4\">\n <div class=\"w-full lg:w-auto\">\n <mng-dropdown\n name=\"property\"\n id=\"property\"\n tabindex=\"1\"\n #propertyControl=\"ngModel\"\n [(ngModel)]=\"propertyModel\"\n [options]=\"propertyOptionsWithTranslations()\"\n optionsValueProperty=\"property\"\n optionsDisabledProperty=\"disabled\"\n optionsLabelProperty=\"label\"\n [placeholder]=\"'mngFilter.property' | translate\"\n [optionsLabelTranslate]=\"!propertySearch()\"\n [inlineSearch]=\"propertySearch()\"\n required=\"true\"\n className=\"w-full\"\n [disabled]=\"isEdit()\"\n [appendTo]=\"null\" />\n </div>\n <div class=\"w-full lg:w-auto\">\n <mng-dropdown\n name=\"matchMode\"\n id=\"matchMode\"\n [(ngModel)]=\"matchModeModel\"\n className=\"w-full\"\n [options]=\"selectedFilterMetadata()?.matchModes ?? []\"\n [placeholder]=\"'mngFilter.matchMode' | translate\"\n [disabled]=\"!propertyControl.value\"\n class=\"self-end\"\n required=\"true\"\n [appendTo]=\"null\" />\n </div>\n @if (!(matchModeModel() === FilterMatchMode.Exists || matchModeModel() === FilterMatchMode.DoesNotExist)) {\n <div class=\"w-full lg:w-auto flex flex-col\">\n @switch (selectedFilterMetadata()?.descriptor?.filterType) {\n @case (FilterTypeEnum.Number) {\n @if (matchModeModel() === FilterMatchMode.In || matchModeModel() === FilterMatchMode.NotIn) {\n <mng-table-filter-input-multi-value\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [filterType]=\"selectedFilterMetadata()?.descriptor?.filterType\"\n [disabled]=\"!matchModeModel()\" />\n } @else if (matchModeModel() === FilterMatchMode.Between) {\n <mng-number-range\n className=\"mng-filter-number\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedFilterMetadata()?.descriptor?.numberUseGrouping ?? false\"\n [minFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMax\"\n required=\"true\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-filter-number\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [styleClass]=\"'w-full'\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedFilterMetadata()?.descriptor?.numberUseGrouping\"\n [minFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMax\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\" />\n }\n }\n\n @case (FilterTypeEnum.Boolean) {\n <p-checkbox [(ngModel)]=\"valueModel\" [disabled]=\"!matchModeModel()\" name=\"value\" binary=\"true\" required=\"true\" />\n }\n @case (FilterTypeEnum.Date) {\n @if (matchModeModel() === FilterMatchMode.Between) {\n <mng-date-range\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n vertical=\"true\"\n [showTime]=\"selectedFilterMetadata()?.dateConfig?.showTime\"\n [showSeconds]=\"selectedFilterMetadata()?.dateConfig?.showSeconds\"\n [milliseconds]=\"selectedFilterMetadata()?.dateConfig?.showMilliseconds\"\n [optimusTimePicker]=\"selectedFilterMetadata()?.dateConfig?.optimusTimePicker\"\n [timeSelect]=\"selectedFilterMetadata()?.dateConfig?.timeSelect\"\n [timeSelectInterval]=\"selectedFilterMetadata()?.dateConfig?.timeSelectInterval\"\n [dateFormat]=\"selectedFilterMetadata()?.dateConfig?.format\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\" />\n } @else {\n <mng-datetime-picker\n name=\"value\"\n className=\"w-full\"\n [(ngModel)]=\"valueModel\"\n [placeholder]=\"'mngFilter.value' | translate\"\n showIcon=\"true\"\n [time]=\"selectedFilterMetadata()?.dateConfig?.showTime\"\n [seconds]=\"selectedFilterMetadata()?.dateConfig?.showSeconds\"\n [milliseconds]=\"selectedFilterMetadata()?.dateConfig?.showMilliseconds\"\n [optimusTimePicker]=\"selectedFilterMetadata()?.dateConfig?.optimusTimePicker\"\n [timeSelect]=\"selectedFilterMetadata()?.dateConfig?.timeSelect\"\n [timeSelectInterval]=\"selectedFilterMetadata()?.dateConfig?.timeSelectInterval\"\n [dateFormat]=\"selectedFilterMetadata()?.dateConfig?.format\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\" />\n }\n }\n @case (FilterTypeEnum.Lookup) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\"></ng-container>\n }\n @case (FilterTypeEnum.LookupEnum) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\"></ng-container>\n }\n @default {\n @if (selectedFilterMetadata()?.descriptor?.genericValueProvider && genericValueDataProvider()) {\n <div class=\"flex\">\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"genericValueDataProvider()\"\n [className]=\"selectedFilterMetadata()?.descriptor?.className + ' ' + (enableCaseSensitive() ? 'rounded-r-none!' : '')\"\n [dropdownClassName]=\"selectedFilterMetadata()?.descriptor?.dropdownClassName\"\n [placeholder]=\"valueModel() ? undefined : ('mngFilter.value' | translate)\"\n allowInput=\"true\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\" />\n @if (enableCaseSensitive()) {\n <p-toggle-button\n [(ngModel)]=\"caseSensitiveModel\"\n [disabled]=\"!matchModeModel()\"\n name=\"caseSensitive\"\n styleClass=\"mng-button-xs mng-toggle-button-addon-right\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n }\n </div>\n } @else if (matchModeModel() === FilterMatchMode.In || matchModeModel() === FilterMatchMode.NotIn) {\n <mng-table-filter-input-multi-value\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [filterType]=\"selectedFilterMetadata()?.descriptor?.filterType\"\n [enableCaseSensitive]=\"enableCaseSensitive()\"\n [(caseSensitiveModel)]=\"caseSensitiveModel\"\n [inputTrim]=\"selectedFilterMetadata()?.descriptor?.trimOption\"\n [disabled]=\"!matchModeModel()\" />\n } @else {\n <div class=\"flex\">\n <input\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n type=\"text\"\n pInputText\n class=\"mng-filter-string w-full\"\n [class.rounded-r-none!]=\"enableCaseSensitive()\"\n [attr.placeholder]=\"'mngFilter.value' | translate\"\n [mngInputTrim]=\"selectedFilterMetadata()?.descriptor?.trimOption\"\n [disabled]=\"!matchModeModel()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\" />\n @if (enableCaseSensitive()) {\n <p-toggle-button\n [(ngModel)]=\"caseSensitiveModel\"\n [disabled]=\"!matchModeModel()\"\n name=\"caseSensitive\"\n styleClass=\"mng-button-xs mng-toggle-button-addon-right\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n }\n </div>\n }\n }\n }\n <ng-template #lookupFilter>\n @if (selectedDescriptorAsLookup(); as lookupFilterDescriptor) {\n @switch (lookupFilterDescriptor.lookupType) {\n @case (lookupTypeAutocomplete) {\n <mng-autocomplete\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"lookupFilterDescriptor.dataProvider\"\n [optionsTrackProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsValueProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsLabelProperty]=\"lookupFilterDescriptor.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookupFilterDescriptor.optionsLabelTranslate\"\n [multiselect]=\"isMultiselect()\"\n [autoClear]=\"lookupFilterDescriptor.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookupFilterDescriptor.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookupFilterDescriptor.inlineSearch ?? false\"\n [allowInput]=\"lookupFilterDescriptor.allowInput ?? false\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [className]=\"lookupFilterDescriptor.className\"\n [dropdownClassName]=\"lookupFilterDescriptor.dropdownClassName\"\n [searchTrim]=\"selectedFilterMetadata()?.descriptor?.trimOption\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\">\n </mng-autocomplete>\n }\n @case (lookupTypeDropdown) {\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"lookupFilterDescriptor.dataProvider\"\n [optionsValueProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsLabelProperty]=\"lookupFilterDescriptor.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookupFilterDescriptor.optionsLabelTranslate\"\n [inlineSearch]=\"lookupFilterDescriptor.inlineSearch ?? false\"\n [allowInput]=\"lookupFilterDescriptor.allowInput ?? false\"\n [multiselect]=\"isMultiselect()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [className]=\"lookupFilterDescriptor.className + ' w-full'\"\n [dropdownClassName]=\"lookupFilterDescriptor.dropdownClassName\"\n showClear=\"false\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\">\n </mng-dropdown>\n }\n }\n } @else if (selectedFilterMetadata()?.descriptor?.isGenericFilter && genericValueDataProvider()) {\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"genericValueDataProvider()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n showClear=\"false\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\">\n </mng-dropdown>\n }\n </ng-template>\n </div>\n }\n <div class=\"flex justify-end\">\n <button pButton type=\"submit\" class=\"mng-filter-submit-button self-end\">\n {{ (filter() ? 'general.apply' : 'general.add') | translate }}\n </button>\n </div>\n </form>\n @if (formSubmitted() && filterForm.invalid) {\n @for (message of formErrorMessage(); track message) {\n <p-message [severity]=\"message.severity\" [text]=\"message.detail\" [icon]=\"message.icon\" styleClass=\"mt-2\" />\n }\n }\n</div>\n", styles: [".mng-toggle-button-addon-right{border-color:var(--p-select-border-color)!important;border-left:none!important;border-top-left-radius:0!important;border-bottom-left-radius:0!important;min-width:35px}.mng-toggle-button-addon-right .p-togglebutton-content{padding-left:.25rem;padding-right:.25rem}\n"] }]
|
|
1409
1330
|
}], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], metadata: [{ type: i0.Input, args: [{ isSignal: true, alias: "metadata", required: true }] }], genericDescriptor: [{ type: i0.Input, args: [{ isSignal: true, alias: "genericDescriptor", required: false }] }], model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: true }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], overlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlay", required: false }] }], disabledProperties: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledProperties", required: false }] }], enableCaseSensitive: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableCaseSensitive", required: false }] }], propertySearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertySearch", required: false }] }], apply: [{ type: i0.Output, args: ["apply"] }], filterForm: [{ type: i0.ViewChild, args: ['filterForm', { isSignal: true }] }] } });
|
|
1410
1331
|
|
|
1411
1332
|
class ADataListMetaService {
|
|
1412
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1413
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1333
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ADataListMetaService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1334
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ADataListMetaService }); }
|
|
1414
1335
|
}
|
|
1415
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1336
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ADataListMetaService, decorators: [{
|
|
1416
1337
|
type: Injectable
|
|
1417
1338
|
}] });
|
|
1418
1339
|
|
|
@@ -1421,12 +1342,13 @@ const COMMONS_TABLE_FEATURE_CONFIG_IT = new InjectionToken('COMMONS_TABLE_FEATUR
|
|
|
1421
1342
|
class TableHeaderWithFiltersTemplateDirective extends TemplateDirective {
|
|
1422
1343
|
constructor() {
|
|
1423
1344
|
super(...arguments);
|
|
1424
|
-
this.name = input.required(
|
|
1345
|
+
this.name = input.required(/* @ts-ignore */
|
|
1346
|
+
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
1425
1347
|
}
|
|
1426
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1427
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
1348
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableHeaderWithFiltersTemplateDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1349
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: TableHeaderWithFiltersTemplateDirective, isStandalone: true, selector: "[mngTableHeaderWithFiltersTemplate]", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
|
|
1428
1350
|
}
|
|
1429
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1351
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableHeaderWithFiltersTemplateDirective, decorators: [{
|
|
1430
1352
|
type: Directive,
|
|
1431
1353
|
args: [{
|
|
1432
1354
|
selector: '[mngTableHeaderWithFiltersTemplate]'
|
|
@@ -1440,27 +1362,42 @@ class TableHeaderWithFiltersComponent {
|
|
|
1440
1362
|
this.tableData = inject((ADataListService));
|
|
1441
1363
|
this.tableMetadata = inject(ADataListMetaService);
|
|
1442
1364
|
this.tableConfig = inject(COMMONS_TABLE_FEATURE_CONFIG_IT, { optional: true });
|
|
1443
|
-
this.metadata = input.required(
|
|
1444
|
-
|
|
1445
|
-
this.
|
|
1446
|
-
|
|
1447
|
-
this.
|
|
1448
|
-
|
|
1449
|
-
this.
|
|
1450
|
-
this.
|
|
1451
|
-
|
|
1452
|
-
this.
|
|
1453
|
-
|
|
1454
|
-
this.
|
|
1455
|
-
this.
|
|
1365
|
+
this.metadata = input.required(/* @ts-ignore */
|
|
1366
|
+
...(ngDevMode ? [{ debugName: "metadata" }] : /* istanbul ignore next */ []));
|
|
1367
|
+
this.genericFilterDescriptor = input(/* @ts-ignore */
|
|
1368
|
+
...(ngDevMode ? [undefined, { debugName: "genericFilterDescriptor" }] : /* istanbul ignore next */ []));
|
|
1369
|
+
this.model = input.required(/* @ts-ignore */
|
|
1370
|
+
...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
|
|
1371
|
+
this.enableSearch = input(false, { ...(ngDevMode ? { debugName: "enableSearch" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1372
|
+
this.search = input(/* @ts-ignore */
|
|
1373
|
+
...(ngDevMode ? [undefined, { debugName: "search" }] : /* istanbul ignore next */ []));
|
|
1374
|
+
this.searchLimitWordMax = input(undefined, /* @ts-ignore */
|
|
1375
|
+
...(ngDevMode ? [{ debugName: "searchLimitWordMax" }] : /* istanbul ignore next */ []));
|
|
1376
|
+
this.enableCaseSensitive = input(true, { ...(ngDevMode ? { debugName: "enableCaseSensitive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1377
|
+
this.filterMenuItems = signal([], /* @ts-ignore */
|
|
1378
|
+
...(ngDevMode ? [{ debugName: "filterMenuItems" }] : /* istanbul ignore next */ []));
|
|
1379
|
+
this.filterOverlay = viewChild.required(Popover, /* @ts-ignore */
|
|
1380
|
+
...(ngDevMode ? [{ debugName: "filterOverlay" }] : /* istanbul ignore next */ []));
|
|
1381
|
+
this.filterFormComponent = viewChild(TableFilterFormComponent, /* @ts-ignore */
|
|
1382
|
+
...(ngDevMode ? [{ debugName: "filterFormComponent" }] : /* istanbul ignore next */ []));
|
|
1383
|
+
this.templates = contentChildren(TableHeaderWithFiltersTemplateDirective, /* @ts-ignore */
|
|
1384
|
+
...(ngDevMode ? [{ debugName: "templates" }] : /* istanbul ignore next */ []));
|
|
1385
|
+
this.titleTemplate = computed(() => findTemplateByName([...this.templates()], 'title'), /* @ts-ignore */
|
|
1386
|
+
...(ngDevMode ? [{ debugName: "titleTemplate" }] : /* istanbul ignore next */ []));
|
|
1387
|
+
this.titleRowRightTemplate = computed(() => findTemplateByName([...this.templates()], 'titleRowRight'), /* @ts-ignore */
|
|
1388
|
+
...(ngDevMode ? [{ debugName: "titleRowRightTemplate" }] : /* istanbul ignore next */ []));
|
|
1456
1389
|
this.overlayFormMetadata = computed(() => this.metadata().filter(f => (f.descriptor.displayType == null && FilterDisplayTypeEnum.OverlayWithTag === this.tableMetadata.defaultFilterDisplayType()) ||
|
|
1457
|
-
f.descriptor.displayType === FilterDisplayTypeEnum.OverlayWithTag),
|
|
1390
|
+
f.descriptor.displayType === FilterDisplayTypeEnum.OverlayWithTag), /* @ts-ignore */
|
|
1391
|
+
...(ngDevMode ? [{ debugName: "overlayFormMetadata" }] : /* istanbul ignore next */ []));
|
|
1458
1392
|
this.directInputMetadata = computed(() => this.metadata().filter(f => (f.descriptor.displayType == null && FilterDisplayTypeEnum.DirectInput === this.tableMetadata.defaultFilterDisplayType()) ||
|
|
1459
|
-
f.descriptor.displayType === FilterDisplayTypeEnum.DirectInput),
|
|
1393
|
+
f.descriptor.displayType === FilterDisplayTypeEnum.DirectInput), /* @ts-ignore */
|
|
1394
|
+
...(ngDevMode ? [{ debugName: "directInputMetadata" }] : /* istanbul ignore next */ []));
|
|
1460
1395
|
this.overlayFormFilters = computed(() => {
|
|
1461
1396
|
return this.getInitialFilters(this.tableData.filterStates(), this.overlayFormMetadata());
|
|
1462
|
-
},
|
|
1463
|
-
|
|
1397
|
+
}, /* @ts-ignore */
|
|
1398
|
+
...(ngDevMode ? [{ debugName: "overlayFormFilters" }] : /* istanbul ignore next */ []));
|
|
1399
|
+
this.showOverlayFilterFormButton = computed(() => this.overlayFormMetadata().length > 0, /* @ts-ignore */
|
|
1400
|
+
...(ngDevMode ? [{ debugName: "showOverlayFilterFormButton" }] : /* istanbul ignore next */ []));
|
|
1464
1401
|
this.activeFilters = computed(() => {
|
|
1465
1402
|
const filterEntry = this.overlayFormFilters();
|
|
1466
1403
|
return this.overlayFormMetadata()
|
|
@@ -1474,9 +1411,12 @@ class TableHeaderWithFiltersComponent {
|
|
|
1474
1411
|
(filter.value !== undefined && filter.displayValue !== undefined)));
|
|
1475
1412
|
})
|
|
1476
1413
|
.map(d => filterEntry[d.descriptor.property]);
|
|
1477
|
-
},
|
|
1478
|
-
|
|
1479
|
-
this.
|
|
1414
|
+
}, /* @ts-ignore */
|
|
1415
|
+
...(ngDevMode ? [{ debugName: "activeFilters" }] : /* istanbul ignore next */ []));
|
|
1416
|
+
this.activeFilterProperties = computed(() => this.activeFilters().map(f => f.config.descriptor.property), /* @ts-ignore */
|
|
1417
|
+
...(ngDevMode ? [{ debugName: "activeFilterProperties" }] : /* istanbul ignore next */ []));
|
|
1418
|
+
this.filterEdit = signal(undefined, /* @ts-ignore */
|
|
1419
|
+
...(ngDevMode ? [{ debugName: "filterEdit" }] : /* istanbul ignore next */ []));
|
|
1480
1420
|
this.unsetRequiredFilters = computed(() => {
|
|
1481
1421
|
const activeFilters = this.activeFilters().map(el => el.config.descriptor.property);
|
|
1482
1422
|
return this.overlayFormMetadata()
|
|
@@ -1488,28 +1428,37 @@ class TableHeaderWithFiltersComponent {
|
|
|
1488
1428
|
config: el
|
|
1489
1429
|
};
|
|
1490
1430
|
});
|
|
1491
|
-
},
|
|
1492
|
-
|
|
1431
|
+
}, /* @ts-ignore */
|
|
1432
|
+
...(ngDevMode ? [{ debugName: "unsetRequiredFilters" }] : /* istanbul ignore next */ []));
|
|
1433
|
+
this.allActiveFiltersDisabled = computed(() => this.activeFilters().filter(f => f.disabled).length === this.activeFilters().length, /* @ts-ignore */
|
|
1434
|
+
...(ngDevMode ? [{ debugName: "allActiveFiltersDisabled" }] : /* istanbul ignore next */ []));
|
|
1493
1435
|
this.addFilterShortcutText = isMac() ? '⌘ + /' : 'Ctrl + /';
|
|
1494
1436
|
// global search model
|
|
1495
|
-
this.searchValue = computed(() => this.search()?.value,
|
|
1496
|
-
|
|
1497
|
-
this.
|
|
1437
|
+
this.searchValue = computed(() => this.search()?.value, /* @ts-ignore */
|
|
1438
|
+
...(ngDevMode ? [{ debugName: "searchValue" }] : /* istanbul ignore next */ []));
|
|
1439
|
+
this.searchCaseSensitive = computed(() => this.search()?.caseSensitive, /* @ts-ignore */
|
|
1440
|
+
...(ngDevMode ? [{ debugName: "searchCaseSensitive" }] : /* istanbul ignore next */ []));
|
|
1441
|
+
this.searchWordLimitMaxError = signal(false, /* @ts-ignore */
|
|
1442
|
+
...(ngDevMode ? [{ debugName: "searchWordLimitMaxError" }] : /* istanbul ignore next */ []));
|
|
1498
1443
|
this.searchWordLimitMaxCmp = computed(() => {
|
|
1499
1444
|
const inputLimit = this.searchLimitWordMax();
|
|
1500
1445
|
if (inputLimit !== undefined) {
|
|
1501
1446
|
return inputLimit;
|
|
1502
1447
|
}
|
|
1503
1448
|
return this.tableConfig?.searchLimitMaxWords !== undefined ? this.tableConfig?.searchLimitMaxWords : TableHeaderWithFiltersComponent.SEARCH_WORD_LIMIT_MAX;
|
|
1504
|
-
},
|
|
1449
|
+
}, /* @ts-ignore */
|
|
1450
|
+
...(ngDevMode ? [{ debugName: "searchWordLimitMaxCmp" }] : /* istanbul ignore next */ []));
|
|
1505
1451
|
this.searchValueSubject = new BehaviorSubject(undefined);
|
|
1506
1452
|
this.searchCaseSensitiveSubject = new BehaviorSubject(undefined);
|
|
1507
1453
|
// UI utilities
|
|
1508
1454
|
this.clickedOnFilterEvent = undefined;
|
|
1509
|
-
this.filterSplitButton = viewChild.required('filterSplitButton'
|
|
1510
|
-
|
|
1455
|
+
this.filterSplitButton = viewChild.required('filterSplitButton', /* @ts-ignore */
|
|
1456
|
+
...(ngDevMode ? [{ debugName: "filterSplitButton" }] : /* istanbul ignore next */ []));
|
|
1457
|
+
this.searchInput = viewChild.required('searchInput', /* @ts-ignore */
|
|
1458
|
+
...(ngDevMode ? [{ debugName: "searchInput" }] : /* istanbul ignore next */ []));
|
|
1511
1459
|
this.elementRef = inject(ElementRef);
|
|
1512
|
-
this.isInsideOverlay = signal(false,
|
|
1460
|
+
this.isInsideOverlay = signal(false, /* @ts-ignore */
|
|
1461
|
+
...(ngDevMode ? [{ debugName: "isInsideOverlay" }] : /* istanbul ignore next */ []));
|
|
1513
1462
|
this.overlaySelectors = [
|
|
1514
1463
|
'.p-dialog',
|
|
1515
1464
|
'.p-overlaypanel',
|
|
@@ -1653,7 +1602,6 @@ class TableHeaderWithFiltersComponent {
|
|
|
1653
1602
|
}
|
|
1654
1603
|
this.clickedOnFilterEvent = undefined;
|
|
1655
1604
|
}, 0);
|
|
1656
|
-
return;
|
|
1657
1605
|
}
|
|
1658
1606
|
else {
|
|
1659
1607
|
// clean state
|
|
@@ -1707,10 +1655,15 @@ class TableHeaderWithFiltersComponent {
|
|
|
1707
1655
|
// match mode needs to be set for inline search
|
|
1708
1656
|
this.tableData.updateSearch(searchQuery != null ? { value: searchQuery, caseSensitive: caseSensitive } : undefined);
|
|
1709
1657
|
}
|
|
1710
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1711
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: TableHeaderWithFiltersComponent, isStandalone: true, selector: "mng-table-header-with-filters", inputs: { metadata: { classPropertyName: "metadata", publicName: "metadata", isSignal: true, isRequired: true, transformFunction: null }, genericFilterDescriptor: { classPropertyName: "genericFilterDescriptor", publicName: "genericFilterDescriptor", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null }, enableSearch: { classPropertyName: "enableSearch", publicName: "enableSearch", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, searchLimitWordMax: { classPropertyName: "searchLimitWordMax", publicName: "searchLimitWordMax", isSignal: true, isRequired: false, transformFunction: null }, enableCaseSensitive: { classPropertyName: "enableCaseSensitive", publicName: "enableCaseSensitive", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "window:keydown": "filterShortcuts($event)" } }, queries: [{ propertyName: "templates", predicate: TableHeaderWithFiltersTemplateDirective, isSignal: true }], viewQueries: [{ propertyName: "filterOverlay", first: true, predicate: Popover, descendants: true, isSignal: true }, { propertyName: "filterFormComponent", first: true, predicate: TableFilterFormComponent, descendants: true, isSignal: true }, { propertyName: "filterSplitButton", first: true, predicate: ["filterSplitButton"], descendants: true, isSignal: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex items-center grow flex-wrap\">\n @if (titleTemplate()) {\n <ng-container *ngTemplateOutlet=\"titleTemplate()\"></ng-container>\n }\n @if (showOverlayFilterFormButton()) {\n <p-splitbutton\n #filterSplitButton\n [label]=\"'mngFilter.titleAdd' | translate\"\n [severity]=\"'secondary'\"\n (onClick)=\"onFilterAdd($event)\"\n [class]=\"'mng-filter-add-button mr-2' + (titleTemplate() ? ' ml-3' : '')\"\n (onMenuShow)=\"onFilterSplitButtonShow()\"\n showDelay=\"500\"\n [pTooltip]=\"('mngFilter.titleAdd' | translate) + ' ( ' + addFilterShortcutText + ' )'\"\n icon=\"pi pi-filter\"\n [model]=\"filterMenuItems()\">\n </p-splitbutton>\n }\n @if (enableSearch()) {\n @let shouldShowShortcut = !isInsideOverlay();\n <div\n class=\"mng-search mr-3\"\n [ngClass]=\"{'ml-3': !showOverlayFilterFormButton() && titleTemplate()}\"\n showDelay=\"500\"\n [pTooltip]=\"('mngFilter.search.input' | translate) + (shouldShowShortcut ? ' ( / )' : '')\">\n <span class=\"p-input-icon-left w-full\">\n <p-iconfield>\n <p-inputicon class=\"pi pi-search\" />\n <input\n #searchInput\n [ngModel]=\"searchValue()\"\n (ngModelChange)=\"onSearchChange($event)\"\n (keydown.enter)=\"onSearchSubmit($event)\"\n name=\"globalSearch\"\n type=\"text\"\n pInputText\n class=\"search-input w-full\"\n [ngClass]=\"{'ng-invalid': searchWordLimitMaxError()}\"\n [attr.placeholder]=\"'mngFilter.search.input' | translate\"\n [placeholder]=\"'mngFilter.search.input' | translate\" />\n @if (shouldShowShortcut) {\n <span class=\"search-shortcut-hint\">/</span>\n }\n </p-iconfield>\n @if (enableCaseSensitive()) {\n <span class=\"toggle-button-input\">\n <p-toggleButton\n styleClass=\"ml-1 p-1 p-button-sm\"\n [ngModel]=\"searchCaseSensitive()\"\n (ngModelChange)=\"onSearchCaseSensitiveChange($event)\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n </span>\n }\n </span>\n @if (searchWordLimitMaxError()) {\n <small class=\"p-error block\">\n {{ 'mngFilter.search.maxWordsExceededMessage' | translate }}\n </small>\n }\n </div>\n }\n @if (directInputMetadata().length > 0) {\n <div class=\"mng-direct-input-filters flex flex-wrap items-center my-1\">\n @for (metadata of directInputMetadata(); track metadata.descriptor.property) {\n @if (metadata.descriptor.filterType !== FilterTypeEnum.Component) {\n @defer (on idle) {\n <mng-table-filter [config]=\"metadata\" [model]=\"model()\" [showFilterIcon]=\"true\" [showTitleAsPlaceholder]=\"true\" class=\"mx-1 my-1\" />\n }\n } @else if (metadata.descriptor.customComponentType) {\n <ng-container [mngComponent]=\"metadata.descriptor.customComponentType\" [inputs]=\"{descriptor: metadata.descriptor}\"></ng-container>\n }\n }\n </div>\n }\n @if (titleRowRightTemplate()) {\n <ng-container *ngTemplateOutlet=\"titleRowRightTemplate()\"></ng-container>\n }\n</div>\n@if (activeFilters().length > 0 || unsetRequiredFilters().length > 0) {\n <div class=\"flex items-center flex-wrap mt-2\">\n @for (filter of unsetRequiredFilters(); track filter.config.descriptor.property) {\n @defer (on viewport) {\n <mng-table-filter-active-tag\n [model]=\"model()\"\n [filter]=\"filter\"\n (edit)=\"onFilterEdit($event)\"\n (remove)=\"onFilterRemove($event)\"\n (toggleDisabled)=\"onFilterToggleDisabled($event)\" />\n } @placeholder {\n <p-skeleton width=\"10rem\" height=\"2rem\"></p-skeleton>\n }\n }\n @for (filter of activeFilters(); track filter.config.descriptor.property) {\n @defer (on viewport) {\n <mng-table-filter-active-tag\n [model]=\"model()\"\n [filter]=\"filter\"\n (edit)=\"onFilterEdit($event)\"\n (remove)=\"onFilterRemove($event)\"\n (toggleDisabled)=\"onFilterToggleDisabled($event)\" />\n } @placeholder {\n <p-skeleton width=\"10rem\" height=\"2rem\"></p-skeleton>\n }\n }\n </div>\n}\n<p-popover #op showCloseIcon=\"true\" (onHide)=\"onOverlayHide()\" appendTo=\"body\">\n @defer (on viewport) {\n <mng-table-filter-form\n [model]=\"model()\"\n [metadata]=\"overlayFormMetadata()\"\n [genericDescriptor]=\"genericFilterDescriptor()\"\n [filter]=\"filterEdit()\"\n [disabledProperties]=\"activeFilterProperties()\"\n [propertySearch]=\"genericFilterDescriptor()?.propertySearch\"\n [overlay]=\"op\"\n [enableCaseSensitive]=\"enableCaseSensitive()\"\n (apply)=\"onFilterFormApply($event)\" />\n } @placeholder {\n <p-skeleton width=\"20rem\" height=\"3rem\"></p-skeleton>\n }\n</p-popover>\n", styles: [".toggle-button-input{position:absolute;right:.35rem;top:50%;transform:translateY(-50%)}.mng-search{min-width:20rem}.search-shortcut-hint{position:absolute;right:1rem;top:50%;transform:translateY(-50%);font-size:1.1rem;pointer-events:none;opacity:.5;transition:opacity .15s}.search-input:not(:placeholder-shown)~.search-shortcut-hint,.search-input:focus~.search-shortcut-hint{opacity:0;pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: TagModule }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ToggleButton, selector: "p-toggleButton, p-togglebutton, p-toggle-button", inputs: ["onLabel", "offLabel", "onIcon", "offIcon", "ariaLabel", "ariaLabelledBy", "styleClass", "inputId", "tabindex", "iconPos", "autofocus", "size", "allowEmpty", "fluid"], outputs: ["onChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["hostName", "iconPosition", "styleClass"] }, { kind: "component", type: InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["hostName", "styleClass"] }, { kind: "component", type: Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "directive", type: ComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "injectionToken", "inputs", "attachToHost", "parentInjector"], outputs: ["instanceCreated"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: SplitButton, selector: "p-splitbutton, p-splitButton, p-split-button", inputs: ["model", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "icon", "iconPos", "label", "tooltip", "tooltipOptions", "styleClass", "menuStyle", "menuStyleClass", "dropdownIcon", "appendTo", "dir", "expandAriaLabel", "showTransitionOptions", "hideTransitionOptions", "motionOptions", "buttonProps", "menuButtonProps", "autofocus", "disabled", "tabindex", "menuButtonDisabled", "buttonDisabled"], outputs: ["onClick", "onMenuHide", "onMenuShow", "onDropdownClick"] }, { kind: "directive", type: Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [Promise.resolve().then(function () { return filter_component; }).then(m => m.TableFilterComponent)], () => [Promise.resolve().then(function () { return filterActiveTag_component; }).then(m => m.TableFilterActiveTagComponent)], () => [Promise.resolve().then(function () { return filterActiveTag_component; }).then(m => m.TableFilterActiveTagComponent)], () => [TableFilterFormComponent]] }); }
|
|
1658
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableHeaderWithFiltersComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1659
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: TableHeaderWithFiltersComponent, isStandalone: true, selector: "mng-table-header-with-filters", inputs: { metadata: { classPropertyName: "metadata", publicName: "metadata", isSignal: true, isRequired: true, transformFunction: null }, genericFilterDescriptor: { classPropertyName: "genericFilterDescriptor", publicName: "genericFilterDescriptor", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null }, enableSearch: { classPropertyName: "enableSearch", publicName: "enableSearch", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, searchLimitWordMax: { classPropertyName: "searchLimitWordMax", publicName: "searchLimitWordMax", isSignal: true, isRequired: false, transformFunction: null }, enableCaseSensitive: { classPropertyName: "enableCaseSensitive", publicName: "enableCaseSensitive", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "window:keydown": "filterShortcuts($event)" } }, queries: [{ propertyName: "templates", predicate: TableHeaderWithFiltersTemplateDirective, isSignal: true }], viewQueries: [{ propertyName: "filterOverlay", first: true, predicate: Popover, descendants: true, isSignal: true }, { propertyName: "filterFormComponent", first: true, predicate: TableFilterFormComponent, descendants: true, isSignal: true }, { propertyName: "filterSplitButton", first: true, predicate: ["filterSplitButton"], descendants: true, isSignal: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex items-center grow flex-wrap\">\n @if (titleTemplate()) {\n <ng-container *ngTemplateOutlet=\"titleTemplate()\"></ng-container>\n }\n @if (showOverlayFilterFormButton()) {\n <p-splitbutton\n #filterSplitButton\n [label]=\"'mngFilter.titleAdd' | translate\"\n [severity]=\"'secondary'\"\n (onClick)=\"onFilterAdd($event)\"\n [class]=\"'mng-filter-add-button mr-2' + (titleTemplate() ? ' ml-3' : '')\"\n (onMenuShow)=\"onFilterSplitButtonShow()\"\n showDelay=\"500\"\n [pTooltip]=\"('mngFilter.titleAdd' | translate) + ' ( ' + addFilterShortcutText + ' )'\"\n icon=\"pi pi-filter\"\n [model]=\"filterMenuItems()\">\n </p-splitbutton>\n }\n @if (enableSearch()) {\n @let shouldShowShortcut = !isInsideOverlay();\n <div\n class=\"mng-search mr-3\"\n [ngClass]=\"{'ml-3': !showOverlayFilterFormButton() && titleTemplate()}\"\n showDelay=\"500\"\n [pTooltip]=\"('mngFilter.search.input' | translate) + (shouldShowShortcut ? ' ( / )' : '')\">\n <span class=\"p-input-icon-left w-full\">\n <p-iconfield>\n <p-inputicon class=\"pi pi-search\" />\n <input\n #searchInput\n [ngModel]=\"searchValue()\"\n (ngModelChange)=\"onSearchChange($event)\"\n (keydown.enter)=\"onSearchSubmit($event)\"\n name=\"globalSearch\"\n type=\"text\"\n pInputText\n class=\"search-input w-full\"\n [ngClass]=\"{'ng-invalid': searchWordLimitMaxError()}\"\n [attr.placeholder]=\"'mngFilter.search.input' | translate\"\n [placeholder]=\"'mngFilter.search.input' | translate\" />\n @if (shouldShowShortcut) {\n <span class=\"search-shortcut-hint\">/</span>\n }\n </p-iconfield>\n @if (enableCaseSensitive()) {\n <span class=\"toggle-button-input\">\n <p-toggleButton\n styleClass=\"ml-1 p-1 p-button-sm\"\n [ngModel]=\"searchCaseSensitive()\"\n (ngModelChange)=\"onSearchCaseSensitiveChange($event)\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n </span>\n }\n </span>\n @if (searchWordLimitMaxError()) {\n <small class=\"p-error block\">\n {{ 'mngFilter.search.maxWordsExceededMessage' | translate }}\n </small>\n }\n </div>\n }\n @if (directInputMetadata().length > 0) {\n <div class=\"mng-direct-input-filters flex flex-wrap items-center my-1\">\n @for (metadata of directInputMetadata(); track metadata.descriptor.property) {\n @if (metadata.descriptor.filterType !== FilterTypeEnum.Component) {\n @defer (on idle) {\n <mng-table-filter [config]=\"metadata\" [model]=\"model()\" [showFilterIcon]=\"true\" [showTitleAsPlaceholder]=\"true\" class=\"mx-1 my-1\" />\n }\n } @else if (metadata.descriptor.customComponentType) {\n <ng-container [mngComponent]=\"metadata.descriptor.customComponentType\" [inputs]=\"{descriptor: metadata.descriptor}\"></ng-container>\n }\n }\n </div>\n }\n @if (titleRowRightTemplate()) {\n <ng-container *ngTemplateOutlet=\"titleRowRightTemplate()\"></ng-container>\n }\n</div>\n@if (activeFilters().length > 0 || unsetRequiredFilters().length > 0) {\n <div class=\"flex items-center flex-wrap mt-2\">\n @for (filter of unsetRequiredFilters(); track filter.config.descriptor.property) {\n @defer (on viewport) {\n <mng-table-filter-active-tag\n [model]=\"model()\"\n [filter]=\"filter\"\n (edit)=\"onFilterEdit($event)\"\n (remove)=\"onFilterRemove($event)\"\n (toggleDisabled)=\"onFilterToggleDisabled($event)\" />\n } @placeholder {\n <p-skeleton width=\"10rem\" height=\"2rem\"></p-skeleton>\n }\n }\n @for (filter of activeFilters(); track filter.config.descriptor.property) {\n @defer (on viewport) {\n <mng-table-filter-active-tag\n [model]=\"model()\"\n [filter]=\"filter\"\n (edit)=\"onFilterEdit($event)\"\n (remove)=\"onFilterRemove($event)\"\n (toggleDisabled)=\"onFilterToggleDisabled($event)\" />\n } @placeholder {\n <p-skeleton width=\"10rem\" height=\"2rem\"></p-skeleton>\n }\n }\n </div>\n}\n<p-popover #op showCloseIcon=\"true\" (onHide)=\"onOverlayHide()\" appendTo=\"body\">\n @defer (on viewport) {\n <mng-table-filter-form\n [model]=\"model()\"\n [metadata]=\"overlayFormMetadata()\"\n [genericDescriptor]=\"genericFilterDescriptor()\"\n [filter]=\"filterEdit()\"\n [disabledProperties]=\"activeFilterProperties()\"\n [propertySearch]=\"genericFilterDescriptor()?.propertySearch\"\n [overlay]=\"op\"\n [enableCaseSensitive]=\"enableCaseSensitive()\"\n (apply)=\"onFilterFormApply($event)\" />\n } @placeholder {\n <p-skeleton width=\"20rem\" height=\"3rem\"></p-skeleton>\n }\n</p-popover>\n", styles: [".toggle-button-input{position:absolute;right:.35rem;top:50%;transform:translateY(-50%)}.mng-search{min-width:20rem}.search-shortcut-hint{position:absolute;right:1rem;top:50%;transform:translateY(-50%);font-size:1.1rem;pointer-events:none;opacity:.5;transition:opacity .15s}.search-input:not(:placeholder-shown)~.search-shortcut-hint,.search-input:focus~.search-shortcut-hint{opacity:0;pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: TagModule }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ToggleButton, selector: "p-toggleButton, p-togglebutton, p-toggle-button", inputs: ["onLabel", "offLabel", "onIcon", "offIcon", "ariaLabel", "ariaLabelledBy", "styleClass", "inputId", "tabindex", "iconPos", "autofocus", "size", "allowEmpty", "fluid"], outputs: ["onChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["hostName", "iconPosition", "styleClass"] }, { kind: "component", type: InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["hostName", "styleClass"] }, { kind: "component", type: Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "directive", type: ComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "injectionToken", "inputs", "attachToHost", "parentInjector"], outputs: ["instanceCreated"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: SplitButton, selector: "p-splitbutton, p-splitButton, p-split-button", inputs: ["model", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "icon", "iconPos", "label", "tooltip", "tooltipOptions", "styleClass", "menuStyle", "menuStyleClass", "dropdownIcon", "appendTo", "dir", "expandAriaLabel", "showTransitionOptions", "hideTransitionOptions", "motionOptions", "buttonProps", "menuButtonProps", "autofocus", "disabled", "tabindex", "menuButtonDisabled", "buttonDisabled"], outputs: ["onClick", "onMenuHide", "onMenuShow", "onDropdownClick"] }, { kind: "directive", type: Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], deferBlockDependencies: [() => [/* @ts-ignore */
|
|
1660
|
+
Promise.resolve().then(function () { return filter_component; }).then(m => m.TableFilterComponent)], () => [/* @ts-ignore */
|
|
1661
|
+
Promise.resolve().then(function () { return filterActiveTag_component; }).then(m => m.TableFilterActiveTagComponent)], () => [/* @ts-ignore */
|
|
1662
|
+
Promise.resolve().then(function () { return filterActiveTag_component; }).then(m => m.TableFilterActiveTagComponent)], () => [TableFilterFormComponent]] }); }
|
|
1712
1663
|
}
|
|
1713
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "
|
|
1664
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.1.4", ngImport: i0, type: TableHeaderWithFiltersComponent, resolveDeferredDeps: () => [/* @ts-ignore */
|
|
1665
|
+
Promise.resolve().then(function () { return filter_component; }).then(m => m.TableFilterComponent), /* @ts-ignore */
|
|
1666
|
+
Promise.resolve().then(function () { return filterActiveTag_component; }).then(m => m.TableFilterActiveTagComponent)], resolveMetadata: (TableFilterComponent, TableFilterActiveTagComponent) => ({ decorators: [{
|
|
1714
1667
|
type: Component,
|
|
1715
1668
|
args: [{ selector: 'mng-table-header-with-filters', imports: [
|
|
1716
1669
|
TranslatePipe,
|
|
@@ -1730,7 +1683,7 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.0.8", ng
|
|
|
1730
1683
|
Skeleton,
|
|
1731
1684
|
SplitButton,
|
|
1732
1685
|
Tooltip
|
|
1733
|
-
],
|
|
1686
|
+
], template: "<div class=\"flex items-center grow flex-wrap\">\n @if (titleTemplate()) {\n <ng-container *ngTemplateOutlet=\"titleTemplate()\"></ng-container>\n }\n @if (showOverlayFilterFormButton()) {\n <p-splitbutton\n #filterSplitButton\n [label]=\"'mngFilter.titleAdd' | translate\"\n [severity]=\"'secondary'\"\n (onClick)=\"onFilterAdd($event)\"\n [class]=\"'mng-filter-add-button mr-2' + (titleTemplate() ? ' ml-3' : '')\"\n (onMenuShow)=\"onFilterSplitButtonShow()\"\n showDelay=\"500\"\n [pTooltip]=\"('mngFilter.titleAdd' | translate) + ' ( ' + addFilterShortcutText + ' )'\"\n icon=\"pi pi-filter\"\n [model]=\"filterMenuItems()\">\n </p-splitbutton>\n }\n @if (enableSearch()) {\n @let shouldShowShortcut = !isInsideOverlay();\n <div\n class=\"mng-search mr-3\"\n [ngClass]=\"{'ml-3': !showOverlayFilterFormButton() && titleTemplate()}\"\n showDelay=\"500\"\n [pTooltip]=\"('mngFilter.search.input' | translate) + (shouldShowShortcut ? ' ( / )' : '')\">\n <span class=\"p-input-icon-left w-full\">\n <p-iconfield>\n <p-inputicon class=\"pi pi-search\" />\n <input\n #searchInput\n [ngModel]=\"searchValue()\"\n (ngModelChange)=\"onSearchChange($event)\"\n (keydown.enter)=\"onSearchSubmit($event)\"\n name=\"globalSearch\"\n type=\"text\"\n pInputText\n class=\"search-input w-full\"\n [ngClass]=\"{'ng-invalid': searchWordLimitMaxError()}\"\n [attr.placeholder]=\"'mngFilter.search.input' | translate\"\n [placeholder]=\"'mngFilter.search.input' | translate\" />\n @if (shouldShowShortcut) {\n <span class=\"search-shortcut-hint\">/</span>\n }\n </p-iconfield>\n @if (enableCaseSensitive()) {\n <span class=\"toggle-button-input\">\n <p-toggleButton\n styleClass=\"ml-1 p-1 p-button-sm\"\n [ngModel]=\"searchCaseSensitive()\"\n (ngModelChange)=\"onSearchCaseSensitiveChange($event)\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n </span>\n }\n </span>\n @if (searchWordLimitMaxError()) {\n <small class=\"p-error block\">\n {{ 'mngFilter.search.maxWordsExceededMessage' | translate }}\n </small>\n }\n </div>\n }\n @if (directInputMetadata().length > 0) {\n <div class=\"mng-direct-input-filters flex flex-wrap items-center my-1\">\n @for (metadata of directInputMetadata(); track metadata.descriptor.property) {\n @if (metadata.descriptor.filterType !== FilterTypeEnum.Component) {\n @defer (on idle) {\n <mng-table-filter [config]=\"metadata\" [model]=\"model()\" [showFilterIcon]=\"true\" [showTitleAsPlaceholder]=\"true\" class=\"mx-1 my-1\" />\n }\n } @else if (metadata.descriptor.customComponentType) {\n <ng-container [mngComponent]=\"metadata.descriptor.customComponentType\" [inputs]=\"{descriptor: metadata.descriptor}\"></ng-container>\n }\n }\n </div>\n }\n @if (titleRowRightTemplate()) {\n <ng-container *ngTemplateOutlet=\"titleRowRightTemplate()\"></ng-container>\n }\n</div>\n@if (activeFilters().length > 0 || unsetRequiredFilters().length > 0) {\n <div class=\"flex items-center flex-wrap mt-2\">\n @for (filter of unsetRequiredFilters(); track filter.config.descriptor.property) {\n @defer (on viewport) {\n <mng-table-filter-active-tag\n [model]=\"model()\"\n [filter]=\"filter\"\n (edit)=\"onFilterEdit($event)\"\n (remove)=\"onFilterRemove($event)\"\n (toggleDisabled)=\"onFilterToggleDisabled($event)\" />\n } @placeholder {\n <p-skeleton width=\"10rem\" height=\"2rem\"></p-skeleton>\n }\n }\n @for (filter of activeFilters(); track filter.config.descriptor.property) {\n @defer (on viewport) {\n <mng-table-filter-active-tag\n [model]=\"model()\"\n [filter]=\"filter\"\n (edit)=\"onFilterEdit($event)\"\n (remove)=\"onFilterRemove($event)\"\n (toggleDisabled)=\"onFilterToggleDisabled($event)\" />\n } @placeholder {\n <p-skeleton width=\"10rem\" height=\"2rem\"></p-skeleton>\n }\n }\n </div>\n}\n<p-popover #op showCloseIcon=\"true\" (onHide)=\"onOverlayHide()\" appendTo=\"body\">\n @defer (on viewport) {\n <mng-table-filter-form\n [model]=\"model()\"\n [metadata]=\"overlayFormMetadata()\"\n [genericDescriptor]=\"genericFilterDescriptor()\"\n [filter]=\"filterEdit()\"\n [disabledProperties]=\"activeFilterProperties()\"\n [propertySearch]=\"genericFilterDescriptor()?.propertySearch\"\n [overlay]=\"op\"\n [enableCaseSensitive]=\"enableCaseSensitive()\"\n (apply)=\"onFilterFormApply($event)\" />\n } @placeholder {\n <p-skeleton width=\"20rem\" height=\"3rem\"></p-skeleton>\n }\n</p-popover>\n", styles: [".toggle-button-input{position:absolute;right:.35rem;top:50%;transform:translateY(-50%)}.mng-search{min-width:20rem}.search-shortcut-hint{position:absolute;right:1rem;top:50%;transform:translateY(-50%);font-size:1.1rem;pointer-events:none;opacity:.5;transition:opacity .15s}.search-input:not(:placeholder-shown)~.search-shortcut-hint,.search-input:focus~.search-shortcut-hint{opacity:0;pointer-events:none}\n"] }]
|
|
1734
1687
|
}], ctorParameters: () => [], propDecorators: { metadata: [{ type: i0.Input, args: [{ isSignal: true, alias: "metadata", required: true }] }], genericFilterDescriptor: [{ type: i0.Input, args: [{ isSignal: true, alias: "genericFilterDescriptor", required: false }] }], model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: true }] }], enableSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableSearch", required: false }] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }], searchLimitWordMax: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchLimitWordMax", required: false }] }], enableCaseSensitive: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableCaseSensitive", required: false }] }], filterOverlay: [{ type: i0.ViewChild, args: [i0.forwardRef(() => Popover), { isSignal: true }] }], filterFormComponent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TableFilterFormComponent), { isSignal: true }] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TableHeaderWithFiltersTemplateDirective), { isSignal: true }] }], filterSplitButton: [{ type: i0.ViewChild, args: ['filterSplitButton', { isSignal: true }] }], searchInput: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }], filterShortcuts: [{
|
|
1735
1688
|
type: HostListener,
|
|
1736
1689
|
args: ['window:keydown', ['$event']]
|
|
@@ -1762,11 +1715,11 @@ function tableNotificationError(translate, messageService, table, error) {
|
|
|
1762
1715
|
* @return {Record<string, FilterState>} A mapping of filter keys to their corresponding filter states, constructed from the provided parameters or defaults.
|
|
1763
1716
|
*/
|
|
1764
1717
|
function tableCreateFilterState(paramsWithDefaults) {
|
|
1765
|
-
const
|
|
1718
|
+
const optimusFilterMeta = {};
|
|
1766
1719
|
// if any filter is present, no default filters should be applied!
|
|
1767
1720
|
if (paramsWithDefaults?.filters) {
|
|
1768
1721
|
Object.entries(paramsWithDefaults.filters).forEach(([key, value]) => {
|
|
1769
|
-
|
|
1722
|
+
optimusFilterMeta[key] = {
|
|
1770
1723
|
value: value?.value,
|
|
1771
1724
|
matchMode: value?.matchMode,
|
|
1772
1725
|
caseSensitive: value?.caseSensitive,
|
|
@@ -1774,7 +1727,7 @@ function tableCreateFilterState(paramsWithDefaults) {
|
|
|
1774
1727
|
};
|
|
1775
1728
|
});
|
|
1776
1729
|
}
|
|
1777
|
-
return
|
|
1730
|
+
return optimusFilterMeta;
|
|
1778
1731
|
}
|
|
1779
1732
|
/**
|
|
1780
1733
|
* Creates a sort state for a data table based on the provided parameters.
|
|
@@ -1807,10 +1760,10 @@ class LocaleDefaultRowClassPipe {
|
|
|
1807
1760
|
}
|
|
1808
1761
|
return value ?? '';
|
|
1809
1762
|
}
|
|
1810
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1811
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
1763
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: LocaleDefaultRowClassPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1764
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: LocaleDefaultRowClassPipe, isStandalone: true, name: "mngLocaleDefaultRowClass" }); }
|
|
1812
1765
|
}
|
|
1813
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1766
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: LocaleDefaultRowClassPipe, decorators: [{
|
|
1814
1767
|
type: Pipe,
|
|
1815
1768
|
args: [{
|
|
1816
1769
|
name: 'mngLocaleDefaultRowClass',
|
|
@@ -1828,10 +1781,10 @@ class TableFilterClassPipe {
|
|
|
1828
1781
|
return strValue;
|
|
1829
1782
|
}
|
|
1830
1783
|
}
|
|
1831
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1832
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
1784
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableFilterClassPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1785
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.4", ngImport: i0, type: TableFilterClassPipe, isStandalone: true, name: "mngTableFilterClass" }); }
|
|
1833
1786
|
}
|
|
1834
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1787
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableFilterClassPipe, decorators: [{
|
|
1835
1788
|
type: Pipe,
|
|
1836
1789
|
args: [{
|
|
1837
1790
|
pure: true,
|
|
@@ -1842,7 +1795,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
1842
1795
|
class TableMetadataService extends ADataListMetaService {
|
|
1843
1796
|
static { this.cmpTypeName = 'TableComponent'; }
|
|
1844
1797
|
#injector;
|
|
1845
|
-
#
|
|
1798
|
+
#optimusConfig;
|
|
1846
1799
|
#tableModuleConfig;
|
|
1847
1800
|
#translationObserver;
|
|
1848
1801
|
// signal sources
|
|
@@ -1859,19 +1812,24 @@ class TableMetadataService extends ADataListMetaService {
|
|
|
1859
1812
|
constructor() {
|
|
1860
1813
|
super();
|
|
1861
1814
|
this.#injector = inject(Injector);
|
|
1862
|
-
this.#
|
|
1815
|
+
this.#optimusConfig = inject(Optimus);
|
|
1863
1816
|
this.moduleConfig = inject(COMMONS_MODULE_CONFIG_IT, { optional: true });
|
|
1864
1817
|
this.#tableModuleConfig = inject(COMMONS_TABLE_FEATURE_CONFIG_IT, { optional: true });
|
|
1865
1818
|
this.serializationCfg = {};
|
|
1866
|
-
this.#translationObserver = toSignal(this.#
|
|
1819
|
+
this.#translationObserver = toSignal(this.#optimusConfig.translationObserver);
|
|
1867
1820
|
// signal sources
|
|
1868
|
-
this.#signalSources = signal({},
|
|
1821
|
+
this.#signalSources = signal({}, /* @ts-ignore */
|
|
1822
|
+
...(ngDevMode ? [{ debugName: "#signalSources" }] : /* istanbul ignore next */ []));
|
|
1869
1823
|
// config
|
|
1870
|
-
this.tableConfig = computed(() => ({ ...this.#tableModuleConfig, ...this.#signalSources().featureConfig?.() }),
|
|
1871
|
-
|
|
1824
|
+
this.tableConfig = computed(() => ({ ...this.#tableModuleConfig, ...this.#signalSources().featureConfig?.() }), /* @ts-ignore */
|
|
1825
|
+
...(ngDevMode ? [{ debugName: "tableConfig" }] : /* istanbul ignore next */ []));
|
|
1826
|
+
this.defaultFilterDisplayType = computed(() => this.tableConfig()?.filterDisplayType ?? FilterDisplayTypeEnum.OverlayWithTag, /* @ts-ignore */
|
|
1827
|
+
...(ngDevMode ? [{ debugName: "defaultFilterDisplayType" }] : /* istanbul ignore next */ []));
|
|
1872
1828
|
// descriptors
|
|
1873
|
-
this.descriptorFromSource = computed(() => this.#signalSources().descriptor?.(),
|
|
1874
|
-
|
|
1829
|
+
this.descriptorFromSource = computed(() => this.#signalSources().descriptor?.(), /* @ts-ignore */
|
|
1830
|
+
...(ngDevMode ? [{ debugName: "descriptorFromSource" }] : /* istanbul ignore next */ []));
|
|
1831
|
+
this.#descriptor = signal(tableDescriptor(), /* @ts-ignore */
|
|
1832
|
+
...(ngDevMode ? [{ debugName: "#descriptor" }] : /* istanbul ignore next */ []));
|
|
1875
1833
|
this.descriptor = this.#descriptor.asReadonly();
|
|
1876
1834
|
// eslint-disable-next-line no-unused-private-class-members
|
|
1877
1835
|
this.#updateDescriptorFromSourceEffect = effectWithDeps([this.descriptorFromSource], ([d]) => {
|
|
@@ -1888,7 +1846,8 @@ class TableMetadataService extends ADataListMetaService {
|
|
|
1888
1846
|
else {
|
|
1889
1847
|
return [25, 50, 100];
|
|
1890
1848
|
}
|
|
1891
|
-
},
|
|
1849
|
+
}, /* @ts-ignore */
|
|
1850
|
+
...(ngDevMode ? [{ debugName: "rowsPerPageOptions" }] : /* istanbul ignore next */ []));
|
|
1892
1851
|
this.defaultRowsPerPage = computed(() => {
|
|
1893
1852
|
const defaultNumRows = this.descriptor().defaultNumRows ?? this.tableConfig().defaultNumRows;
|
|
1894
1853
|
const rowsPerPageOptions = this.rowsPerPageOptions();
|
|
@@ -1896,20 +1855,27 @@ class TableMetadataService extends ADataListMetaService {
|
|
|
1896
1855
|
return defaultNumRows;
|
|
1897
1856
|
}
|
|
1898
1857
|
return rowsPerPageOptions[0];
|
|
1899
|
-
},
|
|
1858
|
+
}, /* @ts-ignore */
|
|
1859
|
+
...(ngDevMode ? [{ debugName: "defaultRowsPerPage" }] : /* istanbul ignore next */ []));
|
|
1900
1860
|
// filters
|
|
1901
|
-
this.filterDescriptors = computed(() => this.descriptor().filters,
|
|
1861
|
+
this.filterDescriptors = computed(() => this.descriptor().filters, /* @ts-ignore */
|
|
1862
|
+
...(ngDevMode ? [{ debugName: "filterDescriptors" }] : /* istanbul ignore next */ []));
|
|
1902
1863
|
this.filters = computed(() => {
|
|
1903
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1864
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars,sonarjs/no-dead-store
|
|
1904
1865
|
const observer = this.#translationObserver(); // need this one to track language changes
|
|
1905
1866
|
return this.filterDescriptors().map(d => this.mapFilterDescriptorToConfig(d));
|
|
1906
|
-
},
|
|
1907
|
-
|
|
1908
|
-
this
|
|
1867
|
+
}, /* @ts-ignore */
|
|
1868
|
+
...(ngDevMode ? [{ debugName: "filters" }] : /* istanbul ignore next */ []));
|
|
1869
|
+
this.genericFilterDescriptor = computed(() => this.descriptor().genericFilter, /* @ts-ignore */
|
|
1870
|
+
...(ngDevMode ? [{ debugName: "genericFilterDescriptor" }] : /* istanbul ignore next */ []));
|
|
1871
|
+
this.#genericFilters = signal([], /* @ts-ignore */
|
|
1872
|
+
...(ngDevMode ? [{ debugName: "#genericFilters" }] : /* istanbul ignore next */ []));
|
|
1909
1873
|
this.genericFilters = this.#genericFilters.asReadonly();
|
|
1910
1874
|
// search
|
|
1911
|
-
this.#searchFieldsFromSignalSource = computed(() => this.#signalSources().searchFields?.(),
|
|
1912
|
-
|
|
1875
|
+
this.#searchFieldsFromSignalSource = computed(() => this.#signalSources().searchFields?.(), /* @ts-ignore */
|
|
1876
|
+
...(ngDevMode ? [{ debugName: "#searchFieldsFromSignalSource" }] : /* istanbul ignore next */ []));
|
|
1877
|
+
this.#searchFields = signal([], /* @ts-ignore */
|
|
1878
|
+
...(ngDevMode ? [{ debugName: "#searchFields" }] : /* istanbul ignore next */ []));
|
|
1913
1879
|
this.searchFields = this.#searchFields.asReadonly();
|
|
1914
1880
|
// eslint-disable-next-line no-unused-private-class-members
|
|
1915
1881
|
this.#searchFieldsEffect = effectWithDeps([this.descriptor, this.#searchFieldsFromSignalSource], ([descriptor, searchFieldsFromSignalSource]) => {
|
|
@@ -1939,7 +1905,8 @@ class TableMetadataService extends ADataListMetaService {
|
|
|
1939
1905
|
};
|
|
1940
1906
|
});
|
|
1941
1907
|
return params;
|
|
1942
|
-
},
|
|
1908
|
+
}, /* @ts-ignore */
|
|
1909
|
+
...(ngDevMode ? [{ debugName: "defaultParams" }] : /* istanbul ignore next */ []));
|
|
1943
1910
|
filterApplySerializationConfigToCmp(this.moduleConfig, this.serializationCfg);
|
|
1944
1911
|
combineLatest([toObservable(this.genericFilterDescriptor), toObservable(this.#translationObserver)])
|
|
1945
1912
|
.pipe(switchMap(([genericFilterDescriptor]) => {
|
|
@@ -1967,7 +1934,7 @@ class TableMetadataService extends ADataListMetaService {
|
|
|
1967
1934
|
}
|
|
1968
1935
|
}
|
|
1969
1936
|
mapFilterDescriptorToConfig(descriptor) {
|
|
1970
|
-
const matchModes = filterGenerateMatchModeOptions(this.#
|
|
1937
|
+
const matchModes = filterGenerateMatchModeOptions(this.#optimusConfig, descriptor, this.serializationCfg);
|
|
1971
1938
|
return {
|
|
1972
1939
|
descriptor: descriptor,
|
|
1973
1940
|
matchModes: matchModes,
|
|
@@ -1976,10 +1943,10 @@ class TableMetadataService extends ADataListMetaService {
|
|
|
1976
1943
|
numberConfig: filterGetNumberConfig(descriptor)
|
|
1977
1944
|
};
|
|
1978
1945
|
}
|
|
1979
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1980
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1946
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableMetadataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1947
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableMetadataService }); }
|
|
1981
1948
|
}
|
|
1982
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1949
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableMetadataService, decorators: [{
|
|
1983
1950
|
type: Injectable
|
|
1984
1951
|
}], ctorParameters: () => [] });
|
|
1985
1952
|
|
|
@@ -1988,7 +1955,7 @@ class TableDataService extends ADataListService {
|
|
|
1988
1955
|
#destroyRef;
|
|
1989
1956
|
#commons;
|
|
1990
1957
|
#metadata;
|
|
1991
|
-
#
|
|
1958
|
+
#optimusTable;
|
|
1992
1959
|
// signal sources
|
|
1993
1960
|
#dataSources;
|
|
1994
1961
|
// data sources
|
|
@@ -2019,7 +1986,7 @@ class TableDataService extends ADataListService {
|
|
|
2019
1986
|
#count;
|
|
2020
1987
|
#loading;
|
|
2021
1988
|
// eslint-disable-next-line no-unused-private-class-members
|
|
2022
|
-
#
|
|
1989
|
+
#syncOptimusTableFirstEffect;
|
|
2023
1990
|
constructor() {
|
|
2024
1991
|
super();
|
|
2025
1992
|
this.#injector = inject(Injector);
|
|
@@ -2027,9 +1994,11 @@ class TableDataService extends ADataListService {
|
|
|
2027
1994
|
this.#commons = inject(CommonsService);
|
|
2028
1995
|
this.#metadata = inject(TableMetadataService);
|
|
2029
1996
|
// signal sources
|
|
2030
|
-
this.#dataSources = signal({},
|
|
1997
|
+
this.#dataSources = signal({}, /* @ts-ignore */
|
|
1998
|
+
...(ngDevMode ? [{ debugName: "#dataSources" }] : /* istanbul ignore next */ []));
|
|
2031
1999
|
// data sources
|
|
2032
|
-
this.#manualLoading = computed(() => this.#dataSources()?.manualLoading?.(),
|
|
2000
|
+
this.#manualLoading = computed(() => this.#dataSources()?.manualLoading?.(), /* @ts-ignore */
|
|
2001
|
+
...(ngDevMode ? [{ debugName: "#manualLoading" }] : /* istanbul ignore next */ []));
|
|
2033
2002
|
// results that are set directly via input and are not result of a asynchronous operation (aka data provider)
|
|
2034
2003
|
this.#synchronousResult = computed(() => {
|
|
2035
2004
|
const dataSources = this.#dataSources();
|
|
@@ -2043,12 +2012,15 @@ class TableDataService extends ADataListService {
|
|
|
2043
2012
|
return { data: dataSources.arrayItems(), totalCount: dataSources.arrayItems()?.length ?? 0 };
|
|
2044
2013
|
}
|
|
2045
2014
|
return undefined;
|
|
2046
|
-
},
|
|
2047
|
-
|
|
2015
|
+
}, /* @ts-ignore */
|
|
2016
|
+
...(ngDevMode ? [{ debugName: "#synchronousResult" }] : /* istanbul ignore next */ []));
|
|
2017
|
+
this.#dataProvider = computed(() => this.#dataSources()?.dataProvider?.(), /* @ts-ignore */
|
|
2018
|
+
...(ngDevMode ? [{ debugName: "#dataProvider" }] : /* istanbul ignore next */ []));
|
|
2048
2019
|
this.#dataProviderService = computed(() => {
|
|
2049
2020
|
const dataProvider = this.#dataProvider();
|
|
2050
2021
|
return dataProvider?.serviceType ? this.#injector.get(dataProvider.serviceType) : null;
|
|
2051
|
-
},
|
|
2022
|
+
}, /* @ts-ignore */
|
|
2023
|
+
...(ngDevMode ? [{ debugName: "#dataProviderService" }] : /* istanbul ignore next */ []));
|
|
2052
2024
|
// eslint-disable-next-line no-unused-private-class-members
|
|
2053
2025
|
this.#synchronousResultEffect = effectWithDeps([this.#synchronousResult], ([res]) => {
|
|
2054
2026
|
if (res != null) {
|
|
@@ -2069,32 +2041,39 @@ class TableDataService extends ADataListService {
|
|
|
2069
2041
|
});
|
|
2070
2042
|
this.#destroyed = false;
|
|
2071
2043
|
// pagination
|
|
2072
|
-
this.#params = signal(undefined,
|
|
2044
|
+
this.#params = signal(undefined, /* @ts-ignore */
|
|
2045
|
+
...(ngDevMode ? [{ debugName: "#params" }] : /* istanbul ignore next */ []));
|
|
2073
2046
|
this.params = this.#params.asReadonly();
|
|
2074
|
-
this.#sortStates = signal(undefined,
|
|
2047
|
+
this.#sortStates = signal(undefined, /* @ts-ignore */
|
|
2048
|
+
...(ngDevMode ? [{ debugName: "#sortStates" }] : /* istanbul ignore next */ []));
|
|
2075
2049
|
this.sortStates = this.#sortStates.asReadonly();
|
|
2076
|
-
this.#filterStates = signal({},
|
|
2050
|
+
this.#filterStates = signal({}, /* @ts-ignore */
|
|
2051
|
+
...(ngDevMode ? [{ debugName: "#filterStates" }] : /* istanbul ignore next */ []));
|
|
2077
2052
|
this.filterStates = this.#filterStates.asReadonly();
|
|
2078
|
-
this.
|
|
2053
|
+
this.optimusFilterStates = computed(() => {
|
|
2079
2054
|
const filterStates = this.#filterStates();
|
|
2080
2055
|
const searchState = this.#searchState();
|
|
2081
|
-
const
|
|
2056
|
+
const optimusFilterStates = { ...filterStates };
|
|
2082
2057
|
if (searchState != null) {
|
|
2083
|
-
|
|
2058
|
+
optimusFilterStates['global'] = { ...searchState, matchMode: 'contains' };
|
|
2084
2059
|
}
|
|
2085
|
-
return
|
|
2086
|
-
},
|
|
2087
|
-
|
|
2060
|
+
return optimusFilterStates;
|
|
2061
|
+
}, /* @ts-ignore */
|
|
2062
|
+
...(ngDevMode ? [{ debugName: "optimusFilterStates" }] : /* istanbul ignore next */ []));
|
|
2063
|
+
this.#isSortAndFilterMetaInitialized = signal(false, /* @ts-ignore */
|
|
2064
|
+
...(ngDevMode ? [{ debugName: "#isSortAndFilterMetaInitialized" }] : /* istanbul ignore next */ []));
|
|
2088
2065
|
// eslint-disable-next-line no-unused-private-class-members
|
|
2089
2066
|
this.#defaultParamsEffect = effectWithDeps([this.#metadata.defaultParams], ([defaultParams]) => {
|
|
2090
2067
|
this.#sortStates.set(tableCreateSortState(defaultParams));
|
|
2091
2068
|
this.#filterStates.set(tableCreateFilterState(defaultParams));
|
|
2092
2069
|
this.#isSortAndFilterMetaInitialized.set(true);
|
|
2093
2070
|
}, { firstOnly: true });
|
|
2094
|
-
this.#isSearchMetaInitialized = signal(false,
|
|
2095
|
-
|
|
2071
|
+
this.#isSearchMetaInitialized = signal(false, /* @ts-ignore */
|
|
2072
|
+
...(ngDevMode ? [{ debugName: "#isSearchMetaInitialized" }] : /* istanbul ignore next */ []));
|
|
2073
|
+
this.#searchState = signal(undefined, /* @ts-ignore */
|
|
2074
|
+
...(ngDevMode ? [{ debugName: "#searchState" }] : /* istanbul ignore next */ []));
|
|
2096
2075
|
this.searchState = this.#searchState.asReadonly();
|
|
2097
|
-
this.isAllPaginationMetaInitialized =
|
|
2076
|
+
this.isAllPaginationMetaInitialized = this.#isSortAndFilterMetaInitialized.asReadonly();
|
|
2098
2077
|
this.paginationMode = computed(() => {
|
|
2099
2078
|
const descriptor = this.#metadata.descriptor();
|
|
2100
2079
|
if (descriptor.paginationMode != null) {
|
|
@@ -2108,25 +2087,32 @@ class TableDataService extends ADataListService {
|
|
|
2108
2087
|
else {
|
|
2109
2088
|
return TablePaginationModeEnum.None;
|
|
2110
2089
|
}
|
|
2111
|
-
},
|
|
2112
|
-
|
|
2090
|
+
}, /* @ts-ignore */
|
|
2091
|
+
...(ngDevMode ? [{ debugName: "paginationMode" }] : /* istanbul ignore next */ []));
|
|
2092
|
+
this.offset = computed(() => this.params()?.offset ?? 0, /* @ts-ignore */
|
|
2093
|
+
...(ngDevMode ? [{ debugName: "offset" }] : /* istanbul ignore next */ []));
|
|
2113
2094
|
this.rows = computed(() => {
|
|
2114
2095
|
const params = this.params();
|
|
2115
2096
|
if (params?.limit) {
|
|
2116
2097
|
return params.limit;
|
|
2117
2098
|
}
|
|
2118
2099
|
return this.#metadata.defaultRowsPerPage();
|
|
2119
|
-
},
|
|
2100
|
+
}, /* @ts-ignore */
|
|
2101
|
+
...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
2120
2102
|
// data
|
|
2121
|
-
this.#data = signal([],
|
|
2103
|
+
this.#data = signal([], /* @ts-ignore */
|
|
2104
|
+
...(ngDevMode ? [{ debugName: "#data" }] : /* istanbul ignore next */ []));
|
|
2122
2105
|
this.data = this.#data.asReadonly();
|
|
2123
|
-
this.#count = signal(0,
|
|
2106
|
+
this.#count = signal(0, /* @ts-ignore */
|
|
2107
|
+
...(ngDevMode ? [{ debugName: "#count" }] : /* istanbul ignore next */ []));
|
|
2124
2108
|
this.count = this.#count.asReadonly();
|
|
2125
|
-
this.#loading = signal(false,
|
|
2109
|
+
this.#loading = signal(false, /* @ts-ignore */
|
|
2110
|
+
...(ngDevMode ? [{ debugName: "#loading" }] : /* istanbul ignore next */ []));
|
|
2126
2111
|
this.loading = this.#loading.asReadonly();
|
|
2127
|
-
this.selectedItems = signal([],
|
|
2112
|
+
this.selectedItems = signal([], /* @ts-ignore */
|
|
2113
|
+
...(ngDevMode ? [{ debugName: "selectedItems" }] : /* istanbul ignore next */ []));
|
|
2128
2114
|
// eslint-disable-next-line no-unused-private-class-members
|
|
2129
|
-
this.#
|
|
2115
|
+
this.#syncOptimusTableFirstEffect = effectWithDeps([this.#data, this.optimusFilterStates, this.params], () => this.#syncOptimusTableFirst());
|
|
2130
2116
|
this.#destroyRef.onDestroy(() => {
|
|
2131
2117
|
this.#destroyed = true;
|
|
2132
2118
|
this.#dataProviderSubscription?.unsubscribe();
|
|
@@ -2135,14 +2121,15 @@ class TableDataService extends ADataListService {
|
|
|
2135
2121
|
setDataSources(arrayItems, dataListResult, dataProvider, manualLoading) {
|
|
2136
2122
|
this.#dataSources.set({ arrayItems, dataListResult, dataProvider, manualLoading });
|
|
2137
2123
|
}
|
|
2138
|
-
|
|
2139
|
-
this.#
|
|
2140
|
-
this.#
|
|
2124
|
+
setOptimusTable(cmp) {
|
|
2125
|
+
this.#optimusTable = cmp;
|
|
2126
|
+
this.#syncOptimusTableFirst();
|
|
2141
2127
|
}
|
|
2142
2128
|
fetchWithDataProvider(paramsList, onErrorFn) {
|
|
2143
2129
|
// remove disabled filters from fetch
|
|
2144
2130
|
const params = {
|
|
2145
2131
|
...paramsList,
|
|
2132
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2146
2133
|
filters: paramsList.filters ? Object.fromEntries(Object.entries(paramsList.filters).filter(([_, f]) => !f?.disabled)) : undefined
|
|
2147
2134
|
};
|
|
2148
2135
|
const dataProvider = this.#dataProvider();
|
|
@@ -2186,9 +2173,9 @@ class TableDataService extends ADataListService {
|
|
|
2186
2173
|
}
|
|
2187
2174
|
}
|
|
2188
2175
|
/**
|
|
2189
|
-
* Updates
|
|
2176
|
+
* Updates the Optimus UI component with new filters and triggers data reload (if lazy load) or inline filtering.
|
|
2190
2177
|
* Usually setting the params should trigger the cycle to load data and calculate other states (sort, filter, search, etc.) from params.
|
|
2191
|
-
* In case of
|
|
2178
|
+
* In case of Optimus UI inline filtering, the internal state must be updated first and the states must subsequently be updated via callback functions.
|
|
2192
2179
|
*
|
|
2193
2180
|
* @param filters - { [fieldName]: FilterState | undefined } where:
|
|
2194
2181
|
* - fieldName = column field identifier
|
|
@@ -2196,18 +2183,18 @@ class TableDataService extends ADataListService {
|
|
|
2196
2183
|
* - undefined = clears filter for that field
|
|
2197
2184
|
*/
|
|
2198
2185
|
updateFilters(filters) {
|
|
2199
|
-
if (!this.#
|
|
2186
|
+
if (!this.#optimusTable)
|
|
2200
2187
|
return;
|
|
2201
2188
|
for (const key of Object.keys(filters)) {
|
|
2202
|
-
this.#
|
|
2189
|
+
this.#optimusTable.filters[key] = { ...filters[key] };
|
|
2203
2190
|
}
|
|
2204
|
-
this.#
|
|
2191
|
+
this.#optimusTable._filter();
|
|
2205
2192
|
}
|
|
2206
2193
|
updateSearch(search) {
|
|
2207
|
-
if (!this.#
|
|
2194
|
+
if (!this.#optimusTable)
|
|
2208
2195
|
return;
|
|
2209
|
-
this.#
|
|
2210
|
-
this.#
|
|
2196
|
+
this.#optimusTable.filters['global'] = { ...search, matchMode: 'contains' };
|
|
2197
|
+
this.#optimusTable._filter();
|
|
2211
2198
|
}
|
|
2212
2199
|
/**
|
|
2213
2200
|
* Compare the given params with the stored params in the DataListService.
|
|
@@ -2227,32 +2214,32 @@ class TableDataService extends ADataListService {
|
|
|
2227
2214
|
#lastFilterStateKey;
|
|
2228
2215
|
#lastSearchKey;
|
|
2229
2216
|
/**
|
|
2230
|
-
*
|
|
2217
|
+
* Optimus UI resets the paginator to the first page whenever the client-side filter state is applied
|
|
2231
2218
|
* to the table (see `Table._filter`). When that happens after the params have already been set
|
|
2232
2219
|
* (e.g. an offset from url query params on an eagerly loaded table with preset filters), the
|
|
2233
|
-
* requested page would be lost - re-assert the current params offset onto the
|
|
2220
|
+
* requested page would be lost - re-assert the current params offset onto the optimus table once
|
|
2234
2221
|
* the ongoing change detection cycle (and therefore the filter application) has settled.
|
|
2235
2222
|
*/
|
|
2236
|
-
#
|
|
2237
|
-
if (!this.#
|
|
2223
|
+
#syncOptimusTableFirst() {
|
|
2224
|
+
if (!this.#isOptimusTableFirstSyncable()) {
|
|
2238
2225
|
return;
|
|
2239
2226
|
}
|
|
2240
2227
|
queueMicrotask(() => {
|
|
2241
|
-
const
|
|
2242
|
-
if (!
|
|
2228
|
+
const optimusTable = this.#optimusTable;
|
|
2229
|
+
if (!optimusTable || !this.#isOptimusTableFirstSyncable()) {
|
|
2243
2230
|
return;
|
|
2244
2231
|
}
|
|
2245
|
-
if (
|
|
2246
|
-
|
|
2247
|
-
|
|
2232
|
+
if (optimusTable.first !== this.offset()) {
|
|
2233
|
+
optimusTable.first = this.offset();
|
|
2234
|
+
optimusTable.cd.detectChanges();
|
|
2248
2235
|
}
|
|
2249
2236
|
});
|
|
2250
2237
|
}
|
|
2251
|
-
#
|
|
2252
|
-
const
|
|
2238
|
+
#isOptimusTableFirstSyncable() {
|
|
2239
|
+
const optimusTable = this.#optimusTable;
|
|
2253
2240
|
// only non-lazy paginated tables with an active filter state are affected by the reset -
|
|
2254
2241
|
// everywhere else the [first] binding alone keeps the table and the params in sync
|
|
2255
|
-
return !this.#destroyed && !!
|
|
2242
|
+
return !this.#destroyed && !!optimusTable && !optimusTable.lazy && !!optimusTable.paginator && Object.keys(this.optimusFilterStates()).length > 0;
|
|
2256
2243
|
}
|
|
2257
2244
|
/**
|
|
2258
2245
|
* Returns true when the filter state changed since the last data provider load.
|
|
@@ -2291,10 +2278,10 @@ class TableDataService extends ADataListService {
|
|
|
2291
2278
|
this.selectedItems.set(reconciled);
|
|
2292
2279
|
}
|
|
2293
2280
|
}
|
|
2294
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2295
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2281
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableDataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2282
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableDataService }); }
|
|
2296
2283
|
}
|
|
2297
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2284
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableDataService, decorators: [{
|
|
2298
2285
|
type: Injectable
|
|
2299
2286
|
}], ctorParameters: () => [] });
|
|
2300
2287
|
|
|
@@ -2316,17 +2303,21 @@ class TablePreferencesService {
|
|
|
2316
2303
|
this.localstorageKey = computed(() => {
|
|
2317
2304
|
const descriptor = this.#metadata.descriptor();
|
|
2318
2305
|
return descriptor.model.i18nBaseKey ? generateTableLayoutPrefsKey(descriptor.model.i18nBaseKey, this.#router.url, descriptor.identifier) : null;
|
|
2319
|
-
},
|
|
2320
|
-
|
|
2306
|
+
}, /* @ts-ignore */
|
|
2307
|
+
...(ngDevMode ? [{ debugName: "localstorageKey" }] : /* istanbul ignore next */ []));
|
|
2308
|
+
this.#layoutPrefsSaveCnt = signal(0, /* @ts-ignore */
|
|
2309
|
+
...(ngDevMode ? [{ debugName: "#layoutPrefsSaveCnt" }] : /* istanbul ignore next */ []));
|
|
2321
2310
|
this.layoutPreferences = computed(() => {
|
|
2322
2311
|
const lsKey = this.localstorageKey();
|
|
2323
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2312
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars,sonarjs/no-dead-store
|
|
2324
2313
|
const cnt = this.#layoutPrefsSaveCnt(); // needed to force updates on user changes
|
|
2325
2314
|
const layoutPrefs = lsKey ? this.#storageService.getItem(TableMetadataService.cmpTypeName, lsKey) : undefined;
|
|
2326
2315
|
return layoutPrefs ?? { columnWidths: {} };
|
|
2327
|
-
},
|
|
2316
|
+
}, /* @ts-ignore */
|
|
2317
|
+
...(ngDevMode ? [{ debugName: "layoutPreferences" }] : /* istanbul ignore next */ []));
|
|
2328
2318
|
// columns
|
|
2329
|
-
this.columnsWithPrefs = computed(() => this.#computeColumnsWithLayout(),
|
|
2319
|
+
this.columnsWithPrefs = computed(() => this.#computeColumnsWithLayout(), /* @ts-ignore */
|
|
2320
|
+
...(ngDevMode ? [{ debugName: "columnsWithPrefs" }] : /* istanbul ignore next */ []));
|
|
2330
2321
|
}
|
|
2331
2322
|
#router;
|
|
2332
2323
|
#storageService;
|
|
@@ -2438,10 +2429,10 @@ class TablePreferencesService {
|
|
|
2438
2429
|
}
|
|
2439
2430
|
return columns.sort((a, b) => (a.orderIdx !== undefined && b.orderIdx !== undefined ? a.orderIdx - b.orderIdx : 0));
|
|
2440
2431
|
}
|
|
2441
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2442
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2432
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TablePreferencesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2433
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TablePreferencesService }); }
|
|
2443
2434
|
}
|
|
2444
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2435
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TablePreferencesService, decorators: [{
|
|
2445
2436
|
type: Injectable
|
|
2446
2437
|
}] });
|
|
2447
2438
|
|
|
@@ -2521,10 +2512,10 @@ class TableRemovableSortDirective {
|
|
|
2521
2512
|
}
|
|
2522
2513
|
return multiSortMeta;
|
|
2523
2514
|
}
|
|
2524
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2525
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2515
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableRemovableSortDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2516
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.4", type: TableRemovableSortDirective, isStandalone: true, selector: "[mngRemovableSort]", outputs: { sortChange: "sortChange" }, ngImport: i0 }); }
|
|
2526
2517
|
}
|
|
2527
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2518
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableRemovableSortDirective, decorators: [{
|
|
2528
2519
|
type: Directive,
|
|
2529
2520
|
args: [{
|
|
2530
2521
|
selector: '[mngRemovableSort]'
|
|
@@ -2534,16 +2525,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
2534
2525
|
class TableTemplateDirective extends TemplateDirective {
|
|
2535
2526
|
constructor() {
|
|
2536
2527
|
super(...arguments);
|
|
2537
|
-
this.name = input.required(
|
|
2528
|
+
this.name = input.required(/* @ts-ignore */
|
|
2529
|
+
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
2538
2530
|
}
|
|
2539
2531
|
// narrow the type of the context using the generic type of the directive.
|
|
2532
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2540
2533
|
static ngTemplateContextGuard(dir, ctx) {
|
|
2541
2534
|
return true;
|
|
2542
2535
|
}
|
|
2543
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2544
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
2536
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableTemplateDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2537
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: TableTemplateDirective, isStandalone: true, selector: "[mngTableTemplate]", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
|
|
2545
2538
|
}
|
|
2546
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2539
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableTemplateDirective, decorators: [{
|
|
2547
2540
|
type: Directive,
|
|
2548
2541
|
args: [{
|
|
2549
2542
|
selector: '[mngTableTemplate]'
|
|
@@ -2566,21 +2559,28 @@ class TableComponent {
|
|
|
2566
2559
|
this.prefs = inject(TablePreferencesService);
|
|
2567
2560
|
this.data = inject((TableDataService));
|
|
2568
2561
|
// descriptor
|
|
2569
|
-
this.descriptorInput = input.required({ ...(ngDevMode ? { debugName: "descriptorInput" } : {}), alias: 'descriptor' });
|
|
2562
|
+
this.descriptorInput = input.required({ ...(ngDevMode ? { debugName: "descriptorInput" } : /* istanbul ignore next */ {}), alias: 'descriptor' });
|
|
2570
2563
|
// data source inputs
|
|
2571
|
-
this.items = input(
|
|
2572
|
-
|
|
2573
|
-
this.
|
|
2574
|
-
|
|
2564
|
+
this.items = input(/* @ts-ignore */
|
|
2565
|
+
...(ngDevMode ? [undefined, { debugName: "items" }] : /* istanbul ignore next */ []));
|
|
2566
|
+
this.result = input(/* @ts-ignore */
|
|
2567
|
+
...(ngDevMode ? [undefined, { debugName: "result" }] : /* istanbul ignore next */ []));
|
|
2568
|
+
this.loadingInput = input(undefined, { ...(ngDevMode ? { debugName: "loadingInput" } : /* istanbul ignore next */ {}), alias: 'loading', transform: booleanOrUndefinedAttribute });
|
|
2569
|
+
this.dataProvider = input(/* @ts-ignore */
|
|
2570
|
+
...(ngDevMode ? [undefined, { debugName: "dataProvider" }] : /* istanbul ignore next */ []));
|
|
2575
2571
|
// extra features input
|
|
2576
|
-
this.queryParamPrepend = input(
|
|
2577
|
-
|
|
2578
|
-
this.
|
|
2579
|
-
this.
|
|
2580
|
-
|
|
2581
|
-
this.
|
|
2582
|
-
this.
|
|
2583
|
-
|
|
2572
|
+
this.queryParamPrepend = input(/* @ts-ignore */
|
|
2573
|
+
...(ngDevMode ? [undefined, { debugName: "queryParamPrepend" }] : /* istanbul ignore next */ []));
|
|
2574
|
+
this.useQueryParams = input(false, { ...(ngDevMode ? { debugName: "useQueryParams" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2575
|
+
this.filterKeyPrepend = computed(() => 'f_' + (this.useQueryParams() ? (this.queryParamPrepend() ?? '') : ''), /* @ts-ignore */
|
|
2576
|
+
...(ngDevMode ? [{ debugName: "filterKeyPrepend" }] : /* istanbul ignore next */ []));
|
|
2577
|
+
this.cellClickEnabled = input(true, { ...(ngDevMode ? { debugName: "cellClickEnabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2578
|
+
this.selectionMode = input('multiple', /* @ts-ignore */
|
|
2579
|
+
...(ngDevMode ? [{ debugName: "selectionMode" }] : /* istanbul ignore next */ []));
|
|
2580
|
+
this.selectionEnabled = input(false, { ...(ngDevMode ? { debugName: "selectionEnabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2581
|
+
this.rowReorderEnabledInput = input(true, { ...(ngDevMode ? { debugName: "rowReorderEnabledInput" } : /* istanbul ignore next */ {}), alias: 'rowReorderEnabled', transform: booleanAttribute });
|
|
2582
|
+
this.rowReorderEnabled = computed(() => this.rowReorderEnabledInput() && this.metadata.descriptor().rowReorderable, /* @ts-ignore */
|
|
2583
|
+
...(ngDevMode ? [{ debugName: "rowReorderEnabled" }] : /* istanbul ignore next */ []));
|
|
2584
2584
|
this.expandedRowKeys = computed(() => {
|
|
2585
2585
|
const descriptor = this.metadata.descriptor();
|
|
2586
2586
|
if (typeof descriptor.isRowExpanded === 'string') {
|
|
@@ -2596,19 +2596,27 @@ class TableComponent {
|
|
|
2596
2596
|
}, {});
|
|
2597
2597
|
}
|
|
2598
2598
|
return {};
|
|
2599
|
-
},
|
|
2600
|
-
|
|
2599
|
+
}, /* @ts-ignore */
|
|
2600
|
+
...(ngDevMode ? [{ debugName: "expandedRowKeys" }] : /* istanbul ignore next */ []));
|
|
2601
|
+
this.featureConfig = input(undefined, /* @ts-ignore */
|
|
2602
|
+
...(ngDevMode ? [{ debugName: "featureConfig" }] : /* istanbul ignore next */ []));
|
|
2601
2603
|
// styling
|
|
2602
|
-
this.columnLastMinWidth = input(
|
|
2603
|
-
|
|
2604
|
-
this.
|
|
2605
|
-
|
|
2604
|
+
this.columnLastMinWidth = input(/* @ts-ignore */
|
|
2605
|
+
...(ngDevMode ? [undefined, { debugName: "columnLastMinWidth" }] : /* istanbul ignore next */ []));
|
|
2606
|
+
this.columnsColspan = computed(() => this.visibleColumns().length + (this.hasLastColumn() ? 1 : 0) + (this.selectionEnabled() ? 1 : 0) + (this.rowReorderEnabled() ? 1 : 0), /* @ts-ignore */
|
|
2607
|
+
...(ngDevMode ? [{ debugName: "columnsColspan" }] : /* istanbul ignore next */ []));
|
|
2608
|
+
this.hasTitleDisplay = computed(() => this.headerTitleTemplate() || this.metadata.descriptor().title, /* @ts-ignore */
|
|
2609
|
+
...(ngDevMode ? [{ debugName: "hasTitleDisplay" }] : /* istanbul ignore next */ []));
|
|
2610
|
+
this.isCaptionVisible = computed(() => this.headerTemplate() || this.hasTitleDisplay() || this.tableHeaderFilters().length > 0 || this.metadata.descriptor().search, /* @ts-ignore */
|
|
2611
|
+
...(ngDevMode ? [{ debugName: "isCaptionVisible" }] : /* istanbul ignore next */ []));
|
|
2606
2612
|
// component inputs
|
|
2607
|
-
this.globalFilterFieldsInput = input(undefined, { ...(ngDevMode ? { debugName: "globalFilterFieldsInput" } : {}), alias: 'globalFilterFields' });
|
|
2613
|
+
this.globalFilterFieldsInput = input(undefined, { ...(ngDevMode ? { debugName: "globalFilterFieldsInput" } : /* istanbul ignore next */ {}), alias: 'globalFilterFields' });
|
|
2608
2614
|
// cell click
|
|
2609
2615
|
this.cellClickSubject = new Subject();
|
|
2610
|
-
this.isCellClickObserved = signal(this.cellClickSubject.observed,
|
|
2611
|
-
|
|
2616
|
+
this.isCellClickObserved = signal(this.cellClickSubject.observed, /* @ts-ignore */
|
|
2617
|
+
...(ngDevMode ? [{ debugName: "isCellClickObserved" }] : /* istanbul ignore next */ []));
|
|
2618
|
+
this.isCellClickEnabled = computed(() => this.cellClickEnabled() && this.isCellClickObserved(), /* @ts-ignore */
|
|
2619
|
+
...(ngDevMode ? [{ debugName: "isCellClickEnabled" }] : /* istanbul ignore next */ []));
|
|
2612
2620
|
// event outputs
|
|
2613
2621
|
this.tableLoad = output();
|
|
2614
2622
|
this.cellClick = outputFromObservable(this.cellClickSubject);
|
|
@@ -2618,23 +2626,38 @@ class TableComponent {
|
|
|
2618
2626
|
this.searchChange = output();
|
|
2619
2627
|
this.sortChange = output();
|
|
2620
2628
|
// content and view queries
|
|
2621
|
-
this.templates = input([],
|
|
2622
|
-
|
|
2623
|
-
this.
|
|
2624
|
-
|
|
2625
|
-
this.
|
|
2629
|
+
this.templates = input([], /* @ts-ignore */
|
|
2630
|
+
...(ngDevMode ? [{ debugName: "templates" }] : /* istanbul ignore next */ []));
|
|
2631
|
+
this.contentTemplates = contentChildren(TableTemplateDirective, /* @ts-ignore */
|
|
2632
|
+
...(ngDevMode ? [{ debugName: "contentTemplates" }] : /* istanbul ignore next */ []));
|
|
2633
|
+
this.optimusTable = viewChild((Table), /* @ts-ignore */
|
|
2634
|
+
...(ngDevMode ? [{ debugName: "optimusTable" }] : /* istanbul ignore next */ []));
|
|
2635
|
+
this.rowSelectCheckboxes = viewChildren(TableCheckbox, /* @ts-ignore */
|
|
2636
|
+
...(ngDevMode ? [{ debugName: "rowSelectCheckboxes" }] : /* istanbul ignore next */ []));
|
|
2637
|
+
this.rowSelectRadioButtons = viewChildren(TableRadioButton, /* @ts-ignore */
|
|
2638
|
+
...(ngDevMode ? [{ debugName: "rowSelectRadioButtons" }] : /* istanbul ignore next */ []));
|
|
2626
2639
|
// templates
|
|
2627
|
-
this.#templatesMerged = computed(() => [...this.contentTemplates(), ...this.templates()],
|
|
2628
|
-
|
|
2629
|
-
this.
|
|
2630
|
-
|
|
2631
|
-
this.
|
|
2632
|
-
|
|
2633
|
-
this.
|
|
2634
|
-
|
|
2640
|
+
this.#templatesMerged = computed(() => [...this.contentTemplates(), ...this.templates()], /* @ts-ignore */
|
|
2641
|
+
...(ngDevMode ? [{ debugName: "#templatesMerged" }] : /* istanbul ignore next */ []));
|
|
2642
|
+
this.headerTemplate = computed(() => findTemplateByName([...this.#templatesMerged()], 'header'), /* @ts-ignore */
|
|
2643
|
+
...(ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []));
|
|
2644
|
+
this.headerTitleTemplate = computed(() => findTemplateByName([...this.#templatesMerged()], 'headerTitle'), /* @ts-ignore */
|
|
2645
|
+
...(ngDevMode ? [{ debugName: "headerTitleTemplate" }] : /* istanbul ignore next */ []));
|
|
2646
|
+
this.titleRowRightTemplate = computed(() => findTemplateByName([...this.#templatesMerged()], 'headerTitleRowRight'), /* @ts-ignore */
|
|
2647
|
+
...(ngDevMode ? [{ debugName: "titleRowRightTemplate" }] : /* istanbul ignore next */ []));
|
|
2648
|
+
this.columnCustomLastTemplate = computed(() => findTemplateByName([...this.#templatesMerged()], 'columnCustomLast'), /* @ts-ignore */
|
|
2649
|
+
...(ngDevMode ? [{ debugName: "columnCustomLastTemplate" }] : /* istanbul ignore next */ []));
|
|
2650
|
+
this.footerTemplate = computed(() => findTemplateByName([...this.#templatesMerged()], 'footer'), /* @ts-ignore */
|
|
2651
|
+
...(ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []));
|
|
2652
|
+
this.rowExpandTemplate = computed(() => findTemplateByName([...this.#templatesMerged()], 'rowExpandContent'), /* @ts-ignore */
|
|
2653
|
+
...(ngDevMode ? [{ debugName: "rowExpandTemplate" }] : /* istanbul ignore next */ []));
|
|
2654
|
+
this.columnHeaderTemplate = computed(() => findTemplateByName([...this.#templatesMerged()], 'columnHeader'), /* @ts-ignore */
|
|
2655
|
+
...(ngDevMode ? [{ debugName: "columnHeaderTemplate" }] : /* istanbul ignore next */ []));
|
|
2635
2656
|
// data provider and items
|
|
2636
|
-
this.isLazy = computed(() => this.dataProvider()?.isLazy === true,
|
|
2637
|
-
|
|
2657
|
+
this.isLazy = computed(() => this.dataProvider()?.isLazy === true, /* @ts-ignore */
|
|
2658
|
+
...(ngDevMode ? [{ debugName: "isLazy" }] : /* istanbul ignore next */ []));
|
|
2659
|
+
this.isPagination = computed(() => this.data.paginationMode() === TablePaginationModeEnum.Pagination, /* @ts-ignore */
|
|
2660
|
+
...(ngDevMode ? [{ debugName: "isPagination" }] : /* istanbul ignore next */ []));
|
|
2638
2661
|
// visual
|
|
2639
2662
|
this.className = computed(() => {
|
|
2640
2663
|
let className = this.metadata.descriptor().className ?? '';
|
|
@@ -2651,17 +2674,22 @@ class TableComponent {
|
|
|
2651
2674
|
className += ' p-datatable-gridlines';
|
|
2652
2675
|
}
|
|
2653
2676
|
return className;
|
|
2654
|
-
},
|
|
2677
|
+
}, /* @ts-ignore */
|
|
2678
|
+
...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
2655
2679
|
// columns
|
|
2656
|
-
this.visibleColumns = computed(() => this.prefs.columnsWithPrefs().filter(col => col.isVisible),
|
|
2657
|
-
|
|
2658
|
-
this.
|
|
2680
|
+
this.visibleColumns = computed(() => this.prefs.columnsWithPrefs().filter(col => col.isVisible), /* @ts-ignore */
|
|
2681
|
+
...(ngDevMode ? [{ debugName: "visibleColumns" }] : /* istanbul ignore next */ []));
|
|
2682
|
+
this.areColumnsReorderable = computed(() => this.prefs.columnsWithPrefs().some(col => col.descriptor.isReorderable ?? this.metadata.tableConfig()?.columnReorder), /* @ts-ignore */
|
|
2683
|
+
...(ngDevMode ? [{ debugName: "areColumnsReorderable" }] : /* istanbul ignore next */ []));
|
|
2684
|
+
this.areColumnsToggleable = computed(() => this.prefs.columnsWithPrefs().some(col => col.descriptor.isToggleable ?? this.metadata.tableConfig()?.columnVisibilityToggle), /* @ts-ignore */
|
|
2685
|
+
...(ngDevMode ? [{ debugName: "areColumnsToggleable" }] : /* istanbul ignore next */ []));
|
|
2659
2686
|
// filter, sort
|
|
2660
2687
|
this.hasColumnFilters = computed(() => {
|
|
2661
2688
|
const defaultFilterDisplayType = this.metadata.defaultFilterDisplayType();
|
|
2662
2689
|
return ((defaultFilterDisplayType === FilterDisplayTypeEnum.OverlayWithTag && this.metadata.filterDescriptors().some(d => d.displayType === FilterDisplayTypeEnum.Column)) ||
|
|
2663
2690
|
(defaultFilterDisplayType === FilterDisplayTypeEnum.Column && this.metadata.filterDescriptors().some(d => d.displayType == null)));
|
|
2664
|
-
},
|
|
2691
|
+
}, /* @ts-ignore */
|
|
2692
|
+
...(ngDevMode ? [{ debugName: "hasColumnFilters" }] : /* istanbul ignore next */ []));
|
|
2665
2693
|
this.tableHeaderFilters = computed(() => {
|
|
2666
2694
|
// statically defined filters AND generic filters
|
|
2667
2695
|
const defaultFilterDisplayType = this.metadata.defaultFilterDisplayType();
|
|
@@ -2670,7 +2698,8 @@ class TableComponent {
|
|
|
2670
2698
|
.filter(d => (d.descriptor.displayType == null && [FilterDisplayTypeEnum.OverlayWithTag, FilterDisplayTypeEnum.DirectInput].includes(defaultFilterDisplayType)) ||
|
|
2671
2699
|
(d.descriptor.displayType != null && [FilterDisplayTypeEnum.OverlayWithTag, FilterDisplayTypeEnum.DirectInput].includes(d.descriptor.displayType)));
|
|
2672
2700
|
return filters.concat(this.metadata.genericFilters());
|
|
2673
|
-
},
|
|
2701
|
+
}, /* @ts-ignore */
|
|
2702
|
+
...(ngDevMode ? [{ debugName: "tableHeaderFilters" }] : /* istanbul ignore next */ []));
|
|
2674
2703
|
this.requiredFiltersMissing = computed(() => {
|
|
2675
2704
|
const paramsWithDefaults = this.data.params() ?? this.metadata.defaultParams();
|
|
2676
2705
|
const requiredFilters = this.metadata
|
|
@@ -2683,12 +2712,14 @@ class TableComponent {
|
|
|
2683
2712
|
filter.matchMode === undefined ||
|
|
2684
2713
|
(!['exists', 'doesNotExist'].includes(filter.matchMode) && isFilterValueBlank(filter.value)));
|
|
2685
2714
|
});
|
|
2686
|
-
},
|
|
2687
|
-
|
|
2715
|
+
}, /* @ts-ignore */
|
|
2716
|
+
...(ngDevMode ? [{ debugName: "requiredFiltersMissing" }] : /* istanbul ignore next */ []));
|
|
2717
|
+
this.hasLastColumn = computed(() => this.columnCustomLastTemplate() || this.areColumnsToggleable() || this.areColumnsReorderable(), /* @ts-ignore */
|
|
2718
|
+
...(ngDevMode ? [{ debugName: "hasLastColumn" }] : /* istanbul ignore next */ []));
|
|
2688
2719
|
// other
|
|
2689
2720
|
this.navigationOutOfTableInProgress = false;
|
|
2690
2721
|
this.navigationInTableInProgress = false;
|
|
2691
|
-
effectWithDeps([this.
|
|
2722
|
+
effectWithDeps([this.optimusTable], ([table]) => this.data.setOptimusTable(table));
|
|
2692
2723
|
effectWithDeps([this.dataProvider], ([dataProvider]) => {
|
|
2693
2724
|
if (dataProvider?.isLazy === false) {
|
|
2694
2725
|
this.loadTableWithDataProvider(this.metadata.defaultParams());
|
|
@@ -2730,6 +2761,7 @@ class TableComponent {
|
|
|
2730
2761
|
this.data.setDataSources(this.items, this.result, this.dataProvider, this.loadingInput);
|
|
2731
2762
|
}
|
|
2732
2763
|
reload(emitEvent) {
|
|
2764
|
+
// eslint-disable-next-line sonarjs/no-nested-conditional
|
|
2733
2765
|
const params = emitEvent?.params ? emitEvent?.params : emitEvent?.resetParams ? undefined : this.lastParamsWithDefaults;
|
|
2734
2766
|
const reloadParams = mergeDataListParamsWithDefaults(params ?? {}, this.metadata.defaultParams());
|
|
2735
2767
|
this.loadTableWithDataProvider(reloadParams, emitEvent?.emitEvent ?? false);
|
|
@@ -2869,7 +2901,7 @@ class TableComponent {
|
|
|
2869
2901
|
}
|
|
2870
2902
|
#navigateWithNewParams(params) {
|
|
2871
2903
|
if (!this.navigationOutOfTableInProgress && !this.navigationInTableInProgress) {
|
|
2872
|
-
// this check is necessary: from some reason,
|
|
2904
|
+
// this check is necessary: from some reason, Optimus UI commits one last lazy load event whenever any angular router navigation occurs
|
|
2873
2905
|
this.navigationInTableInProgress = true;
|
|
2874
2906
|
const queryParamPrepend = this.queryParamPrepend();
|
|
2875
2907
|
const newParams = dataListParamsToUrlQuery(params, this.metadata.defaultParams(), {
|
|
@@ -2909,16 +2941,20 @@ class TableComponent {
|
|
|
2909
2941
|
});
|
|
2910
2942
|
}
|
|
2911
2943
|
}
|
|
2912
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2913
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2944
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2945
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: TableComponent, isStandalone: true, selector: "mng-table", inputs: { descriptorInput: { classPropertyName: "descriptorInput", publicName: "descriptor", isSignal: true, isRequired: true, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, result: { classPropertyName: "result", publicName: "result", isSignal: true, isRequired: false, transformFunction: null }, loadingInput: { classPropertyName: "loadingInput", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, dataProvider: { classPropertyName: "dataProvider", publicName: "dataProvider", isSignal: true, isRequired: false, transformFunction: null }, queryParamPrepend: { classPropertyName: "queryParamPrepend", publicName: "queryParamPrepend", isSignal: true, isRequired: false, transformFunction: null }, useQueryParams: { classPropertyName: "useQueryParams", publicName: "useQueryParams", isSignal: true, isRequired: false, transformFunction: null }, cellClickEnabled: { classPropertyName: "cellClickEnabled", publicName: "cellClickEnabled", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, selectionEnabled: { classPropertyName: "selectionEnabled", publicName: "selectionEnabled", isSignal: true, isRequired: false, transformFunction: null }, rowReorderEnabledInput: { classPropertyName: "rowReorderEnabledInput", publicName: "rowReorderEnabled", isSignal: true, isRequired: false, transformFunction: null }, featureConfig: { classPropertyName: "featureConfig", publicName: "featureConfig", isSignal: true, isRequired: false, transformFunction: null }, columnLastMinWidth: { classPropertyName: "columnLastMinWidth", publicName: "columnLastMinWidth", isSignal: true, isRequired: false, transformFunction: null }, globalFilterFieldsInput: { classPropertyName: "globalFilterFieldsInput", publicName: "globalFilterFields", isSignal: true, isRequired: false, transformFunction: null }, templates: { classPropertyName: "templates", publicName: "templates", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tableLoad: "tableLoad", cellClick: "cellClick", selectionChange: "selectionChange", rowReorder: "rowReorder", filterChange: "filterChange", searchChange: "searchChange", sortChange: "sortChange" }, host: { properties: { "class.mng-table-no-header": "!isCaptionVisible()" } }, providers: [
|
|
2914
2946
|
TableMetadataService,
|
|
2915
2947
|
TableDataService,
|
|
2916
2948
|
{ provide: ADataListService, useExisting: TableDataService },
|
|
2917
2949
|
{ provide: ADataListMetaService, useExisting: TableMetadataService },
|
|
2918
2950
|
TablePreferencesService
|
|
2919
|
-
], queries: [{ propertyName: "contentTemplates", predicate: TableTemplateDirective, isSignal: true }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: (Table), descendants: true, isSignal: true }, { propertyName: "rowSelectCheckboxes", predicate: TableCheckbox, descendants: true, isSignal: true }, { propertyName: "rowSelectRadioButtons", predicate: TableRadioButton, descendants: true, isSignal: true }], ngImport: i0, template: "<div>\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n @if (data.isAllPaginationMetaInitialized()) {\n <p-table\n [value]=\"requiredFiltersMissing() ? [] : data.data()\"\n [dataKey]=\"metadata.descriptor().trackProperty\"\n [lazy]=\"isLazy()\"\n [loading]=\"data.loading()\"\n [paginator]=\"isPagination()\"\n [rows]=\"data.rows()\"\n [first]=\"data.offset()\"\n [totalRecords]=\"data.count()\"\n [rowsPerPageOptions]=\"metadata.rowsPerPageOptions()\"\n [showCurrentPageReport]=\"true\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"data.sortStates()\"\n [filters]=\"data.primeFilterStates()\"\n [globalFilterFields]=\"metadata.searchFields()\"\n sortMode=\"multiple\"\n [selection]=\"data.selectedItems()\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"selectionEnabled() ? selectionMode() : null\"\n [scrollable]=\"true\"\n scrollHeight=\"flex\"\n [rowHover]=\"metadata.descriptor().hasHover\"\n [styleClass]=\"className()\"\n [resizableColumns]=\"metadata.descriptor().hasResizableColumns ?? metadata.tableConfig().columnResize ?? false\"\n [columnResizeMode]=\"metadata.descriptor().columnResizeMode ?? metadata.tableConfig().columnResizeMode ?? 'expand'\"\n [reorderableColumns]=\"areColumnsReorderable()\"\n paginatorDropdownAppendTo=\"body\"\n [columns]=\"visibleColumns()\"\n [expandedRowKeys]=\"expandedRowKeys()\"\n (onColResize)=\"prefs.onColumnResize($event)\"\n (onColReorder)=\"prefs.onColumnReorder($event)\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onFilter)=\"onTableFilter($event)\"\n (sortChange)=\"onTableSort($event)\"\n (onPage)=\"onTablePage($event)\"\n (onRowReorder)=\"onRowReorder($event)\"\n mngRemovableSort>\n <ng-template #caption>\n @if (isCaptionVisible()) {\n <div class=\"table-header\">\n @if (headerTemplate()) {\n <ng-container *ngTemplateOutlet=\"headerTemplate(); context: {data: data.data(), totalCount: data.count(), table: this}\"></ng-container>\n } @else {\n <mng-table-header-with-filters\n [metadata]=\"tableHeaderFilters()\"\n [genericFilterDescriptor]=\"metadata.genericFilterDescriptor()\"\n [model]=\"metadata.descriptor().model\"\n [enableSearch]=\"metadata.descriptor().search\"\n [search]=\"data.searchState()\"\n [searchLimitWordMax]=\"metadata.descriptor().searchLimitMaxWords\"\n [enableCaseSensitive]=\"isLazy()\">\n @if (hasTitleDisplay()) {\n <ng-template mngTableHeaderWithFiltersTemplate name=\"title\">\n @if (headerTitleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"headerTitleTemplate(); context: {data: data.data(), totalCount: data.count(), table: this}\"></ng-container>\n } @else if (metadata.descriptor().title) {\n <h5 class=\"p-0 m-0\">{{ metadata.descriptor().title! | translate }}</h5>\n }\n </ng-template>\n }\n @if (titleRowRightTemplate()) {\n <ng-template mngTableHeaderWithFiltersTemplate name=\"titleRowRight\">\n <ng-container *ngTemplateOutlet=\"titleRowRightTemplate()\"></ng-container>\n </ng-template>\n }\n </mng-table-header-with-filters>\n }\n </div>\n }\n </ng-template>\n <ng-template #header>\n @if (!metadata.descriptor().hideHeader) {\n <tr class=\"mng-table-header\" [class]=\"metadata.descriptor().headerClassName\">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableHeaderCheckbox />\n </th>\n } @else {\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\"></th>\n }\n }\n @if (metadata.descriptor().rowExpandable) {\n <th scope=\"col\" pFrozenColumn [frozen]=\"true\"></th>\n }\n @if (rowReorderEnabled()) {\n <th scope=\"col\"></th>\n }\n @for (col of visibleColumns(); track col.id) {\n <ng-template #sortableColumnTHTemplate>\n @if (columnHeaderTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n columnHeaderTemplate();\n context: {data: data.data(), totalCount: data.count(), property: col.descriptor.property, table: this}\n \"></ng-container>\n } @else {\n <div class=\"flex justify-between items-center\">\n {{\n (col.descriptor.title && !col.descriptor.titleUseModelBase\n ? col.descriptor.title\n : (col.descriptor.title ?? col.descriptor.property | mngI18nProperty: metadata.descriptor().model)\n ) | translate\n }}\n <p-sortIcon [field]=\"col.sort?.property\" class=\"flex\"></p-sortIcon>\n </div>\n }\n </ng-template>\n <ng-template #nonSortableColumnTHTemplate>\n @if (columnHeaderTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n columnHeaderTemplate();\n context: {data: data.data(), totalCount: data.count(), property: col.descriptor.property, table: this}\n \"></ng-container>\n } @else {\n {{\n (col.descriptor.title && !col.descriptor.titleUseModelBase\n ? col.descriptor.title\n : (col.descriptor.title ?? col.descriptor.property | mngI18nProperty: metadata.descriptor().model)\n ) | translate\n }}\n }\n </ng-template>\n @if (col.reorderable) {\n <th\n pResizableColumn\n pReorderableColumn\n [id]=\"col.descriptor.property\"\n [pSortableColumn]=\"col.sort?.property\"\n [pSortableColumnDisabled]=\"!col.sort\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\"\n [class]=\"col.descriptor.headerClassName | mngTableFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\">\n <ng-container *ngTemplateOutlet=\"col.sort ? sortableColumnTHTemplate : nonSortableColumnTHTemplate\"></ng-container>\n </th>\n } @else {\n <th\n pResizableColumn\n [id]=\"col.descriptor.property\"\n [pSortableColumn]=\"col.sort?.property\"\n [pSortableColumnDisabled]=\"!col.sort\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\"\n [class]=\"col.descriptor.headerClassName | mngTableFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\">\n <ng-container *ngTemplateOutlet=\"col.sort ? sortableColumnTHTemplate : nonSortableColumnTHTemplate\"></ng-container>\n </th>\n }\n }\n @if (hasLastColumn()) {\n <th\n [style.min-width.px]=\"columnLastMinWidth()\"\n pFrozenColumn\n [frozen]=\"metadata.descriptor().actionColumnFrozen ?? areColumnsToggleable()\"\n alignFrozen=\"right\"\n class=\"mng-table-column-custom-last text-right!\">\n @if (areColumnsToggleable()) {\n @defer (on idle) {\n <mng-table-column-toggle [columns]=\"visibleColumns()\" />\n }\n }\n </th>\n }\n </tr>\n }\n @if (hasColumnFilters()) {\n <tr class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n @if (selectionEnabled()) {\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\"></th>\n }\n @if (rowReorderEnabled()) {\n <th scope=\"col\"></th>\n }\n @if (metadata.descriptor().rowExpandable) {\n <th scope=\"col\"></th>\n }\n @for (col of visibleColumns(); track col.id) {\n <th\n [class]=\"'px-1! ' + col.filter?.descriptor?.columnClassName | mngTableFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\"\n [style.width.px]=\"col.width\"\n [style.width.%]=\"col.width ? null : (col.filter?.descriptor?.columnWidth ?? col.descriptor.width ?? null)\"\n [style.min-width.px]=\"col.width ? null : (col.filter?.descriptor?.columnMinWidth ?? col.descriptor.minWidth)\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\">\n @if (col.filter && col.filter.descriptor.filterType !== FilterTypeEnum.Component) {\n @defer (on idle) {\n <mng-table-filter [config]=\"col.filter\" [model]=\"metadata.descriptor().model\"></mng-table-filter>\n }\n } @else if (col.filter && col.filter.descriptor.customComponentType) {\n <ng-container [mngComponent]=\"col.filter.descriptor.customComponentType\" [inputs]=\"{descriptor: col.filter.descriptor}\"></ng-container>\n }\n </th>\n }\n @if (hasLastColumn()) {\n <th pFrozenColumn alignFrozen=\"right\" class=\"mng-table-column-custom-last\" [style.min-width.px]=\"columnLastMinWidth()\"></th>\n }\n </tr>\n }\n </ng-template>\n <ng-template #body let-item let-idx=\"rowIndex\" let-expanded=\"expanded\">\n <tr\n (click)=\"onRowClick($event, item)\"\n [pReorderableRow]=\"idx\"\n [ngClass]=\"\n metadata.descriptor().rowClassName | mngClassMap: metadata.descriptor().rowClassNameMapFn : item | mngLocaleDefaultRowClass: metadata.descriptor() : item\n \">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableCheckbox (click)=\"$event.stopPropagation()\" [value]=\"item\"></p-tableCheckbox>\n </td>\n } @else {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableRadioButton (click)=\"$event.stopPropagation()\" [value]=\"item\"></p-tableRadioButton>\n </td>\n }\n }\n @if (metadata.descriptor().rowExpandable) {\n <td>\n @let expandProp = metadata.descriptor().rowExpandableProperty;\n @if (!expandProp || item[expandProp]) {\n <button\n pButton\n type=\"button\"\n [pRowToggler]=\"item\"\n rounded=\"true\"\n text=\"true\"\n size=\"small\"\n [icon]=\"expanded ? 'pi pi-chevron-down' : 'pi pi-chevron-right'\"></button>\n }\n </td>\n }\n @if (rowReorderEnabled()) {\n <td>\n <span class=\"pi pi-bars\" pReorderableRowHandle></span>\n </td>\n }\n @for (col of visibleColumns(); track col.id) {\n <td\n (click)=\"onCellClick($event, col.descriptor, item, idx)\"\n [class]=\"\n col.descriptor.className\n | mngClassMap: col.descriptor.classNameMapFn : item\n | mngTableFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\n \"\n [class.clickable]=\"isCellClickEnabled()\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\">\n <mng-table-column-value [descriptor]=\"col.descriptor\" [item]=\"item\"></mng-table-column-value>\n </td>\n }\n @if (hasLastColumn()) {\n <td\n class=\"mng-table-column-custom-last justify-end text-right!\"\n [style.min-width.px]=\"columnLastMinWidth()\"\n pFrozenColumn\n alignFrozen=\"right\"\n [frozen]=\"metadata.descriptor().actionColumnFrozen ?? true\">\n @if (columnCustomLastTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n columnCustomLastTemplate();\n context: {item: item, index: idx, data: data.data(), totalCount: data.count(), table: this}\n \"></ng-container>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #expandedrow let-item let-idx=\"rowIndex\">\n @if (metadata.descriptor().rowExpandable) {\n <tr>\n <td></td>\n <td [colSpan]=\"metadata.descriptor().rowExpandableColSpan\">\n @if (metadata.descriptor().rowExpandableComponentType !== undefined) {\n <ng-container [mngComponent]=\"metadata.descriptor().rowExpandableComponentType\" [inputs]=\"{item}\"> </ng-container>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n rowExpandTemplate();\n context: {item: item, index: idx, data: data.data(), totalCount: data.count(), table: this}\n \"></ng-container>\n }\n </td>\n </tr>\n }\n </ng-template>\n <ng-template #loadingicon>\n <div class=\"flex flex-col items-center\">\n @if (metadata.descriptor().loadingIcon) {\n <i [class]=\"'text-white text-4xl pi-spin ' + metadata.descriptor().loadingIcon\"></i>\n }\n @if (metadata.descriptor().loadingText) {\n <div class=\"text text-white text-lg font-semibold\" [ngClass]=\"{'mt-3': metadata.descriptor().loadingIcon}\">\n {{ metadata.descriptor().loadingText ?? '' | translate }}\n </div>\n }\n </div>\n </ng-template>\n <ng-template #loadingbody>\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n <div class=\"loading-text\"></div>\n <p-skeleton width=\"100%\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n @if (requiredFiltersMissing()) {\n <i class=\"pi pi-exclamation-triangle mr-2\"></i> <strong>{{ 'mngTable.requiredFiltersMissing' | translate }}</strong>\n } @else {\n {{ 'mngTable.noItems' | translate }}\n }\n </td>\n </tr>\n </ng-template>\n @if (footerTemplate()) {\n <ng-template #summary>\n <ng-container *ngTemplateOutlet=\"footerTemplate(); context: {data: data.data(), totalCount: data.count(), table: this}\"></ng-container>\n </ng-template>\n }\n </p-table>\n }\n</div>\n", styles: ["mng-table .p-datatable .p-datatable-header{border-top:0}mng-table .p-datatable:not(.p-datatable-gridlines) .p-datatable-tbody>tr>td{cursor:auto}mng-table .p-datatable:not(.p-datatable-gridlines) .p-datatable-tbody>tr>td.clickable{cursor:pointer}:is(mng-table .p-datatable .p-datatable-thead>tr>th,mng-table .p-datatable .p-datatable-tbody>tr>td):hover mng-table-column-value .help-buttons{display:block}mng-table .p-datatable .p-datatable-thead>tr>th.mng-table-column-custom-last{padding:var(--mng-table-column-head-custom-last, .1rem 1rem)}mng-table .p-datatable .p-datatable-tbody>tr>td{position:relative}mng-table .p-datatable .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding-top:.1rem;padding-bottom:.1rem}mng-table .p-datatable .p-datatable-tbody>tr>td.p-datatable-frozen-column{position:sticky;z-index:1;background:transparent}mng-table .p-datatable.p-datatable-lg .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding:var(--mng-table-column-body-custom-last, .15rem 1rem)}mng-table .p-datatable.p-datatable-sm .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding:var(--mng-table-sm-column-body-custom-last, .05rem 1rem)}mng-table .p-datatable.p-datatable-flex-scrollable .p-datatable-thead>tr>th{overflow:hidden;text-overflow:ellipsis}mng-table .p-datatable.p-datatable-flex-scrollable .p-datatable-tbody>tr>td{overflow:hidden}mng-table .p-datatable .mng-table-row-localization-default-locale{background:var(--p-surface-100)!important}mng-table .mng-table-header>th:not(:first-child):not(:last-child){border-radius:0!important}mng-table .mng-table-header>th:first-child{border-top-right-radius:0!important;border-bottom-right-radius:0!important}mng-table .mng-table-header>th:last-child{border-radius:0!important}mng-table .mng-table-header .mng-table-columns-multiselect{width:36px}mng-table .mng-table-header .mng-table-columns-multiselect .p-multiselect-label-container{width:0}mng-table.mng-table-no-header p-datatable .p-datatable-header{display:none}mng-table.mng-table-header-compact .p-datatable-header{padding:var(--mng-table-header-compact-padding, 0 0 .5rem 0)!important}\n"], dependencies: [{ kind: "directive", type: ComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "injectionToken", "inputs", "attachToHost", "parentInjector"], outputs: ["instanceCreated"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { kind: "component", type: TableHeaderWithFiltersComponent, selector: "mng-table-header-with-filters", inputs: ["metadata", "genericFilterDescriptor", "model", "enableSearch", "search", "searchLimitWordMax", "enableCaseSensitive"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i1$1.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i1$1.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i1$1.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "directive", type: i1$1.RowToggler, selector: "[pRowToggler]", inputs: ["pRowToggler", "pRowTogglerDisabled"] }, { kind: "directive", type: i1$1.ResizableColumn, selector: "[pResizableColumn]", inputs: ["pResizableColumnDisabled"] }, { kind: "directive", type: i1$1.ReorderableColumn, selector: "[pReorderableColumn]", inputs: ["pReorderableColumnDisabled"] }, { kind: "component", type: i1$1.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i1$1.TableRadioButton, selector: "p-tableRadioButton", inputs: ["value", "disabled", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i1$1.TableCheckbox, selector: "p-tableCheckbox", inputs: ["value", "disabled", "required", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i1$1.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "directive", type: i1$1.ReorderableRowHandle, selector: "[pReorderableRowHandle]" }, { kind: "directive", type: i1$1.ReorderableRow, selector: "[pReorderableRow]", inputs: ["pReorderableRow", "pReorderableRowDisabled"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "directive", type: TableRemovableSortDirective, selector: "[mngRemovableSort]", outputs: ["sortChange"] }, { kind: "directive", type: TableHeaderWithFiltersTemplateDirective, selector: "[mngTableHeaderWithFiltersTemplate]", inputs: ["name"] }, { kind: "pipe", type: I18nPropertyPipe, name: "mngI18nProperty" }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: ClassMapPipe, name: "mngClassMap" }, { kind: "pipe", type: LocaleDefaultRowClassPipe, name: "mngLocaleDefaultRowClass" }, { kind: "pipe", type: TableFilterClassPipe, name: "mngTableFilterClass" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None, deferBlockDependencies: [() => [import('./mediusinc-mng-commons-table-column-toggle.component-BS5xvoDR.mjs').then(m => m.TableColumnToggleComponent)], () => [Promise.resolve().then(function () { return filter_component; }).then(m => m.TableFilterComponent)]] }); }
|
|
2951
|
+
], queries: [{ propertyName: "contentTemplates", predicate: TableTemplateDirective, isSignal: true }], viewQueries: [{ propertyName: "optimusTable", first: true, predicate: (Table), descendants: true, isSignal: true }, { propertyName: "rowSelectCheckboxes", predicate: TableCheckbox, descendants: true, isSignal: true }, { propertyName: "rowSelectRadioButtons", predicate: TableRadioButton, descendants: true, isSignal: true }], ngImport: i0, template: "<div>\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n @if (data.isAllPaginationMetaInitialized()) {\n <p-table\n [value]=\"requiredFiltersMissing() ? [] : data.data()\"\n [dataKey]=\"metadata.descriptor().trackProperty\"\n [lazy]=\"isLazy()\"\n [loading]=\"data.loading()\"\n [paginator]=\"isPagination()\"\n [rows]=\"data.rows()\"\n [first]=\"data.offset()\"\n [totalRecords]=\"data.count()\"\n [rowsPerPageOptions]=\"metadata.rowsPerPageOptions()\"\n [showCurrentPageReport]=\"true\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"data.sortStates()\"\n [filters]=\"data.optimusFilterStates()\"\n [globalFilterFields]=\"metadata.searchFields()\"\n sortMode=\"multiple\"\n [selection]=\"data.selectedItems()\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"selectionEnabled() ? selectionMode() : null\"\n [scrollable]=\"true\"\n scrollHeight=\"flex\"\n [rowHover]=\"metadata.descriptor().hasHover\"\n [styleClass]=\"className()\"\n [resizableColumns]=\"metadata.descriptor().hasResizableColumns ?? metadata.tableConfig().columnResize ?? false\"\n [columnResizeMode]=\"metadata.descriptor().columnResizeMode ?? metadata.tableConfig().columnResizeMode ?? 'expand'\"\n [reorderableColumns]=\"areColumnsReorderable()\"\n paginatorDropdownAppendTo=\"body\"\n [columns]=\"visibleColumns()\"\n [expandedRowKeys]=\"expandedRowKeys()\"\n (onColResize)=\"prefs.onColumnResize($event)\"\n (onColReorder)=\"prefs.onColumnReorder($event)\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onFilter)=\"onTableFilter($event)\"\n (sortChange)=\"onTableSort($event)\"\n (onPage)=\"onTablePage($event)\"\n (onRowReorder)=\"onRowReorder($event)\"\n mngRemovableSort>\n <ng-template #caption>\n @if (isCaptionVisible()) {\n <div class=\"table-header\">\n @if (headerTemplate()) {\n <ng-container *ngTemplateOutlet=\"headerTemplate(); context: {data: data.data(), totalCount: data.count(), table: this}\"></ng-container>\n } @else {\n <mng-table-header-with-filters\n [metadata]=\"tableHeaderFilters()\"\n [genericFilterDescriptor]=\"metadata.genericFilterDescriptor()\"\n [model]=\"metadata.descriptor().model\"\n [enableSearch]=\"metadata.descriptor().search\"\n [search]=\"data.searchState()\"\n [searchLimitWordMax]=\"metadata.descriptor().searchLimitMaxWords\"\n [enableCaseSensitive]=\"isLazy()\">\n @if (hasTitleDisplay()) {\n <ng-template mngTableHeaderWithFiltersTemplate name=\"title\">\n @if (headerTitleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"headerTitleTemplate(); context: {data: data.data(), totalCount: data.count(), table: this}\"></ng-container>\n } @else if (metadata.descriptor().title) {\n <h5 class=\"p-0 m-0\">{{ metadata.descriptor().title! | translate }}</h5>\n }\n </ng-template>\n }\n @if (titleRowRightTemplate()) {\n <ng-template mngTableHeaderWithFiltersTemplate name=\"titleRowRight\">\n <ng-container *ngTemplateOutlet=\"titleRowRightTemplate()\"></ng-container>\n </ng-template>\n }\n </mng-table-header-with-filters>\n }\n </div>\n }\n </ng-template>\n <ng-template #header>\n @if (!metadata.descriptor().hideHeader) {\n <tr class=\"mng-table-header\" [class]=\"metadata.descriptor().headerClassName\">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableHeaderCheckbox />\n </th>\n } @else {\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\"></th>\n }\n }\n @if (metadata.descriptor().rowExpandable) {\n <th scope=\"col\" pFrozenColumn [frozen]=\"true\"></th>\n }\n @if (rowReorderEnabled()) {\n <th scope=\"col\"></th>\n }\n @for (col of visibleColumns(); track col.id) {\n <ng-template #sortableColumnTHTemplate>\n @if (columnHeaderTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n columnHeaderTemplate();\n context: {data: data.data(), totalCount: data.count(), property: col.descriptor.property, table: this}\n \"></ng-container>\n } @else {\n <div class=\"flex justify-between items-center\">\n {{\n (col.descriptor.title && !col.descriptor.titleUseModelBase\n ? col.descriptor.title\n : (col.descriptor.title ?? col.descriptor.property | mngI18nProperty: metadata.descriptor().model)\n ) | translate\n }}\n <p-sortIcon [field]=\"col.sort?.property\" class=\"flex\"></p-sortIcon>\n </div>\n }\n </ng-template>\n <ng-template #nonSortableColumnTHTemplate>\n @if (columnHeaderTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n columnHeaderTemplate();\n context: {data: data.data(), totalCount: data.count(), property: col.descriptor.property, table: this}\n \"></ng-container>\n } @else {\n {{\n (col.descriptor.title && !col.descriptor.titleUseModelBase\n ? col.descriptor.title\n : (col.descriptor.title ?? col.descriptor.property | mngI18nProperty: metadata.descriptor().model)\n ) | translate\n }}\n }\n </ng-template>\n @if (col.reorderable) {\n <th\n pResizableColumn\n pReorderableColumn\n [id]=\"col.descriptor.property\"\n [pSortableColumn]=\"col.sort?.property\"\n [pSortableColumnDisabled]=\"!col.sort\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\"\n [class]=\"col.descriptor.headerClassName | mngTableFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\">\n <ng-container *ngTemplateOutlet=\"col.sort ? sortableColumnTHTemplate : nonSortableColumnTHTemplate\"></ng-container>\n </th>\n } @else {\n <th\n pResizableColumn\n [id]=\"col.descriptor.property\"\n [pSortableColumn]=\"col.sort?.property\"\n [pSortableColumnDisabled]=\"!col.sort\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\"\n [class]=\"col.descriptor.headerClassName | mngTableFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\">\n <ng-container *ngTemplateOutlet=\"col.sort ? sortableColumnTHTemplate : nonSortableColumnTHTemplate\"></ng-container>\n </th>\n }\n }\n @if (hasLastColumn()) {\n <th\n [style.min-width.px]=\"columnLastMinWidth()\"\n pFrozenColumn\n [frozen]=\"metadata.descriptor().actionColumnFrozen ?? areColumnsToggleable()\"\n alignFrozen=\"right\"\n class=\"mng-table-column-custom-last text-right!\">\n @if (areColumnsToggleable()) {\n @defer (on idle) {\n <mng-table-column-toggle [columns]=\"visibleColumns()\" />\n }\n }\n </th>\n }\n </tr>\n }\n @if (hasColumnFilters()) {\n <tr class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n @if (selectionEnabled()) {\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\"></th>\n }\n @if (rowReorderEnabled()) {\n <th scope=\"col\"></th>\n }\n @if (metadata.descriptor().rowExpandable) {\n <th scope=\"col\"></th>\n }\n @for (col of visibleColumns(); track col.id) {\n <th\n [class]=\"'px-1! ' + col.filter?.descriptor?.columnClassName | mngTableFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\"\n [style.width.px]=\"col.width\"\n [style.width.%]=\"col.width ? null : (col.filter?.descriptor?.columnWidth ?? col.descriptor.width ?? null)\"\n [style.min-width.px]=\"col.width ? null : (col.filter?.descriptor?.columnMinWidth ?? col.descriptor.minWidth)\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\">\n @if (col.filter && col.filter.descriptor.filterType !== FilterTypeEnum.Component) {\n @defer (on idle) {\n <mng-table-filter [config]=\"col.filter\" [model]=\"metadata.descriptor().model\"></mng-table-filter>\n }\n } @else if (col.filter && col.filter.descriptor.customComponentType) {\n <ng-container [mngComponent]=\"col.filter.descriptor.customComponentType\" [inputs]=\"{descriptor: col.filter.descriptor}\"></ng-container>\n }\n </th>\n }\n @if (hasLastColumn()) {\n <th pFrozenColumn alignFrozen=\"right\" class=\"mng-table-column-custom-last\" [style.min-width.px]=\"columnLastMinWidth()\"></th>\n }\n </tr>\n }\n </ng-template>\n <ng-template #body let-item let-idx=\"rowIndex\" let-expanded=\"expanded\">\n <tr\n (click)=\"onRowClick($event, item)\"\n [pReorderableRow]=\"idx\"\n [ngClass]=\"\n metadata.descriptor().rowClassName | mngClassMap: metadata.descriptor().rowClassNameMapFn : item | mngLocaleDefaultRowClass: metadata.descriptor() : item\n \">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableCheckbox (click)=\"$event.stopPropagation()\" [value]=\"item\"></p-tableCheckbox>\n </td>\n } @else {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableRadioButton (click)=\"$event.stopPropagation()\" [value]=\"item\"></p-tableRadioButton>\n </td>\n }\n }\n @if (metadata.descriptor().rowExpandable) {\n <td>\n @let expandProp = metadata.descriptor().rowExpandableProperty;\n @if (!expandProp || item[expandProp]) {\n <button\n pButton\n type=\"button\"\n [pRowToggler]=\"item\"\n rounded=\"true\"\n text=\"true\"\n size=\"small\"\n [icon]=\"expanded ? 'pi pi-chevron-down' : 'pi pi-chevron-right'\"></button>\n }\n </td>\n }\n @if (rowReorderEnabled()) {\n <td>\n <span class=\"pi pi-bars\" pReorderableRowHandle></span>\n </td>\n }\n @for (col of visibleColumns(); track col.id) {\n <td\n (click)=\"onCellClick($event, col.descriptor, item, idx)\"\n [class]=\"\n col.descriptor.className\n | mngClassMap: col.descriptor.classNameMapFn : item\n | mngTableFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\n \"\n [class.clickable]=\"isCellClickEnabled()\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\">\n <mng-table-column-value [descriptor]=\"col.descriptor\" [item]=\"item\"></mng-table-column-value>\n </td>\n }\n @if (hasLastColumn()) {\n <td\n class=\"mng-table-column-custom-last justify-end text-right!\"\n [style.min-width.px]=\"columnLastMinWidth()\"\n pFrozenColumn\n alignFrozen=\"right\"\n [frozen]=\"metadata.descriptor().actionColumnFrozen ?? true\">\n @if (columnCustomLastTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n columnCustomLastTemplate();\n context: {item: item, index: idx, data: data.data(), totalCount: data.count(), table: this}\n \"></ng-container>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #expandedrow let-item let-idx=\"rowIndex\">\n @if (metadata.descriptor().rowExpandable) {\n <tr>\n <td></td>\n <td [colSpan]=\"metadata.descriptor().rowExpandableColSpan\">\n @if (metadata.descriptor().rowExpandableComponentType !== undefined) {\n <ng-container [mngComponent]=\"metadata.descriptor().rowExpandableComponentType\" [inputs]=\"{item}\"> </ng-container>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n rowExpandTemplate();\n context: {item: item, index: idx, data: data.data(), totalCount: data.count(), table: this}\n \"></ng-container>\n }\n </td>\n </tr>\n }\n </ng-template>\n <ng-template #loadingicon>\n <div class=\"flex flex-col items-center\">\n @if (metadata.descriptor().loadingIcon) {\n <i [class]=\"'text-white text-4xl pi-spin ' + metadata.descriptor().loadingIcon\"></i>\n }\n @if (metadata.descriptor().loadingText) {\n <div class=\"text text-white text-lg font-semibold\" [ngClass]=\"{'mt-3': metadata.descriptor().loadingIcon}\">\n {{ metadata.descriptor().loadingText ?? '' | translate }}\n </div>\n }\n </div>\n </ng-template>\n <ng-template #loadingbody>\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n <div class=\"loading-text\"></div>\n <p-skeleton width=\"100%\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n @if (requiredFiltersMissing()) {\n <i class=\"pi pi-exclamation-triangle mr-2\"></i> <strong>{{ 'mngTable.requiredFiltersMissing' | translate }}</strong>\n } @else {\n {{ 'mngTable.noItems' | translate }}\n }\n </td>\n </tr>\n </ng-template>\n @if (footerTemplate()) {\n <ng-template #summary>\n <ng-container *ngTemplateOutlet=\"footerTemplate(); context: {data: data.data(), totalCount: data.count(), table: this}\"></ng-container>\n </ng-template>\n }\n </p-table>\n }\n</div>\n", styles: ["mng-table .p-datatable .p-datatable-header{border-top:0}mng-table .p-datatable:not(.p-datatable-gridlines) .p-datatable-tbody>tr>td{cursor:auto}mng-table .p-datatable:not(.p-datatable-gridlines) .p-datatable-tbody>tr>td.clickable{cursor:pointer}:is(mng-table .p-datatable .p-datatable-thead>tr>th,mng-table .p-datatable .p-datatable-tbody>tr>td):hover mng-table-column-value .help-buttons{display:block}mng-table .p-datatable .p-datatable-thead>tr>th.mng-table-column-custom-last{padding:var(--mng-table-column-head-custom-last, .1rem 1rem)}mng-table .p-datatable .p-datatable-tbody>tr>td{position:relative}mng-table .p-datatable .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding-top:.1rem;padding-bottom:.1rem}mng-table .p-datatable .p-datatable-tbody>tr>td.p-datatable-frozen-column{position:sticky;z-index:1;background:transparent}mng-table .p-datatable.p-datatable-lg .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding:var(--mng-table-column-body-custom-last, .15rem 1rem)}mng-table .p-datatable.p-datatable-sm .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding:var(--mng-table-sm-column-body-custom-last, .05rem 1rem)}mng-table .p-datatable.p-datatable-flex-scrollable .p-datatable-thead>tr>th{overflow:hidden;text-overflow:ellipsis}mng-table .p-datatable.p-datatable-flex-scrollable .p-datatable-tbody>tr>td{overflow:hidden}mng-table .p-datatable .mng-table-row-localization-default-locale{background:var(--p-surface-100)!important}mng-table .mng-table-header>th:not(:first-child):not(:last-child){border-radius:0!important}mng-table .mng-table-header>th:first-child{border-top-right-radius:0!important;border-bottom-right-radius:0!important}mng-table .mng-table-header>th:last-child{border-radius:0!important}mng-table .mng-table-header .mng-table-columns-multiselect{width:36px}mng-table .mng-table-header .mng-table-columns-multiselect .p-multiselect-label-container{width:0}mng-table.mng-table-no-header p-datatable .p-datatable-header{display:none}mng-table.mng-table-header-compact .p-datatable-header{padding:var(--mng-table-header-compact-padding, 0 0 .5rem 0)!important}\n"], dependencies: [{ kind: "directive", type: ComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "injectionToken", "inputs", "attachToHost", "parentInjector"], outputs: ["instanceCreated"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { kind: "component", type: TableHeaderWithFiltersComponent, selector: "mng-table-header-with-filters", inputs: ["metadata", "genericFilterDescriptor", "model", "enableSearch", "search", "searchLimitWordMax", "enableCaseSensitive"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i1$1.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i1$1.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i1$1.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "directive", type: i1$1.RowToggler, selector: "[pRowToggler]", inputs: ["pRowToggler", "pRowTogglerDisabled"] }, { kind: "directive", type: i1$1.ResizableColumn, selector: "[pResizableColumn]", inputs: ["pResizableColumnDisabled"] }, { kind: "directive", type: i1$1.ReorderableColumn, selector: "[pReorderableColumn]", inputs: ["pReorderableColumnDisabled"] }, { kind: "component", type: i1$1.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i1$1.TableRadioButton, selector: "p-tableRadioButton", inputs: ["value", "disabled", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i1$1.TableCheckbox, selector: "p-tableCheckbox", inputs: ["value", "disabled", "required", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i1$1.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "directive", type: i1$1.ReorderableRowHandle, selector: "[pReorderableRowHandle]" }, { kind: "directive", type: i1$1.ReorderableRow, selector: "[pReorderableRow]", inputs: ["pReorderableRow", "pReorderableRowDisabled"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "directive", type: TableRemovableSortDirective, selector: "[mngRemovableSort]", outputs: ["sortChange"] }, { kind: "directive", type: TableHeaderWithFiltersTemplateDirective, selector: "[mngTableHeaderWithFiltersTemplate]", inputs: ["name"] }, { kind: "pipe", type: I18nPropertyPipe, name: "mngI18nProperty" }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: ClassMapPipe, name: "mngClassMap" }, { kind: "pipe", type: LocaleDefaultRowClassPipe, name: "mngLocaleDefaultRowClass" }, { kind: "pipe", type: TableFilterClassPipe, name: "mngTableFilterClass" }], encapsulation: i0.ViewEncapsulation.None, deferBlockDependencies: [() => [/* @ts-ignore */
|
|
2952
|
+
import('./mediusinc-mng-commons-table-column-toggle.component-BHIzrUZz.mjs').then(m => m.TableColumnToggleComponent)], () => [/* @ts-ignore */
|
|
2953
|
+
Promise.resolve().then(function () { return filter_component; }).then(m => m.TableFilterComponent)]] }); }
|
|
2920
2954
|
}
|
|
2921
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "
|
|
2955
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.1.4", ngImport: i0, type: TableComponent, resolveDeferredDeps: () => [/* @ts-ignore */
|
|
2956
|
+
import('./mediusinc-mng-commons-table-column-toggle.component-BHIzrUZz.mjs').then(m => m.TableColumnToggleComponent), /* @ts-ignore */
|
|
2957
|
+
Promise.resolve().then(function () { return filter_component; }).then(m => m.TableFilterComponent)], resolveMetadata: (TableColumnToggleComponent, TableFilterComponent) => ({ decorators: [{
|
|
2922
2958
|
type: Component,
|
|
2923
2959
|
args: [{ selector: 'mng-table', imports: [
|
|
2924
2960
|
ComponentDirective,
|
|
@@ -2947,8 +2983,8 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.0.8", ng
|
|
|
2947
2983
|
TablePreferencesService
|
|
2948
2984
|
], host: {
|
|
2949
2985
|
'[class.mng-table-no-header]': '!isCaptionVisible()'
|
|
2950
|
-
}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div>\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n @if (data.isAllPaginationMetaInitialized()) {\n <p-table\n [value]=\"requiredFiltersMissing() ? [] : data.data()\"\n [dataKey]=\"metadata.descriptor().trackProperty\"\n [lazy]=\"isLazy()\"\n [loading]=\"data.loading()\"\n [paginator]=\"isPagination()\"\n [rows]=\"data.rows()\"\n [first]=\"data.offset()\"\n [totalRecords]=\"data.count()\"\n [rowsPerPageOptions]=\"metadata.rowsPerPageOptions()\"\n [showCurrentPageReport]=\"true\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"data.sortStates()\"\n [filters]=\"data.primeFilterStates()\"\n [globalFilterFields]=\"metadata.searchFields()\"\n sortMode=\"multiple\"\n [selection]=\"data.selectedItems()\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"selectionEnabled() ? selectionMode() : null\"\n [scrollable]=\"true\"\n scrollHeight=\"flex\"\n [rowHover]=\"metadata.descriptor().hasHover\"\n [styleClass]=\"className()\"\n [resizableColumns]=\"metadata.descriptor().hasResizableColumns ?? metadata.tableConfig().columnResize ?? false\"\n [columnResizeMode]=\"metadata.descriptor().columnResizeMode ?? metadata.tableConfig().columnResizeMode ?? 'expand'\"\n [reorderableColumns]=\"areColumnsReorderable()\"\n paginatorDropdownAppendTo=\"body\"\n [columns]=\"visibleColumns()\"\n [expandedRowKeys]=\"expandedRowKeys()\"\n (onColResize)=\"prefs.onColumnResize($event)\"\n (onColReorder)=\"prefs.onColumnReorder($event)\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onFilter)=\"onTableFilter($event)\"\n (sortChange)=\"onTableSort($event)\"\n (onPage)=\"onTablePage($event)\"\n (onRowReorder)=\"onRowReorder($event)\"\n mngRemovableSort>\n <ng-template #caption>\n @if (isCaptionVisible()) {\n <div class=\"table-header\">\n @if (headerTemplate()) {\n <ng-container *ngTemplateOutlet=\"headerTemplate(); context: {data: data.data(), totalCount: data.count(), table: this}\"></ng-container>\n } @else {\n <mng-table-header-with-filters\n [metadata]=\"tableHeaderFilters()\"\n [genericFilterDescriptor]=\"metadata.genericFilterDescriptor()\"\n [model]=\"metadata.descriptor().model\"\n [enableSearch]=\"metadata.descriptor().search\"\n [search]=\"data.searchState()\"\n [searchLimitWordMax]=\"metadata.descriptor().searchLimitMaxWords\"\n [enableCaseSensitive]=\"isLazy()\">\n @if (hasTitleDisplay()) {\n <ng-template mngTableHeaderWithFiltersTemplate name=\"title\">\n @if (headerTitleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"headerTitleTemplate(); context: {data: data.data(), totalCount: data.count(), table: this}\"></ng-container>\n } @else if (metadata.descriptor().title) {\n <h5 class=\"p-0 m-0\">{{ metadata.descriptor().title! | translate }}</h5>\n }\n </ng-template>\n }\n @if (titleRowRightTemplate()) {\n <ng-template mngTableHeaderWithFiltersTemplate name=\"titleRowRight\">\n <ng-container *ngTemplateOutlet=\"titleRowRightTemplate()\"></ng-container>\n </ng-template>\n }\n </mng-table-header-with-filters>\n }\n </div>\n }\n </ng-template>\n <ng-template #header>\n @if (!metadata.descriptor().hideHeader) {\n <tr class=\"mng-table-header\" [class]=\"metadata.descriptor().headerClassName\">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableHeaderCheckbox />\n </th>\n } @else {\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\"></th>\n }\n }\n @if (metadata.descriptor().rowExpandable) {\n <th scope=\"col\" pFrozenColumn [frozen]=\"true\"></th>\n }\n @if (rowReorderEnabled()) {\n <th scope=\"col\"></th>\n }\n @for (col of visibleColumns(); track col.id) {\n <ng-template #sortableColumnTHTemplate>\n @if (columnHeaderTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n columnHeaderTemplate();\n context: {data: data.data(), totalCount: data.count(), property: col.descriptor.property, table: this}\n \"></ng-container>\n } @else {\n <div class=\"flex justify-between items-center\">\n {{\n (col.descriptor.title && !col.descriptor.titleUseModelBase\n ? col.descriptor.title\n : (col.descriptor.title ?? col.descriptor.property | mngI18nProperty: metadata.descriptor().model)\n ) | translate\n }}\n <p-sortIcon [field]=\"col.sort?.property\" class=\"flex\"></p-sortIcon>\n </div>\n }\n </ng-template>\n <ng-template #nonSortableColumnTHTemplate>\n @if (columnHeaderTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n columnHeaderTemplate();\n context: {data: data.data(), totalCount: data.count(), property: col.descriptor.property, table: this}\n \"></ng-container>\n } @else {\n {{\n (col.descriptor.title && !col.descriptor.titleUseModelBase\n ? col.descriptor.title\n : (col.descriptor.title ?? col.descriptor.property | mngI18nProperty: metadata.descriptor().model)\n ) | translate\n }}\n }\n </ng-template>\n @if (col.reorderable) {\n <th\n pResizableColumn\n pReorderableColumn\n [id]=\"col.descriptor.property\"\n [pSortableColumn]=\"col.sort?.property\"\n [pSortableColumnDisabled]=\"!col.sort\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\"\n [class]=\"col.descriptor.headerClassName | mngTableFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\">\n <ng-container *ngTemplateOutlet=\"col.sort ? sortableColumnTHTemplate : nonSortableColumnTHTemplate\"></ng-container>\n </th>\n } @else {\n <th\n pResizableColumn\n [id]=\"col.descriptor.property\"\n [pSortableColumn]=\"col.sort?.property\"\n [pSortableColumnDisabled]=\"!col.sort\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\"\n [class]=\"col.descriptor.headerClassName | mngTableFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\">\n <ng-container *ngTemplateOutlet=\"col.sort ? sortableColumnTHTemplate : nonSortableColumnTHTemplate\"></ng-container>\n </th>\n }\n }\n @if (hasLastColumn()) {\n <th\n [style.min-width.px]=\"columnLastMinWidth()\"\n pFrozenColumn\n [frozen]=\"metadata.descriptor().actionColumnFrozen ?? areColumnsToggleable()\"\n alignFrozen=\"right\"\n class=\"mng-table-column-custom-last text-right!\">\n @if (areColumnsToggleable()) {\n @defer (on idle) {\n <mng-table-column-toggle [columns]=\"visibleColumns()\" />\n }\n }\n </th>\n }\n </tr>\n }\n @if (hasColumnFilters()) {\n <tr class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n @if (selectionEnabled()) {\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\"></th>\n }\n @if (rowReorderEnabled()) {\n <th scope=\"col\"></th>\n }\n @if (metadata.descriptor().rowExpandable) {\n <th scope=\"col\"></th>\n }\n @for (col of visibleColumns(); track col.id) {\n <th\n [class]=\"'px-1! ' + col.filter?.descriptor?.columnClassName | mngTableFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\"\n [style.width.px]=\"col.width\"\n [style.width.%]=\"col.width ? null : (col.filter?.descriptor?.columnWidth ?? col.descriptor.width ?? null)\"\n [style.min-width.px]=\"col.width ? null : (col.filter?.descriptor?.columnMinWidth ?? col.descriptor.minWidth)\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\">\n @if (col.filter && col.filter.descriptor.filterType !== FilterTypeEnum.Component) {\n @defer (on idle) {\n <mng-table-filter [config]=\"col.filter\" [model]=\"metadata.descriptor().model\"></mng-table-filter>\n }\n } @else if (col.filter && col.filter.descriptor.customComponentType) {\n <ng-container [mngComponent]=\"col.filter.descriptor.customComponentType\" [inputs]=\"{descriptor: col.filter.descriptor}\"></ng-container>\n }\n </th>\n }\n @if (hasLastColumn()) {\n <th pFrozenColumn alignFrozen=\"right\" class=\"mng-table-column-custom-last\" [style.min-width.px]=\"columnLastMinWidth()\"></th>\n }\n </tr>\n }\n </ng-template>\n <ng-template #body let-item let-idx=\"rowIndex\" let-expanded=\"expanded\">\n <tr\n (click)=\"onRowClick($event, item)\"\n [pReorderableRow]=\"idx\"\n [ngClass]=\"\n metadata.descriptor().rowClassName | mngClassMap: metadata.descriptor().rowClassNameMapFn : item | mngLocaleDefaultRowClass: metadata.descriptor() : item\n \">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableCheckbox (click)=\"$event.stopPropagation()\" [value]=\"item\"></p-tableCheckbox>\n </td>\n } @else {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableRadioButton (click)=\"$event.stopPropagation()\" [value]=\"item\"></p-tableRadioButton>\n </td>\n }\n }\n @if (metadata.descriptor().rowExpandable) {\n <td>\n @let expandProp = metadata.descriptor().rowExpandableProperty;\n @if (!expandProp || item[expandProp]) {\n <button\n pButton\n type=\"button\"\n [pRowToggler]=\"item\"\n rounded=\"true\"\n text=\"true\"\n size=\"small\"\n [icon]=\"expanded ? 'pi pi-chevron-down' : 'pi pi-chevron-right'\"></button>\n }\n </td>\n }\n @if (rowReorderEnabled()) {\n <td>\n <span class=\"pi pi-bars\" pReorderableRowHandle></span>\n </td>\n }\n @for (col of visibleColumns(); track col.id) {\n <td\n (click)=\"onCellClick($event, col.descriptor, item, idx)\"\n [class]=\"\n col.descriptor.className\n | mngClassMap: col.descriptor.classNameMapFn : item\n | mngTableFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\n \"\n [class.clickable]=\"isCellClickEnabled()\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\">\n <mng-table-column-value [descriptor]=\"col.descriptor\" [item]=\"item\"></mng-table-column-value>\n </td>\n }\n @if (hasLastColumn()) {\n <td\n class=\"mng-table-column-custom-last justify-end text-right!\"\n [style.min-width.px]=\"columnLastMinWidth()\"\n pFrozenColumn\n alignFrozen=\"right\"\n [frozen]=\"metadata.descriptor().actionColumnFrozen ?? true\">\n @if (columnCustomLastTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n columnCustomLastTemplate();\n context: {item: item, index: idx, data: data.data(), totalCount: data.count(), table: this}\n \"></ng-container>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #expandedrow let-item let-idx=\"rowIndex\">\n @if (metadata.descriptor().rowExpandable) {\n <tr>\n <td></td>\n <td [colSpan]=\"metadata.descriptor().rowExpandableColSpan\">\n @if (metadata.descriptor().rowExpandableComponentType !== undefined) {\n <ng-container [mngComponent]=\"metadata.descriptor().rowExpandableComponentType\" [inputs]=\"{item}\"> </ng-container>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n rowExpandTemplate();\n context: {item: item, index: idx, data: data.data(), totalCount: data.count(), table: this}\n \"></ng-container>\n }\n </td>\n </tr>\n }\n </ng-template>\n <ng-template #loadingicon>\n <div class=\"flex flex-col items-center\">\n @if (metadata.descriptor().loadingIcon) {\n <i [class]=\"'text-white text-4xl pi-spin ' + metadata.descriptor().loadingIcon\"></i>\n }\n @if (metadata.descriptor().loadingText) {\n <div class=\"text text-white text-lg font-semibold\" [ngClass]=\"{'mt-3': metadata.descriptor().loadingIcon}\">\n {{ metadata.descriptor().loadingText ?? '' | translate }}\n </div>\n }\n </div>\n </ng-template>\n <ng-template #loadingbody>\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n <div class=\"loading-text\"></div>\n <p-skeleton width=\"100%\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n @if (requiredFiltersMissing()) {\n <i class=\"pi pi-exclamation-triangle mr-2\"></i> <strong>{{ 'mngTable.requiredFiltersMissing' | translate }}</strong>\n } @else {\n {{ 'mngTable.noItems' | translate }}\n }\n </td>\n </tr>\n </ng-template>\n @if (footerTemplate()) {\n <ng-template #summary>\n <ng-container *ngTemplateOutlet=\"footerTemplate(); context: {data: data.data(), totalCount: data.count(), table: this}\"></ng-container>\n </ng-template>\n }\n </p-table>\n }\n</div>\n", styles: ["mng-table .p-datatable .p-datatable-header{border-top:0}mng-table .p-datatable:not(.p-datatable-gridlines) .p-datatable-tbody>tr>td{cursor:auto}mng-table .p-datatable:not(.p-datatable-gridlines) .p-datatable-tbody>tr>td.clickable{cursor:pointer}:is(mng-table .p-datatable .p-datatable-thead>tr>th,mng-table .p-datatable .p-datatable-tbody>tr>td):hover mng-table-column-value .help-buttons{display:block}mng-table .p-datatable .p-datatable-thead>tr>th.mng-table-column-custom-last{padding:var(--mng-table-column-head-custom-last, .1rem 1rem)}mng-table .p-datatable .p-datatable-tbody>tr>td{position:relative}mng-table .p-datatable .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding-top:.1rem;padding-bottom:.1rem}mng-table .p-datatable .p-datatable-tbody>tr>td.p-datatable-frozen-column{position:sticky;z-index:1;background:transparent}mng-table .p-datatable.p-datatable-lg .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding:var(--mng-table-column-body-custom-last, .15rem 1rem)}mng-table .p-datatable.p-datatable-sm .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding:var(--mng-table-sm-column-body-custom-last, .05rem 1rem)}mng-table .p-datatable.p-datatable-flex-scrollable .p-datatable-thead>tr>th{overflow:hidden;text-overflow:ellipsis}mng-table .p-datatable.p-datatable-flex-scrollable .p-datatable-tbody>tr>td{overflow:hidden}mng-table .p-datatable .mng-table-row-localization-default-locale{background:var(--p-surface-100)!important}mng-table .mng-table-header>th:not(:first-child):not(:last-child){border-radius:0!important}mng-table .mng-table-header>th:first-child{border-top-right-radius:0!important;border-bottom-right-radius:0!important}mng-table .mng-table-header>th:last-child{border-radius:0!important}mng-table .mng-table-header .mng-table-columns-multiselect{width:36px}mng-table .mng-table-header .mng-table-columns-multiselect .p-multiselect-label-container{width:0}mng-table.mng-table-no-header p-datatable .p-datatable-header{display:none}mng-table.mng-table-header-compact .p-datatable-header{padding:var(--mng-table-header-compact-padding, 0 0 .5rem 0)!important}\n"] }]
|
|
2951
|
-
}], ctorParameters: () => [], propDecorators: { descriptorInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "descriptor", required: true }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], result: [{ type: i0.Input, args: [{ isSignal: true, alias: "result", required: false }] }], loadingInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], dataProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataProvider", required: false }] }], queryParamPrepend: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryParamPrepend", required: false }] }], useQueryParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "useQueryParams", required: false }] }], cellClickEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellClickEnabled", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], selectionEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionEnabled", required: false }] }], rowReorderEnabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowReorderEnabled", required: false }] }], featureConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "featureConfig", required: false }] }], columnLastMinWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnLastMinWidth", required: false }] }], globalFilterFieldsInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "globalFilterFields", required: false }] }], tableLoad: [{ type: i0.Output, args: ["tableLoad"] }], cellClick: [{ type: i0.Output, args: ["cellClick"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], rowReorder: [{ type: i0.Output, args: ["rowReorder"] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], searchChange: [{ type: i0.Output, args: ["searchChange"] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], templates: [{ type: i0.Input, args: [{ isSignal: true, alias: "templates", required: false }] }], contentTemplates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TableTemplateDirective), { isSignal: true }] }],
|
|
2986
|
+
}, encapsulation: ViewEncapsulation.None, template: "<div>\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n @if (data.isAllPaginationMetaInitialized()) {\n <p-table\n [value]=\"requiredFiltersMissing() ? [] : data.data()\"\n [dataKey]=\"metadata.descriptor().trackProperty\"\n [lazy]=\"isLazy()\"\n [loading]=\"data.loading()\"\n [paginator]=\"isPagination()\"\n [rows]=\"data.rows()\"\n [first]=\"data.offset()\"\n [totalRecords]=\"data.count()\"\n [rowsPerPageOptions]=\"metadata.rowsPerPageOptions()\"\n [showCurrentPageReport]=\"true\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"data.sortStates()\"\n [filters]=\"data.optimusFilterStates()\"\n [globalFilterFields]=\"metadata.searchFields()\"\n sortMode=\"multiple\"\n [selection]=\"data.selectedItems()\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"selectionEnabled() ? selectionMode() : null\"\n [scrollable]=\"true\"\n scrollHeight=\"flex\"\n [rowHover]=\"metadata.descriptor().hasHover\"\n [styleClass]=\"className()\"\n [resizableColumns]=\"metadata.descriptor().hasResizableColumns ?? metadata.tableConfig().columnResize ?? false\"\n [columnResizeMode]=\"metadata.descriptor().columnResizeMode ?? metadata.tableConfig().columnResizeMode ?? 'expand'\"\n [reorderableColumns]=\"areColumnsReorderable()\"\n paginatorDropdownAppendTo=\"body\"\n [columns]=\"visibleColumns()\"\n [expandedRowKeys]=\"expandedRowKeys()\"\n (onColResize)=\"prefs.onColumnResize($event)\"\n (onColReorder)=\"prefs.onColumnReorder($event)\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onFilter)=\"onTableFilter($event)\"\n (sortChange)=\"onTableSort($event)\"\n (onPage)=\"onTablePage($event)\"\n (onRowReorder)=\"onRowReorder($event)\"\n mngRemovableSort>\n <ng-template #caption>\n @if (isCaptionVisible()) {\n <div class=\"table-header\">\n @if (headerTemplate()) {\n <ng-container *ngTemplateOutlet=\"headerTemplate(); context: {data: data.data(), totalCount: data.count(), table: this}\"></ng-container>\n } @else {\n <mng-table-header-with-filters\n [metadata]=\"tableHeaderFilters()\"\n [genericFilterDescriptor]=\"metadata.genericFilterDescriptor()\"\n [model]=\"metadata.descriptor().model\"\n [enableSearch]=\"metadata.descriptor().search\"\n [search]=\"data.searchState()\"\n [searchLimitWordMax]=\"metadata.descriptor().searchLimitMaxWords\"\n [enableCaseSensitive]=\"isLazy()\">\n @if (hasTitleDisplay()) {\n <ng-template mngTableHeaderWithFiltersTemplate name=\"title\">\n @if (headerTitleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"headerTitleTemplate(); context: {data: data.data(), totalCount: data.count(), table: this}\"></ng-container>\n } @else if (metadata.descriptor().title) {\n <h5 class=\"p-0 m-0\">{{ metadata.descriptor().title! | translate }}</h5>\n }\n </ng-template>\n }\n @if (titleRowRightTemplate()) {\n <ng-template mngTableHeaderWithFiltersTemplate name=\"titleRowRight\">\n <ng-container *ngTemplateOutlet=\"titleRowRightTemplate()\"></ng-container>\n </ng-template>\n }\n </mng-table-header-with-filters>\n }\n </div>\n }\n </ng-template>\n <ng-template #header>\n @if (!metadata.descriptor().hideHeader) {\n <tr class=\"mng-table-header\" [class]=\"metadata.descriptor().headerClassName\">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableHeaderCheckbox />\n </th>\n } @else {\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\"></th>\n }\n }\n @if (metadata.descriptor().rowExpandable) {\n <th scope=\"col\" pFrozenColumn [frozen]=\"true\"></th>\n }\n @if (rowReorderEnabled()) {\n <th scope=\"col\"></th>\n }\n @for (col of visibleColumns(); track col.id) {\n <ng-template #sortableColumnTHTemplate>\n @if (columnHeaderTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n columnHeaderTemplate();\n context: {data: data.data(), totalCount: data.count(), property: col.descriptor.property, table: this}\n \"></ng-container>\n } @else {\n <div class=\"flex justify-between items-center\">\n {{\n (col.descriptor.title && !col.descriptor.titleUseModelBase\n ? col.descriptor.title\n : (col.descriptor.title ?? col.descriptor.property | mngI18nProperty: metadata.descriptor().model)\n ) | translate\n }}\n <p-sortIcon [field]=\"col.sort?.property\" class=\"flex\"></p-sortIcon>\n </div>\n }\n </ng-template>\n <ng-template #nonSortableColumnTHTemplate>\n @if (columnHeaderTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n columnHeaderTemplate();\n context: {data: data.data(), totalCount: data.count(), property: col.descriptor.property, table: this}\n \"></ng-container>\n } @else {\n {{\n (col.descriptor.title && !col.descriptor.titleUseModelBase\n ? col.descriptor.title\n : (col.descriptor.title ?? col.descriptor.property | mngI18nProperty: metadata.descriptor().model)\n ) | translate\n }}\n }\n </ng-template>\n @if (col.reorderable) {\n <th\n pResizableColumn\n pReorderableColumn\n [id]=\"col.descriptor.property\"\n [pSortableColumn]=\"col.sort?.property\"\n [pSortableColumnDisabled]=\"!col.sort\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\"\n [class]=\"col.descriptor.headerClassName | mngTableFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\">\n <ng-container *ngTemplateOutlet=\"col.sort ? sortableColumnTHTemplate : nonSortableColumnTHTemplate\"></ng-container>\n </th>\n } @else {\n <th\n pResizableColumn\n [id]=\"col.descriptor.property\"\n [pSortableColumn]=\"col.sort?.property\"\n [pSortableColumnDisabled]=\"!col.sort\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\"\n [class]=\"col.descriptor.headerClassName | mngTableFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\">\n <ng-container *ngTemplateOutlet=\"col.sort ? sortableColumnTHTemplate : nonSortableColumnTHTemplate\"></ng-container>\n </th>\n }\n }\n @if (hasLastColumn()) {\n <th\n [style.min-width.px]=\"columnLastMinWidth()\"\n pFrozenColumn\n [frozen]=\"metadata.descriptor().actionColumnFrozen ?? areColumnsToggleable()\"\n alignFrozen=\"right\"\n class=\"mng-table-column-custom-last text-right!\">\n @if (areColumnsToggleable()) {\n @defer (on idle) {\n <mng-table-column-toggle [columns]=\"visibleColumns()\" />\n }\n }\n </th>\n }\n </tr>\n }\n @if (hasColumnFilters()) {\n <tr class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n @if (selectionEnabled()) {\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\"></th>\n }\n @if (rowReorderEnabled()) {\n <th scope=\"col\"></th>\n }\n @if (metadata.descriptor().rowExpandable) {\n <th scope=\"col\"></th>\n }\n @for (col of visibleColumns(); track col.id) {\n <th\n [class]=\"'px-1! ' + col.filter?.descriptor?.columnClassName | mngTableFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\"\n [style.width.px]=\"col.width\"\n [style.width.%]=\"col.width ? null : (col.filter?.descriptor?.columnWidth ?? col.descriptor.width ?? null)\"\n [style.min-width.px]=\"col.width ? null : (col.filter?.descriptor?.columnMinWidth ?? col.descriptor.minWidth)\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\">\n @if (col.filter && col.filter.descriptor.filterType !== FilterTypeEnum.Component) {\n @defer (on idle) {\n <mng-table-filter [config]=\"col.filter\" [model]=\"metadata.descriptor().model\"></mng-table-filter>\n }\n } @else if (col.filter && col.filter.descriptor.customComponentType) {\n <ng-container [mngComponent]=\"col.filter.descriptor.customComponentType\" [inputs]=\"{descriptor: col.filter.descriptor}\"></ng-container>\n }\n </th>\n }\n @if (hasLastColumn()) {\n <th pFrozenColumn alignFrozen=\"right\" class=\"mng-table-column-custom-last\" [style.min-width.px]=\"columnLastMinWidth()\"></th>\n }\n </tr>\n }\n </ng-template>\n <ng-template #body let-item let-idx=\"rowIndex\" let-expanded=\"expanded\">\n <tr\n (click)=\"onRowClick($event, item)\"\n [pReorderableRow]=\"idx\"\n [ngClass]=\"\n metadata.descriptor().rowClassName | mngClassMap: metadata.descriptor().rowClassNameMapFn : item | mngLocaleDefaultRowClass: metadata.descriptor() : item\n \">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableCheckbox (click)=\"$event.stopPropagation()\" [value]=\"item\"></p-tableCheckbox>\n </td>\n } @else {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableRadioButton (click)=\"$event.stopPropagation()\" [value]=\"item\"></p-tableRadioButton>\n </td>\n }\n }\n @if (metadata.descriptor().rowExpandable) {\n <td>\n @let expandProp = metadata.descriptor().rowExpandableProperty;\n @if (!expandProp || item[expandProp]) {\n <button\n pButton\n type=\"button\"\n [pRowToggler]=\"item\"\n rounded=\"true\"\n text=\"true\"\n size=\"small\"\n [icon]=\"expanded ? 'pi pi-chevron-down' : 'pi pi-chevron-right'\"></button>\n }\n </td>\n }\n @if (rowReorderEnabled()) {\n <td>\n <span class=\"pi pi-bars\" pReorderableRowHandle></span>\n </td>\n }\n @for (col of visibleColumns(); track col.id) {\n <td\n (click)=\"onCellClick($event, col.descriptor, item, idx)\"\n [class]=\"\n col.descriptor.className\n | mngClassMap: col.descriptor.classNameMapFn : item\n | mngTableFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\n \"\n [class.clickable]=\"isCellClickEnabled()\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\">\n <mng-table-column-value [descriptor]=\"col.descriptor\" [item]=\"item\"></mng-table-column-value>\n </td>\n }\n @if (hasLastColumn()) {\n <td\n class=\"mng-table-column-custom-last justify-end text-right!\"\n [style.min-width.px]=\"columnLastMinWidth()\"\n pFrozenColumn\n alignFrozen=\"right\"\n [frozen]=\"metadata.descriptor().actionColumnFrozen ?? true\">\n @if (columnCustomLastTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n columnCustomLastTemplate();\n context: {item: item, index: idx, data: data.data(), totalCount: data.count(), table: this}\n \"></ng-container>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #expandedrow let-item let-idx=\"rowIndex\">\n @if (metadata.descriptor().rowExpandable) {\n <tr>\n <td></td>\n <td [colSpan]=\"metadata.descriptor().rowExpandableColSpan\">\n @if (metadata.descriptor().rowExpandableComponentType !== undefined) {\n <ng-container [mngComponent]=\"metadata.descriptor().rowExpandableComponentType\" [inputs]=\"{item}\"> </ng-container>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n rowExpandTemplate();\n context: {item: item, index: idx, data: data.data(), totalCount: data.count(), table: this}\n \"></ng-container>\n }\n </td>\n </tr>\n }\n </ng-template>\n <ng-template #loadingicon>\n <div class=\"flex flex-col items-center\">\n @if (metadata.descriptor().loadingIcon) {\n <i [class]=\"'text-white text-4xl pi-spin ' + metadata.descriptor().loadingIcon\"></i>\n }\n @if (metadata.descriptor().loadingText) {\n <div class=\"text text-white text-lg font-semibold\" [ngClass]=\"{'mt-3': metadata.descriptor().loadingIcon}\">\n {{ metadata.descriptor().loadingText ?? '' | translate }}\n </div>\n }\n </div>\n </ng-template>\n <ng-template #loadingbody>\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n <div class=\"loading-text\"></div>\n <p-skeleton width=\"100%\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n @if (requiredFiltersMissing()) {\n <i class=\"pi pi-exclamation-triangle mr-2\"></i> <strong>{{ 'mngTable.requiredFiltersMissing' | translate }}</strong>\n } @else {\n {{ 'mngTable.noItems' | translate }}\n }\n </td>\n </tr>\n </ng-template>\n @if (footerTemplate()) {\n <ng-template #summary>\n <ng-container *ngTemplateOutlet=\"footerTemplate(); context: {data: data.data(), totalCount: data.count(), table: this}\"></ng-container>\n </ng-template>\n }\n </p-table>\n }\n</div>\n", styles: ["mng-table .p-datatable .p-datatable-header{border-top:0}mng-table .p-datatable:not(.p-datatable-gridlines) .p-datatable-tbody>tr>td{cursor:auto}mng-table .p-datatable:not(.p-datatable-gridlines) .p-datatable-tbody>tr>td.clickable{cursor:pointer}:is(mng-table .p-datatable .p-datatable-thead>tr>th,mng-table .p-datatable .p-datatable-tbody>tr>td):hover mng-table-column-value .help-buttons{display:block}mng-table .p-datatable .p-datatable-thead>tr>th.mng-table-column-custom-last{padding:var(--mng-table-column-head-custom-last, .1rem 1rem)}mng-table .p-datatable .p-datatable-tbody>tr>td{position:relative}mng-table .p-datatable .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding-top:.1rem;padding-bottom:.1rem}mng-table .p-datatable .p-datatable-tbody>tr>td.p-datatable-frozen-column{position:sticky;z-index:1;background:transparent}mng-table .p-datatable.p-datatable-lg .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding:var(--mng-table-column-body-custom-last, .15rem 1rem)}mng-table .p-datatable.p-datatable-sm .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding:var(--mng-table-sm-column-body-custom-last, .05rem 1rem)}mng-table .p-datatable.p-datatable-flex-scrollable .p-datatable-thead>tr>th{overflow:hidden;text-overflow:ellipsis}mng-table .p-datatable.p-datatable-flex-scrollable .p-datatable-tbody>tr>td{overflow:hidden}mng-table .p-datatable .mng-table-row-localization-default-locale{background:var(--p-surface-100)!important}mng-table .mng-table-header>th:not(:first-child):not(:last-child){border-radius:0!important}mng-table .mng-table-header>th:first-child{border-top-right-radius:0!important;border-bottom-right-radius:0!important}mng-table .mng-table-header>th:last-child{border-radius:0!important}mng-table .mng-table-header .mng-table-columns-multiselect{width:36px}mng-table .mng-table-header .mng-table-columns-multiselect .p-multiselect-label-container{width:0}mng-table.mng-table-no-header p-datatable .p-datatable-header{display:none}mng-table.mng-table-header-compact .p-datatable-header{padding:var(--mng-table-header-compact-padding, 0 0 .5rem 0)!important}\n"] }]
|
|
2987
|
+
}], ctorParameters: () => [], propDecorators: { descriptorInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "descriptor", required: true }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], result: [{ type: i0.Input, args: [{ isSignal: true, alias: "result", required: false }] }], loadingInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], dataProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataProvider", required: false }] }], queryParamPrepend: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryParamPrepend", required: false }] }], useQueryParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "useQueryParams", required: false }] }], cellClickEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellClickEnabled", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], selectionEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionEnabled", required: false }] }], rowReorderEnabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowReorderEnabled", required: false }] }], featureConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "featureConfig", required: false }] }], columnLastMinWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnLastMinWidth", required: false }] }], globalFilterFieldsInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "globalFilterFields", required: false }] }], tableLoad: [{ type: i0.Output, args: ["tableLoad"] }], cellClick: [{ type: i0.Output, args: ["cellClick"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], rowReorder: [{ type: i0.Output, args: ["rowReorder"] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], searchChange: [{ type: i0.Output, args: ["searchChange"] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], templates: [{ type: i0.Input, args: [{ isSignal: true, alias: "templates", required: false }] }], contentTemplates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TableTemplateDirective), { isSignal: true }] }], optimusTable: [{ type: i0.ViewChild, args: [i0.forwardRef(() => Table), { isSignal: true }] }], rowSelectCheckboxes: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => TableCheckbox), { isSignal: true }] }], rowSelectRadioButtons: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => TableRadioButton), { isSignal: true }] }] } }) });
|
|
2952
2988
|
|
|
2953
2989
|
/**
|
|
2954
2990
|
* Prepares providers for usage of the tableview functionalities.
|
|
@@ -2986,5 +3022,5 @@ function provideTableChild(config) {
|
|
|
2986
3022
|
* Generated bundle index. Do not edit.
|
|
2987
3023
|
*/
|
|
2988
3024
|
|
|
2989
|
-
export {
|
|
2990
|
-
//# sourceMappingURL=mediusinc-mng-commons-table-mediusinc-mng-commons-table-
|
|
3025
|
+
export { ADataListMetaService as A, tableCreateFilterState as B, COMMONS_TABLE_FEATURE_CONFIG_IT as C, tableCreateSortState as D, tableNotificationError as E, FilterService as F, withTable as G, LocaleDefaultRowClassPipe as L, TableMetadataService as T, TablePreferencesService as a, ADataListService as b, FilterValuePipe as c, TableColumnValueComponent as d, TableComponent as e, TableDataService as f, TableFilterActiveTagComponent as g, TableFilterClassPipe as h, TableFilterComponent as i, TableFilterFormComponent as j, TableHeaderWithFiltersComponent as k, TableHeaderWithFiltersTemplateDirective as l, TableTemplateDirective as m, createFilterDescriptorsFromGeneric as n, filterAdjustDisplayValueOnMatchModeChange as o, filterApplySerializationConfigToCmp as p, filterAreDatesEqual as q, filterGenerateMatchModeOptions as r, filterGetDateConfig as s, filterGetDefaultMatchMode as t, filterGetNumberConfig as u, filterSetStateOnChange as v, filterSetStateOnDisplayChange as w, generateTableLayoutPrefsKey as x, isFilterValueBlank as y, provideTableChild as z };
|
|
3026
|
+
//# sourceMappingURL=mediusinc-mng-commons-table-mediusinc-mng-commons-table-BPgwJRZk.mjs.map
|