@mediusinc/mng-commons 0.2.17 → 0.2.20

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 (96) hide show
  1. package/assets/i18n/en.json +7 -5
  2. package/assets/i18n/sl.json +23 -21
  3. package/esm2020/lib/api/services/crud-api.abstract.service.mjs +22 -17
  4. package/esm2020/lib/components/action/action.component.mjs +50 -23
  5. package/esm2020/lib/components/action/editor/action-editor.component.mjs +239 -0
  6. package/esm2020/lib/components/action/index.mjs +2 -2
  7. package/esm2020/lib/components/action/models/action-execution.model.mjs +3 -3
  8. package/esm2020/lib/components/action/route/action-route.component.mjs +19 -38
  9. package/esm2020/lib/components/form/autocomplete/autocomplete.component.mjs +9 -6
  10. package/esm2020/lib/components/form/editor/form-editor.component.mjs +56 -4
  11. package/esm2020/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +3 -3
  12. package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +3 -3
  13. package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
  14. package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +179 -0
  15. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +28 -9
  16. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +12 -9
  17. package/esm2020/lib/components/form/formly/fields/index.mjs +2 -1
  18. package/esm2020/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +3 -3
  19. package/esm2020/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.mjs +4 -3
  20. package/esm2020/lib/components/form/models/form-editor.event.mjs +28 -1
  21. package/esm2020/lib/components/layout/main-layout.component.mjs +1 -1
  22. package/esm2020/lib/components/layout/topbar.component.mjs +1 -1
  23. package/esm2020/lib/components/tableview/table/table.component.mjs +37 -12
  24. package/esm2020/lib/components/tableview/tableview.component.mjs +28 -21
  25. package/esm2020/lib/config/formly.config.mjs +7 -2
  26. package/esm2020/lib/config/models/mng-config.model.mjs +1 -1
  27. package/esm2020/lib/data-providers/table.data-provider.mjs +17 -2
  28. package/esm2020/lib/descriptors/action.descriptor.mjs +146 -2
  29. package/esm2020/lib/descriptors/editor.descriptor.interface.mjs +2 -0
  30. package/esm2020/lib/descriptors/editor.descriptor.mjs +122 -27
  31. package/esm2020/lib/directives/component.directive.mjs +8 -3
  32. package/esm2020/lib/mng-commons.module.mjs +21 -11
  33. package/esm2020/lib/models/error.model.mjs +2 -0
  34. package/esm2020/lib/models/index.mjs +3 -1
  35. package/esm2020/lib/models/view-container.model.mjs +2 -0
  36. package/esm2020/lib/services/action-executor.service.mjs +343 -0
  37. package/esm2020/lib/services/error-mapper.service.mjs +14 -0
  38. package/esm2020/lib/services/index.mjs +4 -2
  39. package/esm2020/lib/services/tokens/default-setting.token.mjs +3 -0
  40. package/esm2020/lib/services/tokens/index.mjs +2 -1
  41. package/esm2020/lib/services/view-container.component.service.mjs +35 -0
  42. package/esm2020/lib/utils/editor-formly.util.mjs +14 -3
  43. package/esm2020/lib/utils/i18n.util.mjs +29 -1
  44. package/esm2020/lib/utils/toast.util.mjs +18 -14
  45. package/esm2020/public-api.mjs +1 -2
  46. package/fesm2015/mediusinc-mng-commons.mjs +1818 -994
  47. package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
  48. package/fesm2020/mediusinc-mng-commons.mjs +1805 -998
  49. package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
  50. package/lib/api/services/crud-api.abstract.service.d.ts +9 -8
  51. package/lib/components/action/action.component.d.ts +16 -9
  52. package/lib/components/action/editor/action-editor.component.d.ts +59 -0
  53. package/lib/components/action/index.d.ts +1 -1
  54. package/lib/components/action/models/action-execution.model.d.ts +3 -3
  55. package/lib/components/action/route/action-route.component.d.ts +5 -6
  56. package/lib/components/form/editor/form-editor.component.d.ts +7 -2
  57. package/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +45 -0
  58. package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +2 -0
  59. package/lib/components/form/formly/fields/index.d.ts +1 -0
  60. package/lib/components/form/models/form-editor.event.d.ts +32 -0
  61. package/lib/components/tableview/table/table.component.d.ts +14 -6
  62. package/lib/components/tableview/tableview.component.d.ts +9 -7
  63. package/lib/data-providers/table.data-provider.d.ts +9 -1
  64. package/lib/descriptors/action.descriptor.d.ts +71 -16
  65. package/lib/descriptors/editor.descriptor.d.ts +59 -18
  66. package/lib/descriptors/editor.descriptor.interface.d.ts +9 -0
  67. package/lib/directives/component.directive.d.ts +5 -4
  68. package/lib/mng-commons.module.d.ts +55 -54
  69. package/lib/models/error.model.d.ts +12 -0
  70. package/lib/models/index.d.ts +2 -0
  71. package/lib/models/view-container.model.d.ts +6 -0
  72. package/lib/services/{action.service.d.ts → action-executor.service.d.ts} +25 -18
  73. package/lib/services/error-mapper.service.d.ts +7 -0
  74. package/lib/services/index.d.ts +3 -1
  75. package/lib/services/tokens/default-setting.token.d.ts +2 -0
  76. package/lib/services/tokens/index.d.ts +1 -0
  77. package/lib/services/view-container.component.service.d.ts +22 -0
  78. package/lib/utils/i18n.util.d.ts +3 -0
  79. package/lib/utils/toast.util.d.ts +5 -4
  80. package/package.json +1 -1
  81. package/public-api.d.ts +0 -1
  82. package/scss/mng-overrides/_layout_forms.scss +2 -0
  83. package/scss/mng-overrides/_mixins.scss +7 -0
  84. package/scss/mng-overrides/_theme_button.scss +57 -0
  85. package/scss/mng-overrides/_theme_dropdown.scss +17 -0
  86. package/scss/mng-overrides/_theme_styles.scss +2 -0
  87. package/scss/mng-overrides/_theme_toolbar.scss +5 -0
  88. package/scss/theme/default/_mng-variables-theme-dark.scss +3 -0
  89. package/scss/theme/default/_mng-variables-theme-light.scss +3 -0
  90. package/esm2020/lib/components/action/dialog/action-dialog.component.mjs +0 -151
  91. package/esm2020/lib/components/tableview/services/index.mjs +0 -2
  92. package/esm2020/lib/components/tableview/services/tableview.component.service.mjs +0 -21
  93. package/esm2020/lib/services/action.service.mjs +0 -273
  94. package/lib/components/action/dialog/action-dialog.component.d.ts +0 -47
  95. package/lib/components/tableview/services/index.d.ts +0 -1
  96. package/lib/components/tableview/services/tableview.component.service.d.ts +0 -14
@@ -1,473 +1,145 @@
1
- import * as i4$1 from '@angular/common';
1
+ import * as i4 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
- import { HttpClient, HttpClientModule } from '@angular/common/http';
3
+ import { HttpErrorResponse, HttpClient, HttpClientModule } from '@angular/common/http';
4
4
  import * as i0 from '@angular/core';
5
- import { Injectable, InjectionToken, Inject, Component, ChangeDetectionStrategy, Input, Directive, EventEmitter, Output, ContentChildren, ViewChild, forwardRef, Pipe, Optional, ViewChildren, HostListener, APP_INITIALIZER, NgModule } from '@angular/core';
6
- import * as i2$3 from '@angular/forms';
7
- import { Validators, FormGroup, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
5
+ import { InjectionToken, Injectable, Inject, EventEmitter, Component, ChangeDetectionStrategy, Optional, Input, Output, Directive, ContentChildren, ViewChild, forwardRef, Pipe, ViewChildren, HostListener, APP_INITIALIZER, NgModule } from '@angular/core';
6
+ import * as i4$2 from '@angular/forms';
7
+ import { Validators, FormGroup, FormArray, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
8
8
  import * as i1 from '@angular/router';
9
9
  import { NavigationEnd, GuardsCheckEnd, RouterModule } from '@angular/router';
10
- import * as i3 from '@ngx-formly/core';
10
+ import * as i3$2 from '@ngx-formly/core';
11
11
  import { FieldType, FieldWrapper, FORMLY_CONFIG, FormlyModule } from '@ngx-formly/core';
12
- import * as i2$2 from '@ngx-translate/core';
12
+ import * as i3$1 from '@ngx-translate/core';
13
13
  import { TranslateService, TranslateModule } from '@ngx-translate/core';
14
- import * as i2$1 from 'primeng/api';
15
- import { MessageService, ConfirmationService, FilterMatchMode } from 'primeng/api';
14
+ import * as i2 from 'primeng/api';
15
+ import { ConfirmationService, MessageService, FilterMatchMode } from 'primeng/api';
16
16
  import * as i1$1 from 'primeng/autocomplete';
17
17
  import { AutoComplete, AutoCompleteModule } from 'primeng/autocomplete';
18
- import * as i2$7 from 'primeng/breadcrumb';
18
+ import * as i2$3 from 'primeng/breadcrumb';
19
19
  import { BreadcrumbModule } from 'primeng/breadcrumb';
20
- import * as i8 from 'primeng/button';
20
+ import * as i7 from 'primeng/button';
21
21
  import { ButtonModule } from 'primeng/button';
22
- import * as i5 from 'primeng/calendar';
22
+ import * as i5$1 from 'primeng/calendar';
23
23
  import { CalendarModule } from 'primeng/calendar';
24
24
  import { CardModule } from 'primeng/card';
25
25
  import { CheckboxModule } from 'primeng/checkbox';
26
26
  import { ChipModule } from 'primeng/chip';
27
- import * as i6 from 'primeng/confirmdialog';
27
+ import * as i5 from 'primeng/confirmdialog';
28
28
  import { ConfirmDialogModule } from 'primeng/confirmdialog';
29
29
  import { ConfirmPopupModule } from 'primeng/confirmpopup';
30
- import * as i2$6 from 'primeng/dialog';
30
+ import * as i1$4 from 'primeng/dialog';
31
31
  import { DialogModule } from 'primeng/dialog';
32
32
  import * as i1$2 from 'primeng/dropdown';
33
33
  import { Dropdown, DropdownModule } from 'primeng/dropdown';
34
- import * as i2 from 'primeng/dynamicdialog';
34
+ import * as i3 from 'primeng/dynamicdialog';
35
35
  import { DynamicDialogModule, DialogService } from 'primeng/dynamicdialog';
36
- import * as i1$5 from 'primeng/fieldset';
36
+ import * as i1$6 from 'primeng/fieldset';
37
37
  import { FieldsetModule } from 'primeng/fieldset';
38
38
  import { FileUploadModule } from 'primeng/fileupload';
39
39
  import * as i6$1 from 'primeng/inputmask';
40
40
  import { InputMaskModule } from 'primeng/inputmask';
41
41
  import * as i1$3 from 'primeng/inputnumber';
42
42
  import { InputNumberModule } from 'primeng/inputnumber';
43
- import * as i2$5 from 'primeng/inputswitch';
43
+ import * as i2$2 from 'primeng/inputswitch';
44
44
  import { InputSwitchModule } from 'primeng/inputswitch';
45
- import * as i10$1 from 'primeng/inputtext';
45
+ import * as i10 from 'primeng/inputtext';
46
46
  import { InputTextModule } from 'primeng/inputtext';
47
47
  import * as i9$1 from 'primeng/inputtextarea';
48
48
  import { InputTextareaModule } from 'primeng/inputtextarea';
49
- import * as i3$1 from 'primeng/messages';
49
+ import * as i3$3 from 'primeng/messages';
50
50
  import { MessagesModule } from 'primeng/messages';
51
- import * as i2$4 from 'primeng/multiselect';
51
+ import * as i2$1 from 'primeng/multiselect';
52
52
  import { MultiSelectModule } from 'primeng/multiselect';
53
53
  import { PaginatorModule } from 'primeng/paginator';
54
- import * as i4$2 from 'primeng/progressspinner';
54
+ import * as i6 from 'primeng/progressspinner';
55
55
  import { ProgressSpinnerModule } from 'primeng/progressspinner';
56
- import * as i4$3 from 'primeng/radiobutton';
56
+ import * as i4$4 from 'primeng/radiobutton';
57
57
  import { RadioButtonModule } from 'primeng/radiobutton';
58
- import * as i9 from 'primeng/ripple';
58
+ import * as i8 from 'primeng/ripple';
59
59
  import { RippleModule } from 'primeng/ripple';
60
60
  import { SelectButtonModule } from 'primeng/selectbutton';
61
- import * as i7 from 'primeng/skeleton';
61
+ import * as i7$1 from 'primeng/skeleton';
62
62
  import { SkeletonModule } from 'primeng/skeleton';
63
- import * as i4$4 from 'primeng/table';
63
+ import * as i4$5 from 'primeng/table';
64
64
  import { Table, TableModule } from 'primeng/table';
65
- import * as i1$4 from 'primeng/tabview';
65
+ import * as i1$5 from 'primeng/tabview';
66
66
  import { TabViewModule } from 'primeng/tabview';
67
67
  import { TagModule } from 'primeng/tag';
68
- import * as i7$1 from 'primeng/toast';
68
+ import * as i6$2 from 'primeng/toast';
69
69
  import { ToastModule } from 'primeng/toast';
70
70
  import { ToggleButtonModule } from 'primeng/togglebutton';
71
- import * as i8$1 from 'primeng/toolbar';
71
+ import * as i4$3 from 'primeng/toolbar';
72
72
  import { ToolbarModule } from 'primeng/toolbar';
73
- import * as i10 from 'primeng/tooltip';
73
+ import * as i9 from 'primeng/tooltip';
74
74
  import { TooltipModule } from 'primeng/tooltip';
75
- import { of, throwError, Observable, from, BehaviorSubject, Subject, ReplaySubject, distinctUntilChanged, combineLatest } from 'rxjs';
75
+ import { throwError, of, Subject, Observable, from, BehaviorSubject, ReplaySubject, distinctUntilChanged, combineLatest } from 'rxjs';
76
76
  import 'reflect-metadata';
77
77
  import { mergeMap, map, first, catchError, filter, finalize, startWith } from 'rxjs/operators';
78
- import * as i4 from '@angular/platform-browser';
78
+ import * as i4$1 from '@angular/platform-browser';
79
79
  import { trigger, state, style, transition, animate } from '@angular/animations';
80
80
 
81
- class ActionDescriptor {
82
- constructor(model, actionName, parentType, parentProperty) {
83
- this._type = ActionTypeEnum.Direct;
84
- this._activationTrigger = ActionActivationTriggerEnum.OnClick;
85
- this._position = ActionPositionEnum.ToolbarRight;
86
- this._level = ActionLevelEnum.Default;
87
- this._routeUrl = null;
88
- this._className = '';
89
- this._hasRunConfirmation = false;
90
- this._hasRunNotificationSuccess = true;
91
- this._hasRunNotificationError = true;
92
- this._model = model;
93
- this._actionName = actionName;
94
- if ((parentType && !parentProperty) || (!parentProperty && parentProperty)) {
95
- throw new Error(`Provide both the parent type and parent property or none: ${parentType}, ${parentProperty}.`);
96
- }
97
- this._parentType = parentType;
98
- this._parentTypeName = parentType ? TypeUtil.findTypeName(parentType) : undefined;
99
- this._parentProperty = parentProperty;
100
- this._i18nModelActionBaseKey = this._parentTypeName
101
- ? `${this._parentTypeName}.actions.${this._parentProperty}_${actionName}`
102
- : `${this._model.typeName}.actions.${actionName}`;
103
- }
104
- get model() {
105
- return this._model;
106
- }
107
- get parentTypeName() {
108
- return this._parentTypeName;
109
- }
110
- get parentProperty() {
111
- return this._parentProperty;
112
- }
113
- get i18nModelActionBaseKey() {
114
- return this._i18nModelActionBaseKey;
115
- }
116
- get type() {
117
- return this._type;
118
- }
119
- get activationTrigger() {
120
- return this._activationTrigger;
121
- }
122
- get position() {
123
- return this._position;
124
- }
125
- get level() {
126
- return this._level;
127
- }
128
- get routeUrl() {
129
- return this._routeUrl;
130
- }
131
- get title() {
132
- return this._title;
133
- }
134
- get icon() {
135
- return this._icon;
136
- }
137
- get tooltip() {
138
- return this._tooltip;
139
- }
140
- get runFunction() {
141
- if (!this._runFunction) {
142
- throw new Error('Run function is not defined and cannot be invoked');
143
- }
144
- return this._runFunction;
145
- }
146
- get isVisibleFunction() {
147
- return this._isVisibleFunction;
148
- }
149
- get isEnabledFunction() {
150
- return this._isEnabledFunction;
151
- }
152
- get actionName() {
153
- return this._actionName;
154
- }
155
- get className() {
156
- return this._className;
157
- }
158
- get hasRunConfirmation() {
159
- return this._hasRunConfirmation;
160
- }
161
- get runConfirmationIcon() {
162
- return this._runConfirmationIcon;
163
- }
164
- get runConfirmationTitle() {
165
- return this._runConfirmationTitle;
166
- }
167
- get runConfirmationMessage() {
168
- return this._runConfirmationMessage;
169
- }
170
- get runConfirmationAcceptTitle() {
171
- return this._runConfirmationAcceptTitle;
172
- }
173
- get runConfirmationRejectTitle() {
174
- return this._runConfirmationRejectTitle;
175
- }
176
- get hasRunNotificationSuccess() {
177
- return this._hasRunNotificationSuccess;
178
- }
179
- get runNotificationSuccessTitle() {
180
- return this._runNotificationSuccessTitle;
181
- }
182
- get runNotificationSuccessMessage() {
183
- return this._runNotificationSuccessMessage;
184
- }
185
- get hasRunNotificationError() {
186
- return this._hasRunNotificationError;
187
- }
188
- get runNotificationErrorTitle() {
189
- return this._runNotificationErrorTitle;
190
- }
191
- get runNotificationErrorMessage() {
192
- return this._runNotificationErrorMessage;
81
+ class DataProvider {
82
+ constructor(modelType, serviceType) {
83
+ this._modelType = modelType;
84
+ this._serviceType = serviceType;
193
85
  }
194
- withRunFunction(fn) {
195
- this._runFunction = fn;
196
- return this;
86
+ get serviceType() {
87
+ return this._serviceType;
197
88
  }
198
- withIsVisibleFunction(fn) {
199
- this._isVisibleFunction = fn;
200
- return this;
89
+ get modelType() {
90
+ return this._modelType;
201
91
  }
202
- withIsEnabledFunction(fn) {
203
- this._isEnabledFunction = fn;
92
+ withServiceType(type) {
93
+ this._serviceType = type;
204
94
  return this;
205
95
  }
206
- withRouteTrigger(routeUrl) {
207
- this._activationTrigger = ActionActivationTriggerEnum.OnRoute;
208
- this._routeUrl = routeUrl;
209
- return this;
96
+ }
97
+
98
+ class EditorDataProvider extends DataProvider {
99
+ constructor(modelType, serviceType) {
100
+ super(modelType, serviceType);
101
+ this._fetch = id => throwError(`No fetch function provided for id ${id}.`);
210
102
  }
211
- withLevel(level) {
212
- this._level = level;
213
- return this;
103
+ get fetch() {
104
+ return this._fetch;
214
105
  }
215
- /**
216
- * Overrides default title key with model action key (${model.typeName}.actions.${actionName}). Not relevant if parentType name is provided.
217
- */
218
- withModelTitle() {
219
- this._title = `${this._i18nModelActionBaseKey}.title`;
220
- return this;
106
+ get create() {
107
+ return this._create;
221
108
  }
222
- /**
223
- * Overrides default title key (${actionName}.title). If null, no title will be shown.
224
- * @param title Title i18n key or title.
225
- */
226
- withTitle(title) {
227
- this._title = title;
228
- return this;
109
+ get update() {
110
+ return this._update;
229
111
  }
230
- withIcon(icon) {
231
- this._icon = icon;
232
- return this;
112
+ get delete() {
113
+ return this._delete;
233
114
  }
234
- withTooltip(tooltip) {
235
- this._title = tooltip;
115
+ withFetch(fetch) {
116
+ this._fetch = fetch;
236
117
  return this;
237
118
  }
238
- withClassName(className) {
239
- this._className = className;
119
+ withCreate(create) {
120
+ this._create = create;
240
121
  return this;
241
122
  }
242
- withPosition(position) {
243
- this._position = position;
123
+ withUpdate(update) {
124
+ this._update = update;
244
125
  return this;
245
126
  }
246
- withRunConfirmation(icon = 'pi pi-exclamation-triangle', title, message, acceptTitle, rejectTitle) {
247
- this._hasRunConfirmation = true;
248
- this._runConfirmationIcon = icon;
249
- this._runConfirmationTitle = title;
250
- this._runConfirmationMessage = message;
251
- this._runConfirmationAcceptTitle = acceptTitle;
252
- this._runConfirmationRejectTitle = rejectTitle;
127
+ withDelete(deleteFn) {
128
+ this._delete = deleteFn;
253
129
  return this;
254
130
  }
255
- withRunNotificationSuccess(title, message, hasNotification = true) {
256
- this._hasRunNotificationSuccess = hasNotification;
257
- this._runNotificationSuccessTitle = title;
258
- this._runNotificationSuccessMessage = message;
259
- }
260
- withRunNotificationError(title, message, hasNotification = true) {
261
- this._hasRunNotificationError = hasNotification;
262
- this._runNotificationErrorTitle = title;
263
- this._runNotificationErrorMessage = message;
264
- }
265
131
  }
266
- class ActionEditorDescriptor extends ActionDescriptor {
267
- constructor(editorDescriptor, actionName, parentType, parentProperty) {
268
- super(editorDescriptor.model, actionName, parentType, parentProperty);
269
- this._editorTitle = undefined;
270
- this._hasFetchNotificationSuccess = false;
271
- this._type = ActionTypeEnum.Editor;
272
- this._editorDescriptor = editorDescriptor;
273
- }
274
- get editorTitle() {
275
- return this._editorTitle;
276
- }
277
- get editorDescriptor() {
278
- return this._editorDescriptor;
279
- }
280
- get hasFetchNotificationSuccess() {
281
- return this._hasFetchNotificationSuccess;
282
- }
283
- get fetchNotificationSuccessTitle() {
284
- return this._fetchNotificationSuccessTitle;
285
- }
286
- get fetchNotificationSuccessMessage() {
287
- return this._fetchNotificationSuccessMessage;
288
- }
289
- get runFunction() {
290
- throw new Error('Run function cannot be used in editor action. Use submit function instead!');
291
- }
292
- get fetchFunction() {
293
- if (!this._fetchFunction) {
294
- return ctx => {
295
- console.warn(`Fetch function is not provided for function ${this._actionName}, using default and returning context item`, ctx.data?.item);
296
- return of(ctx.data?.item ? ctx.data.item : {});
297
- };
298
- }
299
- return this._fetchFunction;
300
- }
301
- get submitFunction() {
302
- return this._submitFunction;
303
- }
304
- withEditorTitle(title) {
305
- this._editorTitle = title;
306
- return this;
307
- }
308
- withRunFunction(fn) {
309
- return this.withSubmitFunction(fn);
132
+
133
+ class LookupDataProvider extends DataProvider {
134
+ constructor(modelType, serviceType) {
135
+ super(modelType, serviceType);
136
+ this._lookup = () => of([]);
310
137
  }
311
- withFetchFunction(fn) {
312
- this._fetchFunction = fn;
313
- return this;
138
+ get lookup() {
139
+ return this._lookup;
314
140
  }
315
- withSubmitFunction(fn) {
316
- this._submitFunction = fn;
317
- return this;
318
- }
319
- withFetchNotificationError(title, message, hasNotification = true) {
320
- this._hasFetchNotificationSuccess = hasNotification;
321
- this._fetchNotificationSuccessTitle = title;
322
- this._fetchNotificationSuccessMessage = message;
323
- }
324
- }
325
- class ActionEditorDetailsDescriptor extends ActionEditorDescriptor {
326
- constructor(editorDescriptor) {
327
- super(editorDescriptor, 'details');
328
- this.withPosition(ActionPositionEnum.RowClick);
329
- this.withRouteTrigger(':itemId');
330
- this.withFetchFunction(ctx => ctx.dataProvider?.fetch && ctx.data?.itemId
331
- ? ctx.dataProvider.fetch(ctx.data?.itemId, ctx.serviceInstance)
332
- : throwError(new Error(`Data provider fetch function or item id ${ctx.data?.itemId} is missing.`)));
333
- this.withClassName('mng-details-dynamic-dialog');
334
- }
335
- }
336
- class ActionEditorAddDescriptor extends ActionEditorDescriptor {
337
- constructor(editorDescriptor) {
338
- super(editorDescriptor, 'add');
339
- this.withPosition(ActionPositionEnum.ToolbarLeft);
340
- this.withRouteTrigger('add');
341
- this.withSubmitFunction(ctx => ctx.dataProvider?.create ? ctx.dataProvider.create(ctx.data?.item, ctx.serviceInstance) : throwError(new Error(`Data provider create function is missing.`)));
342
- this.withLevel(ActionLevelEnum.Success);
343
- this.withIcon('pi pi-plus');
344
- this.withClassName('mng-details-dynamic-dialog');
345
- }
346
- }
347
- class ActionEditorEditDescriptor extends ActionEditorDescriptor {
348
- constructor(editorDescriptor) {
349
- super(editorDescriptor, 'edit');
350
- this.withPosition(ActionPositionEnum.RowInline);
351
- this.withTitle(null);
352
- this.withRouteTrigger(':itemId/edit');
353
- this.withFetchFunction(ctx => ctx.dataProvider?.fetch && ctx.data?.itemId
354
- ? ctx.dataProvider.fetch(ctx.data.itemId, ctx.serviceInstance)
355
- : throwError(new Error(`Data provider fetch function or item id ${ctx.data?.itemId} is missing.`)));
356
- this.withSubmitFunction(ctx => ctx.dataProvider?.update && ctx.data?.itemId
357
- ? ctx.dataProvider.update(ctx.data.itemId, ctx.data?.item, ctx.serviceInstance)
358
- : throwError(new Error(`Data provider update function or item id ${ctx.data?.itemId} is missing.`)));
359
- this.withIcon('pi pi-pencil');
360
- this.withClassName('mng-details-dynamic-dialog');
361
- }
362
- }
363
- class ActionDeleteDescriptor extends ActionDescriptor {
364
- constructor(model) {
365
- super(model, 'delete');
366
- this.withPosition(ActionPositionEnum.RowInline);
367
- this.withTitle(null);
368
- this.withRunFunction(ctx => {
369
- const editorDataProvider = ctx.dataProvider;
370
- return editorDataProvider?.delete && ctx.data?.itemId
371
- ? editorDataProvider.delete(ctx.data.itemId, ctx.data.item, ctx.serviceInstance)
372
- : throwError(new Error(`Data provider delete function or item id ${ctx.data?.itemId} is missing.`));
373
- });
374
- this.withLevel(ActionLevelEnum.Danger);
375
- this.withIcon('pi pi-trash');
376
- this.withRunConfirmation(undefined);
377
- }
378
- }
379
- var ActionPositionEnum;
380
- (function (ActionPositionEnum) {
381
- ActionPositionEnum[ActionPositionEnum["ToolbarLeft"] = 0] = "ToolbarLeft";
382
- ActionPositionEnum[ActionPositionEnum["ToolbarRight"] = 1] = "ToolbarRight";
383
- ActionPositionEnum[ActionPositionEnum["TableHeader"] = 2] = "TableHeader";
384
- ActionPositionEnum[ActionPositionEnum["RowInline"] = 3] = "RowInline";
385
- ActionPositionEnum[ActionPositionEnum["RowClick"] = 4] = "RowClick";
386
- })(ActionPositionEnum || (ActionPositionEnum = {}));
387
- var ActionActivationTriggerEnum;
388
- (function (ActionActivationTriggerEnum) {
389
- ActionActivationTriggerEnum[ActionActivationTriggerEnum["OnClick"] = 0] = "OnClick";
390
- ActionActivationTriggerEnum[ActionActivationTriggerEnum["OnRoute"] = 1] = "OnRoute"; // action is triggered for activation by route url
391
- })(ActionActivationTriggerEnum || (ActionActivationTriggerEnum = {}));
392
- var ActionTypeEnum;
393
- (function (ActionTypeEnum) {
394
- ActionTypeEnum[ActionTypeEnum["Direct"] = 0] = "Direct";
395
- ActionTypeEnum[ActionTypeEnum["Editor"] = 1] = "Editor"; // editor providing middle step for activation
396
- })(ActionTypeEnum || (ActionTypeEnum = {}));
397
- var ActionLevelEnum;
398
- (function (ActionLevelEnum) {
399
- ActionLevelEnum[ActionLevelEnum["Default"] = 0] = "Default";
400
- ActionLevelEnum[ActionLevelEnum["Primary"] = 1] = "Primary";
401
- ActionLevelEnum[ActionLevelEnum["Secondary"] = 2] = "Secondary";
402
- ActionLevelEnum[ActionLevelEnum["Info"] = 3] = "Info";
403
- ActionLevelEnum[ActionLevelEnum["Help"] = 4] = "Help";
404
- ActionLevelEnum[ActionLevelEnum["Success"] = 5] = "Success";
405
- ActionLevelEnum[ActionLevelEnum["Warning"] = 6] = "Warning";
406
- ActionLevelEnum[ActionLevelEnum["Danger"] = 7] = "Danger";
407
- })(ActionLevelEnum || (ActionLevelEnum = {}));
408
-
409
- class DataProvider {
410
- constructor(modelType, serviceType) {
411
- this._modelType = modelType;
412
- this._serviceType = serviceType;
413
- }
414
- get serviceType() {
415
- return this._serviceType;
416
- }
417
- get modelType() {
418
- return this._modelType;
419
- }
420
- withServiceType(type) {
421
- this._serviceType = type;
422
- return this;
423
- }
424
- }
425
-
426
- class EditorDataProvider extends DataProvider {
427
- constructor(modelType, serviceType) {
428
- super(modelType, serviceType);
429
- this._fetch = id => throwError(`No fetch function provided for id ${id}.`);
430
- }
431
- get fetch() {
432
- return this._fetch;
433
- }
434
- get create() {
435
- return this._create;
436
- }
437
- get update() {
438
- return this._update;
439
- }
440
- get delete() {
441
- return this._delete;
442
- }
443
- withFetch(fetch) {
444
- this._fetch = fetch;
445
- return this;
446
- }
447
- withCreate(create) {
448
- this._create = create;
449
- return this;
450
- }
451
- withUpdate(update) {
452
- this._update = update;
453
- return this;
454
- }
455
- withDelete(deleteFn) {
456
- this._delete = deleteFn;
457
- return this;
458
- }
459
- }
460
-
461
- class LookupDataProvider extends DataProvider {
462
- constructor(modelType, serviceType) {
463
- super(modelType, serviceType);
464
- this._lookup = () => of([]);
465
- }
466
- get lookup() {
467
- return this._lookup;
468
- }
469
- withLookup(lookup) {
470
- this._lookup = lookup;
141
+ withLookup(lookup) {
142
+ this._lookup = lookup;
471
143
  return this;
472
144
  }
473
145
  }
@@ -634,109 +306,628 @@ MediusQueryResultBase.attributeTypeMap = [
634
306
  baseName: 'selectInTwoSteps',
635
307
  type: 'boolean'
636
308
  }
637
- ];
638
- class MediusQueryResultWithObject extends MediusQueryResultBase {
639
- static getAttributeTypeMap() {
640
- return MediusQueryResultWithObject.attributeTypeMap;
309
+ ];
310
+ class MediusQueryResultWithObject extends MediusQueryResultBase {
311
+ static getAttributeTypeMap() {
312
+ return MediusQueryResultWithObject.attributeTypeMap;
313
+ }
314
+ }
315
+ MediusQueryResultWithObject.discriminator = undefined;
316
+ MediusQueryResultWithObject.attributeTypeMap = [
317
+ ...MediusQueryResultBase.attributeTypeMap,
318
+ {
319
+ name: 'pageData',
320
+ baseName: 'page_data',
321
+ type: 'Array<object>'
322
+ }
323
+ ];
324
+ class MediusQueryResult extends MediusQueryResultBase {
325
+ static getAttributeTypeMap() {
326
+ return MediusQueryResultWithObject.attributeTypeMap;
327
+ }
328
+ }
329
+ MediusQueryResult.discriminator = undefined;
330
+ MediusQueryResult.attributeTypeMapBase = MediusQueryResultBase.attributeTypeMap;
331
+ MediusQueryResult.attributeTypeMap = [
332
+ ...MediusQueryResultBase.attributeTypeMap,
333
+ {
334
+ name: 'pageData',
335
+ baseName: 'page_data',
336
+ type: 'Array<T>'
337
+ }
338
+ ];
339
+
340
+ class MediusQueryParamBuilder {
341
+ constructor(queryParam) {
342
+ this.queryParam = queryParam;
343
+ }
344
+ static create(itemsPerPage = 50, itemsOffset = 0) {
345
+ const queryParam = new MediusQueryParam();
346
+ queryParam.itemsPerPage = itemsPerPage;
347
+ queryParam.itemsOffset = itemsOffset;
348
+ return new MediusQueryParamBuilder(queryParam);
349
+ }
350
+ withItemsPerPage(itemsPerPage) {
351
+ this.queryParam.itemsPerPage = itemsPerPage;
352
+ return this;
353
+ }
354
+ withItemsOffset(itemsOffset) {
355
+ this.queryParam.itemsOffset = itemsOffset;
356
+ return this;
357
+ }
358
+ withSort(property, asc = true) {
359
+ if (!this.queryParam.sortProperty || !this.queryParam.sortAsc) {
360
+ this.queryParam.sortProperty = [];
361
+ this.queryParam.sortAsc = [];
362
+ }
363
+ this.queryParam.sortProperty.push(property);
364
+ this.queryParam.sortAsc.push(asc);
365
+ return this;
366
+ }
367
+ withFilter(property, value, valueTo = undefined, matchType = MediusFilterMatchType.Contains, matchCaseSensitive = false) {
368
+ if (!this.queryParam.filterParams) {
369
+ this.queryParam.filterParams = [];
370
+ }
371
+ const filterParam = new MediusFilterParam();
372
+ filterParam.property = property;
373
+ filterParam.filterValue = value;
374
+ filterParam.filterValueTo = valueTo;
375
+ filterParam.filterMatchType = matchType;
376
+ filterParam.filterMatchCaseSensitive = matchCaseSensitive;
377
+ this.queryParam.filterParams.push(filterParam);
378
+ return this;
379
+ }
380
+ build() {
381
+ const queryParam = this.queryParam;
382
+ this.queryParam = new MediusQueryParam();
383
+ return queryParam;
384
+ }
385
+ }
386
+
387
+ /* tslint:disable:no-angle-bracket-type-assertion no-trailing-whitespace member-ordering object-literal-key-quotes */
388
+ const enumsMapBase = {
389
+ FilterMatchType: MediusFilterMatchType,
390
+ QueryMode: MediusQueryMode
391
+ };
392
+ const typeMapBase = {
393
+ FilterParam: MediusFilterParam,
394
+ QueryParam: MediusQueryParam,
395
+ QueryResult: MediusQueryResult,
396
+ QueryResultWithObject: MediusQueryResultWithObject
397
+ };
398
+
399
+ class TableDataProvider extends DataProvider {
400
+ constructor(modelType, serviceType) {
401
+ super(modelType, serviceType);
402
+ this._getAll = () => of(new MediusQueryResult());
403
+ }
404
+ get getAll() {
405
+ return this._getAll;
406
+ }
407
+ withGetAll(getAll) {
408
+ this._getAll = getAll;
409
+ return this;
410
+ }
411
+ }
412
+
413
+ class TableviewDataProvider extends EditorDataProvider {
414
+ constructor(modelType, serviceType) {
415
+ super(modelType, serviceType);
416
+ this._getAll = () => of(new MediusQueryResult());
417
+ }
418
+ get getAll() {
419
+ return this._getAll;
420
+ }
421
+ withGetAll(getAll) {
422
+ this._getAll = getAll;
423
+ return this;
424
+ }
425
+ }
426
+
427
+ class ActionDescriptor {
428
+ constructor(model, actionName, parentType, parentProperty) {
429
+ this._type = ActionTypeEnum.Direct;
430
+ this._activationTrigger = ActionActivationTriggerEnum.OnClick;
431
+ this._position = ActionPositionEnum.ToolbarRight;
432
+ this._level = ActionLevelEnum.Default;
433
+ this._routeUrl = null;
434
+ this._className = '';
435
+ this._size = ActionDescriptor.SizeEnum.Normal;
436
+ this._hasRunConfirmation = false;
437
+ this._hasRunNotificationSuccess = true;
438
+ this._hasRunNotificationError = true;
439
+ this._model = model;
440
+ this._actionName = actionName;
441
+ if ((parentType && !parentProperty) || (!parentProperty && parentProperty)) {
442
+ throw new Error(`Provide both the parent type and parent property or none: ${parentType}, ${parentProperty}.`);
443
+ }
444
+ this._parentType = parentType;
445
+ this._parentTypeName = parentType ? TypeUtil.findTypeName(parentType) : undefined;
446
+ this._parentProperty = parentProperty;
447
+ this._i18nModelActionBaseKey = this._parentTypeName
448
+ ? `${this._parentTypeName}.actions.${this._parentProperty}_${actionName}`
449
+ : `${this._model.typeName}.actions.${actionName}`;
450
+ }
451
+ get model() {
452
+ return this._model;
453
+ }
454
+ get parentTypeName() {
455
+ return this._parentTypeName;
456
+ }
457
+ get parentProperty() {
458
+ return this._parentProperty;
459
+ }
460
+ get i18nModelActionBaseKey() {
461
+ return this._i18nModelActionBaseKey;
462
+ }
463
+ get type() {
464
+ return this._type;
465
+ }
466
+ get activationTrigger() {
467
+ return this._activationTrigger;
468
+ }
469
+ get position() {
470
+ return this._position;
471
+ }
472
+ get level() {
473
+ return this._level;
474
+ }
475
+ get routeUrl() {
476
+ return this._routeUrl;
477
+ }
478
+ get title() {
479
+ return this._title;
480
+ }
481
+ get icon() {
482
+ return this._icon;
483
+ }
484
+ get tooltip() {
485
+ return this._tooltip;
486
+ }
487
+ get dataProvider() {
488
+ return this._dataProvider;
489
+ }
490
+ get hasRunFunction() {
491
+ return typeof this._runFunction === 'function';
492
+ }
493
+ get runFunction() {
494
+ if (!this._runFunction) {
495
+ throw new Error('Run function is not defined and cannot be invoked');
496
+ }
497
+ return this._runFunction;
498
+ }
499
+ get isVisibleFunction() {
500
+ return this._isVisibleFunction;
501
+ }
502
+ get isEnabledFunction() {
503
+ return this._isEnabledFunction;
504
+ }
505
+ get actionName() {
506
+ return this._actionName;
507
+ }
508
+ get className() {
509
+ return this._className;
510
+ }
511
+ get size() {
512
+ return this._size;
513
+ }
514
+ get isSizeExtraSmall() {
515
+ return this._size === ActionDescriptor.SizeEnum.ExtraSmall;
516
+ }
517
+ get isSizeSmall() {
518
+ return this._size === ActionDescriptor.SizeEnum.Small;
519
+ }
520
+ get isSizeLarge() {
521
+ return this._size === ActionDescriptor.SizeEnum.Large;
522
+ }
523
+ get isSizeExtraLarge() {
524
+ return this._size === ActionDescriptor.SizeEnum.ExtraLarge;
525
+ }
526
+ get hasRunConfirmation() {
527
+ return this._hasRunConfirmation;
528
+ }
529
+ get runConfirmationIcon() {
530
+ return this._runConfirmationIcon;
531
+ }
532
+ get runConfirmationTitle() {
533
+ return this._runConfirmationTitle;
534
+ }
535
+ get runConfirmationMessage() {
536
+ return this._runConfirmationMessage;
537
+ }
538
+ get runConfirmationAcceptTitle() {
539
+ return this._runConfirmationAcceptTitle;
540
+ }
541
+ get runConfirmationRejectTitle() {
542
+ return this._runConfirmationRejectTitle;
543
+ }
544
+ get hasRunNotificationSuccess() {
545
+ return this._hasRunNotificationSuccess;
546
+ }
547
+ get runNotificationSuccessTitle() {
548
+ return this._runNotificationSuccessTitle;
549
+ }
550
+ get runNotificationSuccessMessage() {
551
+ return this._runNotificationSuccessMessage;
552
+ }
553
+ get hasRunNotificationError() {
554
+ return this._hasRunNotificationError;
555
+ }
556
+ get runNotificationErrorTitle() {
557
+ return this._runNotificationErrorTitle;
558
+ }
559
+ get runNotificationErrorMessage() {
560
+ return this._runNotificationErrorMessage;
561
+ }
562
+ withDataProvider(dataProvider) {
563
+ this._dataProvider = dataProvider;
564
+ return this;
565
+ }
566
+ withServiceType(serviceType) {
567
+ this._dataProvider = new DataProvider(this._model.type, serviceType);
568
+ return this;
569
+ }
570
+ withRunFunction(fn) {
571
+ this._runFunction = fn;
572
+ return this;
573
+ }
574
+ withIsVisibleFunction(fn) {
575
+ this._isVisibleFunction = fn;
576
+ return this;
577
+ }
578
+ withIsEnabledFunction(fn) {
579
+ this._isEnabledFunction = fn;
580
+ return this;
581
+ }
582
+ withRouteTrigger(routeUrl) {
583
+ this._activationTrigger = ActionActivationTriggerEnum.OnRoute;
584
+ this._routeUrl = routeUrl;
585
+ return this;
586
+ }
587
+ withLevel(level) {
588
+ this._level = level;
589
+ return this;
590
+ }
591
+ /**
592
+ * Overrides default title key with model action key (${model.typeName}.actions.${actionName}). Not relevant if parentType name is provided.
593
+ */
594
+ withModelTitle() {
595
+ this._title = `${this._i18nModelActionBaseKey}.title`;
596
+ return this;
597
+ }
598
+ /**
599
+ * Overrides default title key (${actionName}.title). If null, no title will be shown.
600
+ * @param title Title i18n key or title.
601
+ */
602
+ withTitle(title) {
603
+ this._title = title;
604
+ return this;
605
+ }
606
+ withIcon(icon) {
607
+ this._icon = icon;
608
+ return this;
609
+ }
610
+ withTooltip(tooltip) {
611
+ this._title = tooltip;
612
+ return this;
613
+ }
614
+ withClassName(className) {
615
+ this._className = className;
616
+ return this;
617
+ }
618
+ withSize(size = ActionDescriptor.SizeEnum.Normal) {
619
+ this._size = size;
620
+ return this;
621
+ }
622
+ withPosition(position) {
623
+ this._position = position;
624
+ return this;
625
+ }
626
+ withRunConfirmation(icon = 'pi pi-exclamation-triangle', title, message, acceptTitle, rejectTitle) {
627
+ this._hasRunConfirmation = true;
628
+ this._runConfirmationIcon = icon;
629
+ this._runConfirmationTitle = title;
630
+ this._runConfirmationMessage = message;
631
+ this._runConfirmationAcceptTitle = acceptTitle;
632
+ this._runConfirmationRejectTitle = rejectTitle;
633
+ return this;
634
+ }
635
+ withRunNotificationSuccess(title, message, hasNotification = true) {
636
+ this._hasRunNotificationSuccess = hasNotification;
637
+ this._runNotificationSuccessTitle = title;
638
+ this._runNotificationSuccessMessage = message;
639
+ }
640
+ withRunNotificationError(title, message, hasNotification = true) {
641
+ this._hasRunNotificationError = hasNotification;
642
+ this._runNotificationErrorTitle = title;
643
+ this._runNotificationErrorMessage = message;
644
+ }
645
+ }
646
+ (function (ActionDescriptor) {
647
+ let SizeEnum;
648
+ (function (SizeEnum) {
649
+ SizeEnum[SizeEnum["ExtraSmall"] = 0] = "ExtraSmall";
650
+ SizeEnum[SizeEnum["Small"] = 1] = "Small";
651
+ SizeEnum[SizeEnum["Normal"] = 2] = "Normal";
652
+ SizeEnum[SizeEnum["Large"] = 3] = "Large";
653
+ SizeEnum[SizeEnum["ExtraLarge"] = 4] = "ExtraLarge";
654
+ })(SizeEnum = ActionDescriptor.SizeEnum || (ActionDescriptor.SizeEnum = {}));
655
+ })(ActionDescriptor || (ActionDescriptor = {}));
656
+ class ActionEditorDescriptor extends ActionDescriptor {
657
+ constructor(editorDescriptor, actionName, parentType, parentProperty) {
658
+ super(editorDescriptor.model, actionName, parentType, parentProperty);
659
+ this._editorActions = [];
660
+ this._editorTitle = undefined;
661
+ this._hasFetchNotificationSuccess = false;
662
+ this._type = ActionTypeEnum.Editor;
663
+ this._editorDescriptor = editorDescriptor;
664
+ this._editorActions.push(new ActionEditorSubmitDescriptor(this), new ActionEditorSubmitDescriptor(this, ActionEditorSubmitDescriptor.TypeEnum.Cancel));
665
+ }
666
+ get editorTitle() {
667
+ return this._editorTitle;
668
+ }
669
+ get editorDescriptor() {
670
+ return this._editorDescriptor;
671
+ }
672
+ get hasFetchNotificationSuccess() {
673
+ return this._hasFetchNotificationSuccess;
674
+ }
675
+ get fetchNotificationSuccessTitle() {
676
+ return this._fetchNotificationSuccessTitle;
677
+ }
678
+ get fetchNotificationSuccessMessage() {
679
+ return this._fetchNotificationSuccessMessage;
680
+ }
681
+ get dataProvider() {
682
+ return this._dataProvider;
683
+ }
684
+ get runFunction() {
685
+ throw new Error('Run function cannot be used in editor action. Use submit function instead!');
686
+ }
687
+ get fetchFunction() {
688
+ if (!this._fetchFunction) {
689
+ return ctx => {
690
+ console.warn(`Fetch function is not provided for function ${this._actionName}, using default and returning context item`, ctx.data?.item);
691
+ return of(ctx.data?.item ? ctx.data.item : {});
692
+ };
693
+ }
694
+ return this._fetchFunction;
695
+ }
696
+ get submitFunction() {
697
+ return this._submitFunction;
698
+ }
699
+ get editorActions() {
700
+ return this._editorActions;
701
+ }
702
+ get editorComponent() {
703
+ return this._editorComponent;
704
+ }
705
+ withEditorTitle(title) {
706
+ this._editorTitle = title;
707
+ return this;
708
+ }
709
+ withDataProvider(dataProvider) {
710
+ this._dataProvider = dataProvider;
711
+ return this;
712
+ }
713
+ withServiceType(serviceType) {
714
+ this._dataProvider = new EditorDataProvider(this._model.type, serviceType);
715
+ return this;
716
+ }
717
+ withRunFunction(fn) {
718
+ return this.withSubmitFunction(fn);
719
+ }
720
+ withFetchFunction(fn) {
721
+ this._fetchFunction = fn;
722
+ return this;
723
+ }
724
+ withSubmitFunction(fn) {
725
+ this._submitFunction = fn;
726
+ return this;
727
+ }
728
+ withFetchNotificationError(title, message, hasNotification = true) {
729
+ this._hasFetchNotificationSuccess = hasNotification;
730
+ this._fetchNotificationSuccessTitle = title;
731
+ this._fetchNotificationSuccessMessage = message;
732
+ return this;
641
733
  }
642
- }
643
- MediusQueryResultWithObject.discriminator = undefined;
644
- MediusQueryResultWithObject.attributeTypeMap = [
645
- ...MediusQueryResultBase.attributeTypeMap,
646
- {
647
- name: 'pageData',
648
- baseName: 'page_data',
649
- type: 'Array<object>'
734
+ withEditorAction(action) {
735
+ this._editorActions.push(action);
736
+ return this;
650
737
  }
651
- ];
652
- class MediusQueryResult extends MediusQueryResultBase {
653
- static getAttributeTypeMap() {
654
- return MediusQueryResultWithObject.attributeTypeMap;
738
+ withEditorComponent(editorComponent) {
739
+ this._editorComponent = editorComponent;
740
+ return this;
655
741
  }
656
742
  }
657
- MediusQueryResult.discriminator = undefined;
658
- MediusQueryResult.attributeTypeMapBase = MediusQueryResultBase.attributeTypeMap;
659
- MediusQueryResult.attributeTypeMap = [
660
- ...MediusQueryResultBase.attributeTypeMap,
661
- {
662
- name: 'pageData',
663
- baseName: 'page_data',
664
- type: 'Array<T>'
743
+ class ActionEditorSubmitDescriptor extends ActionDescriptor {
744
+ constructor(editorAction, submitType = ActionEditorSubmitDescriptor.TypeEnum.Submit) {
745
+ super(editorAction.model, submitType === ActionEditorSubmitDescriptor.TypeEnum.Submit ? 'submit' : 'cancel');
746
+ this._editorAction = editorAction;
747
+ this._submitType = submitType;
748
+ this._position = ActionPositionEnum.FooterRight;
665
749
  }
666
- ];
667
-
668
- class MediusQueryParamBuilder {
669
- constructor(queryParam) {
670
- this.queryParam = queryParam;
750
+ get submitType() {
751
+ return this._submitType;
671
752
  }
672
- static create(itemsPerPage = 50, itemsOffset = 0) {
673
- const queryParam = new MediusQueryParam();
674
- queryParam.itemsPerPage = itemsPerPage;
675
- queryParam.itemsOffset = itemsOffset;
676
- return new MediusQueryParamBuilder(queryParam);
753
+ }
754
+ (function (ActionEditorSubmitDescriptor) {
755
+ let TypeEnum;
756
+ (function (TypeEnum) {
757
+ TypeEnum[TypeEnum["Submit"] = 0] = "Submit";
758
+ TypeEnum[TypeEnum["Cancel"] = 1] = "Cancel";
759
+ })(TypeEnum = ActionEditorSubmitDescriptor.TypeEnum || (ActionEditorSubmitDescriptor.TypeEnum = {}));
760
+ })(ActionEditorSubmitDescriptor || (ActionEditorSubmitDescriptor = {}));
761
+ class ActionEditorDetailsDescriptor extends ActionEditorDescriptor {
762
+ constructor(editorDescriptor) {
763
+ super(editorDescriptor, 'details');
764
+ this.withPosition(ActionPositionEnum.RowClick);
765
+ this.withRouteTrigger(':itemId');
766
+ this.withFetchFunction(ctx => ctx.dataProvider?.fetch && ctx.data?.itemId
767
+ ? ctx.dataProvider.fetch(ctx.data?.itemId, ctx.serviceInstance)
768
+ : throwError(new Error(`Data provider fetch function or item id ${ctx.data?.itemId} is missing.`)));
769
+ this.withClassName('mng-details-dynamic-dialog');
677
770
  }
678
- withItemsPerPage(itemsPerPage) {
679
- this.queryParam.itemsPerPage = itemsPerPage;
680
- return this;
771
+ withServiceType(serviceType) {
772
+ return this.withServiceFetchFunction(serviceType);
681
773
  }
682
- withItemsOffset(itemsOffset) {
683
- this.queryParam.itemsOffset = itemsOffset;
774
+ withServiceFetchFunction(serviceType, fetchFn) {
775
+ const dataProvider = new EditorDataProvider(this._model.type, serviceType);
776
+ if (fetchFn) {
777
+ dataProvider.withFetch(fetchFn);
778
+ }
779
+ this._dataProvider = dataProvider;
684
780
  return this;
685
781
  }
686
- withSort(property, asc = true) {
687
- if (!this.queryParam.sortProperty || !this.queryParam.sortAsc) {
688
- this.queryParam.sortProperty = [];
689
- this.queryParam.sortAsc = [];
782
+ }
783
+ class ActionEditorAddDescriptor extends ActionEditorDescriptor {
784
+ constructor(editorDescriptor) {
785
+ super(editorDescriptor, 'add');
786
+ this.withPosition(ActionPositionEnum.ToolbarLeft);
787
+ this.withRouteTrigger('add');
788
+ this.withSubmitFunction(ctx => ctx.dataProvider?.create ? ctx.dataProvider.create(ctx.data?.item, ctx.serviceInstance) : throwError(new Error(`Data provider create function is missing.`)));
789
+ this.withLevel(ActionLevelEnum.Success);
790
+ this.withIcon('pi pi-plus');
791
+ this.withClassName('mng-details-dynamic-dialog');
792
+ }
793
+ withServiceType(serviceType) {
794
+ return this.withServiceSubmitFunction(serviceType);
795
+ }
796
+ withServiceSubmitFunction(serviceType, createFn, fetchFn) {
797
+ const dataProvider = new EditorDataProvider(this._model.type, serviceType);
798
+ if (createFn) {
799
+ dataProvider.withCreate(createFn);
690
800
  }
691
- this.queryParam.sortProperty.push(property);
692
- this.queryParam.sortAsc.push(asc);
801
+ if (fetchFn) {
802
+ dataProvider.withFetch(fetchFn);
803
+ }
804
+ this._dataProvider = dataProvider;
693
805
  return this;
694
806
  }
695
- withFilter(property, value, valueTo = undefined, matchType = MediusFilterMatchType.Contains, matchCaseSensitive = false) {
696
- if (!this.queryParam.filterParams) {
697
- this.queryParam.filterParams = [];
807
+ }
808
+ class ActionEditorEditDescriptor extends ActionEditorDescriptor {
809
+ constructor(editorDescriptor) {
810
+ super(editorDescriptor, 'edit');
811
+ this.withPosition(ActionPositionEnum.RowInline);
812
+ this.withTitle(null);
813
+ this.withRouteTrigger(':itemId/edit');
814
+ this.withFetchFunction(ctx => ctx.dataProvider?.fetch && ctx.data?.itemId
815
+ ? ctx.dataProvider.fetch(ctx.data.itemId, ctx.serviceInstance)
816
+ : throwError(new Error(`Data provider fetch function or item id ${ctx.data?.itemId} is missing.`)));
817
+ this.withSubmitFunction(ctx => ctx.dataProvider?.update && ctx.data?.itemId
818
+ ? ctx.dataProvider.update(ctx.data.itemId, ctx.data?.item, ctx.serviceInstance)
819
+ : throwError(new Error(`Data provider update function or item id ${ctx.data?.itemId} is missing.`)));
820
+ this.withIcon('pi pi-pencil');
821
+ this.withClassName('mng-details-dynamic-dialog');
822
+ }
823
+ withServiceType(serviceType) {
824
+ return this.withServiceSubmitFunction(serviceType);
825
+ }
826
+ withServiceSubmitFunction(serviceType, updateFn, fetchFn) {
827
+ const dataProvider = new EditorDataProvider(this._model.type, serviceType);
828
+ if (updateFn) {
829
+ dataProvider.withUpdate(updateFn);
698
830
  }
699
- const filterParam = new MediusFilterParam();
700
- filterParam.property = property;
701
- filterParam.filterValue = value;
702
- filterParam.filterValueTo = valueTo;
703
- filterParam.filterMatchType = matchType;
704
- filterParam.filterMatchCaseSensitive = matchCaseSensitive;
705
- this.queryParam.filterParams.push(filterParam);
831
+ if (fetchFn) {
832
+ dataProvider.withFetch(fetchFn);
833
+ }
834
+ this._dataProvider = dataProvider;
706
835
  return this;
707
836
  }
708
- build() {
709
- const queryParam = this.queryParam;
710
- this.queryParam = new MediusQueryParam();
711
- return queryParam;
712
- }
713
837
  }
714
-
715
- /* tslint:disable:no-angle-bracket-type-assertion no-trailing-whitespace member-ordering object-literal-key-quotes */
716
- const enumsMapBase = {
717
- FilterMatchType: MediusFilterMatchType,
718
- QueryMode: MediusQueryMode
719
- };
720
- const typeMapBase = {
721
- FilterParam: MediusFilterParam,
722
- QueryParam: MediusQueryParam,
723
- QueryResult: MediusQueryResult,
724
- QueryResultWithObject: MediusQueryResultWithObject
725
- };
726
-
727
- class TableviewDataProvider extends EditorDataProvider {
728
- constructor(modelType, serviceType) {
729
- super(modelType, serviceType);
730
- this._getAll = () => of(new MediusQueryResult());
838
+ class ActionDeleteDescriptor extends ActionDescriptor {
839
+ constructor(model) {
840
+ super(model, 'delete');
841
+ this.withPosition(ActionPositionEnum.RowInline);
842
+ this.withTitle(null);
843
+ this.withRunFunction(ctx => {
844
+ const editorDataProvider = ctx.dataProvider;
845
+ return editorDataProvider?.delete && ctx.data?.itemId
846
+ ? editorDataProvider.delete(ctx.data.itemId, ctx.data.item, ctx.serviceInstance)
847
+ : throwError(new Error(`Data provider delete function or item id ${ctx.data?.itemId} is missing.`));
848
+ });
849
+ this.withLevel(ActionLevelEnum.Danger);
850
+ this.withIcon('pi pi-trash');
851
+ this.withRunConfirmation(undefined);
731
852
  }
732
- get getAll() {
733
- return this._getAll;
853
+ withServiceType(serviceType) {
854
+ return this.withServiceDeleteFunction(serviceType);
734
855
  }
735
- withGetAll(getAll) {
736
- this._getAll = getAll;
856
+ withServiceDeleteFunction(serviceType, deleteFn) {
857
+ const dataProvider = new EditorDataProvider(this._model.type, serviceType);
858
+ if (deleteFn) {
859
+ dataProvider.withDelete(deleteFn);
860
+ }
861
+ this._dataProvider = dataProvider;
737
862
  return this;
738
863
  }
739
864
  }
865
+ var ActionPositionEnum;
866
+ (function (ActionPositionEnum) {
867
+ ActionPositionEnum[ActionPositionEnum["ToolbarLeft"] = 0] = "ToolbarLeft";
868
+ ActionPositionEnum[ActionPositionEnum["ToolbarRight"] = 1] = "ToolbarRight";
869
+ ActionPositionEnum[ActionPositionEnum["TableHeader"] = 2] = "TableHeader";
870
+ ActionPositionEnum[ActionPositionEnum["RowInline"] = 3] = "RowInline";
871
+ ActionPositionEnum[ActionPositionEnum["RowClick"] = 4] = "RowClick";
872
+ ActionPositionEnum[ActionPositionEnum["FooterLeft"] = 5] = "FooterLeft";
873
+ ActionPositionEnum[ActionPositionEnum["FooterRight"] = 6] = "FooterRight";
874
+ })(ActionPositionEnum || (ActionPositionEnum = {}));
875
+ var ActionActivationTriggerEnum;
876
+ (function (ActionActivationTriggerEnum) {
877
+ ActionActivationTriggerEnum[ActionActivationTriggerEnum["OnClick"] = 0] = "OnClick";
878
+ ActionActivationTriggerEnum[ActionActivationTriggerEnum["OnRoute"] = 1] = "OnRoute"; // action is triggered for activation by route url
879
+ })(ActionActivationTriggerEnum || (ActionActivationTriggerEnum = {}));
880
+ var ActionTypeEnum;
881
+ (function (ActionTypeEnum) {
882
+ ActionTypeEnum[ActionTypeEnum["Direct"] = 0] = "Direct";
883
+ ActionTypeEnum[ActionTypeEnum["Event"] = 1] = "Event";
884
+ ActionTypeEnum[ActionTypeEnum["Editor"] = 2] = "Editor"; // editor providing middle step for activation
885
+ })(ActionTypeEnum || (ActionTypeEnum = {}));
886
+ var ActionLevelEnum;
887
+ (function (ActionLevelEnum) {
888
+ ActionLevelEnum[ActionLevelEnum["Default"] = 0] = "Default";
889
+ ActionLevelEnum[ActionLevelEnum["Primary"] = 1] = "Primary";
890
+ ActionLevelEnum[ActionLevelEnum["Secondary"] = 2] = "Secondary";
891
+ ActionLevelEnum[ActionLevelEnum["Info"] = 3] = "Info";
892
+ ActionLevelEnum[ActionLevelEnum["Help"] = 4] = "Help";
893
+ ActionLevelEnum[ActionLevelEnum["Success"] = 5] = "Success";
894
+ ActionLevelEnum[ActionLevelEnum["Warning"] = 6] = "Warning";
895
+ ActionLevelEnum[ActionLevelEnum["Danger"] = 7] = "Danger";
896
+ })(ActionLevelEnum || (ActionLevelEnum = {}));
897
+
898
+ class MngFormEditorSubmitEvent {
899
+ constructor(formItem) {
900
+ this.formItem = formItem;
901
+ this.success = true;
902
+ }
903
+ }
904
+ var MngFormFieldEventTypeEnum;
905
+ (function (MngFormFieldEventTypeEnum) {
906
+ MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Component"] = 0] = "Component";
907
+ MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["ValueChange"] = 1] = "ValueChange";
908
+ MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["DataProvider"] = 2] = "DataProvider";
909
+ MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Dialog"] = 3] = "Dialog";
910
+ MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Other"] = 4] = "Other";
911
+ })(MngFormFieldEventTypeEnum || (MngFormFieldEventTypeEnum = {}));
912
+ class MngFormFieldEventComponentSubtype {
913
+ }
914
+ MngFormFieldEventComponentSubtype.ON_INIT = 'Component.OnInit';
915
+ MngFormFieldEventComponentSubtype.ON_VIEW_INIT = 'Component.OnViewInit';
916
+ MngFormFieldEventComponentSubtype.ON_CONTENT_INIT = 'Component.OnContentInit';
917
+ MngFormFieldEventComponentSubtype.ON_DESTROY = 'Component.OnDestroy';
918
+ class MngFormFieldEventDialogSubtype {
919
+ }
920
+ MngFormFieldEventDialogSubtype.VISIBILITY = 'Dialog.Visibility';
921
+ MngFormFieldEventDialogSubtype.TABLE_CAPTION_COMPONENT_INSTANCE = 'Dialog.MngTable.CaptionComponentInstance';
922
+ MngFormFieldEventDialogSubtype.TABLE_COLUMN_ACTIONS_COMPONENT_INSTANCE = 'Dialog.MngTable.ColumnActionsComponentInstance';
923
+ class MngFormFieldEvent {
924
+ constructor(type, componentType, componentInstance, data = {}) {
925
+ this.type = type;
926
+ this.componentType = componentType;
927
+ this.componentInstance = componentInstance;
928
+ this.data = data;
929
+ }
930
+ }
740
931
 
741
932
  class EditorDescriptor {
742
933
  constructor(modelType, idProperty, titleProperty) {
@@ -879,22 +1070,37 @@ class EditorDescriptor {
879
1070
  EditorDescriptor.defaultGroupName = '_default';
880
1071
  class AGenericFieldDescriptor {
881
1072
  constructor(editor) {
1073
+ this._config = {};
882
1074
  this._editor = editor;
883
1075
  }
884
1076
  get editor() {
885
1077
  return this._editor;
886
1078
  }
1079
+ get config() {
1080
+ return this._config;
1081
+ }
1082
+ withConfig(config) {
1083
+ this._config = config;
1084
+ return this;
1085
+ }
887
1086
  }
888
1087
  class AFieldDescriptor extends AGenericFieldDescriptor {
889
1088
  constructor(editor, property) {
890
1089
  super(editor);
891
1090
  this._required = false;
892
1091
  this._disabled = false;
893
- this._className = '';
894
1092
  this._validators = [];
1093
+ this._className = '';
1094
+ this._labelClassName = '';
1095
+ this._inputClassName = '';
1096
+ this._size = FieldDescriptor.SizeEnum.Normal;
1097
+ this._eventsSubject = new Subject();
895
1098
  this._property = property;
896
1099
  this._label = I18nUtil.getModelPropertyKey(this._editor.model, property);
897
1100
  }
1101
+ get property() {
1102
+ return this._property;
1103
+ }
898
1104
  get group() {
899
1105
  return this._group;
900
1106
  }
@@ -904,6 +1110,9 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
904
1110
  get placeholder() {
905
1111
  return this._placeholder;
906
1112
  }
1113
+ get helpText() {
1114
+ return this._helpText;
1115
+ }
907
1116
  get required() {
908
1117
  return this._required;
909
1118
  }
@@ -913,9 +1122,6 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
913
1122
  get defaultValue() {
914
1123
  return this._defaultValue;
915
1124
  }
916
- get className() {
917
- return this._className;
918
- }
919
1125
  get getter() {
920
1126
  return this._getter;
921
1127
  }
@@ -925,11 +1131,32 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
925
1131
  get validators() {
926
1132
  return this._validators;
927
1133
  }
928
- get disabledFunction() {
929
- return this._disabledFunction;
1134
+ get requiredExpression() {
1135
+ return this._requiredExpression;
930
1136
  }
931
- get property() {
932
- return this._property;
1137
+ get disabledExpression() {
1138
+ return this._disabledExpression;
1139
+ }
1140
+ get hiddenExpression() {
1141
+ return this._hiddenExpression;
1142
+ }
1143
+ get className() {
1144
+ return this._className;
1145
+ }
1146
+ get labelClassName() {
1147
+ return this._labelClassName;
1148
+ }
1149
+ get inputClassName() {
1150
+ return this._inputClassName;
1151
+ }
1152
+ get size() {
1153
+ return this._size;
1154
+ }
1155
+ get isSizeSmall() {
1156
+ return this._size === FieldDescriptor.SizeEnum.Small;
1157
+ }
1158
+ get isSizeLarge() {
1159
+ return this._size === FieldDescriptor.SizeEnum.Large;
933
1160
  }
934
1161
  withLabel(label) {
935
1162
  this._label = label;
@@ -939,23 +1166,30 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
939
1166
  this._placeholder = placeholder;
940
1167
  return this;
941
1168
  }
942
- withRequired(required = true) {
1169
+ withHelpText(helpText) {
1170
+ this._helpText = helpText;
1171
+ return this;
1172
+ }
1173
+ withRequired(required = true, requiredExpression) {
943
1174
  this._required = required;
1175
+ if (requiredExpression) {
1176
+ this._requiredExpression = requiredExpression;
1177
+ }
944
1178
  return this;
945
1179
  }
946
- withDisabled(disabled = true, disabledFunction) {
1180
+ withDisabled(disabled = true, disabledExpression) {
947
1181
  this._disabled = disabled;
948
- if (disabledFunction) {
949
- this._disabledFunction = disabledFunction;
1182
+ if (disabledExpression) {
1183
+ this._disabledExpression = disabledExpression;
950
1184
  }
951
1185
  return this;
952
1186
  }
953
- withDefaultValue(defaultValue) {
954
- this._defaultValue = defaultValue;
1187
+ withHidden(hiddenExpression) {
1188
+ this._hiddenExpression = hiddenExpression;
955
1189
  return this;
956
1190
  }
957
- withClassName(className) {
958
- this._className = className;
1191
+ withDefaultValue(defaultValue) {
1192
+ this._defaultValue = defaultValue;
959
1193
  return this;
960
1194
  }
961
1195
  withGetter(getter) {
@@ -970,19 +1204,48 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
970
1204
  this._validators.push(new FieldValidator(name, expression, message));
971
1205
  return this;
972
1206
  }
1207
+ withClassName(className, labelClassName = '', inputClassName = '') {
1208
+ this._className = className;
1209
+ this._labelClassName = labelClassName;
1210
+ this._inputClassName = inputClassName;
1211
+ return this;
1212
+ }
1213
+ withSize(size = FieldDescriptor.SizeEnum.Normal) {
1214
+ this._size = size;
1215
+ return this;
1216
+ }
1217
+ nextEvent(type, cmpType, cmpInstance, data) {
1218
+ this._eventsSubject.next(new MngFormFieldEvent(type, cmpType, cmpInstance, data));
1219
+ }
1220
+ get events$() {
1221
+ return this._eventsSubject.asObservable();
1222
+ }
973
1223
  copyFieldsTo(obj) {
974
1224
  obj._label = this._label;
975
1225
  obj._placeholder = this._placeholder;
1226
+ obj._helpText = this._helpText;
976
1227
  obj._required = this._required;
977
1228
  obj._disabled = this._disabled;
978
1229
  obj._defaultValue = this._defaultValue;
979
- obj._disabledFunction = this._disabledFunction;
1230
+ obj._requiredExpression = this._requiredExpression;
1231
+ obj._hiddenExpression = this._hiddenExpression;
1232
+ obj._disabledExpression = this._disabledExpression;
980
1233
  obj._className = this._className;
1234
+ obj._size = this.size;
981
1235
  obj._getter = this._getter;
982
1236
  obj._setter = this._setter;
983
1237
  obj._validators = this._validators;
984
1238
  }
985
1239
  }
1240
+ var FieldDescriptor;
1241
+ (function (FieldDescriptor) {
1242
+ let SizeEnum;
1243
+ (function (SizeEnum) {
1244
+ SizeEnum[SizeEnum["Small"] = 0] = "Small";
1245
+ SizeEnum[SizeEnum["Normal"] = 1] = "Normal";
1246
+ SizeEnum[SizeEnum["Large"] = 2] = "Large";
1247
+ })(SizeEnum = FieldDescriptor.SizeEnum || (FieldDescriptor.SizeEnum = {}));
1248
+ })(FieldDescriptor || (FieldDescriptor = {}));
986
1249
  class FieldInputDescriptor extends AFieldDescriptor {
987
1250
  constructor(editor, property) {
988
1251
  super(editor, property);
@@ -1049,6 +1312,10 @@ class FieldInputDescriptor extends AFieldDescriptor {
1049
1312
  get customComponentName() {
1050
1313
  return this._customComponentName;
1051
1314
  }
1315
+ asHidden() {
1316
+ this._fieldType = FieldInputDescriptor.TypeEnum.Hidden;
1317
+ return this;
1318
+ }
1052
1319
  asText(minLength, maxLength, pattern, isEmail) {
1053
1320
  this._fieldType = FieldInputDescriptor.TypeEnum.Text;
1054
1321
  this._minLength = minLength;
@@ -1143,14 +1410,15 @@ class FieldInputDescriptor extends AFieldDescriptor {
1143
1410
  (function (FieldInputDescriptor) {
1144
1411
  let TypeEnum;
1145
1412
  (function (TypeEnum) {
1146
- TypeEnum[TypeEnum["Text"] = 0] = "Text";
1147
- TypeEnum[TypeEnum["Textarea"] = 1] = "Textarea";
1148
- TypeEnum[TypeEnum["Number"] = 2] = "Number";
1149
- TypeEnum[TypeEnum["Switch"] = 3] = "Switch";
1150
- TypeEnum[TypeEnum["Radio"] = 4] = "Radio";
1151
- TypeEnum[TypeEnum["Datepicker"] = 5] = "Datepicker";
1152
- TypeEnum[TypeEnum["Mask"] = 6] = "Mask";
1153
- TypeEnum[TypeEnum["Custom"] = 7] = "Custom";
1413
+ TypeEnum[TypeEnum["Hidden"] = 0] = "Hidden";
1414
+ TypeEnum[TypeEnum["Text"] = 1] = "Text";
1415
+ TypeEnum[TypeEnum["Textarea"] = 2] = "Textarea";
1416
+ TypeEnum[TypeEnum["Number"] = 3] = "Number";
1417
+ TypeEnum[TypeEnum["Switch"] = 4] = "Switch";
1418
+ TypeEnum[TypeEnum["Radio"] = 5] = "Radio";
1419
+ TypeEnum[TypeEnum["Datepicker"] = 6] = "Datepicker";
1420
+ TypeEnum[TypeEnum["Mask"] = 7] = "Mask";
1421
+ TypeEnum[TypeEnum["Custom"] = 8] = "Custom";
1154
1422
  })(TypeEnum = FieldInputDescriptor.TypeEnum || (FieldInputDescriptor.TypeEnum = {}));
1155
1423
  })(FieldInputDescriptor || (FieldInputDescriptor = {}));
1156
1424
  class FieldLookupDescriptor extends AFieldDescriptor {
@@ -1175,9 +1443,15 @@ class FieldLookupDescriptor extends AFieldDescriptor {
1175
1443
  get dataProvider() {
1176
1444
  return this._dataProvider;
1177
1445
  }
1446
+ get lookupTableDataProvider() {
1447
+ return this._lookupTableDataProvider;
1448
+ }
1178
1449
  get modelType() {
1179
1450
  return this._modelType;
1180
1451
  }
1452
+ get lookupTableDescriptor() {
1453
+ return this._lookupTableDescriptor;
1454
+ }
1181
1455
  withItemsLabelProperty(itemsLabelProperty) {
1182
1456
  this._itemsLabelProperty = itemsLabelProperty;
1183
1457
  return this;
@@ -1203,10 +1477,19 @@ class FieldLookupDescriptor extends AFieldDescriptor {
1203
1477
  this._dataProvider = dataProvider;
1204
1478
  return this;
1205
1479
  }
1480
+ withConfig(config) {
1481
+ return super.withConfig(config);
1482
+ }
1206
1483
  asAutocomplete() {
1207
1484
  this._lookupType = FieldLookupDescriptor.LookupTypeEnum.Autocomplete;
1208
1485
  return this;
1209
1486
  }
1487
+ asDialog(lookupTableDescriptor, tableDataProvider) {
1488
+ this._lookupType = FieldLookupDescriptor.LookupTypeEnum.Dialog;
1489
+ this._lookupTableDescriptor = lookupTableDescriptor;
1490
+ this._lookupTableDataProvider = tableDataProvider;
1491
+ return this;
1492
+ }
1210
1493
  copy() {
1211
1494
  const field = new FieldLookupDescriptor(this._editor, this._property, this._modelType);
1212
1495
  this.copyFieldsTo(field);
@@ -1215,6 +1498,7 @@ class FieldLookupDescriptor extends AFieldDescriptor {
1215
1498
  field._itemsValueProperty = this._itemsValueProperty;
1216
1499
  field._dataKeyProperty = this._dataKeyProperty;
1217
1500
  field._dataProvider = this._dataProvider;
1501
+ field._lookupTableDescriptor = this._lookupTableDescriptor;
1218
1502
  return field;
1219
1503
  }
1220
1504
  }
@@ -1223,6 +1507,7 @@ class FieldLookupDescriptor extends AFieldDescriptor {
1223
1507
  (function (LookupTypeEnum) {
1224
1508
  LookupTypeEnum[LookupTypeEnum["Dropdown"] = 0] = "Dropdown";
1225
1509
  LookupTypeEnum[LookupTypeEnum["Autocomplete"] = 1] = "Autocomplete";
1510
+ LookupTypeEnum[LookupTypeEnum["Dialog"] = 2] = "Dialog";
1226
1511
  })(LookupTypeEnum = FieldLookupDescriptor.LookupTypeEnum || (FieldLookupDescriptor.LookupTypeEnum = {}));
1227
1512
  })(FieldLookupDescriptor || (FieldLookupDescriptor = {}));
1228
1513
  class FieldLookupEnumDescriptor extends FieldLookupDescriptor {
@@ -2258,6 +2543,8 @@ class EditorFormlyUtil {
2258
2543
  field.templateOptions['descriptor'] = descriptor;
2259
2544
  if (descriptor instanceof FieldInputDescriptor) {
2260
2545
  switch (descriptor.fieldType) {
2546
+ case FieldInputDescriptor.TypeEnum.Hidden:
2547
+ break;
2261
2548
  case FieldInputDescriptor.TypeEnum.Textarea:
2262
2549
  field.type = 'textarea';
2263
2550
  break;
@@ -2297,6 +2584,9 @@ class EditorFormlyUtil {
2297
2584
  case FieldLookupDescriptor.LookupTypeEnum.Autocomplete:
2298
2585
  field.type = 'autocomplete';
2299
2586
  break;
2587
+ case FieldLookupDescriptor.LookupTypeEnum.Dialog:
2588
+ field.type = 'dialog';
2589
+ break;
2300
2590
  case FieldLookupDescriptor.LookupTypeEnum.Dropdown:
2301
2591
  default:
2302
2592
  field.type = 'dropdown';
@@ -2312,11 +2602,17 @@ class EditorFormlyUtil {
2312
2602
  if (descriptor.label) {
2313
2603
  field.templateOptions.label = descriptor.label;
2314
2604
  }
2605
+ if (descriptor.requiredExpression) {
2606
+ field.expressionProperties['templateOptions.required'] = descriptor.requiredExpression;
2607
+ }
2315
2608
  if (descriptor.required) {
2316
2609
  field.templateOptions.required = true;
2317
2610
  }
2318
- if (descriptor.disabledFunction) {
2319
- field.expressionProperties['templateOptions.disabled'] = descriptor.disabledFunction;
2611
+ if (descriptor.hiddenExpression) {
2612
+ field.expressionProperties['hide'] = descriptor.hiddenExpression;
2613
+ }
2614
+ if (descriptor.disabledExpression) {
2615
+ field.expressionProperties['templateOptions.disabled'] = descriptor.disabledExpression;
2320
2616
  }
2321
2617
  else if (descriptor.disabled) {
2322
2618
  field.templateOptions.disabled = true;
@@ -2481,6 +2777,34 @@ class I18nUtil {
2481
2777
  }
2482
2778
  return i18nParameters;
2483
2779
  }
2780
+ static instantErrorI18nTranslation(translate, error, i18nParameters = {}) {
2781
+ i18nParameters.errorStatus = '';
2782
+ i18nParameters.errorMessage = '';
2783
+ if (error.messageCode) {
2784
+ const params = I18nUtil.getErrorI18nParams(error);
2785
+ const keys = [`errors.${error.messageCode}`, `messages.${error.messageCode}`];
2786
+ const i18ns = translate.instant(keys, params);
2787
+ const i18n = I18nUtil.selectKeyByPriority(keys, i18ns);
2788
+ if (i18n) {
2789
+ return i18n;
2790
+ }
2791
+ }
2792
+ return translate.instant(error.message);
2793
+ }
2794
+ static getErrorI18nParams(error, i18nParameters = {}) {
2795
+ i18nParameters.errorStatus = '';
2796
+ i18nParameters.errorMessage = '';
2797
+ if (error.status) {
2798
+ i18nParameters.errorStatus = error.status;
2799
+ }
2800
+ if (error.message) {
2801
+ i18nParameters.errorMessage = error.message;
2802
+ }
2803
+ if (error.statusDescription) {
2804
+ i18nParameters.errorStatusDescription = error.statusDescription;
2805
+ }
2806
+ return i18nParameters;
2807
+ }
2484
2808
  static instantModelName(translate, model, singular) {
2485
2809
  const keys = I18nUtil.getModelNameKeys(model, singular);
2486
2810
  const i18n = translate.instant(keys);
@@ -2609,7 +2933,15 @@ class ModelUtil {
2609
2933
  }
2610
2934
 
2611
2935
  class ToastUtil {
2612
- static tableNotificationError(translationService, table, error, tableview) {
2936
+ static notification(viewContainer, title, message, severity = 'success') {
2937
+ const messageService = viewContainer?.getMessageService();
2938
+ if (!messageService) {
2939
+ console.warn(`No message service was provided through view container, message will not be displayed.`);
2940
+ return;
2941
+ }
2942
+ messageService.add({ severity: severity, summary: title, detail: message, life: severity === 'error' ? 10000 : 5000 });
2943
+ }
2944
+ static tableNotificationError(translationService, table, error, viewContainer) {
2613
2945
  const params = {};
2614
2946
  if (error?.message) {
2615
2947
  params.errorMessage = `: ${error.message}`;
@@ -2620,25 +2952,21 @@ class ToastUtil {
2620
2952
  console.log(params);
2621
2953
  const tableErrorTitle = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.title', undefined, undefined, 'general.error', params) ?? undefined;
2622
2954
  const tableErrorMessage = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.message', undefined, undefined, 'general.errorMessage', params) ?? undefined;
2623
- tableview?.messageService?.add({ severity: 'error', summary: tableErrorTitle, detail: tableErrorMessage });
2955
+ ToastUtil.notification(viewContainer, tableErrorTitle, tableErrorMessage, 'error');
2624
2956
  }
2625
- static actionNotificationSuccess(translationService, action, functionName, customTitleKey, customMessageKey, tableview, item) {
2957
+ static actionNotificationSuccess(translationService, action, functionName, customTitleKey, customMessageKey, viewContainer, item) {
2626
2958
  const actionSuccessTitle = I18nUtil.instantActionTranslation(translationService, action, 'success.title', customTitleKey, item, 'general.success', functionName) ?? undefined;
2627
2959
  const actionSuccessMessage = I18nUtil.instantActionTranslation(translationService, action, 'success.message', customMessageKey, item, 'general.successMessage', functionName) ?? undefined;
2628
- tableview?.messageService?.add({ severity: 'success', summary: actionSuccessTitle, detail: actionSuccessMessage });
2960
+ ToastUtil.notification(viewContainer, actionSuccessTitle, actionSuccessMessage);
2629
2961
  }
2630
- static actionNotificationError(translationService, action, error, functionName, tableview, item) {
2631
- const params = {};
2632
- if (error?.message) {
2633
- params.errorMessage = `: ${error.message}`;
2634
- }
2635
- else {
2636
- params.errorMessage = '.';
2637
- }
2962
+ static actionNotificationError(translationService, action, error, functionName, viewContainer, item) {
2963
+ const params = {
2964
+ errorMessage: I18nUtil.instantErrorI18nTranslation(translationService, error)
2965
+ };
2638
2966
  const actionErrorTitle = I18nUtil.instantActionTranslation(translationService, action, 'error.title', action.runNotificationErrorTitle, item, 'general.error', functionName, params) ??
2639
2967
  undefined;
2640
2968
  const actionErrorMessage = I18nUtil.instantActionTranslation(translationService, action, 'error.message', action.runNotificationErrorMessage, item, 'general.errorMessage', functionName, params) ?? undefined;
2641
- tableview?.messageService?.add({ severity: 'error', summary: actionErrorTitle, detail: actionErrorMessage });
2969
+ ToastUtil.notification(viewContainer, actionErrorTitle, actionErrorMessage, 'error');
2642
2970
  }
2643
2971
  static getFormEditorWarningMessage(translationService, title, message) {
2644
2972
  const actionErrorTitle = translationService.instant(title) ?? undefined;
@@ -3092,12 +3420,12 @@ MediusRestUtil.matchModeMapping = [
3092
3420
  ];
3093
3421
 
3094
3422
  class ActionExecContext {
3095
- constructor(dataProvider, serviceInstance, data, sourceComponent = null, tableview = null) {
3423
+ constructor(dataProvider, serviceInstance, data, sourceComponent = null, viewContainer = null) {
3096
3424
  this.dataProvider = dataProvider;
3097
3425
  this.serviceInstance = serviceInstance;
3098
3426
  this.data = data;
3099
3427
  this.sourceComponent = sourceComponent;
3100
- this.tableview = tableview;
3428
+ this.viewContainer = viewContainer;
3101
3429
  }
3102
3430
  }
3103
3431
  class ActionError {
@@ -3149,23 +3477,92 @@ class ActionTriggerResult {
3149
3477
  }
3150
3478
  }
3151
3479
 
3152
- class MngActionService {
3153
- constructor(injector, router, dialogService, confirmationService, translate) {
3480
+ const MNG_BROWSER_STORAGE_IT = new InjectionToken('Browser storage', {
3481
+ providedIn: 'root',
3482
+ factory: () => localStorage
3483
+ });
3484
+
3485
+ const ACTION_EDITOR_DIALOG_COMPONENT_SETTING = new InjectionToken('ACTION_EDITOR_DIALOG_COMPONENT_SETTING');
3486
+
3487
+ const MNG_MODULE_CONFIG_IT = new InjectionToken('MngModuleConfig');
3488
+
3489
+ class MngNavigationService {
3490
+ constructor(router, location) {
3491
+ this.router = router;
3492
+ this.location = location;
3493
+ this.history = [];
3494
+ this.router.events.subscribe(event => {
3495
+ if (event instanceof NavigationEnd) {
3496
+ this.history.push(event.urlAfterRedirects);
3497
+ }
3498
+ });
3499
+ }
3500
+ getCurrentLocation() {
3501
+ if (this.history.length > 0) {
3502
+ return this.history[this.history.length - 1];
3503
+ }
3504
+ else {
3505
+ return null;
3506
+ }
3507
+ }
3508
+ getPreviousLocation() {
3509
+ if (this.history.length > 1) {
3510
+ return this.history[this.history.length - 2];
3511
+ }
3512
+ else {
3513
+ return null;
3514
+ }
3515
+ }
3516
+ back() {
3517
+ this.history.pop();
3518
+ if (this.history.length > 0) {
3519
+ this.location.back();
3520
+ }
3521
+ else {
3522
+ this.router.navigateByUrl('/');
3523
+ }
3524
+ }
3525
+ }
3526
+ MngNavigationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngNavigationService, deps: [{ token: i1.Router }, { token: i4.Location }], target: i0.ɵɵFactoryTarget.Injectable });
3527
+ MngNavigationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngNavigationService });
3528
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngNavigationService, decorators: [{
3529
+ type: Injectable
3530
+ }], ctorParameters: function () { return [{ type: i1.Router }, { type: i4.Location }]; } });
3531
+
3532
+ class MngErrorMapperService {
3533
+ }
3534
+ class DefaultMngErrorMapperService extends MngErrorMapperService {
3535
+ toMngError(error, mngError) {
3536
+ if (!mngError) {
3537
+ mngError = {
3538
+ name: error?.name ?? 'UnknownError',
3539
+ message: error.message ?? 'Unknown error'
3540
+ };
3541
+ }
3542
+ return mngError;
3543
+ }
3544
+ }
3545
+
3546
+ class MngActionExecutorService {
3547
+ constructor(injector, router, dialogService, confirmationService, translate, navigationService, errorMapper, defaultEditorDialogComponent) {
3154
3548
  this.injector = injector;
3155
3549
  this.router = router;
3156
3550
  this.dialogService = dialogService;
3157
3551
  this.confirmationService = confirmationService;
3158
3552
  this.translate = translate;
3553
+ this.navigationService = navigationService;
3554
+ this.errorMapper = errorMapper;
3555
+ this.defaultEditorDialogComponent = defaultEditorDialogComponent;
3159
3556
  }
3160
- getActionExecContext(action, itemId, item, dataProvider, tableview, sourceComponent, actionData) {
3161
- return new ActionExecContext(dataProvider, this.getDataProviderService(dataProvider) ?? undefined, {
3557
+ prepareActionExecContext(action, itemId, item, dataProvider, viewContainer, sourceComponent, actionData) {
3558
+ return new ActionExecContext(dataProvider ?? action.dataProvider ?? viewContainer?.getDataProvider(), this.getDataProviderService(dataProvider) ?? undefined, {
3162
3559
  item,
3163
3560
  itemId,
3164
3561
  actionData
3165
- }, sourceComponent, tableview);
3562
+ }, sourceComponent, viewContainer);
3166
3563
  }
3167
- runAction(action, itemId, item, dataProvider, sourceComponent, tableview, actionData) {
3168
- const context = this.getActionExecContext(action, itemId, item, dataProvider, tableview, sourceComponent, actionData);
3564
+ runAction(action, itemId, item, dataProvider, sourceComponent, viewContainer, actionData) {
3565
+ const context = this.prepareActionExecContext(action, itemId, item, dataProvider, viewContainer, sourceComponent, actionData);
3169
3566
  if (action.hasRunConfirmation) {
3170
3567
  if (typeof sourceComponent?.getConfirmationService !== 'function' || typeof sourceComponent?.getConfirmationServiceInstanceKey !== 'function') {
3171
3568
  throw Error(`Source component ${sourceComponent} should be implementing IConfirmationService interface to be able to provide confirmation functionality.`);
@@ -3203,17 +3600,19 @@ class MngActionService {
3203
3600
  .runFunction(context)
3204
3601
  .pipe(first(), map(res => new ActionRunResult(context, res)), map(value => {
3205
3602
  if (action.hasRunNotificationSuccess) {
3206
- ToastUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, tableview, item);
3603
+ ToastUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, item);
3207
3604
  }
3208
3605
  return value;
3209
3606
  }), catchError(err => {
3607
+ const actionError = this.toMngActionError(err);
3210
3608
  if (action.hasRunNotificationError) {
3211
- ToastUtil.actionNotificationError(this.translate, action, err, 'run', tableview, item);
3609
+ ToastUtil.actionNotificationError(this.translate, action, actionError, 'run', viewContainer, item);
3212
3610
  }
3213
- throw err;
3611
+ throw actionError;
3214
3612
  }))
3215
3613
  .subscribe(res => {
3216
3614
  observer.next(res);
3615
+ observer.complete();
3217
3616
  });
3218
3617
  };
3219
3618
  confirmParams.reject = () => {
@@ -3226,14 +3625,15 @@ class MngActionService {
3226
3625
  else {
3227
3626
  return action.runFunction(context).pipe(map(res => new ActionRunResult(context, res)), map(value => {
3228
3627
  if (action.hasRunNotificationSuccess) {
3229
- ToastUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, tableview, item);
3628
+ ToastUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, item);
3230
3629
  }
3231
3630
  return value;
3232
3631
  }), catchError(err => {
3632
+ const actionError = this.toMngActionError(err);
3233
3633
  if (action.hasRunNotificationError) {
3234
- ToastUtil.actionNotificationError(this.translate, action, err, 'run', tableview, item);
3634
+ ToastUtil.actionNotificationError(this.translate, action, actionError, 'run', viewContainer, item);
3235
3635
  }
3236
- throw err;
3636
+ throw actionError;
3237
3637
  }));
3238
3638
  }
3239
3639
  }
@@ -3245,24 +3645,25 @@ class MngActionService {
3245
3645
  * @param formItem Item instance (from form).
3246
3646
  * @param dataProvider Data provider
3247
3647
  * @param sourceComponent Source component from where the fetch function was called.
3248
- * @param tableview Tableview component.
3648
+ * @param viewContainer View container/service.
3249
3649
  * @param actionData Additional action data.
3250
3650
  */
3251
- runEditorSave(action, itemId, formItem, dataProvider, sourceComponent, tableview, actionData) {
3252
- const context = this.prepareRunContextForEditor(formItem, itemId, dataProvider, sourceComponent, tableview, actionData);
3651
+ runEditorSave(action, itemId, formItem, dataProvider, sourceComponent, viewContainer, actionData) {
3652
+ const context = this.prepareExecContextForEditor(action, formItem, itemId, dataProvider, sourceComponent, viewContainer, actionData);
3253
3653
  if (typeof action.submitFunction !== 'function') {
3254
3654
  throw new Error(`Submit function for action ${action.actionName} cannot be invoked.`);
3255
3655
  }
3256
3656
  return action.submitFunction(context).pipe(map(res => new ActionRunResult(context, res)), map(value => {
3257
3657
  if (action.hasRunNotificationSuccess) {
3258
- ToastUtil.actionNotificationSuccess(this.translate, action, 'submit', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, tableview, formItem);
3658
+ ToastUtil.actionNotificationSuccess(this.translate, action, 'submit', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, formItem);
3259
3659
  }
3260
3660
  return value;
3261
3661
  }), catchError(err => {
3662
+ const actionError = this.toMngActionError(err);
3262
3663
  if (action.hasRunNotificationError) {
3263
- ToastUtil.actionNotificationError(this.translate, action, err, 'submit', tableview, formItem);
3664
+ ToastUtil.actionNotificationError(this.translate, action, actionError, 'submit', viewContainer, formItem);
3264
3665
  }
3265
- throw err;
3666
+ throw actionError;
3266
3667
  }));
3267
3668
  }
3268
3669
  /**
@@ -3272,30 +3673,40 @@ class MngActionService {
3272
3673
  * @param itemId Item id.
3273
3674
  * @param dataProvider Data provider
3274
3675
  * @param sourceComponent Source component from where the fetch function was called.
3275
- * @param tableview Tableview component.
3676
+ * @param viewContainer View container/service. Tableview component.
3276
3677
  * @param actionData Additional action data.
3277
3678
  */
3278
- runEditorFetch(action, itemId, dataProvider, sourceComponent, tableview, actionData) {
3279
- const context = this.prepareRunContextForEditor(undefined, itemId, dataProvider, sourceComponent, tableview, actionData);
3679
+ runEditorFetch(action, itemId, dataProvider, sourceComponent, viewContainer, actionData) {
3680
+ const context = this.prepareExecContextForEditor(action, undefined, itemId, dataProvider, sourceComponent, viewContainer, actionData);
3280
3681
  return action.fetchFunction(context).pipe(map(res => new ActionRunResult(context, res)));
3281
3682
  // TODO: error handling
3282
3683
  }
3283
3684
  /**
3284
- * Prepares action run context for action of type editor.
3685
+ * Prepares action exec context for action of type editor.
3285
3686
  *
3286
3687
  * @param item Item instance (if exists).
3287
3688
  * @param itemId Item id (if exists).
3288
3689
  * @param dataProvider Data provider.
3289
3690
  * @param sourceComponent Source component from where the context preparation was called.
3290
- * @param tableview Tableview component.
3691
+ * @param viewContainer View container/service.
3291
3692
  * @param actionData Additional action data.
3292
3693
  */
3293
- prepareRunContextForEditor(item, itemId, dataProvider, sourceComponent, tableview, actionData) {
3294
- const context = new ActionExecContext(dataProvider, this.getDataProviderService(dataProvider) ?? undefined, {
3694
+ prepareExecContextForEditor(action, item, itemId, dataProvider, sourceComponent, viewContainer, actionData) {
3695
+ let ctxDataProvider = dataProvider;
3696
+ if (!ctxDataProvider && action.dataProvider) {
3697
+ ctxDataProvider = action.dataProvider;
3698
+ }
3699
+ if (!ctxDataProvider) {
3700
+ const viewContainerDataProvider = viewContainer?.getDataProvider();
3701
+ if (viewContainerDataProvider) {
3702
+ ctxDataProvider = action.dataProvider;
3703
+ }
3704
+ }
3705
+ const context = new ActionExecContext(ctxDataProvider, this.getDataProviderService(ctxDataProvider) ?? undefined, {
3295
3706
  item,
3296
3707
  itemId,
3297
3708
  actionData
3298
- }, sourceComponent, tableview);
3709
+ }, sourceComponent, viewContainer);
3299
3710
  return context;
3300
3711
  }
3301
3712
  /**
@@ -3318,11 +3729,15 @@ class MngActionService {
3318
3729
  * @param item Item instance (if exists).
3319
3730
  * @param itemId Item id (if exists).
3320
3731
  * @param actionData Optional additional action data.
3321
- * @param tableview Tableview component.
3732
+ * @param viewContainer View container component/service.
3322
3733
  * @param sourceComponent Source activation component.
3323
3734
  */
3324
- activateAction(action, itemId, item, actionData, tableview, sourceComponent) {
3735
+ activateAction(action, itemId, item, actionData, viewContainer, sourceComponent) {
3325
3736
  if (action.type === ActionTypeEnum.Editor) {
3737
+ let dialogComponent = this.defaultEditorDialogComponent;
3738
+ if (action instanceof ActionEditorDescriptor && action.editorComponent) {
3739
+ dialogComponent = action.editorComponent;
3740
+ }
3326
3741
  const dialogConfig = {
3327
3742
  data: {
3328
3743
  action
@@ -3338,18 +3753,22 @@ class MngActionService {
3338
3753
  if (actionData) {
3339
3754
  dialogConfig.data.actionData = actionData;
3340
3755
  }
3341
- if (tableview) {
3342
- dialogConfig.data.tableview = tableview;
3756
+ if (viewContainer) {
3757
+ dialogConfig.data.viewContainer = viewContainer;
3343
3758
  }
3344
3759
  if (sourceComponent) {
3345
3760
  dialogConfig.data.sourceComponent = sourceComponent;
3346
3761
  }
3347
- const dialogRef = this.dialogService.open(MngActionDialogComponent, dialogConfig);
3762
+ const dialogRef = this.dialogService.open(dialogComponent, dialogConfig);
3348
3763
  return of(new ActionActivationResult(undefined, dialogRef));
3349
3764
  }
3765
+ else if (action.type === ActionTypeEnum.Event) {
3766
+ // just emit event
3767
+ return of(new ActionActivationResult(undefined));
3768
+ }
3350
3769
  else {
3351
3770
  // directly execute action
3352
- return this.runAction(action, itemId, item, tableview?.dataProvider ?? undefined, sourceComponent, tableview, actionData).pipe(map(res => new ActionActivationResult(res)));
3771
+ return this.runAction(action, itemId, item, undefined, sourceComponent, viewContainer, actionData).pipe(map(res => new ActionActivationResult(res)));
3353
3772
  }
3354
3773
  }
3355
3774
  /**
@@ -3373,7 +3792,7 @@ class MngActionService {
3373
3792
  * @param actionData Optional action data.
3374
3793
  * @param route Optional activated route.
3375
3794
  */
3376
- triggerAction(action, itemId, item, actionData, route, tableview, sourceComponent) {
3795
+ triggerAction(action, itemId, item, actionData, route, viewContainer, sourceComponent) {
3377
3796
  if (action.activationTrigger === ActionActivationTriggerEnum.OnRoute) {
3378
3797
  const baseUrl = this.router.url.split('?')[0];
3379
3798
  const parsedUrl = this.router.parseUrl(this.router.url);
@@ -3400,15 +3819,57 @@ class MngActionService {
3400
3819
  return of(new ActionTriggerResult(undefined, from(this.router.navigate([baseUrl, ...actionUrlSegments], { relativeTo: route, queryParams: parsedUrl.queryParams }))));
3401
3820
  }
3402
3821
  else {
3403
- return this.activateAction(action, itemId, item, actionData, tableview, sourceComponent).pipe(map(res => new ActionTriggerResult(res)));
3822
+ return this.activateAction(action, itemId, item, actionData, viewContainer, sourceComponent).pipe(map(res => new ActionTriggerResult(res)));
3823
+ }
3824
+ }
3825
+ deactivateAction(action) {
3826
+ if (this.navigationService.getPreviousLocation()) {
3827
+ // there are internal history records, so back can be normally called
3828
+ this.navigationService.back();
3829
+ }
3830
+ else {
3831
+ // there is no internal history records, figure out the base url by eliminating action specific url
3832
+ let url = this.navigationService.getCurrentLocation();
3833
+ if (!url) {
3834
+ this.navigationService.back();
3835
+ }
3836
+ else {
3837
+ if (url.startsWith('/')) {
3838
+ url = url.substring(1);
3839
+ }
3840
+ const urlPathSegments = url.split('?')[0].split('#')[0].split('/');
3841
+ let actionUrl = action?.routeUrl ?? '';
3842
+ if (actionUrl.startsWith('/')) {
3843
+ actionUrl = actionUrl.substring(1);
3844
+ }
3845
+ const actionUrlSegments = actionUrl.split('/');
3846
+ const redirectUrl = urlPathSegments.slice(0, urlPathSegments.length - actionUrlSegments.length).join('/');
3847
+ this.router.navigateByUrl(`/${redirectUrl}`, { replaceUrl: true });
3848
+ }
3849
+ }
3850
+ }
3851
+ toMngActionError(error) {
3852
+ const actionError = {
3853
+ name: error?.name ?? 'UnknownError',
3854
+ message: error?.message ?? 'Unknown error',
3855
+ cause: error
3856
+ };
3857
+ if (error instanceof HttpErrorResponse) {
3858
+ actionError.status = error.status;
3859
+ actionError.statusDescription = error.statusText;
3860
+ actionError.url = error.url ?? undefined;
3404
3861
  }
3862
+ return this.errorMapper.toMngError(error, actionError);
3405
3863
  }
3406
3864
  }
3407
- MngActionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionService, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i2.DialogService }, { token: i2$1.ConfirmationService }, { token: i2$2.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
3408
- MngActionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionService });
3409
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionService, decorators: [{
3865
+ MngActionExecutorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionExecutorService, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i3.DialogService }, { token: i2.ConfirmationService }, { token: i3$1.TranslateService }, { token: MngNavigationService }, { token: MngErrorMapperService }, { token: ACTION_EDITOR_DIALOG_COMPONENT_SETTING }], target: i0.ɵɵFactoryTarget.Injectable });
3866
+ MngActionExecutorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionExecutorService });
3867
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionExecutorService, decorators: [{
3410
3868
  type: Injectable
3411
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i2.DialogService }, { type: i2$1.ConfirmationService }, { type: i2$2.TranslateService }]; } });
3869
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i3.DialogService }, { type: i2.ConfirmationService }, { type: i3$1.TranslateService }, { type: MngNavigationService }, { type: MngErrorMapperService }, { type: i0.Type, decorators: [{
3870
+ type: Inject,
3871
+ args: [ACTION_EDITOR_DIALOG_COMPONENT_SETTING]
3872
+ }] }]; } });
3412
3873
 
3413
3874
  class MngConfigurationService {
3414
3875
  constructor(http) {
@@ -3486,13 +3947,6 @@ class MngConfigurationService {
3486
3947
  }
3487
3948
  MngConfigurationService._instance = null;
3488
3949
 
3489
- const MNG_BROWSER_STORAGE_IT = new InjectionToken('Browser storage', {
3490
- providedIn: 'root',
3491
- factory: () => localStorage
3492
- });
3493
-
3494
- const MNG_MODULE_CONFIG_IT = new InjectionToken('MngModuleConfig');
3495
-
3496
3950
  class MngCommonsService {
3497
3951
  constructor(router, primengConfig, translate, titleService, configurationService, moduleConfig, localStorage) {
3498
3952
  this.router = router;
@@ -3815,11 +4269,11 @@ class MngCommonsService {
3815
4269
  return titlePieces.join(' - ');
3816
4270
  }
3817
4271
  }
3818
- MngCommonsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService, deps: [{ token: i1.Router }, { token: i2$1.PrimeNGConfig }, { token: i2$2.TranslateService }, { token: i4.Title }, { token: MngConfigurationService }, { token: MNG_MODULE_CONFIG_IT }, { token: MNG_BROWSER_STORAGE_IT }], target: i0.ɵɵFactoryTarget.Injectable });
4272
+ MngCommonsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService, deps: [{ token: i1.Router }, { token: i2.PrimeNGConfig }, { token: i3$1.TranslateService }, { token: i4$1.Title }, { token: MngConfigurationService }, { token: MNG_MODULE_CONFIG_IT }, { token: MNG_BROWSER_STORAGE_IT }], target: i0.ɵɵFactoryTarget.Injectable });
3819
4273
  MngCommonsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService });
3820
4274
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService, decorators: [{
3821
4275
  type: Injectable
3822
- }], ctorParameters: function () { return [{ type: i1.Router }, { type: i2$1.PrimeNGConfig }, { type: i2$2.TranslateService }, { type: i4.Title }, { type: MngConfigurationService }, { type: undefined, decorators: [{
4276
+ }], ctorParameters: function () { return [{ type: i1.Router }, { type: i2.PrimeNGConfig }, { type: i3$1.TranslateService }, { type: i4$1.Title }, { type: MngConfigurationService }, { type: undefined, decorators: [{
3823
4277
  type: Inject,
3824
4278
  args: [MNG_MODULE_CONFIG_IT]
3825
4279
  }] }, { type: Storage, decorators: [{
@@ -3827,81 +4281,55 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
3827
4281
  args: [MNG_BROWSER_STORAGE_IT]
3828
4282
  }] }]; } });
3829
4283
 
3830
- class MngNavigationService {
3831
- constructor(router, location) {
3832
- this.router = router;
3833
- this.location = location;
3834
- this.history = [];
3835
- this.router.events.subscribe(event => {
3836
- if (event instanceof NavigationEnd) {
3837
- this.history.push(event.urlAfterRedirects);
3838
- }
3839
- });
3840
- }
3841
- getCurrentLocation() {
3842
- if (this.history.length > 0) {
3843
- return this.history[this.history.length - 1];
3844
- }
3845
- else {
3846
- return null;
3847
- }
3848
- }
3849
- getPreviousLocation() {
3850
- if (this.history.length > 1) {
3851
- return this.history[this.history.length - 2];
3852
- }
3853
- else {
3854
- return null;
3855
- }
3856
- }
3857
- back() {
3858
- this.history.pop();
3859
- if (this.history.length > 0) {
3860
- this.location.back();
3861
- }
3862
- else {
3863
- this.router.navigateByUrl('/');
3864
- }
3865
- }
3866
- }
3867
- MngNavigationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngNavigationService, deps: [{ token: i1.Router }, { token: i4$1.Location }], target: i0.ɵɵFactoryTarget.Injectable });
3868
- MngNavigationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngNavigationService });
3869
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngNavigationService, decorators: [{
3870
- type: Injectable
3871
- }], ctorParameters: function () { return [{ type: i1.Router }, { type: i4$1.Location }]; } });
3872
-
3873
- class TableviewComponentService {
3874
- constructor() {
4284
+ /**
4285
+ * Should be used with providers defined within component.
4286
+ */
4287
+ class MngViewContainerComponentService {
4288
+ constructor(messageService) {
4289
+ this.messageService = messageService;
3875
4290
  this.actions = [];
3876
4291
  this._reloadTableSubject = new Subject();
3877
4292
  }
4293
+ set dataProvider(dataProvider) {
4294
+ this._dataProvider = dataProvider;
4295
+ }
3878
4296
  get reloadTable$() {
3879
4297
  return this._reloadTableSubject.asObservable();
3880
4298
  }
3881
4299
  triggerTableReload(event) {
3882
4300
  this._reloadTableSubject.next(event);
3883
4301
  }
4302
+ getMessageService() {
4303
+ return this.messageService;
4304
+ }
4305
+ getDataProvider() {
4306
+ return this._dataProvider;
4307
+ }
3884
4308
  }
3885
- TableviewComponentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: TableviewComponentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3886
- TableviewComponentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: TableviewComponentService });
3887
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: TableviewComponentService, decorators: [{
4309
+ MngViewContainerComponentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngViewContainerComponentService, deps: [{ token: i2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
4310
+ MngViewContainerComponentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngViewContainerComponentService });
4311
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngViewContainerComponentService, decorators: [{
3888
4312
  type: Injectable
3889
- }] });
4313
+ }], ctorParameters: function () { return [{ type: i2.MessageService }]; } });
3890
4314
 
3891
4315
  class MngActionComponent {
3892
- constructor(route, translate, actionService, confirmationService, tableviewService) {
4316
+ constructor(route, translate, actionExecutor, confirmationService, viewContainerService) {
3893
4317
  this.route = route;
3894
4318
  this.translate = translate;
3895
- this.actionService = actionService;
4319
+ this.actionExecutor = actionExecutor;
3896
4320
  this.confirmationService = confirmationService;
3897
- this.tableviewService = tableviewService;
4321
+ this.viewContainerService = viewContainerService;
4322
+ this.inputDisabled = of(false);
4323
+ this.inputLoading = of(false);
4324
+ this.triggerEventEmitter = new EventEmitter();
3898
4325
  this.loadingSubject = new ReplaySubject(1);
3899
4326
  this.$loading = this.loadingSubject.asObservable();
3900
4327
  this.cmpId = Math.random().toString(36).substring(2);
3901
4328
  this.loadingSubject.next(false);
3902
4329
  }
3903
4330
  ngOnInit() {
3904
- const context = this.actionService.getActionExecContext(this.action, this.itemId, this.item, this.tableviewService?.dataProvider ?? undefined, this.tableviewService, this, this.actionData);
4331
+ this.viewContainer = this.viewContainerInit ?? this.viewContainerService ?? undefined;
4332
+ const context = this.actionExecutor.prepareActionExecContext(this.action, this.itemId, this.item, this.dataProvider, this.viewContainer ?? undefined, this, this.actionData);
3905
4333
  this.$isVisible = typeof this.action.isVisibleFunction === 'function' ? this.action.isVisibleFunction(context) : of(true);
3906
4334
  this.$isEnabled = typeof this.action.isEnabledFunction === 'function' ? this.action.isEnabledFunction(context) : of(true);
3907
4335
  this.$label = I18nUtil.streamActionTranslation(this.translate, this.action, 'title', this.action?.title ?? undefined, this.item);
@@ -3912,11 +4340,19 @@ class MngActionComponent {
3912
4340
  this.loadingSubject.next(true);
3913
4341
  const actionData = this.actionData ? this.actionData : {};
3914
4342
  actionData['cmpId'] = this.cmpId;
3915
- this.actionService
3916
- .triggerAction(this.action, this.itemId, this.item, actionData, this.route, this.tableviewService, this)
3917
- .pipe(first(), finalize(() => this.loadingSubject.next(false)))
3918
- // eslint-disable-next-line @typescript-eslint/no-empty-function
3919
- .subscribe(() => { });
4343
+ this.actionExecutor
4344
+ .triggerAction(this.action, this.itemId, this.item, actionData, this.route, this.viewContainer, this)
4345
+ .pipe(first())
4346
+ .subscribe({
4347
+ next: atr => {
4348
+ this.triggerEventEmitter.next(atr);
4349
+ this.loadingSubject.next(false);
4350
+ },
4351
+ error: err => {
4352
+ console.error(`Error occurred while executing action ${this.action.actionName}.`, err);
4353
+ this.loadingSubject.next(false);
4354
+ }
4355
+ });
3920
4356
  }
3921
4357
  getConfirmationService() {
3922
4358
  return this.confirmationService;
@@ -3925,12 +4361,14 @@ class MngActionComponent {
3925
4361
  return `${action.actionName}_${this.cmpId}`;
3926
4362
  }
3927
4363
  }
3928
- MngActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2$2.TranslateService }, { token: MngActionService }, { token: i2$1.ConfirmationService }, { token: TableviewComponentService }], target: i0.ɵɵFactoryTarget.Component });
3929
- 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" }, providers: [MessageService, ConfirmationService], ngImport: i0, template: "<ng-container *ngIf=\"$isVisible | async\">\n <button\n *ngIf=\"action.icon && action.title === null; else noIcon\"\n type=\"button\"\n pButton\n pRipple\n [icon]=\"action.icon\"\n [loading]=\"($loading | async) ?? false\"\n [disabled]=\"($isEnabled | async) === false\"\n [pTooltip]=\"$any($tooltip | async)\"\n (click)=\"triggerAction($event)\"\n class=\"mng-action-button mng-action-button-icon p-button-rounded\"\n [class.p-button-primary]=\"action.level === 1\"\n [class.p-button-success]=\"action.level === 5\"\n [class.p-button-danger]=\"action.level === 7\"></button>\n <ng-template #noIcon>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [label]=\"($label | async) ?? ''\"\n [loading]=\"($loading | async) ?? false\"\n [disabled]=\"($isEnabled | async) === false\"\n [pTooltip]=\"$any($tooltip | async)\"\n (click)=\"triggerAction($event)\"\n class=\"mng-action-button p-button-text\"\n [class.p-button-primary]=\"action.level === 1\"\n [class.p-button-success]=\"action.level === 5\"\n [class.p-button-danger]=\"action.level === 7\"></button>\n </ng-template>\n <p-confirmDialog *ngIf=\"action.hasRunConfirmation\" [key]=\"action.actionName + '_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n</ng-container>\n", components: [{ type: i6.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$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i9.Ripple, selector: "[pRipple]" }, { type: i10.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }], pipes: { "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4364
+ MngActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionComponent, deps: [{ token: i1.ActivatedRoute }, { token: i3$1.TranslateService }, { token: MngActionExecutorService }, { token: i2.ConfirmationService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
4365
+ 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" }, providers: [ConfirmationService], ngImport: i0, template: "<ng-container *ngIf=\"$isVisible | async\">\n <button\n *ngIf=\"action.icon && action.title === null; else noIcon\"\n type=\"button\"\n pButton\n pRipple\n [icon]=\"action.icon\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false && ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n (click)=\"triggerAction($event)\"\n class=\"mng-action-button mng-action-button-icon p-button-rounded\"\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-primary]=\"action.level === 1\"\n [class.p-button-success]=\"action.level === 5\"\n [class.p-button-danger]=\"action.level === 7\"></button>\n <ng-template #noIcon>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [label]=\"($label | async) ?? ''\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false && ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n (click)=\"triggerAction($event)\"\n class=\"mng-action-button p-button-text\"\n [class.p-button-sm]=\"action.isSizeSmall\"\n [class.p-button-lg]=\"action.isSizeLarge\"\n [class.p-button-primary]=\"action.level === 1\"\n [class.p-button-success]=\"action.level === 5\"\n [class.p-button-danger]=\"action.level === 7\"></button>\n </ng-template>\n <p-confirmDialog *ngIf=\"action.hasRunConfirmation\" [key]=\"action.actionName + '_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n</ng-container>\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: i9.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3930
4366
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionComponent, decorators: [{
3931
4367
  type: Component,
3932
- args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [MessageService, ConfirmationService], template: "<ng-container *ngIf=\"$isVisible | async\">\n <button\n *ngIf=\"action.icon && action.title === null; else noIcon\"\n type=\"button\"\n pButton\n pRipple\n [icon]=\"action.icon\"\n [loading]=\"($loading | async) ?? false\"\n [disabled]=\"($isEnabled | async) === false\"\n [pTooltip]=\"$any($tooltip | async)\"\n (click)=\"triggerAction($event)\"\n class=\"mng-action-button mng-action-button-icon p-button-rounded\"\n [class.p-button-primary]=\"action.level === 1\"\n [class.p-button-success]=\"action.level === 5\"\n [class.p-button-danger]=\"action.level === 7\"></button>\n <ng-template #noIcon>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [label]=\"($label | async) ?? ''\"\n [loading]=\"($loading | async) ?? false\"\n [disabled]=\"($isEnabled | async) === false\"\n [pTooltip]=\"$any($tooltip | async)\"\n (click)=\"triggerAction($event)\"\n class=\"mng-action-button p-button-text\"\n [class.p-button-primary]=\"action.level === 1\"\n [class.p-button-success]=\"action.level === 5\"\n [class.p-button-danger]=\"action.level === 7\"></button>\n </ng-template>\n <p-confirmDialog *ngIf=\"action.hasRunConfirmation\" [key]=\"action.actionName + '_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n</ng-container>\n" }]
3933
- }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i2$2.TranslateService }, { type: MngActionService }, { type: i2$1.ConfirmationService }, { type: TableviewComponentService }]; }, propDecorators: { action: [{
4368
+ args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfirmationService], template: "<ng-container *ngIf=\"$isVisible | async\">\n <button\n *ngIf=\"action.icon && action.title === null; else noIcon\"\n type=\"button\"\n pButton\n pRipple\n [icon]=\"action.icon\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false && ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n (click)=\"triggerAction($event)\"\n class=\"mng-action-button mng-action-button-icon p-button-rounded\"\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-primary]=\"action.level === 1\"\n [class.p-button-success]=\"action.level === 5\"\n [class.p-button-danger]=\"action.level === 7\"></button>\n <ng-template #noIcon>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [label]=\"($label | async) ?? ''\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false && ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n (click)=\"triggerAction($event)\"\n class=\"mng-action-button p-button-text\"\n [class.p-button-sm]=\"action.isSizeSmall\"\n [class.p-button-lg]=\"action.isSizeLarge\"\n [class.p-button-primary]=\"action.level === 1\"\n [class.p-button-success]=\"action.level === 5\"\n [class.p-button-danger]=\"action.level === 7\"></button>\n </ng-template>\n <p-confirmDialog *ngIf=\"action.hasRunConfirmation\" [key]=\"action.actionName + '_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n</ng-container>\n" }]
4369
+ }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i3$1.TranslateService }, { type: MngActionExecutorService }, { type: i2.ConfirmationService }, { type: MngViewContainerComponentService, decorators: [{
4370
+ type: Optional
4371
+ }] }]; }, propDecorators: { action: [{
3934
4372
  type: Input
3935
4373
  }], item: [{
3936
4374
  type: Input
@@ -3938,22 +4376,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
3938
4376
  type: Input
3939
4377
  }], actionData: [{
3940
4378
  type: Input
4379
+ }], dataProvider: [{
4380
+ type: Input
4381
+ }], inputDisabled: [{
4382
+ type: Input,
4383
+ args: ['disabled']
4384
+ }], inputLoading: [{
4385
+ type: Input,
4386
+ args: ['loading']
4387
+ }], viewContainerInit: [{
4388
+ type: Input,
4389
+ args: ['viewContainer']
4390
+ }], triggerEventEmitter: [{
4391
+ type: Output,
4392
+ args: ['trigger']
3941
4393
  }] } });
3942
4394
 
3943
4395
  class MngActionRouteComponent {
3944
- constructor(router, route, confirmationService, navigationService, actionService, tableviewService) {
4396
+ constructor(router, route, confirmationService, navigationService, actionExecutor, viewContainerService) {
3945
4397
  this.router = router;
3946
4398
  this.route = route;
3947
4399
  this.confirmationService = confirmationService;
3948
4400
  this.navigationService = navigationService;
3949
- this.actionService = actionService;
3950
- this.tableviewService = tableviewService;
4401
+ this.actionExecutor = actionExecutor;
4402
+ this.viewContainerService = viewContainerService;
3951
4403
  this.cmpId = Math.random().toString(36).substring(2);
3952
4404
  this.actions = [];
3953
4405
  this.subscriptions = [];
3954
4406
  }
3955
4407
  ngOnInit() {
3956
- this.actions = this.tableviewService?.actions.filter(a => a.activationTrigger === ActionActivationTriggerEnum.OnRoute) ?? [];
4408
+ this.actions = this.viewContainerService?.actions.filter(a => a.activationTrigger === ActionActivationTriggerEnum.OnRoute) ?? [];
3957
4409
  const subscription = this.route.params.subscribe(p => {
3958
4410
  const action = this.findActiveAction(p);
3959
4411
  if (action) {
@@ -3988,8 +4440,8 @@ class MngActionRouteComponent {
3988
4440
  for (const key in qp) {
3989
4441
  actionData[key] = p[key];
3990
4442
  }
3991
- this.actionService
3992
- .activateAction(action, itemId, undefined, actionData, this.tableviewService, this)
4443
+ this.actionExecutor
4444
+ .activateAction(action, itemId, undefined, actionData, this.viewContainerService ?? undefined, this)
3993
4445
  .pipe(first())
3994
4446
  .subscribe(res => {
3995
4447
  if (res.dialogRef) {
@@ -3997,7 +4449,10 @@ class MngActionRouteComponent {
3997
4449
  this.dialogCloseSubscription = this.dialogRef?.onClose.subscribe(e => {
3998
4450
  const actionEv = e;
3999
4451
  if (!actionEv?.error || !actionEv?.error?.dismissed) {
4000
- this.tableviewService.triggerTableReload(actionEv); // reload only if no error in action and
4452
+ if (!this.viewContainerService) {
4453
+ console.warn(`View container service could not be found, table reload will not be triggered.`);
4454
+ }
4455
+ this.viewContainerService?.triggerTableReload(actionEv); // reload only if no error in action and
4001
4456
  }
4002
4457
  this.deactivateAction();
4003
4458
  });
@@ -4009,30 +4464,7 @@ class MngActionRouteComponent {
4009
4464
  this.dialogCloseSubscription.unsubscribe();
4010
4465
  this.dialogCloseSubscription = undefined;
4011
4466
  }
4012
- if (this.navigationService.getPreviousLocation()) {
4013
- // there are internal history records, so back can be normally called
4014
- this.navigationService.back();
4015
- }
4016
- else {
4017
- // there is no internal history records, figure out the base url by eliminating action specific url
4018
- let url = this.navigationService.getCurrentLocation();
4019
- if (!url) {
4020
- this.navigationService.back();
4021
- }
4022
- else {
4023
- if (url.startsWith('/')) {
4024
- url = url.substring(1);
4025
- }
4026
- const urlPathSegments = url.split('?')[0].split('#')[0].split('/');
4027
- let actionUrl = this.activeAction?.routeUrl ?? '';
4028
- if (actionUrl.startsWith('/')) {
4029
- actionUrl = actionUrl.substring(1);
4030
- }
4031
- const actionUrlSegments = actionUrl.split('/');
4032
- const redirectUrl = urlPathSegments.slice(0, urlPathSegments.length - actionUrlSegments.length).join('/');
4033
- this.router.navigateByUrl(`/${redirectUrl}`, { replaceUrl: true });
4034
- }
4035
- }
4467
+ this.actionExecutor.deactivateAction(this.activeAction);
4036
4468
  this.activeAction = undefined;
4037
4469
  this.dialogRef = undefined;
4038
4470
  }
@@ -4069,24 +4501,28 @@ class MngActionRouteComponent {
4069
4501
  return null;
4070
4502
  }
4071
4503
  }
4072
- MngActionRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionRouteComponent, deps: [{ token: i1.Router }, { token: i1.ActivatedRoute }, { token: i2$1.ConfirmationService }, { token: MngNavigationService }, { token: MngActionService }, { token: TableviewComponentService }], target: i0.ɵɵFactoryTarget.Component });
4073
- MngActionRouteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngActionRouteComponent, selector: "mng-action-route", providers: [MessageService, ConfirmationService], ngImport: i0, template: "<p-confirmDialog [key]=\"'actionRoute_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n", components: [{ type: i6.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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4504
+ MngActionRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionRouteComponent, deps: [{ token: i1.Router }, { token: i1.ActivatedRoute }, { token: i2.ConfirmationService }, { token: MngNavigationService }, { token: MngActionExecutorService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
4505
+ MngActionRouteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngActionRouteComponent, selector: "mng-action-route", providers: [MessageService, ConfirmationService], ngImport: i0, template: "<p-confirmDialog [key]=\"'actionRoute_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4074
4506
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionRouteComponent, decorators: [{
4075
4507
  type: Component,
4076
4508
  args: [{ selector: 'mng-action-route', changeDetection: ChangeDetectionStrategy.OnPush, providers: [MessageService, ConfirmationService], template: "<p-confirmDialog [key]=\"'actionRoute_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n" }]
4077
- }], ctorParameters: function () { return [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2$1.ConfirmationService }, { type: MngNavigationService }, { type: MngActionService }, { type: TableviewComponentService }]; } });
4509
+ }], ctorParameters: function () { return [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2.ConfirmationService }, { type: MngNavigationService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService, decorators: [{
4510
+ type: Optional
4511
+ }] }]; } });
4078
4512
 
4079
4513
  class MngComponentDirective {
4080
4514
  constructor(viewContainerRef) {
4081
4515
  this.viewContainerRef = viewContainerRef;
4516
+ this.componentInstanceEventEmitter = new EventEmitter();
4082
4517
  }
4083
4518
  ngOnInit() {
4084
4519
  this.viewContainerRef.clear();
4085
4520
  this.componentRef = this.viewContainerRef.createComponent(this.component);
4521
+ this.componentInstanceEventEmitter.next(this.componentRef.instance);
4086
4522
  }
4087
4523
  }
4088
4524
  MngComponentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngComponentDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
4089
- MngComponentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: MngComponentDirective, selector: "[mngComponent]", inputs: { component: ["mngComponent", "component"] }, ngImport: i0 });
4525
+ MngComponentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: MngComponentDirective, selector: "[mngComponent]", inputs: { component: ["mngComponent", "component"] }, outputs: { componentInstanceEventEmitter: "instanceCreated" }, ngImport: i0 });
4090
4526
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngComponentDirective, decorators: [{
4091
4527
  type: Directive,
4092
4528
  args: [{
@@ -4095,6 +4531,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4095
4531
  }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { component: [{
4096
4532
  type: Input,
4097
4533
  args: ['mngComponent']
4534
+ }], componentInstanceEventEmitter: [{
4535
+ type: Output,
4536
+ args: ['instanceCreated']
4098
4537
  }] } });
4099
4538
 
4100
4539
  class MngTemplateDirective {
@@ -4123,13 +4562,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4123
4562
  args: ['mngTemplate']
4124
4563
  }] } });
4125
4564
 
4126
- class MngFormEditorSubmitEvent {
4127
- constructor(formItem) {
4128
- this.formItem = formItem;
4129
- this.success = true;
4130
- }
4131
- }
4132
-
4133
4565
  class MngFormEditorComponent {
4134
4566
  constructor(translateService) {
4135
4567
  this.translateService = translateService;
@@ -4152,7 +4584,7 @@ class MngFormEditorComponent {
4152
4584
  this.subscriptions = [];
4153
4585
  }
4154
4586
  ngOnInit() {
4155
- this.updateFormModel(this.item);
4587
+ this.resetFormModel(this.item);
4156
4588
  this.submitLoading$ = this.submitLoading instanceof Observable ? this.submitLoading : of(this.submitLoading);
4157
4589
  // init fields for formly
4158
4590
  this.formFields = EditorFormlyUtil.createFormlyConfigFromDescriptor(this.descriptor);
@@ -4195,6 +4627,58 @@ class MngFormEditorComponent {
4195
4627
  });
4196
4628
  return formValue;
4197
4629
  }
4630
+ getFormField(key) {
4631
+ return this.findFormField(this.form, key.split('.'));
4632
+ }
4633
+ setFormFieldValue(key, value) {
4634
+ const control = this.getFormField(key);
4635
+ if (control) {
4636
+ control.setValue(value);
4637
+ }
4638
+ else {
4639
+ console.warn(`Value was not set, because field ${key} was not found.`);
4640
+ }
4641
+ }
4642
+ patchFormFieldValue(key, value) {
4643
+ const control = this.getFormField(key);
4644
+ if (control) {
4645
+ control.patchValue(value);
4646
+ }
4647
+ else {
4648
+ console.warn(`Value was not set, because field ${key} was not found.`);
4649
+ }
4650
+ }
4651
+ resetFormFieldValue(key, value) {
4652
+ const control = this.getFormField(key);
4653
+ if (control) {
4654
+ control.reset(value);
4655
+ }
4656
+ else {
4657
+ console.warn(`Value was not set, because field ${key} was not found.`);
4658
+ }
4659
+ }
4660
+ findFormField(control, keyPath) {
4661
+ if (keyPath.length === 0) {
4662
+ return control;
4663
+ }
4664
+ if (keyPath.length === 1) {
4665
+ return control.get(keyPath[0]);
4666
+ }
4667
+ let nextControl = null;
4668
+ if (control instanceof FormGroup) {
4669
+ nextControl = control.get(keyPath[0]);
4670
+ }
4671
+ else if (control instanceof FormArray) {
4672
+ const idx = +keyPath[0];
4673
+ if (!isNaN(idx)) {
4674
+ nextControl = control.at(idx);
4675
+ }
4676
+ }
4677
+ if (!control) {
4678
+ return null;
4679
+ }
4680
+ return this.findFormField(nextControl, keyPath.slice(1));
4681
+ }
4198
4682
  isAnyFieldInvalid(fields = []) {
4199
4683
  for (const field of fields) {
4200
4684
  let fieldInvalid = false;
@@ -4210,7 +4694,7 @@ class MngFormEditorComponent {
4210
4694
  }
4211
4695
  return false;
4212
4696
  }
4213
- updateFormModel(item) {
4697
+ resetFormModel(item) {
4214
4698
  this.formOrigItem = item;
4215
4699
  // TODO: to check if this is ok, could be problems with dates, if so, try lodash
4216
4700
  const formModel = JSON.parse(JSON.stringify(item ?? {}));
@@ -4229,12 +4713,12 @@ class MngFormEditorComponent {
4229
4713
  this.formOptions.formState.disabled = this.isFormDisabled !== null ? this.isFormDisabled === true : this.descriptor.disabled;
4230
4714
  }
4231
4715
  }
4232
- MngFormEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormEditorComponent, deps: [{ token: i2$2.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
4233
- MngFormEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormEditorComponent, selector: "mng-form-editor", inputs: { descriptor: "descriptor", submitLoading: "submitLoading", item: "item", isSubmitButtonVisible: "isSubmitButtonVisible", isFormDisabled: "isFormDisabled" }, outputs: { formSubmitEventEmitter: "formSubmit" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "submitButtonElementRef", first: true, predicate: ["submitButton"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit($event)\">\n <formly-form [form]=\"form\" [fields]=\"formFields\" [options]=\"formOptions\" [model]=\"formModel\"></formly-form>\n <button #submitButton pButton type=\"submit\" [class.hidden]=\"!isSubmitButtonVisible\" [disabled]=\"form.disabled\" [loading]=\"(submitLoading$ | async) ?? false\"></button>\n</form>\n<p-messages [value]=\"formMessages\" [enableService]=\"false\"></p-messages>\n", components: [{ type: i3.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { type: i3$1.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: i2$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i2$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i8.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }], pipes: { "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4716
+ MngFormEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormEditorComponent, deps: [{ token: i3$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
4717
+ MngFormEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormEditorComponent, selector: "mng-form-editor", inputs: { descriptor: "descriptor", submitLoading: "submitLoading", item: "item", isSubmitButtonVisible: "isSubmitButtonVisible", isFormDisabled: "isFormDisabled" }, outputs: { formSubmitEventEmitter: "formSubmit" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "submitButtonElementRef", first: true, predicate: ["submitButton"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit($event)\">\n <formly-form [form]=\"form\" [fields]=\"formFields\" [options]=\"formOptions\" [model]=\"formModel\"></formly-form>\n <button #submitButton pButton type=\"submit\" [class.hidden]=\"!isSubmitButtonVisible\" [disabled]=\"form.disabled\" [loading]=\"(submitLoading$ | async) ?? false\"></button>\n</form>\n<p-messages [value]=\"formMessages\" [enableService]=\"false\"></p-messages>\n", components: [{ type: i3$2.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { type: i3$3.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: i4$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4234
4718
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormEditorComponent, decorators: [{
4235
4719
  type: Component,
4236
4720
  args: [{ selector: 'mng-form-editor', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit($event)\">\n <formly-form [form]=\"form\" [fields]=\"formFields\" [options]=\"formOptions\" [model]=\"formModel\"></formly-form>\n <button #submitButton pButton type=\"submit\" [class.hidden]=\"!isSubmitButtonVisible\" [disabled]=\"form.disabled\" [loading]=\"(submitLoading$ | async) ?? false\"></button>\n</form>\n<p-messages [value]=\"formMessages\" [enableService]=\"false\"></p-messages>\n" }]
4237
- }], ctorParameters: function () { return [{ type: i2$2.TranslateService }]; }, propDecorators: { descriptor: [{
4721
+ }], ctorParameters: function () { return [{ type: i3$1.TranslateService }]; }, propDecorators: { descriptor: [{
4238
4722
  type: Input
4239
4723
  }], submitLoading: [{
4240
4724
  type: Input
@@ -4300,11 +4784,14 @@ class MngAutocompleteComponent {
4300
4784
  if (event.query && event.query.length > 0 && this.itemsLabelProperty) {
4301
4785
  queryParamBuilder.withFilter(this.itemsLabelProperty, event.query, undefined, MediusFilterMatchType.StartsWith);
4302
4786
  }
4303
- this.searchSubscription = this.dataProvider.lookup(queryParamBuilder.build(), this.dataProviderService, event.query).subscribe((res) => {
4304
- this.suggestionsSubject.next(res);
4305
- this.isLoading = false;
4306
- }, () => {
4307
- this.isLoading = false;
4787
+ this.searchSubscription = this.dataProvider.lookup(queryParamBuilder.build(), this.dataProviderService, event.query).subscribe({
4788
+ next: (res) => {
4789
+ this.suggestionsSubject.next(res);
4790
+ this.isLoading = false;
4791
+ },
4792
+ error: () => {
4793
+ this.isLoading = false;
4794
+ }
4308
4795
  });
4309
4796
  }
4310
4797
  }
@@ -4331,7 +4818,7 @@ class MngAutocompleteComponent {
4331
4818
  }
4332
4819
  }
4333
4820
  MngAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngAutocompleteComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
4334
- MngAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: { dataProvider: "dataProvider", dataKeyProperty: "dataKeyProperty", itemsLabelProperty: "itemsLabelProperty", multiselect: "multiselect", placeholder: "placeholder", className: "className", dropdownClassName: "dropdownClassName" }, outputs: { valueChangeEventEmitter: "valueChange" }, providers: [MNG_AUTOCOMPLETE_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeAutocomplete", first: true, predicate: AutoComplete, descendants: true }], ngImport: i0, template: "<p-autoComplete\n [formControl]=\"autocompleteFormControl\"\n [placeholder]=\"$any(placeholder)\"\n [dropdown]=\"true\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [field]=\"$any(itemsLabelProperty)\"\n [suggestions]=\"(suggestions$ | async) ?? []\"\n [multiple]=\"multiselect\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'mngAutocomplete.noMatches' | translate\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n (completeMethod)=\"onSearch($event)\"\n (onSelect)=\"onSelect($event)\"\n appendTo=\"body\"\n dropdownMode=\"current\">\n</p-autoComplete>\n", components: [{ type: i1$1.AutoComplete, selector: "p-autoComplete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "virtualScroll", "itemSize", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "field", "scrollHeight", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "suggestions"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide"] }], directives: [{ type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4821
+ MngAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: { dataProvider: "dataProvider", dataKeyProperty: "dataKeyProperty", itemsLabelProperty: "itemsLabelProperty", multiselect: "multiselect", placeholder: "placeholder", className: "className", dropdownClassName: "dropdownClassName" }, outputs: { valueChangeEventEmitter: "valueChange" }, providers: [MNG_AUTOCOMPLETE_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeAutocomplete", first: true, predicate: AutoComplete, descendants: true }], ngImport: i0, template: "<p-autoComplete\n [formControl]=\"autocompleteFormControl\"\n [placeholder]=\"$any(placeholder)\"\n [dropdown]=\"true\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [field]=\"$any(itemsLabelProperty)\"\n [suggestions]=\"(suggestions$ | async) ?? []\"\n [multiple]=\"multiselect\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'mngAutocomplete.noMatches' | translate\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n (completeMethod)=\"onSearch($event)\"\n (onSelect)=\"onSelect($event)\"\n appendTo=\"body\"\n dropdownMode=\"current\">\n</p-autoComplete>\n", components: [{ type: i1$1.AutoComplete, selector: "p-autoComplete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "virtualScroll", "itemSize", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "field", "scrollHeight", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "suggestions"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide"] }], directives: [{ type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "async": i4.AsyncPipe, "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4335
4822
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngAutocompleteComponent, decorators: [{
4336
4823
  type: Component,
4337
4824
  args: [{ selector: 'mng-autocomplete', providers: [MNG_AUTOCOMPLETE_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-autoComplete\n [formControl]=\"autocompleteFormControl\"\n [placeholder]=\"$any(placeholder)\"\n [dropdown]=\"true\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [field]=\"$any(itemsLabelProperty)\"\n [suggestions]=\"(suggestions$ | async) ?? []\"\n [multiple]=\"multiselect\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'mngAutocomplete.noMatches' | translate\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n (completeMethod)=\"onSearch($event)\"\n (onSelect)=\"onSelect($event)\"\n appendTo=\"body\"\n dropdownMode=\"current\">\n</p-autoComplete>\n" }]
@@ -4424,7 +4911,7 @@ class MngDropdownComponent {
4424
4911
  }
4425
4912
  }
4426
4913
  MngDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngDropdownComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
4427
- MngDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngDropdownComponent, selector: "mng-dropdown", inputs: { dataProvider: "dataProvider", dataKeyProperty: "dataKeyProperty", itemsLabelProperty: "itemsLabelProperty", itemsValueProperty: "itemsValueProperty", multiselect: "multiselect", placeholder: "placeholder", showClear: "showClear", selectFirstItem: "selectFirstItem", className: "className", dropdownClassName: "dropdownClassName" }, outputs: { valueChangeEventEmitter: "valueChange" }, providers: [MNG_DROPDOWN_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeDropdown", first: true, predicate: Dropdown, descendants: true }], ngImport: i0, template: "<p-dropdown\n *ngIf=\"!multiselect; else pMultiselect\"\n [formControl]=\"dropdownFormControl\"\n [placeholder]=\"$any(placeholder)\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [optionLabel]=\"$any(itemsLabelProperty)\"\n [optionValue]=\"$any(itemsValueProperty)\"\n [options]=\"$any(items$ | async)\"\n [showClear]=\"showClear\"\n [autoDisplayFirst]=\"false\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n appendTo=\"body\">\n</p-dropdown>\n<ng-template #pMultiselect>\n <p-multiSelect\n display=\"chip\"\n [formControl]=\"dropdownFormControl\"\n [defaultLabel]=\"$any(placeholder)\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [optionLabel]=\"$any(itemsLabelProperty)\"\n [optionValue]=\"$any(itemsValueProperty)\"\n [options]=\"(items$ | async) ?? []\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n [filter]=\"false\"\n appendTo=\"body\">\n </p-multiSelect>\n</ng-template>\n", components: [{ type: i1$2.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "virtualScroll", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "disabled", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear"] }, { type: i2$4.MultiSelect, selector: "p-multiSelect", inputs: ["style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "autoZIndex", "baseZIndex", "filterBy", "virtualScroll", "itemSize", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "scrollHeight", "defaultLabel", "placeholder", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onPanelShow", "onPanelHide"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4914
+ MngDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngDropdownComponent, selector: "mng-dropdown", inputs: { dataProvider: "dataProvider", dataKeyProperty: "dataKeyProperty", itemsLabelProperty: "itemsLabelProperty", itemsValueProperty: "itemsValueProperty", multiselect: "multiselect", placeholder: "placeholder", showClear: "showClear", selectFirstItem: "selectFirstItem", className: "className", dropdownClassName: "dropdownClassName" }, outputs: { valueChangeEventEmitter: "valueChange" }, providers: [MNG_DROPDOWN_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeDropdown", first: true, predicate: Dropdown, descendants: true }], ngImport: i0, template: "<p-dropdown\n *ngIf=\"!multiselect; else pMultiselect\"\n [formControl]=\"dropdownFormControl\"\n [placeholder]=\"$any(placeholder)\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [optionLabel]=\"$any(itemsLabelProperty)\"\n [optionValue]=\"$any(itemsValueProperty)\"\n [options]=\"$any(items$ | async)\"\n [showClear]=\"showClear\"\n [autoDisplayFirst]=\"false\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n appendTo=\"body\">\n</p-dropdown>\n<ng-template #pMultiselect>\n <p-multiSelect\n display=\"chip\"\n [formControl]=\"dropdownFormControl\"\n [defaultLabel]=\"$any(placeholder)\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [optionLabel]=\"$any(itemsLabelProperty)\"\n [optionValue]=\"$any(itemsValueProperty)\"\n [options]=\"(items$ | async) ?? []\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n [filter]=\"false\"\n appendTo=\"body\">\n </p-multiSelect>\n</ng-template>\n", components: [{ type: i1$2.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "virtualScroll", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "disabled", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear"] }, { type: i2$1.MultiSelect, selector: "p-multiSelect", inputs: ["style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "autoZIndex", "baseZIndex", "filterBy", "virtualScroll", "itemSize", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "scrollHeight", "defaultLabel", "placeholder", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onPanelShow", "onPanelHide"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4428
4915
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngDropdownComponent, decorators: [{
4429
4916
  type: Component,
4430
4917
  args: [{ selector: 'mng-dropdown', providers: [MNG_DROPDOWN_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-dropdown\n *ngIf=\"!multiselect; else pMultiselect\"\n [formControl]=\"dropdownFormControl\"\n [placeholder]=\"$any(placeholder)\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [optionLabel]=\"$any(itemsLabelProperty)\"\n [optionValue]=\"$any(itemsValueProperty)\"\n [options]=\"$any(items$ | async)\"\n [showClear]=\"showClear\"\n [autoDisplayFirst]=\"false\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n appendTo=\"body\">\n</p-dropdown>\n<ng-template #pMultiselect>\n <p-multiSelect\n display=\"chip\"\n [formControl]=\"dropdownFormControl\"\n [defaultLabel]=\"$any(placeholder)\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [optionLabel]=\"$any(itemsLabelProperty)\"\n [optionValue]=\"$any(itemsValueProperty)\"\n [options]=\"(items$ | async) ?? []\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n [filter]=\"false\"\n appendTo=\"body\">\n </p-multiSelect>\n</ng-template>\n" }]
@@ -4456,16 +4943,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4456
4943
  args: [Dropdown]
4457
4944
  }] } });
4458
4945
 
4459
- class MngActionDialogComponent {
4460
- constructor(injector, translate, dialogRef, dialogConfig, actionService, mngCommonsService) {
4946
+ class MngActionEditorComponent {
4947
+ constructor(injector, translate, actionExecutor, mngCommonsService, navigationService, dialogRef, dialogConfig, viewContainerService) {
4461
4948
  this.injector = injector;
4462
4949
  this.translate = translate;
4950
+ this.actionExecutor = actionExecutor;
4951
+ this.mngCommonsService = mngCommonsService;
4952
+ this.navigationService = navigationService;
4463
4953
  this.dialogRef = dialogRef;
4464
4954
  this.dialogConfig = dialogConfig;
4465
- this.actionService = actionService;
4466
- this.mngCommonsService = mngCommonsService;
4955
+ this.viewContainerService = viewContainerService;
4956
+ this.actionRunEventEmitter = new EventEmitter();
4467
4957
  this.cmpId = Math.random().toString(36).substring(2);
4958
+ this.isDialog = true;
4468
4959
  this.isSaveButton = true;
4960
+ // actions
4961
+ this.toolbarLeftActions = [];
4962
+ this.toolbarRightActions = [];
4963
+ this.footerLeftActions = [];
4964
+ this.footerRightActions = [];
4469
4965
  this.loadingSubject = new ReplaySubject(1);
4470
4966
  this.loading$ = this.loadingSubject.asObservable();
4471
4967
  this.submitLoadingSubject = new ReplaySubject(1);
@@ -4474,7 +4970,7 @@ class MngActionDialogComponent {
4474
4970
  this.subscriptions = [];
4475
4971
  }
4476
4972
  ngOnInit() {
4477
- if (this.dialogConfig.data) {
4973
+ if (this.dialogConfig?.data) {
4478
4974
  if (this.dialogConfig.data.action) {
4479
4975
  this.action = this.dialogConfig.data.action;
4480
4976
  }
@@ -4487,18 +4983,65 @@ class MngActionDialogComponent {
4487
4983
  if (this.dialogConfig.data.actionData) {
4488
4984
  this.actionData = this.dialogConfig.data.actionData;
4489
4985
  }
4490
- if (this.dialogConfig.data.tableview) {
4491
- this.tableviewService = this.dialogConfig.data.tableview;
4492
- if (!this.dataProvider && this.tableviewService?.dataProvider) {
4493
- this.dataProvider = this.tableviewService.dataProvider;
4986
+ if (this.dialogConfig.data.viewContainer) {
4987
+ this.viewContainer = this.dialogConfig.data.viewContainer;
4988
+ if (!this.dataProvider && this.viewContainer) {
4989
+ const dataProvider = this.viewContainer.getDataProvider();
4990
+ if (dataProvider && typeof dataProvider['fetch'] === 'function') {
4991
+ this.dataProvider = dataProvider;
4992
+ }
4494
4993
  }
4495
4994
  }
4496
4995
  if (this.dialogConfig.data.sourceComponent) {
4497
4996
  this.sourceComponent = this.dialogConfig.data.sourceComponent;
4498
4997
  }
4499
4998
  }
4999
+ else {
5000
+ this.isDialog = false;
5001
+ this.viewContainer = this.viewContainerInit ?? this.viewContainerService ?? undefined;
5002
+ }
4500
5003
  this.isSaveButton = typeof this.action.submitFunction === 'function';
4501
- this.setDialogHeaderTitle();
5004
+ this.setTitle();
5005
+ for (const action of this.action.editorActions) {
5006
+ if (action instanceof ActionEditorSubmitDescriptor) {
5007
+ if (typeof action.icon === 'undefined') {
5008
+ action.withIcon(action.submitType === ActionEditorSubmitDescriptor.TypeEnum.Submit ? 'pi pi-check' : 'pi pi-times');
5009
+ }
5010
+ if (typeof action.title === 'undefined') {
5011
+ action.withTitle(action.submitType === ActionEditorSubmitDescriptor.TypeEnum.Submit ? 'general.save' : this.isDialog ? 'general.close' : 'general.cancel');
5012
+ }
5013
+ // assign run operations
5014
+ action.withRunNotificationSuccess(undefined, undefined, false);
5015
+ if (action.submitType === ActionEditorSubmitDescriptor.TypeEnum.Submit) {
5016
+ action.withRunFunction(ctx => {
5017
+ this.triggerSubmit();
5018
+ return of(undefined);
5019
+ });
5020
+ }
5021
+ else {
5022
+ action.withRunFunction(ctx => {
5023
+ this.cancel();
5024
+ return of(undefined);
5025
+ });
5026
+ }
5027
+ }
5028
+ switch (action.position) {
5029
+ case ActionPositionEnum.ToolbarLeft:
5030
+ this.toolbarLeftActions.push(action);
5031
+ break;
5032
+ case ActionPositionEnum.ToolbarRight:
5033
+ this.toolbarRightActions.push(action);
5034
+ break;
5035
+ case ActionPositionEnum.FooterLeft:
5036
+ this.footerLeftActions.push(action);
5037
+ break;
5038
+ case ActionPositionEnum.FooterRight:
5039
+ this.footerRightActions.push(action);
5040
+ break;
5041
+ }
5042
+ }
5043
+ this.toolbarRightActions = this.toolbarRightActions.reverse();
5044
+ this.footerRightActions = this.footerRightActions.reverse();
4502
5045
  this.loadItemWithDataProvider();
4503
5046
  }
4504
5047
  ngOnDestroy() {
@@ -4510,18 +5053,30 @@ class MngActionDialogComponent {
4510
5053
  return;
4511
5054
  }
4512
5055
  this.submitLoadingSubject.next(true);
4513
- this.actionService
4514
- .runEditorSave(this.action, this.itemId, event.formItem, this.dataProvider, this.sourceComponent, this.tableviewService, this.actionData)
4515
- .pipe(first(), finalize(() => this.submitLoadingSubject.next(false)))
4516
- .subscribe(res => {
4517
- this.closeDialog(res);
5056
+ this.actionExecutor
5057
+ .runEditorSave(this.action, this.itemId, event.formItem, this.dataProvider, this.sourceComponent, this.viewContainer, this.actionData)
5058
+ .pipe(first())
5059
+ .subscribe({
5060
+ next: res => {
5061
+ this.submitLoadingSubject.next(false);
5062
+ this.cancel(res);
5063
+ },
5064
+ error: () => {
5065
+ this.submitLoadingSubject.next(false);
5066
+ }
4518
5067
  });
4519
5068
  }
4520
5069
  }
4521
- closeDialog(result) {
4522
- this.dialogRef.close(result ? result : new ActionRunResult(undefined, undefined, new ActionError(null, true)));
5070
+ cancel(result) {
5071
+ if (!result) {
5072
+ result = new ActionRunResult(undefined, undefined, new ActionError(null, true));
5073
+ }
5074
+ if (this.isDialog) {
5075
+ this.dialogRef?.close(result);
5076
+ }
5077
+ this.actionRunEventEmitter.next(result);
4523
5078
  }
4524
- saveItem() {
5079
+ triggerSubmit() {
4525
5080
  this.editorComponent.submit();
4526
5081
  }
4527
5082
  loadItemWithDataProvider() {
@@ -4529,48 +5084,60 @@ class MngActionDialogComponent {
4529
5084
  return;
4530
5085
  }
4531
5086
  this.loadingSubject.next(true);
4532
- this.actionService
4533
- .runEditorFetch(this.action, this.itemId, this.dataProvider, this.sourceComponent, this.tableviewService)
5087
+ this.actionExecutor
5088
+ .runEditorFetch(this.action, this.itemId, this.dataProvider, this.sourceComponent, this.viewContainer)
4534
5089
  .pipe(first(), catchError(err => {
4535
5090
  if (this.action.hasRunNotificationError) {
4536
- ToastUtil.actionNotificationError(this.translate, this.action, err, 'fetch', this.tableviewService, this.item);
5091
+ ToastUtil.actionNotificationError(this.translate, this.action, err, 'fetch', this.viewContainer, this.item);
4537
5092
  }
4538
5093
  throw err;
4539
5094
  }), finalize(() => this.loadingSubject.next(false)))
4540
5095
  .subscribe(res => {
4541
5096
  this.item = res.result;
4542
5097
  if (this.action.hasFetchNotificationSuccess) {
4543
- ToastUtil.actionNotificationSuccess(this.translate, this.action, 'fetch', this.action.fetchNotificationSuccessTitle, this.action.fetchNotificationSuccessMessage, this.tableviewService, this.item);
5098
+ ToastUtil.actionNotificationSuccess(this.translate, this.action, 'fetch', this.action.fetchNotificationSuccessTitle, this.action.fetchNotificationSuccessMessage, this.viewContainer, this.item);
4544
5099
  }
4545
- this.setDialogHeaderTitle();
5100
+ this.setTitle();
4546
5101
  });
4547
5102
  }
4548
- setDialogHeaderTitle() {
5103
+ setTitle() {
4549
5104
  if (this.action.editorTitle === null) {
4550
- requestAnimationFrame(() => {
4551
- this.dialogConfig.header = undefined;
4552
- });
5105
+ this.title = undefined;
5106
+ if (this.dialogConfig) {
5107
+ requestAnimationFrame(() => {
5108
+ this.dialogConfig.header = undefined;
5109
+ });
5110
+ }
4553
5111
  return;
4554
5112
  }
4555
- const subscription = I18nUtil.streamActionTranslation(this.translate, this.action, 'dialog.title', undefined, this.item)
5113
+ const subscription = I18nUtil.streamActionTranslation(this.translate, this.action, 'editor.title', this.action.editorTitle, this.item)
4556
5114
  .pipe(mergeMap(i18nDialogTitle => i18nDialogTitle === null
4557
- ? I18nUtil.getActionTranslation(this.translate, this.action, 'title', this.action.editorTitle, this.item)
5115
+ ? I18nUtil.getActionTranslation(this.translate, this.action, 'title', undefined, this.item)
4558
5116
  : of(i18nDialogTitle)))
4559
5117
  .subscribe(t => {
4560
- requestAnimationFrame(() => {
4561
- this.dialogConfig.header = t ?? undefined;
4562
- this.mngCommonsService.setPageTitle(t ?? undefined);
4563
- });
5118
+ this.title = t ?? undefined;
5119
+ if (this.dialogConfig) {
5120
+ requestAnimationFrame(() => {
5121
+ this.dialogConfig.header = t ?? undefined;
5122
+ this.mngCommonsService.setPageTitle(t ?? undefined);
5123
+ });
5124
+ }
4564
5125
  });
4565
5126
  this.subscriptions.push(subscription);
4566
5127
  }
4567
5128
  }
4568
- MngActionDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionDialogComponent, deps: [{ token: i0.Injector }, { token: i2$2.TranslateService }, { token: i2.DynamicDialogRef }, { token: i2.DynamicDialogConfig }, { token: MngActionService }, { token: MngCommonsService }], target: i0.ɵɵFactoryTarget.Component });
4569
- MngActionDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngActionDialogComponent, selector: "mng-action-dialog", inputs: { action: "action", itemId: "itemId", item: "item", actionData: "actionData", dataProvider: "dataProvider" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "submitButtonElementRef", first: true, predicate: ["submitButton"], descendants: true }, { propertyName: "editorComponent", first: true, predicate: MngFormEditorComponent, descendants: true }], ngImport: i0, template: "<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n <div class=\"flex flex-row justify-content-between\">\n <div></div>\n <div>\n <button\n type=\"button\"\n pButton\n pRipple\n [label]=\"'general.close' | translate\"\n icon=\"pi pi-times\"\n class=\"p-button-text\"\n (click)=\"closeDialog()\"\n [disabled]=\"submitLoading$ | async\"></button>\n <button\n *ngIf=\"isSaveButton\"\n #submitButton\n type=\"button\"\n pButton\n pRipple\n [label]=\"'general.save' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"saveItem()\"\n [loading]=\"(submitLoading$ | async) ?? false\"\n [disabled]=\"(submitLoading$ | async) ?? false\"></button>\n </div>\n </div>\n</div>\n", components: [{ type: i4$2.ProgressSpinner, selector: "p-progressSpinner", inputs: ["style", "styleClass", "strokeWidth", "fill", "animationDuration"] }, { type: MngFormEditorComponent, selector: "mng-form-editor", inputs: ["descriptor", "submitLoading", "item", "isSubmitButtonVisible", "isFormDisabled"], outputs: ["formSubmit"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i9.Ripple, selector: "[pRipple]" }], pipes: { "async": i4$1.AsyncPipe, "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4570
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionDialogComponent, decorators: [{
5129
+ MngActionEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionEditorComponent, deps: [{ token: i0.Injector }, { token: i3$1.TranslateService }, { token: MngActionExecutorService }, { token: MngCommonsService }, { token: MngNavigationService }, { token: i3.DynamicDialogRef, optional: true }, { token: i3.DynamicDialogConfig, optional: true }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
5130
+ MngActionEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngActionEditorComponent, selector: "mng-action-editor", inputs: { action: "action", itemId: "itemId", item: "item", actionData: "actionData", dataProvider: "dataProvider", viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { actionRunEventEmitter: "actionSubmit" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "submitButtonElementRef", first: true, predicate: ["submitButton"], descendants: true }, { propertyName: "editorComponent", first: true, predicate: MngFormEditorComponent, descendants: true }], ngImport: i0, template: "<h2 *ngIf=\"!isDialog && title\">{{ title }}</h2>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <p-toolbar styleClass=\"mng-action-editor-toolbar\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n </p-toolbar>\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n\n <div class=\"flex flex-row justify-content-between\">\n <div>\n <mng-action *ngFor=\"let action of footerLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n <div>\n <mng-action *ngFor=\"let action of footerRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n </div>\n</div>\n", components: [{ type: i4$3.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }, { type: i6.ProgressSpinner, selector: "p-progressSpinner", inputs: ["style", "styleClass", "strokeWidth", "fill", "animationDuration"] }, { type: MngFormEditorComponent, selector: "mng-form-editor", inputs: ["descriptor", "submitLoading", "item", "isSubmitButtonVisible", "isFormDisabled"], outputs: ["formSubmit"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionEditorComponent, decorators: [{
4571
5132
  type: Component,
4572
- args: [{ selector: 'mng-action-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n <div class=\"flex flex-row justify-content-between\">\n <div></div>\n <div>\n <button\n type=\"button\"\n pButton\n pRipple\n [label]=\"'general.close' | translate\"\n icon=\"pi pi-times\"\n class=\"p-button-text\"\n (click)=\"closeDialog()\"\n [disabled]=\"submitLoading$ | async\"></button>\n <button\n *ngIf=\"isSaveButton\"\n #submitButton\n type=\"button\"\n pButton\n pRipple\n [label]=\"'general.save' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"saveItem()\"\n [loading]=\"(submitLoading$ | async) ?? false\"\n [disabled]=\"(submitLoading$ | async) ?? false\"></button>\n </div>\n </div>\n</div>\n" }]
4573
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i2$2.TranslateService }, { type: i2.DynamicDialogRef }, { type: i2.DynamicDialogConfig }, { type: MngActionService }, { type: MngCommonsService }]; }, propDecorators: { action: [{
5133
+ args: [{ selector: 'mng-action-editor', changeDetection: ChangeDetectionStrategy.OnPush, template: "<h2 *ngIf=\"!isDialog && title\">{{ title }}</h2>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <p-toolbar styleClass=\"mng-action-editor-toolbar\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n </p-toolbar>\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n\n <div class=\"flex flex-row justify-content-between\">\n <div>\n <mng-action *ngFor=\"let action of footerLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n <div>\n <mng-action *ngFor=\"let action of footerRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n </div>\n</div>\n" }]
5134
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i3$1.TranslateService }, { type: MngActionExecutorService }, { type: MngCommonsService }, { type: MngNavigationService }, { type: i3.DynamicDialogRef, decorators: [{
5135
+ type: Optional
5136
+ }] }, { type: i3.DynamicDialogConfig, decorators: [{
5137
+ type: Optional
5138
+ }] }, { type: MngViewContainerComponentService, decorators: [{
5139
+ type: Optional
5140
+ }] }]; }, propDecorators: { action: [{
4574
5141
  type: Input
4575
5142
  }], itemId: [{
4576
5143
  type: Input
@@ -4580,6 +5147,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4580
5147
  type: Input
4581
5148
  }], dataProvider: [{
4582
5149
  type: Input
5150
+ }], viewContainerInit: [{
5151
+ type: Input,
5152
+ args: ['viewContainer']
5153
+ }], actionRunEventEmitter: [{
5154
+ type: Output,
5155
+ args: ['actionSubmit']
4583
5156
  }], templates: [{
4584
5157
  type: ContentChildren,
4585
5158
  args: [MngTemplateDirective]
@@ -4598,10 +5171,10 @@ class MngFormlyFieldAutocompleteComponent extends FieldType {
4598
5171
  }
4599
5172
  }
4600
5173
  MngFormlyFieldAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldAutocompleteComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4601
- MngFormlyFieldAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldAutocompleteComponent, selector: "mng-formly-field-autocomplete", usesInheritance: true, ngImport: i0, template: "<mng-autocomplete\n [id]=\"$any(key)\"\n [formControl]=\"aFormControl\"\n [formlyAttributes]=\"field\"\n [dataProvider]=\"$any(descriptor.dataProvider)\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\">\n</mng-autocomplete>\n", components: [{ type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "multiselect", "placeholder", "className", "dropdownClassName"], outputs: ["valueChange"] }], directives: [{ type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5174
+ MngFormlyFieldAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldAutocompleteComponent, selector: "mng-formly-field-autocomplete", usesInheritance: true, ngImport: i0, template: "<mng-autocomplete\n [id]=\"$any(key)\"\n [formControl]=\"aFormControl\"\n [formlyAttributes]=\"field\"\n [dataProvider]=\"$any(descriptor.dataProvider)\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [className]=\"descriptor.inputClassName\">\n</mng-autocomplete>\n", components: [{ type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "multiselect", "placeholder", "className", "dropdownClassName"], outputs: ["valueChange"] }], directives: [{ type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$2.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4602
5175
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldAutocompleteComponent, decorators: [{
4603
5176
  type: Component,
4604
- args: [{ selector: 'mng-formly-field-autocomplete', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-autocomplete\n [id]=\"$any(key)\"\n [formControl]=\"aFormControl\"\n [formlyAttributes]=\"field\"\n [dataProvider]=\"$any(descriptor.dataProvider)\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\">\n</mng-autocomplete>\n" }]
5177
+ args: [{ selector: 'mng-formly-field-autocomplete', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-autocomplete\n [id]=\"$any(key)\"\n [formControl]=\"aFormControl\"\n [formlyAttributes]=\"field\"\n [dataProvider]=\"$any(descriptor.dataProvider)\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [className]=\"descriptor.inputClassName\">\n</mng-autocomplete>\n" }]
4605
5178
  }] });
4606
5179
 
4607
5180
  class MngFormlyFieldInputComponent extends FieldType {
@@ -4615,10 +5188,10 @@ class MngFormlyFieldInputComponent extends FieldType {
4615
5188
  }
4616
5189
  }
4617
5190
  MngFormlyFieldInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4618
- MngFormlyFieldInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldInputComponent, selector: "mng-formly-field-input", usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"option.value\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"option.value\" class=\"mng-radio-button-label\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <p-inputMask\n *ngSwitchCase=\"'mask'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [mask]=\"$any(descriptor.mask)\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [slotChar]=\"$any(descriptor.slotChar)\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n", components: [{ type: i1$3.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }, { type: i2$5.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabelledBy"], outputs: ["onChange"] }, { type: i3.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i4$3.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i5.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { type: i6$1.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "style", "inputId", "styleClass", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "disabled", "readonly", "unmask", "name", "required", "characterPattern", "autoFocus", "autocomplete", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown"] }], directives: [{ type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i4$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i10$1.InputText, selector: "[pInputText]" }], pipes: { "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5191
+ MngFormlyFieldInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldInputComponent, selector: "mng-formly-field-input", usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\"\n [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 [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", components: [{ type: i1$3.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }, { type: i2$2.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabelledBy"], outputs: ["onChange"] }, { type: i3$2.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i4$4.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i5$1.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { type: i6$1.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "style", "inputId", "styleClass", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "disabled", "readonly", "unmask", "name", "required", "characterPattern", "autoFocus", "autocomplete", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown"] }], directives: [{ type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$2.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i10.InputText, selector: "[pInputText]" }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4619
5192
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, decorators: [{
4620
5193
  type: Component,
4621
- args: [{ selector: 'mng-formly-field-input', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"option.value\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"option.value\" class=\"mng-radio-button-label\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <p-inputMask\n *ngSwitchCase=\"'mask'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [mask]=\"$any(descriptor.mask)\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [slotChar]=\"$any(descriptor.slotChar)\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n" }]
5194
+ 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 [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" }]
4622
5195
  }] });
4623
5196
 
4624
5197
  class MngFormlyFieldDropdownComponent extends FieldType {
@@ -4628,10 +5201,10 @@ class MngFormlyFieldDropdownComponent extends FieldType {
4628
5201
  }
4629
5202
  }
4630
5203
  MngFormlyFieldDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldDropdownComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4631
- MngFormlyFieldDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldDropdownComponent, selector: "mng-formly-field-dropdown", usesInheritance: true, ngImport: i0, template: "<mng-dropdown\n [id]=\"$any(key)\"\n [formControl]=\"dFormControl\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [dataProvider]=\"descriptor.dataProvider\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [itemsValueProperty]=\"$any(descriptor.itemsValueProperty)\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\"\n [showClear]=\"!this.to.required\">\n</mng-dropdown>\n", components: [{ type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsValueProperty", "multiselect", "placeholder", "showClear", "selectFirstItem", "className", "dropdownClassName"], outputs: ["valueChange"] }], directives: [{ type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5204
+ MngFormlyFieldDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldDropdownComponent, selector: "mng-formly-field-dropdown", usesInheritance: true, ngImport: i0, template: "<mng-dropdown\n [id]=\"$any(key)\"\n [formControl]=\"dFormControl\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [dataProvider]=\"descriptor.dataProvider\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [itemsValueProperty]=\"$any(descriptor.itemsValueProperty)\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\"\n [showClear]=\"!to.required\"\n [className]=\"descriptor.inputClassName\">\n</mng-dropdown>\n", components: [{ type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsValueProperty", "multiselect", "placeholder", "showClear", "selectFirstItem", "className", "dropdownClassName"], outputs: ["valueChange"] }], directives: [{ type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$2.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4632
5205
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldDropdownComponent, decorators: [{
4633
5206
  type: Component,
4634
- args: [{ selector: 'mng-formly-field-dropdown', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-dropdown\n [id]=\"$any(key)\"\n [formControl]=\"dFormControl\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [dataProvider]=\"descriptor.dataProvider\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [itemsValueProperty]=\"$any(descriptor.itemsValueProperty)\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\"\n [showClear]=\"!this.to.required\">\n</mng-dropdown>\n" }]
5207
+ args: [{ selector: 'mng-formly-field-dropdown', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-dropdown\n [id]=\"$any(key)\"\n [formControl]=\"dFormControl\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [dataProvider]=\"descriptor.dataProvider\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [itemsValueProperty]=\"$any(descriptor.itemsValueProperty)\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\"\n [showClear]=\"!to.required\"\n [className]=\"descriptor.inputClassName\">\n</mng-dropdown>\n" }]
4635
5208
  }] });
4636
5209
 
4637
5210
  class MngTableLoadEvent {
@@ -4714,12 +5287,12 @@ class MngTableColumnFilterComponent {
4714
5287
  }
4715
5288
  }
4716
5289
  }
4717
- MngTableColumnFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnFilterComponent, deps: [{ token: i2$1.PrimeNGConfig }], target: i0.ɵɵFactoryTarget.Component });
4718
- MngTableColumnFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: { descriptor: "descriptor", display: "display" }, ngImport: i0, template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n matchMode=\"equals\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\">\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"true\"\n (valueChange)=\"filterCallback($event)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n", components: [{ type: i4$4.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping"] }, { type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "multiselect", "placeholder", "className", "dropdownClassName"], outputs: ["valueChange"] }, { type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsValueProperty", "multiselect", "placeholder", "showClear", "selectFirstItem", "className", "dropdownClassName"], outputs: ["valueChange"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "translate": i2$2.TranslatePipe } });
5290
+ MngTableColumnFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnFilterComponent, deps: [{ token: i2.PrimeNGConfig }], target: i0.ɵɵFactoryTarget.Component });
5291
+ MngTableColumnFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: { descriptor: "descriptor", display: "display" }, ngImport: i0, template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n matchMode=\"equals\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\">\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"true\"\n (valueChange)=\"filterCallback($event)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n", components: [{ type: i4$5.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping"] }, { type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "multiselect", "placeholder", "className", "dropdownClassName"], outputs: ["valueChange"] }, { type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsValueProperty", "multiselect", "placeholder", "showClear", "selectFirstItem", "className", "dropdownClassName"], outputs: ["valueChange"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "translate": i3$1.TranslatePipe } });
4719
5292
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnFilterComponent, decorators: [{
4720
5293
  type: Component,
4721
5294
  args: [{ selector: 'mng-table-column-filter', template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n matchMode=\"equals\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\">\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"true\"\n (valueChange)=\"filterCallback($event)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n" }]
4722
- }], ctorParameters: function () { return [{ type: i2$1.PrimeNGConfig }]; }, propDecorators: { descriptor: [{
5295
+ }], ctorParameters: function () { return [{ type: i2.PrimeNGConfig }]; }, propDecorators: { descriptor: [{
4723
5296
  type: Input
4724
5297
  }], display: [{
4725
5298
  type: Input
@@ -4808,7 +5381,7 @@ class MngTableColumnValueComponent {
4808
5381
  }
4809
5382
  }
4810
5383
  MngTableColumnValueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4811
- MngTableColumnValueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: { descriptor: "descriptor", item: "item" }, ngImport: i0, template: "<ng-container [ngSwitch]=\"descriptor.columnType\">\n <ng-container *ngSwitchCase=\"columnTypeString\">\n {{ descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property] }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeNumber\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | number: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeDate\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | date: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeBoolean\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | boolean }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeEnum\">\n {{\n (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property])\n | enum: descriptor.enumType:descriptor.enumTitlePath:descriptor.enumNameAsValue\n | translate\n }}\n </ng-container>\n</ng-container>\n", directives: [{ type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "propertyPath": MngPropertyPathPipe, "number": i4$1.DecimalPipe, "date": i4$1.DatePipe, "boolean": MngBooleanPipe, "translate": i2$2.TranslatePipe, "enum": MngEnumPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5384
+ MngTableColumnValueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: { descriptor: "descriptor", item: "item" }, ngImport: i0, template: "<ng-container [ngSwitch]=\"descriptor.columnType\">\n <ng-container *ngSwitchCase=\"columnTypeString\">\n {{ descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property] }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeNumber\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | number: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeDate\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | date: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeBoolean\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | boolean }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeEnum\">\n {{\n (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property])\n | enum: descriptor.enumType:descriptor.enumTitlePath:descriptor.enumNameAsValue\n | translate\n }}\n </ng-container>\n</ng-container>\n", directives: [{ type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "propertyPath": MngPropertyPathPipe, "number": i4.DecimalPipe, "date": i4.DatePipe, "boolean": MngBooleanPipe, "translate": i3$1.TranslatePipe, "enum": MngEnumPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4812
5385
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnValueComponent, decorators: [{
4813
5386
  type: Component,
4814
5387
  args: [{ selector: 'mng-table-column-value', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"descriptor.columnType\">\n <ng-container *ngSwitchCase=\"columnTypeString\">\n {{ descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property] }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeNumber\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | number: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeDate\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | date: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeBoolean\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | boolean }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeEnum\">\n {{\n (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property])\n | enum: descriptor.enumType:descriptor.enumTitlePath:descriptor.enumNameAsValue\n | translate\n }}\n </ng-container>\n</ng-container>\n" }]
@@ -4836,21 +5409,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4836
5409
  var TypeEnum = FilterDescriptor.TypeEnum;
4837
5410
  var PaginationModeEnum = TableDescriptor.PaginationModeEnum;
4838
5411
  class MngTableComponent {
4839
- constructor(injector, router, activatedRoute, translate, tableviewService) {
5412
+ constructor(injector, router, activatedRoute, translate, viewContainerService) {
4840
5413
  this.injector = injector;
4841
5414
  this.router = router;
4842
5415
  this.activatedRoute = activatedRoute;
4843
5416
  this.translate = translate;
4844
- this.tableviewService = tableviewService;
5417
+ this.viewContainerService = viewContainerService;
4845
5418
  this.filterDisplayRow = TableDescriptor.FilterDisplayEnum.Row;
4846
5419
  this.filterDisplayMenu = TableDescriptor.FilterDisplayEnum.Menu;
4847
5420
  this.useQueryParams = false;
4848
5421
  // extra features input
5422
+ this.selectionMode = 'multiple';
4849
5423
  this.selectionEnabled = false;
4850
5424
  // event outputs
4851
5425
  this.loadEventEmitter = new EventEmitter();
4852
5426
  this.cellClickEventEmitter = new EventEmitter();
4853
5427
  this.selectionChangeEventEmitter = new EventEmitter();
5428
+ this.captionCmpInstEventEmitter = new EventEmitter();
5429
+ this.columnActionCmpInstEventEmitter = new EventEmitter();
4854
5430
  // data provider and items
4855
5431
  this.useDataProvider = false;
4856
5432
  this.useQueryParamsInitialized = false;
@@ -4990,6 +5566,12 @@ class MngTableComponent {
4990
5566
  onSelectionChange(event) {
4991
5567
  this.selectionChangeEventEmitter.emit(event);
4992
5568
  }
5569
+ onCaptionCmpInst(instance) {
5570
+ this.captionCmpInstEventEmitter.next(instance);
5571
+ }
5572
+ onColumnActionCmpInst(instance) {
5573
+ this.columnActionCmpInstEventEmitter.next(instance);
5574
+ }
4993
5575
  loadTableWithDataProvider(queryParam = null, emitEvent = true) {
4994
5576
  if (!this.useDataProvider) {
4995
5577
  return;
@@ -5010,115 +5592,419 @@ class MngTableComponent {
5010
5592
  this.dataProviderInfiniteScrollItems = [...this.dataProviderInfiniteScrollItems];
5011
5593
  }
5012
5594
  else {
5013
- this.dataProviderQueryResultSubject.next(res);
5595
+ this.dataProviderQueryResultSubject.next(res);
5596
+ }
5597
+ this.isFilterChanged = false;
5598
+ this.isSortChanged = false;
5599
+ this.dataProviderLoadingSubject.next(false);
5600
+ }, err => {
5601
+ ToastUtil.tableNotificationError(this.translate, this.descriptor, err, this.viewContainerService ?? undefined);
5602
+ const emptyQueryResult = new MediusQueryResult();
5603
+ emptyQueryResult.pageData = [];
5604
+ emptyQueryResult.allDataCount = 0;
5605
+ this.dataProviderQueryResultSubject.next(emptyQueryResult);
5606
+ this.dataProviderLoadingSubject.next(false);
5607
+ });
5608
+ if (emitEvent) {
5609
+ const mngEvent = new MngTableLoadEvent();
5610
+ mngEvent.originalEvent = this.dataProviderLatestLazyLoadEvent ?? undefined;
5611
+ mngEvent.queryParam = queryParam;
5612
+ this.loadEventEmitter.next(mngEvent);
5613
+ }
5614
+ }
5615
+ loadTableFromRouteUpdate(params) {
5616
+ const mediusQueryParam = MediusRestUtil.fromAngularQueryParamsToMediusQueryParams(params, this.filterDescriptors, this.rowsPerPageOptions[0]);
5617
+ if (this.dataProviderLatestLazyLoadEventVersion < this.dataProviderLatestQueryParamVersion + 1) {
5618
+ // update only if new version from query params will be higher
5619
+ this.updatePrimeSortAndFilter(mediusQueryParam);
5620
+ }
5621
+ this.useQueryParamsInitialized = true;
5622
+ this.loadTableWithDataProvider(mediusQueryParam);
5623
+ }
5624
+ updatePrimeSortAndFilter(mediusQueryParam) {
5625
+ const primeSortMeta = [];
5626
+ const primeFilterMeta = {};
5627
+ this.filterDescriptors.forEach(f => {
5628
+ primeFilterMeta[f.property] = {
5629
+ value: null,
5630
+ matchMode: f.filterType === TypeEnum.String ? 'contains' : 'equals'
5631
+ };
5632
+ });
5633
+ mediusQueryParam?.sortProperty?.forEach((s, idx) => {
5634
+ primeSortMeta.push({
5635
+ field: s,
5636
+ order: mediusQueryParam?.sortAsc?.[idx] ?? true ? 1 : -1
5637
+ });
5638
+ });
5639
+ mediusQueryParam?.filterParams?.forEach(f => {
5640
+ const descriptor = this.filterDescriptors.find(fd => fd.filterProperty === f.property || fd.property === f.property);
5641
+ const operator = MediusRestUtil.matchModeMapping.find(mapping => mapping[2] === f.filterMatchType);
5642
+ if (descriptor && operator) {
5643
+ primeFilterMeta[descriptor.property] = {
5644
+ value: f.filterValue,
5645
+ matchMode: operator[0]
5646
+ };
5647
+ }
5648
+ });
5649
+ this.multiSortMeta = primeSortMeta;
5650
+ this.filterMetadata = primeFilterMeta;
5651
+ this.rows = mediusQueryParam?.itemsPerPage ?? this.rowsPerPageOptions[0];
5652
+ this.offset = mediusQueryParam?.itemsOffset ?? 0;
5653
+ }
5654
+ getDefaultSortMeta() {
5655
+ if (this.descriptor.hasDefaultSort) {
5656
+ return this.descriptor.defaultSortProperty.map((p, idx) => ({
5657
+ field: p,
5658
+ order: this.descriptor.defaultSortAsc[idx] ? 1 : -1
5659
+ }));
5660
+ }
5661
+ else {
5662
+ return [];
5663
+ }
5664
+ }
5665
+ }
5666
+ MngTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i1.ActivatedRoute }, { token: i3$1.TranslateService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
5667
+ MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableComponent, selector: "mng-table", inputs: { descriptor: "descriptor", items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", captionComponent: "captionComponent", columnActionComponent: "columnActionComponent" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + descriptor.tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [rowHover]=\"true\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n [selectionMode]=\"selectionMode\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.property | i18nProperty: descriptor.model | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.property | i18nProperty: descriptor.model | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" class=\"clickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate || columnActionComponent\" class=\"text-right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponent\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponent>\n <span [mngComponent]=\"columnActionComponent!\" (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", components: [{ type: i4$5.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { type: i4$5.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { type: i4$5.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { type: i4$5.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { type: i4$5.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { type: i7$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent"], outputs: ["instanceCreated"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$5.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4.AsyncPipe, "translate": i3$1.TranslatePipe, "i18nProperty": MngI18nPropertyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5668
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, decorators: [{
5669
+ type: Component,
5670
+ args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + descriptor.tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [rowHover]=\"true\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n [selectionMode]=\"selectionMode\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.property | i18nProperty: descriptor.model | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.property | i18nProperty: descriptor.model | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" class=\"clickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate || columnActionComponent\" class=\"text-right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponent\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponent>\n <span [mngComponent]=\"columnActionComponent!\" (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n" }]
5671
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i3$1.TranslateService }, { type: MngViewContainerComponentService, decorators: [{
5672
+ type: Optional
5673
+ }] }]; }, propDecorators: { descriptor: [{
5674
+ type: Input
5675
+ }], items: [{
5676
+ type: Input
5677
+ }], queryResult: [{
5678
+ type: Input
5679
+ }], loading: [{
5680
+ type: Input
5681
+ }], dataProvider: [{
5682
+ type: Input
5683
+ }], useQueryParams: [{
5684
+ type: Input
5685
+ }], selectionMode: [{
5686
+ type: Input
5687
+ }], selectionEnabled: [{
5688
+ type: Input
5689
+ }], captionComponent: [{
5690
+ type: Input
5691
+ }], columnActionComponent: [{
5692
+ type: Input
5693
+ }], loadEventEmitter: [{
5694
+ type: Output,
5695
+ args: ['tableLoad']
5696
+ }], cellClickEventEmitter: [{
5697
+ type: Output,
5698
+ args: ['cellClick']
5699
+ }], selectionChangeEventEmitter: [{
5700
+ type: Output,
5701
+ args: ['selectionChange']
5702
+ }], captionCmpInstEventEmitter: [{
5703
+ type: Output,
5704
+ args: ['captionComponentInstance']
5705
+ }], columnActionCmpInstEventEmitter: [{
5706
+ type: Output,
5707
+ args: ['columnActionComponentInstance']
5708
+ }], templates: [{
5709
+ type: ContentChildren,
5710
+ args: [MngTemplateDirective]
5711
+ }], components: [{
5712
+ type: ViewChildren,
5713
+ args: [MngComponentDirective]
5714
+ }], primeTable: [{
5715
+ type: ViewChild,
5716
+ args: [Table]
5717
+ }] } });
5718
+
5719
+ class MngTableviewComponent {
5720
+ constructor(route, messageService, translateService, dialogService, confirmationService, actionExecutor, viewContainerService) {
5721
+ this.route = route;
5722
+ this.messageService = messageService;
5723
+ this.translateService = translateService;
5724
+ this.dialogService = dialogService;
5725
+ this.confirmationService = confirmationService;
5726
+ this.actionExecutor = actionExecutor;
5727
+ this.viewContainerService = viewContainerService;
5728
+ this.actions = [];
5729
+ this.tableComponent = null;
5730
+ this.rowClickActions = [];
5731
+ this.rowInlineActions = [];
5732
+ this.toolbarLeftActions = [];
5733
+ this.toolbarRightActions = [];
5734
+ this.subscriptions = [];
5735
+ }
5736
+ ngOnInit() {
5737
+ this.viewContainerService.actions = this.actions;
5738
+ if (this.dataProvider) {
5739
+ this.viewContainerService.dataProvider = this.dataProvider;
5740
+ }
5741
+ const reloadTableSubscription = this.viewContainerService.reloadTable$.subscribe(() => {
5742
+ this.reloadTable();
5743
+ });
5744
+ this.subscriptions.push(reloadTableSubscription);
5745
+ for (const action of this.actions) {
5746
+ switch (action.position) {
5747
+ case ActionPositionEnum.RowClick:
5748
+ this.rowClickActions.push(action);
5749
+ break;
5750
+ case ActionPositionEnum.RowInline:
5751
+ this.rowInlineActions.push(action);
5752
+ break;
5753
+ case ActionPositionEnum.ToolbarLeft:
5754
+ this.toolbarLeftActions.push(action);
5755
+ break;
5756
+ case ActionPositionEnum.ToolbarRight:
5757
+ this.toolbarRightActions.push(action);
5758
+ break;
5759
+ }
5760
+ }
5761
+ this.toolbarRightActions = this.toolbarRightActions.reverse();
5762
+ }
5763
+ ngOnDestroy() {
5764
+ this.subscriptions.forEach(s => s.unsubscribe());
5765
+ }
5766
+ getMessageService() {
5767
+ return this.messageService;
5768
+ }
5769
+ getDataProvider() {
5770
+ return this.dataProvider;
5771
+ }
5772
+ reloadTable() {
5773
+ this.tableComponent?.reload();
5774
+ }
5775
+ onTableCellClick(event) {
5776
+ if (this.rowClickActions.length) {
5777
+ for (const action of this.rowClickActions) {
5778
+ this.actionExecutor.triggerRowClickAction(action, event, this.route);
5779
+ }
5780
+ }
5781
+ }
5782
+ }
5783
+ MngTableviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2.MessageService }, { token: i3$1.TranslateService }, { token: i3.DialogService }, { token: i2.ConfirmationService }, { token: MngActionExecutorService }, { token: MngViewContainerComponentService }], target: i0.ɵɵFactoryTarget.Component });
5784
+ MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, MngViewContainerComponentService], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table [descriptor]=\"descriptor.table\" [dataProvider]=\"dataProvider\" [useQueryParams]=\"true\" (cellClick)=\"onTableCellClick($event)\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle | translate }}</h5>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\">\n </mng-action>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n", components: [{ type: i6$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: i4$3.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "translate": i3$1.TranslatePipe } });
5785
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, decorators: [{
5786
+ type: Component,
5787
+ args: [{ selector: 'mng-tableview', providers: [MessageService, ConfirmationService, MngViewContainerComponentService], template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table [descriptor]=\"descriptor.table\" [dataProvider]=\"dataProvider\" [useQueryParams]=\"true\" (cellClick)=\"onTableCellClick($event)\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle | translate }}</h5>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\">\n </mng-action>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n" }]
5788
+ }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i2.MessageService }, { type: i3$1.TranslateService }, { type: i3.DialogService }, { type: i2.ConfirmationService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService }]; }, propDecorators: { descriptor: [{
5789
+ type: Input
5790
+ }], dataProvider: [{
5791
+ type: Input
5792
+ }], actions: [{
5793
+ type: Input
5794
+ }], tableComponent: [{
5795
+ type: ViewChild,
5796
+ args: [MngTableComponent]
5797
+ }] } });
5798
+
5799
+ class AMngTableviewRouteComponent {
5800
+ ngOnInit() {
5801
+ this.descriptor = this.createTableviewDescriptor();
5802
+ this.dataProvider = this.createTableviewDataProvider();
5803
+ this.actions = this.createActionDescriptors();
5804
+ }
5805
+ createActionDescriptors() {
5806
+ const actions = [];
5807
+ actions.push(new ActionEditorDetailsDescriptor(this.descriptor.viewEditor));
5808
+ actions.push(new ActionEditorAddDescriptor(this.descriptor.addEditor));
5809
+ actions.push(new ActionEditorEditDescriptor(this.descriptor.editEditor));
5810
+ actions.push(new ActionDeleteDescriptor(this.descriptor.model));
5811
+ return actions;
5812
+ }
5813
+ }
5814
+ AMngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: AMngTableviewRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
5815
+ AMngTableviewRouteComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: AMngTableviewRouteComponent, ngImport: i0 });
5816
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: AMngTableviewRouteComponent, decorators: [{
5817
+ type: Directive
5818
+ }] });
5819
+
5820
+ class MngTableviewRouteComponent extends AMngTableviewRouteComponent {
5821
+ constructor(route) {
5822
+ super();
5823
+ this.route = route;
5824
+ }
5825
+ createTableviewDescriptor() {
5826
+ if (!this.route.snapshot.data['tableviewData'].descriptor) {
5827
+ throw Error('Tableview requires a descriptor.');
5828
+ }
5829
+ return this.route.snapshot.data['tableviewData'].descriptor;
5830
+ }
5831
+ createTableviewDataProvider() {
5832
+ if (!this.route.snapshot.data['tableviewData'].dataProvider) {
5833
+ throw Error('Tableview requires a data provider.');
5834
+ }
5835
+ return this.route.snapshot.data['tableviewData'].dataProvider;
5836
+ }
5837
+ createActionDescriptors() {
5838
+ return this.route.snapshot.data['tableviewData'].actions ?? super.createActionDescriptors();
5839
+ }
5840
+ }
5841
+ MngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, deps: [{ token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
5842
+ MngTableviewRouteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableviewRouteComponent, selector: "mng-tableview-route", usesInheritance: true, ngImport: i0, template: "<div class=\"grid\">\n <div class=\"col-12\">\n <mng-tableview [descriptor]=\"descriptor\" [dataProvider]=\"dataProvider\" [actions]=\"actions\"></mng-tableview>\n </div>\n</div>\n", components: [{ type: MngTableviewComponent, selector: "mng-tableview", inputs: ["descriptor", "dataProvider", "actions"] }] });
5843
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, decorators: [{
5844
+ type: Component,
5845
+ args: [{ selector: 'mng-tableview-route', template: "<div class=\"grid\">\n <div class=\"col-12\">\n <mng-tableview [descriptor]=\"descriptor\" [dataProvider]=\"dataProvider\" [actions]=\"actions\"></mng-tableview>\n </div>\n</div>\n" }]
5846
+ }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }]; } });
5847
+
5848
+ class MngFormlyFieldLookupDialogComponent extends FieldType {
5849
+ constructor(injector) {
5850
+ super();
5851
+ this.injector = injector;
5852
+ this.fieldLabelFormControl = new FormControl();
5853
+ this.itemsSubject = new ReplaySubject(1);
5854
+ this.itemsAsync = this.itemsSubject.asObservable();
5855
+ this.addItemsSubject = new ReplaySubject(1);
5856
+ this.addItemsAsync = this.addItemsSubject.asObservable();
5857
+ this.dialogUseDataProvider = false;
5858
+ this.dialogDataProviderService = null;
5859
+ this.dialogIsLoadingSubject = new ReplaySubject(1);
5860
+ this.isDialogVisible = false;
5861
+ this.dialogAreItemsLoaded = false;
5862
+ this.dialogSelectedItem = null;
5863
+ this.dialogMessages = [];
5864
+ this.dialogIsLoading$ = this.dialogIsLoadingSubject.asObservable();
5865
+ this.subscriptions = [];
5866
+ }
5867
+ ngOnInit() {
5868
+ this.descriptor = this.to['descriptor'];
5869
+ // emit lifecycle event
5870
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Component, MngFormlyFieldLookupDialogComponent, this, {
5871
+ eventSubtype: MngFormFieldEventComponentSubtype.ON_INIT
5872
+ });
5873
+ this.config = this.descriptor.config;
5874
+ if (!this.descriptor.lookupTableDataProvider && this.descriptor.dataProvider?.serviceType) {
5875
+ this.dialogUseDataProvider = true;
5876
+ this.dialogDataProviderService = this.injector.get(this.descriptor.dataProvider.serviceType);
5877
+ }
5878
+ // init values
5879
+ this.setFieldLabelValue(this.formControl.value);
5880
+ const subscription = this.formControl.valueChanges.pipe(startWith(this.formControl.value), distinctUntilChanged((prev, curr) => {
5881
+ const compareProp = this.descriptor.lookupTableDescriptor.dataKeyProperty ?? this.descriptor.lookupTableDescriptor.model.idPropertyName;
5882
+ if (compareProp && typeof prev === 'object' && typeof curr === 'object') {
5883
+ return prev[compareProp] === curr[compareProp];
5884
+ }
5885
+ else {
5886
+ return prev === curr;
5014
5887
  }
5015
- this.isFilterChanged = false;
5016
- this.isSortChanged = false;
5017
- this.dataProviderLoadingSubject.next(false);
5018
- }, err => {
5019
- ToastUtil.tableNotificationError(this.translate, this.descriptor, err, this.tableviewService);
5020
- const emptyQueryResult = new MediusQueryResult();
5021
- emptyQueryResult.pageData = [];
5022
- emptyQueryResult.allDataCount = 0;
5023
- this.dataProviderQueryResultSubject.next(emptyQueryResult);
5024
- this.dataProviderLoadingSubject.next(false);
5888
+ })).subscribe(v => {
5889
+ this.setFieldLabelValue(v);
5890
+ this.itemsSubject.next(v);
5891
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.ValueChange, MngFormlyFieldLookupDialogComponent, this, {
5892
+ value: v
5893
+ });
5025
5894
  });
5026
- if (emitEvent) {
5027
- const mngEvent = new MngTableLoadEvent();
5028
- mngEvent.originalEvent = this.dataProviderLatestLazyLoadEvent ?? undefined;
5029
- mngEvent.queryParam = queryParam;
5030
- this.loadEventEmitter.next(mngEvent);
5031
- }
5895
+ this.subscriptions.push(subscription);
5032
5896
  }
5033
- loadTableFromRouteUpdate(params) {
5034
- const mediusQueryParam = MediusRestUtil.fromAngularQueryParamsToMediusQueryParams(params, this.filterDescriptors, this.rowsPerPageOptions[0]);
5035
- if (this.dataProviderLatestLazyLoadEventVersion < this.dataProviderLatestQueryParamVersion + 1) {
5036
- // update only if new version from query params will be higher
5037
- this.updatePrimeSortAndFilter(mediusQueryParam);
5038
- }
5039
- this.useQueryParamsInitialized = true;
5040
- this.loadTableWithDataProvider(mediusQueryParam);
5897
+ ngAfterViewInit() {
5898
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Component, MngFormlyFieldLookupDialogComponent, this, {
5899
+ eventSubtype: MngFormFieldEventComponentSubtype.ON_VIEW_INIT
5900
+ });
5041
5901
  }
5042
- updatePrimeSortAndFilter(mediusQueryParam) {
5043
- const primeSortMeta = [];
5044
- const primeFilterMeta = {};
5045
- this.filterDescriptors.forEach(f => {
5046
- primeFilterMeta[f.property] = {
5047
- value: null,
5048
- matchMode: f.filterType === TypeEnum.String ? 'contains' : 'equals'
5049
- };
5902
+ ngOnDestroy() {
5903
+ this.lookupDataProviderSubscription?.unsubscribe();
5904
+ this.subscriptions.forEach(s => s.unsubscribe());
5905
+ // emit lifecycle event
5906
+ this.descriptor?.nextEvent(MngFormFieldEventTypeEnum.Component, MngFormlyFieldLookupDialogComponent, this, {
5907
+ eventSubtype: MngFormFieldEventComponentSubtype.ON_DESTROY
5050
5908
  });
5051
- mediusQueryParam?.sortProperty?.forEach((s, idx) => {
5052
- primeSortMeta.push({
5053
- field: s,
5054
- order: mediusQueryParam?.sortAsc?.[idx] ?? true ? 1 : -1
5909
+ }
5910
+ openSelectDialog() {
5911
+ if (!this.dialogAreItemsLoaded && this.dialogUseDataProvider) {
5912
+ this.dialogIsLoadingSubject.next(true);
5913
+ const queryParamBuilder = MediusQueryParamBuilder.create(50);
5914
+ if (this.descriptor.lookupTableDescriptor.hasDefaultSort) {
5915
+ this.descriptor.lookupTableDescriptor.defaultSortProperty.forEach((p, idx) => queryParamBuilder.withSort(p, this.descriptor.lookupTableDescriptor.defaultSortAsc[idx]));
5916
+ }
5917
+ this.lookupDataProviderSubscription = this.descriptor.dataProvider?.lookup(queryParamBuilder.build(), this.dialogDataProviderService).subscribe({
5918
+ next: res => {
5919
+ const mqr = new MediusQueryResult();
5920
+ mqr.pageData = res;
5921
+ mqr.allDataCount = res.length;
5922
+ this.addItemsSubject.next(mqr);
5923
+ this.dialogAreItemsLoaded = true;
5924
+ this.dialogIsLoadingSubject.next(false);
5925
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.DataProvider, MngFormlyFieldLookupDialogComponent, this, {
5926
+ eventSubtype: 'LookupNext',
5927
+ queryResult: mqr
5928
+ });
5929
+ },
5930
+ error: err => {
5931
+ this.dialogIsLoadingSubject.next(false);
5932
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.DataProvider, MngFormlyFieldLookupDialogComponent, this, {
5933
+ eventSubtype: 'LookupError',
5934
+ queryResult: err
5935
+ });
5936
+ }
5055
5937
  });
5938
+ }
5939
+ this.dialogSelectedItem = null;
5940
+ this.isDialogVisible = true;
5941
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Dialog, MngFormlyFieldLookupDialogComponent, this, {
5942
+ eventSubtype: MngFormFieldEventDialogSubtype.VISIBILITY,
5943
+ dialogVisible: true
5056
5944
  });
5057
- mediusQueryParam?.filterParams?.forEach(f => {
5058
- const descriptor = this.filterDescriptors.find(fd => fd.filterProperty === f.property || fd.property === f.property);
5059
- const operator = MediusRestUtil.matchModeMapping.find(mapping => mapping[2] === f.filterMatchType);
5060
- if (descriptor && operator) {
5061
- primeFilterMeta[descriptor.property] = {
5062
- value: f.filterValue,
5063
- matchMode: operator[0]
5064
- };
5065
- }
5945
+ }
5946
+ onSelectionChange(item) {
5947
+ this.dialogSelectedItem = item;
5948
+ }
5949
+ onCaptionCmpInst(instance) {
5950
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Dialog, MngFormlyFieldLookupDialogComponent, this, {
5951
+ eventSubtype: MngFormFieldEventDialogSubtype.TABLE_CAPTION_COMPONENT_INSTANCE,
5952
+ captionComponentInstance: instance
5066
5953
  });
5067
- this.multiSortMeta = primeSortMeta;
5068
- this.filterMetadata = primeFilterMeta;
5069
- this.rows = mediusQueryParam?.itemsPerPage ?? this.rowsPerPageOptions[0];
5070
- this.offset = mediusQueryParam?.itemsOffset ?? 0;
5071
5954
  }
5072
- getDefaultSortMeta() {
5073
- if (this.descriptor.hasDefaultSort) {
5074
- return this.descriptor.defaultSortProperty.map((p, idx) => ({
5075
- field: p,
5076
- order: this.descriptor.defaultSortAsc[idx] ? 1 : -1
5077
- }));
5955
+ onColumnActionCmpInst(instance) {
5956
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Dialog, MngFormlyFieldLookupDialogComponent, this, {
5957
+ eventSubtype: MngFormFieldEventDialogSubtype.TABLE_COLUMN_ACTIONS_COMPONENT_INSTANCE,
5958
+ captionComponentInstance: instance
5959
+ });
5960
+ }
5961
+ clear() {
5962
+ this.formControl.setValue(undefined);
5963
+ this.dialogSelectedItem = null;
5964
+ this.dialogAreItemsLoaded = false;
5965
+ this.hideDialog();
5966
+ }
5967
+ hideDialog() {
5968
+ this.isDialogVisible = false;
5969
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Dialog, MngFormlyFieldLookupDialogComponent, this, {
5970
+ eventSubtype: MngFormFieldEventDialogSubtype.VISIBILITY,
5971
+ dialogVisible: false
5972
+ });
5973
+ }
5974
+ addItem() {
5975
+ this.formControl.setValue(this.dialogSelectedItem);
5976
+ this.dialogSelectedItem = null;
5977
+ this.dialogAreItemsLoaded = false;
5978
+ this.hideDialog();
5979
+ }
5980
+ setFieldLabelValue(value) {
5981
+ if (!value) {
5982
+ this.fieldLabelFormControl.setValue('');
5983
+ return;
5984
+ }
5985
+ if (typeof value === 'object') {
5986
+ const labelProperty = this.descriptor.itemsLabelProperty ?? this.descriptor.lookupTableDescriptor?.model.titlePropertyName;
5987
+ if (!labelProperty) {
5988
+ throw new Error('Could not determine label property.');
5989
+ }
5990
+ this.fieldLabelFormControl.setValue(value[labelProperty]);
5078
5991
  }
5079
5992
  else {
5080
- return [];
5993
+ this.fieldLabelFormControl.setValue(value);
5081
5994
  }
5082
5995
  }
5083
5996
  }
5084
- MngTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i1.ActivatedRoute }, { token: i2$2.TranslateService }, { token: TableviewComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
5085
- MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableComponent, selector: "mng-table", inputs: { descriptor: "descriptor", items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionEnabled: "selectionEnabled" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }], ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + descriptor.tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [rowHover]=\"true\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else defaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #defaultCaption>\n <h5 class=\"p-m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.property | i18nProperty: descriptor.model | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.property | i18nProperty: descriptor.model | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"columnActionTemplate\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <th *ngFor=\"let col of descriptor.columns\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"columnActionTemplate\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td *ngIf=\"selectionEnabled\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" class=\"clickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate\" class=\"text-right\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", components: [{ type: i4$4.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { type: i4$4.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { type: i4$4.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { type: i4$4.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { type: i7.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$4.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i4$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i2$2.TranslatePipe, "i18nProperty": MngI18nPropertyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5086
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, decorators: [{
5997
+ MngFormlyFieldLookupDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
5998
+ MngFormlyFieldLookupDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldLookupDialogComponent, selector: "mng-formly-field-lookup-dialog", viewQueries: [{ propertyName: "mngTable", first: true, predicate: MngTableComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div [class]=\"'p-inputgroup mng-dropdown-dialog' + descriptor.inputClassName\" [class.p-inputtext-sm]=\"descriptor.isSizeSmall\" [class.p-inputtext-lg]=\"descriptor.isSizeLarge\">\n <input pInputText type=\"text\" [id]=\"$any(key)\" [readonly]=\"true\" [formlyAttributes]=\"field\" [formControl]=\"fieldLabelFormControl\" />\n <i class=\"mng-dropdown-clear-icon pi pi-times\" (click)=\"clear()\" *ngIf=\"!to.required && formControl?.value\"></i>\n <button pButton pRipple class=\"mng-dropdown-dialog-search-button\" type=\"button\" [label]=\"'general.search' | translate: {item: ''}\" (click)=\"openSelectDialog()\"></button>\n</div>\n\n<p-dialog\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.search' | 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.lookupTableDescriptor!\"\n [dataProvider]=\"descriptor.lookupTableDataProvider\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [selectionMode]=\"'single'\"\n [loading]=\"dialogIsLoading$\"\n [captionComponent]=\"config?.table?.captionComponent\"\n [columnActionComponent]=\"config?.table?.columnActionComponent\"\n (selectionChange)=\"onSelectionChange($event)\"\n (captionComponentInstance)=\"onCaptionCmpInst($event)\"\n (columnActionComponentInstance)=\"onColumnActionCmpInst($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.select' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItem()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: i1$4.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: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i3$3.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10.InputText, selector: "[pInputText]" }, { type: i3$2.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { 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": i3$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5999
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, decorators: [{
5087
6000
  type: Component,
5088
- args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + descriptor.tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [rowHover]=\"true\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else defaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #defaultCaption>\n <h5 class=\"p-m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.property | i18nProperty: descriptor.model | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.property | i18nProperty: descriptor.model | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"columnActionTemplate\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <th *ngFor=\"let col of descriptor.columns\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"columnActionTemplate\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td *ngIf=\"selectionEnabled\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" class=\"clickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate\" class=\"text-right\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n" }]
5089
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2$2.TranslateService }, { type: TableviewComponentService, decorators: [{
5090
- type: Optional
5091
- }] }]; }, propDecorators: { descriptor: [{
5092
- type: Input
5093
- }], items: [{
5094
- type: Input
5095
- }], queryResult: [{
5096
- type: Input
5097
- }], loading: [{
5098
- type: Input
5099
- }], dataProvider: [{
5100
- type: Input
5101
- }], useQueryParams: [{
5102
- type: Input
5103
- }], selectionEnabled: [{
5104
- type: Input
5105
- }], loadEventEmitter: [{
5106
- type: Output,
5107
- args: ['tableLoad']
5108
- }], cellClickEventEmitter: [{
5109
- type: Output,
5110
- args: ['cellClick']
5111
- }], selectionChangeEventEmitter: [{
5112
- type: Output,
5113
- args: ['selectionChange']
5114
- }], templates: [{
5115
- type: ContentChildren,
5116
- args: [MngTemplateDirective]
5117
- }], primeTable: [{
6001
+ args: [{ selector: 'mng-formly-field-lookup-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'p-inputgroup mng-dropdown-dialog' + descriptor.inputClassName\" [class.p-inputtext-sm]=\"descriptor.isSizeSmall\" [class.p-inputtext-lg]=\"descriptor.isSizeLarge\">\n <input pInputText type=\"text\" [id]=\"$any(key)\" [readonly]=\"true\" [formlyAttributes]=\"field\" [formControl]=\"fieldLabelFormControl\" />\n <i class=\"mng-dropdown-clear-icon pi pi-times\" (click)=\"clear()\" *ngIf=\"!to.required && formControl?.value\"></i>\n <button pButton pRipple class=\"mng-dropdown-dialog-search-button\" type=\"button\" [label]=\"'general.search' | translate: {item: ''}\" (click)=\"openSelectDialog()\"></button>\n</div>\n\n<p-dialog\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.search' | 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.lookupTableDescriptor!\"\n [dataProvider]=\"descriptor.lookupTableDataProvider\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [selectionMode]=\"'single'\"\n [loading]=\"dialogIsLoading$\"\n [captionComponent]=\"config?.table?.captionComponent\"\n [columnActionComponent]=\"config?.table?.columnActionComponent\"\n (selectionChange)=\"onSelectionChange($event)\"\n (captionComponentInstance)=\"onCaptionCmpInst($event)\"\n (columnActionComponentInstance)=\"onColumnActionCmpInst($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.select' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItem()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n" }]
6002
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { mngTable: [{
5118
6003
  type: ViewChild,
5119
- args: [Table]
6004
+ args: [MngTableComponent]
5120
6005
  }] } });
5121
6006
 
6007
+ var SizeEnum = ActionDescriptor.SizeEnum;
5122
6008
  class MngFormlyFieldTableDialogFormComponent extends FieldType {
5123
6009
  constructor() {
5124
6010
  super(...arguments);
@@ -5127,6 +6013,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5127
6013
  this.toolbarActions = [];
5128
6014
  this.rowActions = [];
5129
6015
  this.subscriptions = [];
6016
+ this.isDisabledSubject = new BehaviorSubject(false);
6017
+ this.isEnabled$ = this.isDisabledSubject.asObservable().pipe(distinctUntilChanged(), map(e => !e));
5130
6018
  }
5131
6019
  ngOnInit() {
5132
6020
  this.descriptor = this.to['descriptor'];
@@ -5138,6 +6026,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5138
6026
  .withTitle(null)
5139
6027
  .withIcon('pi pi-plus')
5140
6028
  .withClassName('mng-formly-field-table-form-dialog')
6029
+ .withSize(SizeEnum.ExtraSmall)
5141
6030
  .withSubmitFunction(ctx => {
5142
6031
  if (!ctx.data?.item) {
5143
6032
  throw new Error(`No item was provided in context, edit cannot be done.`);
@@ -5148,7 +6037,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5148
6037
  this.formControl.patchValue(value);
5149
6038
  return of(ctx.data.item);
5150
6039
  })
5151
- .withIsVisibleFunction(() => of(!this.options?.formState.disabled));
6040
+ .withIsVisibleFunction(() => of(!this.options?.formState.disabled))
6041
+ .withIsEnabledFunction(() => this.isEnabled$);
5152
6042
  this.toolbarActions.push(addAction);
5153
6043
  }
5154
6044
  if (hasEditAction) {
@@ -5156,6 +6046,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5156
6046
  .withTitle(null)
5157
6047
  .withIcon('pi pi-pencil')
5158
6048
  .withClassName('mng-formly-field-table-form-dialog')
6049
+ .withSize(SizeEnum.ExtraSmall)
5159
6050
  .withSubmitFunction(ctx => {
5160
6051
  if (!ctx.data?.item) {
5161
6052
  throw new Error(`No item was provided in context, edit cannot be done.`);
@@ -5166,7 +6057,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5166
6057
  this.formControl.patchValue(formControlValue);
5167
6058
  return of(ctx.data.item);
5168
6059
  })
5169
- .withIsVisibleFunction(() => of(!this.options?.formState.disabled));
6060
+ .withIsVisibleFunction(() => of(!this.formControl?.disabled))
6061
+ .withIsEnabledFunction(() => this.isEnabled$);
5170
6062
  this.rowActions.push(editAction);
5171
6063
  }
5172
6064
  if (hasDeleteAction) {
@@ -5174,6 +6066,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5174
6066
  .withLevel(ActionLevelEnum.Danger)
5175
6067
  .withTitle(null)
5176
6068
  .withIcon('pi pi-trash')
6069
+ .withSize(SizeEnum.ExtraSmall)
5177
6070
  .withRunFunction(ctx => {
5178
6071
  if (!ctx.data?.item) {
5179
6072
  throw new Error(`No item was provided in context, delete cannot be done.`);
@@ -5193,27 +6086,38 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5193
6086
  this.formControl.patchValue(formControlValue);
5194
6087
  return of(ctx.data.item);
5195
6088
  })
5196
- .withIsVisibleFunction(() => of(!this.options?.formState.disabled));
6089
+ .withIsVisibleFunction(() => of(!this.options?.formState.disabled))
6090
+ .withIsEnabledFunction(() => this.isEnabled$);
5197
6091
  this.rowActions.push(deleteAction);
5198
6092
  }
5199
6093
  // init values
5200
6094
  if (typeof this.formControl.value === 'undefined' || this.formControl.value === null) {
5201
6095
  this.formControl.patchValue([]);
5202
6096
  }
5203
- const subscription = this.formControl.valueChanges.pipe(startWith(this.formControl.value)).subscribe(v => {
6097
+ let subscription = this.formControl.valueChanges.pipe(startWith(this.formControl.value)).subscribe(v => {
5204
6098
  this.itemsSubject.next(v);
5205
6099
  });
5206
6100
  this.subscriptions.push(subscription);
6101
+ this.isDisabledSubject.next(this.formControl.disabled);
6102
+ subscription = this.formControl.statusChanges.pipe().subscribe(status => {
6103
+ if (status === 'DISABLED' && !this.isDisabledSubject.value) {
6104
+ this.isDisabledSubject.next(true);
6105
+ }
6106
+ else if (status !== 'DISABLED' && this.isDisabledSubject.value) {
6107
+ this.isDisabledSubject.next(false);
6108
+ }
6109
+ });
6110
+ this.subscriptions.push(subscription);
5207
6111
  }
5208
6112
  ngOnDestroy() {
5209
6113
  this.subscriptions.forEach(s => s.unsubscribe());
5210
6114
  }
5211
6115
  }
5212
6116
  MngFormlyFieldTableDialogFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
5213
- MngFormlyFieldTableDialogFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTableDialogFormComponent, selector: "mng-formly-table-dialog-form-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end table-header\">\n <label class=\"mng-datatable-form-label p-m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <mng-action *ngFor=\"let action of toolbarActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\" let-idx=\"rowIndex\">\n <mng-action\n *ngFor=\"let action of rowActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.tableviewDescriptor.model.idPropertyName ? item[descriptor.tableviewDescriptor.model.idPropertyName] : undefined\"\n [actionData]=\"{itemIndex: idx}\">\n </mng-action>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"], components: [{ type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionEnabled"], outputs: ["tableLoad", "cellClick", "selectionChange"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6117
+ MngFormlyFieldTableDialogFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTableDialogFormComponent, selector: "mng-formly-table-dialog-form-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header\">\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 <mng-action *ngFor=\"let action of toolbarActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\" let-idx=\"rowIndex\">\n <mng-action\n *ngFor=\"let action of rowActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.tableviewDescriptor.model.idPropertyName ? item[descriptor.tableviewDescriptor.model.idPropertyName] : undefined\"\n [actionData]=\"{itemIndex: idx}\">\n </mng-action>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"], components: [{ type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5214
6118
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, decorators: [{
5215
6119
  type: Component,
5216
- args: [{ selector: 'mng-formly-table-dialog-form-field', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end table-header\">\n <label class=\"mng-datatable-form-label p-m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <mng-action *ngFor=\"let action of toolbarActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\" let-idx=\"rowIndex\">\n <mng-action\n *ngFor=\"let action of rowActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.tableviewDescriptor.model.idPropertyName ? item[descriptor.tableviewDescriptor.model.idPropertyName] : undefined\"\n [actionData]=\"{itemIndex: idx}\">\n </mng-action>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"] }]
6120
+ args: [{ selector: 'mng-formly-table-dialog-form-field', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header\">\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 <mng-action *ngFor=\"let action of toolbarActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\" let-idx=\"rowIndex\">\n <mng-action\n *ngFor=\"let action of rowActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.tableviewDescriptor.model.idPropertyName ? item[descriptor.tableviewDescriptor.model.idPropertyName] : undefined\"\n [actionData]=\"{itemIndex: idx}\">\n </mng-action>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"] }]
5217
6121
  }] });
5218
6122
 
5219
6123
  class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
@@ -5268,12 +6172,15 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
5268
6172
  const filterValues = this.formControl.value.map((i) => i[this.descriptor.excludeValueProperty]);
5269
6173
  queryParamBuilder.withFilter(this.descriptor.excludeFilterProperty, filterValues, undefined, MediusFilterMatchType.NotIn);
5270
6174
  }
5271
- this.lookupDataProviderSubscription = this.descriptor.lookupTableDataProvider?.getAll(queryParamBuilder.build(), this.dialogDataProviderService).subscribe(res => {
5272
- this.addItemsSubject.next(res);
5273
- this.dialogAreItemsLoaded = true;
5274
- this.dialogIsLoadingSubject.next(false);
5275
- }, () => {
5276
- this.dialogIsLoadingSubject.next(false);
6175
+ this.lookupDataProviderSubscription = this.descriptor.lookupTableDataProvider?.getAll(queryParamBuilder.build(), this.dialogDataProviderService).subscribe({
6176
+ next: res => {
6177
+ this.addItemsSubject.next(res);
6178
+ this.dialogAreItemsLoaded = true;
6179
+ this.dialogIsLoadingSubject.next(false);
6180
+ },
6181
+ error: () => {
6182
+ this.dialogIsLoadingSubject.next(false);
6183
+ }
5277
6184
  });
5278
6185
  }
5279
6186
  this.dialogSelectedAddItems = [];
@@ -5318,16 +6225,16 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
5318
6225
  }
5319
6226
  }
5320
6227
  MngFormlyFieldTableDialogMultiselectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
5321
- 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 table-header\">\n <label class=\"mng-datatable-form-label p-m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <button\n *ngIf=\"hasAddAction && !formControl!.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-success\"\n (click)=\"openAddDialog()\"></button>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <button\n *ngIf=\"hasDeleteAction && !formControl!.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-danger\"\n (click)=\"removeItem(item)\"></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", "selectionEnabled"], outputs: ["tableLoad", "cellClick", "selectionChange"] }, { type: i2$6.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$1.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$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i9.Ripple, selector: "[pRipple]" }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i2$2.TranslatePipe, "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6228
+ 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", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i1$4.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$3.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": i3$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5322
6229
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, decorators: [{
5323
6230
  type: Component,
5324
- 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 table-header\">\n <label class=\"mng-datatable-form-label p-m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <button\n *ngIf=\"hasAddAction && !formControl!.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-success\"\n (click)=\"openAddDialog()\"></button>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <button\n *ngIf=\"hasDeleteAction && !formControl!.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-danger\"\n (click)=\"removeItem(item)\"></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" }]
6231
+ 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" }]
5325
6232
  }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
5326
6233
 
5327
6234
  class MngFormlyFieldTabsComponent extends FieldType {
5328
6235
  }
5329
6236
  MngFormlyFieldTabsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTabsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
5330
- MngFormlyFieldTabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTabsComponent, selector: "mng-formly-field-tabs", usesInheritance: true, ngImport: i0, template: "<p-tabView>\n <p-tabPanel\n *ngFor=\"let tab of field.fieldGroup; let i = index; let last = last\"\n [header]=\"tab.templateOptions?.label! | translate\"\n [headerStyleClass]=\"$any(formControl!.valid ? 'p-tabview-title' : null)\">\n <ng-template pTemplate=\"header\">\n <span\n class=\"p-tabview-title\"\n [class.p-tabview-title-error]=\"formState.submittedOn && formState['tab_' + (tab.id ? tab.id : tab.templateOptions?.label!) + '_invalid']\"\n >{{ tab.templateOptions?.label! | translate }}</span\n >\n </ng-template>\n <formly-field [field]=\"tab\"></formly-field>\n </p-tabPanel>\n</p-tabView>\n", components: [{ type: i1$4.TabView, selector: "p-tabView", inputs: ["orientation", "style", "styleClass", "controlClose", "scrollable", "activeIndex"], outputs: ["onChange", "onClose", "activeIndexChange"] }, { type: i1$4.TabPanel, selector: "p-tabPanel", inputs: ["closable", "headerStyle", "headerStyleClass", "cache", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "selected", "disabled", "header", "leftIcon", "rightIcon"] }, { type: i3.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6237
+ MngFormlyFieldTabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTabsComponent, selector: "mng-formly-field-tabs", usesInheritance: true, ngImport: i0, template: "<p-tabView>\n <p-tabPanel\n *ngFor=\"let tab of field.fieldGroup; let i = index; let last = last\"\n [header]=\"tab.templateOptions?.label! | translate\"\n [headerStyleClass]=\"$any(formControl!.valid ? 'p-tabview-title' : null)\">\n <ng-template pTemplate=\"header\">\n <span\n class=\"p-tabview-title\"\n [class.p-tabview-title-error]=\"formState.submittedOn && formState['tab_' + (tab.id ? tab.id : tab.templateOptions?.label!) + '_invalid']\"\n >{{ tab.templateOptions?.label! | translate }}</span\n >\n </ng-template>\n <formly-field [field]=\"tab\"></formly-field>\n </p-tabPanel>\n</p-tabView>\n", components: [{ type: i1$5.TabView, selector: "p-tabView", inputs: ["orientation", "style", "styleClass", "controlClose", "scrollable", "activeIndex"], outputs: ["onChange", "onClose", "activeIndexChange"] }, { type: i1$5.TabPanel, selector: "p-tabPanel", inputs: ["closable", "headerStyle", "headerStyleClass", "cache", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "selected", "disabled", "header", "leftIcon", "rightIcon"] }, { type: i3$2.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5331
6238
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTabsComponent, decorators: [{
5332
6239
  type: Component,
5333
6240
  args: [{ selector: 'mng-formly-field-tabs', changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-tabView>\n <p-tabPanel\n *ngFor=\"let tab of field.fieldGroup; let i = index; let last = last\"\n [header]=\"tab.templateOptions?.label! | translate\"\n [headerStyleClass]=\"$any(formControl!.valid ? 'p-tabview-title' : null)\">\n <ng-template pTemplate=\"header\">\n <span\n class=\"p-tabview-title\"\n [class.p-tabview-title-error]=\"formState.submittedOn && formState['tab_' + (tab.id ? tab.id : tab.templateOptions?.label!) + '_invalid']\"\n >{{ tab.templateOptions?.label! | translate }}</span\n >\n </ng-template>\n <formly-field [field]=\"tab\"></formly-field>\n </p-tabPanel>\n</p-tabView>\n" }]
@@ -5336,7 +6243,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
5336
6243
  class MngFormlyFieldFieldsetComponent extends FieldType {
5337
6244
  }
5338
6245
  MngFormlyFieldFieldsetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldFieldsetComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
5339
- 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.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6246
+ 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$6.Fieldset, selector: "p-fieldset", inputs: ["legend", "toggleable", "collapsed", "style", "styleClass", "transitionOptions"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }, { type: i3$2.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": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5340
6247
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldFieldsetComponent, decorators: [{
5341
6248
  type: Component,
5342
6249
  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" }]
@@ -5345,19 +6252,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
5345
6252
  class MngFormlyFieldWrapperComponent extends FieldWrapper {
5346
6253
  }
5347
6254
  MngFormlyFieldWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
5348
- 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\">{{ $any(to?.label) | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <ng-container #fieldComponent></ng-container>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n</div>\n", components: [{ type: i3.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6255
+ 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$2.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5349
6256
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldWrapperComponent, decorators: [{
5350
6257
  type: Component,
5351
- args: [{ selector: 'mng-formly-field-wrapper', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"field\">\n <label [for]=\"key\">{{ $any(to?.label) | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <ng-container #fieldComponent></ng-container>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n</div>\n" }]
6258
+ 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" }]
5352
6259
  }] });
5353
6260
 
5354
6261
  class MngFormlyTableWrapperComponent extends FieldWrapper {
5355
6262
  }
5356
6263
  MngFormlyTableWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyTableWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
5357
- 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=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n</div>\n", components: [{ type: i3.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
6264
+ 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$2.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5358
6265
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyTableWrapperComponent, decorators: [{
5359
6266
  type: Component,
5360
- args: [{ selector: 'mng-formly-table-wrapper', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"field table\">\n <ng-container #fieldComponent></ng-container>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n</div>\n" }]
6267
+ 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" }]
5361
6268
  }] });
5362
6269
 
5363
6270
  class MngBreadcrumbComponent {
@@ -5366,7 +6273,7 @@ class MngBreadcrumbComponent {
5366
6273
  }
5367
6274
  }
5368
6275
  MngBreadcrumbComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBreadcrumbComponent, deps: [{ token: MngCommonsService }], target: i0.ɵɵFactoryTarget.Component });
5369
- MngBreadcrumbComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngBreadcrumbComponent, selector: "mng-breadcrumb", ngImport: i0, template: "<div class=\"layout-breadcrumb-container\">\n <div class=\"layout-breadcrumb\">\n <p-breadcrumb [home]=\"$any(mngCommons.breadcrumbHome$ | async)\" [model]=\"$any(mngCommons.breadcrumbs$ | async)\" styleClass=\"layout-breadcrumb py-2\"></p-breadcrumb>\n </div>\n</div>\n", components: [{ type: i2$7.Breadcrumb, selector: "p-breadcrumb", inputs: ["model", "style", "styleClass", "home", "homeAriaLabel"], outputs: ["onItemClick"] }], pipes: { "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6276
+ MngBreadcrumbComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngBreadcrumbComponent, selector: "mng-breadcrumb", ngImport: i0, template: "<div class=\"layout-breadcrumb-container\">\n <div class=\"layout-breadcrumb\">\n <p-breadcrumb [home]=\"$any(mngCommons.breadcrumbHome$ | async)\" [model]=\"$any(mngCommons.breadcrumbs$ | async)\" styleClass=\"layout-breadcrumb py-2\"></p-breadcrumb>\n </div>\n</div>\n", components: [{ type: i2$3.Breadcrumb, selector: "p-breadcrumb", inputs: ["model", "style", "styleClass", "home", "homeAriaLabel"], outputs: ["onItemClick"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5370
6277
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBreadcrumbComponent, decorators: [{
5371
6278
  type: Component,
5372
6279
  args: [{ selector: 'mng-breadcrumb', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"layout-breadcrumb-container\">\n <div class=\"layout-breadcrumb\">\n <p-breadcrumb [home]=\"$any(mngCommons.breadcrumbHome$ | async)\" [model]=\"$any(mngCommons.breadcrumbs$ | async)\" styleClass=\"layout-breadcrumb py-2\"></p-breadcrumb>\n </div>\n</div>\n" }]
@@ -5379,7 +6286,7 @@ class MngFooterComponent {
5379
6286
  }
5380
6287
  }
5381
6288
  MngFooterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFooterComponent, deps: [{ token: MngCommonsService }], target: i0.ɵɵFactoryTarget.Component });
5382
- MngFooterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFooterComponent, selector: "mng-footer", ngImport: i0, template: "<div class=\"layout-footer\">\n <div class=\"footer-logo-container\">\n <img id=\"footer-logo\" [src]=\"mngCommons.colorSchemeIsLight ? mngCommons.appLogoDark : mngCommons.appLogoLight\" alt=\"atlantis-layout\" />\n <span class=\"app-name\">{{ mngCommons.appName | translate }}</span>\n </div>\n <span class=\"copyright\">&#169; {{ mngCommons.appOwner | translate }} - {{ currentYear }}</span>\n</div>\n", pipes: { "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6289
+ MngFooterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFooterComponent, selector: "mng-footer", ngImport: i0, template: "<div class=\"layout-footer\">\n <div class=\"footer-logo-container\">\n <img id=\"footer-logo\" [src]=\"mngCommons.colorSchemeIsLight ? mngCommons.appLogoDark : mngCommons.appLogoLight\" alt=\"atlantis-layout\" />\n <span class=\"app-name\">{{ mngCommons.appName | translate }}</span>\n </div>\n <span class=\"copyright\">&#169; {{ mngCommons.appOwner | translate }} - {{ currentYear }}</span>\n</div>\n", pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5383
6290
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFooterComponent, decorators: [{
5384
6291
  type: Component,
5385
6292
  args: [{ selector: 'mng-footer', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"layout-footer\">\n <div class=\"footer-logo-container\">\n <img id=\"footer-logo\" [src]=\"mngCommons.colorSchemeIsLight ? mngCommons.appLogoDark : mngCommons.appLogoLight\" alt=\"atlantis-layout\" />\n <span class=\"app-name\">{{ mngCommons.appName | translate }}</span>\n </div>\n <span class=\"copyright\">&#169; {{ mngCommons.appOwner | translate }} - {{ currentYear }}</span>\n</div>\n" }]
@@ -5715,7 +6622,7 @@ class MngMenuItemComponent {
5715
6622
  }
5716
6623
  }
5717
6624
  MngMenuItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngMenuItemComponent, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i1.ActivatedRoute }, { token: MngCommonsService }, { token: MngMainLayoutComponentService }], target: i0.ɵɵFactoryTarget.Component });
5718
- MngMenuItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: { item: "item", index: "index", root: "root", parentKey: "parentKey" }, host: { properties: { "class.layout-root-menuitem": "root", "class.active-menuitem": "active" } }, ngImport: i0, template: "<ng-container>\n <div *ngIf=\"root && item.visible !== false && (isAllowed$ | async) === true\" class=\"layout-menuitem-root-text\">{{ item.label! | translate }}</div>\n <a\n *ngIf=\"(!item.routerLink || item.items) && item.visible !== false && (isAllowed$ | async) === true\"\n [attr.href]=\"item.href\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (keydown.enter)=\"itemClick($event)\"\n [routerLink]=\"item.routerLink\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <a\n *ngIf=\"item.routerLink && !item.items && item.visible !== false && (isAllowed$ | async) === true\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"hover = true\"\n (mouseleave)=\"hover = false\"\n [routerLink]=\"item.routerLink\"\n routerLinkActive=\"active-menuitem-routerlink\"\n [routerLinkActiveOptions]=\"{exact: true}\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <ul\n *ngIf=\"((item.items && active) || (item.items && (mngCommons.menuModeIsStatic$ | async) && (root || active))) && item.visible !== false && (isAllowed$ | async) === true\"\n [@children]=\"\n (mngCommons.menuModeIsSlim$ | async) && (mainLayoutService.isMobile$ | async) === false && root\n ? active\n ? 'visible'\n : 'hidden'\n : (mngCommons.menuModeIsStatic$ | async) && root && (mainLayoutService.isMobile$ | async) === false\n ? 'visible'\n : active\n ? 'visibleAnimated'\n : 'hiddenAnimated'\n \">\n <ng-template ngFor let-child let-i=\"index\" [ngForOf]=\"item.items\">\n <li mng-menuitem [item]=\"child\" [index]=\"i\" [parentKey]=\"key\" [class]=\"child.badgeClassName\"></li>\n </ng-template>\n </ul>\n</ng-container>\n", components: [{ type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: ["item", "index", "root", "parentKey"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i9.Ripple, selector: "[pRipple]" }, { type: i4$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i2$2.TranslatePipe }, animations: [
6625
+ MngMenuItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: { item: "item", index: "index", root: "root", parentKey: "parentKey" }, host: { properties: { "class.layout-root-menuitem": "root", "class.active-menuitem": "active" } }, ngImport: i0, template: "<ng-container>\n <div *ngIf=\"root && item.visible !== false && (isAllowed$ | async) === true\" class=\"layout-menuitem-root-text\">{{ item.label! | translate }}</div>\n <a\n *ngIf=\"(!item.routerLink || item.items) && item.visible !== false && (isAllowed$ | async) === true\"\n [attr.href]=\"item.href\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (keydown.enter)=\"itemClick($event)\"\n [routerLink]=\"item.routerLink\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <a\n *ngIf=\"item.routerLink && !item.items && item.visible !== false && (isAllowed$ | async) === true\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"hover = true\"\n (mouseleave)=\"hover = false\"\n [routerLink]=\"item.routerLink\"\n routerLinkActive=\"active-menuitem-routerlink\"\n [routerLinkActiveOptions]=\"{exact: true}\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <ul\n *ngIf=\"((item.items && active) || (item.items && (mngCommons.menuModeIsStatic$ | async) && (root || active))) && item.visible !== false && (isAllowed$ | async) === true\"\n [@children]=\"\n (mngCommons.menuModeIsSlim$ | async) && (mainLayoutService.isMobile$ | async) === false && root\n ? active\n ? 'visible'\n : 'hidden'\n : (mngCommons.menuModeIsStatic$ | async) && root && (mainLayoutService.isMobile$ | async) === false\n ? 'visible'\n : active\n ? 'visibleAnimated'\n : 'hiddenAnimated'\n \">\n <ng-template ngFor let-child let-i=\"index\" [ngForOf]=\"item.items\">\n <li mng-menuitem [item]=\"child\" [index]=\"i\" [parentKey]=\"key\" [class]=\"child.badgeClassName\"></li>\n </ng-template>\n </ul>\n</ng-container>\n", components: [{ type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: ["item", "index", "root", "parentKey"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4.AsyncPipe, "translate": i3$1.TranslatePipe }, animations: [
5719
6626
  trigger('children', [
5720
6627
  state('void', style({
5721
6628
  height: '0px'
@@ -5785,7 +6692,7 @@ class MngMenuComponent {
5785
6692
  }
5786
6693
  }
5787
6694
  MngMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngMenuComponent, deps: [{ token: MngCommonsService }, { token: MngMainLayoutComponentService }], target: i0.ɵɵFactoryTarget.Component });
5788
- MngMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMenuComponent, selector: "mng-menu", ngImport: i0, template: "<div\n class=\"layout-menu-wrapper\"\n [ngClass]=\"{'layout-sidebar-active': (mainLayoutService.sidebarActive$ | async)}\"\n (click)=\"mainLayoutService.onSidebarClick($event)\"\n (mouseover)=\"mainLayoutService.onSidebarMouseOver($event)\"\n (mouseleave)=\"mainLayoutService.onSidebarMouseLeave($event)\">\n <div class=\"menu-logo\">\n <a routerLink=\"/\" class=\"logo\">\n <img [src]=\"mngCommons.colorSchemeIsLight ? mngCommons.appLogoDark : mngCommons.appLogoLight\" />\n </a>\n\n <a routerLink=\"/\" class=\"app-name\" *ngIf=\"(mngCommons.menuModeIsSlim$ | async) === false || (mainLayoutService.isMobile$ | async)\">\n <img [src]=\"mngCommons.colorSchemeIsLight ? mngCommons.appLogoNameDark : mngCommons.appLogoNameLight\" />\n </a>\n <a *ngIf=\"mngCommons.menuPinEnabled\" class=\"menu-pin\" (click)=\"mainLayoutService.onToggleMenu($event)\">\n <span *ngIf=\"mngCommons.menuModeIsOverlay$ | async\" class=\"pi pi-times\"></span>\n <span\n *ngIf=\"(mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async) === false && (mainLayoutService.pinActive$ | async)\"\n class=\"pi pi-unlock\"></span>\n <span *ngIf=\"(mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async) && (mainLayoutService.pinActive$ | async)\" class=\"pi pi-lock\"></span>\n </a>\n </div>\n\n <div class=\"layout-menu-container\">\n <ul class=\"layout-menu\">\n <ng-container *ngFor=\"let item of mngCommons.menuItems; let i = index\">\n <li mng-menuitem *ngIf=\"!item.separator\" [item]=\"item\" [index]=\"i\" [root]=\"true\"></li>\n <li *ngIf=\"item.separator\" class=\"menu-separator\"></li>\n </ng-container>\n </ul>\n </div>\n</div>\n", components: [{ type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: ["item", "index", "root", "parentKey"] }], directives: [{ type: i4$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6695
+ MngMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMenuComponent, selector: "mng-menu", ngImport: i0, template: "<div\n class=\"layout-menu-wrapper\"\n [ngClass]=\"{'layout-sidebar-active': (mainLayoutService.sidebarActive$ | async)}\"\n (click)=\"mainLayoutService.onSidebarClick($event)\"\n (mouseover)=\"mainLayoutService.onSidebarMouseOver($event)\"\n (mouseleave)=\"mainLayoutService.onSidebarMouseLeave($event)\">\n <div class=\"menu-logo\">\n <a routerLink=\"/\" class=\"logo\">\n <img [src]=\"mngCommons.colorSchemeIsLight ? mngCommons.appLogoDark : mngCommons.appLogoLight\" />\n </a>\n\n <a routerLink=\"/\" class=\"app-name\" *ngIf=\"(mngCommons.menuModeIsSlim$ | async) === false || (mainLayoutService.isMobile$ | async)\">\n <img [src]=\"mngCommons.colorSchemeIsLight ? mngCommons.appLogoNameDark : mngCommons.appLogoNameLight\" />\n </a>\n <a *ngIf=\"mngCommons.menuPinEnabled\" class=\"menu-pin\" (click)=\"mainLayoutService.onToggleMenu($event)\">\n <span *ngIf=\"mngCommons.menuModeIsOverlay$ | async\" class=\"pi pi-times\"></span>\n <span\n *ngIf=\"(mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async) === false && (mainLayoutService.pinActive$ | async)\"\n class=\"pi pi-unlock\"></span>\n <span *ngIf=\"(mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async) && (mainLayoutService.pinActive$ | async)\" class=\"pi pi-lock\"></span>\n </a>\n </div>\n\n <div class=\"layout-menu-container\">\n <ul class=\"layout-menu\">\n <ng-container *ngFor=\"let item of mngCommons.menuItems; let i = index\">\n <li mng-menuitem *ngIf=\"!item.separator\" [item]=\"item\" [index]=\"i\" [root]=\"true\"></li>\n <li *ngIf=\"item.separator\" class=\"menu-separator\"></li>\n </ng-container>\n </ul>\n </div>\n</div>\n", components: [{ type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: ["item", "index", "root", "parentKey"] }], directives: [{ type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5789
6696
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngMenuComponent, decorators: [{
5790
6697
  type: Component,
5791
6698
  args: [{ selector: 'mng-menu', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"layout-menu-wrapper\"\n [ngClass]=\"{'layout-sidebar-active': (mainLayoutService.sidebarActive$ | async)}\"\n (click)=\"mainLayoutService.onSidebarClick($event)\"\n (mouseover)=\"mainLayoutService.onSidebarMouseOver($event)\"\n (mouseleave)=\"mainLayoutService.onSidebarMouseLeave($event)\">\n <div class=\"menu-logo\">\n <a routerLink=\"/\" class=\"logo\">\n <img [src]=\"mngCommons.colorSchemeIsLight ? mngCommons.appLogoDark : mngCommons.appLogoLight\" />\n </a>\n\n <a routerLink=\"/\" class=\"app-name\" *ngIf=\"(mngCommons.menuModeIsSlim$ | async) === false || (mainLayoutService.isMobile$ | async)\">\n <img [src]=\"mngCommons.colorSchemeIsLight ? mngCommons.appLogoNameDark : mngCommons.appLogoNameLight\" />\n </a>\n <a *ngIf=\"mngCommons.menuPinEnabled\" class=\"menu-pin\" (click)=\"mainLayoutService.onToggleMenu($event)\">\n <span *ngIf=\"mngCommons.menuModeIsOverlay$ | async\" class=\"pi pi-times\"></span>\n <span\n *ngIf=\"(mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async) === false && (mainLayoutService.pinActive$ | async)\"\n class=\"pi pi-unlock\"></span>\n <span *ngIf=\"(mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async) && (mainLayoutService.pinActive$ | async)\" class=\"pi pi-lock\"></span>\n </a>\n </div>\n\n <div class=\"layout-menu-container\">\n <ul class=\"layout-menu\">\n <ng-container *ngFor=\"let item of mngCommons.menuItems; let i = index\">\n <li mng-menuitem *ngIf=\"!item.separator\" [item]=\"item\" [index]=\"i\" [root]=\"true\"></li>\n <li *ngIf=\"item.separator\" class=\"menu-separator\"></li>\n </ng-container>\n </ul>\n </div>\n</div>\n" }]
@@ -5827,7 +6734,7 @@ class MngTopbarComponent {
5827
6734
  }
5828
6735
  }
5829
6736
  MngTopbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTopbarComponent, deps: [{ token: i1.ActivatedRoute }, { token: MngCommonsService }, { token: MngMainLayoutComponentService }], target: i0.ɵɵFactoryTarget.Component });
5830
- MngTopbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTopbarComponent, selector: "mng-topbar", viewQueries: [{ propertyName: "templates", predicate: MngTemplateDirective, descendants: true }], ngImport: i0, template: "<div class=\"layout-topbar\">\n <div class=\"layout-topbar-left\">\n <a\n href=\"#\"\n class=\"topbar-menu-button\"\n (click)=\"mainLayoutService.onMenuButtonClick($event)\"\n *ngIf=\"(mngCommons.menuModeIsOverlay$ | async) || (mainLayoutService.isMobile$ | async)\">\n <i class=\"pi pi-bars\"></i>\n </a>\n\n <ng-container [mngComponent]=\"breadcrumbComponent\"></ng-container>\n </div>\n\n <ng-container [mngComponent]=\"menuComponent\"></ng-container>\n\n <div class=\"layout-topbar-right\">\n <ul class=\"layout-topbar-right-items\">\n <li #profile class=\"profile-item\" [ngClass]=\"{'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile}\">\n <a href=\"#\" (click)=\"mainLayoutService.onTopbarItemClick($event, profile)\">\n <i class=\"pi pi-fw pi-user\"></i>\n </a>\n <ul class=\"fadeInDown\" *ngIf=\"user\">\n <li role=\"menuitem\">\n <a>\n {{ user?.displayName ?? user?.username }}\n </a>\n </li>\n <li role=\"menuitem\" *ngIf=\"user?.logout || user?.logoutUrl\">\n <a [href]=\"user?.logoutUrl\" (click)=\"logout(user, $event)\">\n <i class=\"pi pi-fw pi-sign-out\"></i>\n <span>{{ 'mngTopbar.logout' | translate }}</span>\n </a>\n </li>\n </ul>\n </li>\n <li *ngIf=\"languages.length > 1\" class=\"profile-item\" [ngClass]=\"{'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile}\">\n <i class=\"pi pi-fw pi-globe\"></i>\n <p-dropdown [ngModel]=\"selectedLanguage\" [options]=\"languages\" (onChange)=\"switchLanguage($event.value)\"></p-dropdown>\n </li>\n </ul>\n </div>\n</div>\n", components: [{ type: i1$2.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "virtualScroll", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "disabled", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent"] }, { type: i4$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6737
+ MngTopbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTopbarComponent, selector: "mng-topbar", viewQueries: [{ propertyName: "templates", predicate: MngTemplateDirective, descendants: true }], ngImport: i0, template: "<div class=\"layout-topbar\">\n <div class=\"layout-topbar-left\">\n <a\n href=\"#\"\n class=\"topbar-menu-button\"\n (click)=\"mainLayoutService.onMenuButtonClick($event)\"\n *ngIf=\"(mngCommons.menuModeIsOverlay$ | async) || (mainLayoutService.isMobile$ | async)\">\n <i class=\"pi pi-bars\"></i>\n </a>\n\n <ng-container [mngComponent]=\"breadcrumbComponent\"></ng-container>\n </div>\n\n <ng-container [mngComponent]=\"menuComponent\"></ng-container>\n\n <div class=\"layout-topbar-right\">\n <ul class=\"layout-topbar-right-items\">\n <li #profile class=\"profile-item\" [ngClass]=\"{'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile}\">\n <a href=\"#\" (click)=\"mainLayoutService.onTopbarItemClick($event, profile)\">\n <i class=\"pi pi-fw pi-user\"></i>\n </a>\n <ul class=\"fadeInDown\" *ngIf=\"user\">\n <li role=\"menuitem\">\n <a>\n {{ user?.displayName ?? user?.username }}\n </a>\n </li>\n <li role=\"menuitem\" *ngIf=\"user?.logout || user?.logoutUrl\">\n <a [href]=\"user?.logoutUrl\" (click)=\"logout(user, $event)\">\n <i class=\"pi pi-fw pi-sign-out\"></i>\n <span>{{ 'mngTopbar.logout' | translate }}</span>\n </a>\n </li>\n </ul>\n </li>\n <li *ngIf=\"languages.length > 1\" class=\"profile-item\" [ngClass]=\"{'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile}\">\n <i class=\"pi pi-fw pi-globe\"></i>\n <p-dropdown [ngModel]=\"selectedLanguage\" [options]=\"languages\" (onChange)=\"switchLanguage($event.value)\"></p-dropdown>\n </li>\n </ul>\n </div>\n</div>\n", components: [{ type: i1$2.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "virtualScroll", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "disabled", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent"], outputs: ["instanceCreated"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "async": i4.AsyncPipe, "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5831
6738
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTopbarComponent, decorators: [{
5832
6739
  type: Component,
5833
6740
  args: [{ selector: 'mng-topbar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"layout-topbar\">\n <div class=\"layout-topbar-left\">\n <a\n href=\"#\"\n class=\"topbar-menu-button\"\n (click)=\"mainLayoutService.onMenuButtonClick($event)\"\n *ngIf=\"(mngCommons.menuModeIsOverlay$ | async) || (mainLayoutService.isMobile$ | async)\">\n <i class=\"pi pi-bars\"></i>\n </a>\n\n <ng-container [mngComponent]=\"breadcrumbComponent\"></ng-container>\n </div>\n\n <ng-container [mngComponent]=\"menuComponent\"></ng-container>\n\n <div class=\"layout-topbar-right\">\n <ul class=\"layout-topbar-right-items\">\n <li #profile class=\"profile-item\" [ngClass]=\"{'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile}\">\n <a href=\"#\" (click)=\"mainLayoutService.onTopbarItemClick($event, profile)\">\n <i class=\"pi pi-fw pi-user\"></i>\n </a>\n <ul class=\"fadeInDown\" *ngIf=\"user\">\n <li role=\"menuitem\">\n <a>\n {{ user?.displayName ?? user?.username }}\n </a>\n </li>\n <li role=\"menuitem\" *ngIf=\"user?.logout || user?.logoutUrl\">\n <a [href]=\"user?.logoutUrl\" (click)=\"logout(user, $event)\">\n <i class=\"pi pi-fw pi-sign-out\"></i>\n <span>{{ 'mngTopbar.logout' | translate }}</span>\n </a>\n </li>\n </ul>\n </li>\n <li *ngIf=\"languages.length > 1\" class=\"profile-item\" [ngClass]=\"{'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile}\">\n <i class=\"pi pi-fw pi-globe\"></i>\n <p-dropdown [ngModel]=\"selectedLanguage\" [options]=\"languages\" (onChange)=\"switchLanguage($event.value)\"></p-dropdown>\n </li>\n </ul>\n </div>\n</div>\n" }]
@@ -5864,7 +6771,7 @@ class MngMainLayoutComponent {
5864
6771
  }
5865
6772
  }
5866
6773
  MngMainLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngMainLayoutComponent, deps: [{ token: i1.ActivatedRoute }, { token: MngCommonsService }, { token: MngMainLayoutComponentService }], target: i0.ɵɵFactoryTarget.Component });
5867
- MngMainLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMainLayoutComponent, selector: "mng-main-layout", host: { listeners: { "window:resize": "onWindowResize($event)" } }, providers: [MngMainLayoutComponentService], viewQueries: [{ propertyName: "templates", predicate: MngTemplateDirective, descendants: true }], ngImport: i0, template: "<div\n class=\"layout-wrapper\"\n (click)=\"mainLayoutService.onLayoutClick()\"\n [ngClass]=\"{\n 'layout-static': mngCommons.menuModeIsStatic$ | async,\n 'layout-overlay': mngCommons.menuModeIsOverlay$ | async,\n 'layout-slim': mngCommons.menuModeIsSlim$ | async,\n 'layout-sidebar': mngCommons.menuModeIsSidebar$ | async,\n 'layout-sidebar-static': (mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async),\n 'layout-overlay-active': mainLayoutService.overlayMenuActive$ | async,\n 'layout-mobile-active': mainLayoutService.staticMenuMobileActive$ | async,\n 'layout-static-inactive': (mainLayoutService.staticMenuDesktopInactive$ | async) && (mngCommons.menuModeIsStatic$ | async)\n }\">\n <div class=\"layout-main\">\n <ng-container [mngComponent]=\"topbarComponent\"></ng-container>\n\n <ng-container\n *ngIf=\"\n (mainLayoutService.isMobile$ | async) === false &&\n ((mngCommons.menuModeIsStatic$ | async) || (mngCommons.menuModeIsSlim$ | async) || (mngCommons.menuModeIsSidebar$ | async))\n \"\n [mngComponent]=\"menuComponent\">\n </ng-container>\n\n <div class=\"layout-main-content\">\n <router-outlet></router-outlet>\n </div>\n\n <ng-container [mngComponent]=\"footerComponent\"></ng-container>\n </div>\n</div>\n", directives: [{ type: i4$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6774
+ MngMainLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMainLayoutComponent, selector: "mng-main-layout", host: { listeners: { "window:resize": "onWindowResize($event)" } }, providers: [MngMainLayoutComponentService], viewQueries: [{ propertyName: "templates", predicate: MngTemplateDirective, descendants: true }], ngImport: i0, template: "<div\n class=\"layout-wrapper\"\n (click)=\"mainLayoutService.onLayoutClick()\"\n [ngClass]=\"{\n 'layout-static': mngCommons.menuModeIsStatic$ | async,\n 'layout-overlay': mngCommons.menuModeIsOverlay$ | async,\n 'layout-slim': mngCommons.menuModeIsSlim$ | async,\n 'layout-sidebar': mngCommons.menuModeIsSidebar$ | async,\n 'layout-sidebar-static': (mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async),\n 'layout-overlay-active': mainLayoutService.overlayMenuActive$ | async,\n 'layout-mobile-active': mainLayoutService.staticMenuMobileActive$ | async,\n 'layout-static-inactive': (mainLayoutService.staticMenuDesktopInactive$ | async) && (mngCommons.menuModeIsStatic$ | async)\n }\">\n <div class=\"layout-main\">\n <ng-container [mngComponent]=\"topbarComponent\"></ng-container>\n\n <ng-container\n *ngIf=\"\n (mainLayoutService.isMobile$ | async) === false &&\n ((mngCommons.menuModeIsStatic$ | async) || (mngCommons.menuModeIsSlim$ | async) || (mngCommons.menuModeIsSidebar$ | async))\n \"\n [mngComponent]=\"menuComponent\">\n </ng-container>\n\n <div class=\"layout-main-content\">\n <router-outlet></router-outlet>\n </div>\n\n <ng-container [mngComponent]=\"footerComponent\"></ng-container>\n </div>\n</div>\n", directives: [{ type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent"], outputs: ["instanceCreated"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5868
6775
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngMainLayoutComponent, decorators: [{
5869
6776
  type: Component,
5870
6777
  args: [{ selector: 'mng-main-layout', providers: [MngMainLayoutComponentService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"layout-wrapper\"\n (click)=\"mainLayoutService.onLayoutClick()\"\n [ngClass]=\"{\n 'layout-static': mngCommons.menuModeIsStatic$ | async,\n 'layout-overlay': mngCommons.menuModeIsOverlay$ | async,\n 'layout-slim': mngCommons.menuModeIsSlim$ | async,\n 'layout-sidebar': mngCommons.menuModeIsSidebar$ | async,\n 'layout-sidebar-static': (mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async),\n 'layout-overlay-active': mainLayoutService.overlayMenuActive$ | async,\n 'layout-mobile-active': mainLayoutService.staticMenuMobileActive$ | async,\n 'layout-static-inactive': (mainLayoutService.staticMenuDesktopInactive$ | async) && (mngCommons.menuModeIsStatic$ | async)\n }\">\n <div class=\"layout-main\">\n <ng-container [mngComponent]=\"topbarComponent\"></ng-container>\n\n <ng-container\n *ngIf=\"\n (mainLayoutService.isMobile$ | async) === false &&\n ((mngCommons.menuModeIsStatic$ | async) || (mngCommons.menuModeIsSlim$ | async) || (mngCommons.menuModeIsSidebar$ | async))\n \"\n [mngComponent]=\"menuComponent\">\n </ng-container>\n\n <div class=\"layout-main-content\">\n <router-outlet></router-outlet>\n </div>\n\n <ng-container [mngComponent]=\"footerComponent\"></ng-container>\n </div>\n</div>\n" }]
@@ -5876,127 +6783,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
5876
6783
  args: ['window:resize', ['$event']]
5877
6784
  }] } });
5878
6785
 
5879
- class MngTableviewComponent {
5880
- constructor(route, messageService, translateService, dialogService, confirmationService, actionService, tableviewService) {
5881
- this.route = route;
5882
- this.messageService = messageService;
5883
- this.translateService = translateService;
5884
- this.dialogService = dialogService;
5885
- this.confirmationService = confirmationService;
5886
- this.actionService = actionService;
5887
- this.tableviewService = tableviewService;
5888
- this.actions = [];
5889
- this.tableComponent = null;
5890
- this.rowClickActions = [];
5891
- this.rowInlineActions = [];
5892
- this.toolbarLeftActions = [];
5893
- this.toolbarRightActions = [];
5894
- this.subscriptions = [];
5895
- }
5896
- ngOnInit() {
5897
- this.tableviewService.actions = this.actions;
5898
- this.tableviewService.dataProvider = this.dataProvider;
5899
- this.tableviewService.messageService = this.messageService;
5900
- const reloadTableSubscription = this.tableviewService.reloadTable$.subscribe(() => {
5901
- this.reloadTable();
5902
- });
5903
- this.subscriptions.push(reloadTableSubscription);
5904
- for (const action of this.actions) {
5905
- switch (action.position) {
5906
- case ActionPositionEnum.RowClick:
5907
- this.rowClickActions.push(action);
5908
- break;
5909
- case ActionPositionEnum.RowInline:
5910
- this.rowInlineActions.push(action);
5911
- break;
5912
- case ActionPositionEnum.ToolbarLeft:
5913
- this.toolbarLeftActions.push(action);
5914
- break;
5915
- case ActionPositionEnum.ToolbarRight:
5916
- this.toolbarRightActions.push(action);
5917
- break;
5918
- }
5919
- }
5920
- }
5921
- ngOnDestroy() {
5922
- this.subscriptions.forEach(s => s.unsubscribe());
5923
- }
5924
- reloadTable() {
5925
- this.tableComponent?.reload();
5926
- }
5927
- onTableCellClick(event) {
5928
- if (this.rowClickActions.length) {
5929
- for (const action of this.rowClickActions) {
5930
- this.actionService.triggerRowClickAction(action, event, this.route);
5931
- }
5932
- }
5933
- }
5934
- }
5935
- MngTableviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2$1.MessageService }, { token: i2$2.TranslateService }, { token: i2.DialogService }, { token: i2$1.ConfirmationService }, { token: MngActionService }, { token: TableviewComponentService }], target: i0.ɵɵFactoryTarget.Component });
5936
- MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, TableviewComponentService], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table [descriptor]=\"descriptor.table\" [dataProvider]=\"dataProvider\" [useQueryParams]=\"true\" (cellClick)=\"onTableCellClick($event)\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-m-0\">{{ descriptor.tableTitle | translate }}</h5>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\">\n </mng-action>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n", components: [{ type: i7$1.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: i8$1.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionEnabled"], outputs: ["tableLoad", "cellClick", "selectionChange"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "translate": i2$2.TranslatePipe } });
5937
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, decorators: [{
5938
- type: Component,
5939
- args: [{ selector: 'mng-tableview', providers: [MessageService, ConfirmationService, TableviewComponentService], template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table [descriptor]=\"descriptor.table\" [dataProvider]=\"dataProvider\" [useQueryParams]=\"true\" (cellClick)=\"onTableCellClick($event)\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-m-0\">{{ descriptor.tableTitle | translate }}</h5>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\">\n </mng-action>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n" }]
5940
- }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i2$1.MessageService }, { type: i2$2.TranslateService }, { type: i2.DialogService }, { type: i2$1.ConfirmationService }, { type: MngActionService }, { type: TableviewComponentService }]; }, propDecorators: { descriptor: [{
5941
- type: Input
5942
- }], dataProvider: [{
5943
- type: Input
5944
- }], actions: [{
5945
- type: Input
5946
- }], tableComponent: [{
5947
- type: ViewChild,
5948
- args: [MngTableComponent]
5949
- }] } });
5950
-
5951
- class AMngTableviewRouteComponent {
5952
- ngOnInit() {
5953
- this.descriptor = this.createTableviewDescriptor();
5954
- this.dataProvider = this.createTableviewDataProvider();
5955
- this.actions = this.createActionDescriptors();
5956
- }
5957
- createActionDescriptors() {
5958
- const actions = [];
5959
- actions.push(new ActionEditorDetailsDescriptor(this.descriptor.viewEditor));
5960
- actions.push(new ActionEditorAddDescriptor(this.descriptor.addEditor));
5961
- actions.push(new ActionEditorEditDescriptor(this.descriptor.editEditor));
5962
- actions.push(new ActionDeleteDescriptor(this.descriptor.model));
5963
- return actions;
5964
- }
5965
- }
5966
- AMngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: AMngTableviewRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
5967
- AMngTableviewRouteComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: AMngTableviewRouteComponent, ngImport: i0 });
5968
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: AMngTableviewRouteComponent, decorators: [{
5969
- type: Directive
5970
- }] });
5971
-
5972
- class MngTableviewRouteComponent extends AMngTableviewRouteComponent {
5973
- constructor(route) {
5974
- super();
5975
- this.route = route;
5976
- }
5977
- createTableviewDescriptor() {
5978
- if (!this.route.snapshot.data['tableviewData'].descriptor) {
5979
- throw Error('Tableview requires a descriptor.');
5980
- }
5981
- return this.route.snapshot.data['tableviewData'].descriptor;
5982
- }
5983
- createTableviewDataProvider() {
5984
- if (!this.route.snapshot.data['tableviewData'].dataProvider) {
5985
- throw Error('Tableview requires a data provider.');
5986
- }
5987
- return this.route.snapshot.data['tableviewData'].dataProvider;
5988
- }
5989
- createActionDescriptors() {
5990
- return this.route.snapshot.data['tableviewData'].actions ?? super.createActionDescriptors();
5991
- }
5992
- }
5993
- MngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, deps: [{ token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
5994
- MngTableviewRouteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableviewRouteComponent, selector: "mng-tableview-route", usesInheritance: true, ngImport: i0, template: "<div class=\"grid\">\n <div class=\"col-12\">\n <mng-tableview [descriptor]=\"descriptor\" [dataProvider]=\"dataProvider\" [actions]=\"actions\"></mng-tableview>\n </div>\n</div>\n", components: [{ type: MngTableviewComponent, selector: "mng-tableview", inputs: ["descriptor", "dataProvider", "actions"] }] });
5995
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, decorators: [{
5996
- type: Component,
5997
- args: [{ selector: 'mng-tableview-route', template: "<div class=\"grid\">\n <div class=\"col-12\">\n <mng-tableview [descriptor]=\"descriptor\" [dataProvider]=\"dataProvider\" [actions]=\"actions\"></mng-tableview>\n </div>\n</div>\n" }]
5998
- }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }]; } });
5999
-
6000
6786
  function mngCommonsInitializerProvider(mngCommons) {
6001
6787
  return () => mngCommons.initialize();
6002
6788
  }
@@ -6104,6 +6890,11 @@ const formlyTypesConfig = [
6104
6890
  component: MngFormlyFieldAutocompleteComponent,
6105
6891
  wrappers: ['field']
6106
6892
  },
6893
+ {
6894
+ name: 'dialog',
6895
+ component: MngFormlyFieldLookupDialogComponent,
6896
+ wrappers: ['field']
6897
+ },
6107
6898
  {
6108
6899
  name: 'table-dialog-multiselect',
6109
6900
  component: MngFormlyFieldTableDialogMultiselectComponent,
@@ -6263,6 +7054,7 @@ const declarations = [
6263
7054
  MngFormlyFieldInputComponent,
6264
7055
  MngFormlyFieldDropdownComponent,
6265
7056
  MngFormlyFieldAutocompleteComponent,
7057
+ MngFormlyFieldLookupDialogComponent,
6266
7058
  MngFormlyFieldTableDialogMultiselectComponent,
6267
7059
  MngFormlyFieldTableDialogFormComponent,
6268
7060
  MngFormlyFieldTabsComponent,
@@ -6276,7 +7068,7 @@ const declarations = [
6276
7068
  // editor components
6277
7069
  MngFormEditorComponent,
6278
7070
  MngActionComponent,
6279
- MngActionDialogComponent,
7071
+ MngActionEditorComponent,
6280
7072
  MngActionRouteComponent
6281
7073
  ];
6282
7074
  class MngCommonsModule {
@@ -6288,12 +7080,12 @@ class MngCommonsModule {
6288
7080
  DialogService,
6289
7081
  MessageService,
6290
7082
  ConfirmationService,
6291
- MngActionService,
7083
+ MngActionExecutorService,
6292
7084
  MngNavigationService,
6293
7085
  MngCommonsService,
6294
7086
  // component service
6295
7087
  MngMainLayoutComponentService,
6296
- TableviewComponentService,
7088
+ MngViewContainerComponentService,
6297
7089
  {
6298
7090
  provide: MNG_MODULE_CONFIG_IT,
6299
7091
  useValue: config
@@ -6324,6 +7116,14 @@ class MngCommonsModule {
6324
7116
  multi: true,
6325
7117
  useFactory: mngFormlyConfigProvider,
6326
7118
  deps: [TranslateService, MNG_MODULE_CONFIG_IT]
7119
+ },
7120
+ {
7121
+ provide: ACTION_EDITOR_DIALOG_COMPONENT_SETTING,
7122
+ useValue: MngActionEditorComponent
7123
+ },
7124
+ {
7125
+ provide: MngErrorMapperService,
7126
+ useClass: DefaultMngErrorMapperService
6327
7127
  }
6328
7128
  ]
6329
7129
  };
@@ -6356,6 +7156,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
6356
7156
  MngFormlyFieldInputComponent,
6357
7157
  MngFormlyFieldDropdownComponent,
6358
7158
  MngFormlyFieldAutocompleteComponent,
7159
+ MngFormlyFieldLookupDialogComponent,
6359
7160
  MngFormlyFieldTableDialogMultiselectComponent,
6360
7161
  MngFormlyFieldTableDialogFormComponent,
6361
7162
  MngFormlyFieldTabsComponent,
@@ -6369,13 +7170,13 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
6369
7170
  // editor components
6370
7171
  MngFormEditorComponent,
6371
7172
  MngActionComponent,
6372
- MngActionDialogComponent,
7173
+ MngActionEditorComponent,
6373
7174
  MngActionRouteComponent], imports: [
6374
7175
  // angular modules
6375
7176
  CommonModule,
6376
7177
  RouterModule,
6377
7178
  HttpClientModule,
6378
- ReactiveFormsModule, i2$2.TranslateModule, i3.FormlyModule, AutoCompleteModule,
7179
+ ReactiveFormsModule, i3$1.TranslateModule, i3$2.FormlyModule, AutoCompleteModule,
6379
7180
  BreadcrumbModule,
6380
7181
  ButtonModule,
6381
7182
  CalendarModule,
@@ -6467,6 +7268,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
6467
7268
  MngFormlyFieldInputComponent,
6468
7269
  MngFormlyFieldDropdownComponent,
6469
7270
  MngFormlyFieldAutocompleteComponent,
7271
+ MngFormlyFieldLookupDialogComponent,
6470
7272
  MngFormlyFieldTableDialogMultiselectComponent,
6471
7273
  MngFormlyFieldTableDialogFormComponent,
6472
7274
  MngFormlyFieldTabsComponent,
@@ -6480,7 +7282,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
6480
7282
  // editor components
6481
7283
  MngFormEditorComponent,
6482
7284
  MngActionComponent,
6483
- MngActionDialogComponent,
7285
+ MngActionEditorComponent,
6484
7286
  MngActionRouteComponent] });
6485
7287
  MngCommonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsModule, imports: [[
6486
7288
  // angular modules
@@ -6556,54 +7358,59 @@ class AMngCrudApiService {
6556
7358
  this.http = http;
6557
7359
  this.objectSerializer = ObjectSerializer.get();
6558
7360
  }
6559
- createPost(item) {
6560
- const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getCreatePostPath()}`;
7361
+ createPost(item, params) {
7362
+ const url = `${this.getBasePath()}${this.getServiceBasePath()}${this.getCreatePostPath()}`;
6561
7363
  return this.http
6562
7364
  .post(url, this.objectSerializer.serializeClass(item, this.type), {
6563
7365
  withCredentials: true,
6564
7366
  observe: 'body',
6565
- reportProgress: false
7367
+ reportProgress: false,
7368
+ params: params
6566
7369
  })
6567
7370
  .pipe(map(res => this.objectSerializer.deserializeClass(res, this.type)));
6568
7371
  }
6569
- getAllPost(queryParam) {
6570
- const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getGetAllPostPath()}`;
7372
+ getAllPost(queryParamBody, params) {
7373
+ const url = `${this.getBasePath()}${this.getServiceBasePath()}${this.getGetAllPostPath()}`;
6571
7374
  return this.http
6572
- .post(url, this.objectSerializer.serialize(queryParam, 'QueryParam'), {
7375
+ .post(url, this.objectSerializer.serialize(queryParamBody, 'QueryParam'), {
6573
7376
  withCredentials: true,
6574
7377
  observe: 'body',
6575
- reportProgress: false
7378
+ reportProgress: false,
7379
+ params: params
6576
7380
  })
6577
7381
  .pipe(map(res => this.objectSerializer.deserializeClass(res, this.queryResultType)));
6578
7382
  }
6579
- getByIdGet(id) {
6580
- const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getGetByIdGetPath(id)}`;
7383
+ getByIdGet(id, params) {
7384
+ const url = `${this.getBasePath()}${this.getServiceBasePath()}${this.getGetByIdGetPath(id)}`;
6581
7385
  return this.http
6582
7386
  .get(url, {
6583
7387
  withCredentials: true,
6584
7388
  observe: 'body',
6585
- reportProgress: false
7389
+ reportProgress: false,
7390
+ params: params
6586
7391
  })
6587
7392
  .pipe(map(res => this.objectSerializer.deserializeClass(res, this.type)));
6588
7393
  }
6589
- updatePut(id, item) {
6590
- const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getUpdatePutPath(id, item)}`;
7394
+ updatePut(id, item, params) {
7395
+ const url = `${this.getBasePath()}${this.getServiceBasePath()}${this.getUpdatePutPath(id, item)}`;
6591
7396
  return this.http
6592
7397
  .put(url, this.objectSerializer.serializeClass(item, this.type), {
6593
7398
  withCredentials: true,
6594
7399
  observe: 'body',
6595
- reportProgress: false
7400
+ reportProgress: false,
7401
+ params: params
6596
7402
  })
6597
7403
  .pipe(map(res => this.objectSerializer.deserializeClass(res, this.type)));
6598
7404
  }
6599
- removeDelete(id, item) {
6600
- const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getRemoveDeletePath(id, item)}`;
7405
+ removeDelete(id, item, params) {
7406
+ const url = `${this.getBasePath()}${this.getServiceBasePath()}${this.getRemoveDeletePath(id, item)}`;
6601
7407
  return this.http
6602
7408
  .request('delete', url, {
6603
7409
  withCredentials: true,
6604
7410
  observe: 'body',
6605
7411
  reportProgress: false,
6606
- body: this.objectSerializer.serializeClass(item, this.type)
7412
+ body: item ? this.objectSerializer.serializeClass(item, this.type) : undefined,
7413
+ params: params
6607
7414
  })
6608
7415
  .pipe(map(res => this.objectSerializer.deserializeClass(res, this.type)));
6609
7416
  }
@@ -7080,5 +7887,5 @@ class RouteDataBuilder {
7080
7887
  * Generated bundle index. Do not edit.
7081
7888
  */
7082
7889
 
7083
- export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngCrudApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtil, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusQueryResultBase, MediusQueryResultWithObject, MediusRestUtil, MngActionComponent, MngActionDialogComponent, MngActionRouteComponent, MngActionService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngPropertyPathPipe, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, ModelDescriptor, ModelUtil, ObjectSerializer, RouteBuilder, RouteDataBuilder, RoutesBuilder, TableDescriptor, TableviewComponentService, TableviewDataProvider, TableviewDescriptor, ToastUtil, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngCommonsInitializerProvider, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
7890
+ export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngCrudApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, DefaultMngErrorMapperService, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldDescriptor, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtil, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusQueryResultBase, MediusQueryResultWithObject, MediusRestUtil, MngActionComponent, 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, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngPropertyPathPipe, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, ObjectSerializer, RouteBuilder, RouteDataBuilder, RoutesBuilder, TableDataProvider, TableDescriptor, TableviewDataProvider, TableviewDescriptor, ToastUtil, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngCommonsInitializerProvider, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
7084
7891
  //# sourceMappingURL=mediusinc-mng-commons.mjs.map