@mediusinc/mng-commons 5.4.0-rc.3 → 5.4.0-rc.4
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/core/data-list/data-list-params-helpers.d.ts +1 -1
- package/core/data-list/data-list.model.d.ts +1 -0
- package/core/helpers/type-helpers.d.ts +12 -0
- package/esm2022/core/data-list/data-list-params-helpers.mjs +29 -5
- package/esm2022/core/data-list/data-list.model.mjs +1 -1
- package/esm2022/core/helpers/type-helpers.mjs +1 -1
- package/esm2022/filter/descriptors/filter-generic.descriptor.mjs +21 -0
- package/esm2022/filter/descriptors/filter-lookup.descriptor.mjs +1 -1
- package/esm2022/filter/descriptors/filter.descriptor.mjs +40 -1
- package/esm2022/filter/index.mjs +3 -1
- package/esm2022/filter/models/filter-generic-property.model.mjs +2 -0
- package/esm2022/form/components/dropdown/dropdown.component.mjs +159 -10
- package/esm2022/table/api/descriptors/table.descriptor.mjs +51 -2
- package/esm2022/table/components/column-filter/column-filter.component.mjs +2 -2
- package/esm2022/table/components/filter/filter-active-tag/filter-active-tag.component.mjs +4 -1
- package/esm2022/table/components/filter/filter-form/filter-form.component.mjs +42 -9
- package/esm2022/table/components/filter/filter-overlay-with-tag/filter-overlay-with-tag.component.mjs +95 -11
- package/esm2022/table/components/table/table.component.mjs +54 -10
- package/esm2022/table/helpers/filters.mjs +32 -2
- package/esm2022/table/services/table-feature-config.token.mjs +1 -1
- package/esm2022/tableview/action/components/localization/data-language-dropdown.component.mjs +2 -2
- package/esm2022/tableview/api/editor/descriptors/field-many.descriptor.mjs +11 -10
- package/esm2022/tableview/api/editor/descriptors/field.descriptor.mjs +16 -2
- package/esm2022/tableview/api/editor/models/formly-custom-field.model.mjs +2 -1
- package/esm2022/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +2 -2
- package/esm2022/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
- package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +3 -4
- package/esm2022/tableview/editor/components/formly/fields/formly-field-type.abstract.component.mjs +2 -1
- package/fesm2022/mediusinc-mng-commons-core.mjs +28 -4
- package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-filter.mjs +61 -1
- package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form.mjs +156 -7
- package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table-api.mjs +50 -1
- package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table.mjs +227 -42
- package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +26 -10
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview.mjs +7 -6
- package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
- package/filter/descriptors/filter-generic.descriptor.d.ts +11 -0
- package/filter/descriptors/filter.descriptor.d.ts +21 -2
- package/filter/index.d.ts +2 -0
- package/filter/models/filter-generic-property.model.d.ts +7 -0
- package/form/components/dropdown/dropdown.component.d.ts +27 -1
- package/i18n/en.json +4 -0
- package/i18n/sl.json +4 -0
- package/package.json +7 -7
- package/table/api/descriptors/table.descriptor.d.ts +33 -1
- package/table/components/filter/filter-form/filter-form.component.d.ts +11 -2
- package/table/components/filter/filter-overlay-with-tag/filter-overlay-with-tag.component.d.ts +21 -1
- package/table/components/table/table.component.d.ts +18 -3
- package/table/helpers/filters.d.ts +9 -1
- package/table/services/table-feature-config.token.d.ts +1 -0
- package/tableview/api/editor/descriptors/field-many.descriptor.d.ts +6 -4
- package/tableview/api/editor/descriptors/field.descriptor.d.ts +10 -1
- package/version-info.json +5 -5
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
2
2
|
import { NgClass, NgTemplateOutlet, DecimalPipe, CurrencyPipe, DatePipe, AsyncPipe, NgStyle } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { signal, Injectable, inject, ElementRef, Renderer2, ChangeDetectorRef, DestroyRef, input, computed, viewChild, effect, untracked, Component, ViewEncapsulation, ChangeDetectionStrategy, LOCALE_ID, Pipe, output,
|
|
4
|
+
import { signal, Injectable, inject, ElementRef, Renderer2, ChangeDetectorRef, DestroyRef, input, computed, viewChild, effect, untracked, Component, ViewEncapsulation, ChangeDetectionStrategy, LOCALE_ID, Pipe, output, InjectionToken, booleanAttribute, contentChildren, Injector, viewChildren, afterNextRender } from '@angular/core';
|
|
5
5
|
import { toSignal, takeUntilDestroyed, toObservable, outputFromObservable } from '@angular/core/rxjs-interop';
|
|
6
|
-
import * as i1
|
|
6
|
+
import * as i1 from '@angular/forms';
|
|
7
7
|
import { FormsModule } from '@angular/forms';
|
|
8
|
-
import * as
|
|
8
|
+
import * as i2 from '@ngx-translate/core';
|
|
9
9
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
10
|
-
import * as i2$
|
|
10
|
+
import * as i2$3 from 'primeng/api';
|
|
11
11
|
import { PrimeNGConfig, OverlayService, TranslationKeys, MessageService } from 'primeng/api';
|
|
12
|
-
import * as i2 from 'primeng/calendar';
|
|
12
|
+
import * as i2$1 from 'primeng/calendar';
|
|
13
13
|
import { CalendarModule } from 'primeng/calendar';
|
|
14
14
|
import * as i6 from 'primeng/checkbox';
|
|
15
15
|
import { CheckboxModule } from 'primeng/checkbox';
|
|
@@ -20,26 +20,33 @@ import * as i4 from 'primeng/inputnumber';
|
|
|
20
20
|
import { InputNumberModule } from 'primeng/inputnumber';
|
|
21
21
|
import * as i5 from 'primeng/inputtext';
|
|
22
22
|
import { InputTextModule } from 'primeng/inputtext';
|
|
23
|
-
import * as i1$
|
|
23
|
+
import * as i1$3 from 'primeng/table';
|
|
24
24
|
import { Table, TableModule } from 'primeng/table';
|
|
25
25
|
import { ZIndexUtils } from 'primeng/utils';
|
|
26
|
-
import { Subject, debounceTime, distinctUntilChanged, ReplaySubject, switchMap, NEVER,
|
|
27
|
-
import { FilterMatchMode, dateToIsoString, angularDateFormatHasTime, fromAngularDateFormatToPrime, angularDateFormatHasSeconds, fromAngularNumberFormatToFractions, COMMONS_MODULE_CONFIG_IT, GetterPipe, TemplatePipe, BooleanPipe, EnumPipe, ComponentDirective, getI18nTypePropertyKey, TemplateDirective, findTemplateByName, toastMessage, CommonsService, LoggerService, CommonsStorageService, booleanOrUndefinedAttribute, mergeDataListParamsWithDefaults, fromTableLoadToDataListParams, dataListParamsToUrlQuery,
|
|
28
|
-
import { FilterTypeEnum, FilterLookupDescriptor, FilterLookupTypeEnum, FilterDisplayTypeEnum } from '@mediusinc/mng-commons/filter';
|
|
26
|
+
import { Subject, debounceTime, distinctUntilChanged, ReplaySubject, switchMap, NEVER, BehaviorSubject, combineLatest, skip, of } from 'rxjs';
|
|
27
|
+
import { FilterMatchMode, dateToIsoString, angularDateFormatHasTime, fromAngularDateFormatToPrime, angularDateFormatHasSeconds, fromAngularNumberFormatToFractions, COMMONS_MODULE_CONFIG_IT, GetterPipe, TemplatePipe, BooleanPipe, EnumPipe, ComponentDirective, getI18nTypePropertyKey, TemplateDirective, findTemplateByName, toastMessage, CommonsService, LoggerService, CommonsStorageService, booleanOrUndefinedAttribute, toObservable as toObservable$1, mergeDataListParamsWithDefaults, fromTableLoadToDataListParams, dataListParamsToUrlQuery, fromSubscribeError, getErrorLogLevel, fromUrlQueryToDataListParams, I18nPropertyPipe, ClassMapPipe, CommonsFeatureTypeEnum } from '@mediusinc/mng-commons/core';
|
|
28
|
+
import { FilterTypeEnum, FilterLookupDescriptor, FilterDescriptor, FilterLookupTypeEnum, FilterDisplayTypeEnum } from '@mediusinc/mng-commons/filter';
|
|
29
29
|
import { DateRangeComponent, AutocompleteComponent, DropdownComponent, InputTrimDirective, NumberRangeComponent } from '@mediusinc/mng-commons/form';
|
|
30
30
|
import * as i4$1 from 'primeng/button';
|
|
31
31
|
import { ButtonModule, Button } from 'primeng/button';
|
|
32
32
|
import * as i4$2 from 'primeng/ripple';
|
|
33
33
|
import { RippleModule } from 'primeng/ripple';
|
|
34
|
-
import * as i1$
|
|
34
|
+
import * as i1$1 from 'primeng/tooltip';
|
|
35
35
|
import { TooltipModule } from 'primeng/tooltip';
|
|
36
36
|
import { ColumnDisplayTypeEnum, TablePaginationModeEnum, TableSizeEnum, tableDescriptor, TableDynamicDescriptorInst } from '@mediusinc/mng-commons/table/api';
|
|
37
|
-
import * as i2$
|
|
37
|
+
import * as i2$2 from 'primeng/tag';
|
|
38
38
|
import { TagModule } from 'primeng/tag';
|
|
39
|
+
import { DropdownModule } from 'primeng/dropdown';
|
|
39
40
|
import * as i7 from 'primeng/messages';
|
|
40
41
|
import { MessagesModule } from 'primeng/messages';
|
|
41
|
-
import
|
|
42
|
+
import { lookupDataProviderWithService } from '@mediusinc/mng-commons/form/api';
|
|
43
|
+
import { InputGroupModule } from 'primeng/inputgroup';
|
|
44
|
+
import { InputGroupAddonModule } from 'primeng/inputgroupaddon';
|
|
45
|
+
import * as i1$2 from 'primeng/overlaypanel';
|
|
42
46
|
import { OverlayPanel, OverlayPanelModule } from 'primeng/overlaypanel';
|
|
47
|
+
import { PaginatorModule } from 'primeng/paginator';
|
|
48
|
+
import * as i5$1 from 'primeng/togglebutton';
|
|
49
|
+
import { ToggleButtonModule } from 'primeng/togglebutton';
|
|
43
50
|
import { Router, ActivatedRoute, NavigationStart, NavigationEnd, NavigationCancel, NavigationError } from '@angular/router';
|
|
44
51
|
import * as i3 from 'primeng/multiselect';
|
|
45
52
|
import { MultiSelectModule } from 'primeng/multiselect';
|
|
@@ -341,6 +348,36 @@ function filterGetNumberConfig(descriptor) {
|
|
|
341
348
|
fractionsMax: descriptor.numberMaxFractionDigits ?? displayCfg?.fractionsMax
|
|
342
349
|
};
|
|
343
350
|
}
|
|
351
|
+
/**
|
|
352
|
+
* Creates an array of filter descriptors from an array of generic filter properties.
|
|
353
|
+
*
|
|
354
|
+
* @param {FilterGenericProperty[]} properties - The array of filterable properties, their types and options.
|
|
355
|
+
* @param {LookupDataProviderInst<string, any, any, 'field'>} [valueLookup] - The lookup data provider for value suggestions.
|
|
356
|
+
*/
|
|
357
|
+
function createFilterDescriptorsFromGeneric(properties, valueLookup) {
|
|
358
|
+
return properties.reduce((createdFilterDescriptors, genericFilter) => {
|
|
359
|
+
// when no generic value lookup is provided, lookup enum filters are treated as string filters
|
|
360
|
+
const filterType = genericFilter.type === FilterTypeEnum.LookupEnum && valueLookup === undefined ? FilterTypeEnum.String : genericFilter.type;
|
|
361
|
+
const filterDescriptor = new FilterDescriptor(genericFilter.property).asFilterType(filterType).asGenericFilter();
|
|
362
|
+
if ((genericFilter.type === FilterTypeEnum.String || genericFilter.type === FilterTypeEnum.LookupEnum) && valueLookup) {
|
|
363
|
+
filterDescriptor.withGenericValueProvider(valueLookup);
|
|
364
|
+
}
|
|
365
|
+
if (filterDescriptor && genericFilter.opts !== undefined) {
|
|
366
|
+
switch (genericFilter.type) {
|
|
367
|
+
case FilterTypeEnum.Number:
|
|
368
|
+
filterDescriptor.asNumber(genericFilter.opts);
|
|
369
|
+
break;
|
|
370
|
+
case FilterTypeEnum.Date:
|
|
371
|
+
filterDescriptor.asDate(genericFilter.opts);
|
|
372
|
+
break;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
if (filterDescriptor) {
|
|
376
|
+
createdFilterDescriptors.push(filterDescriptor);
|
|
377
|
+
}
|
|
378
|
+
return createdFilterDescriptors;
|
|
379
|
+
}, []);
|
|
380
|
+
}
|
|
344
381
|
|
|
345
382
|
class DataListService {
|
|
346
383
|
constructor() {
|
|
@@ -702,7 +739,7 @@ class TableColumnFilterComponent {
|
|
|
702
739
|
this.primeTable._filter();
|
|
703
740
|
}
|
|
704
741
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: TableColumnFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
705
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", type: TableColumnFilterComponent, isStandalone: true, selector: "mng-table-column-filter", inputs: { descriptor: { classPropertyName: "descriptor", publicName: "descriptor", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "icon", first: true, predicate: ["icon"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"p-column-filter p-column-filter-row\">\n @switch (descriptor().filterType) {\n @case (FilterTypeEnum.Number) {\n @if (filterConstraint()?.displayMatchMode === 'between') {\n <mng-number-range\n className=\"mng-column-filter-number-input\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n (ngModelChange)=\"onNumericModelChange($event)\"\n (keyDown)=\"onNumericInputKeyDown($event)\"\n [placeholder]=\"descriptor().placeholder ?? 'mngTable.typeToFilter' | translate\"\n [useGrouping]=\"descriptor().numberUseGrouping\"\n [minFractionDigits]=\"numberConfig()?.fractionsMin\"\n [maxFractionDigits]=\"numberConfig()?.fractionsMax\"\n [disabled]=\"isInputDisabled()\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-column-filter-number-input\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n (ngModelChange)=\"onNumericModelChange($event)\"\n (onKeyDown)=\"onNumericInputKeyDown($event)\"\n [placeholder]=\"descriptor().placeholder ?? 'mngTable.typeToFilter' | translate\"\n [useGrouping]=\"descriptor().numberUseGrouping\"\n [minFractionDigits]=\"numberConfig()?.fractionsMin\"\n [maxFractionDigits]=\"numberConfig()?.fractionsMax\"\n [disabled]=\"isInputDisabled()\" />\n }\n }\n\n @case (FilterTypeEnum.Boolean) {\n <p-checkbox [ngModel]=\"filterConstraint()?.displayValue\" binary=\"true\" (ngModelChange)=\"onCheckboxModelChange($event)\"></p-checkbox>\n }\n @case (FilterTypeEnum.Date) {\n @if (filterConstraint()?.displayMatchMode === FilterMatchMode.Between) {\n <mng-date-range\n [ngModel]=\"filterConstraint()?.displayValue\"\n (ngModelChange)=\"onDateFilterModelChange($event)\"\n [showTime]=\"dateConfig()?.showTime ?? false\"\n [showSeconds]=\"dateConfig()?.showSeconds ?? false\"\n [dateFormat]=\"dateConfig()?.format\"\n [placeholder]=\"descriptor().placeholder ?? 'mngTable.typeToFilter' | translate\"\n [disabled]=\"isInputDisabled()\"></mng-date-range>\n } @else {\n <p-calendar\n appendTo=\"body\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n (ngModelChange)=\"onDateFilterModelChange($event)\"\n [placeholder]=\"descriptor().placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showIcon]=\"true\"\n [showTime]=\"dateConfig()?.showTime ?? false\"\n [showSeconds]=\"dateConfig()?.showSeconds ?? false\"\n [dateFormat]=\"dateConfig()?.format\"\n [firstDayOfWeek]=\"1\">\n </p-calendar>\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 <input\n type=\"text\"\n pInputText\n class=\"mng-column-filter-string-input\"\n [value]=\"filterConstraint()?.displayValue\"\n [disabled]=\"isInputDisabled()\"\n (input)=\"onTextModelChange($event)\"\n (keydown.enter)=\"onTextInputEnterKeyDown($event)\"\n [attr.placeholder]=\"descriptor().placeholder ?? 'mngTable.typeToFilter' | translate\"\n [mngInputTrim]=\"descriptor().trimOption\" />\n }\n }\n\n <ng-template #lookupFilter>\n @if (descriptorAsLookup(); as lookup) {\n @switch (lookup.lookupType) {\n @case (lookupTypeAutocomplete) {\n <mng-autocomplete\n [ngModel]=\"filterConstraint()?.displayValue\"\n [dataProvider]=\"lookup.dataProvider\"\n [optionsTrackProperty]=\"lookup.optionsValueProperty\"\n [optionsValueProperty]=\"lookup.optionsValueProperty\"\n [optionsLabelProperty]=\"lookup.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookup.optionsLabelTranslate\"\n [multiselect]=\"lookup.multiselect\"\n [autoClear]=\"lookup.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookup.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookup.autocompleteInlineSearch ?? false\"\n [placeholder]=\"descriptor().placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookup.className\"\n [dropdownClassName]=\"lookup.dropdownClassName\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"autocompleteFilter($event)\"\n [searchTrim]=\"descriptor().trimOption\">\n </mng-autocomplete>\n }\n @case (lookupTypeDropdown) {\n <mng-dropdown\n [ngModel]=\"filterConstraint()?.displayValue\"\n [dataProvider]=\"lookup.dataProvider\"\n [optionsValueProperty]=\"lookup.optionsValueProperty\"\n [optionsLabelProperty]=\"lookup.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookup.optionsLabelTranslate\"\n [multiselect]=\"lookup.multiselect\"\n [placeholder]=\"descriptor().placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookup.className\"\n [dropdownClassName]=\"lookup.dropdownClassName\"\n [showClear]=\"false\"\n [changeValueOnBlur]=\"lookup.multiselect\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"dropdownFilter($event)\">\n </mng-dropdown>\n }\n }\n }\n </ng-template>\n\n @if (matchModes().length > 1) {\n <button\n #icon\n type=\"button\"\n class=\"p-column-filter-menu-button p-link\"\n aria-haspopup=\"true\"\n [attr.aria-expanded]=\"overlayVisible()\"\n [ngClass]=\"{'p-column-filter-menu-button-open': overlayVisible(), 'p-column-filter-menu-button-active': isFilterSet()}\"\n (click)=\"toggleMenu($event)\"\n (keydown)=\"onToggleButtonKeyDown($event)\">\n <FilterIcon [styleClass]=\"'pi-filter-icon'\" />\n </button>\n }\n <button #icon [ngClass]=\"{'p-hidden-space': !isFilterSet()}\" type=\"button\" class=\"p-column-filter-clear-button p-link\" (click)=\"clearFilter()\">\n <FilterSlashIcon />\n </button>\n @if (overlayVisible()) {\n <div\n class=\"p-column-filter-overlay p-component p-fluid\"\n (click)=\"onContentClick()\"\n [@overlayAnimation]=\"'visible'\"\n (@overlayAnimation.start)=\"onOverlayAnimationStart($event)\"\n (@overlayAnimation.done)=\"onOverlayAnimationEnd($event)\"\n (keydown.escape)=\"onEscape()\">\n <ul class=\"p-column-filter-row-items\">\n @for (matchMode of matchModes(); track matchMode; let i = $index) {\n <li\n class=\"p-column-filter-row-item\"\n (click)=\"onMatchModeChange(matchMode.value)\"\n (keydown)=\"onMatchModeKeyDown($event)\"\n (keydown.enter)=\"this.onMatchModeChange(matchMode.value)\"\n [ngClass]=\"{'p-highlight': matchMode.value === filterConstraint()?.displayMatchMode}\"\n [attr.tabindex]=\"i === 0 ? '0' : null\">\n {{ matchMode.label }}\n </li>\n }\n <li class=\"p-column-filter-separator\"></li>\n <li class=\"p-column-filter-row-item\" (click)=\"onRowClearItemClick()\" (keydown)=\"onMatchModeKeyDown($event)\" (keydown.enter)=\"onRowClearItemClick()\">\n {{ noFilterLabel }}\n </li>\n </ul>\n </div>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: TableModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "component", type: DateRangeComponent, selector: "mng-date-range", inputs: ["placeholder", "showTime", "showSeconds", "dateFormat", "className", "required", "disabled"] }, { kind: "ngmodule", type: CalendarModule }, { kind: "component", type: i2.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepYearPicker", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.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", "searchTrim", "disabled"], 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", "appendTo"], outputs: ["valueChange", "blur"] }, { kind: "ngmodule", type: InputNumberModule }, { kind: "component", type: i4.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i5.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: FilterIcon, selector: "FilterIcon" }, { kind: "component", type: FilterSlashIcon, selector: "FilterSlashIcon" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: InputTrimDirective, selector: "[mngInputTrim]", inputs: ["mngInputTrim"] }, { kind: "component", type: NumberRangeComponent, selector: "mng-number-range", inputs: ["placeholder", "useGrouping", "minFractionDigits", "maxFractionDigits", "required", "disabled"], outputs: ["keyDown"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i6.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }], animations: [
|
|
742
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", type: TableColumnFilterComponent, isStandalone: true, selector: "mng-table-column-filter", inputs: { descriptor: { classPropertyName: "descriptor", publicName: "descriptor", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "icon", first: true, predicate: ["icon"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"p-column-filter p-column-filter-row\">\n @switch (descriptor().filterType) {\n @case (FilterTypeEnum.Number) {\n @if (filterConstraint()?.displayMatchMode === 'between') {\n <mng-number-range\n className=\"mng-column-filter-number-input\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n (ngModelChange)=\"onNumericModelChange($event)\"\n (keyDown)=\"onNumericInputKeyDown($event)\"\n [placeholder]=\"descriptor().placeholder ?? 'mngTable.typeToFilter' | translate\"\n [useGrouping]=\"descriptor().numberUseGrouping\"\n [minFractionDigits]=\"numberConfig()?.fractionsMin\"\n [maxFractionDigits]=\"numberConfig()?.fractionsMax\"\n [disabled]=\"isInputDisabled()\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-column-filter-number-input\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n (ngModelChange)=\"onNumericModelChange($event)\"\n (onKeyDown)=\"onNumericInputKeyDown($event)\"\n [placeholder]=\"descriptor().placeholder ?? 'mngTable.typeToFilter' | translate\"\n [useGrouping]=\"descriptor().numberUseGrouping\"\n [minFractionDigits]=\"numberConfig()?.fractionsMin\"\n [maxFractionDigits]=\"numberConfig()?.fractionsMax\"\n [disabled]=\"isInputDisabled()\" />\n }\n }\n\n @case (FilterTypeEnum.Boolean) {\n <p-checkbox [ngModel]=\"filterConstraint()?.displayValue\" binary=\"true\" (ngModelChange)=\"onCheckboxModelChange($event)\"></p-checkbox>\n }\n @case (FilterTypeEnum.Date) {\n @if (filterConstraint()?.displayMatchMode === FilterMatchMode.Between) {\n <mng-date-range\n [ngModel]=\"filterConstraint()?.displayValue\"\n (ngModelChange)=\"onDateFilterModelChange($event)\"\n [showTime]=\"dateConfig()?.showTime ?? false\"\n [showSeconds]=\"dateConfig()?.showSeconds ?? false\"\n [dateFormat]=\"dateConfig()?.format\"\n [placeholder]=\"descriptor().placeholder ?? 'mngTable.typeToFilter' | translate\"\n [disabled]=\"isInputDisabled()\"></mng-date-range>\n } @else {\n <p-calendar\n appendTo=\"body\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n (ngModelChange)=\"onDateFilterModelChange($event)\"\n [placeholder]=\"descriptor().placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showIcon]=\"true\"\n [showTime]=\"dateConfig()?.showTime ?? false\"\n [showSeconds]=\"dateConfig()?.showSeconds ?? false\"\n [dateFormat]=\"dateConfig()?.format\"\n [firstDayOfWeek]=\"1\">\n </p-calendar>\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 <input\n type=\"text\"\n pInputText\n class=\"mng-column-filter-string-input\"\n [value]=\"filterConstraint()?.displayValue\"\n [disabled]=\"isInputDisabled()\"\n (input)=\"onTextModelChange($event)\"\n (keydown.enter)=\"onTextInputEnterKeyDown($event)\"\n [attr.placeholder]=\"descriptor().placeholder ?? 'mngTable.typeToFilter' | translate\"\n [mngInputTrim]=\"descriptor().trimOption\" />\n }\n }\n\n <ng-template #lookupFilter>\n @if (descriptorAsLookup(); as lookup) {\n @switch (lookup.lookupType) {\n @case (lookupTypeAutocomplete) {\n <mng-autocomplete\n [ngModel]=\"filterConstraint()?.displayValue\"\n [dataProvider]=\"lookup.dataProvider\"\n [optionsTrackProperty]=\"lookup.optionsValueProperty\"\n [optionsValueProperty]=\"lookup.optionsValueProperty\"\n [optionsLabelProperty]=\"lookup.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookup.optionsLabelTranslate\"\n [multiselect]=\"lookup.multiselect\"\n [autoClear]=\"lookup.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookup.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookup.autocompleteInlineSearch ?? false\"\n [placeholder]=\"descriptor().placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookup.className\"\n [dropdownClassName]=\"lookup.dropdownClassName\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"autocompleteFilter($event)\"\n [searchTrim]=\"descriptor().trimOption\">\n </mng-autocomplete>\n }\n @case (lookupTypeDropdown) {\n <mng-dropdown\n [ngModel]=\"filterConstraint()?.displayValue\"\n [dataProvider]=\"lookup.dataProvider\"\n [optionsValueProperty]=\"lookup.optionsValueProperty\"\n [optionsLabelProperty]=\"lookup.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookup.optionsLabelTranslate\"\n [multiselect]=\"lookup.multiselect\"\n [placeholder]=\"descriptor().placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookup.className\"\n [dropdownClassName]=\"lookup.dropdownClassName\"\n [showClear]=\"false\"\n [changeValueOnBlur]=\"lookup.multiselect\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"dropdownFilter($event)\">\n </mng-dropdown>\n }\n }\n }\n </ng-template>\n\n @if (matchModes().length > 1) {\n <button\n #icon\n type=\"button\"\n class=\"p-column-filter-menu-button p-link\"\n aria-haspopup=\"true\"\n [attr.aria-expanded]=\"overlayVisible()\"\n [ngClass]=\"{'p-column-filter-menu-button-open': overlayVisible(), 'p-column-filter-menu-button-active': isFilterSet()}\"\n (click)=\"toggleMenu($event)\"\n (keydown)=\"onToggleButtonKeyDown($event)\">\n <FilterIcon [styleClass]=\"'pi-filter-icon'\" />\n </button>\n }\n <button #icon [ngClass]=\"{'p-hidden-space': !isFilterSet()}\" type=\"button\" class=\"p-column-filter-clear-button p-link\" (click)=\"clearFilter()\">\n <FilterSlashIcon />\n </button>\n @if (overlayVisible()) {\n <div\n class=\"p-column-filter-overlay p-component p-fluid\"\n (click)=\"onContentClick()\"\n [@overlayAnimation]=\"'visible'\"\n (@overlayAnimation.start)=\"onOverlayAnimationStart($event)\"\n (@overlayAnimation.done)=\"onOverlayAnimationEnd($event)\"\n (keydown.escape)=\"onEscape()\">\n <ul class=\"p-column-filter-row-items\">\n @for (matchMode of matchModes(); track matchMode; let i = $index) {\n <li\n class=\"p-column-filter-row-item\"\n (click)=\"onMatchModeChange(matchMode.value)\"\n (keydown)=\"onMatchModeKeyDown($event)\"\n (keydown.enter)=\"this.onMatchModeChange(matchMode.value)\"\n [ngClass]=\"{'p-highlight': matchMode.value === filterConstraint()?.displayMatchMode}\"\n [attr.tabindex]=\"i === 0 ? '0' : null\">\n {{ matchMode.label }}\n </li>\n }\n <li class=\"p-column-filter-separator\"></li>\n <li class=\"p-column-filter-row-item\" (click)=\"onRowClearItemClick()\" (keydown)=\"onMatchModeKeyDown($event)\" (keydown.enter)=\"onRowClearItemClick()\">\n {{ noFilterLabel }}\n </li>\n </ul>\n </div>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: TableModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "component", type: DateRangeComponent, selector: "mng-date-range", inputs: ["placeholder", "showTime", "showSeconds", "dateFormat", "className", "required", "disabled"] }, { kind: "ngmodule", type: CalendarModule }, { kind: "component", type: i2$1.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepYearPicker", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: FormsModule }, { 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: AutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "optionsTrackProperty", "optionsValueProperty", "optionsLabelProperty", "optionsLabelTranslate", "inlineSearch", "openOnFocus", "multiselect", "placeholder", "className", "dropdownClassName", "showClear", "autoClear", "selectFirst", "searchTrim", "disabled"], 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", "inlineSearch", "searchTrim"], outputs: ["valueChange", "blur"] }, { kind: "ngmodule", type: InputNumberModule }, { kind: "component", type: i4.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i5.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: FilterIcon, selector: "FilterIcon" }, { kind: "component", type: FilterSlashIcon, selector: "FilterSlashIcon" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: InputTrimDirective, selector: "[mngInputTrim]", inputs: ["mngInputTrim"] }, { kind: "component", type: NumberRangeComponent, selector: "mng-number-range", inputs: ["placeholder", "useGrouping", "minFractionDigits", "maxFractionDigits", "required", "disabled"], outputs: ["keyDown"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i6.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }], animations: [
|
|
706
743
|
trigger('overlayAnimation', [
|
|
707
744
|
transition(':enter', [style({ opacity: 0, transform: 'scaleY(0.8)' }), animate('.12s cubic-bezier(0, 0, 0.2, 1)')]),
|
|
708
745
|
transition(':leave', [animate('.1s linear', style({ opacity: 0 }))])
|
|
@@ -791,7 +828,7 @@ class TableColumnValueComponent {
|
|
|
791
828
|
this.messageService.add({ severity: 'info', summary: title, detail: message });
|
|
792
829
|
}
|
|
793
830
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: TableColumnValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
794
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", 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 {{ value() | number: descriptor().displayFormat : descriptor().locale }}\n }\n @case (columnDisplayTypeCurrency) {\n {{ value() | currency: currency() : descriptor().currencyDisplay : descriptor().displayFormat : descriptor().locale }}\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\n [mngComponent]=\"descriptor().customComponentType!\"\n [inputs]=\"{\n value: value(),\n item: item(),\n descriptor: descriptor()\n }\"></ng-container>\n }\n}\n@if (descriptor().hasCopyToClipboard) {\n <div class=\"help-buttons\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-copy\" class=\"p-button-rounded p-button-info p-button-sm\" (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: "ngmodule", type: TooltipModule }, { kind: "directive", type: i1$
|
|
831
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", 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 {{ value() | number: descriptor().displayFormat : descriptor().locale }}\n }\n @case (columnDisplayTypeCurrency) {\n {{ value() | currency: currency() : descriptor().currencyDisplay : descriptor().displayFormat : descriptor().locale }}\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\n [mngComponent]=\"descriptor().customComponentType!\"\n [inputs]=\"{\n value: value(),\n item: item(),\n descriptor: descriptor()\n }\"></ng-container>\n }\n}\n@if (descriptor().hasCopyToClipboard) {\n <div class=\"help-buttons\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-copy\" class=\"p-button-rounded p-button-info p-button-sm\" (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: "ngmodule", type: TooltipModule }, { kind: "directive", type: i1$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "pipe", type: BooleanPipe, name: "mngBoolean" }, { kind: "pipe", type: EnumPipe, name: "mngEnum" }, { kind: "directive", type: ComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "injectionToken", "inputs", "attachToHost", "parentInjector"], outputs: ["instanceCreated"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i4$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "ngmodule", type: RippleModule }, { kind: "directive", type: i4$2.Ripple, selector: "[pRipple]" }, { kind: "pipe", type: DecimalPipe, name: "number" }, { kind: "pipe", type: CurrencyPipe, name: "currency" }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
795
832
|
}
|
|
796
833
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: TableColumnValueComponent, decorators: [{
|
|
797
834
|
type: Component,
|
|
@@ -894,6 +931,9 @@ class FilterActiveTagComponent {
|
|
|
894
931
|
});
|
|
895
932
|
}
|
|
896
933
|
getPropertyLabelKey(filterDescriptor) {
|
|
934
|
+
if (filterDescriptor.isGenericFilter) {
|
|
935
|
+
return filterDescriptor.property;
|
|
936
|
+
}
|
|
897
937
|
let labelKey;
|
|
898
938
|
if (filterDescriptor.title !== undefined) {
|
|
899
939
|
labelKey = filterDescriptor.title;
|
|
@@ -904,7 +944,7 @@ class FilterActiveTagComponent {
|
|
|
904
944
|
return labelKey;
|
|
905
945
|
}
|
|
906
946
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: FilterActiveTagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
907
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", type: FilterActiveTagComponent, isStandalone: true, selector: "mng-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" }, ngImport: i0, template: "<p-tag severity=\"secondary\" styleClass=\"mr-1 p-tag-outlined\">\n <div class=\"flex align-items-center gap-2 p-1 cursor-pointer\" (click)=\"onEdit($event)\">\n <span>{{ label() | translate }}</span>\n @if (matchMode() === FilterMatchMode.Between) {\n <span class=\"font-semibold\">{{ value()?.[0] | mngFilterValue: filter().descriptor | async }}</span>\n <span class=\"text-primary\">{{ matchModeSymbol() | translate }}</span>\n <span class=\"font-semibold\">{{ value()?.[1] | mngFilterValue: filter().descriptor | async }}</span>\n } @else {\n <span class=\"text-primary\">{{ matchModeSymbol() | translate }}</span>\n <span class=\"font-semibold\">{{ value() | mngFilterValue: filter().descriptor | async }}</span>\n @if (filter().caseSensitive) {\n <small class=\"border-solid border-1 border-round-sm px-1 text-primary-400\">Aa</small>\n }\n }\n <span class=\"pi pi-times text-xs\" (click)=\"onRemove($event)\"></span>\n </div>\n</p-tag>\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type:
|
|
947
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", type: FilterActiveTagComponent, isStandalone: true, selector: "mng-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" }, ngImport: i0, template: "<p-tag severity=\"secondary\" styleClass=\"mr-1 p-tag-outlined\">\n <div class=\"flex align-items-center gap-2 p-1 cursor-pointer\" (click)=\"onEdit($event)\">\n <span>{{ label() | translate }}</span>\n @if (matchMode() === FilterMatchMode.Between) {\n <span class=\"font-semibold\">{{ value()?.[0] | mngFilterValue: filter().descriptor | async }}</span>\n <span class=\"text-primary\">{{ matchModeSymbol() | translate }}</span>\n <span class=\"font-semibold\">{{ value()?.[1] | mngFilterValue: filter().descriptor | async }}</span>\n } @else {\n <span class=\"text-primary\">{{ matchModeSymbol() | translate }}</span>\n <span class=\"font-semibold\">{{ value() | mngFilterValue: filter().descriptor | async }}</span>\n @if (filter().caseSensitive) {\n <small class=\"border-solid border-1 border-round-sm px-1 text-primary-400\">Aa</small>\n }\n }\n <span class=\"pi pi-times text-xs\" (click)=\"onRemove($event)\"></span>\n </div>\n</p-tag>\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: i2$2.Tag, selector: "p-tag", inputs: ["style", "styleClass", "severity", "value", "icon", "rounded"] }, { kind: "pipe", type: FilterValuePipe, name: "mngFilterValue" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
908
948
|
}
|
|
909
949
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: FilterActiveTagComponent, decorators: [{
|
|
910
950
|
type: Component,
|
|
@@ -931,15 +971,47 @@ class FilterFormComponent {
|
|
|
931
971
|
this.propertyOptionsWithTranslations = computed(() => {
|
|
932
972
|
const disabledProperties = this.disabledProperties();
|
|
933
973
|
const filter = this.filter();
|
|
934
|
-
return this.descriptors()?.map(d =>
|
|
974
|
+
return this.descriptors()?.map(d => {
|
|
975
|
+
return {
|
|
976
|
+
property: d.property,
|
|
977
|
+
label: d.isGenericFilter ? d.property : this.getPropertyLabelKey(d),
|
|
978
|
+
disabled: !filter && disabledProperties.includes(d.property)
|
|
979
|
+
};
|
|
980
|
+
});
|
|
935
981
|
});
|
|
936
982
|
this.selectedDescriptor = computed(() => {
|
|
937
983
|
const property = this.propertyModel();
|
|
938
984
|
return this.descriptors().find(filterDescriptor => filterDescriptor.property === property);
|
|
939
985
|
});
|
|
986
|
+
this.genericValueProviderInput = computed(() => {
|
|
987
|
+
return this.descriptors().find(d => d.isGenericFilter && (d.filterType === FilterTypeEnum.String || d.filterType === FilterTypeEnum.LookupEnum))?.genericValueProvider;
|
|
988
|
+
});
|
|
989
|
+
// change value lookup function to include the property name of the generic filter
|
|
990
|
+
this.genericValueDataProvider = computed(() => {
|
|
991
|
+
const genericValueProvider = this.genericValueProviderInput();
|
|
992
|
+
if (genericValueProvider && genericValueProvider.serviceType) {
|
|
993
|
+
const lookupFn = genericValueProvider.lookup;
|
|
994
|
+
return lookupDataProviderWithService(genericValueProvider.serviceType).withLookup((params, service, search) => {
|
|
995
|
+
params = {
|
|
996
|
+
...params,
|
|
997
|
+
filters: {
|
|
998
|
+
...params?.filters,
|
|
999
|
+
field: {
|
|
1000
|
+
value: this.selectedDescriptor()?.property,
|
|
1001
|
+
matchMode: this.selectedDescriptor()?.filterType === FilterTypeEnum.LookupEnum ? FilterMatchMode.In : FilterMatchMode.StartsWith
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
};
|
|
1005
|
+
return lookupFn(params, service, search);
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
return;
|
|
1009
|
+
});
|
|
940
1010
|
this.selectedDescriptorAsLookup = computed(() => {
|
|
941
1011
|
const filterDescriptor = this.selectedDescriptor();
|
|
942
|
-
return filterDescriptor !== undefined &&
|
|
1012
|
+
return filterDescriptor !== undefined &&
|
|
1013
|
+
!filterDescriptor.isGenericFilter &&
|
|
1014
|
+
(filterDescriptor.filterType === FilterTypeEnum.Lookup || filterDescriptor.filterType === FilterTypeEnum.LookupEnum)
|
|
943
1015
|
? filterDescriptor
|
|
944
1016
|
: undefined;
|
|
945
1017
|
});
|
|
@@ -1041,9 +1113,7 @@ class FilterFormComponent {
|
|
|
1041
1113
|
value: this.valueModel(),
|
|
1042
1114
|
caseSensitive: this.caseSensitiveModel()
|
|
1043
1115
|
});
|
|
1044
|
-
|
|
1045
|
-
this.resetForm();
|
|
1046
|
-
}
|
|
1116
|
+
// resetting the form is done in the parent component (filter-overlay-with-tag) for smoother animations
|
|
1047
1117
|
}
|
|
1048
1118
|
resetForm(value) {
|
|
1049
1119
|
this.filterForm().resetForm(value);
|
|
@@ -1062,7 +1132,7 @@ class FilterFormComponent {
|
|
|
1062
1132
|
return labelKey;
|
|
1063
1133
|
}
|
|
1064
1134
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: FilterFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1065
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", type: FilterFormComponent, isStandalone: true, selector: "mng-filter-form", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, descriptors: { classPropertyName: "descriptors", publicName: "descriptors", isSignal: true, isRequired: true, 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 } }, outputs: { apply: "apply" }, host: { classAttribute: "flex flex-grow-1" }, viewQueries: [{ propertyName: "filterForm", first: true, predicate: ["filterForm"], descendants: true, isSignal: true }], ngImport: i0, template: "<div>\n <div>\n <h5>{{ filter() ? ('mngFilter.titleEdit' | translate) : ('mngFilter.titleAdd' | translate) }}</h5>\n </div>\n <form #filterForm=\"ngForm\" (ngSubmit)=\"onFormSubmit(filterForm)\" class=\"flex flex-column align-items-center lg:flex-row gap-3\">\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=\"true\"\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]=\"matchModeOptions()\"\n [placeholder]=\"'mngFilter.matchMode' | translate\"\n [disabled]=\"!propertyControl.value\"\n class=\"align-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-column\">\n @switch (selectedDescriptor()?.filterType) {\n @case (FilterTypeEnum.Number) {\n @if (matchModeModel() === FilterMatchMode.Between) {\n <mng-number-range\n className=\"mng-column-filter-number-input\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedDescriptor()?.numberUseGrouping ?? false\"\n [minFractionDigits]=\"numberConfig()?.fractionsMin\"\n [maxFractionDigits]=\"numberConfig()?.fractionsMax\"\n required=\"true\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-column-filter-number-input\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [styleClass]=\"'w-full'\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedDescriptor()?.numberUseGrouping\"\n [minFractionDigits]=\"numberConfig()?.fractionsMin\"\n [maxFractionDigits]=\"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 [showTime]=\"dateConfig()?.showTime ?? false\"\n [showSeconds]=\"dateConfig()?.showSeconds ?? false\"\n [dateFormat]=\"dateConfig()?.format\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\"></mng-date-range>\n } @else {\n <p-calendar\n appendTo=\"body\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [styleClass]=\"'w-full'\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [showIcon]=\"true\"\n [showTime]=\"dateConfig()?.showTime ?? false\"\n [showSeconds]=\"dateConfig()?.showSeconds ?? false\"\n [dateFormat]=\"dateConfig()?.format\"\n [firstDayOfWeek]=\"1\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\">\n </p-calendar>\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 <input\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n type=\"text\"\n pInputText\n class=\"mng-column-filter-string-input w-full\"\n [attr.placeholder]=\"'mngFilter.value' | translate\"\n [mngInputTrim]=\"selectedDescriptor()?.trimOption!\"\n [disabled]=\"!matchModeModel()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\" />\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]=\"lookupFilterDescriptor.multiselect\"\n [autoClear]=\"lookupFilterDescriptor.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookupFilterDescriptor.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookupFilterDescriptor.autocompleteInlineSearch ?? false\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [className]=\"lookupFilterDescriptor.className\"\n [dropdownClassName]=\"lookupFilterDescriptor.dropdownClassName\"\n [searchTrim]=\"selectedDescriptor()?.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 [multiselect]=\"lookupFilterDescriptor.multiselect\"\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 }\n </ng-template>\n </div>\n }\n @if (selectedDescriptor()?.filterType === FilterTypeEnum.String && matchModeModel() !== FilterMatchMode.Exists && matchModeModel() !== FilterMatchMode.DoesNotExist) {\n <div class=\"flex align-items-center gap-2\">\n <p-checkbox [(ngModel)]=\"caseSensitiveModel\" name=\"caseSensitive\" binary=\"true\" id=\"caseSensitive\" />\n <label for=\"caseSensitive\">{{ 'mngFilter.caseSensitive' | translate }}</label>\n </div>\n }\n <div class=\"flex justify-content-end\">\n <button pButton type=\"submit\" class=\"align-self-end\">\n {{ (filter() ? 'general.apply' : 'general.add') | translate }}\n </button>\n </div>\n </form>\n @if (formSubmitted() && filterForm.invalid) {\n <p-messages [value]=\"formErrorMessage()\" class=\"w-full\"></p-messages>\n }\n</div>\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", "appendTo"], outputs: ["valueChange", "blur"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "directive", type: InputTrimDirective, selector: "[mngInputTrim]", inputs: ["mngInputTrim"] }, { kind: "component", type: NumberRangeComponent, selector: "mng-number-range", inputs: ["placeholder", "useGrouping", "minFractionDigits", "maxFractionDigits", "required", "disabled"], outputs: ["keyDown"] }, { kind: "ngmodule", type: InputNumberModule }, { kind: "component", type: i4.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "component", type: DateRangeComponent, selector: "mng-date-range", inputs: ["placeholder", "showTime", "showSeconds", "dateFormat", "className", "required", "disabled"] }, { kind: "ngmodule", type: CalendarModule }, { kind: "component", type: i2.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepYearPicker", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "directive", type: i4$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: AutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "optionsTrackProperty", "optionsValueProperty", "optionsLabelProperty", "optionsLabelTranslate", "inlineSearch", "openOnFocus", "multiselect", "placeholder", "className", "dropdownClassName", "showClear", "autoClear", "selectFirst", "searchTrim", "disabled"], outputs: ["valueChange", "blur"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i6.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: MessagesModule }, { kind: "component", type: i7.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i5.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1135
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", type: FilterFormComponent, isStandalone: true, selector: "mng-filter-form", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, descriptors: { classPropertyName: "descriptors", publicName: "descriptors", isSignal: true, isRequired: true, 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 } }, outputs: { apply: "apply" }, host: { classAttribute: "flex flex-grow-1" }, viewQueries: [{ propertyName: "filterForm", first: true, predicate: ["filterForm"], descendants: true, isSignal: true }], ngImport: i0, template: "<div>\n <div>\n <h5>{{ filter() ? ('mngFilter.titleEdit' | translate) : ('mngFilter.titleAdd' | translate) }}</h5>\n </div>\n <form #filterForm=\"ngForm\" (ngSubmit)=\"onFormSubmit(filterForm)\" class=\"flex flex-column align-items-center lg:flex-row gap-3\">\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=\"true\"\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]=\"matchModeOptions()\"\n [placeholder]=\"'mngFilter.matchMode' | translate\"\n [disabled]=\"!propertyControl.value\"\n class=\"align-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-column\">\n @switch (selectedDescriptor()?.filterType) {\n @case (FilterTypeEnum.Number) {\n @if (matchModeModel() === FilterMatchMode.Between) {\n <mng-number-range\n className=\"mng-column-filter-number-input\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedDescriptor()?.numberUseGrouping ?? false\"\n [minFractionDigits]=\"numberConfig()?.fractionsMin\"\n [maxFractionDigits]=\"numberConfig()?.fractionsMax\"\n required=\"true\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-column-filter-number-input\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [styleClass]=\"'w-full'\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedDescriptor()?.numberUseGrouping\"\n [minFractionDigits]=\"numberConfig()?.fractionsMin\"\n [maxFractionDigits]=\"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 [showTime]=\"dateConfig()?.showTime ?? false\"\n [showSeconds]=\"dateConfig()?.showSeconds ?? false\"\n [dateFormat]=\"dateConfig()?.format\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\"></mng-date-range>\n } @else {\n <p-calendar\n appendTo=\"body\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [styleClass]=\"'w-full'\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [showIcon]=\"true\"\n [showTime]=\"dateConfig()?.showTime ?? false\"\n [showSeconds]=\"dateConfig()?.showSeconds ?? false\"\n [dateFormat]=\"dateConfig()?.format\"\n [firstDayOfWeek]=\"1\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\">\n </p-calendar>\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 (selectedDescriptor()?.genericValueProvider && genericValueDataProvider()) {\n <!-- conditional rendering on the placeholder is there because of styling issues with PrimeNG -->\n <!-- (PrimeNG applies the .p-placeholder class to programmatically set values, making them greyed out) -->\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"genericValueDataProvider()\"\n [className]=\"selectedDescriptor()?.className\"\n [dropdownClassName]=\"selectedDescriptor()?.dropdownClassName\"\n [placeholder]=\"valueModel() ? undefined : ('mngFilter.value' | translate)\"\n allowInput=\"true\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\"></mng-dropdown>\n } @else {\n <input\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n type=\"text\"\n pInputText\n class=\"mng-column-filter-string-input w-full\"\n [attr.placeholder]=\"'mngFilter.value' | translate\"\n [mngInputTrim]=\"selectedDescriptor()?.trimOption!\"\n [disabled]=\"!matchModeModel()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\" />\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]=\"lookupFilterDescriptor.multiselect\"\n [autoClear]=\"lookupFilterDescriptor.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookupFilterDescriptor.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookupFilterDescriptor.autocompleteInlineSearch ?? false\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [className]=\"lookupFilterDescriptor.className\"\n [dropdownClassName]=\"lookupFilterDescriptor.dropdownClassName\"\n [searchTrim]=\"selectedDescriptor()?.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 [multiselect]=\"lookupFilterDescriptor.multiselect\"\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 (selectedDescriptor()?.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 @if (selectedDescriptor()?.filterType === FilterTypeEnum.String && matchModeModel() !== FilterMatchMode.Exists && matchModeModel() !== FilterMatchMode.DoesNotExist) {\n <div class=\"flex align-items-center gap-2\">\n <p-checkbox [(ngModel)]=\"caseSensitiveModel\" name=\"caseSensitive\" binary=\"true\" id=\"caseSensitive\" />\n <label for=\"caseSensitive\">{{ 'mngFilter.caseSensitive' | translate }}</label>\n </div>\n }\n <div class=\"flex justify-content-end\">\n <button pButton type=\"submit\" class=\"align-self-end\">\n {{ (filter() ? 'general.apply' : 'general.add') | translate }}\n </button>\n </div>\n </form>\n @if (formSubmitted() && filterForm.invalid) {\n <p-messages [value]=\"formErrorMessage()\" class=\"w-full\"></p-messages>\n }\n</div>\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", "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],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]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "directive", type: InputTrimDirective, selector: "[mngInputTrim]", inputs: ["mngInputTrim"] }, { kind: "component", type: NumberRangeComponent, selector: "mng-number-range", inputs: ["placeholder", "useGrouping", "minFractionDigits", "maxFractionDigits", "required", "disabled"], outputs: ["keyDown"] }, { kind: "ngmodule", type: InputNumberModule }, { kind: "component", type: i4.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "component", type: DateRangeComponent, selector: "mng-date-range", inputs: ["placeholder", "showTime", "showSeconds", "dateFormat", "className", "required", "disabled"] }, { kind: "ngmodule", type: CalendarModule }, { kind: "component", type: i2$1.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepYearPicker", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "directive", type: i4$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: AutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "optionsTrackProperty", "optionsValueProperty", "optionsLabelProperty", "optionsLabelTranslate", "inlineSearch", "openOnFocus", "multiselect", "placeholder", "className", "dropdownClassName", "showClear", "autoClear", "selectFirst", "searchTrim", "disabled"], outputs: ["valueChange", "blur"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i6.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: MessagesModule }, { kind: "component", type: i7.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i5.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: DropdownModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1066
1136
|
}
|
|
1067
1137
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: FilterFormComponent, decorators: [{
|
|
1068
1138
|
type: Component,
|
|
@@ -1080,25 +1150,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImpor
|
|
|
1080
1150
|
CheckboxModule,
|
|
1081
1151
|
MessagesModule,
|
|
1082
1152
|
InputTextModule,
|
|
1083
|
-
NgTemplateOutlet
|
|
1153
|
+
NgTemplateOutlet,
|
|
1154
|
+
DropdownModule
|
|
1084
1155
|
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
1085
1156
|
class: 'flex flex-grow-1'
|
|
1086
|
-
}, template: "<div>\n <div>\n <h5>{{ filter() ? ('mngFilter.titleEdit' | translate) : ('mngFilter.titleAdd' | translate) }}</h5>\n </div>\n <form #filterForm=\"ngForm\" (ngSubmit)=\"onFormSubmit(filterForm)\" class=\"flex flex-column align-items-center lg:flex-row gap-3\">\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=\"true\"\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]=\"matchModeOptions()\"\n [placeholder]=\"'mngFilter.matchMode' | translate\"\n [disabled]=\"!propertyControl.value\"\n class=\"align-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-column\">\n @switch (selectedDescriptor()?.filterType) {\n @case (FilterTypeEnum.Number) {\n @if (matchModeModel() === FilterMatchMode.Between) {\n <mng-number-range\n className=\"mng-column-filter-number-input\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedDescriptor()?.numberUseGrouping ?? false\"\n [minFractionDigits]=\"numberConfig()?.fractionsMin\"\n [maxFractionDigits]=\"numberConfig()?.fractionsMax\"\n required=\"true\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-column-filter-number-input\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [styleClass]=\"'w-full'\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedDescriptor()?.numberUseGrouping\"\n [minFractionDigits]=\"numberConfig()?.fractionsMin\"\n [maxFractionDigits]=\"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 [showTime]=\"dateConfig()?.showTime ?? false\"\n [showSeconds]=\"dateConfig()?.showSeconds ?? false\"\n [dateFormat]=\"dateConfig()?.format\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\"></mng-date-range>\n } @else {\n <p-calendar\n appendTo=\"body\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [styleClass]=\"'w-full'\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [showIcon]=\"true\"\n [showTime]=\"dateConfig()?.showTime ?? false\"\n [showSeconds]=\"dateConfig()?.showSeconds ?? false\"\n [dateFormat]=\"dateConfig()?.format\"\n [firstDayOfWeek]=\"1\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\">\n </p-calendar>\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 <input\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n type=\"text\"\n pInputText\n class=\"mng-column-filter-string-input w-full\"\n [attr.placeholder]=\"'mngFilter.value' | translate\"\n [mngInputTrim]=\"selectedDescriptor()?.trimOption!\"\n [disabled]=\"!matchModeModel()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\" />\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]=\"lookupFilterDescriptor.multiselect\"\n [autoClear]=\"lookupFilterDescriptor.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookupFilterDescriptor.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookupFilterDescriptor.autocompleteInlineSearch ?? false\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [className]=\"lookupFilterDescriptor.className\"\n [dropdownClassName]=\"lookupFilterDescriptor.dropdownClassName\"\n [searchTrim]=\"selectedDescriptor()?.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 [multiselect]=\"lookupFilterDescriptor.multiselect\"\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 }\n </ng-template>\n </div>\n }\n @if (selectedDescriptor()?.filterType === FilterTypeEnum.String && matchModeModel() !== FilterMatchMode.Exists && matchModeModel() !== FilterMatchMode.DoesNotExist) {\n <div class=\"flex align-items-center gap-2\">\n <p-checkbox [(ngModel)]=\"caseSensitiveModel\" name=\"caseSensitive\" binary=\"true\" id=\"caseSensitive\" />\n <label for=\"caseSensitive\">{{ 'mngFilter.caseSensitive' | translate }}</label>\n </div>\n }\n <div class=\"flex justify-content-end\">\n <button pButton type=\"submit\" class=\"align-self-end\">\n {{ (filter() ? 'general.apply' : 'general.add') | translate }}\n </button>\n </div>\n </form>\n @if (formSubmitted() && filterForm.invalid) {\n <p-messages [value]=\"formErrorMessage()\" class=\"w-full\"></p-messages>\n }\n</div>\n" }]
|
|
1157
|
+
}, template: "<div>\n <div>\n <h5>{{ filter() ? ('mngFilter.titleEdit' | translate) : ('mngFilter.titleAdd' | translate) }}</h5>\n </div>\n <form #filterForm=\"ngForm\" (ngSubmit)=\"onFormSubmit(filterForm)\" class=\"flex flex-column align-items-center lg:flex-row gap-3\">\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=\"true\"\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]=\"matchModeOptions()\"\n [placeholder]=\"'mngFilter.matchMode' | translate\"\n [disabled]=\"!propertyControl.value\"\n class=\"align-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-column\">\n @switch (selectedDescriptor()?.filterType) {\n @case (FilterTypeEnum.Number) {\n @if (matchModeModel() === FilterMatchMode.Between) {\n <mng-number-range\n className=\"mng-column-filter-number-input\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedDescriptor()?.numberUseGrouping ?? false\"\n [minFractionDigits]=\"numberConfig()?.fractionsMin\"\n [maxFractionDigits]=\"numberConfig()?.fractionsMax\"\n required=\"true\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-column-filter-number-input\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [styleClass]=\"'w-full'\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedDescriptor()?.numberUseGrouping\"\n [minFractionDigits]=\"numberConfig()?.fractionsMin\"\n [maxFractionDigits]=\"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 [showTime]=\"dateConfig()?.showTime ?? false\"\n [showSeconds]=\"dateConfig()?.showSeconds ?? false\"\n [dateFormat]=\"dateConfig()?.format\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\"></mng-date-range>\n } @else {\n <p-calendar\n appendTo=\"body\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [styleClass]=\"'w-full'\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [showIcon]=\"true\"\n [showTime]=\"dateConfig()?.showTime ?? false\"\n [showSeconds]=\"dateConfig()?.showSeconds ?? false\"\n [dateFormat]=\"dateConfig()?.format\"\n [firstDayOfWeek]=\"1\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\">\n </p-calendar>\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 (selectedDescriptor()?.genericValueProvider && genericValueDataProvider()) {\n <!-- conditional rendering on the placeholder is there because of styling issues with PrimeNG -->\n <!-- (PrimeNG applies the .p-placeholder class to programmatically set values, making them greyed out) -->\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"genericValueDataProvider()\"\n [className]=\"selectedDescriptor()?.className\"\n [dropdownClassName]=\"selectedDescriptor()?.dropdownClassName\"\n [placeholder]=\"valueModel() ? undefined : ('mngFilter.value' | translate)\"\n allowInput=\"true\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\"></mng-dropdown>\n } @else {\n <input\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n type=\"text\"\n pInputText\n class=\"mng-column-filter-string-input w-full\"\n [attr.placeholder]=\"'mngFilter.value' | translate\"\n [mngInputTrim]=\"selectedDescriptor()?.trimOption!\"\n [disabled]=\"!matchModeModel()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\" />\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]=\"lookupFilterDescriptor.multiselect\"\n [autoClear]=\"lookupFilterDescriptor.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookupFilterDescriptor.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookupFilterDescriptor.autocompleteInlineSearch ?? false\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [className]=\"lookupFilterDescriptor.className\"\n [dropdownClassName]=\"lookupFilterDescriptor.dropdownClassName\"\n [searchTrim]=\"selectedDescriptor()?.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 [multiselect]=\"lookupFilterDescriptor.multiselect\"\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 (selectedDescriptor()?.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 @if (selectedDescriptor()?.filterType === FilterTypeEnum.String && matchModeModel() !== FilterMatchMode.Exists && matchModeModel() !== FilterMatchMode.DoesNotExist) {\n <div class=\"flex align-items-center gap-2\">\n <p-checkbox [(ngModel)]=\"caseSensitiveModel\" name=\"caseSensitive\" binary=\"true\" id=\"caseSensitive\" />\n <label for=\"caseSensitive\">{{ 'mngFilter.caseSensitive' | translate }}</label>\n </div>\n }\n <div class=\"flex justify-content-end\">\n <button pButton type=\"submit\" class=\"align-self-end\">\n {{ (filter() ? 'general.apply' : 'general.add') | translate }}\n </button>\n </div>\n </form>\n @if (formSubmitted() && filterForm.invalid) {\n <p-messages [value]=\"formErrorMessage()\" class=\"w-full\"></p-messages>\n }\n</div>\n" }]
|
|
1087
1158
|
}], ctorParameters: () => [] });
|
|
1088
1159
|
|
|
1160
|
+
const COMMONS_TABLE_FEATURE_CONFIG_IT = new InjectionToken('COMMONS_TABLE_FEATURE_CONFIG');
|
|
1161
|
+
|
|
1089
1162
|
class FilterOverlayWithTagComponent {
|
|
1163
|
+
static { this.SEARCH_WORD_LIMIT_MAX = 4; }
|
|
1090
1164
|
constructor() {
|
|
1091
1165
|
this.primeTable = inject(Table);
|
|
1092
1166
|
this.dataListService = inject((DataListService));
|
|
1093
1167
|
this.moduleConfig = inject(COMMONS_MODULE_CONFIG_IT, { optional: true });
|
|
1168
|
+
this.tableConfig = inject(COMMONS_TABLE_FEATURE_CONFIG_IT, { optional: true });
|
|
1094
1169
|
this.descriptors = input.required();
|
|
1095
1170
|
this.model = input.required();
|
|
1171
|
+
this.enableSearch = input(false, { transform: booleanAttribute });
|
|
1172
|
+
this.search = input();
|
|
1173
|
+
this.searchLimitWordMax = input(undefined);
|
|
1174
|
+
this.enableCaseSensitive = input(true, { transform: booleanAttribute });
|
|
1096
1175
|
this.filterOverlay = viewChild.required(OverlayPanel);
|
|
1176
|
+
this.filterFormComponent = viewChild(FilterFormComponent);
|
|
1097
1177
|
this.templates = contentChildren(TemplateDirective);
|
|
1098
1178
|
this.titleTemplate = computed(() => findTemplateByName([...this.templates()], 'title'));
|
|
1099
1179
|
this.filters = computed(() => {
|
|
1100
1180
|
return this.setInitialFilters(this.dataListService.filterMeta());
|
|
1101
1181
|
});
|
|
1182
|
+
this.showFilterButton = computed(() => this.descriptors().length > 0);
|
|
1102
1183
|
this.activeFilters = computed(() => {
|
|
1103
1184
|
const filterEntry = this.filters();
|
|
1104
1185
|
return this.descriptors()
|
|
@@ -1116,19 +1197,41 @@ class FilterOverlayWithTagComponent {
|
|
|
1116
1197
|
this.activeFilterProperties = computed(() => this.activeFilters().map(f => f.descriptor.property));
|
|
1117
1198
|
this.filterEdit = signal(undefined);
|
|
1118
1199
|
this.serializationCfg = {};
|
|
1200
|
+
// global search model
|
|
1201
|
+
this.searchValue = computed(() => this.search()?.value);
|
|
1202
|
+
this.searchCaseSensitive = computed(() => this.search()?.caseSensitive);
|
|
1203
|
+
this.searchWordLimitMaxError = signal(false);
|
|
1204
|
+
this.searchWordLimitMaxCmp = computed(() => {
|
|
1205
|
+
const inputLimit = this.searchLimitWordMax();
|
|
1206
|
+
if (inputLimit !== undefined) {
|
|
1207
|
+
return inputLimit;
|
|
1208
|
+
}
|
|
1209
|
+
return this.tableConfig?.searchLimitMaxWords !== undefined ? this.tableConfig?.searchLimitMaxWords : FilterOverlayWithTagComponent.SEARCH_WORD_LIMIT_MAX;
|
|
1210
|
+
});
|
|
1211
|
+
this.searchValueSubject = new BehaviorSubject(undefined);
|
|
1212
|
+
this.searchCaseSensitiveSubject = new BehaviorSubject(undefined);
|
|
1119
1213
|
// UI utilities
|
|
1120
1214
|
this.clickedOnFilterEvent = undefined;
|
|
1121
1215
|
filterApplySerializationConfigToCmp(this.moduleConfig, this.serializationCfg);
|
|
1216
|
+
combineLatest([this.searchValueSubject.pipe(debounceTime(500), distinctUntilChanged()), this.searchCaseSensitiveSubject])
|
|
1217
|
+
// NOTE: skip is used to ignore propagating the initial value of the subjects
|
|
1218
|
+
.pipe(skip(1), takeUntilDestroyed())
|
|
1219
|
+
.subscribe(([value, caseSensitive]) => {
|
|
1220
|
+
this.updatePrimeTableGlobalFilter(value == null ? this.search()?.value ?? '' : value, caseSensitive == null ? this.search()?.caseSensitive ?? undefined : caseSensitive);
|
|
1221
|
+
});
|
|
1122
1222
|
}
|
|
1123
1223
|
onFilterFormApply(event) {
|
|
1124
1224
|
const descriptor = this.descriptors().find(d => d.property === event.property);
|
|
1125
1225
|
if (!descriptor) {
|
|
1126
1226
|
return;
|
|
1127
1227
|
}
|
|
1128
|
-
|
|
1228
|
+
const filterData = {
|
|
1129
1229
|
...filterSetMetadataOnDisplayChange({ caseSensitive: event.caseSensitive }, event.matchMode, event.value, descriptor.filterType, filterGetDateConfig(descriptor, this.serializationCfg)),
|
|
1130
1230
|
descriptor: descriptor
|
|
1131
|
-
}
|
|
1231
|
+
};
|
|
1232
|
+
this.updatePrimeTableFilter(filterData);
|
|
1233
|
+
// this keeps the UI updated properly before closing the overlay
|
|
1234
|
+
this.filterEdit.set(filterData);
|
|
1132
1235
|
// Resetting the form is done in the onOverlayHide callback because resetting the
|
|
1133
1236
|
// values here renders empty inputs for a split second before closing the overlay
|
|
1134
1237
|
this.filterOverlay().hide();
|
|
@@ -1148,11 +1251,32 @@ class FilterOverlayWithTagComponent {
|
|
|
1148
1251
|
onFilterAdd(event) {
|
|
1149
1252
|
this.onFilterAddOrEdit(undefined, event);
|
|
1150
1253
|
}
|
|
1254
|
+
onSearchChange(value) {
|
|
1255
|
+
const searchWordLimitMax = this.searchWordLimitMaxCmp();
|
|
1256
|
+
if (searchWordLimitMax !== null) {
|
|
1257
|
+
const wordCount = value.split(/\s+/).filter(word => word.length > 0).length;
|
|
1258
|
+
this.searchWordLimitMaxError.set(wordCount > searchWordLimitMax);
|
|
1259
|
+
}
|
|
1260
|
+
else {
|
|
1261
|
+
this.searchWordLimitMaxError.set(false);
|
|
1262
|
+
}
|
|
1263
|
+
if (!this.searchWordLimitMaxError()) {
|
|
1264
|
+
this.searchValueSubject.next(value);
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
onSearchCaseSensitiveChange(value) {
|
|
1268
|
+
this.searchCaseSensitiveSubject.next(value);
|
|
1269
|
+
}
|
|
1151
1270
|
onOverlayHide() {
|
|
1271
|
+
// resetting the form is done here for a smoother animation
|
|
1272
|
+
if (this.filterFormComponent !== undefined) {
|
|
1273
|
+
this.filterFormComponent()?.resetForm();
|
|
1274
|
+
}
|
|
1152
1275
|
if (this.clickedOnFilterEvent) {
|
|
1153
1276
|
// show the overlay again if the user clicked another filter
|
|
1154
1277
|
setTimeout(() => {
|
|
1155
|
-
this.
|
|
1278
|
+
this.filterEdit.set(this.clickedOnFilterEvent?.filter);
|
|
1279
|
+
this.filterOverlay().show(this.clickedOnFilterEvent?.event);
|
|
1156
1280
|
this.clickedOnFilterEvent = undefined;
|
|
1157
1281
|
}, 0);
|
|
1158
1282
|
return;
|
|
@@ -1166,17 +1290,16 @@ class FilterOverlayWithTagComponent {
|
|
|
1166
1290
|
// If user clicks on the same filter or add that is already open, close the overlay
|
|
1167
1291
|
if (this.filterOverlay().overlayVisible && this.filterEdit()?.descriptor.property === filter?.descriptor.property) {
|
|
1168
1292
|
this.filterOverlay().hide();
|
|
1169
|
-
this.filterEdit.set(undefined);
|
|
1170
1293
|
return;
|
|
1171
1294
|
}
|
|
1172
|
-
this.filterEdit.set(filter);
|
|
1173
1295
|
if (this.filterOverlay().overlayVisible) {
|
|
1174
1296
|
// In case the user clicks another filter, 're-showing' the overlay in
|
|
1175
1297
|
// the new position is done in the onOverlayHide callback
|
|
1176
|
-
this.clickedOnFilterEvent = event;
|
|
1298
|
+
this.clickedOnFilterEvent = { event, filter };
|
|
1177
1299
|
this.filterOverlay().hide();
|
|
1178
1300
|
}
|
|
1179
1301
|
else {
|
|
1302
|
+
this.filterEdit.set(filter);
|
|
1180
1303
|
this.filterOverlay().show(event);
|
|
1181
1304
|
}
|
|
1182
1305
|
}
|
|
@@ -1199,12 +1322,33 @@ class FilterOverlayWithTagComponent {
|
|
|
1199
1322
|
this.primeTable.filters[filter.descriptor.property] = { ...filter };
|
|
1200
1323
|
this.primeTable._filter();
|
|
1201
1324
|
}
|
|
1325
|
+
updatePrimeTableGlobalFilter(searchQuery, caseSensitive = false) {
|
|
1326
|
+
// match mode needs to be set for inline search
|
|
1327
|
+
this.primeTable.filters['global'] = { ...{ value: searchQuery, matchMode: 'contains', caseSensitive: caseSensitive } };
|
|
1328
|
+
this.primeTable._filter();
|
|
1329
|
+
}
|
|
1202
1330
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: FilterOverlayWithTagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1203
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", type: FilterOverlayWithTagComponent, isStandalone: true, selector: "mng-filter-overlay-with-tag", inputs: { descriptors: { classPropertyName: "descriptors", publicName: "descriptors", isSignal: true, isRequired: true, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null } }, queries: [{ propertyName: "templates", predicate: TemplateDirective, isSignal: true }], viewQueries: [{ propertyName: "filterOverlay", first: true, predicate: OverlayPanel, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex align-items-center flex-grow-1\">\n @if (titleTemplate()) {\n <ng-container *ngTemplateOutlet=\"titleTemplate()\"></ng-container>\n }\n <p-button\n
|
|
1331
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", type: FilterOverlayWithTagComponent, isStandalone: true, selector: "mng-filter-overlay-with-tag", inputs: { descriptors: { classPropertyName: "descriptors", publicName: "descriptors", isSignal: true, isRequired: true, 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 } }, queries: [{ propertyName: "templates", predicate: TemplateDirective, isSignal: true }], viewQueries: [{ propertyName: "filterOverlay", first: true, predicate: OverlayPanel, descendants: true, isSignal: true }, { propertyName: "filterFormComponent", first: true, predicate: FilterFormComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex align-items-center flex-grow-1\">\n @if (titleTemplate()) {\n <ng-container *ngTemplateOutlet=\"titleTemplate()\"></ng-container>\n }\n @if (showFilterButton()) {\n <p-button\n icon=\"pi pi-filter\"\n rounded=\"true\"\n [severity]=\"activeFilters().length > 0 ? 'primary' : 'secondary'\"\n size=\"small\"\n (click)=\"onFilterAdd($event)\"\n [styleClass]=\"'my-1 mr-2' + (titleTemplate() ? ' ml-3' : '')\">\n </p-button>\n }\n @if (enableSearch()) {\n <div class=\"col-4\" [ngClass]=\"{'ml-3': !showFilterButton() && titleTemplate()}\">\n <span class=\"p-input-icon-left w-full\">\n <i class=\"pi pi-search\"></i>\n <input\n [ngModel]=\"searchValue()\"\n (ngModelChange)=\"onSearchChange($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 (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</div>\n@if (activeFilters().length > 0) {\n <div class=\"flex align-items-center flex-wrap mt-2\">\n @for (filter of activeFilters(); track filter.descriptor.property) {\n <mng-filter-active-tag [model]=\"model()\" [filter]=\"filter\" (edit)=\"onFilterEdit($event)\" (remove)=\"onFilterRemove($event)\" />\n }\n </div>\n}\n<p-overlayPanel #op [showCloseIcon]=\"true\" (onHide)=\"onOverlayHide()\" appendTo=\"body\">\n <mng-filter-form\n [model]=\"model()\"\n [descriptors]=\"descriptors()\"\n [filter]=\"filterEdit()\"\n [disabledProperties]=\"activeFilterProperties()\"\n [overlay]=\"op\"\n (apply)=\"onFilterFormApply($event)\" />\n</p-overlayPanel>\n", styles: [".toggle-button-input{position:absolute;right:.35rem;top:50%;transform:translateY(-50%)}\n"], dependencies: [{ kind: "ngmodule", type: OverlayPanelModule }, { kind: "component", type: i1$2.OverlayPanel, selector: "p-overlayPanel", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "showCloseIcon", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: FilterFormComponent, selector: "mng-filter-form", inputs: ["title", "descriptors", "model", "filter", "overlay", "disabledProperties"], outputs: ["apply"] }, { kind: "component", type: Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: FilterActiveTagComponent, selector: "mng-filter-active-tag", inputs: ["model", "filter"], outputs: ["edit", "remove"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i5.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "ngmodule", type: PaginatorModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ToggleButtonModule }, { kind: "component", type: i5$1.ToggleButton, selector: "p-toggleButton", inputs: ["onLabel", "offLabel", "onIcon", "offIcon", "ariaLabel", "ariaLabelledBy", "disabled", "style", "styleClass", "inputId", "tabindex", "iconPos", "autofocus"], outputs: ["onChange"] }, { kind: "ngmodule", type: InputGroupModule }, { kind: "ngmodule", type: InputGroupAddonModule }, { kind: "ngmodule", type: CheckboxModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1204
1332
|
}
|
|
1205
1333
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: FilterOverlayWithTagComponent, decorators: [{
|
|
1206
1334
|
type: Component,
|
|
1207
|
-
args: [{ standalone: true, selector: 'mng-filter-overlay-with-tag', imports: [
|
|
1335
|
+
args: [{ standalone: true, selector: 'mng-filter-overlay-with-tag', imports: [
|
|
1336
|
+
OverlayPanelModule,
|
|
1337
|
+
TranslateModule,
|
|
1338
|
+
TagModule,
|
|
1339
|
+
FilterFormComponent,
|
|
1340
|
+
Button,
|
|
1341
|
+
FilterActiveTagComponent,
|
|
1342
|
+
NgTemplateOutlet,
|
|
1343
|
+
InputTextModule,
|
|
1344
|
+
PaginatorModule,
|
|
1345
|
+
NgClass,
|
|
1346
|
+
ToggleButtonModule,
|
|
1347
|
+
InputGroupModule,
|
|
1348
|
+
InputGroupAddonModule,
|
|
1349
|
+
CheckboxModule,
|
|
1350
|
+
NgStyle
|
|
1351
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex align-items-center flex-grow-1\">\n @if (titleTemplate()) {\n <ng-container *ngTemplateOutlet=\"titleTemplate()\"></ng-container>\n }\n @if (showFilterButton()) {\n <p-button\n icon=\"pi pi-filter\"\n rounded=\"true\"\n [severity]=\"activeFilters().length > 0 ? 'primary' : 'secondary'\"\n size=\"small\"\n (click)=\"onFilterAdd($event)\"\n [styleClass]=\"'my-1 mr-2' + (titleTemplate() ? ' ml-3' : '')\">\n </p-button>\n }\n @if (enableSearch()) {\n <div class=\"col-4\" [ngClass]=\"{'ml-3': !showFilterButton() && titleTemplate()}\">\n <span class=\"p-input-icon-left w-full\">\n <i class=\"pi pi-search\"></i>\n <input\n [ngModel]=\"searchValue()\"\n (ngModelChange)=\"onSearchChange($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 (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</div>\n@if (activeFilters().length > 0) {\n <div class=\"flex align-items-center flex-wrap mt-2\">\n @for (filter of activeFilters(); track filter.descriptor.property) {\n <mng-filter-active-tag [model]=\"model()\" [filter]=\"filter\" (edit)=\"onFilterEdit($event)\" (remove)=\"onFilterRemove($event)\" />\n }\n </div>\n}\n<p-overlayPanel #op [showCloseIcon]=\"true\" (onHide)=\"onOverlayHide()\" appendTo=\"body\">\n <mng-filter-form\n [model]=\"model()\"\n [descriptors]=\"descriptors()\"\n [filter]=\"filterEdit()\"\n [disabledProperties]=\"activeFilterProperties()\"\n [overlay]=\"op\"\n (apply)=\"onFilterFormApply($event)\" />\n</p-overlayPanel>\n", styles: [".toggle-button-input{position:absolute;right:.35rem;top:50%;transform:translateY(-50%)}\n"] }]
|
|
1208
1352
|
}], ctorParameters: () => [] });
|
|
1209
1353
|
|
|
1210
1354
|
function tableNotificationError(translate, table, error, messageService) {
|
|
@@ -1276,8 +1420,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImpor
|
|
|
1276
1420
|
}]
|
|
1277
1421
|
}] });
|
|
1278
1422
|
|
|
1279
|
-
const COMMONS_TABLE_FEATURE_CONFIG_IT = new InjectionToken('COMMONS_TABLE_FEATURE_CONFIG');
|
|
1280
|
-
|
|
1281
1423
|
class TableComponent {
|
|
1282
1424
|
constructor() {
|
|
1283
1425
|
this.cmpTypeName = 'TableComponent';
|
|
@@ -1310,7 +1452,7 @@ class TableComponent {
|
|
|
1310
1452
|
this.columnLastMinWidth = input();
|
|
1311
1453
|
this.columnsColspan = computed(() => this.visibleColumns().length + (this.hasLastColumn() ? 1 : 0) + (this.selectionEnabled() ? 1 : 0) + (this.rowReorderEnabled() ? 1 : 0));
|
|
1312
1454
|
this.hasTitleDisplay = computed(() => this.captionTemplate() || this.captionComponent() || this.descriptor().title);
|
|
1313
|
-
this.isCaptionVisible = computed(() => this.hasTitleDisplay() || this.overlayWithTagFilters().length > 0);
|
|
1455
|
+
this.isCaptionVisible = computed(() => this.hasTitleDisplay() || this.overlayWithTagFilters().length > 0 || this.descriptor().search);
|
|
1314
1456
|
// component inputs
|
|
1315
1457
|
this.captionComponent = input();
|
|
1316
1458
|
this.columnCustomLastComponent = input();
|
|
@@ -1394,9 +1536,14 @@ class TableComponent {
|
|
|
1394
1536
|
this.visibleColumns = computed(() => this.columns().filter(col => col.isVisible));
|
|
1395
1537
|
// filter, sort
|
|
1396
1538
|
this.filterDescriptors = computed(() => this.descriptor().filters);
|
|
1539
|
+
this.genericFilterDescriptor = computed(() => this.descriptor().genericFilter);
|
|
1540
|
+
this.filterDescriptorsFromGeneric = signal([]);
|
|
1397
1541
|
this.hasColumnFilters = computed(() => (this.defaultFilterDisplayType === FilterDisplayTypeEnum.OverlayWithTag && this.filterDescriptors().some(d => d.displayType === FilterDisplayTypeEnum.Column)) ||
|
|
1398
1542
|
(this.defaultFilterDisplayType === FilterDisplayTypeEnum.Column && this.filterDescriptors().some(d => d.displayType == null)));
|
|
1399
|
-
this.overlayWithTagFilters = computed(() =>
|
|
1543
|
+
this.overlayWithTagFilters = computed(() => {
|
|
1544
|
+
const filters = this.filterDescriptors().filter(d => (d.displayType == null && this.defaultFilterDisplayType === FilterDisplayTypeEnum.OverlayWithTag) || d.displayType === FilterDisplayTypeEnum.OverlayWithTag);
|
|
1545
|
+
return filters.concat(this.filterDescriptorsFromGeneric());
|
|
1546
|
+
});
|
|
1400
1547
|
this.defaultParams = computed(() => this.computeDefaultDataListParams());
|
|
1401
1548
|
this.anyColumnVisible = computed(() => this.visibleColumns().length > 0);
|
|
1402
1549
|
this.hasCustomLastColumn = computed(() => this.columnCustomLastComponent || this.columnCustomLastTemplate());
|
|
@@ -1404,6 +1551,7 @@ class TableComponent {
|
|
|
1404
1551
|
// layout prefs
|
|
1405
1552
|
this.areColumnsReorderable = computed(() => this.descriptor().columns.some(value => value.isReorderable));
|
|
1406
1553
|
this.areColumnsToggleable = computed(() => this.descriptor().columns.some(value => value.isToggleable));
|
|
1554
|
+
this.globalSearchParamFromUrl = signal(undefined);
|
|
1407
1555
|
// other
|
|
1408
1556
|
this.routerIsNavigationOutsideInProgress = false;
|
|
1409
1557
|
effect(() => {
|
|
@@ -1445,7 +1593,9 @@ class TableComponent {
|
|
|
1445
1593
|
}
|
|
1446
1594
|
}, { allowSignalWrites: true });
|
|
1447
1595
|
effect(() => {
|
|
1448
|
-
|
|
1596
|
+
const descriptor = this.descriptor();
|
|
1597
|
+
this.dataListService.globalFilterFields.set(this.globalFilterFieldsInput() ??
|
|
1598
|
+
(this.descriptor().search && descriptor.searchFields ? descriptor.searchFields : this.columns().map(c => c.descriptor.property)));
|
|
1449
1599
|
}, { allowSignalWrites: true });
|
|
1450
1600
|
afterNextRender(() => {
|
|
1451
1601
|
this.isCellClickObserved.set(this.cellClickSubject.observed);
|
|
@@ -1498,6 +1648,22 @@ class TableComponent {
|
|
|
1498
1648
|
.subscribe(e => {
|
|
1499
1649
|
this.routerIsNavigationOutsideInProgress = e instanceof NavigationStart;
|
|
1500
1650
|
});
|
|
1651
|
+
toObservable(this.genericFilterDescriptor)
|
|
1652
|
+
.pipe(switchMap(genericFilterDescriptor => {
|
|
1653
|
+
if (genericFilterDescriptor) {
|
|
1654
|
+
const dataProvider = this.genericFilterDescriptor()?.propertyLookup;
|
|
1655
|
+
const genericFilterService = dataProvider?.serviceType ? this.injector.get(dataProvider.serviceType) : null;
|
|
1656
|
+
// fetch filterable properties
|
|
1657
|
+
return toObservable$1(genericFilterDescriptor.propertyLookup.lookup({}, genericFilterService));
|
|
1658
|
+
}
|
|
1659
|
+
return of([]);
|
|
1660
|
+
}), takeUntilDestroyed())
|
|
1661
|
+
.subscribe({
|
|
1662
|
+
next: genericFilters => {
|
|
1663
|
+
// set descriptors from generic filter data
|
|
1664
|
+
this.filterDescriptorsFromGeneric.set(createFilterDescriptorsFromGeneric(genericFilters, this.genericFilterDescriptor()?.valueLookup));
|
|
1665
|
+
}
|
|
1666
|
+
});
|
|
1501
1667
|
}
|
|
1502
1668
|
ngOnDestroy() {
|
|
1503
1669
|
this.dataProviderSubscription?.unsubscribe();
|
|
@@ -1527,7 +1693,11 @@ class TableComponent {
|
|
|
1527
1693
|
}
|
|
1528
1694
|
}
|
|
1529
1695
|
else {
|
|
1530
|
-
|
|
1696
|
+
const paramsWithDefaults = mergeDataListParamsWithDefaults(params, this.defaultParams());
|
|
1697
|
+
if (!this.compareWithCurrentParams(paramsWithDefaults)) {
|
|
1698
|
+
this.updatePrimeSortAndFilter(paramsWithDefaults);
|
|
1699
|
+
}
|
|
1700
|
+
this.loadTableWithDataProvider(paramsWithDefaults);
|
|
1531
1701
|
}
|
|
1532
1702
|
}
|
|
1533
1703
|
onCellClick(event, col, item, idx) {
|
|
@@ -1600,9 +1770,11 @@ class TableComponent {
|
|
|
1600
1770
|
}
|
|
1601
1771
|
}
|
|
1602
1772
|
loadTableFromRouteUpdate(urlParams) {
|
|
1603
|
-
const paramsWithDefaults = mergeDataListParamsWithDefaults(fromUrlQueryToDataListParams(urlParams), this.defaultParams());
|
|
1773
|
+
const paramsWithDefaults = mergeDataListParamsWithDefaults(fromUrlQueryToDataListParams(urlParams, true), this.defaultParams());
|
|
1604
1774
|
this.updatePrimeSortAndFilter(paramsWithDefaults);
|
|
1605
|
-
|
|
1775
|
+
if (!this.useQueryParamsInitialized() && paramsWithDefaults?.search) {
|
|
1776
|
+
this.globalSearchParamFromUrl.set({ value: paramsWithDefaults?.search, caseSensitive: paramsWithDefaults.filters?.['global']?.caseSensitive ?? false });
|
|
1777
|
+
}
|
|
1606
1778
|
this.useQueryParamsInitialized.set(true);
|
|
1607
1779
|
this.loadTableWithDataProvider(paramsWithDefaults);
|
|
1608
1780
|
}
|
|
@@ -1773,8 +1945,21 @@ class TableComponent {
|
|
|
1773
1945
|
this.layoutPrefsSaveCnt.update(v => v + 1);
|
|
1774
1946
|
}
|
|
1775
1947
|
}
|
|
1948
|
+
/**
|
|
1949
|
+
* Compare the given params with the stored params in the DataListService.
|
|
1950
|
+
*
|
|
1951
|
+
* @param {DataListParams} params - The params to compare with the stored params.
|
|
1952
|
+
*
|
|
1953
|
+
* @return {boolean} - True if the given params match the stored params, otherwise false.
|
|
1954
|
+
*/
|
|
1955
|
+
compareWithCurrentParams(params) {
|
|
1956
|
+
return (params.offset === this.dataListService.offset() &&
|
|
1957
|
+
params.limit === this.dataListService.rows() &&
|
|
1958
|
+
JSON.stringify(this.createSortMeta(params)) === JSON.stringify(this.dataListService.sortMeta()) &&
|
|
1959
|
+
JSON.stringify(this.createFilterMeta(params)) === JSON.stringify(this.dataListService.filterMeta()));
|
|
1960
|
+
}
|
|
1776
1961
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1777
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", 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 }, 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 }, columnLastMinWidth: { classPropertyName: "columnLastMinWidth", publicName: "columnLastMinWidth", isSignal: true, isRequired: false, transformFunction: null }, captionComponent: { classPropertyName: "captionComponent", publicName: "captionComponent", isSignal: true, isRequired: false, transformFunction: null }, columnCustomLastComponent: { classPropertyName: "columnCustomLastComponent", publicName: "columnCustomLastComponent", isSignal: true, isRequired: false, transformFunction: null }, globalFilterFieldsInput: { classPropertyName: "globalFilterFieldsInput", publicName: "globalFilterFields", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tableLoad: "tableLoad", cellClick: "cellClick", selectionChange: "selectionChange", captionComponentInstance: "captionComponentInstance", columnCustomLastComponentInstance: "columnCustomLastComponentInstance", rowReorder: "rowReorder" }, providers: [DataListService], queries: [{ propertyName: "templates", predicate: TemplateDirective, isSignal: true }], viewQueries: [{ propertyName: "components", predicate: (ComponentDirective), descendants: true, isSignal: true }, { propertyName: "primeTable", first: true, predicate: Table, 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 (!useQueryParams() || useQueryParamsInitialized()) {\n <p-table\n [value]=\"dataListService.data()\"\n [dataKey]=\"descriptor().trackProperty\"\n [lazy]=\"isLazy()\"\n [loading]=\"dataListService.loading()\"\n [paginator]=\"isPagination()\"\n [rows]=\"dataListService.rows()\"\n [first]=\"dataListService.offset()\"\n [totalRecords]=\"dataListService.count()\"\n [rowsPerPageOptions]=\"dataListService.rowsPerPageOptions()\"\n [showCurrentPageReport]=\"true\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"dataListService.sortMeta()\"\n [filters]=\"dataListService.filterMeta()\"\n [globalFilterFields]=\"dataListService.globalFilterFields()\"\n sortMode=\"multiple\"\n [selection]=\"[]\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"selectionEnabled() ? selectionMode() : null\"\n [scrollable]=\"true\"\n scrollHeight=\"flex\"\n [rowHover]=\"descriptor().hasHover\"\n [styleClass]=\"className()\"\n [resizableColumns]=\"descriptor().hasResizableColumns\"\n [columnResizeMode]=\"descriptor().columnResizeMode ?? 'expand'\"\n [reorderableColumns]=\"areColumnsReorderable()\"\n paginatorDropdownAppendTo=\"body\"\n [columns]=\"visibleColumns()\"\n (onColResize)=\"onTableColumnResize($event)\"\n (onColReorder)=\"onColumnReorder($event)\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onRowReorder)=\"onRowReorder($event)\">\n <ng-template pTemplate=\"caption\">\n @if (isCaptionVisible()) {\n <div class=\"table-header\">\n @if (overlayWithTagFilters().length > 0) {\n <mng-filter-overlay-with-tag [title]=\"descriptor().title\" [descriptors]=\"overlayWithTagFilters()\" [model]=\"descriptor().model\">\n @if (hasTitleDisplay()) {\n <ng-template mngTemplate=\"title\">\n <ng-container *ngTemplateOutlet=\"captionTemplateOrComponentOrTitle\"></ng-container>\n </ng-template>\n }\n </mng-filter-overlay-with-tag>\n } @else {\n <ng-container *ngTemplateOutlet=\"captionTemplateOrComponentOrTitle\"></ng-container>\n }\n <ng-template #captionTemplateOrComponentOrTitle>\n @if (captionTemplate()) {\n <ng-container *ngTemplateOutlet=\"captionTemplate()\"></ng-container>\n } @else if (captionComponent()) {\n <ng-container [mngComponent]=\"captionComponent()\" (instanceCreated)=\"captionComponentInstance.emit($event)\"></ng-container>\n } @else if (descriptor().title) {\n <h5 class=\"p-0 m-0\">{{ descriptor().title! | translate }}</h5>\n }\n </ng-template>\n </div>\n }\n </ng-template>\n <ng-template pTemplate=\"header\">\n @if (!descriptor().hideHeader) {\n <tr class=\"mng-table-header\" [class]=\"descriptor().headerClassName\">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"descriptor().selectionColumnFrozen ?? true\">\n <p-tableHeaderCheckbox></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]=\"descriptor().selectionColumnFrozen ?? true\"></th>\n }\n }\n @if (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 <div class=\"flex justify-content-between align-items-center\">\n {{ col.descriptor.title ?? (col.descriptor.property | mngI18nProperty: descriptor().model) | translate }}\n <p-sortIcon [field]=\"col.descriptor.property\"></p-sortIcon>\n </div>\n </ng-template>\n <ng-template #nonSortableColumnTHTemplate>\n {{ col.descriptor.title ?? (col.descriptor.property | mngI18nProperty: descriptor().model) | translate }}\n </ng-template>\n @if (col.descriptor.isReorderable) {\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 | mngTableColumnFilterClass: col.filter : 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 | mngTableColumnFilterClass: col.filter : 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]=\"descriptor().actionColumnFrozen ?? areColumnsToggleable()\"\n alignFrozen=\"right\"\n class=\"column-custom-last text-right\">\n @if (descriptor().hasResizableColumns) {\n <p-multiSelect\n #columnToggleMultiselect\n styleClass=\"p-button-primary mng-table-columns-multiselect\"\n appendTo=\"body\"\n dataKey=\"id\"\n tooltipPosition=\"left\"\n placeholder=\"\"\n dropdownIcon=\"pi pi-sliders-h\"\n [filter]=\"false\"\n [options]=\"columns()\"\n [ngModel]=\"visibleColumns()\"\n [pTooltip]=\"'mngTable.adjustTable' | translate\"\n [displaySelectedLabel]=\"false\"\n (onChange)=\"onColumnToggle($event)\">\n <ng-template pTemplate=\"filter\">\n <div class=\"p-checkbox p-component ml-1\" [ngClass]=\"{'p-checkbox-disabled': !areColumnsToggleable}\">\n <div class=\"p-hidden-accessible\">\n <input\n type=\"checkbox\"\n readonly=\"readonly\"\n [checked]=\"columnToggleMultiselect.allSelected\"\n (focus)=\"columnToggleMultiselect.onHeaderCheckboxFocus()\"\n (blur)=\"columnToggleMultiselect.onHeaderCheckboxBlur()\"\n (keydown.space)=\"columnToggleMultiselect.onToggleAll($event)\"\n [disabled]=\"!areColumnsToggleable\" />\n </div>\n <div\n class=\"p-checkbox-box\"\n role=\"checkbox\"\n [attr.aria-checked]=\"columnToggleMultiselect.allSelected\"\n [ngClass]=\"{\n 'p-highlight': anyColumnVisible()\n }\"\n (click)=\"onColumnToggleAll()\">\n <span class=\"p-checkbox-icon\" [ngClass]=\"{'pi pi-check': anyColumnVisible()}\"></span>\n </div>\n </div>\n <p-button\n icon=\"pi pi-replay\"\n styleClass=\"p-button-secondary\"\n [pTooltip]=\"'mngTable.resetLayout' | translate\"\n tooltipPosition=\"left\"\n (click)=\"resetDefaultLayout()\"></p-button>\n </ng-template>\n <ng-template let-item pTemplate=\"item\">\n {{ item.descriptor.title ?? (item.descriptor.property | mngI18nProperty: descriptor().model) | translate }}\n </ng-template>\n </p-multiSelect>\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]=\"descriptor().selectionColumnFrozen ?? true\"></th>\n }\n @if (rowReorderEnabled()) {\n <th scope=\"col\"></th>\n }\n @if (descriptor().rowExpandable) {\n <th scope=\"col\"></th>\n }\n @for (col of visibleColumns(); track col.id) {\n <th\n [class]=\"col.filter?.columnClassName | mngTableColumnFilterClass: col.filter : hasColumnFilters() && !col.width\"\n [style.width.px]=\"col.width\"\n [style.width.%]=\"col.width ? null : col.filter?.columnWidth ?? col.descriptor.width ?? null\"\n [style.min-width.px]=\"col.width ? null : col.filter?.columnMinWidth ?? col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\">\n @if (col.filter) {\n <mng-table-column-filter [descriptor]=\"col.filter\"></mng-table-column-filter>\n }\n </th>\n }\n @if (hasLastColumn()) {\n <th class=\"column-custom-last\" [style.min-width.px]=\"columnLastMinWidth()\"></th>\n }\n </tr>\n }\n </ng-template>\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\" let-expanded=\"expanded\">\n <tr\n [pReorderableRow]=\"idx\"\n [ngClass]=\"descriptor().rowClassName | mngClassMap: descriptor().rowClassNameMapFn : item | mngLocaleDefaultRowClass: descriptor() : item\">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"descriptor().selectionColumnFrozen ?? true\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n } @else {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"descriptor().selectionColumnFrozen ?? true\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n }\n }\n @if (descriptor().rowExpandable) {\n <td>\n @if (!descriptor().rowExpandableProperty || item[descriptor().rowExpandableProperty!]) {\n <button\n pButton\n type=\"button\"\n [pRowToggler]=\"item\"\n class=\"p-button-text p-button-rounded p-button-plain mng-table-row-expand-button\"\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 | mngTableColumnFilterClass: col.filter : 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 <span class=\"p-column-title\">{{ col.descriptor.title ?? (col.descriptor.property | mngI18nProperty: descriptor().model) | translate }}</span>\n <mng-table-column-value [descriptor]=\"col.descriptor\" [item]=\"item\"></mng-table-column-value>\n </td>\n }\n @if (hasLastColumn()) {\n <td\n class=\"column-custom-last justify-content-end text-right\"\n [style.min-width.px]=\"columnLastMinWidth()\"\n pFrozenColumn\n [frozen]=\"descriptor().actionColumnFrozen ?? true\"\n alignFrozen=\"right\">\n @if (columnCustomLastTemplate()) {\n <ng-container *ngTemplateOutlet=\"columnCustomLastTemplate(); context: {rowItem: item, rowIndex: idx}\"></ng-container>\n } @else if (columnCustomLastComponent()) {\n <div [mngComponent]=\"columnCustomLastComponent()\" (instanceCreated)=\"columnCustomLastComponentInstance.emit($event)\"></div>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template pTemplate=\"rowexpansion\" let-item>\n @if (descriptor().rowExpandable) {\n <tr>\n <td></td>\n <td [colSpan]=\"descriptor().rowExpandableColSpan\">\n @if (descriptor().rowExpandableComponentType !== undefined) {\n <ng-container\n [mngComponent]=\"descriptor().rowExpandableComponentType\"\n [inputs]=\"{item}\">\n </ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"rowExpandTemplate(); context: {rowItem: item}\"></ng-container>\n }\n </td>\n </tr>\n }\n </ng-template>\n <ng-template pTemplate=\"loadingicon\">\n <div class=\"flex flex-column align-items-center\">\n @if (descriptor().loadingIcon) {\n <i [class]=\"'text-white text-4xl pi-spin ' + descriptor().loadingIcon\"></i>\n }\n @if (descriptor().loadingText) {\n <div class=\"text text-white text-lg font-semibold\" [ngClass]=\"{'mt-3': descriptor().loadingIcon}\">\n {{ descriptor().loadingText ?? '' | translate }}\n </div>\n }\n </div>\n </ng-template>\n <ng-template pTemplate=\"loadingbody\">\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\">\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n @if (footerTemplate()) {\n <ng-template pTemplate=\"summary\">\n <ng-container *ngTemplateOutlet=\"footerTemplate(); context: {data: dataListService.data(), totalCount: dataListService.count()}\"></ng-container>\n </ng-template>\n }\n </p-table>\n }\n</div>\n", dependencies: [{ kind: "directive", type: ComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "injectionToken", "inputs", "attachToHost", "parentInjector"], outputs: ["instanceCreated"] }, { kind: "pipe", type: I18nPropertyPipe, name: "mngI18nProperty" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { kind: "pipe", type: ClassMapPipe, name: "mngClassMap" }, { kind: "pipe", type: LocaleDefaultRowClassPipe, name: "mngLocaleDefaultRowClass" }, { kind: "component", type: TableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor"] }, { kind: "pipe", type: TableColumnFilterClassPipe, name: "mngTableColumnFilterClass" }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i1$4.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "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", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll", "virtualRowHeight"], 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: i2$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i1$4.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i1$4.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "directive", type: i1$4.RowToggler, selector: "[pRowToggler]", inputs: ["pRowToggler", "pRowTogglerDisabled"] }, { kind: "directive", type: i1$4.ResizableColumn, selector: "[pResizableColumn]", inputs: ["pResizableColumnDisabled"] }, { kind: "directive", type: i1$4.ReorderableColumn, selector: "[pReorderableColumn]", inputs: ["pReorderableColumnDisabled"] }, { kind: "component", type: i1$4.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i1$4.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i1$4.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { kind: "component", type: i1$4.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "directive", type: i1$4.ReorderableRowHandle, selector: "[pReorderableRowHandle]" }, { kind: "directive", type: i1$4.ReorderableRow, selector: "[pReorderableRow]", inputs: ["pReorderableRow", "pReorderableRowDisabled"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i3.MultiSelect, selector: "p-multiSelect", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "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", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i4$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i4$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i1$2.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "component", type: FilterOverlayWithTagComponent, selector: "mng-filter-overlay-with-tag", inputs: ["descriptors", "model"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1962
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", 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 }, 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 }, columnLastMinWidth: { classPropertyName: "columnLastMinWidth", publicName: "columnLastMinWidth", isSignal: true, isRequired: false, transformFunction: null }, captionComponent: { classPropertyName: "captionComponent", publicName: "captionComponent", isSignal: true, isRequired: false, transformFunction: null }, columnCustomLastComponent: { classPropertyName: "columnCustomLastComponent", publicName: "columnCustomLastComponent", isSignal: true, isRequired: false, transformFunction: null }, globalFilterFieldsInput: { classPropertyName: "globalFilterFieldsInput", publicName: "globalFilterFields", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tableLoad: "tableLoad", cellClick: "cellClick", selectionChange: "selectionChange", captionComponentInstance: "captionComponentInstance", columnCustomLastComponentInstance: "columnCustomLastComponentInstance", rowReorder: "rowReorder" }, providers: [DataListService], queries: [{ propertyName: "templates", predicate: TemplateDirective, isSignal: true }], viewQueries: [{ propertyName: "components", predicate: (ComponentDirective), descendants: true, isSignal: true }, { propertyName: "primeTable", first: true, predicate: Table, 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 (!useQueryParams() || useQueryParamsInitialized()) {\n <p-table\n [value]=\"dataListService.data()\"\n [dataKey]=\"descriptor().trackProperty\"\n [lazy]=\"isLazy()\"\n [loading]=\"dataListService.loading()\"\n [paginator]=\"isPagination()\"\n [rows]=\"dataListService.rows()\"\n [first]=\"dataListService.offset()\"\n [totalRecords]=\"dataListService.count()\"\n [rowsPerPageOptions]=\"dataListService.rowsPerPageOptions()\"\n [showCurrentPageReport]=\"true\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"dataListService.sortMeta()\"\n [filters]=\"dataListService.filterMeta()\"\n [globalFilterFields]=\"dataListService.globalFilterFields()\"\n sortMode=\"multiple\"\n [selection]=\"[]\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"selectionEnabled() ? selectionMode() : null\"\n [scrollable]=\"true\"\n scrollHeight=\"flex\"\n [rowHover]=\"descriptor().hasHover\"\n [styleClass]=\"className()\"\n [resizableColumns]=\"descriptor().hasResizableColumns\"\n [columnResizeMode]=\"descriptor().columnResizeMode ?? 'expand'\"\n [reorderableColumns]=\"areColumnsReorderable()\"\n paginatorDropdownAppendTo=\"body\"\n [columns]=\"visibleColumns()\"\n (onColResize)=\"onTableColumnResize($event)\"\n (onColReorder)=\"onColumnReorder($event)\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onRowReorder)=\"onRowReorder($event)\">\n <ng-template pTemplate=\"caption\">\n @if (isCaptionVisible()) {\n <div class=\"table-header\">\n @if (overlayWithTagFilters().length > 0 || descriptor().search) {\n <mng-filter-overlay-with-tag\n [title]=\"descriptor().title\"\n [descriptors]=\"overlayWithTagFilters()\"\n [model]=\"descriptor().model\"\n [enableSearch]=\"descriptor().search\"\n [search]=\"globalSearchParamFromUrl()\"\n [searchLimitWordMax]=\"descriptor().searchLimitMaxWords\"\n [enableCaseSensitive]=\"isLazy()\">\n @if (hasTitleDisplay()) {\n <ng-template mngTemplate=\"title\">\n <ng-container *ngTemplateOutlet=\"captionTemplateOrComponentOrTitle\"></ng-container>\n </ng-template>\n }\n </mng-filter-overlay-with-tag>\n } @else {\n <ng-container *ngTemplateOutlet=\"captionTemplateOrComponentOrTitle\"></ng-container>\n }\n <ng-template #captionTemplateOrComponentOrTitle>\n @if (captionTemplate()) {\n <ng-container *ngTemplateOutlet=\"captionTemplate()\"></ng-container>\n } @else if (captionComponent()) {\n <ng-container [mngComponent]=\"captionComponent()\" (instanceCreated)=\"captionComponentInstance.emit($event)\"></ng-container>\n } @else if (descriptor().title) {\n <h5 class=\"p-0 m-0\">{{ descriptor().title! | translate }}</h5>\n }\n </ng-template>\n </div>\n }\n </ng-template>\n <ng-template pTemplate=\"header\">\n @if (!descriptor().hideHeader) {\n <tr class=\"mng-table-header\" [class]=\"descriptor().headerClassName\">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"descriptor().selectionColumnFrozen ?? true\">\n <p-tableHeaderCheckbox></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]=\"descriptor().selectionColumnFrozen ?? true\"></th>\n }\n }\n @if (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 <div class=\"flex justify-content-between align-items-center\">\n {{ col.descriptor.title ?? (col.descriptor.property | mngI18nProperty: descriptor().model) | translate }}\n <p-sortIcon [field]=\"col.descriptor.property\"></p-sortIcon>\n </div>\n </ng-template>\n <ng-template #nonSortableColumnTHTemplate>\n {{ col.descriptor.title ?? (col.descriptor.property | mngI18nProperty: descriptor().model) | translate }}\n </ng-template>\n @if (col.descriptor.isReorderable) {\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 | mngTableColumnFilterClass: col.filter : 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 | mngTableColumnFilterClass: col.filter : 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]=\"descriptor().actionColumnFrozen ?? areColumnsToggleable()\"\n alignFrozen=\"right\"\n class=\"column-custom-last text-right\">\n @if (descriptor().hasResizableColumns) {\n <p-multiSelect\n #columnToggleMultiselect\n styleClass=\"p-button-primary mng-table-columns-multiselect\"\n appendTo=\"body\"\n dataKey=\"id\"\n tooltipPosition=\"left\"\n placeholder=\"\"\n dropdownIcon=\"pi pi-sliders-h\"\n [filter]=\"false\"\n [options]=\"columns()\"\n [ngModel]=\"visibleColumns()\"\n [pTooltip]=\"'mngTable.adjustTable' | translate\"\n [displaySelectedLabel]=\"false\"\n (onChange)=\"onColumnToggle($event)\">\n <ng-template pTemplate=\"filter\">\n <div class=\"p-checkbox p-component ml-1\" [ngClass]=\"{'p-checkbox-disabled': !areColumnsToggleable}\">\n <div class=\"p-hidden-accessible\">\n <input\n type=\"checkbox\"\n readonly=\"readonly\"\n [checked]=\"columnToggleMultiselect.allSelected\"\n (focus)=\"columnToggleMultiselect.onHeaderCheckboxFocus()\"\n (blur)=\"columnToggleMultiselect.onHeaderCheckboxBlur()\"\n (keydown.space)=\"columnToggleMultiselect.onToggleAll($event)\"\n [disabled]=\"!areColumnsToggleable\" />\n </div>\n <div\n class=\"p-checkbox-box\"\n role=\"checkbox\"\n [attr.aria-checked]=\"columnToggleMultiselect.allSelected\"\n [ngClass]=\"{\n 'p-highlight': anyColumnVisible()\n }\"\n (click)=\"onColumnToggleAll()\">\n <span class=\"p-checkbox-icon\" [ngClass]=\"{'pi pi-check': anyColumnVisible()}\"></span>\n </div>\n </div>\n <p-button\n icon=\"pi pi-replay\"\n styleClass=\"p-button-secondary\"\n [pTooltip]=\"'mngTable.resetLayout' | translate\"\n tooltipPosition=\"left\"\n (click)=\"resetDefaultLayout()\"></p-button>\n </ng-template>\n <ng-template let-item pTemplate=\"item\">\n {{ item.descriptor.title ?? (item.descriptor.property | mngI18nProperty: descriptor().model) | translate }}\n </ng-template>\n </p-multiSelect>\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]=\"descriptor().selectionColumnFrozen ?? true\"></th>\n }\n @if (rowReorderEnabled()) {\n <th scope=\"col\"></th>\n }\n @if (descriptor().rowExpandable) {\n <th scope=\"col\"></th>\n }\n @for (col of visibleColumns(); track col.id) {\n <th\n [class]=\"col.filter?.columnClassName | mngTableColumnFilterClass: col.filter : hasColumnFilters() && !col.width\"\n [style.width.px]=\"col.width\"\n [style.width.%]=\"col.width ? null : col.filter?.columnWidth ?? col.descriptor.width ?? null\"\n [style.min-width.px]=\"col.width ? null : col.filter?.columnMinWidth ?? col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\">\n @if (col.filter) {\n <mng-table-column-filter [descriptor]=\"col.filter\"></mng-table-column-filter>\n }\n </th>\n }\n @if (hasLastColumn()) {\n <th class=\"column-custom-last\" [style.min-width.px]=\"columnLastMinWidth()\"></th>\n }\n </tr>\n }\n </ng-template>\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\" let-expanded=\"expanded\">\n <tr\n [pReorderableRow]=\"idx\"\n [ngClass]=\"descriptor().rowClassName | mngClassMap: descriptor().rowClassNameMapFn : item | mngLocaleDefaultRowClass: descriptor() : item\">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"descriptor().selectionColumnFrozen ?? true\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n } @else {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"descriptor().selectionColumnFrozen ?? true\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n }\n }\n @if (descriptor().rowExpandable) {\n <td>\n @if (!descriptor().rowExpandableProperty || item[descriptor().rowExpandableProperty!]) {\n <button\n pButton\n type=\"button\"\n [pRowToggler]=\"item\"\n class=\"p-button-text p-button-rounded p-button-plain mng-table-row-expand-button\"\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 | mngTableColumnFilterClass: col.filter : 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 <span class=\"p-column-title\">{{ col.descriptor.title ?? (col.descriptor.property | mngI18nProperty: descriptor().model) | translate }}</span>\n <mng-table-column-value [descriptor]=\"col.descriptor\" [item]=\"item\"></mng-table-column-value>\n </td>\n }\n @if (hasLastColumn()) {\n <td\n class=\"column-custom-last justify-content-end text-right\"\n [style.min-width.px]=\"columnLastMinWidth()\"\n pFrozenColumn\n [frozen]=\"descriptor().actionColumnFrozen ?? true\"\n alignFrozen=\"right\">\n @if (columnCustomLastTemplate()) {\n <ng-container *ngTemplateOutlet=\"columnCustomLastTemplate(); context: {rowItem: item, rowIndex: idx}\"></ng-container>\n } @else if (columnCustomLastComponent()) {\n <div [mngComponent]=\"columnCustomLastComponent()\" (instanceCreated)=\"columnCustomLastComponentInstance.emit($event)\"></div>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template pTemplate=\"rowexpansion\" let-item>\n @if (descriptor().rowExpandable) {\n <tr>\n <td></td>\n <td [colSpan]=\"descriptor().rowExpandableColSpan\">\n @if (descriptor().rowExpandableComponentType !== undefined) {\n <ng-container [mngComponent]=\"descriptor().rowExpandableComponentType\" [inputs]=\"{item}\"> </ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"rowExpandTemplate(); context: {rowItem: item}\"></ng-container>\n }\n </td>\n </tr>\n }\n </ng-template>\n <ng-template pTemplate=\"loadingicon\">\n <div class=\"flex flex-column align-items-center\">\n @if (descriptor().loadingIcon) {\n <i [class]=\"'text-white text-4xl pi-spin ' + descriptor().loadingIcon\"></i>\n }\n @if (descriptor().loadingText) {\n <div class=\"text text-white text-lg font-semibold\" [ngClass]=\"{'mt-3': descriptor().loadingIcon}\">\n {{ descriptor().loadingText ?? '' | translate }}\n </div>\n }\n </div>\n </ng-template>\n <ng-template pTemplate=\"loadingbody\">\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\">\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n @if (footerTemplate()) {\n <ng-template pTemplate=\"summary\">\n <ng-container *ngTemplateOutlet=\"footerTemplate(); context: {data: dataListService.data(), totalCount: dataListService.count()}\"></ng-container>\n </ng-template>\n }\n </p-table>\n }\n</div>\n", dependencies: [{ kind: "directive", type: ComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "injectionToken", "inputs", "attachToHost", "parentInjector"], outputs: ["instanceCreated"] }, { kind: "pipe", type: I18nPropertyPipe, name: "mngI18nProperty" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { kind: "pipe", type: ClassMapPipe, name: "mngClassMap" }, { kind: "pipe", type: LocaleDefaultRowClassPipe, name: "mngLocaleDefaultRowClass" }, { kind: "component", type: TableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor"] }, { kind: "pipe", type: TableColumnFilterClassPipe, name: "mngTableColumnFilterClass" }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i1$3.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "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", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll", "virtualRowHeight"], 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: i2$3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i1$3.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i1$3.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "directive", type: i1$3.RowToggler, selector: "[pRowToggler]", inputs: ["pRowToggler", "pRowTogglerDisabled"] }, { kind: "directive", type: i1$3.ResizableColumn, selector: "[pResizableColumn]", inputs: ["pResizableColumnDisabled"] }, { kind: "directive", type: i1$3.ReorderableColumn, selector: "[pReorderableColumn]", inputs: ["pReorderableColumnDisabled"] }, { kind: "component", type: i1$3.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i1$3.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i1$3.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { kind: "component", type: i1$3.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "directive", type: i1$3.ReorderableRowHandle, selector: "[pReorderableRowHandle]" }, { kind: "directive", type: i1$3.ReorderableRow, selector: "[pReorderableRow]", inputs: ["pReorderableRow", "pReorderableRowDisabled"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i3.MultiSelect, selector: "p-multiSelect", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "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", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i4$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i4$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i1$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "component", type: FilterOverlayWithTagComponent, selector: "mng-filter-overlay-with-tag", inputs: ["descriptors", "model", "enableSearch", "search", "searchLimitWordMax", "enableCaseSensitive"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1778
1963
|
}
|
|
1779
1964
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: TableComponent, decorators: [{
|
|
1780
1965
|
type: Component,
|
|
@@ -1798,7 +1983,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImpor
|
|
|
1798
1983
|
FilterOverlayWithTagComponent,
|
|
1799
1984
|
FormsModule,
|
|
1800
1985
|
TemplateDirective
|
|
1801
|
-
], providers: [DataListService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div>\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n @if (!useQueryParams() || useQueryParamsInitialized()) {\n <p-table\n [value]=\"dataListService.data()\"\n [dataKey]=\"descriptor().trackProperty\"\n [lazy]=\"isLazy()\"\n [loading]=\"dataListService.loading()\"\n [paginator]=\"isPagination()\"\n [rows]=\"dataListService.rows()\"\n [first]=\"dataListService.offset()\"\n [totalRecords]=\"dataListService.count()\"\n [rowsPerPageOptions]=\"dataListService.rowsPerPageOptions()\"\n [showCurrentPageReport]=\"true\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"dataListService.sortMeta()\"\n [filters]=\"dataListService.filterMeta()\"\n [globalFilterFields]=\"dataListService.globalFilterFields()\"\n sortMode=\"multiple\"\n [selection]=\"[]\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"selectionEnabled() ? selectionMode() : null\"\n [scrollable]=\"true\"\n scrollHeight=\"flex\"\n [rowHover]=\"descriptor().hasHover\"\n [styleClass]=\"className()\"\n [resizableColumns]=\"descriptor().hasResizableColumns\"\n [columnResizeMode]=\"descriptor().columnResizeMode ?? 'expand'\"\n [reorderableColumns]=\"areColumnsReorderable()\"\n paginatorDropdownAppendTo=\"body\"\n [columns]=\"visibleColumns()\"\n (onColResize)=\"onTableColumnResize($event)\"\n (onColReorder)=\"onColumnReorder($event)\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onRowReorder)=\"onRowReorder($event)\">\n <ng-template pTemplate=\"caption\">\n @if (isCaptionVisible()) {\n <div class=\"table-header\">\n @if (overlayWithTagFilters().length > 0) {\n <mng-filter-overlay-with-tag [title]=\"descriptor().title\" [descriptors]=\"overlayWithTagFilters()\" [model]=\"descriptor().model\">\n @if (hasTitleDisplay()) {\n <ng-template mngTemplate=\"title\">\n <ng-container *ngTemplateOutlet=\"captionTemplateOrComponentOrTitle\"></ng-container>\n </ng-template>\n }\n </mng-filter-overlay-with-tag>\n } @else {\n <ng-container *ngTemplateOutlet=\"captionTemplateOrComponentOrTitle\"></ng-container>\n }\n <ng-template #captionTemplateOrComponentOrTitle>\n @if (captionTemplate()) {\n <ng-container *ngTemplateOutlet=\"captionTemplate()\"></ng-container>\n } @else if (captionComponent()) {\n <ng-container [mngComponent]=\"captionComponent()\" (instanceCreated)=\"captionComponentInstance.emit($event)\"></ng-container>\n } @else if (descriptor().title) {\n <h5 class=\"p-0 m-0\">{{ descriptor().title! | translate }}</h5>\n }\n </ng-template>\n </div>\n }\n </ng-template>\n <ng-template pTemplate=\"header\">\n @if (!descriptor().hideHeader) {\n <tr class=\"mng-table-header\" [class]=\"descriptor().headerClassName\">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"descriptor().selectionColumnFrozen ?? true\">\n <p-tableHeaderCheckbox></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]=\"descriptor().selectionColumnFrozen ?? true\"></th>\n }\n }\n @if (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 <div class=\"flex justify-content-between align-items-center\">\n {{ col.descriptor.title ?? (col.descriptor.property | mngI18nProperty: descriptor().model) | translate }}\n <p-sortIcon [field]=\"col.descriptor.property\"></p-sortIcon>\n </div>\n </ng-template>\n <ng-template #nonSortableColumnTHTemplate>\n {{ col.descriptor.title ?? (col.descriptor.property | mngI18nProperty: descriptor().model) | translate }}\n </ng-template>\n @if (col.descriptor.isReorderable) {\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 | mngTableColumnFilterClass: col.filter : 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 | mngTableColumnFilterClass: col.filter : 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]=\"descriptor().actionColumnFrozen ?? areColumnsToggleable()\"\n alignFrozen=\"right\"\n class=\"column-custom-last text-right\">\n @if (descriptor().hasResizableColumns) {\n <p-multiSelect\n #columnToggleMultiselect\n styleClass=\"p-button-primary mng-table-columns-multiselect\"\n appendTo=\"body\"\n dataKey=\"id\"\n tooltipPosition=\"left\"\n placeholder=\"\"\n dropdownIcon=\"pi pi-sliders-h\"\n [filter]=\"false\"\n [options]=\"columns()\"\n [ngModel]=\"visibleColumns()\"\n [pTooltip]=\"'mngTable.adjustTable' | translate\"\n [displaySelectedLabel]=\"false\"\n (onChange)=\"onColumnToggle($event)\">\n <ng-template pTemplate=\"filter\">\n <div class=\"p-checkbox p-component ml-1\" [ngClass]=\"{'p-checkbox-disabled': !areColumnsToggleable}\">\n <div class=\"p-hidden-accessible\">\n <input\n type=\"checkbox\"\n readonly=\"readonly\"\n [checked]=\"columnToggleMultiselect.allSelected\"\n (focus)=\"columnToggleMultiselect.onHeaderCheckboxFocus()\"\n (blur)=\"columnToggleMultiselect.onHeaderCheckboxBlur()\"\n (keydown.space)=\"columnToggleMultiselect.onToggleAll($event)\"\n [disabled]=\"!areColumnsToggleable\" />\n </div>\n <div\n class=\"p-checkbox-box\"\n role=\"checkbox\"\n [attr.aria-checked]=\"columnToggleMultiselect.allSelected\"\n [ngClass]=\"{\n 'p-highlight': anyColumnVisible()\n }\"\n (click)=\"onColumnToggleAll()\">\n <span class=\"p-checkbox-icon\" [ngClass]=\"{'pi pi-check': anyColumnVisible()}\"></span>\n </div>\n </div>\n <p-button\n icon=\"pi pi-replay\"\n styleClass=\"p-button-secondary\"\n [pTooltip]=\"'mngTable.resetLayout' | translate\"\n tooltipPosition=\"left\"\n (click)=\"resetDefaultLayout()\"></p-button>\n </ng-template>\n <ng-template let-item pTemplate=\"item\">\n {{ item.descriptor.title ?? (item.descriptor.property | mngI18nProperty: descriptor().model) | translate }}\n </ng-template>\n </p-multiSelect>\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]=\"descriptor().selectionColumnFrozen ?? true\"></th>\n }\n @if (rowReorderEnabled()) {\n <th scope=\"col\"></th>\n }\n @if (descriptor().rowExpandable) {\n <th scope=\"col\"></th>\n }\n @for (col of visibleColumns(); track col.id) {\n <th\n [class]=\"col.filter?.columnClassName | mngTableColumnFilterClass: col.filter : hasColumnFilters() && !col.width\"\n [style.width.px]=\"col.width\"\n [style.width.%]=\"col.width ? null : col.filter?.columnWidth ?? col.descriptor.width ?? null\"\n [style.min-width.px]=\"col.width ? null : col.filter?.columnMinWidth ?? col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\">\n @if (col.filter) {\n <mng-table-column-filter [descriptor]=\"col.filter\"></mng-table-column-filter>\n }\n </th>\n }\n @if (hasLastColumn()) {\n <th class=\"column-custom-last\" [style.min-width.px]=\"columnLastMinWidth()\"></th>\n }\n </tr>\n }\n </ng-template>\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\" let-expanded=\"expanded\">\n <tr\n [pReorderableRow]=\"idx\"\n [ngClass]=\"descriptor().rowClassName | mngClassMap: descriptor().rowClassNameMapFn : item | mngLocaleDefaultRowClass: descriptor() : item\">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"descriptor().selectionColumnFrozen ?? true\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n } @else {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"descriptor().selectionColumnFrozen ?? true\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n }\n }\n @if (descriptor().rowExpandable) {\n <td>\n @if (!descriptor().rowExpandableProperty || item[descriptor().rowExpandableProperty!]) {\n <button\n pButton\n type=\"button\"\n [pRowToggler]=\"item\"\n class=\"p-button-text p-button-rounded p-button-plain mng-table-row-expand-button\"\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 | mngTableColumnFilterClass: col.filter : 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 <span class=\"p-column-title\">{{ col.descriptor.title ?? (col.descriptor.property | mngI18nProperty: descriptor().model) | translate }}</span>\n <mng-table-column-value [descriptor]=\"col.descriptor\" [item]=\"item\"></mng-table-column-value>\n </td>\n }\n @if (hasLastColumn()) {\n <td\n class=\"column-custom-last justify-content-end text-right\"\n [style.min-width.px]=\"columnLastMinWidth()\"\n pFrozenColumn\n [frozen]=\"descriptor().actionColumnFrozen ?? true\"\n alignFrozen=\"right\">\n @if (columnCustomLastTemplate()) {\n <ng-container *ngTemplateOutlet=\"columnCustomLastTemplate(); context: {rowItem: item, rowIndex: idx}\"></ng-container>\n } @else if (columnCustomLastComponent()) {\n <div [mngComponent]=\"columnCustomLastComponent()\" (instanceCreated)=\"columnCustomLastComponentInstance.emit($event)\"></div>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template pTemplate=\"rowexpansion\" let-item>\n @if (descriptor().rowExpandable) {\n <tr>\n <td></td>\n <td [colSpan]=\"descriptor().rowExpandableColSpan\">\n @if (descriptor().rowExpandableComponentType !== undefined) {\n <ng-container\n [mngComponent]=\"descriptor().rowExpandableComponentType\"\n [inputs]=\"{item}\">\n </ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"rowExpandTemplate(); context: {rowItem: item}\"></ng-container>\n }\n </td>\n </tr>\n }\n </ng-template>\n <ng-template pTemplate=\"loadingicon\">\n <div class=\"flex flex-column align-items-center\">\n @if (descriptor().loadingIcon) {\n <i [class]=\"'text-white text-4xl pi-spin ' + descriptor().loadingIcon\"></i>\n }\n @if (descriptor().loadingText) {\n <div class=\"text text-white text-lg font-semibold\" [ngClass]=\"{'mt-3': descriptor().loadingIcon}\">\n {{ descriptor().loadingText ?? '' | translate }}\n </div>\n }\n </div>\n </ng-template>\n <ng-template pTemplate=\"loadingbody\">\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\">\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n @if (footerTemplate()) {\n <ng-template pTemplate=\"summary\">\n <ng-container *ngTemplateOutlet=\"footerTemplate(); context: {data: dataListService.data(), totalCount: dataListService.count()}\"></ng-container>\n </ng-template>\n }\n </p-table>\n }\n</div>\n" }]
|
|
1986
|
+
], providers: [DataListService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div>\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n @if (!useQueryParams() || useQueryParamsInitialized()) {\n <p-table\n [value]=\"dataListService.data()\"\n [dataKey]=\"descriptor().trackProperty\"\n [lazy]=\"isLazy()\"\n [loading]=\"dataListService.loading()\"\n [paginator]=\"isPagination()\"\n [rows]=\"dataListService.rows()\"\n [first]=\"dataListService.offset()\"\n [totalRecords]=\"dataListService.count()\"\n [rowsPerPageOptions]=\"dataListService.rowsPerPageOptions()\"\n [showCurrentPageReport]=\"true\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"dataListService.sortMeta()\"\n [filters]=\"dataListService.filterMeta()\"\n [globalFilterFields]=\"dataListService.globalFilterFields()\"\n sortMode=\"multiple\"\n [selection]=\"[]\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"selectionEnabled() ? selectionMode() : null\"\n [scrollable]=\"true\"\n scrollHeight=\"flex\"\n [rowHover]=\"descriptor().hasHover\"\n [styleClass]=\"className()\"\n [resizableColumns]=\"descriptor().hasResizableColumns\"\n [columnResizeMode]=\"descriptor().columnResizeMode ?? 'expand'\"\n [reorderableColumns]=\"areColumnsReorderable()\"\n paginatorDropdownAppendTo=\"body\"\n [columns]=\"visibleColumns()\"\n (onColResize)=\"onTableColumnResize($event)\"\n (onColReorder)=\"onColumnReorder($event)\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onRowReorder)=\"onRowReorder($event)\">\n <ng-template pTemplate=\"caption\">\n @if (isCaptionVisible()) {\n <div class=\"table-header\">\n @if (overlayWithTagFilters().length > 0 || descriptor().search) {\n <mng-filter-overlay-with-tag\n [title]=\"descriptor().title\"\n [descriptors]=\"overlayWithTagFilters()\"\n [model]=\"descriptor().model\"\n [enableSearch]=\"descriptor().search\"\n [search]=\"globalSearchParamFromUrl()\"\n [searchLimitWordMax]=\"descriptor().searchLimitMaxWords\"\n [enableCaseSensitive]=\"isLazy()\">\n @if (hasTitleDisplay()) {\n <ng-template mngTemplate=\"title\">\n <ng-container *ngTemplateOutlet=\"captionTemplateOrComponentOrTitle\"></ng-container>\n </ng-template>\n }\n </mng-filter-overlay-with-tag>\n } @else {\n <ng-container *ngTemplateOutlet=\"captionTemplateOrComponentOrTitle\"></ng-container>\n }\n <ng-template #captionTemplateOrComponentOrTitle>\n @if (captionTemplate()) {\n <ng-container *ngTemplateOutlet=\"captionTemplate()\"></ng-container>\n } @else if (captionComponent()) {\n <ng-container [mngComponent]=\"captionComponent()\" (instanceCreated)=\"captionComponentInstance.emit($event)\"></ng-container>\n } @else if (descriptor().title) {\n <h5 class=\"p-0 m-0\">{{ descriptor().title! | translate }}</h5>\n }\n </ng-template>\n </div>\n }\n </ng-template>\n <ng-template pTemplate=\"header\">\n @if (!descriptor().hideHeader) {\n <tr class=\"mng-table-header\" [class]=\"descriptor().headerClassName\">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"descriptor().selectionColumnFrozen ?? true\">\n <p-tableHeaderCheckbox></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]=\"descriptor().selectionColumnFrozen ?? true\"></th>\n }\n }\n @if (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 <div class=\"flex justify-content-between align-items-center\">\n {{ col.descriptor.title ?? (col.descriptor.property | mngI18nProperty: descriptor().model) | translate }}\n <p-sortIcon [field]=\"col.descriptor.property\"></p-sortIcon>\n </div>\n </ng-template>\n <ng-template #nonSortableColumnTHTemplate>\n {{ col.descriptor.title ?? (col.descriptor.property | mngI18nProperty: descriptor().model) | translate }}\n </ng-template>\n @if (col.descriptor.isReorderable) {\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 | mngTableColumnFilterClass: col.filter : 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 | mngTableColumnFilterClass: col.filter : 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]=\"descriptor().actionColumnFrozen ?? areColumnsToggleable()\"\n alignFrozen=\"right\"\n class=\"column-custom-last text-right\">\n @if (descriptor().hasResizableColumns) {\n <p-multiSelect\n #columnToggleMultiselect\n styleClass=\"p-button-primary mng-table-columns-multiselect\"\n appendTo=\"body\"\n dataKey=\"id\"\n tooltipPosition=\"left\"\n placeholder=\"\"\n dropdownIcon=\"pi pi-sliders-h\"\n [filter]=\"false\"\n [options]=\"columns()\"\n [ngModel]=\"visibleColumns()\"\n [pTooltip]=\"'mngTable.adjustTable' | translate\"\n [displaySelectedLabel]=\"false\"\n (onChange)=\"onColumnToggle($event)\">\n <ng-template pTemplate=\"filter\">\n <div class=\"p-checkbox p-component ml-1\" [ngClass]=\"{'p-checkbox-disabled': !areColumnsToggleable}\">\n <div class=\"p-hidden-accessible\">\n <input\n type=\"checkbox\"\n readonly=\"readonly\"\n [checked]=\"columnToggleMultiselect.allSelected\"\n (focus)=\"columnToggleMultiselect.onHeaderCheckboxFocus()\"\n (blur)=\"columnToggleMultiselect.onHeaderCheckboxBlur()\"\n (keydown.space)=\"columnToggleMultiselect.onToggleAll($event)\"\n [disabled]=\"!areColumnsToggleable\" />\n </div>\n <div\n class=\"p-checkbox-box\"\n role=\"checkbox\"\n [attr.aria-checked]=\"columnToggleMultiselect.allSelected\"\n [ngClass]=\"{\n 'p-highlight': anyColumnVisible()\n }\"\n (click)=\"onColumnToggleAll()\">\n <span class=\"p-checkbox-icon\" [ngClass]=\"{'pi pi-check': anyColumnVisible()}\"></span>\n </div>\n </div>\n <p-button\n icon=\"pi pi-replay\"\n styleClass=\"p-button-secondary\"\n [pTooltip]=\"'mngTable.resetLayout' | translate\"\n tooltipPosition=\"left\"\n (click)=\"resetDefaultLayout()\"></p-button>\n </ng-template>\n <ng-template let-item pTemplate=\"item\">\n {{ item.descriptor.title ?? (item.descriptor.property | mngI18nProperty: descriptor().model) | translate }}\n </ng-template>\n </p-multiSelect>\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]=\"descriptor().selectionColumnFrozen ?? true\"></th>\n }\n @if (rowReorderEnabled()) {\n <th scope=\"col\"></th>\n }\n @if (descriptor().rowExpandable) {\n <th scope=\"col\"></th>\n }\n @for (col of visibleColumns(); track col.id) {\n <th\n [class]=\"col.filter?.columnClassName | mngTableColumnFilterClass: col.filter : hasColumnFilters() && !col.width\"\n [style.width.px]=\"col.width\"\n [style.width.%]=\"col.width ? null : col.filter?.columnWidth ?? col.descriptor.width ?? null\"\n [style.min-width.px]=\"col.width ? null : col.filter?.columnMinWidth ?? col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\">\n @if (col.filter) {\n <mng-table-column-filter [descriptor]=\"col.filter\"></mng-table-column-filter>\n }\n </th>\n }\n @if (hasLastColumn()) {\n <th class=\"column-custom-last\" [style.min-width.px]=\"columnLastMinWidth()\"></th>\n }\n </tr>\n }\n </ng-template>\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\" let-expanded=\"expanded\">\n <tr\n [pReorderableRow]=\"idx\"\n [ngClass]=\"descriptor().rowClassName | mngClassMap: descriptor().rowClassNameMapFn : item | mngLocaleDefaultRowClass: descriptor() : item\">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"descriptor().selectionColumnFrozen ?? true\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n } @else {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"descriptor().selectionColumnFrozen ?? true\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n }\n }\n @if (descriptor().rowExpandable) {\n <td>\n @if (!descriptor().rowExpandableProperty || item[descriptor().rowExpandableProperty!]) {\n <button\n pButton\n type=\"button\"\n [pRowToggler]=\"item\"\n class=\"p-button-text p-button-rounded p-button-plain mng-table-row-expand-button\"\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 | mngTableColumnFilterClass: col.filter : 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 <span class=\"p-column-title\">{{ col.descriptor.title ?? (col.descriptor.property | mngI18nProperty: descriptor().model) | translate }}</span>\n <mng-table-column-value [descriptor]=\"col.descriptor\" [item]=\"item\"></mng-table-column-value>\n </td>\n }\n @if (hasLastColumn()) {\n <td\n class=\"column-custom-last justify-content-end text-right\"\n [style.min-width.px]=\"columnLastMinWidth()\"\n pFrozenColumn\n [frozen]=\"descriptor().actionColumnFrozen ?? true\"\n alignFrozen=\"right\">\n @if (columnCustomLastTemplate()) {\n <ng-container *ngTemplateOutlet=\"columnCustomLastTemplate(); context: {rowItem: item, rowIndex: idx}\"></ng-container>\n } @else if (columnCustomLastComponent()) {\n <div [mngComponent]=\"columnCustomLastComponent()\" (instanceCreated)=\"columnCustomLastComponentInstance.emit($event)\"></div>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template pTemplate=\"rowexpansion\" let-item>\n @if (descriptor().rowExpandable) {\n <tr>\n <td></td>\n <td [colSpan]=\"descriptor().rowExpandableColSpan\">\n @if (descriptor().rowExpandableComponentType !== undefined) {\n <ng-container [mngComponent]=\"descriptor().rowExpandableComponentType\" [inputs]=\"{item}\"> </ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"rowExpandTemplate(); context: {rowItem: item}\"></ng-container>\n }\n </td>\n </tr>\n }\n </ng-template>\n <ng-template pTemplate=\"loadingicon\">\n <div class=\"flex flex-column align-items-center\">\n @if (descriptor().loadingIcon) {\n <i [class]=\"'text-white text-4xl pi-spin ' + descriptor().loadingIcon\"></i>\n }\n @if (descriptor().loadingText) {\n <div class=\"text text-white text-lg font-semibold\" [ngClass]=\"{'mt-3': descriptor().loadingIcon}\">\n {{ descriptor().loadingText ?? '' | translate }}\n </div>\n }\n </div>\n </ng-template>\n <ng-template pTemplate=\"loadingbody\">\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\">\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n @if (footerTemplate()) {\n <ng-template pTemplate=\"summary\">\n <ng-container *ngTemplateOutlet=\"footerTemplate(); context: {data: dataListService.data(), totalCount: dataListService.count()}\"></ng-container>\n </ng-template>\n }\n </p-table>\n }\n</div>\n" }]
|
|
1802
1987
|
}], ctorParameters: () => [] });
|
|
1803
1988
|
|
|
1804
1989
|
/**
|
|
@@ -1824,5 +2009,5 @@ function withTable(config) {
|
|
|
1824
2009
|
* Generated bundle index. Do not edit.
|
|
1825
2010
|
*/
|
|
1826
2011
|
|
|
1827
|
-
export { COMMONS_TABLE_FEATURE_CONFIG_IT, DataListService, FilterActiveTagComponent, FilterFormComponent, FilterOverlayWithTagComponent, FilterValuePipe, LocaleDefaultRowClassPipe, TableColumnFilterClassPipe, TableColumnFilterComponent, TableColumnValueComponent, TableComponent, filterAdjustDisplayValueOnMatchModeChange, filterApplySerializationConfigToCmp, filterAreDatesEqual, filterGetDateConfig, filterGetDefaultMatchMode, filterGetNumberConfig, filterSetMetadataOnChange, filterSetMetadataOnDisplayChange, generateMatchModeOptions, generateTableLayoutPrefsKey, tableNotificationError, withTable };
|
|
2012
|
+
export { COMMONS_TABLE_FEATURE_CONFIG_IT, DataListService, FilterActiveTagComponent, FilterFormComponent, FilterOverlayWithTagComponent, FilterValuePipe, LocaleDefaultRowClassPipe, TableColumnFilterClassPipe, TableColumnFilterComponent, TableColumnValueComponent, TableComponent, createFilterDescriptorsFromGeneric, filterAdjustDisplayValueOnMatchModeChange, filterApplySerializationConfigToCmp, filterAreDatesEqual, filterGetDateConfig, filterGetDefaultMatchMode, filterGetNumberConfig, filterSetMetadataOnChange, filterSetMetadataOnDisplayChange, generateMatchModeOptions, generateTableLayoutPrefsKey, tableNotificationError, withTable };
|
|
1828
2013
|
//# sourceMappingURL=mediusinc-mng-commons-table.mjs.map
|