@mediusinc/mng-commons 6.0.0-rc.2 → 6.0.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/helpers/notification.d.ts +17 -1
- package/core/i18n/i18n-error.d.ts +2 -3
- package/core/router/route-builder.d.ts +1 -1
- package/esm2022/core/helpers/notification.mjs +19 -4
- package/esm2022/core/i18n/i18n-error.mjs +10 -8
- package/esm2022/core/router/route-builder.mjs +2 -2
- package/esm2022/form/api/descriptors/action-button.descriptor.mjs +5 -17
- package/esm2022/form/api/descriptors/button-style.builder.mjs +80 -101
- package/esm2022/form/api/index.mjs +2 -1
- package/esm2022/form/api/models/button.model.mjs +2 -0
- package/esm2022/model/helpers/i18n.mjs +14 -9
- package/esm2022/table/components/column-value/column-value.component.mjs +4 -3
- package/esm2022/table/components/table/table.component.mjs +12 -11
- package/esm2022/table/helpers/notification.mjs +19 -13
- package/esm2022/tableview/action/components/action/action.component.mjs +41 -37
- package/esm2022/tableview/action/components/editor/injector-context/action-editor-injector-context.component.mjs +13 -8
- package/esm2022/tableview/action/helpers/i18n.mjs +50 -30
- package/esm2022/tableview/action/helpers/notification.mjs +73 -12
- package/esm2022/tableview/action/helpers/styles.mjs +2 -2
- package/esm2022/tableview/action/services/action-executor.service.mjs +83 -66
- package/esm2022/tableview/api/action/descriptors/action-editor.descriptor.mjs +34 -21
- package/esm2022/tableview/api/action/descriptors/action-link-descriptor.factory.mjs +4 -4
- package/esm2022/tableview/api/action/descriptors/action.descriptor.mjs +49 -67
- package/esm2022/tableview/api/action/models/action-confirmation.model.mjs +2 -0
- package/esm2022/tableview/api/action/models/action-descriptor.types.mjs +1 -1
- package/esm2022/tableview/api/editor/descriptors/field-action.descriptor.mjs +14 -8
- package/esm2022/tableview/api/editor/models/formly-custom-field.model.mjs +1 -1
- package/esm2022/tableview/api/index.mjs +2 -2
- package/esm2022/tableview/api/tableview/helpers/tableview-default-actions.mjs +67 -37
- package/esm2022/tableview/editor/components/editor/form-editor.component.mjs +5 -8
- package/esm2022/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.mjs +7 -5
- package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +29 -18
- package/esm2022/tableview/provide.mjs +44 -1
- package/fesm2022/mediusinc-mng-commons-core.mjs +29 -12
- package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form-api.mjs +137 -169
- package/fesm2022/mediusinc-mng-commons-form-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-model.mjs +13 -8
- package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table.mjs +32 -24
- package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +165 -215
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview.mjs +358 -197
- package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
- package/form/api/descriptors/action-button.descriptor.d.ts +11 -13
- package/form/api/descriptors/button-style.builder.d.ts +30 -44
- package/form/api/index.d.ts +1 -0
- package/form/api/models/button.model.d.ts +19 -0
- package/i18n/sl.json +56 -6
- package/model/helpers/i18n.d.ts +8 -3
- package/package.json +1 -1
- package/table/components/column-value/column-value.component.d.ts +1 -0
- package/table/components/table/table.component.d.ts +0 -1
- package/table/helpers/notification.d.ts +10 -1
- package/tableview/action/components/action/action.component.d.ts +8 -11
- package/tableview/action/helpers/i18n.d.ts +36 -11
- package/tableview/action/helpers/notification.d.ts +37 -3
- package/tableview/api/action/descriptors/action-editor.descriptor.d.ts +18 -8
- package/tableview/api/action/descriptors/action.descriptor.d.ts +22 -31
- package/tableview/api/action/models/action-confirmation.model.d.ts +14 -0
- package/tableview/api/action/models/action-descriptor.types.d.ts +4 -0
- package/tableview/api/editor/descriptors/field-action.descriptor.d.ts +5 -5
- package/tableview/api/index.d.ts +1 -1
- package/tableview/api/tableview/helpers/tableview-default-actions.d.ts +1 -1
- package/tableview/provide.d.ts +7 -0
- package/version-info.json +6 -6
- package/esm2022/tableview/api/action/descriptors/action-confirmation.descriptor.mjs +0 -88
- package/tableview/api/action/descriptors/action-confirmation.descriptor.d.ts +0 -37
|
@@ -24,7 +24,7 @@ import * as i1$3 from 'primeng/table';
|
|
|
24
24
|
import { Table, TableModule } from 'primeng/table';
|
|
25
25
|
import { ZIndexUtils } from 'primeng/utils';
|
|
26
26
|
import { combineLatest, switchMap, of, Subject, debounceTime, distinctUntilChanged, ReplaySubject, NEVER, BehaviorSubject, skip, filter } from 'rxjs';
|
|
27
|
-
import { FilterMatchMode, dateToIsoString, angularDateFormatHasTime, fromAngularDateFormatToPrime, angularDateFormatHasSeconds, fromAngularNumberFormatToFractions, COMMONS_MODULE_CONFIG_IT, effectWithDeps, toObservable as toObservable$1, CommonsService, RerenderDirective, GetterPipe, TemplatePipe, JsonPathPipe, BooleanPipe, EnumPipe, ComponentDirective, getI18nTypePropertyKey, TemplateDirective, findTemplateByName, toastMessage, CommonsStorageService, LoggerService, booleanOrUndefinedAttribute, mergeDataListParamsWithDefaults, fromTableLoadToDataListParams, dataListParamsToUrlQuery, fromSubscribeError, getErrorLogLevel, fromUrlQueryToDataListParams, I18nPropertyPipe, ClassMapPipe, CommonsFeatureTypeEnum } from '@mediusinc/mng-commons/core';
|
|
27
|
+
import { FilterMatchMode, dateToIsoString, angularDateFormatHasTime, fromAngularDateFormatToPrime, angularDateFormatHasSeconds, fromAngularNumberFormatToFractions, COMMONS_MODULE_CONFIG_IT, effectWithDeps, toObservable as toObservable$1, CommonsService, RerenderDirective, GetterPipe, TemplatePipe, JsonPathPipe, BooleanPipe, EnumPipe, ComponentDirective, getI18nTypePropertyKey, TemplateDirective, findTemplateByName, getI18nForError, getI18nErrorParams, toastMessage, CommonsStorageService, LoggerService, booleanOrUndefinedAttribute, mergeDataListParamsWithDefaults, fromTableLoadToDataListParams, dataListParamsToUrlQuery, fromSubscribeError, getErrorLogLevel, fromUrlQueryToDataListParams, I18nPropertyPipe, ClassMapPipe, CommonsFeatureTypeEnum } from '@mediusinc/mng-commons/core';
|
|
28
28
|
import { FilterTypeEnum, FilterDescriptor, FilterDisplayTypeEnum, FilterLookupTypeEnum, FilterLookupDescriptor } from '@mediusinc/mng-commons/filter';
|
|
29
29
|
import { DateRangeComponent, AutocompleteComponent, DropdownComponent, InputTrimDirective, NumberRangeComponent } from '@mediusinc/mng-commons/form';
|
|
30
30
|
import { tableDescriptor, TableDynamicDescriptorInst, TablePaginationModeEnum, ColumnDisplayTypeEnum, TableSizeEnum } from '@mediusinc/mng-commons/table/api';
|
|
@@ -1103,6 +1103,7 @@ class TableColumnValueComponent {
|
|
|
1103
1103
|
}
|
|
1104
1104
|
return;
|
|
1105
1105
|
});
|
|
1106
|
+
this.hasCopyToClipboard = computed(() => this.descriptor().hasCopyToClipboard && this.value() != null);
|
|
1106
1107
|
}
|
|
1107
1108
|
copyToClipboard(event) {
|
|
1108
1109
|
event.stopPropagation();
|
|
@@ -1117,11 +1118,11 @@ class TableColumnValueComponent {
|
|
|
1117
1118
|
this.messageService.add({ severity: 'info', summary: title, detail: message });
|
|
1118
1119
|
}
|
|
1119
1120
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: TableColumnValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1120
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", 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 (
|
|
1121
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", 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 (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 }); }
|
|
1121
1122
|
}
|
|
1122
1123
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: TableColumnValueComponent, decorators: [{
|
|
1123
1124
|
type: Component,
|
|
1124
|
-
args: [{ standalone: true, selector: 'mng-table-column-value', imports: [TooltipModule, TranslateModule, BooleanPipe, EnumPipe, ComponentDirective, ButtonModule, RippleModule, DecimalPipe, CurrencyPipe, DatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: { '[class]': 'className()', '[style.max-width.px]': 'styleMaxWidth()' }, template: "@if (descriptor().localizationExistsProperty && !item()[descriptor().localizationExistsProperty!]) {\n <i class=\"pi pi-exclamation-circle\" [pTooltip]=\"'mngTable.translationMissing' | translate\"></i>\n}\n@switch (descriptor().columnDisplayType) {\n @case (columnDisplayTypeString) {\n @if (descriptor().hasValueAsTooltip) {\n <span [pTooltip]=\"value()\" tooltipPosition=\"left\">{{ value() }}</span>\n } @else {\n {{ value() }}\n }\n }\n @case (columnDisplayTypeHtml) {\n <span [innerHTML]=\"value()\"></span>\n }\n @case (columnDisplayTypeNumber) {\n {{ 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 (
|
|
1125
|
+
args: [{ standalone: true, selector: 'mng-table-column-value', imports: [TooltipModule, TranslateModule, BooleanPipe, EnumPipe, ComponentDirective, ButtonModule, RippleModule, DecimalPipe, CurrencyPipe, DatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: { '[class]': 'className()', '[style.max-width.px]': 'styleMaxWidth()' }, template: "@if (descriptor().localizationExistsProperty && !item()[descriptor().localizationExistsProperty!]) {\n <i class=\"pi pi-exclamation-circle\" [pTooltip]=\"'mngTable.translationMissing' | translate\"></i>\n}\n@switch (descriptor().columnDisplayType) {\n @case (columnDisplayTypeString) {\n @if (descriptor().hasValueAsTooltip) {\n <span [pTooltip]=\"value()\" tooltipPosition=\"left\">{{ value() }}</span>\n } @else {\n {{ value() }}\n }\n }\n @case (columnDisplayTypeHtml) {\n <span [innerHTML]=\"value()\"></span>\n }\n @case (columnDisplayTypeNumber) {\n {{ 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 (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"] }]
|
|
1125
1126
|
}] });
|
|
1126
1127
|
|
|
1127
1128
|
class FilterValuePipe {
|
|
@@ -1630,17 +1631,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
1630
1631
|
], 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.metadata.descriptor.property) {\n <mng-table-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-table-filter-form\n [model]=\"model()\"\n [metadata]=\"metadata()\"\n [genericDescriptor]=\"genericFilterDescriptor()\"\n [filter]=\"filterEdit()\"\n [disabledProperties]=\"activeFilterProperties()\"\n [propertySearch]=\"genericFilterDescriptor()?.propertySearch\"\n [overlay]=\"op\"\n [enableCaseSensitive]=\"enableCaseSensitive()\"\n (apply)=\"onFilterFormApply($event)\" />\n</p-overlayPanel>\n", styles: [".toggle-button-input{position:absolute;right:.35rem;top:50%;transform:translateY(-50%)}\n"] }]
|
|
1631
1632
|
}], ctorParameters: () => [] });
|
|
1632
1633
|
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1634
|
+
/**
|
|
1635
|
+
* Generates and displays a notification for a table-related error with localized error messages and details.
|
|
1636
|
+
*
|
|
1637
|
+
* @param {TranslateService} translate - The service used to handle localization and translations.
|
|
1638
|
+
* @param {MessageService} messageService - The service used to manage and display messages.
|
|
1639
|
+
* @param {TableDescriptorInst<any>} table - The table descriptor containing table-specific information and model data.
|
|
1640
|
+
* @param {Error} error - The error object providing details about the error that occurred.
|
|
1641
|
+
* @return {Message | null} The generated message object for the error notification or null if no notification was created.
|
|
1642
|
+
*/
|
|
1643
|
+
function tableNotificationError(translate, messageService, table, error) {
|
|
1644
|
+
const params = {
|
|
1645
|
+
errorMessage: getI18nForError(translate, error) ?? error.message,
|
|
1646
|
+
...getI18nErrorParams(error)
|
|
1647
|
+
};
|
|
1648
|
+
const tableErrorTitle = getI18nForModel(translate, table.model, 'table.error.title', { fallbackKey: 'general.error', params }) ?? undefined;
|
|
1649
|
+
const tableErrorMessage = getI18nForModel(translate, table.model, 'table.error.message', { fallbackKey: 'general.errorMessage', params }) ?? undefined;
|
|
1650
|
+
return toastMessage(tableErrorMessage ?? error.message, 'error', { messageService: messageService, title: tableErrorTitle, icon: 'pi-exclamation-triangle' });
|
|
1644
1651
|
}
|
|
1645
1652
|
|
|
1646
1653
|
class LocaleDefaultRowClassPipe {
|
|
@@ -1836,6 +1843,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
1836
1843
|
|
|
1837
1844
|
class TableComponent {
|
|
1838
1845
|
// subscriptions and refs
|
|
1846
|
+
#previousDataProvider;
|
|
1839
1847
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1840
1848
|
#dataProviderEagerFirstLoad;
|
|
1841
1849
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -1957,16 +1965,18 @@ class TableComponent {
|
|
|
1957
1965
|
this.hasCustomLastColumn = computed(() => this.columnCustomLastComponent() || this.columnCustomLastTemplate());
|
|
1958
1966
|
this.hasLastColumn = computed(() => this.hasCustomLastColumn() || this.areColumnsToggleable() || this.areColumnsReorderable());
|
|
1959
1967
|
// other
|
|
1960
|
-
this.lastQueryParams = this.route.snapshot.queryParams;
|
|
1961
1968
|
this.navigationOutOfTableInProgress = false;
|
|
1962
1969
|
this.navigationInTableInProgress = false;
|
|
1963
|
-
// subscriptions and refs
|
|
1964
1970
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1965
1971
|
this.#dataProviderEagerFirstLoad = effectWithDeps([this.dataProvider], ([dataProvider]) => {
|
|
1966
1972
|
if (dataProvider?.isLazy === false) {
|
|
1967
1973
|
this.loadTableWithDataProvider(this.metadata.defaultParams());
|
|
1968
1974
|
}
|
|
1969
|
-
|
|
1975
|
+
else if (this.#previousDataProvider && dataProvider) {
|
|
1976
|
+
this.reload();
|
|
1977
|
+
}
|
|
1978
|
+
this.#previousDataProvider = dataProvider;
|
|
1979
|
+
});
|
|
1970
1980
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1971
1981
|
this.#dataProviderReloadSubscription = toObservable(this.dataProvider)
|
|
1972
1982
|
.pipe(switchMap(dp => dp?.tableReload$ ?? of({})), takeUntilDestroyed())
|
|
@@ -2010,8 +2020,9 @@ class TableComponent {
|
|
|
2010
2020
|
this.navigationInTableInProgress = true;
|
|
2011
2021
|
const newParams = dataListParamsToUrlQuery(params, this.metadata.defaultParams(), { prependFilterName: this.filterKeyPrepend });
|
|
2012
2022
|
const newParamsWithParamsToRemove = { ...newParams };
|
|
2013
|
-
|
|
2014
|
-
|
|
2023
|
+
const currentQp = this.route.snapshot.queryParams;
|
|
2024
|
+
if (currentQp) {
|
|
2025
|
+
Object.keys(currentQp)
|
|
2015
2026
|
.filter(k => (k.startsWith(this.filterKeyPrepend) || ['offset', 'limit', 'sort', 'q'].indexOf(k) >= 0) && newParams[k] === undefined)
|
|
2016
2027
|
.forEach(k => (newParamsWithParamsToRemove[k] = null));
|
|
2017
2028
|
}
|
|
@@ -2022,11 +2033,8 @@ class TableComponent {
|
|
|
2022
2033
|
queryParams: newParamsWithParamsToRemove,
|
|
2023
2034
|
queryParamsHandling: 'merge'
|
|
2024
2035
|
})
|
|
2025
|
-
.then(
|
|
2036
|
+
.then(() => {
|
|
2026
2037
|
this.navigationInTableInProgress = false;
|
|
2027
|
-
if (res) {
|
|
2028
|
-
this.lastQueryParams = newParams;
|
|
2029
|
-
}
|
|
2030
2038
|
});
|
|
2031
2039
|
}
|
|
2032
2040
|
}
|
|
@@ -2068,7 +2076,7 @@ class TableComponent {
|
|
|
2068
2076
|
}
|
|
2069
2077
|
loadTableWithDataProvider(paramsWithDefaults, emitEvent = true) {
|
|
2070
2078
|
const isFetched = this.data.fetchWithDataProvider(paramsWithDefaults, error => {
|
|
2071
|
-
tableNotificationError(this.translate, this.metadata.descriptor(), error
|
|
2079
|
+
tableNotificationError(this.translate, this.messageService, this.metadata.descriptor(), error);
|
|
2072
2080
|
const commonsError = fromSubscribeError(error, 'TableComponentError', {
|
|
2073
2081
|
params: paramsWithDefaults
|
|
2074
2082
|
});
|