@mediusinc/mng-commons 5.4.0 → 5.5.0-rc.1

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 (166) hide show
  1. package/core/descriptors/table.descriptor.d.ts +4 -2
  2. package/core/directives/rerender.directive.d.ts +9 -0
  3. package/core/helpers/route.d.ts +25 -25
  4. package/core/index.d.ts +2 -0
  5. package/core/models/version.model.d.ts +16 -4
  6. package/core/reactivity/effect.d.ts +16 -0
  7. package/esm2022/core/components/notification/notification-wrapper.component.mjs +4 -4
  8. package/esm2022/core/components/pages/error/error.page.component.mjs +4 -4
  9. package/esm2022/core/components/pages/not-found/not-found.page.component.mjs +4 -4
  10. package/esm2022/core/data-list/data-list-params-helpers.mjs +18 -3
  11. package/esm2022/core/descriptors/table.descriptor.mjs +1 -1
  12. package/esm2022/core/directives/component.directive.mjs +4 -4
  13. package/esm2022/core/directives/rerender.directive.mjs +25 -0
  14. package/esm2022/core/directives/template.directive.mjs +4 -4
  15. package/esm2022/core/index.mjs +4 -1
  16. package/esm2022/core/models/version.model.mjs +1 -1
  17. package/esm2022/core/pipes/boolean.pipe.mjs +6 -6
  18. package/esm2022/core/pipes/class-map.pipe.mjs +4 -4
  19. package/esm2022/core/pipes/enum.pipe.mjs +4 -4
  20. package/esm2022/core/pipes/enumerate-async.pipe.mjs +4 -4
  21. package/esm2022/core/pipes/enumerate.pipe.mjs +4 -4
  22. package/esm2022/core/pipes/getter.pipe.mjs +5 -5
  23. package/esm2022/core/pipes/i18n-property.pipe.mjs +4 -4
  24. package/esm2022/core/pipes/json-path.pipe.mjs +4 -4
  25. package/esm2022/core/pipes/parametrize.pipe.mjs +4 -4
  26. package/esm2022/core/pipes/template.pipe.mjs +4 -4
  27. package/esm2022/core/reactivity/effect.mjs +22 -0
  28. package/esm2022/core/security/permission.service.mjs +4 -4
  29. package/esm2022/core/services/commons-init.service.mjs +4 -4
  30. package/esm2022/core/services/commons-router.service.mjs +4 -4
  31. package/esm2022/core/services/commons-storage.service.mjs +4 -4
  32. package/esm2022/core/services/commons.service.mjs +8 -8
  33. package/esm2022/filter/descriptors/filter-lookup.descriptor.mjs +32 -25
  34. package/esm2022/filter/descriptors/filter.descriptor.mjs +53 -1
  35. package/esm2022/form/components/autocomplete/autocomplete.component.mjs +4 -4
  36. package/esm2022/form/components/date-range/date-range.component.mjs +4 -4
  37. package/esm2022/form/components/dropdown/dropdown.component.mjs +4 -4
  38. package/esm2022/form/components/number-range/number-range.component.mjs +4 -4
  39. package/esm2022/form/directives/input-trim.directive.mjs +4 -4
  40. package/esm2022/table/api/descriptors/sort.descriptor.mjs +2 -2
  41. package/esm2022/table/api/descriptors/table.descriptor.mjs +31 -7
  42. package/esm2022/table/components/column-filter/column-filter.component.mjs +33 -40
  43. package/esm2022/table/components/column-value/column-value.component.mjs +6 -6
  44. package/esm2022/table/components/filter/filter-active-tag/filter-active-tag.component.mjs +7 -7
  45. package/esm2022/table/components/filter/filter-form/filter-form.component.mjs +28 -35
  46. package/esm2022/table/components/filter/filter-overlay-with-tag/filter-overlay-with-tag.component.mjs +44 -45
  47. package/esm2022/table/components/table/table.component.mjs +114 -430
  48. package/esm2022/table/helpers/filters.mjs +9 -25
  49. package/esm2022/table/helpers/table.mjs +24 -0
  50. package/esm2022/table/index.mjs +2 -2
  51. package/esm2022/table/models/column-preferences.model.mjs +1 -1
  52. package/esm2022/table/models/filter.model.mjs +1 -1
  53. package/esm2022/table/pipes/filter-value.pipe.mjs +4 -4
  54. package/esm2022/table/pipes/locale-default-row-class.pipe.mjs +4 -4
  55. package/esm2022/table/pipes/table-column-filter-class.pipe.mjs +4 -4
  56. package/esm2022/table/services/table-data.service.mjs +194 -0
  57. package/esm2022/table/services/table-metadata.service.mjs +136 -0
  58. package/esm2022/table/services/table-preferences.service.mjs +142 -0
  59. package/esm2022/tableview/action/components/action/action.component.mjs +6 -7
  60. package/esm2022/tableview/action/components/editor/action-editor.component.mjs +4 -4
  61. package/esm2022/tableview/action/components/editor/injector-context/action-editor-injector-context.component.mjs +69 -46
  62. package/esm2022/tableview/action/components/localization/data-language-dropdown.component.mjs +4 -4
  63. package/esm2022/tableview/action/components/route/action-route.component.mjs +5 -6
  64. package/esm2022/tableview/action/components/table/action-table.component.mjs +6 -6
  65. package/esm2022/tableview/action/helpers/action-execution.mjs +25 -0
  66. package/esm2022/tableview/action/models/execution/action-instance.model.mjs +2 -3
  67. package/esm2022/tableview/action/services/action-executor.service.mjs +12 -79
  68. package/esm2022/tableview/action/services/component-action-executor.service.mjs +4 -4
  69. package/esm2022/tableview/action/services/data-provider-executor.service.mjs +4 -4
  70. package/esm2022/tableview/action/services/navigation.service.mjs +4 -4
  71. package/esm2022/tableview/action/services/root-action-executor.service.mjs +4 -4
  72. package/esm2022/tableview/action/services/view-container.service.mjs +4 -4
  73. package/esm2022/tableview/api/action/descriptors/action-confirmation.descriptor.mjs +13 -1
  74. package/esm2022/tableview/api/action/descriptors/action-editor.descriptor.mjs +67 -10
  75. package/esm2022/tableview/api/action/descriptors/action-link-descriptor.factory.mjs +2 -2
  76. package/esm2022/tableview/api/action/descriptors/action-link.descriptor.mjs +17 -1
  77. package/esm2022/tableview/api/action/descriptors/action.descriptor.mjs +32 -7
  78. package/esm2022/tableview/api/action/models/execution/action-instance-state.model.mjs +2 -2
  79. package/esm2022/tableview/api/editor/descriptors/field-many.descriptor.mjs +2 -1
  80. package/esm2022/tableview/api/editor/models/formly-custom-field.model.mjs +4 -4
  81. package/esm2022/tableview/api/tableview/descriptors/tableview.descriptor.mjs +13 -5
  82. package/esm2022/tableview/api/tableview/helpers/tableview-default-actions.mjs +3 -2
  83. package/esm2022/tableview/api/tableview/helpers/tableview-descriptor-helpers.mjs +2 -2
  84. package/esm2022/tableview/editor/components/editor/auto-save-status/auto-save-status.component.mjs +4 -4
  85. package/esm2022/tableview/editor/components/editor/form-editor.component.mjs +31 -38
  86. package/esm2022/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.mjs +4 -4
  87. package/esm2022/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +7 -5
  88. package/esm2022/tableview/editor/components/formly/fields/formly-field-custom/formly-field-custom.component.mjs +4 -4
  89. package/esm2022/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.mjs +7 -5
  90. package/esm2022/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +7 -5
  91. package/esm2022/tableview/editor/components/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +4 -4
  92. package/esm2022/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.mjs +5 -5
  93. package/esm2022/tableview/editor/components/formly/fields/formly-field-label/formly-field-label.component.mjs +4 -4
  94. package/esm2022/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +5 -6
  95. package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +5 -6
  96. package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +6 -7
  97. package/esm2022/tableview/editor/components/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +4 -4
  98. package/esm2022/tableview/editor/components/formly/fields/formly-field-type.abstract.component.mjs +6 -5
  99. package/esm2022/tableview/editor/components/formly/pipes/formly-field-label.pipe.mjs +4 -4
  100. package/esm2022/tableview/editor/components/formly/wrappers/formly-field-no-label-wrapper/formly-field-no-label-wrapper.component.mjs +4 -4
  101. package/esm2022/tableview/editor/components/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +4 -4
  102. package/esm2022/tableview/editor/helpers/editor-autosave.mjs +2 -2
  103. package/esm2022/tableview/editor/services/form-editor.service.mjs +4 -4
  104. package/esm2022/tableview/index.mjs +1 -2
  105. package/esm2022/tableview/tableview/components/route/tableview-route.component.mjs +4 -4
  106. package/esm2022/tableview/tableview/components/tableview/tableview.component.mjs +4 -4
  107. package/fesm2022/mediusinc-mng-commons-core.mjs +130 -71
  108. package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
  109. package/fesm2022/mediusinc-mng-commons-filter.mjs +83 -24
  110. package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -1
  111. package/fesm2022/mediusinc-mng-commons-form-api.mjs.map +1 -1
  112. package/fesm2022/mediusinc-mng-commons-form.mjs +15 -15
  113. package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
  114. package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
  115. package/fesm2022/mediusinc-mng-commons-table-api.mjs +31 -7
  116. package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
  117. package/fesm2022/mediusinc-mng-commons-table.mjs +704 -606
  118. package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -1
  119. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +146 -26
  120. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
  121. package/fesm2022/mediusinc-mng-commons-tableview.mjs +260 -317
  122. package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
  123. package/fesm2022/mediusinc-mng-commons.mjs.map +1 -1
  124. package/filter/descriptors/filter-lookup.descriptor.d.ts +17 -20
  125. package/filter/descriptors/filter.descriptor.d.ts +32 -2
  126. package/form/components/date-range/date-range.component.d.ts +3 -3
  127. package/form/components/number-range/number-range.component.d.ts +2 -2
  128. package/package.json +4 -4
  129. package/table/api/descriptors/column.descriptor.d.ts +1 -1
  130. package/table/api/descriptors/sort.descriptor.d.ts +2 -2
  131. package/table/api/descriptors/table.descriptor.d.ts +20 -6
  132. package/table/components/column-filter/column-filter.component.d.ts +8 -14
  133. package/table/components/filter/filter-active-tag/filter-active-tag.component.d.ts +5 -5
  134. package/table/components/filter/filter-form/filter-form.component.d.ts +10 -19
  135. package/table/components/filter/filter-overlay-with-tag/filter-overlay-with-tag.component.d.ts +11 -13
  136. package/table/components/table/table.component.d.ts +20 -64
  137. package/table/helpers/filters.d.ts +4 -7
  138. package/table/helpers/table.d.ts +6 -0
  139. package/table/index.d.ts +1 -1
  140. package/table/models/column-preferences.model.d.ts +2 -2
  141. package/table/models/filter.model.d.ts +14 -2
  142. package/table/services/table-data.service.d.ts +36 -0
  143. package/table/services/table-metadata.service.d.ts +31 -0
  144. package/table/services/table-preferences.service.d.ts +25 -0
  145. package/tableview/action/components/editor/injector-context/action-editor-injector-context.component.d.ts +4 -7
  146. package/tableview/action/components/localization/data-language-dropdown.component.d.ts +1 -1
  147. package/tableview/action/helpers/action-execution.d.ts +7 -0
  148. package/tableview/action/models/execution/action-instance.model.d.ts +1 -2
  149. package/tableview/action/services/action-executor.service.d.ts +1 -2
  150. package/tableview/api/action/descriptors/action-confirmation.descriptor.d.ts +1 -0
  151. package/tableview/api/action/descriptors/action-editor.descriptor.d.ts +12 -4
  152. package/tableview/api/action/descriptors/action-link.descriptor.d.ts +1 -0
  153. package/tableview/api/action/descriptors/action.descriptor.d.ts +5 -3
  154. package/tableview/api/action/models/execution/action-instance-state.model.d.ts +1 -1
  155. package/tableview/api/editor/descriptors/field-base.descriptor.d.ts +4 -10
  156. package/tableview/api/editor/descriptors/field-group.descriptor.d.ts +1 -1
  157. package/tableview/api/tableview/descriptors/tableview.descriptor.d.ts +6 -4
  158. package/tableview/editor/components/editor/form-editor.component.d.ts +3 -2
  159. package/tableview/editor/components/formly/fields/formly-field-fieldset/formly-field-fieldset.component.d.ts +1 -1
  160. package/tableview/editor/components/formly/fields/formly-field-type.abstract.component.d.ts +2 -1
  161. package/tableview/index.d.ts +0 -1
  162. package/version-info.json +6 -6
  163. package/esm2022/table/services/data-list.service.mjs +0 -29
  164. package/esm2022/tableview/action/models/execution/action-instance-state.model.mjs +0 -32
  165. package/table/services/data-list.service.d.ts +0 -19
  166. package/tableview/action/models/execution/action-instance-state.model.d.ts +0 -30
@@ -120,6 +120,18 @@ class ActionConfirmationDescriptor {
120
120
  get rejectButton() {
121
121
  return this._rejectButton;
122
122
  }
123
+ copy() {
124
+ const descriptor = new ActionConfirmationDescriptor();
125
+ descriptor._icon = this._icon;
126
+ descriptor._title = this._title;
127
+ descriptor._message = this._message;
128
+ descriptor._acceptButton = this._acceptButton;
129
+ descriptor._rejectButton = this._rejectButton;
130
+ descriptor._closeOnEscape = this._closeOnEscape;
131
+ descriptor._closable = this._closable;
132
+ descriptor._runConfirmationConfigMapFn = this._runConfirmationConfigMapFn;
133
+ return descriptor;
134
+ }
123
135
  }
124
136
 
125
137
  class ActionDescriptorInst {
@@ -391,33 +403,48 @@ class ActionDescriptorInst {
391
403
  this._subactions.push(...subactions);
392
404
  return this;
393
405
  }
394
- copyTo(descriptor) {
406
+ copyFieldsTo(descriptor) {
395
407
  descriptor._i18nModelActionBaseKey = this._i18nModelActionBaseKey;
396
408
  descriptor._type = this._type;
397
409
  descriptor._activationTrigger = this._activationTrigger;
398
410
  descriptor._position = this._position;
399
411
  descriptor._level = this._level;
400
- descriptor._positionTableviewCategories = this._positionTableviewCategories;
412
+ descriptor._positionTableviewCategories = this._positionTableviewCategories ? [...this._positionTableviewCategories] : undefined;
401
413
  descriptor._tableviewCategory = this._tableviewCategory;
402
414
  descriptor._routeUrl = this._routeUrl;
403
415
  descriptor._runFunction = this._runFunction;
404
416
  descriptor._isVisibleFunction = this._isVisibleFunction;
405
417
  descriptor._isEnabledFunction = this._isEnabledFunction;
406
- descriptor._runConfirmationDialogDescriptor = this._runConfirmationDialogDescriptor;
418
+ descriptor._runConfirmationDialogDescriptor = this._runConfirmationDialogDescriptor?.copy();
407
419
  descriptor._hasRunNotificationSuccess = this._hasRunNotificationSuccess;
408
420
  descriptor._runNotificationSuccessTitle = this._runNotificationSuccessTitle;
409
421
  descriptor._runNotificationSuccessMessage = this._runNotificationSuccessMessage;
410
422
  descriptor._hasRunNotificationError = this._hasRunNotificationError;
411
423
  descriptor._runNotificationErrorTitle = this._runNotificationErrorTitle;
412
424
  descriptor._runNotificationErrorMessage = this._runNotificationErrorMessage;
413
- descriptor._afterRunAction = this._afterRunAction;
414
- descriptor._onRunErrorAction = this._onRunErrorAction;
425
+ if (this._afterRunAction != null) {
426
+ descriptor._afterRunAction = typeof this._afterRunAction === 'function' ? this._afterRunAction : this._afterRunAction.copy();
427
+ }
428
+ if (this._onRunErrorAction != null) {
429
+ descriptor._onRunErrorAction = typeof this._onRunErrorAction === 'function' ? this._afterRunAction : this._onRunErrorAction.copy();
430
+ }
415
431
  descriptor._permissions = this._permissions;
416
432
  descriptor._button = this._button.copy();
417
433
  descriptor._hasItemsSelection = this._hasItemsSelection;
418
434
  descriptor._component = this._component;
435
+ descriptor._componentFromDi = this._componentFromDi;
419
436
  descriptor._subactionsAsMenu = this._subactionsAsMenu;
420
- descriptor._subactions = this._subactions;
437
+ descriptor._subactions = this._subactions.map(a => a.copy());
438
+ return descriptor;
439
+ }
440
+ copy() {
441
+ const descriptor = new ActionDescriptorInst(this._actionName, {
442
+ dataProvider: this._dataProvider,
443
+ model: this._model?.copy(),
444
+ parentModel: this._parentModel,
445
+ parentProperty: this._parentProperty
446
+ });
447
+ this.copyFieldsTo(descriptor);
421
448
  return descriptor;
422
449
  }
423
450
  }
@@ -432,6 +459,16 @@ class ActionDeleteDescriptorInst extends ActionDescriptorInst {
432
459
  this.withTableviewCategory(TableviewActionDefaultCategories.DELETE);
433
460
  this.button.withLabel(null).withIcon('pi pi-trash');
434
461
  }
462
+ copy() {
463
+ if (!this.model) {
464
+ throw new CommonsInternalError(`Model should be defined on action ${this.actionName} of instance ActionDeleteDescriptorInst`);
465
+ }
466
+ const descriptor = new ActionDeleteDescriptorInst(this.model.copy(), {
467
+ dataProvider: this._dataProvider
468
+ });
469
+ this.copyFieldsTo(descriptor);
470
+ return descriptor;
471
+ }
435
472
  }
436
473
 
437
474
  const actionGetProviderCfgObj = (serviceOrDataProvider) => {
@@ -645,6 +682,7 @@ class ActionEditorDescriptorInst extends ActionDescriptorInst {
645
682
  this._dialogSize = StyleSizeEnum.Normal;
646
683
  this._resubmitRefetch = true;
647
684
  this._unsavedChangesConfirmation = false;
685
+ this._isTableviewMainEditor = cfg?.isTableviewMainEditor ?? false;
648
686
  if (cfg?.serviceType) {
649
687
  this._dataProvider = new EditorDataProviderInst(this._model?.type, cfg.serviceType);
650
688
  }
@@ -655,6 +693,9 @@ class ActionEditorDescriptorInst extends ActionDescriptorInst {
655
693
  this._editorDescriptor = editorDescriptor;
656
694
  this._editorActions.push(actionEditorSubmit(this), actionEditorCancel(this));
657
695
  }
696
+ get isTableviewMainEditor() {
697
+ return this._isTableviewMainEditor;
698
+ }
658
699
  get editorTitle() {
659
700
  return this._editorTitle;
660
701
  }
@@ -774,18 +815,50 @@ class ActionEditorDescriptorInst extends ActionDescriptorInst {
774
815
  this._unsavedChangesConfirmation = unsavedChangesConfirmation;
775
816
  return this;
776
817
  }
818
+ copyFieldsTo(descriptor) {
819
+ super.copyFieldsTo(descriptor);
820
+ descriptor._editorActions = this._editorActions.map(a => a.copy());
821
+ descriptor._editorTitle = this._editorTitle;
822
+ descriptor._editorTitleParams = this._editorTitleParams != null ? { ...this._editorTitleParams } : undefined;
823
+ descriptor._hasFetchNotificationSuccess = this._hasFetchNotificationSuccess;
824
+ descriptor._fetchNotificationSuccessTitle = this._fetchNotificationSuccessTitle;
825
+ descriptor._fetchNotificationSuccessMessage = this._fetchNotificationSuccessMessage;
826
+ descriptor._dialogSize = this._dialogSize;
827
+ descriptor._dialogClassName = this._dialogClassName;
828
+ descriptor._fetchFunction = this._fetchFunction;
829
+ descriptor._submitFunction = this._submitFunction;
830
+ descriptor._editorComponent = this._editorComponent;
831
+ descriptor._resubmitEnabled = this._resubmitEnabled;
832
+ descriptor._resubmitRefetch = this._resubmitRefetch;
833
+ descriptor._unsavedChangesConfirmation = this._unsavedChangesConfirmation;
834
+ return descriptor;
835
+ }
836
+ copy() {
837
+ const editor = this._editorDescriptor.copy();
838
+ const descriptor = new ActionEditorDescriptorInst(editor, this._actionName, {
839
+ dataProvider: this._dataProvider,
840
+ model: this._model?.copy(),
841
+ parentModel: this._parentModel,
842
+ parentProperty: this._parentProperty
843
+ });
844
+ this.copyFieldsTo(descriptor);
845
+ return descriptor;
846
+ }
777
847
  }
778
848
  class ActionEditorSubmitDescriptorInst extends ActionDescriptorInst {
779
- constructor(editorAction, submitType = ActionEditorSubmitTypeEnum.Submit) {
780
- super(submitType === ActionEditorSubmitTypeEnum.Submit ? `${editorAction.actionName}.submit` : `${editorAction.actionName}.cancel`, { model: editorAction.model });
781
- this._editorAction = editorAction;
849
+ constructor(editorActionName, editorActionModel, submitType = ActionEditorSubmitTypeEnum.Submit) {
850
+ super(submitType === ActionEditorSubmitTypeEnum.Submit ? `${editorActionName}.submit` : `${editorActionName}.cancel`, { model: editorActionModel });
782
851
  this._submitType = submitType;
783
852
  this._position = ActionPositionEnum.FooterRight;
784
- this.button.styleClass.withActionLevel(editorAction.level).withTextButton();
785
853
  }
786
854
  get submitType() {
787
855
  return this._submitType;
788
856
  }
857
+ copy() {
858
+ const descriptor = new ActionEditorSubmitDescriptorInst(this._actionName.split('.').slice(0, -1).join('.'), this._model?.copy(), this._submitType);
859
+ this.copyFieldsTo(descriptor);
860
+ return descriptor;
861
+ }
789
862
  }
790
863
  /**
791
864
  * creates primary action with primary button style
@@ -793,7 +866,7 @@ class ActionEditorSubmitDescriptorInst extends ActionDescriptorInst {
793
866
  * @param submitType
794
867
  */
795
868
  function actionEditorSubmit(editorAction, submitType = ActionEditorSubmitTypeEnum.Submit) {
796
- return new ActionEditorSubmitDescriptorInst(editorAction, submitType).withButtonDescriptor(new ActionButtonDescriptor().withStyleClass(new ButtonStyleBuilder()));
869
+ return new ActionEditorSubmitDescriptorInst(editorAction.actionName, editorAction.model, submitType).withButtonDescriptor(new ActionButtonDescriptor().withStyleClass(new ButtonStyleBuilder().withActionLevel(editorAction.level)));
797
870
  }
798
871
  /**
799
872
  * creates secondary button with text button style
@@ -801,33 +874,47 @@ function actionEditorSubmit(editorAction, submitType = ActionEditorSubmitTypeEnu
801
874
  * @param submitType
802
875
  */
803
876
  function actionEditorCancel(editorAction, submitType = ActionEditorSubmitTypeEnum.Cancel) {
804
- return new ActionEditorSubmitDescriptorInst(editorAction, submitType).withButtonDescriptor(new ActionButtonDescriptor().withStyleClass(new ButtonStyleBuilder().withTextButton()));
877
+ return new ActionEditorSubmitDescriptorInst(editorAction.actionName, editorAction.model, submitType).withButtonDescriptor(new ActionButtonDescriptor().withStyleClass(new ButtonStyleBuilder().withTextButton().withActionLevel(editorAction.level)));
805
878
  }
806
879
  class ActionEditorDetailsDescriptorInst extends ActionEditorDescriptorInst {
807
880
  static { this.ACTION_NAME = 'details'; }
808
881
  constructor(editorDescriptor, cfg) {
809
- super(editorDescriptor, ActionEditorDetailsDescriptorInst.ACTION_NAME, cfg);
882
+ super(editorDescriptor, ActionEditorDetailsDescriptorInst.ACTION_NAME, { ...cfg, isTableviewMainEditor: true });
810
883
  this.withPosition(ActionPositionEnum.RowClick);
811
884
  this.withRouteTrigger(':itemId');
812
885
  this.withEditorActions([actionEditorCancel(this)]);
813
886
  this.withTableviewCategory(TableviewActionDefaultCategories.DETAILS);
814
887
  }
888
+ copy() {
889
+ const descriptor = new ActionEditorDetailsDescriptorInst(this.editorDescriptor.copy(), {
890
+ dataProvider: this._dataProvider
891
+ });
892
+ this.copyFieldsTo(descriptor);
893
+ return descriptor;
894
+ }
815
895
  }
816
896
  class ActionEditorAddDescriptorInst extends ActionEditorDescriptorInst {
817
897
  static { this.ACTION_NAME = 'add'; }
818
898
  constructor(editorDescriptor, cfg) {
819
- super(editorDescriptor, ActionEditorAddDescriptorInst.ACTION_NAME, cfg);
899
+ super(editorDescriptor, ActionEditorAddDescriptorInst.ACTION_NAME, { ...cfg, isTableviewMainEditor: true });
820
900
  this.withPosition(ActionPositionEnum.ToolbarLeft);
821
901
  this.withRouteTrigger('add');
822
902
  this.button.withIcon('pi pi-plus');
823
903
  this.withTableviewCategory(TableviewActionDefaultCategories.ADD);
824
904
  this.withUnsavedChangesConfirmation();
825
905
  }
906
+ copy() {
907
+ const descriptor = new ActionEditorAddDescriptorInst(this.editorDescriptor.copy(), {
908
+ dataProvider: this._dataProvider
909
+ });
910
+ this.copyFieldsTo(descriptor);
911
+ return descriptor;
912
+ }
826
913
  }
827
914
  class ActionEditorEditDescriptorInst extends ActionEditorDescriptorInst {
828
915
  static { this.ACTION_NAME = 'edit'; }
829
916
  constructor(editorDescriptor, cfg) {
830
- super(editorDescriptor, ActionEditorEditDescriptorInst.ACTION_NAME, cfg);
917
+ super(editorDescriptor, ActionEditorEditDescriptorInst.ACTION_NAME, { ...cfg, isTableviewMainEditor: true });
831
918
  this.withPosition(ActionPositionEnum.RowInline);
832
919
  this.button.styleClass.withSize(StyleSizeEnum.Small);
833
920
  this.withRouteTrigger(':itemId/edit');
@@ -835,6 +922,13 @@ class ActionEditorEditDescriptorInst extends ActionEditorDescriptorInst {
835
922
  this.button.withLabel(null).withIcon('pi pi-pencil');
836
923
  this.withUnsavedChangesConfirmation();
837
924
  }
925
+ copy() {
926
+ const descriptor = new ActionEditorEditDescriptorInst(this.editorDescriptor.copy(), {
927
+ dataProvider: this._dataProvider
928
+ });
929
+ this.copyFieldsTo(descriptor);
930
+ return descriptor;
931
+ }
838
932
  }
839
933
 
840
934
  const actionEditorGetProviderCfgObj = (serviceOrDataProvider) => {
@@ -968,6 +1062,22 @@ class ActionLinkDescriptorInst extends ActionDescriptorInst {
968
1062
  this._isStyleLink = isStyleLink;
969
1063
  return this;
970
1064
  }
1065
+ copy() {
1066
+ const descriptor = new ActionLinkDescriptorInst(this._actionName, {
1067
+ model: this._model?.copy(),
1068
+ parentModel: this._parentModel,
1069
+ parentProperty: this._parentProperty
1070
+ });
1071
+ this.copyFieldsTo(descriptor); // copy base action
1072
+ descriptor._url = this._url;
1073
+ descriptor._pathSegments = [...this._pathSegments];
1074
+ descriptor._queryParams = { ...this._queryParams };
1075
+ descriptor._queryParamsHandling = this._queryParamsHandling;
1076
+ descriptor._replaceUrl = this._replaceUrl;
1077
+ descriptor._target = this._target;
1078
+ descriptor._isStyleLink = this._isStyleLink;
1079
+ return descriptor;
1080
+ }
971
1081
  }
972
1082
 
973
1083
  class ActionLinkDescriptor {
@@ -1003,7 +1113,7 @@ function actionLinkFromClass(type, actionName, cfg) {
1003
1113
  }
1004
1114
  function actionLinkFromAction(action) {
1005
1115
  const descriptor = new ActionLinkDescriptorInst(action.actionName, { model: action.model });
1006
- action.copyTo(descriptor);
1116
+ action.copyFieldsTo(descriptor);
1007
1117
  descriptor.withRunConfirmationDescriptor();
1008
1118
  descriptor.withRunNotificationSuccess(undefined, undefined, false);
1009
1119
  descriptor.withRunNotificationError(undefined, undefined, false);
@@ -1104,7 +1214,7 @@ function getDataProviderService(injector, dataProvider) {
1104
1214
  }
1105
1215
 
1106
1216
  /**
1107
- * States of action. Enums ending with `*Final` are supposed to be final.
1217
+ * States of action. Enums ending with "*Final" are supposed to be final.
1108
1218
  */
1109
1219
  var ActionInstanceStateEnum;
1110
1220
  (function (ActionInstanceStateEnum) {
@@ -2069,6 +2179,7 @@ class FieldManyEditorDescriptor extends AFieldDescriptor {
2069
2179
  this.copyFieldsTo(field);
2070
2180
  field._fieldType = this._fieldType;
2071
2181
  field._fieldActions = this._fieldActions.map(a => a);
2182
+ field._actions = this._actions.map(a => a.copy());
2072
2183
  return field;
2073
2184
  }
2074
2185
  }
@@ -3289,10 +3400,10 @@ class AFormlyCustomFieldComponent extends FieldType {
3289
3400
  get formState() {
3290
3401
  return this._formState;
3291
3402
  }
3292
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: AFormlyCustomFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
3293
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.5", type: AFormlyCustomFieldComponent, inputs: { field: "field", _model: ["model", "_model"], _form: ["form", "_form"], _options: ["options", "_options"], _key: ["key", "_key"], _formControl: ["formControl", "_formControl"], _props: ["props", "_props"], _showError: ["showError", "_showError"], _id: ["id", "_id"], _formState: ["formState", "_formState"] }, usesInheritance: true, ngImport: i0 }); }
3403
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: AFormlyCustomFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
3404
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.12", type: AFormlyCustomFieldComponent, inputs: { field: "field", _model: ["model", "_model"], _form: ["form", "_form"], _options: ["options", "_options"], _key: ["key", "_key"], _formControl: ["formControl", "_formControl"], _props: ["props", "_props"], _showError: ["showError", "_showError"], _id: ["id", "_id"], _formState: ["formState", "_formState"] }, usesInheritance: true, ngImport: i0 }); }
3294
3405
  }
3295
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: AFormlyCustomFieldComponent, decorators: [{
3406
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: AFormlyCustomFieldComponent, decorators: [{
3296
3407
  type: Directive
3297
3408
  }], propDecorators: { field: [{
3298
3409
  type: Input,
@@ -3594,12 +3705,12 @@ class TableviewDescriptorInst {
3594
3705
  this._table.withSortUnsafe(property, isDefault, ascending);
3595
3706
  return this;
3596
3707
  }
3597
- withDefaultSort(property, ascending, order, enabled) {
3598
- this._table.withDefaultSort(property, ascending, order, enabled);
3708
+ withDefaultSort(property, ascending, enabled) {
3709
+ this._table.withDefaultSort(property, ascending, enabled);
3599
3710
  return this;
3600
3711
  }
3601
- withDefaultSortUnsafe(property, ascending, order, enabled) {
3602
- this._table.withDefaultSortUnsafe(property, ascending, order, enabled);
3712
+ withDefaultSortUnsafe(property, ascending, enabled) {
3713
+ this._table.withDefaultSortUnsafe(property, ascending, enabled);
3603
3714
  return this;
3604
3715
  }
3605
3716
  withSorts(...properties) {
@@ -3610,6 +3721,14 @@ class TableviewDescriptorInst {
3610
3721
  this._table.withSortsUnsafe(...properties);
3611
3722
  return this;
3612
3723
  }
3724
+ withDefaultSorts(...properties) {
3725
+ this._table.withDefaultSorts(...properties);
3726
+ return this;
3727
+ }
3728
+ withoutDefaultSorts() {
3729
+ this._table.withoutDefaultSorts();
3730
+ return this;
3731
+ }
3613
3732
  getFilter(property) {
3614
3733
  return this._table.getFilter(property);
3615
3734
  }
@@ -4272,7 +4391,8 @@ function tableviewEditOnDetailsAction(descriptor, editDescriptor, injector) {
4272
4391
  .withTableviewCategory(TableviewActionDefaultCategories.EDIT)
4273
4392
  .withPositionTableviewCategories([TableviewActionDefaultCategories.DETAILS])
4274
4393
  .withPosition(ActionPositionEnum.FooterLeft)
4275
- .withRouterLink('./edit');
4394
+ .withRouterLink('./edit')
4395
+ .withQueryParams({}, 'merge');
4276
4396
  action.button.styleClass.withActionLevel(StyleLevelEnum.Secondary);
4277
4397
  action.button.styleClass.withSize(StyleSizeEnum.Normal);
4278
4398
  action.button.styleClass.withRoundedButton(ButtonStyleRoundedEnum.DEFAULT);
@@ -4668,7 +4788,7 @@ function modifyTableviewLookupUnsafe(descriptor, property, type, lookupProvider,
4668
4788
  const attributeDef = getTableviewClassAttributeDef(descriptor.model.type).find(attr => attr.name === property);
4669
4789
  if (attributeDef != null) {
4670
4790
  type ??= attributeDef.classType ?? TypeRegistry.get().findType(attributeDef.type);
4671
- titleProperty ??= type ? findClassTitleAttribute(type) ?? undefined : undefined;
4791
+ titleProperty ??= type ? (findClassTitleAttribute(type) ?? undefined) : undefined;
4672
4792
  optionsLabelProperty ??= titleProperty;
4673
4793
  attributeDef.columnType = ColumnTypeEnum.String;
4674
4794
  attributeDef.fieldType = FieldInputTypeEnum.Text;