@mediusinc/mng-commons 0.4.6 → 0.5.0

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 (40) hide show
  1. package/esm2020/lib/api/services/api.abstract.service.mjs +15 -4
  2. package/esm2020/lib/api/services/crud-api.abstract.service.mjs +3 -3
  3. package/esm2020/lib/components/action/action.component.mjs +52 -8
  4. package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +25 -1
  5. package/esm2020/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +12 -3
  6. package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +26 -1
  7. package/esm2020/lib/components/form/formly/fields/formly-field-label/formly-field-label.component.mjs +17 -0
  8. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +8 -4
  9. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +3 -3
  10. package/esm2020/lib/components/form/formly/fields/index.mjs +2 -1
  11. package/esm2020/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +3 -3
  12. package/esm2020/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.mjs +3 -3
  13. package/esm2020/lib/config/formly.config.mjs +7 -2
  14. package/esm2020/lib/descriptors/action.descriptor.mjs +34 -6
  15. package/esm2020/lib/descriptors/field.descriptor.mjs +48 -10
  16. package/esm2020/lib/descriptors/table.descriptor.mjs +3 -13
  17. package/esm2020/lib/mng-commons.module.mjs +5 -2
  18. package/esm2020/lib/pipes/enum.pipe.mjs +2 -2
  19. package/esm2020/lib/services/action-executor.service.mjs +28 -5
  20. package/esm2020/lib/utils/editor-formly.util.mjs +5 -5
  21. package/fesm2015/mediusinc-mng-commons.mjs +278 -60
  22. package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
  23. package/fesm2020/mediusinc-mng-commons.mjs +270 -59
  24. package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
  25. package/lib/api/services/api.abstract.service.d.ts +1 -1
  26. package/lib/api/services/crud-api.abstract.service.d.ts +8 -8
  27. package/lib/components/action/action.component.d.ts +13 -2
  28. package/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts +4 -2
  29. package/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.d.ts +7 -1
  30. package/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.d.ts +4 -2
  31. package/lib/components/form/formly/fields/formly-field-label/formly-field-label.component.d.ts +6 -0
  32. package/lib/components/form/formly/fields/index.d.ts +1 -0
  33. package/lib/descriptors/action.descriptor.d.ts +28 -3
  34. package/lib/descriptors/field.descriptor.d.ts +26 -12
  35. package/lib/descriptors/table.descriptor.d.ts +0 -1
  36. package/lib/mng-commons.module.d.ts +58 -57
  37. package/lib/pipes/enum.pipe.d.ts +2 -1
  38. package/package.json +1 -1
  39. package/scss/mng-overrides/_layout_dialog.scss +44 -14
  40. package/scss/mng-overrides/_theme_dialog.scss +2 -3
@@ -72,7 +72,7 @@ import * as i4$3 from 'primeng/toolbar';
72
72
  import { ToolbarModule } from 'primeng/toolbar';
73
73
  import * as i9 from 'primeng/tooltip';
74
74
  import { TooltipModule } from 'primeng/tooltip';
75
- import { throwError, of, Subject, Observable, from, combineLatest, tap, BehaviorSubject, ReplaySubject, switchMap, distinctUntilChanged, mergeMap as mergeMap$1 } from 'rxjs';
75
+ import { throwError, of, Subject, Observable, from, combineLatest, tap, BehaviorSubject, ReplaySubject, distinctUntilChanged, switchMap, mergeMap as mergeMap$1 } from 'rxjs';
76
76
  import 'reflect-metadata';
77
77
  import { map, mergeMap, first, catchError, filter, finalize, startWith } from 'rxjs/operators';
78
78
  import * as i4$1 from '@angular/platform-browser';
@@ -526,6 +526,9 @@ class ActionDescriptor {
526
526
  get runConfirmationRejectTitle() {
527
527
  return this._runConfirmationRejectTitle;
528
528
  }
529
+ get runConfirmationConfigMapFn() {
530
+ return this._runConfirmationConfigMapFn;
531
+ }
529
532
  get hasRunNotificationSuccess() {
530
533
  return this._hasRunNotificationSuccess;
531
534
  }
@@ -617,13 +620,24 @@ class ActionDescriptor {
617
620
  this._position = position;
618
621
  return this;
619
622
  }
620
- withRunConfirmation(icon = 'pi pi-exclamation-triangle', title, message, acceptTitle, rejectTitle) {
623
+ /**
624
+ * Add a confirmation dialogue to the action
625
+ * @param icon the icon to display on the confirmation dialogue
626
+ * @param title the title of the confirmation dialogue
627
+ * @param message the message on the confirmation dialogue
628
+ * @param acceptTitle the title of the accepting button
629
+ * @param rejectTitle the title of the rejecting button
630
+ * @param runConfirmationConfigMapFn function used to generate the confirmation dialogue. **WARNING** changing the *accept* and *reject* methods of the *confirmConfig* parameter
631
+ * may lead to unexpected behaviour
632
+ */
633
+ withRunConfirmation(icon = 'pi pi-exclamation-triangle', title, message, acceptTitle, rejectTitle, runConfirmationConfigMapFn) {
621
634
  this._hasRunConfirmation = true;
622
635
  this._runConfirmationIcon = icon;
623
636
  this._runConfirmationTitle = title;
624
637
  this._runConfirmationMessage = message;
625
638
  this._runConfirmationAcceptTitle = acceptTitle;
626
639
  this._runConfirmationRejectTitle = rejectTitle;
640
+ this._runConfirmationConfigMapFn = runConfirmationConfigMapFn;
627
641
  return this;
628
642
  }
629
643
  withRunNotificationSuccess(title, message, hasNotification = true) {
@@ -659,7 +673,7 @@ class ActionEditorDescriptor extends ActionDescriptor {
659
673
  this._editorActions = [];
660
674
  this._editorTitle = undefined;
661
675
  this._hasFetchNotificationSuccess = false;
662
- this._dialogClassName = '';
676
+ this._dialogSize = ActionEditorDescriptor.DialogSizeEnum.Normal;
663
677
  this._type = ActionTypeEnum.Editor;
664
678
  this._editorDescriptor = editorDescriptor;
665
679
  this._editorActions.push(new ActionEditorSubmitDescriptor(this), new ActionEditorSubmitDescriptor(this, ActionEditorSubmitDescriptor.TypeEnum.Cancel));
@@ -670,6 +684,9 @@ class ActionEditorDescriptor extends ActionDescriptor {
670
684
  get editorDescriptor() {
671
685
  return this._editorDescriptor;
672
686
  }
687
+ get dialogSize() {
688
+ return this._dialogSize;
689
+ }
673
690
  get dialogClassName() {
674
691
  return this._dialogClassName;
675
692
  }
@@ -721,6 +738,10 @@ class ActionEditorDescriptor extends ActionDescriptor {
721
738
  this._dataProvider = new EditorDataProvider(this._model.type, serviceType);
722
739
  return this;
723
740
  }
741
+ withDialogSize(size = ActionEditorDescriptor.DialogSizeEnum.Normal) {
742
+ this._dialogSize = size;
743
+ return this;
744
+ }
724
745
  withDialogClassName(className) {
725
746
  this._dialogClassName = className;
726
747
  return this;
@@ -755,6 +776,16 @@ class ActionEditorDescriptor extends ActionDescriptor {
755
776
  return this;
756
777
  }
757
778
  }
779
+ (function (ActionEditorDescriptor) {
780
+ let DialogSizeEnum;
781
+ (function (DialogSizeEnum) {
782
+ DialogSizeEnum[DialogSizeEnum["ExtraSmall"] = 0] = "ExtraSmall";
783
+ DialogSizeEnum[DialogSizeEnum["Small"] = 1] = "Small";
784
+ DialogSizeEnum[DialogSizeEnum["Normal"] = 2] = "Normal";
785
+ DialogSizeEnum[DialogSizeEnum["Large"] = 3] = "Large";
786
+ DialogSizeEnum[DialogSizeEnum["ExtraLarge"] = 4] = "ExtraLarge";
787
+ })(DialogSizeEnum = ActionEditorDescriptor.DialogSizeEnum || (ActionEditorDescriptor.DialogSizeEnum = {}));
788
+ })(ActionEditorDescriptor || (ActionEditorDescriptor = {}));
758
789
  class ActionEditorSubmitDescriptor extends ActionDescriptor {
759
790
  constructor(editorAction, submitType = ActionEditorSubmitDescriptor.TypeEnum.Submit) {
760
791
  super(editorAction.model, submitType === ActionEditorSubmitDescriptor.TypeEnum.Submit ? 'submit' : 'cancel');
@@ -783,7 +814,6 @@ class ActionEditorDetailsDescriptor extends ActionEditorDescriptor {
783
814
  ? ctx.dataProvider.fetch(ctx.data?.itemId, ctx.serviceInstance)
784
815
  : throwError(new Error(`Data provider fetch function or item id ${ctx.data?.itemId} is missing.`)));
785
816
  this.withEditorActions([new ActionEditorSubmitDescriptor(this, ActionEditorSubmitDescriptor.TypeEnum.Cancel)]);
786
- this.withDialogClassName('mng-details-dynamic-dialog');
787
817
  }
788
818
  withServiceType(serviceType) {
789
819
  return this.withServiceFetchFunction(serviceType);
@@ -806,7 +836,6 @@ class ActionEditorAddDescriptor extends ActionEditorDescriptor {
806
836
  this.withSubmitFunction(ctx => ctx.dataProvider?.create ? ctx.dataProvider.create(ctx.data?.item, ctx.serviceInstance) : throwError(new Error(`Data provider create function is missing.`)));
807
837
  this.withLevel(ActionLevelEnum.Success);
808
838
  this.withIcon('pi pi-plus');
809
- this.withDialogClassName('mng-details-dynamic-dialog');
810
839
  }
811
840
  withServiceType(serviceType) {
812
841
  return this.withServiceSubmitFunction(serviceType);
@@ -837,7 +866,6 @@ class ActionEditorEditDescriptor extends ActionEditorDescriptor {
837
866
  ? ctx.dataProvider.update(ctx.data.itemId, ctx.data?.item, ctx.serviceInstance)
838
867
  : throwError(new Error(`Data provider update function or item id ${ctx.data?.itemId} is missing.`)));
839
868
  this.withIcon('pi pi-pencil');
840
- this.withDialogClassName('mng-details-dynamic-dialog');
841
869
  }
842
870
  withServiceType(serviceType) {
843
871
  return this.withServiceSubmitFunction(serviceType);
@@ -1663,6 +1691,9 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
1663
1691
  get className() {
1664
1692
  return this._className;
1665
1693
  }
1694
+ get fieldClassName() {
1695
+ return this._fieldClassName;
1696
+ }
1666
1697
  get labelClassName() {
1667
1698
  return this._labelClassName;
1668
1699
  }
@@ -1724,10 +1755,11 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
1724
1755
  this._validators.push(new FieldValidator(name, expression, message));
1725
1756
  return this;
1726
1757
  }
1727
- withClassName(className, labelClassName = '', inputClassName = '') {
1758
+ withClassName(className, labelClassName = '', inputClassName = '', fieldClassName) {
1728
1759
  this._className = className;
1729
1760
  this._labelClassName = labelClassName;
1730
1761
  this._inputClassName = inputClassName;
1762
+ this._fieldClassName = fieldClassName;
1731
1763
  return this;
1732
1764
  }
1733
1765
  withSize(size = FieldDescriptor.SizeEnum.Normal) {
@@ -1836,6 +1868,10 @@ class FieldInputDescriptor extends AFieldDescriptor {
1836
1868
  this._fieldType = FieldInputDescriptor.TypeEnum.Hidden;
1837
1869
  return this;
1838
1870
  }
1871
+ asLabel() {
1872
+ this._fieldType = FieldInputDescriptor.TypeEnum.Label;
1873
+ return this;
1874
+ }
1839
1875
  asText(minLength, maxLength, pattern, isEmail) {
1840
1876
  this._fieldType = FieldInputDescriptor.TypeEnum.Text;
1841
1877
  this._minLength = minLength;
@@ -1931,14 +1967,15 @@ class FieldInputDescriptor extends AFieldDescriptor {
1931
1967
  let TypeEnum;
1932
1968
  (function (TypeEnum) {
1933
1969
  TypeEnum[TypeEnum["Hidden"] = 0] = "Hidden";
1934
- TypeEnum[TypeEnum["Text"] = 1] = "Text";
1935
- TypeEnum[TypeEnum["Textarea"] = 2] = "Textarea";
1936
- TypeEnum[TypeEnum["Number"] = 3] = "Number";
1937
- TypeEnum[TypeEnum["Switch"] = 4] = "Switch";
1938
- TypeEnum[TypeEnum["Radio"] = 5] = "Radio";
1939
- TypeEnum[TypeEnum["Datepicker"] = 6] = "Datepicker";
1940
- TypeEnum[TypeEnum["Mask"] = 7] = "Mask";
1941
- TypeEnum[TypeEnum["Custom"] = 8] = "Custom";
1970
+ TypeEnum[TypeEnum["Label"] = 1] = "Label";
1971
+ TypeEnum[TypeEnum["Text"] = 2] = "Text";
1972
+ TypeEnum[TypeEnum["Textarea"] = 3] = "Textarea";
1973
+ TypeEnum[TypeEnum["Number"] = 4] = "Number";
1974
+ TypeEnum[TypeEnum["Switch"] = 5] = "Switch";
1975
+ TypeEnum[TypeEnum["Radio"] = 6] = "Radio";
1976
+ TypeEnum[TypeEnum["Datepicker"] = 7] = "Datepicker";
1977
+ TypeEnum[TypeEnum["Mask"] = 8] = "Mask";
1978
+ TypeEnum[TypeEnum["Custom"] = 9] = "Custom";
1942
1979
  })(TypeEnum = FieldInputDescriptor.TypeEnum || (FieldInputDescriptor.TypeEnum = {}));
1943
1980
  })(FieldInputDescriptor || (FieldInputDescriptor = {}));
1944
1981
  class FieldLookupDescriptor extends AFieldDescriptor {
@@ -2096,6 +2133,16 @@ class FieldLookupEnumDescriptor extends FieldLookupDescriptor {
2096
2133
  }
2097
2134
  return this;
2098
2135
  }
2136
+ withDefaultValueEnum(defaultValue) {
2137
+ const defaultOptionValue = this._nameAsValue ? EnumUtil.getConstantName(this._enumType, defaultValue) : defaultValue;
2138
+ if (defaultOptionValue) {
2139
+ const option = this._optionEnumValues.find(o => o.value === defaultOptionValue);
2140
+ if (option) {
2141
+ this.withDefaultValue(option);
2142
+ }
2143
+ }
2144
+ return this;
2145
+ }
2099
2146
  asAutocomplete(openOnFocus = true) {
2100
2147
  super.asAutocomplete(openOnFocus, true);
2101
2148
  return this;
@@ -2318,6 +2365,13 @@ class FieldTabGroupDescriptor extends AFieldGroupDescriptor {
2318
2365
  class FieldGroupDescriptor extends AFieldGroupDescriptor {
2319
2366
  constructor(editor, name) {
2320
2367
  super(editor, name);
2368
+ this._type = FieldGroupDescriptor.TypeEnum.Fieldset;
2369
+ if (this._default) {
2370
+ this.asLogical();
2371
+ }
2372
+ }
2373
+ get type() {
2374
+ return this._type;
2321
2375
  }
2322
2376
  get fields() {
2323
2377
  return this._fields;
@@ -2329,13 +2383,25 @@ class FieldGroupDescriptor extends AFieldGroupDescriptor {
2329
2383
  this._fields.push(field);
2330
2384
  return this;
2331
2385
  }
2386
+ asLogical() {
2387
+ this._type = FieldGroupDescriptor.TypeEnum.Logical;
2388
+ return this;
2389
+ }
2332
2390
  copy() {
2333
2391
  const group = new FieldGroupDescriptor(this._editor, this.name.substring(this.baseName.length));
2392
+ group._type = this._type;
2334
2393
  group._title = this._title;
2335
2394
  group._fields = this.fields.map(f => f.copy());
2336
2395
  return group;
2337
2396
  }
2338
2397
  }
2398
+ (function (FieldGroupDescriptor) {
2399
+ let TypeEnum;
2400
+ (function (TypeEnum) {
2401
+ TypeEnum[TypeEnum["Fieldset"] = 0] = "Fieldset";
2402
+ TypeEnum[TypeEnum["Logical"] = 1] = "Logical";
2403
+ })(TypeEnum = FieldGroupDescriptor.TypeEnum || (FieldGroupDescriptor.TypeEnum = {}));
2404
+ })(FieldGroupDescriptor || (FieldGroupDescriptor = {}));
2339
2405
 
2340
2406
  class FieldValidator {
2341
2407
  constructor(name, expression, message, options) {
@@ -2403,6 +2469,7 @@ class TableDescriptor {
2403
2469
  this._rowHeight = 45;
2404
2470
  this._tableFullHeightOffset = 315;
2405
2471
  this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
2472
+ this._dataKeyProperty = idProperty ?? ModelUtil.findIdAttribute(modelType) ?? undefined;
2406
2473
  }
2407
2474
  get filterDisplay() {
2408
2475
  return this._filterDisplay;
@@ -2442,48 +2509,41 @@ class TableDescriptor {
2442
2509
  }
2443
2510
  addColumnDescriptor(column) {
2444
2511
  this._columns.push(column);
2445
- this.setDataKeyFromColumn();
2446
2512
  return this;
2447
2513
  }
2448
2514
  addColumn(property) {
2449
2515
  const column = new ColumnDescriptor(this, property);
2450
2516
  this._columns.push(column);
2451
- this.setDataKeyFromColumn();
2452
2517
  return column;
2453
2518
  }
2454
2519
  addColumnNumber(property, displayFormat) {
2455
2520
  const column = new ColumnDescriptor(this, property);
2456
2521
  column.asNumber(displayFormat);
2457
2522
  this._columns.push(column);
2458
- this.setDataKeyFromColumn();
2459
2523
  return column;
2460
2524
  }
2461
2525
  addColumnDate(property, displayFormat) {
2462
2526
  const column = new ColumnDescriptor(this, property);
2463
2527
  column.asDate(displayFormat);
2464
2528
  this._columns.push(column);
2465
- this.setDataKeyFromColumn();
2466
2529
  return column;
2467
2530
  }
2468
2531
  addColumnBoolean(property, yes, no, asIcon = false) {
2469
2532
  const column = new ColumnDescriptor(this, property);
2470
2533
  column.asBoolean(yes, no, asIcon);
2471
2534
  this._columns.push(column);
2472
- this.setDataKeyFromColumn();
2473
2535
  return column;
2474
2536
  }
2475
2537
  addColumnEnum(property, enumType, nameAsValue = false, titlePath) {
2476
2538
  const column = new ColumnDescriptor(this, property);
2477
2539
  column.asEnum(enumType, nameAsValue, titlePath);
2478
2540
  this._columns.push(column);
2479
- this.setDataKeyFromColumn();
2480
2541
  return column;
2481
2542
  }
2482
2543
  addColumnCustomComponent(property, customComponentType) {
2483
2544
  const column = new ColumnDescriptor(this, property);
2484
2545
  column.asCustomComponent(customComponentType);
2485
2546
  this._columns.push(column);
2486
- this.setDataKeyFromColumn();
2487
2547
  return column;
2488
2548
  }
2489
2549
  withFilterDisplay(filterDisplayType) {
@@ -2531,11 +2591,6 @@ class TableDescriptor {
2531
2591
  descriptor._filterDisplay = this._filterDisplay;
2532
2592
  return descriptor;
2533
2593
  }
2534
- setDataKeyFromColumn() {
2535
- if (!this._dataKeyProperty && this._columns.length === 1) {
2536
- this._dataKeyProperty = this._columns[0].property;
2537
- }
2538
- }
2539
2594
  }
2540
2595
  (function (TableDescriptor) {
2541
2596
  let PaginationModeEnum;
@@ -2770,16 +2825,16 @@ class EditorFormlyUtil {
2770
2825
  // assign default field width through entire row
2771
2826
  className = 'col-12';
2772
2827
  }
2773
- if (className.indexOf('col-') < 0) {
2774
- // class was provided, but does not contain col- definition
2775
- className = `col-12 ${descriptor.className}`;
2776
- }
2777
2828
  field.className = className;
2778
2829
  field.templateOptions['descriptor'] = descriptor;
2779
2830
  if (descriptor instanceof FieldInputDescriptor) {
2780
2831
  switch (descriptor.fieldType) {
2781
2832
  case FieldInputDescriptor.TypeEnum.Hidden:
2782
2833
  break;
2834
+ case FieldInputDescriptor.TypeEnum.Label:
2835
+ field.type = 'label';
2836
+ delete field.key;
2837
+ break;
2783
2838
  case FieldInputDescriptor.TypeEnum.Textarea:
2784
2839
  field.type = 'textarea';
2785
2840
  break;
@@ -3889,7 +3944,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
3889
3944
 
3890
3945
  class MngEnumPipe {
3891
3946
  transform(value, enumObj, i18nPath, nameAsValue = false) {
3892
- if (!value || !enumObj) {
3947
+ if (!value || (typeof value !== 'number' && typeof value !== 'string') || !enumObj) {
3893
3948
  return value;
3894
3949
  }
3895
3950
  const enumConstantName = nameAsValue ? value : EnumUtil.getConstantNameFromEnumObject(enumObj, value);
@@ -4066,7 +4121,7 @@ class MngActionExecutorService {
4066
4121
  throw Error(`Source component ${sourceComponent} should be implementing IConfirmationService interface to be able to provide confirmation functionality.`);
4067
4122
  }
4068
4123
  const srcConfirmComponent = sourceComponent;
4069
- const confirmParams = {
4124
+ let confirmParams = {
4070
4125
  key: srcConfirmComponent.getConfirmationServiceInstanceKey(action),
4071
4126
  acceptVisible: false,
4072
4127
  rejectVisible: false
@@ -4112,6 +4167,9 @@ class MngActionExecutorService {
4112
4167
  confirmParams.reject = () => {
4113
4168
  observer.error(new ActionRunResult(context, undefined, new ActionError(null, true)));
4114
4169
  };
4170
+ if (action.runConfirmationConfigMapFn) {
4171
+ confirmParams = action.runConfirmationConfigMapFn(context, confirmParams);
4172
+ }
4115
4173
  srcConfirmComponent.getConfirmationService().confirm(confirmParams);
4116
4174
  });
4117
4175
  return observable;
@@ -4232,13 +4290,33 @@ class MngActionExecutorService {
4232
4290
  let dialogComponent = this.defaultEditorDialogComponent;
4233
4291
  let dialogClassName = '';
4234
4292
  if (action instanceof ActionEditorDescriptor) {
4293
+ dialogClassName = action.dialogClassName ?? 'mng-action-editor-dialog';
4294
+ let dialogSizeClassName = '';
4295
+ switch (action.dialogSize) {
4296
+ case ActionEditorDescriptor.DialogSizeEnum.ExtraSmall:
4297
+ dialogSizeClassName = 'mng-action-editor-dialog-xs';
4298
+ break;
4299
+ case ActionEditorDescriptor.DialogSizeEnum.Small:
4300
+ dialogSizeClassName = 'mng-action-editor-dialog-sm';
4301
+ break;
4302
+ case ActionEditorDescriptor.DialogSizeEnum.Large:
4303
+ dialogSizeClassName = 'mng-action-editor-dialog-lg';
4304
+ break;
4305
+ case ActionEditorDescriptor.DialogSizeEnum.ExtraLarge:
4306
+ dialogSizeClassName = 'mng-action-editor-dialog-xl';
4307
+ break;
4308
+ case ActionEditorDescriptor.DialogSizeEnum.Normal:
4309
+ default:
4310
+ break;
4311
+ }
4312
+ if (dialogSizeClassName.length) {
4313
+ dialogClassName += ` ${dialogSizeClassName}`;
4314
+ }
4235
4315
  if (action.editorComponent) {
4236
4316
  dialogComponent = action.editorComponent;
4237
4317
  }
4238
- if (action.dialogClassName) {
4239
- dialogClassName = action.dialogClassName;
4240
- }
4241
4318
  }
4319
+ console.log(dialogClassName);
4242
4320
  const dialogConfig = {
4243
4321
  data: {
4244
4322
  action
@@ -4856,17 +4934,25 @@ class MngActionComponent {
4856
4934
  this.loadingSubject = new ReplaySubject(1);
4857
4935
  this.$loading = this.loadingSubject.asObservable();
4858
4936
  this.cmpId = Math.random().toString(36).substring(2);
4937
+ this.isVisibleSubject = new ReplaySubject(1);
4938
+ this.$isVisible = this.isVisibleSubject.asObservable().pipe(distinctUntilChanged());
4939
+ this.isEnabledSubject = new ReplaySubject(1);
4940
+ this.$isEnabled = this.isEnabledSubject.asObservable().pipe(distinctUntilChanged());
4941
+ this.labelSubject = new ReplaySubject(1);
4942
+ this.$label = this.labelSubject.asObservable().pipe(distinctUntilChanged());
4943
+ this.tooltipSubject = new ReplaySubject(1);
4944
+ this.$tooltip = this.tooltipSubject.asObservable().pipe(distinctUntilChanged());
4859
4945
  this.hasNoTitle = false;
4860
4946
  this.loadingSubject.next(false);
4861
4947
  }
4862
4948
  ngOnInit() {
4863
4949
  this.viewContainer = this.viewContainerInit ?? this.viewContainerService ?? undefined;
4864
4950
  this.hasNoTitle = this.action.title === null;
4865
- const context = this.actionExecutor.prepareActionExecContext(this.action, this.itemId, this.item, this.dataProvider, this.viewContainer ?? undefined, this, this.actionData);
4866
- this.$isVisible = typeof this.action.isVisibleFunction === 'function' ? this.action.isVisibleFunction(context) : of(true);
4867
- this.$isEnabled = typeof this.action.isEnabledFunction === 'function' ? this.action.isEnabledFunction(context) : of(true);
4868
- this.$label = this.hasNoTitle ? of(null) : I18nUtils.Action.getAsync(this.translate, this.action, 'title', this.action?.title ?? undefined, this.item);
4869
- this.$tooltip = I18nUtils.Action.getAsync(this.translate, this.action, 'tooltip', this.action?.tooltip ?? undefined, this.item);
4951
+ this.isEnabledSubject.next(true);
4952
+ this.isVisibleSubject.next(true);
4953
+ this.labelSubject.next(null);
4954
+ this.tooltipSubject.next(null);
4955
+ this.processSubscriptions();
4870
4956
  if (this.action instanceof ActionLinkDescriptor) {
4871
4957
  this.actionLink = this.action;
4872
4958
  }
@@ -4874,6 +4960,17 @@ class MngActionComponent {
4874
4960
  this.hostClass = this.action.className;
4875
4961
  }
4876
4962
  }
4963
+ ngOnChanges(changes) {
4964
+ if (!(changes['item']?.firstChange ?? true) || !(changes['itemId']?.firstChange ?? true) || !(changes['actionData']?.firstChange ?? true)) {
4965
+ this.processSubscriptions();
4966
+ }
4967
+ }
4968
+ ngOnDestroy() {
4969
+ this.isVisibleSubscription?.unsubscribe();
4970
+ this.isEnabledSubscription?.unsubscribe();
4971
+ this.labelSubscription?.unsubscribe();
4972
+ this.tooltipSubscription?.unsubscribe();
4973
+ }
4877
4974
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
4878
4975
  triggerAction(event) {
4879
4976
  this.loadingSubject.next(true);
@@ -4899,9 +4996,34 @@ class MngActionComponent {
4899
4996
  getConfirmationServiceInstanceKey(action) {
4900
4997
  return `${action.actionName}_${this.cmpId}`;
4901
4998
  }
4999
+ processSubscriptions() {
5000
+ const context = this.actionExecutor.prepareActionExecContext(this.action, this.itemId, this.item, this.dataProvider, this.viewContainer ?? undefined, this, this.actionData);
5001
+ if (typeof this.action.isVisibleFunction === 'function') {
5002
+ this.isVisibleSubscription?.unsubscribe();
5003
+ this.isVisibleSubscription = this.action.isVisibleFunction(context).subscribe({
5004
+ next: res => this.isVisibleSubject.next(res)
5005
+ });
5006
+ }
5007
+ if (typeof this.action.isEnabledFunction === 'function') {
5008
+ this.isEnabledSubscription?.unsubscribe();
5009
+ this.isEnabledSubscription = this.action.isEnabledFunction(context).subscribe({
5010
+ next: res => this.isEnabledSubject.next(res)
5011
+ });
5012
+ }
5013
+ if (!this.hasNoTitle) {
5014
+ this.labelSubscription?.unsubscribe();
5015
+ this.labelSubscription = I18nUtils.Action.getAsync(this.translate, this.action, 'title', this.action?.title ?? undefined, this.item).subscribe({
5016
+ next: i18n => this.labelSubject.next(i18n)
5017
+ });
5018
+ }
5019
+ this.tooltipSubscription?.unsubscribe();
5020
+ this.tooltipSubscription = I18nUtils.Action.getAsync(this.translate, this.action, 'tooltip', this.action?.tooltip ?? undefined, this.item).subscribe({
5021
+ next: i18n => this.tooltipSubject.next(i18n)
5022
+ });
5023
+ }
4902
5024
  }
4903
5025
  MngActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionComponent, deps: [{ token: i1.ActivatedRoute }, { token: i1$1.TranslateService }, { token: MngActionExecutorService }, { token: i2.ConfirmationService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
4904
- MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", dataProvider: "dataProvider", inputDisabled: ["disabled", "inputDisabled"], inputLoading: ["loading", "inputLoading"], viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { triggerEventEmitter: "trigger" }, host: { properties: { "class": "this.hostClass" } }, providers: [ConfirmationService], ngImport: i0, template: "<ng-container *ngIf=\"$isVisible | async\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : actionLink.url\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-link]=\"actionLink.isStyleLink\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"\n ($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | linkFormatter: itemId:item:action.model:actionData)\n \"\n [queryParams]=\"actionLink.queryParams\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-link]=\"actionLink.isStyleLink\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\"></button>\n </ng-template>\n <p-confirmDialog *ngIf=\"action.hasRunConfirmation\" [key]=\"action.actionName + '_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"], components: [{ type: i5.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i9.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }], pipes: { "async": i4.AsyncPipe, "linkFormatter": MngLinkFormatterPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5026
+ MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", dataProvider: "dataProvider", inputDisabled: ["disabled", "inputDisabled"], inputLoading: ["loading", "inputLoading"], viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { triggerEventEmitter: "trigger" }, host: { properties: { "class": "this.hostClass" } }, providers: [ConfirmationService], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"$isVisible | async\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : actionLink.url\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-link]=\"actionLink.isStyleLink\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"\n ($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | linkFormatter: itemId:item:action.model:actionData)\n \"\n [queryParams]=\"actionLink.queryParams\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-link]=\"actionLink.isStyleLink\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\"></button>\n </ng-template>\n <p-confirmDialog *ngIf=\"action.hasRunConfirmation\" [key]=\"action.actionName + '_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"], components: [{ type: i5.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i9.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }], pipes: { "async": i4.AsyncPipe, "linkFormatter": MngLinkFormatterPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4905
5027
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionComponent, decorators: [{
4906
5028
  type: Component,
4907
5029
  args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfirmationService], template: "<ng-container *ngIf=\"$isVisible | async\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : actionLink.url\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-link]=\"actionLink.isStyleLink\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"\n ($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | linkFormatter: itemId:item:action.model:actionData)\n \"\n [queryParams]=\"actionLink.queryParams\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-link]=\"actionLink.isStyleLink\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\"></button>\n </ng-template>\n <p-confirmDialog *ngIf=\"action.hasRunConfirmation\" [key]=\"action.actionName + '_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"] }]
@@ -5936,13 +6058,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
5936
6058
  }] });
5937
6059
 
5938
6060
  class MngFormlyFieldInputComponent extends FieldType {
6061
+ constructor() {
6062
+ super(...arguments);
6063
+ this.subscriptions = [];
6064
+ }
5939
6065
  ngOnInit() {
5940
6066
  this.iFormControl = this.formControl;
5941
6067
  this.descriptor = this.to['descriptor'];
6068
+ // emit lifecycle event
6069
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Component, MngFormlyFieldInputComponent, this, {
6070
+ eventSubtype: MngFormFieldEventComponentSubtype.ON_INIT
6071
+ });
6072
+ // init values
5942
6073
  if (this.to.type === 'datepicker' && typeof this.iFormControl.value === 'string') {
5943
6074
  const dateObject = new Date(this.iFormControl.value);
5944
6075
  this.iFormControl.setValue(dateObject);
5945
6076
  }
6077
+ const subscription = this.formControl.valueChanges.pipe(startWith(this.formControl.value), distinctUntilChanged()).subscribe(v => {
6078
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.ValueChange, MngFormlyFieldInputComponent, this, {
6079
+ value: v
6080
+ });
6081
+ });
6082
+ this.subscriptions.push(subscription);
6083
+ }
6084
+ ngOnDestroy() {
6085
+ this.subscriptions.forEach(s => s.unsubscribe());
6086
+ // emit lifecycle event
6087
+ this.descriptor?.nextEvent(MngFormFieldEventTypeEnum.Component, MngFormlyFieldInputComponent, this, {
6088
+ eventSubtype: MngFormFieldEventComponentSubtype.ON_DESTROY
6089
+ });
5946
6090
  }
5947
6091
  }
5948
6092
  MngFormlyFieldInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
@@ -5952,10 +6096,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
5952
6096
  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 [inputStyleClass]=\"descriptor.inputClassName\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\" [class]=\"descriptor.labelClassName\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [styleClass]=\"descriptor.inputClassName\"></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\n [name]=\"$any(key)\"\n [value]=\"option.value\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [styleClass]=\"descriptor.inputClassName\"></p-radioButton>\n <label [for]=\"option.value\" [class]=\"'mng-radio-button-label ' + descriptor.labelClassName\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea\n *ngSwitchCase=\"'textarea'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [rows]=\"descriptor.rows ?? 3\"\n pInputTextarea\n [class]=\"descriptor.inputClassName\">\n </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n appendTo=\"body\"\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 [inputStyleClass]=\"descriptor.inputClassName\">\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 [styleClass]=\"descriptor.inputClassName\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n" }]
5953
6097
  }] });
5954
6098
 
6099
+ class MngFormlyFieldLabelComponent {
6100
+ constructor() {
6101
+ this.className = 'hidden';
6102
+ }
6103
+ }
6104
+ MngFormlyFieldLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
6105
+ MngFormlyFieldLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldLabelComponent, selector: "mng-formly-field-label", host: { properties: { "class": "this.className" } }, ngImport: i0, template: "", changeDetection: i0.ChangeDetectionStrategy.OnPush });
6106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLabelComponent, decorators: [{
6107
+ type: Component,
6108
+ args: [{ selector: 'mng-formly-field-label', changeDetection: ChangeDetectionStrategy.OnPush, template: "" }]
6109
+ }], propDecorators: { className: [{
6110
+ type: HostBinding,
6111
+ args: ['class']
6112
+ }] } });
6113
+
5955
6114
  class MngFormlyFieldDropdownComponent extends FieldType {
6115
+ constructor() {
6116
+ super(...arguments);
6117
+ this.subscriptions = [];
6118
+ }
5956
6119
  ngOnInit() {
5957
6120
  this.dFormControl = this.formControl;
5958
6121
  this.descriptor = this.to['descriptor'];
6122
+ // emit lifecycle event
6123
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Component, MngFormlyFieldDropdownComponent, this, {
6124
+ eventSubtype: MngFormFieldEventComponentSubtype.ON_INIT
6125
+ });
6126
+ const subscription = this.formControl.valueChanges.pipe(startWith(this.formControl.value), distinctUntilChanged()).subscribe(v => {
6127
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.ValueChange, MngFormlyFieldDropdownComponent, this, {
6128
+ value: v
6129
+ });
6130
+ });
6131
+ this.subscriptions.push(subscription);
6132
+ }
6133
+ ngOnDestroy() {
6134
+ this.subscriptions.forEach(s => s.unsubscribe());
6135
+ // emit lifecycle event
6136
+ this.descriptor?.nextEvent(MngFormFieldEventTypeEnum.Component, MngFormlyFieldDropdownComponent, this, {
6137
+ eventSubtype: MngFormFieldEventComponentSubtype.ON_DESTROY
6138
+ });
5959
6139
  }
5960
6140
  }
5961
6141
  MngFormlyFieldDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldDropdownComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
@@ -6728,6 +6908,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
6728
6908
  }] } });
6729
6909
 
6730
6910
  var SizeEnum = ActionDescriptor.SizeEnum;
6911
+ var DialogSizeEnum = ActionEditorDescriptor.DialogSizeEnum;
6731
6912
  class MngFormlyFieldTableDialogFormComponent extends FieldType {
6732
6913
  constructor(actionExecutor) {
6733
6914
  super();
@@ -6751,7 +6932,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
6751
6932
  const viewAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.viewEditor, 'details', this.descriptor.editor.model.type, this.descriptor.property)
6752
6933
  .withPosition(ActionPositionEnum.RowClick)
6753
6934
  .withTitle(null)
6754
- .withDialogClassName('mng-formly-field-table-form-dialog');
6935
+ .withDialogClassName('mng-field-dialog mng-action-editor-dialog')
6936
+ .withDialogSize(DialogSizeEnum.Small);
6755
6937
  viewAction.withEditorActions([new ActionEditorSubmitDescriptor(viewAction, ActionEditorSubmitDescriptor.TypeEnum.Cancel)]);
6756
6938
  this.rowClickActions.push(viewAction);
6757
6939
  }
@@ -6760,7 +6942,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
6760
6942
  .withPosition(ActionPositionEnum.ToolbarRight)
6761
6943
  .withTitle(null)
6762
6944
  .withIcon('pi pi-plus')
6763
- .withDialogClassName('mng-formly-field-table-form-dialog')
6945
+ .withDialogClassName('mng-field-dialog mng-action-editor-dialog')
6946
+ .withDialogSize(DialogSizeEnum.Small)
6764
6947
  .withSize(SizeEnum.ExtraSmall)
6765
6948
  .withSubmitFunction(ctx => {
6766
6949
  if (!ctx.data?.item) {
@@ -6780,7 +6963,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
6780
6963
  const editAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.editEditor, 'edit', this.descriptor.editor.model.type, this.descriptor.property)
6781
6964
  .withTitle(null)
6782
6965
  .withIcon('pi pi-pencil')
6783
- .withDialogClassName('mng-formly-field-table-form-dialog')
6966
+ .withDialogClassName('mng-field-dialog mng-action-editor-dialog')
6967
+ .withDialogSize(DialogSizeEnum.Small)
6784
6968
  .withSize(SizeEnum.ExtraSmall)
6785
6969
  .withSubmitFunction(ctx => {
6786
6970
  if (!ctx.data?.item) {
@@ -6981,10 +7165,10 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
6981
7165
  }
6982
7166
  }
6983
7167
  MngFormlyFieldTableDialogMultiselectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
6984
- MngFormlyFieldTableDialogMultiselectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTableDialogMultiselectComponent, selector: "mng-formly-table-multiselect-add-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.mainTableDescriptor\" [items]=\"itemsAsync\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header pt-0\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <button\n *ngIf=\"hasAddAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-success mng-button-xs\"\n (click)=\"openAddDialog()\"\n [disabled]=\"formControl!.disabled\"></button>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <button\n *ngIf=\"hasDeleteAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-danger mng-button-xs\"\n (click)=\"removeItem(item)\"\n [disabled]=\"formControl!.disabled\"></button>\n </ng-template>\n</mng-table>\n\n<p-dialog\n *ngIf=\"hasAddAction\"\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.addItem' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-table-multiselect-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.mainTableDescriptor\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [loading]=\"dialogIsLoading$\"\n (selectionChange)=\"onSelectionChange($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.add' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItems()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i1$3.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: i3$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i1$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
7168
+ MngFormlyFieldTableDialogMultiselectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTableDialogMultiselectComponent, selector: "mng-formly-table-multiselect-add-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.mainTableDescriptor\" [items]=\"itemsAsync\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header pt-0\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <button\n *ngIf=\"hasAddAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-success mng-button-xs\"\n (click)=\"openAddDialog()\"\n [disabled]=\"formControl!.disabled\"></button>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <button\n *ngIf=\"hasDeleteAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-danger mng-button-xs\"\n (click)=\"removeItem(item)\"\n [disabled]=\"formControl!.disabled\"></button>\n </ng-template>\n</mng-table>\n\n<p-dialog\n *ngIf=\"hasAddAction\"\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.addItem' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-field-dialog mng-action-editor-dialog mng-action-editor-dialog-sm\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.mainTableDescriptor\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [loading]=\"dialogIsLoading$\"\n (selectionChange)=\"onSelectionChange($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.add' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItems()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i1$3.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: i3$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i1$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6985
7169
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, decorators: [{
6986
7170
  type: Component,
6987
- args: [{ selector: 'mng-formly-table-multiselect-add-field', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-table [descriptor]=\"descriptor.mainTableDescriptor\" [items]=\"itemsAsync\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header pt-0\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <button\n *ngIf=\"hasAddAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-success mng-button-xs\"\n (click)=\"openAddDialog()\"\n [disabled]=\"formControl!.disabled\"></button>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <button\n *ngIf=\"hasDeleteAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-danger mng-button-xs\"\n (click)=\"removeItem(item)\"\n [disabled]=\"formControl!.disabled\"></button>\n </ng-template>\n</mng-table>\n\n<p-dialog\n *ngIf=\"hasAddAction\"\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.addItem' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-table-multiselect-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.mainTableDescriptor\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [loading]=\"dialogIsLoading$\"\n (selectionChange)=\"onSelectionChange($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.add' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItems()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n" }]
7171
+ args: [{ selector: 'mng-formly-table-multiselect-add-field', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-table [descriptor]=\"descriptor.mainTableDescriptor\" [items]=\"itemsAsync\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header pt-0\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <button\n *ngIf=\"hasAddAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-success mng-button-xs\"\n (click)=\"openAddDialog()\"\n [disabled]=\"formControl!.disabled\"></button>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <button\n *ngIf=\"hasDeleteAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-danger mng-button-xs\"\n (click)=\"removeItem(item)\"\n [disabled]=\"formControl!.disabled\"></button>\n </ng-template>\n</mng-table>\n\n<p-dialog\n *ngIf=\"hasAddAction\"\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.addItem' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-field-dialog mng-action-editor-dialog mng-action-editor-dialog-sm\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.mainTableDescriptor\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [loading]=\"dialogIsLoading$\"\n (selectionChange)=\"onSelectionChange($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.add' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItems()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n" }]
6988
7172
  }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
6989
7173
 
6990
7174
  class MngFormlyFieldTabsComponent extends FieldType {
@@ -6997,30 +7181,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
6997
7181
  }] });
6998
7182
 
6999
7183
  class MngFormlyFieldFieldsetComponent extends FieldType {
7184
+ constructor() {
7185
+ super(...arguments);
7186
+ this.typeFieldset = FieldGroupDescriptor.TypeEnum.Fieldset;
7187
+ this.typeLogical = FieldGroupDescriptor.TypeEnum.Logical;
7188
+ }
7189
+ ngOnInit() {
7190
+ this.descriptor = this.to['descriptor'];
7191
+ }
7000
7192
  }
7001
7193
  MngFormlyFieldFieldsetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldFieldsetComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
7002
- MngFormlyFieldFieldsetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldFieldsetComponent, selector: "mng-formly-field-fieldset", usesInheritance: true, ngImport: i0, template: "<ng-container *ngFor=\"let group of field.fieldGroup; let i = index; let last = last\">\n <p-fieldset *ngIf=\"!group.templateOptions?.['descriptor']?.default; else defaultSet\" [legend]=\"group.templateOptions?.label! | translate\">\n <formly-field [field]=\"group\"></formly-field>\n </p-fieldset>\n <ng-template #defaultSet>\n <formly-field [field]=\"group\"></formly-field>\n </ng-template>\n</ng-container>\n", components: [{ type: i1$5.Fieldset, selector: "p-fieldset", inputs: ["legend", "toggleable", "collapsed", "style", "styleClass", "transitionOptions"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }, { type: i3$1.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i1$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
7194
+ MngFormlyFieldFieldsetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldFieldsetComponent, selector: "mng-formly-field-fieldset", usesInheritance: true, ngImport: i0, template: "<ng-container *ngFor=\"let group of field.fieldGroup; let i = index; let last = last\">\n <ng-container [ngSwitch]=\"descriptor?.type\">\n <p-fieldset *ngSwitchCase=\"typeFieldset\" [legend]=\"group.templateOptions?.label! | translate\">\n <formly-field [field]=\"group\"></formly-field>\n </p-fieldset>\n <formly-field *ngSwitchDefault [field]=\"group\"></formly-field>\n </ng-container>\n</ng-container>\n", components: [{ type: i1$5.Fieldset, selector: "p-fieldset", inputs: ["legend", "toggleable", "collapsed", "style", "styleClass", "transitionOptions"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }, { type: i3$1.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }], pipes: { "translate": i1$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
7003
7195
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldFieldsetComponent, decorators: [{
7004
7196
  type: Component,
7005
- args: [{ selector: 'mng-formly-field-fieldset', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngFor=\"let group of field.fieldGroup; let i = index; let last = last\">\n <p-fieldset *ngIf=\"!group.templateOptions?.['descriptor']?.default; else defaultSet\" [legend]=\"group.templateOptions?.label! | translate\">\n <formly-field [field]=\"group\"></formly-field>\n </p-fieldset>\n <ng-template #defaultSet>\n <formly-field [field]=\"group\"></formly-field>\n </ng-template>\n</ng-container>\n" }]
7197
+ args: [{ selector: 'mng-formly-field-fieldset', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngFor=\"let group of field.fieldGroup; let i = index; let last = last\">\n <ng-container [ngSwitch]=\"descriptor?.type\">\n <p-fieldset *ngSwitchCase=\"typeFieldset\" [legend]=\"group.templateOptions?.label! | translate\">\n <formly-field [field]=\"group\"></formly-field>\n </p-fieldset>\n <formly-field *ngSwitchDefault [field]=\"group\"></formly-field>\n </ng-container>\n</ng-container>\n" }]
7006
7198
  }] });
7007
7199
 
7008
7200
  class MngFormlyFieldWrapperComponent extends FieldWrapper {
7009
7201
  }
7010
7202
  MngFormlyFieldWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
7011
- MngFormlyFieldWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldWrapperComponent, selector: "mng-formly-field-wrapper", usesInheritance: true, ngImport: i0, template: "<div class=\"field\">\n <label [for]=\"key\" [class]=\"to?.['descriptor']?.['labelClassName'] ?? ''\"\n >{{ $any(to?.label) | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label\n >\n <ng-container #fieldComponent></ng-container>\n <small *ngIf=\"to?.['descriptor']?.['helpText']\">{{ to?.['descriptor']?.['helpText'] | translate }}</small>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n</div>\n", components: [{ type: i3$1.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i1$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
7203
+ MngFormlyFieldWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldWrapperComponent, selector: "mng-formly-field-wrapper", usesInheritance: true, ngImport: i0, template: "<div [class]=\"to?.['descriptor']?.['fieldClassName'] ?? 'field'\">\n <label [for]=\"key\" [class]=\"to?.['descriptor']?.['labelClassName'] ?? ''\"\n >{{ $any(to?.label) | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label\n >\n <ng-container #fieldComponent></ng-container>\n <small *ngIf=\"to?.['descriptor']?.['helpText']\">{{ to?.['descriptor']?.['helpText'] | translate }}</small>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n</div>\n", components: [{ type: i3$1.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i1$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
7012
7204
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldWrapperComponent, decorators: [{
7013
7205
  type: Component,
7014
- args: [{ selector: 'mng-formly-field-wrapper', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"field\">\n <label [for]=\"key\" [class]=\"to?.['descriptor']?.['labelClassName'] ?? ''\"\n >{{ $any(to?.label) | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label\n >\n <ng-container #fieldComponent></ng-container>\n <small *ngIf=\"to?.['descriptor']?.['helpText']\">{{ to?.['descriptor']?.['helpText'] | translate }}</small>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n</div>\n" }]
7206
+ args: [{ selector: 'mng-formly-field-wrapper', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"to?.['descriptor']?.['fieldClassName'] ?? 'field'\">\n <label [for]=\"key\" [class]=\"to?.['descriptor']?.['labelClassName'] ?? ''\"\n >{{ $any(to?.label) | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label\n >\n <ng-container #fieldComponent></ng-container>\n <small *ngIf=\"to?.['descriptor']?.['helpText']\">{{ to?.['descriptor']?.['helpText'] | translate }}</small>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n</div>\n" }]
7015
7207
  }] });
7016
7208
 
7017
7209
  class MngFormlyTableWrapperComponent extends FieldWrapper {
7018
7210
  }
7019
7211
  MngFormlyTableWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyTableWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
7020
- MngFormlyTableWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyTableWrapperComponent, selector: "mng-formly-table-wrapper", usesInheritance: true, ngImport: i0, template: "<div class=\"field table\">\n <ng-container #fieldComponent></ng-container>\n <small *ngIf=\"to?.['descriptor']?.['helpText']\">{{ to?.['descriptor']?.['helpText'] | translate }}</small>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n</div>\n", components: [{ type: i3$1.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i1$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
7212
+ MngFormlyTableWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyTableWrapperComponent, selector: "mng-formly-table-wrapper", usesInheritance: true, ngImport: i0, template: "<div [class]=\"to?.['descriptor']?.['fieldClassName'] ?? 'field table'\">\n <ng-container #fieldComponent></ng-container>\n <small *ngIf=\"to?.['descriptor']?.['helpText']\">{{ to?.['descriptor']?.['helpText'] | translate }}</small>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n</div>\n", components: [{ type: i3$1.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i1$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
7021
7213
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyTableWrapperComponent, decorators: [{
7022
7214
  type: Component,
7023
- args: [{ selector: 'mng-formly-table-wrapper', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"field table\">\n <ng-container #fieldComponent></ng-container>\n <small *ngIf=\"to?.['descriptor']?.['helpText']\">{{ to?.['descriptor']?.['helpText'] | translate }}</small>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n</div>\n" }]
7215
+ args: [{ selector: 'mng-formly-table-wrapper', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"to?.['descriptor']?.['fieldClassName'] ?? 'field table'\">\n <ng-container #fieldComponent></ng-container>\n <small *ngIf=\"to?.['descriptor']?.['helpText']\">{{ to?.['descriptor']?.['helpText'] | translate }}</small>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n</div>\n" }]
7024
7216
  }] });
7025
7217
 
7026
7218
  class MngBreadcrumbComponent {
@@ -7611,6 +7803,11 @@ const formlyWrappersConfig = [
7611
7803
  { name: 'field-table', component: MngFormlyTableWrapperComponent }
7612
7804
  ];
7613
7805
  const formlyTypesConfig = [
7806
+ {
7807
+ name: 'label',
7808
+ component: MngFormlyFieldLabelComponent,
7809
+ wrappers: ['field']
7810
+ },
7614
7811
  {
7615
7812
  name: 'input',
7616
7813
  component: MngFormlyFieldInputComponent,
@@ -7854,6 +8051,7 @@ const declarations = [
7854
8051
  MngFormlyTableWrapperComponent,
7855
8052
  // formly fields
7856
8053
  MngFormlyFieldInputComponent,
8054
+ MngFormlyFieldLabelComponent,
7857
8055
  MngFormlyFieldDropdownComponent,
7858
8056
  MngFormlyFieldAutocompleteComponent,
7859
8057
  MngFormlyFieldLookupDialogComponent,
@@ -7959,6 +8157,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
7959
8157
  MngFormlyTableWrapperComponent,
7960
8158
  // formly fields
7961
8159
  MngFormlyFieldInputComponent,
8160
+ MngFormlyFieldLabelComponent,
7962
8161
  MngFormlyFieldDropdownComponent,
7963
8162
  MngFormlyFieldAutocompleteComponent,
7964
8163
  MngFormlyFieldLookupDialogComponent,
@@ -8072,6 +8271,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
8072
8271
  MngFormlyTableWrapperComponent,
8073
8272
  // formly fields
8074
8273
  MngFormlyFieldInputComponent,
8274
+ MngFormlyFieldLabelComponent,
8075
8275
  MngFormlyFieldDropdownComponent,
8076
8276
  MngFormlyFieldAutocompleteComponent,
8077
8277
  MngFormlyFieldLookupDialogComponent,
@@ -8163,11 +8363,22 @@ class AMngBaseApiService {
8163
8363
  this.objectSerializer = ObjectSerializer.get();
8164
8364
  }
8165
8365
  getUrl(...pathSegments) {
8166
- let path = pathSegments.join('/');
8167
- if (!path.startsWith('/')) {
8366
+ let baseUrl = this.getBasePath();
8367
+ if (baseUrl.endsWith('/')) {
8368
+ baseUrl = baseUrl.substring(0, baseUrl.length - 1);
8369
+ }
8370
+ const serviceBasePath = this.getServiceBasePath();
8371
+ let path = [serviceBasePath, ...pathSegments].filter(s => s && s.length).join('/');
8372
+ // omit first and last '/'
8373
+ if (path.startsWith('/')) {
8168
8374
  path = path.substring(1);
8169
8375
  }
8170
- return `${this.getBasePath()}${this.getServiceBasePath()}${path}`;
8376
+ if (path.endsWith('/')) {
8377
+ path = path.substring(0, path.length - 1);
8378
+ }
8379
+ // replace any double '//' from path that could come from joining paths
8380
+ path = path.replace('//', '/');
8381
+ return `${baseUrl}/${path}`;
8171
8382
  }
8172
8383
  serializeQueryParam(queryParam, type = 'QueryParam') {
8173
8384
  return this.objectSerializer.serialize(queryParam, type);
@@ -8227,7 +8438,7 @@ class AMngCrudApiService extends AMngGetAllApiService {
8227
8438
  super(type, queryResultType, http);
8228
8439
  }
8229
8440
  createPost(item, params) {
8230
- const url = this.getUrl(this.getCreatePostPath());
8441
+ const url = this.getUrl(this.getCreatePostPath(item));
8231
8442
  return this.http
8232
8443
  .post(url, this.serialize(item), {
8233
8444
  withCredentials: true,
@@ -8271,7 +8482,7 @@ class AMngCrudApiService extends AMngGetAllApiService {
8271
8482
  })
8272
8483
  .pipe(map(res => this.deserialize(res)));
8273
8484
  }
8274
- getCreatePostPath() {
8485
+ getCreatePostPath(item) {
8275
8486
  return '';
8276
8487
  }
8277
8488
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -8747,5 +8958,5 @@ class RouteDataBuilder {
8747
8958
  * Generated bundle index. Do not edit.
8748
8959
  */
8749
8960
 
8750
- export { ACTION_EDITOR_DIALOG_COMPONENT_SETTING, AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionLinkDescriptor, ActionPositionEnum, ActionRunResult, ActionSimpleDescriptor, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, DefaultMngErrorMapperService, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldDescriptor, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtils, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_BROWSER_STORAGE_IT, MNG_COMMONS_INITIALIZER_IT, MNG_DROPDOWN_VALUE_ACCESSOR, MNG_MODULE_CONFIG_IT, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngLinkFormatterPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, RouteBuilder, RouteDataBuilder, RoutesBuilder, TableDataProvider, TableDescriptor, TableviewDataProvider, TableviewDescriptor, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
8961
+ export { ACTION_EDITOR_DIALOG_COMPONENT_SETTING, AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionLinkDescriptor, ActionPositionEnum, ActionRunResult, ActionSimpleDescriptor, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, DefaultMngErrorMapperService, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldDescriptor, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtils, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_BROWSER_STORAGE_IT, MNG_COMMONS_INITIALIZER_IT, MNG_DROPDOWN_VALUE_ACCESSOR, MNG_MODULE_CONFIG_IT, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLabelComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngLinkFormatterPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, RouteBuilder, RouteDataBuilder, RoutesBuilder, TableDataProvider, TableDescriptor, TableviewDataProvider, TableviewDescriptor, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
8751
8962
  //# sourceMappingURL=mediusinc-mng-commons.mjs.map