@mediusinc/mng-commons 5.5.0-rc.0 → 5.5.0-rc.2

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 (170) 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/reactivity/effect.d.ts +16 -0
  6. package/esm2022/core/components/notification/notification-wrapper.component.mjs +4 -4
  7. package/esm2022/core/components/pages/error/error.page.component.mjs +4 -4
  8. package/esm2022/core/components/pages/not-found/not-found.page.component.mjs +4 -4
  9. package/esm2022/core/data-list/data-list-params-helpers.mjs +18 -3
  10. package/esm2022/core/descriptors/table.descriptor.mjs +1 -1
  11. package/esm2022/core/directives/component.directive.mjs +4 -4
  12. package/esm2022/core/directives/rerender.directive.mjs +25 -0
  13. package/esm2022/core/directives/template.directive.mjs +4 -4
  14. package/esm2022/core/index.mjs +4 -1
  15. package/esm2022/core/pipes/boolean.pipe.mjs +6 -6
  16. package/esm2022/core/pipes/class-map.pipe.mjs +4 -4
  17. package/esm2022/core/pipes/enum.pipe.mjs +4 -4
  18. package/esm2022/core/pipes/enumerate-async.pipe.mjs +4 -4
  19. package/esm2022/core/pipes/enumerate.pipe.mjs +4 -4
  20. package/esm2022/core/pipes/getter.pipe.mjs +5 -5
  21. package/esm2022/core/pipes/i18n-property.pipe.mjs +4 -4
  22. package/esm2022/core/pipes/json-path.pipe.mjs +4 -4
  23. package/esm2022/core/pipes/parametrize.pipe.mjs +4 -4
  24. package/esm2022/core/pipes/template.pipe.mjs +4 -4
  25. package/esm2022/core/reactivity/effect.mjs +22 -0
  26. package/esm2022/core/security/permission.service.mjs +4 -4
  27. package/esm2022/core/services/commons-init.service.mjs +4 -4
  28. package/esm2022/core/services/commons-router.service.mjs +4 -4
  29. package/esm2022/core/services/commons-storage.service.mjs +4 -4
  30. package/esm2022/core/services/commons.service.mjs +8 -8
  31. package/esm2022/filter/descriptors/filter-lookup.descriptor.mjs +32 -25
  32. package/esm2022/filter/descriptors/filter.descriptor.mjs +53 -1
  33. package/esm2022/form/components/autocomplete/autocomplete.component.mjs +4 -4
  34. package/esm2022/form/components/date-range/date-range.component.mjs +4 -4
  35. package/esm2022/form/components/dropdown/dropdown.component.mjs +4 -4
  36. package/esm2022/form/components/number-range/number-range.component.mjs +4 -4
  37. package/esm2022/form/directives/input-trim.directive.mjs +4 -4
  38. package/esm2022/table/api/descriptors/sort.descriptor.mjs +2 -2
  39. package/esm2022/table/api/descriptors/table.descriptor.mjs +32 -8
  40. package/esm2022/table/components/column-filter/column-filter.component.mjs +33 -40
  41. package/esm2022/table/components/column-value/column-value.component.mjs +6 -6
  42. package/esm2022/table/components/filter/filter-active-tag/filter-active-tag.component.mjs +7 -7
  43. package/esm2022/table/components/filter/filter-form/filter-form.component.mjs +24 -34
  44. package/esm2022/table/components/filter/filter-overlay-with-tag/filter-overlay-with-tag.component.mjs +44 -45
  45. package/esm2022/table/components/table/table.component.mjs +114 -430
  46. package/esm2022/table/helpers/filters.mjs +9 -25
  47. package/esm2022/table/helpers/table.mjs +24 -0
  48. package/esm2022/table/index.mjs +2 -2
  49. package/esm2022/table/models/column-preferences.model.mjs +1 -1
  50. package/esm2022/table/models/filter.model.mjs +1 -1
  51. package/esm2022/table/pipes/filter-value.pipe.mjs +4 -4
  52. package/esm2022/table/pipes/locale-default-row-class.pipe.mjs +4 -4
  53. package/esm2022/table/pipes/table-column-filter-class.pipe.mjs +4 -4
  54. package/esm2022/table/services/table-data.service.mjs +194 -0
  55. package/esm2022/table/services/table-metadata.service.mjs +136 -0
  56. package/esm2022/table/services/table-preferences.service.mjs +142 -0
  57. package/esm2022/tableview/action/components/action/action.component.mjs +6 -7
  58. package/esm2022/tableview/action/components/editor/action-editor.component.mjs +4 -4
  59. package/esm2022/tableview/action/components/editor/injector-context/action-editor-injector-context.component.mjs +69 -46
  60. package/esm2022/tableview/action/components/localization/data-language-dropdown.component.mjs +4 -4
  61. package/esm2022/tableview/action/components/route/action-route.component.mjs +5 -6
  62. package/esm2022/tableview/action/components/table/action-table.component.mjs +4 -4
  63. package/esm2022/tableview/action/helpers/action-execution.mjs +25 -0
  64. package/esm2022/tableview/action/models/execution/action-instance.model.mjs +2 -3
  65. package/esm2022/tableview/action/services/action-executor.service.mjs +12 -79
  66. package/esm2022/tableview/action/services/component-action-executor.service.mjs +4 -4
  67. package/esm2022/tableview/action/services/data-provider-executor.service.mjs +4 -4
  68. package/esm2022/tableview/action/services/navigation.service.mjs +4 -4
  69. package/esm2022/tableview/action/services/root-action-executor.service.mjs +4 -4
  70. package/esm2022/tableview/action/services/view-container.service.mjs +4 -4
  71. package/esm2022/tableview/api/action/descriptors/action-confirmation.descriptor.mjs +13 -1
  72. package/esm2022/tableview/api/action/descriptors/action-editor.descriptor.mjs +67 -10
  73. package/esm2022/tableview/api/action/descriptors/action-link-descriptor.factory.mjs +2 -2
  74. package/esm2022/tableview/api/action/descriptors/action-link.descriptor.mjs +17 -1
  75. package/esm2022/tableview/api/action/descriptors/action.descriptor.mjs +32 -7
  76. package/esm2022/tableview/api/action/models/execution/action-instance-state.model.mjs +2 -2
  77. package/esm2022/tableview/api/editor/descriptors/field-base.descriptor.mjs +20 -1
  78. package/esm2022/tableview/api/editor/descriptors/field-many.descriptor.mjs +2 -1
  79. package/esm2022/tableview/api/editor/models/formly-custom-field.model.mjs +4 -4
  80. package/esm2022/tableview/api/tableview/descriptors/tableview.descriptor.mjs +13 -5
  81. package/esm2022/tableview/api/tableview/helpers/tableview-default-actions.mjs +3 -2
  82. package/esm2022/tableview/api/tableview/helpers/tableview-descriptor-helpers.mjs +2 -2
  83. package/esm2022/tableview/editor/components/editor/auto-save-status/auto-save-status.component.mjs +4 -4
  84. package/esm2022/tableview/editor/components/editor/form-editor.component.mjs +31 -38
  85. package/esm2022/tableview/editor/components/formly/constants.mjs +2 -0
  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 +10 -6
  96. package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +11 -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 +10 -5
  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 +32 -8
  116. package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
  117. package/fesm2022/mediusinc-mng-commons-table.mjs +700 -603
  118. package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -1
  119. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +165 -26
  120. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
  121. package/fesm2022/mediusinc-mng-commons-tableview.mjs +265 -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 +21 -7
  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 +15 -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/constants.d.ts +1 -0
  160. package/tableview/editor/components/formly/fields/formly-field-fieldset/formly-field-fieldset.component.d.ts +1 -1
  161. package/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +1 -0
  162. package/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +1 -0
  163. package/tableview/editor/components/formly/fields/formly-field-type.abstract.component.d.ts +2 -1
  164. package/tableview/editor/components/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.d.ts +1 -0
  165. package/tableview/index.d.ts +0 -1
  166. package/version-info.json +5 -5
  167. package/esm2022/table/services/data-list.service.mjs +0 -29
  168. package/esm2022/tableview/action/models/execution/action-instance-state.model.mjs +0 -32
  169. package/table/services/data-list.service.d.ts +0 -19
  170. 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) {
@@ -1340,6 +1450,12 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
1340
1450
  get helpText() {
1341
1451
  return this._helpText;
1342
1452
  }
1453
+ get labelInfoTooltip() {
1454
+ return this._labelInfoTooltip;
1455
+ }
1456
+ get labelInfoTooltipIcon() {
1457
+ return this._labelInfoTooltipIcon;
1458
+ }
1343
1459
  get required() {
1344
1460
  return this._required;
1345
1461
  }
@@ -1433,6 +1549,17 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
1433
1549
  this._helpText = helpText;
1434
1550
  return this;
1435
1551
  }
1552
+ /**
1553
+ * Sets the label tooltip and optionally a custom icon for the field.
1554
+ *
1555
+ * @param {string} tooltip - The tooltip text to be displayed.
1556
+ * @param {string} [customIcon] - An optional custom icon to be used for the tooltip. If not provided, the default icon is used.
1557
+ */
1558
+ withLabelInfoTooltip(tooltip, customIcon) {
1559
+ this._labelInfoTooltip = tooltip;
1560
+ this._labelInfoTooltipIcon = customIcon ?? this._labelInfoTooltipIcon;
1561
+ return this;
1562
+ }
1436
1563
  withRequired(required = true, requiredExpression, hideLabelMarker = false) {
1437
1564
  this._required = required;
1438
1565
  if (requiredExpression) {
@@ -1545,6 +1672,8 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
1545
1672
  copyFieldsTo(obj) {
1546
1673
  obj._label = this._label;
1547
1674
  obj._placeholder = this._placeholder;
1675
+ obj._labelInfoTooltip = this._labelInfoTooltip;
1676
+ obj._labelInfoTooltipIcon = this._labelInfoTooltipIcon;
1548
1677
  obj._helpText = this._helpText;
1549
1678
  obj._required = this._required;
1550
1679
  obj._disabled = this._disabled;
@@ -2069,6 +2198,7 @@ class FieldManyEditorDescriptor extends AFieldDescriptor {
2069
2198
  this.copyFieldsTo(field);
2070
2199
  field._fieldType = this._fieldType;
2071
2200
  field._fieldActions = this._fieldActions.map(a => a);
2201
+ field._actions = this._actions.map(a => a.copy());
2072
2202
  return field;
2073
2203
  }
2074
2204
  }
@@ -3289,10 +3419,10 @@ class AFormlyCustomFieldComponent extends FieldType {
3289
3419
  get formState() {
3290
3420
  return this._formState;
3291
3421
  }
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 }); }
3422
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: AFormlyCustomFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
3423
+ 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
3424
  }
3295
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: AFormlyCustomFieldComponent, decorators: [{
3425
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: AFormlyCustomFieldComponent, decorators: [{
3296
3426
  type: Directive
3297
3427
  }], propDecorators: { field: [{
3298
3428
  type: Input,
@@ -3594,12 +3724,12 @@ class TableviewDescriptorInst {
3594
3724
  this._table.withSortUnsafe(property, isDefault, ascending);
3595
3725
  return this;
3596
3726
  }
3597
- withDefaultSort(property, ascending, order, enabled) {
3598
- this._table.withDefaultSort(property, ascending, order, enabled);
3727
+ withDefaultSort(property, ascending, enabled) {
3728
+ this._table.withDefaultSort(property, ascending, enabled);
3599
3729
  return this;
3600
3730
  }
3601
- withDefaultSortUnsafe(property, ascending, order, enabled) {
3602
- this._table.withDefaultSortUnsafe(property, ascending, order, enabled);
3731
+ withDefaultSortUnsafe(property, ascending, enabled) {
3732
+ this._table.withDefaultSortUnsafe(property, ascending, enabled);
3603
3733
  return this;
3604
3734
  }
3605
3735
  withSorts(...properties) {
@@ -3610,6 +3740,14 @@ class TableviewDescriptorInst {
3610
3740
  this._table.withSortsUnsafe(...properties);
3611
3741
  return this;
3612
3742
  }
3743
+ withDefaultSorts(...properties) {
3744
+ this._table.withDefaultSorts(...properties);
3745
+ return this;
3746
+ }
3747
+ withoutDefaultSorts() {
3748
+ this._table.withoutDefaultSorts();
3749
+ return this;
3750
+ }
3613
3751
  getFilter(property) {
3614
3752
  return this._table.getFilter(property);
3615
3753
  }
@@ -4272,7 +4410,8 @@ function tableviewEditOnDetailsAction(descriptor, editDescriptor, injector) {
4272
4410
  .withTableviewCategory(TableviewActionDefaultCategories.EDIT)
4273
4411
  .withPositionTableviewCategories([TableviewActionDefaultCategories.DETAILS])
4274
4412
  .withPosition(ActionPositionEnum.FooterLeft)
4275
- .withRouterLink('./edit');
4413
+ .withRouterLink('./edit')
4414
+ .withQueryParams({}, 'merge');
4276
4415
  action.button.styleClass.withActionLevel(StyleLevelEnum.Secondary);
4277
4416
  action.button.styleClass.withSize(StyleSizeEnum.Normal);
4278
4417
  action.button.styleClass.withRoundedButton(ButtonStyleRoundedEnum.DEFAULT);
@@ -4668,7 +4807,7 @@ function modifyTableviewLookupUnsafe(descriptor, property, type, lookupProvider,
4668
4807
  const attributeDef = getTableviewClassAttributeDef(descriptor.model.type).find(attr => attr.name === property);
4669
4808
  if (attributeDef != null) {
4670
4809
  type ??= attributeDef.classType ?? TypeRegistry.get().findType(attributeDef.type);
4671
- titleProperty ??= type ? findClassTitleAttribute(type) ?? undefined : undefined;
4810
+ titleProperty ??= type ? (findClassTitleAttribute(type) ?? undefined) : undefined;
4672
4811
  optionsLabelProperty ??= titleProperty;
4673
4812
  attributeDef.columnType = ColumnTypeEnum.String;
4674
4813
  attributeDef.fieldType = FieldInputTypeEnum.Text;