@mediusinc/mng-commons 0.2.16 → 0.2.17

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.
Files changed (26) hide show
  1. package/esm2020/lib/api/models/filter-param.model.mjs +1 -1
  2. package/esm2020/lib/api/models/query-param.model.mjs +1 -1
  3. package/esm2020/lib/components/form/autocomplete/autocomplete.component.mjs +9 -10
  4. package/esm2020/lib/components/form/dropdown/dropdown.component.mjs +5 -7
  5. package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
  6. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +7 -6
  7. package/esm2020/lib/components/layout/topbar.component.mjs +1 -3
  8. package/esm2020/lib/components/tableview/table/table.component.mjs +7 -9
  9. package/esm2020/lib/descriptors/editor.descriptor.mjs +8 -2
  10. package/esm2020/lib/router/models/router.model.mjs +1 -1
  11. package/esm2020/lib/router/route-builder.mjs +75 -11
  12. package/esm2020/lib/services/configuration.service.mjs +3 -3
  13. package/fesm2015/mediusinc-mng-commons.mjs +114 -38
  14. package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
  15. package/fesm2020/mediusinc-mng-commons.mjs +107 -42
  16. package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
  17. package/lib/api/models/filter-param.model.d.ts +1 -1
  18. package/lib/api/models/query-param.model.d.ts +1 -1
  19. package/lib/components/form/autocomplete/autocomplete.component.d.ts +3 -2
  20. package/lib/components/form/dropdown/dropdown.component.d.ts +4 -4
  21. package/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +1 -0
  22. package/lib/components/layout/topbar.component.d.ts +2 -3
  23. package/lib/descriptors/editor.descriptor.d.ts +3 -1
  24. package/lib/router/models/router.model.d.ts +2 -2
  25. package/lib/router/route-builder.d.ts +18 -4
  26. package/package.json +1 -1
@@ -987,6 +987,7 @@ class FieldInputDescriptor extends AFieldDescriptor {
987
987
  constructor(editor, property) {
988
988
  super(editor, property);
989
989
  this._fieldType = FieldInputDescriptor.TypeEnum.Text;
990
+ this._numberUseGrouping = true;
990
991
  // radio specific properties
991
992
  this._radioOptions = [];
992
993
  this._datePickerShowTime = false;
@@ -1012,6 +1013,9 @@ class FieldInputDescriptor extends AFieldDescriptor {
1012
1013
  get numberMaxFractionDigits() {
1013
1014
  return this._numberMaxFractionDigits;
1014
1015
  }
1016
+ get numberUseGrouping() {
1017
+ return this._numberUseGrouping;
1018
+ }
1015
1019
  get radioOptions() {
1016
1020
  return this._radioOptions;
1017
1021
  }
@@ -1063,13 +1067,14 @@ class FieldInputDescriptor extends AFieldDescriptor {
1063
1067
  this._pattern = pattern;
1064
1068
  return this;
1065
1069
  }
1066
- asNumber(step, min, max, minFractionDigits, maxFractionDigits) {
1070
+ asNumber(step, min, max, minFractionDigits, maxFractionDigits, numberUseGrouping = true) {
1067
1071
  this._fieldType = FieldInputDescriptor.TypeEnum.Number;
1068
1072
  this._numberStep = step;
1069
1073
  this._numberMinFractionDigits = minFractionDigits;
1070
1074
  this._numberMaxFractionDigits = maxFractionDigits;
1071
1075
  this._numberMin = min ?? Number.MIN_SAFE_INTEGER;
1072
1076
  this._numberMax = max ?? Number.MAX_SAFE_INTEGER;
1077
+ this._numberUseGrouping = numberUseGrouping;
1073
1078
  return this;
1074
1079
  }
1075
1080
  asSwitch() {
@@ -1120,6 +1125,7 @@ class FieldInputDescriptor extends AFieldDescriptor {
1120
1125
  field._numberStep = this._numberStep;
1121
1126
  field._numberMinFractionDigits = this._numberMinFractionDigits;
1122
1127
  field._numberMaxFractionDigits = this._numberMaxFractionDigits;
1128
+ field._numberUseGrouping = this._numberUseGrouping;
1123
1129
  field._radioOptions = [...this._radioOptions];
1124
1130
  field._datePickerFormat = this._datePickerFormat;
1125
1131
  field._datePickerMin = this._datePickerMin;
@@ -3446,7 +3452,7 @@ class MngConfigurationService {
3446
3452
  const pathSegments = url.split('/');
3447
3453
  pathSegments[pathSegments.length - 1] = 'env.json';
3448
3454
  return this.http.get(pathSegments.join('/'));
3449
- }), first(), map(res => {
3455
+ }), map(res => {
3450
3456
  this.jsonEnvironments.push(res);
3451
3457
  this.mergeConfigs();
3452
3458
  return true;
@@ -4280,11 +4286,11 @@ class MngAutocompleteComponent {
4280
4286
  console.warn(`Data provider should be provided for MngAutocompleteComponent.`);
4281
4287
  }
4282
4288
  }
4289
+ ngOnDestroy() {
4290
+ this.searchSubscription?.unsubscribe();
4291
+ }
4283
4292
  onSearch(event) {
4284
- if (this.searchSubscription) {
4285
- // try to cancel existing HTTP request subscription
4286
- this.searchSubscription.unsubscribe();
4287
- }
4293
+ this.searchSubscription?.unsubscribe();
4288
4294
  if (this.dataProvider) {
4289
4295
  this.isLoading = true;
4290
4296
  const queryParamBuilder = MediusQueryParamBuilder.create();
@@ -4294,11 +4300,11 @@ class MngAutocompleteComponent {
4294
4300
  if (event.query && event.query.length > 0 && this.itemsLabelProperty) {
4295
4301
  queryParamBuilder.withFilter(this.itemsLabelProperty, event.query, undefined, MediusFilterMatchType.StartsWith);
4296
4302
  }
4297
- this.searchSubscription = this.dataProvider
4298
- .lookup(queryParamBuilder.build(), this.dataProviderService, event.query)
4299
- .pipe(first(), finalize(() => (this.isLoading = false)))
4300
- .subscribe((res) => {
4303
+ this.searchSubscription = this.dataProvider.lookup(queryParamBuilder.build(), this.dataProviderService, event.query).subscribe((res) => {
4301
4304
  this.suggestionsSubject.next(res);
4305
+ this.isLoading = false;
4306
+ }, () => {
4307
+ this.isLoading = false;
4302
4308
  });
4303
4309
  }
4304
4310
  }
@@ -4373,8 +4379,6 @@ class MngDropdownComponent {
4373
4379
  this.onTouchedFn = () => { };
4374
4380
  this.dropdownFormControl = new FormControl();
4375
4381
  this.items$ = this.itemsSubject.asObservable();
4376
- this.items = [];
4377
- this.itemsLoaded = false;
4378
4382
  }
4379
4383
  ngOnInit() {
4380
4384
  this.dropdownFormControl.valueChanges.subscribe(v => {
@@ -4384,10 +4388,7 @@ class MngDropdownComponent {
4384
4388
  if (this.dataProvider) {
4385
4389
  this.dataProviderService = this.dataProvider.serviceType ? this.injector.get(this.dataProvider.serviceType) : null;
4386
4390
  const queryParamBuilder = MediusQueryParamBuilder.create();
4387
- this.dataProvider
4388
- .lookup(queryParamBuilder.build(), this.dataProviderService)
4389
- .pipe(first())
4390
- .subscribe(res => {
4391
+ this.itemsSubscription = this.dataProvider.lookup(queryParamBuilder.build(), this.dataProviderService).subscribe(res => {
4391
4392
  this.itemsSubject.next(res);
4392
4393
  });
4393
4394
  if (this.selectFirstItem && !this.dropdownFormControl?.value) {
@@ -4401,6 +4402,9 @@ class MngDropdownComponent {
4401
4402
  console.warn(`Data provider should be provided for MngDropdownComponent.`);
4402
4403
  }
4403
4404
  }
4405
+ ngOnDestroy() {
4406
+ this.itemsSubscription?.unsubscribe();
4407
+ }
4404
4408
  registerOnChange(fn) {
4405
4409
  this.onChangeFn = fn;
4406
4410
  }
@@ -4611,10 +4615,10 @@ class MngFormlyFieldInputComponent extends FieldType {
4611
4615
  }
4612
4616
  }
4613
4617
  MngFormlyFieldInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4614
- MngFormlyFieldInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldInputComponent, selector: "mng-formly-field-input", usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"option.value\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"option.value\" class=\"mng-radio-button-label\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <p-inputMask\n *ngSwitchCase=\"'mask'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [mask]=\"$any(descriptor.mask)\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [slotChar]=\"$any(descriptor.slotChar)\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n", components: [{ type: i1$3.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }, { type: i2$5.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabelledBy"], outputs: ["onChange"] }, { type: i3.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i4$3.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i5.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { type: i6$1.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "style", "inputId", "styleClass", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "disabled", "readonly", "unmask", "name", "required", "characterPattern", "autoFocus", "autocomplete", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown"] }], directives: [{ type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i4$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i10$1.InputText, selector: "[pInputText]" }], pipes: { "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4618
+ MngFormlyFieldInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldInputComponent, selector: "mng-formly-field-input", usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"option.value\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"option.value\" class=\"mng-radio-button-label\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <p-inputMask\n *ngSwitchCase=\"'mask'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [mask]=\"$any(descriptor.mask)\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [slotChar]=\"$any(descriptor.slotChar)\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n", components: [{ type: i1$3.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }, { type: i2$5.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabelledBy"], outputs: ["onChange"] }, { type: i3.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i4$3.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i5.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { type: i6$1.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "style", "inputId", "styleClass", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "disabled", "readonly", "unmask", "name", "required", "characterPattern", "autoFocus", "autocomplete", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown"] }], directives: [{ type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i4$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i10$1.InputText, selector: "[pInputText]" }], pipes: { "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4615
4619
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, decorators: [{
4616
4620
  type: Component,
4617
- args: [{ selector: 'mng-formly-field-input', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"option.value\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"option.value\" class=\"mng-radio-button-label\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <p-inputMask\n *ngSwitchCase=\"'mask'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [mask]=\"$any(descriptor.mask)\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [slotChar]=\"$any(descriptor.slotChar)\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n" }]
4621
+ args: [{ selector: 'mng-formly-field-input', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"option.value\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"option.value\" class=\"mng-radio-button-label\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <p-inputMask\n *ngSwitchCase=\"'mask'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [mask]=\"$any(descriptor.mask)\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [slotChar]=\"$any(descriptor.slotChar)\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n" }]
4618
4622
  }] });
4619
4623
 
4620
4624
  class MngFormlyFieldDropdownComponent extends FieldType {
@@ -4946,6 +4950,7 @@ class MngTableComponent {
4946
4950
  });
4947
4951
  }
4948
4952
  ngOnDestroy() {
4953
+ this.dataProviderSubscription?.unsubscribe();
4949
4954
  this.subscriptions.forEach(s => s.unsubscribe());
4950
4955
  }
4951
4956
  reload(emitEvent = false, resetParams = false) {
@@ -4989,19 +4994,14 @@ class MngTableComponent {
4989
4994
  if (!this.useDataProvider) {
4990
4995
  return;
4991
4996
  }
4992
- if (this.dataProviderSubscription) {
4993
- this.dataProviderSubscription.unsubscribe();
4994
- }
4997
+ this.dataProviderSubscription?.unsubscribe();
4995
4998
  this.dataProviderLoadingSubject.next(true);
4996
4999
  if (!queryParam) {
4997
5000
  queryParam = MediusQueryParamBuilder.create(this.rowsPerPageOptions[0]).build();
4998
5001
  }
4999
5002
  this.dataProviderLatestQueryParam = queryParam;
5000
5003
  this.dataProviderLatestQueryParamVersion++;
5001
- this.dataProviderSubscription = this.dataProvider
5002
- ?.getAll(queryParam, this.dataProviderService)
5003
- .pipe(first(), finalize(() => this.dataProviderLoadingSubject.next(false)))
5004
- .subscribe(res => {
5004
+ this.dataProviderSubscription = this.dataProvider?.getAll(queryParam, this.dataProviderService).subscribe(res => {
5005
5005
  if (this.infiniteScroll) {
5006
5006
  if (this.isFilterChanged || this.isSortChanged) {
5007
5007
  this.dataProviderInfiniteScrollItems = [];
@@ -5014,12 +5014,14 @@ class MngTableComponent {
5014
5014
  }
5015
5015
  this.isFilterChanged = false;
5016
5016
  this.isSortChanged = false;
5017
+ this.dataProviderLoadingSubject.next(false);
5017
5018
  }, err => {
5018
5019
  ToastUtil.tableNotificationError(this.translate, this.descriptor, err, this.tableviewService);
5019
5020
  const emptyQueryResult = new MediusQueryResult();
5020
5021
  emptyQueryResult.pageData = [];
5021
5022
  emptyQueryResult.allDataCount = 0;
5022
5023
  this.dataProviderQueryResultSubject.next(emptyQueryResult);
5024
+ this.dataProviderLoadingSubject.next(false);
5023
5025
  });
5024
5026
  if (emitEvent) {
5025
5027
  const mngEvent = new MngTableLoadEvent();
@@ -5252,6 +5254,7 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
5252
5254
  this.subscriptions.push(subscription);
5253
5255
  }
5254
5256
  ngOnDestroy() {
5257
+ this.lookupDataProviderSubscription?.unsubscribe();
5255
5258
  this.subscriptions.forEach(s => s.unsubscribe());
5256
5259
  }
5257
5260
  openAddDialog() {
@@ -5265,12 +5268,12 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
5265
5268
  const filterValues = this.formControl.value.map((i) => i[this.descriptor.excludeValueProperty]);
5266
5269
  queryParamBuilder.withFilter(this.descriptor.excludeFilterProperty, filterValues, undefined, MediusFilterMatchType.NotIn);
5267
5270
  }
5268
- this.descriptor.lookupTableDataProvider
5269
- ?.getAll(queryParamBuilder.build(), this.dialogDataProviderService)
5270
- .pipe(first(), finalize(() => this.dialogIsLoadingSubject.next(false)))
5271
- .subscribe(res => {
5271
+ this.lookupDataProviderSubscription = this.descriptor.lookupTableDataProvider?.getAll(queryParamBuilder.build(), this.dialogDataProviderService).subscribe(res => {
5272
5272
  this.addItemsSubject.next(res);
5273
5273
  this.dialogAreItemsLoaded = true;
5274
+ this.dialogIsLoadingSubject.next(false);
5275
+ }, () => {
5276
+ this.dialogIsLoadingSubject.next(false);
5274
5277
  });
5275
5278
  }
5276
5279
  this.dialogSelectedAddItems = [];
@@ -5811,8 +5814,6 @@ class MngTopbarComponent {
5811
5814
  this.mngCommons.user$.subscribe(u => {
5812
5815
  this.user = u;
5813
5816
  });
5814
- }
5815
- ngAfterViewInit() {
5816
5817
  this.mainLayoutService.innerWidth = window.innerWidth;
5817
5818
  }
5818
5819
  switchLanguage(language) {
@@ -6653,12 +6654,30 @@ class RoutesBuilder {
6653
6654
  constructor(layoutRoute) {
6654
6655
  this.routes = [];
6655
6656
  this.layoutRoute = layoutRoute?.withRoot(this);
6657
+ this.currentRoute = layoutRoute;
6656
6658
  }
6657
6659
  static create() {
6658
6660
  return new RoutesBuilder();
6659
6661
  }
6660
- static createWithLayout(layoutComponent = MngMainLayoutComponent) {
6661
- const routesBuilder = new RoutesBuilder(RouteBuilder.create('', layoutComponent));
6662
+ static createWithLayout(layoutComponent = MngMainLayoutComponent, topbarComponent, breadcrumbComponent, menuComponent, footerComponent) {
6663
+ const layoutRoute = RouteBuilder.create('', layoutComponent);
6664
+ if (topbarComponent || breadcrumbComponent || menuComponent || footerComponent) {
6665
+ const dataBuilder = RouteDataBuilder.create();
6666
+ if (topbarComponent) {
6667
+ dataBuilder.withTopbarComponent(topbarComponent);
6668
+ }
6669
+ if (breadcrumbComponent) {
6670
+ dataBuilder.withBreadcrumbComponent(breadcrumbComponent);
6671
+ }
6672
+ if (menuComponent) {
6673
+ dataBuilder.withMenuComponent(menuComponent);
6674
+ }
6675
+ if (footerComponent) {
6676
+ dataBuilder.withFooterComponent(footerComponent);
6677
+ }
6678
+ layoutRoute.withDataBuilder(dataBuilder);
6679
+ }
6680
+ const routesBuilder = new RoutesBuilder(layoutRoute);
6662
6681
  return routesBuilder;
6663
6682
  }
6664
6683
  addAngularRoute(route) {
@@ -6748,15 +6767,9 @@ class RouteBuilder {
6748
6767
  static createFromRoute(route) {
6749
6768
  return new RouteBuilder(route);
6750
6769
  }
6751
- static createTableviewRoutes(path, descriptor, tableviewDataProvider, actions, hasDetails = true, hasEdit = true, hasAdd = true) {
6770
+ static createTableviewRoutes(path, descriptor, dataProvider, actions, hasDetails = true, hasEdit = true, hasAdd = true) {
6752
6771
  const tableviewRoute = RouteBuilder.createFromRoute({
6753
- data: {
6754
- tableviewData: {
6755
- descriptor: descriptor,
6756
- dataProvider: tableviewDataProvider,
6757
- actions: actions
6758
- }
6759
- },
6772
+ data: RouteDataBuilder.create().withTableview(descriptor, dataProvider, actions).build(),
6760
6773
  path: path,
6761
6774
  component: MngTableviewRouteComponent
6762
6775
  });
@@ -6837,6 +6850,10 @@ class RouteBuilder {
6837
6850
  this.route.data = data;
6838
6851
  return this;
6839
6852
  }
6853
+ withDataBuilder(dataBuilder) {
6854
+ this.route.data = dataBuilder.build();
6855
+ return this;
6856
+ }
6840
6857
  withMngMenuItem(menuItem) {
6841
6858
  this.menuItem = menuItem;
6842
6859
  return this;
@@ -7006,6 +7023,54 @@ class RouteBuilder {
7006
7023
  return guards;
7007
7024
  }
7008
7025
  }
7026
+ class RouteDataBuilder {
7027
+ constructor(init) {
7028
+ this.data = init ?? {};
7029
+ if (!this.data.breadcrumb) {
7030
+ this.data.breadcrumb = null;
7031
+ }
7032
+ }
7033
+ static create(data) {
7034
+ return new RouteDataBuilder(data);
7035
+ }
7036
+ withBreadcrumb(breadcrumb) {
7037
+ this.data.breadcrumb = breadcrumb;
7038
+ return this;
7039
+ }
7040
+ withPageTitle(pageTitle) {
7041
+ this.data.pageTitle = pageTitle;
7042
+ return this;
7043
+ }
7044
+ withTableview(descriptor, dataProvider, actions) {
7045
+ this.data.tableview = {
7046
+ descriptor: descriptor,
7047
+ dataProvider: dataProvider
7048
+ };
7049
+ if (actions) {
7050
+ this.data.tableview.actions = actions;
7051
+ }
7052
+ return this;
7053
+ }
7054
+ withTopbarComponent(component) {
7055
+ this.data.topbarComponent = component;
7056
+ return this;
7057
+ }
7058
+ withBreadcrumbComponent(component) {
7059
+ this.data.breadcrumbComponent = component;
7060
+ return this;
7061
+ }
7062
+ withMenuComponent(component) {
7063
+ this.data.menuComponent = component;
7064
+ return this;
7065
+ }
7066
+ withFooterComponent(component) {
7067
+ this.data.footerComponent = component;
7068
+ return this;
7069
+ }
7070
+ build() {
7071
+ return this.data;
7072
+ }
7073
+ }
7009
7074
 
7010
7075
  /*
7011
7076
  * Public API Surface of mng-commons
@@ -7015,5 +7080,5 @@ class RouteBuilder {
7015
7080
  * Generated bundle index. Do not edit.
7016
7081
  */
7017
7082
 
7018
- export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngCrudApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtil, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusQueryResultBase, MediusQueryResultWithObject, MediusRestUtil, MngActionComponent, MngActionDialogComponent, MngActionRouteComponent, MngActionService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngPropertyPathPipe, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, ModelDescriptor, ModelUtil, ObjectSerializer, RouteBuilder, RoutesBuilder, TableDescriptor, TableviewComponentService, TableviewDataProvider, TableviewDescriptor, ToastUtil, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngCommonsInitializerProvider, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
7083
+ export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngCrudApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtil, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusQueryResultBase, MediusQueryResultWithObject, MediusRestUtil, MngActionComponent, MngActionDialogComponent, MngActionRouteComponent, MngActionService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngPropertyPathPipe, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, ModelDescriptor, ModelUtil, ObjectSerializer, RouteBuilder, RouteDataBuilder, RoutesBuilder, TableDescriptor, TableviewComponentService, TableviewDataProvider, TableviewDescriptor, ToastUtil, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngCommonsInitializerProvider, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
7019
7084
  //# sourceMappingURL=mediusinc-mng-commons.mjs.map