@mediusinc/mng-commons 0.2.16 → 0.2.19

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 (100) hide show
  1. package/assets/i18n/en.json +4 -2
  2. package/assets/i18n/sl.json +19 -17
  3. package/esm2020/lib/api/models/filter-param.model.mjs +1 -1
  4. package/esm2020/lib/api/models/query-param.model.mjs +1 -1
  5. package/esm2020/lib/api/services/crud-api.abstract.service.mjs +17 -12
  6. package/esm2020/lib/components/action/action.component.mjs +32 -18
  7. package/esm2020/lib/components/action/editor/action-editor.component.mjs +182 -0
  8. package/esm2020/lib/components/action/index.mjs +2 -2
  9. package/esm2020/lib/components/action/models/action-execution.model.mjs +3 -3
  10. package/esm2020/lib/components/action/route/action-route.component.mjs +17 -12
  11. package/esm2020/lib/components/form/autocomplete/autocomplete.component.mjs +13 -11
  12. package/esm2020/lib/components/form/dropdown/dropdown.component.mjs +5 -7
  13. package/esm2020/lib/components/form/editor/form-editor.component.mjs +56 -4
  14. package/esm2020/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +3 -3
  15. package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +3 -3
  16. package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
  17. package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +179 -0
  18. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +28 -9
  19. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +14 -10
  20. package/esm2020/lib/components/form/formly/fields/index.mjs +2 -1
  21. package/esm2020/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +3 -3
  22. package/esm2020/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.mjs +4 -3
  23. package/esm2020/lib/components/form/models/form-editor.event.mjs +28 -1
  24. package/esm2020/lib/components/layout/main-layout.component.mjs +1 -1
  25. package/esm2020/lib/components/layout/topbar.component.mjs +2 -4
  26. package/esm2020/lib/components/tableview/table/table.component.mjs +43 -20
  27. package/esm2020/lib/components/tableview/tableview.component.mjs +22 -15
  28. package/esm2020/lib/config/formly.config.mjs +7 -2
  29. package/esm2020/lib/data-providers/table.data-provider.mjs +17 -2
  30. package/esm2020/lib/descriptors/action.descriptor.mjs +112 -1
  31. package/esm2020/lib/descriptors/editor.descriptor.interface.mjs +2 -0
  32. package/esm2020/lib/descriptors/editor.descriptor.mjs +129 -28
  33. package/esm2020/lib/directives/component.directive.mjs +8 -3
  34. package/esm2020/lib/mng-commons.module.mjs +18 -11
  35. package/esm2020/lib/models/index.mjs +2 -1
  36. package/esm2020/lib/models/view-container.model.mjs +2 -0
  37. package/esm2020/lib/router/models/router.model.mjs +1 -1
  38. package/esm2020/lib/router/route-builder.mjs +75 -11
  39. package/esm2020/lib/services/action-executor.service.mjs +291 -0
  40. package/esm2020/lib/services/configuration.service.mjs +3 -3
  41. package/esm2020/lib/services/index.mjs +2 -2
  42. package/esm2020/lib/services/mng-view-container-component.service.mjs +35 -0
  43. package/esm2020/lib/services/tokens/default-setting.token.mjs +3 -0
  44. package/esm2020/lib/services/tokens/index.mjs +2 -1
  45. package/esm2020/lib/utils/editor-formly.util.mjs +14 -3
  46. package/esm2020/lib/utils/toast.util.mjs +15 -7
  47. package/esm2020/public-api.mjs +1 -2
  48. package/fesm2015/mediusinc-mng-commons.mjs +1738 -1012
  49. package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
  50. package/fesm2020/mediusinc-mng-commons.mjs +1578 -878
  51. package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
  52. package/lib/api/models/filter-param.model.d.ts +1 -1
  53. package/lib/api/models/query-param.model.d.ts +1 -1
  54. package/lib/api/services/crud-api.abstract.service.d.ts +9 -8
  55. package/lib/components/action/action.component.d.ts +12 -7
  56. package/lib/components/action/{dialog/action-dialog.component.d.ts → editor/action-editor.component.d.ts} +18 -12
  57. package/lib/components/action/index.d.ts +1 -1
  58. package/lib/components/action/models/action-execution.model.d.ts +3 -3
  59. package/lib/components/action/route/action-route.component.d.ts +6 -6
  60. package/lib/components/form/autocomplete/autocomplete.component.d.ts +3 -2
  61. package/lib/components/form/dropdown/dropdown.component.d.ts +4 -4
  62. package/lib/components/form/editor/form-editor.component.d.ts +7 -2
  63. package/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +45 -0
  64. package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +2 -0
  65. package/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +1 -0
  66. package/lib/components/form/formly/fields/index.d.ts +1 -0
  67. package/lib/components/form/models/form-editor.event.d.ts +32 -0
  68. package/lib/components/layout/topbar.component.d.ts +2 -3
  69. package/lib/components/tableview/table/table.component.d.ts +14 -6
  70. package/lib/components/tableview/tableview.component.d.ts +10 -7
  71. package/lib/data-providers/table.data-provider.d.ts +9 -1
  72. package/lib/descriptors/action.descriptor.d.ts +41 -5
  73. package/lib/descriptors/editor.descriptor.d.ts +62 -19
  74. package/lib/descriptors/editor.descriptor.interface.d.ts +9 -0
  75. package/lib/directives/component.directive.d.ts +5 -4
  76. package/lib/mng-commons.module.d.ts +55 -54
  77. package/lib/models/index.d.ts +1 -0
  78. package/lib/models/view-container.model.d.ts +6 -0
  79. package/lib/router/models/router.model.d.ts +2 -2
  80. package/lib/router/route-builder.d.ts +18 -4
  81. package/lib/services/{action.service.d.ts → action-executor.service.d.ts} +19 -18
  82. package/lib/services/index.d.ts +1 -1
  83. package/lib/services/mng-view-container-component.service.d.ts +22 -0
  84. package/lib/services/tokens/default-setting.token.d.ts +2 -0
  85. package/lib/services/tokens/index.d.ts +1 -0
  86. package/lib/utils/toast.util.d.ts +5 -4
  87. package/package.json +1 -1
  88. package/public-api.d.ts +0 -1
  89. package/scss/mng-overrides/_layout_forms.scss +2 -0
  90. package/scss/mng-overrides/_mixins.scss +7 -0
  91. package/scss/mng-overrides/_theme_button.scss +58 -0
  92. package/scss/mng-overrides/_theme_dropdown.scss +17 -0
  93. package/scss/mng-overrides/_theme_styles.scss +1 -0
  94. package/scss/mng-overrides/_variables.scss +2 -0
  95. package/esm2020/lib/components/action/dialog/action-dialog.component.mjs +0 -151
  96. package/esm2020/lib/components/tableview/services/index.mjs +0 -2
  97. package/esm2020/lib/components/tableview/services/tableview.component.service.mjs +0 -21
  98. package/esm2020/lib/services/action.service.mjs +0 -273
  99. package/lib/components/tableview/services/index.d.ts +0 -1
  100. package/lib/components/tableview/services/tableview.component.service.d.ts +0 -14
@@ -2,24 +2,24 @@ import * as i4$1 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { 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, Component, ChangeDetectionStrategy, Optional, Input, EventEmitter, Directive, Output, 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
20
  import * as i8 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';
@@ -27,31 +27,31 @@ import { ChipModule } from 'primeng/chip';
27
27
  import * as i6 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
45
  import * as i10$1 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 i5 from 'primeng/progressspinner';
55
55
  import { ProgressSpinnerModule } from 'primeng/progressspinner';
56
56
  import * as i4$3 from 'primeng/radiobutton';
57
57
  import { RadioButtonModule } from 'primeng/radiobutton';
@@ -62,7 +62,7 @@ import * as i7 from 'primeng/skeleton';
62
62
  import { SkeletonModule } from 'primeng/skeleton';
63
63
  import * as i4$4 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
68
  import * as i7$1 from 'primeng/toast';
@@ -72,413 +72,74 @@ import * as i8$1 from 'primeng/toolbar';
72
72
  import { ToolbarModule } from 'primeng/toolbar';
73
73
  import * as i10 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
78
  import * as i4 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
- var _a, _b;
296
- console.warn(`Fetch function is not provided for function ${this._actionName}, using default and returning context item`, (_a = ctx.data) === null || _a === void 0 ? void 0 : _a.item);
297
- return of(((_b = ctx.data) === null || _b === void 0 ? void 0 : _b.item) ? ctx.data.item : {});
298
- };
299
- }
300
- return this._fetchFunction;
301
- }
302
- get submitFunction() {
303
- return this._submitFunction;
304
- }
305
- withEditorTitle(title) {
306
- this._editorTitle = title;
307
- return this;
132
+
133
+ class LookupDataProvider extends DataProvider {
134
+ constructor(modelType, serviceType) {
135
+ super(modelType, serviceType);
136
+ this._lookup = () => of([]);
308
137
  }
309
- withRunFunction(fn) {
310
- return this.withSubmitFunction(fn);
138
+ get lookup() {
139
+ return this._lookup;
311
140
  }
312
- withFetchFunction(fn) {
313
- this._fetchFunction = fn;
314
- return this;
315
- }
316
- withSubmitFunction(fn) {
317
- this._submitFunction = fn;
318
- return this;
319
- }
320
- withFetchNotificationError(title, message, hasNotification = true) {
321
- this._hasFetchNotificationSuccess = hasNotification;
322
- this._fetchNotificationSuccessTitle = title;
323
- this._fetchNotificationSuccessMessage = message;
324
- }
325
- }
326
- class ActionEditorDetailsDescriptor extends ActionEditorDescriptor {
327
- constructor(editorDescriptor) {
328
- super(editorDescriptor, 'details');
329
- this.withPosition(ActionPositionEnum.RowClick);
330
- this.withRouteTrigger(':itemId');
331
- this.withFetchFunction(ctx => {
332
- var _a, _b, _c, _d;
333
- return ((_a = ctx.dataProvider) === null || _a === void 0 ? void 0 : _a.fetch) && ((_b = ctx.data) === null || _b === void 0 ? void 0 : _b.itemId)
334
- ? ctx.dataProvider.fetch((_c = ctx.data) === null || _c === void 0 ? void 0 : _c.itemId, ctx.serviceInstance)
335
- : throwError(new Error(`Data provider fetch function or item id ${(_d = ctx.data) === null || _d === void 0 ? void 0 : _d.itemId} is missing.`));
336
- });
337
- this.withClassName('mng-details-dynamic-dialog');
338
- }
339
- }
340
- class ActionEditorAddDescriptor extends ActionEditorDescriptor {
341
- constructor(editorDescriptor) {
342
- super(editorDescriptor, 'add');
343
- this.withPosition(ActionPositionEnum.ToolbarLeft);
344
- this.withRouteTrigger('add');
345
- this.withSubmitFunction(ctx => { var _a, _b; return ((_a = ctx.dataProvider) === null || _a === void 0 ? void 0 : _a.create) ? ctx.dataProvider.create((_b = ctx.data) === null || _b === void 0 ? void 0 : _b.item, ctx.serviceInstance) : throwError(new Error(`Data provider create function is missing.`)); });
346
- this.withLevel(ActionLevelEnum.Success);
347
- this.withIcon('pi pi-plus');
348
- this.withClassName('mng-details-dynamic-dialog');
349
- }
350
- }
351
- class ActionEditorEditDescriptor extends ActionEditorDescriptor {
352
- constructor(editorDescriptor) {
353
- super(editorDescriptor, 'edit');
354
- this.withPosition(ActionPositionEnum.RowInline);
355
- this.withTitle(null);
356
- this.withRouteTrigger(':itemId/edit');
357
- this.withFetchFunction(ctx => {
358
- var _a, _b, _c;
359
- return ((_a = ctx.dataProvider) === null || _a === void 0 ? void 0 : _a.fetch) && ((_b = ctx.data) === null || _b === void 0 ? void 0 : _b.itemId)
360
- ? ctx.dataProvider.fetch(ctx.data.itemId, ctx.serviceInstance)
361
- : throwError(new Error(`Data provider fetch function or item id ${(_c = ctx.data) === null || _c === void 0 ? void 0 : _c.itemId} is missing.`));
362
- });
363
- this.withSubmitFunction(ctx => {
364
- var _a, _b, _c, _d;
365
- return ((_a = ctx.dataProvider) === null || _a === void 0 ? void 0 : _a.update) && ((_b = ctx.data) === null || _b === void 0 ? void 0 : _b.itemId)
366
- ? ctx.dataProvider.update(ctx.data.itemId, (_c = ctx.data) === null || _c === void 0 ? void 0 : _c.item, ctx.serviceInstance)
367
- : throwError(new Error(`Data provider update function or item id ${(_d = ctx.data) === null || _d === void 0 ? void 0 : _d.itemId} is missing.`));
368
- });
369
- this.withIcon('pi pi-pencil');
370
- this.withClassName('mng-details-dynamic-dialog');
371
- }
372
- }
373
- class ActionDeleteDescriptor extends ActionDescriptor {
374
- constructor(model) {
375
- super(model, 'delete');
376
- this.withPosition(ActionPositionEnum.RowInline);
377
- this.withTitle(null);
378
- this.withRunFunction(ctx => {
379
- var _a, _b;
380
- const editorDataProvider = ctx.dataProvider;
381
- return (editorDataProvider === null || editorDataProvider === void 0 ? void 0 : editorDataProvider.delete) && ((_a = ctx.data) === null || _a === void 0 ? void 0 : _a.itemId)
382
- ? editorDataProvider.delete(ctx.data.itemId, ctx.data.item, ctx.serviceInstance)
383
- : throwError(new Error(`Data provider delete function or item id ${(_b = ctx.data) === null || _b === void 0 ? void 0 : _b.itemId} is missing.`));
384
- });
385
- this.withLevel(ActionLevelEnum.Danger);
386
- this.withIcon('pi pi-trash');
387
- this.withRunConfirmation(undefined);
388
- }
389
- }
390
- var ActionPositionEnum;
391
- (function (ActionPositionEnum) {
392
- ActionPositionEnum[ActionPositionEnum["ToolbarLeft"] = 0] = "ToolbarLeft";
393
- ActionPositionEnum[ActionPositionEnum["ToolbarRight"] = 1] = "ToolbarRight";
394
- ActionPositionEnum[ActionPositionEnum["TableHeader"] = 2] = "TableHeader";
395
- ActionPositionEnum[ActionPositionEnum["RowInline"] = 3] = "RowInline";
396
- ActionPositionEnum[ActionPositionEnum["RowClick"] = 4] = "RowClick";
397
- })(ActionPositionEnum || (ActionPositionEnum = {}));
398
- var ActionActivationTriggerEnum;
399
- (function (ActionActivationTriggerEnum) {
400
- ActionActivationTriggerEnum[ActionActivationTriggerEnum["OnClick"] = 0] = "OnClick";
401
- ActionActivationTriggerEnum[ActionActivationTriggerEnum["OnRoute"] = 1] = "OnRoute"; // action is triggered for activation by route url
402
- })(ActionActivationTriggerEnum || (ActionActivationTriggerEnum = {}));
403
- var ActionTypeEnum;
404
- (function (ActionTypeEnum) {
405
- ActionTypeEnum[ActionTypeEnum["Direct"] = 0] = "Direct";
406
- ActionTypeEnum[ActionTypeEnum["Editor"] = 1] = "Editor"; // editor providing middle step for activation
407
- })(ActionTypeEnum || (ActionTypeEnum = {}));
408
- var ActionLevelEnum;
409
- (function (ActionLevelEnum) {
410
- ActionLevelEnum[ActionLevelEnum["Default"] = 0] = "Default";
411
- ActionLevelEnum[ActionLevelEnum["Primary"] = 1] = "Primary";
412
- ActionLevelEnum[ActionLevelEnum["Secondary"] = 2] = "Secondary";
413
- ActionLevelEnum[ActionLevelEnum["Info"] = 3] = "Info";
414
- ActionLevelEnum[ActionLevelEnum["Help"] = 4] = "Help";
415
- ActionLevelEnum[ActionLevelEnum["Success"] = 5] = "Success";
416
- ActionLevelEnum[ActionLevelEnum["Warning"] = 6] = "Warning";
417
- ActionLevelEnum[ActionLevelEnum["Danger"] = 7] = "Danger";
418
- })(ActionLevelEnum || (ActionLevelEnum = {}));
419
-
420
- class DataProvider {
421
- constructor(modelType, serviceType) {
422
- this._modelType = modelType;
423
- this._serviceType = serviceType;
424
- }
425
- get serviceType() {
426
- return this._serviceType;
427
- }
428
- get modelType() {
429
- return this._modelType;
430
- }
431
- withServiceType(type) {
432
- this._serviceType = type;
433
- return this;
434
- }
435
- }
436
-
437
- class EditorDataProvider extends DataProvider {
438
- constructor(modelType, serviceType) {
439
- super(modelType, serviceType);
440
- this._fetch = id => throwError(`No fetch function provided for id ${id}.`);
441
- }
442
- get fetch() {
443
- return this._fetch;
444
- }
445
- get create() {
446
- return this._create;
447
- }
448
- get update() {
449
- return this._update;
450
- }
451
- get delete() {
452
- return this._delete;
453
- }
454
- withFetch(fetch) {
455
- this._fetch = fetch;
456
- return this;
457
- }
458
- withCreate(create) {
459
- this._create = create;
460
- return this;
461
- }
462
- withUpdate(update) {
463
- this._update = update;
464
- return this;
465
- }
466
- withDelete(deleteFn) {
467
- this._delete = deleteFn;
468
- return this;
469
- }
470
- }
471
-
472
- class LookupDataProvider extends DataProvider {
473
- constructor(modelType, serviceType) {
474
- super(modelType, serviceType);
475
- this._lookup = () => of([]);
476
- }
477
- get lookup() {
478
- return this._lookup;
479
- }
480
- withLookup(lookup) {
481
- this._lookup = lookup;
141
+ withLookup(lookup) {
142
+ this._lookup = lookup;
482
143
  return this;
483
144
  }
484
145
  }
@@ -703,49 +364,546 @@ class MediusQueryParamBuilder {
703
364
  this.queryParam.sortAsc.push(asc);
704
365
  return this;
705
366
  }
706
- withFilter(property, value, valueTo = undefined, matchType = MediusFilterMatchType.Contains, matchCaseSensitive = false) {
707
- if (!this.queryParam.filterParams) {
708
- this.queryParam.filterParams = [];
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 runFunction() {
491
+ if (!this._runFunction) {
492
+ throw new Error('Run function is not defined and cannot be invoked');
493
+ }
494
+ return this._runFunction;
495
+ }
496
+ get isVisibleFunction() {
497
+ return this._isVisibleFunction;
498
+ }
499
+ get isEnabledFunction() {
500
+ return this._isEnabledFunction;
501
+ }
502
+ get actionName() {
503
+ return this._actionName;
504
+ }
505
+ get className() {
506
+ return this._className;
507
+ }
508
+ get size() {
509
+ return this._size;
510
+ }
511
+ get isSizeExtraSmall() {
512
+ return this._size === ActionDescriptor.SizeEnum.ExtraSmall;
513
+ }
514
+ get isSizeSmall() {
515
+ return this._size === ActionDescriptor.SizeEnum.Small;
516
+ }
517
+ get isSizeLarge() {
518
+ return this._size === ActionDescriptor.SizeEnum.Large;
519
+ }
520
+ get isSizeExtraLarge() {
521
+ return this._size === ActionDescriptor.SizeEnum.ExtraLarge;
522
+ }
523
+ get hasRunConfirmation() {
524
+ return this._hasRunConfirmation;
525
+ }
526
+ get runConfirmationIcon() {
527
+ return this._runConfirmationIcon;
528
+ }
529
+ get runConfirmationTitle() {
530
+ return this._runConfirmationTitle;
531
+ }
532
+ get runConfirmationMessage() {
533
+ return this._runConfirmationMessage;
534
+ }
535
+ get runConfirmationAcceptTitle() {
536
+ return this._runConfirmationAcceptTitle;
537
+ }
538
+ get runConfirmationRejectTitle() {
539
+ return this._runConfirmationRejectTitle;
540
+ }
541
+ get hasRunNotificationSuccess() {
542
+ return this._hasRunNotificationSuccess;
543
+ }
544
+ get runNotificationSuccessTitle() {
545
+ return this._runNotificationSuccessTitle;
546
+ }
547
+ get runNotificationSuccessMessage() {
548
+ return this._runNotificationSuccessMessage;
549
+ }
550
+ get hasRunNotificationError() {
551
+ return this._hasRunNotificationError;
552
+ }
553
+ get runNotificationErrorTitle() {
554
+ return this._runNotificationErrorTitle;
555
+ }
556
+ get runNotificationErrorMessage() {
557
+ return this._runNotificationErrorMessage;
558
+ }
559
+ withDataProvider(dataProvider) {
560
+ this._dataProvider = dataProvider;
561
+ return this;
562
+ }
563
+ withServiceType(serviceType) {
564
+ this._dataProvider = new DataProvider(this._model.type, serviceType);
565
+ return this;
566
+ }
567
+ withRunFunction(fn) {
568
+ this._runFunction = fn;
569
+ return this;
570
+ }
571
+ withIsVisibleFunction(fn) {
572
+ this._isVisibleFunction = fn;
573
+ return this;
574
+ }
575
+ withIsEnabledFunction(fn) {
576
+ this._isEnabledFunction = fn;
577
+ return this;
578
+ }
579
+ withRouteTrigger(routeUrl) {
580
+ this._activationTrigger = ActionActivationTriggerEnum.OnRoute;
581
+ this._routeUrl = routeUrl;
582
+ return this;
583
+ }
584
+ withLevel(level) {
585
+ this._level = level;
586
+ return this;
587
+ }
588
+ /**
589
+ * Overrides default title key with model action key (${model.typeName}.actions.${actionName}). Not relevant if parentType name is provided.
590
+ */
591
+ withModelTitle() {
592
+ this._title = `${this._i18nModelActionBaseKey}.title`;
593
+ return this;
594
+ }
595
+ /**
596
+ * Overrides default title key (${actionName}.title). If null, no title will be shown.
597
+ * @param title Title i18n key or title.
598
+ */
599
+ withTitle(title) {
600
+ this._title = title;
601
+ return this;
602
+ }
603
+ withIcon(icon) {
604
+ this._icon = icon;
605
+ return this;
606
+ }
607
+ withTooltip(tooltip) {
608
+ this._title = tooltip;
609
+ return this;
610
+ }
611
+ withClassName(className) {
612
+ this._className = className;
613
+ return this;
614
+ }
615
+ withSize(size = ActionDescriptor.SizeEnum.Normal) {
616
+ this._size = size;
617
+ return this;
618
+ }
619
+ withPosition(position) {
620
+ this._position = position;
621
+ return this;
622
+ }
623
+ withRunConfirmation(icon = 'pi pi-exclamation-triangle', title, message, acceptTitle, rejectTitle) {
624
+ this._hasRunConfirmation = true;
625
+ this._runConfirmationIcon = icon;
626
+ this._runConfirmationTitle = title;
627
+ this._runConfirmationMessage = message;
628
+ this._runConfirmationAcceptTitle = acceptTitle;
629
+ this._runConfirmationRejectTitle = rejectTitle;
630
+ return this;
631
+ }
632
+ withRunNotificationSuccess(title, message, hasNotification = true) {
633
+ this._hasRunNotificationSuccess = hasNotification;
634
+ this._runNotificationSuccessTitle = title;
635
+ this._runNotificationSuccessMessage = message;
636
+ }
637
+ withRunNotificationError(title, message, hasNotification = true) {
638
+ this._hasRunNotificationError = hasNotification;
639
+ this._runNotificationErrorTitle = title;
640
+ this._runNotificationErrorMessage = message;
641
+ }
642
+ }
643
+ (function (ActionDescriptor) {
644
+ let SizeEnum;
645
+ (function (SizeEnum) {
646
+ SizeEnum[SizeEnum["ExtraSmall"] = 0] = "ExtraSmall";
647
+ SizeEnum[SizeEnum["Small"] = 1] = "Small";
648
+ SizeEnum[SizeEnum["Normal"] = 2] = "Normal";
649
+ SizeEnum[SizeEnum["Large"] = 3] = "Large";
650
+ SizeEnum[SizeEnum["ExtraLarge"] = 4] = "ExtraLarge";
651
+ })(SizeEnum = ActionDescriptor.SizeEnum || (ActionDescriptor.SizeEnum = {}));
652
+ })(ActionDescriptor || (ActionDescriptor = {}));
653
+ class ActionEditorDescriptor extends ActionDescriptor {
654
+ constructor(editorDescriptor, actionName, parentType, parentProperty) {
655
+ super(editorDescriptor.model, actionName, parentType, parentProperty);
656
+ this._editorTitle = undefined;
657
+ this._hasFetchNotificationSuccess = false;
658
+ this._type = ActionTypeEnum.Editor;
659
+ this._editorDescriptor = editorDescriptor;
660
+ }
661
+ get editorTitle() {
662
+ return this._editorTitle;
663
+ }
664
+ get editorDescriptor() {
665
+ return this._editorDescriptor;
666
+ }
667
+ get hasFetchNotificationSuccess() {
668
+ return this._hasFetchNotificationSuccess;
669
+ }
670
+ get fetchNotificationSuccessTitle() {
671
+ return this._fetchNotificationSuccessTitle;
672
+ }
673
+ get fetchNotificationSuccessMessage() {
674
+ return this._fetchNotificationSuccessMessage;
675
+ }
676
+ get dataProvider() {
677
+ return this._dataProvider;
678
+ }
679
+ get runFunction() {
680
+ throw new Error('Run function cannot be used in editor action. Use submit function instead!');
681
+ }
682
+ get fetchFunction() {
683
+ if (!this._fetchFunction) {
684
+ return ctx => {
685
+ var _a, _b;
686
+ console.warn(`Fetch function is not provided for function ${this._actionName}, using default and returning context item`, (_a = ctx.data) === null || _a === void 0 ? void 0 : _a.item);
687
+ return of(((_b = ctx.data) === null || _b === void 0 ? void 0 : _b.item) ? ctx.data.item : {});
688
+ };
689
+ }
690
+ return this._fetchFunction;
691
+ }
692
+ get submitFunction() {
693
+ return this._submitFunction;
694
+ }
695
+ get editorComponent() {
696
+ return this._editorComponent;
697
+ }
698
+ withEditorTitle(title) {
699
+ this._editorTitle = title;
700
+ return this;
701
+ }
702
+ withDataProvider(dataProvider) {
703
+ this._dataProvider = dataProvider;
704
+ return this;
705
+ }
706
+ withServiceType(serviceType) {
707
+ this._dataProvider = new EditorDataProvider(this._model.type, serviceType);
708
+ return this;
709
+ }
710
+ withRunFunction(fn) {
711
+ return this.withSubmitFunction(fn);
712
+ }
713
+ withFetchFunction(fn) {
714
+ this._fetchFunction = fn;
715
+ return this;
716
+ }
717
+ withSubmitFunction(fn) {
718
+ this._submitFunction = fn;
719
+ return this;
720
+ }
721
+ withFetchNotificationError(title, message, hasNotification = true) {
722
+ this._hasFetchNotificationSuccess = hasNotification;
723
+ this._fetchNotificationSuccessTitle = title;
724
+ this._fetchNotificationSuccessMessage = message;
725
+ return this;
726
+ }
727
+ withEditorComponent(editorComponent) {
728
+ this._editorComponent = editorComponent;
729
+ return this;
730
+ }
731
+ }
732
+ class ActionEditorDetailsDescriptor extends ActionEditorDescriptor {
733
+ constructor(editorDescriptor) {
734
+ super(editorDescriptor, 'details');
735
+ this.withPosition(ActionPositionEnum.RowClick);
736
+ this.withRouteTrigger(':itemId');
737
+ this.withFetchFunction(ctx => {
738
+ var _a, _b, _c, _d;
739
+ return ((_a = ctx.dataProvider) === null || _a === void 0 ? void 0 : _a.fetch) && ((_b = ctx.data) === null || _b === void 0 ? void 0 : _b.itemId)
740
+ ? ctx.dataProvider.fetch((_c = ctx.data) === null || _c === void 0 ? void 0 : _c.itemId, ctx.serviceInstance)
741
+ : throwError(new Error(`Data provider fetch function or item id ${(_d = ctx.data) === null || _d === void 0 ? void 0 : _d.itemId} is missing.`));
742
+ });
743
+ this.withClassName('mng-details-dynamic-dialog');
744
+ }
745
+ withServiceType(serviceType) {
746
+ return this.withServiceFetchFunction(serviceType);
747
+ }
748
+ withServiceFetchFunction(serviceType, fetchFn) {
749
+ const dataProvider = new EditorDataProvider(this._model.type, serviceType);
750
+ if (fetchFn) {
751
+ dataProvider.withFetch(fetchFn);
752
+ }
753
+ this._dataProvider = dataProvider;
754
+ return this;
755
+ }
756
+ }
757
+ class ActionEditorAddDescriptor extends ActionEditorDescriptor {
758
+ constructor(editorDescriptor) {
759
+ super(editorDescriptor, 'add');
760
+ this.withPosition(ActionPositionEnum.ToolbarLeft);
761
+ this.withRouteTrigger('add');
762
+ this.withSubmitFunction(ctx => { var _a, _b; return ((_a = ctx.dataProvider) === null || _a === void 0 ? void 0 : _a.create) ? ctx.dataProvider.create((_b = ctx.data) === null || _b === void 0 ? void 0 : _b.item, ctx.serviceInstance) : throwError(new Error(`Data provider create function is missing.`)); });
763
+ this.withLevel(ActionLevelEnum.Success);
764
+ this.withIcon('pi pi-plus');
765
+ this.withClassName('mng-details-dynamic-dialog');
766
+ }
767
+ withServiceType(serviceType) {
768
+ return this.withServiceSubmitFunction(serviceType);
769
+ }
770
+ withServiceSubmitFunction(serviceType, createFn, fetchFn) {
771
+ const dataProvider = new EditorDataProvider(this._model.type, serviceType);
772
+ if (createFn) {
773
+ dataProvider.withCreate(createFn);
774
+ }
775
+ if (fetchFn) {
776
+ dataProvider.withFetch(fetchFn);
777
+ }
778
+ this._dataProvider = dataProvider;
779
+ return this;
780
+ }
781
+ }
782
+ class ActionEditorEditDescriptor extends ActionEditorDescriptor {
783
+ constructor(editorDescriptor) {
784
+ super(editorDescriptor, 'edit');
785
+ this.withPosition(ActionPositionEnum.RowInline);
786
+ this.withTitle(null);
787
+ this.withRouteTrigger(':itemId/edit');
788
+ this.withFetchFunction(ctx => {
789
+ var _a, _b, _c;
790
+ return ((_a = ctx.dataProvider) === null || _a === void 0 ? void 0 : _a.fetch) && ((_b = ctx.data) === null || _b === void 0 ? void 0 : _b.itemId)
791
+ ? ctx.dataProvider.fetch(ctx.data.itemId, ctx.serviceInstance)
792
+ : throwError(new Error(`Data provider fetch function or item id ${(_c = ctx.data) === null || _c === void 0 ? void 0 : _c.itemId} is missing.`));
793
+ });
794
+ this.withSubmitFunction(ctx => {
795
+ var _a, _b, _c, _d;
796
+ return ((_a = ctx.dataProvider) === null || _a === void 0 ? void 0 : _a.update) && ((_b = ctx.data) === null || _b === void 0 ? void 0 : _b.itemId)
797
+ ? ctx.dataProvider.update(ctx.data.itemId, (_c = ctx.data) === null || _c === void 0 ? void 0 : _c.item, ctx.serviceInstance)
798
+ : throwError(new Error(`Data provider update function or item id ${(_d = ctx.data) === null || _d === void 0 ? void 0 : _d.itemId} is missing.`));
799
+ });
800
+ this.withIcon('pi pi-pencil');
801
+ this.withClassName('mng-details-dynamic-dialog');
802
+ }
803
+ withServiceType(serviceType) {
804
+ return this.withServiceSubmitFunction(serviceType);
805
+ }
806
+ withServiceSubmitFunction(serviceType, updateFn, fetchFn) {
807
+ const dataProvider = new EditorDataProvider(this._model.type, serviceType);
808
+ if (updateFn) {
809
+ dataProvider.withUpdate(updateFn);
810
+ }
811
+ if (fetchFn) {
812
+ dataProvider.withFetch(fetchFn);
813
+ }
814
+ this._dataProvider = dataProvider;
815
+ return this;
816
+ }
817
+ }
818
+ class ActionDeleteDescriptor extends ActionDescriptor {
819
+ constructor(model) {
820
+ super(model, 'delete');
821
+ this.withPosition(ActionPositionEnum.RowInline);
822
+ this.withTitle(null);
823
+ this.withRunFunction(ctx => {
824
+ var _a, _b;
825
+ const editorDataProvider = ctx.dataProvider;
826
+ return (editorDataProvider === null || editorDataProvider === void 0 ? void 0 : editorDataProvider.delete) && ((_a = ctx.data) === null || _a === void 0 ? void 0 : _a.itemId)
827
+ ? editorDataProvider.delete(ctx.data.itemId, ctx.data.item, ctx.serviceInstance)
828
+ : throwError(new Error(`Data provider delete function or item id ${(_b = ctx.data) === null || _b === void 0 ? void 0 : _b.itemId} is missing.`));
829
+ });
830
+ this.withLevel(ActionLevelEnum.Danger);
831
+ this.withIcon('pi pi-trash');
832
+ this.withRunConfirmation(undefined);
833
+ }
834
+ withServiceType(serviceType) {
835
+ return this.withServiceDeleteFunction(serviceType);
836
+ }
837
+ withServiceDeleteFunction(serviceType, deleteFn) {
838
+ const dataProvider = new EditorDataProvider(this._model.type, serviceType);
839
+ if (deleteFn) {
840
+ dataProvider.withDelete(deleteFn);
709
841
  }
710
- const filterParam = new MediusFilterParam();
711
- filterParam.property = property;
712
- filterParam.filterValue = value;
713
- filterParam.filterValueTo = valueTo;
714
- filterParam.filterMatchType = matchType;
715
- filterParam.filterMatchCaseSensitive = matchCaseSensitive;
716
- this.queryParam.filterParams.push(filterParam);
842
+ this._dataProvider = dataProvider;
717
843
  return this;
718
844
  }
719
- build() {
720
- const queryParam = this.queryParam;
721
- this.queryParam = new MediusQueryParam();
722
- return queryParam;
723
- }
724
845
  }
846
+ var ActionPositionEnum;
847
+ (function (ActionPositionEnum) {
848
+ ActionPositionEnum[ActionPositionEnum["ToolbarLeft"] = 0] = "ToolbarLeft";
849
+ ActionPositionEnum[ActionPositionEnum["ToolbarRight"] = 1] = "ToolbarRight";
850
+ ActionPositionEnum[ActionPositionEnum["TableHeader"] = 2] = "TableHeader";
851
+ ActionPositionEnum[ActionPositionEnum["RowInline"] = 3] = "RowInline";
852
+ ActionPositionEnum[ActionPositionEnum["RowClick"] = 4] = "RowClick";
853
+ })(ActionPositionEnum || (ActionPositionEnum = {}));
854
+ var ActionActivationTriggerEnum;
855
+ (function (ActionActivationTriggerEnum) {
856
+ ActionActivationTriggerEnum[ActionActivationTriggerEnum["OnClick"] = 0] = "OnClick";
857
+ ActionActivationTriggerEnum[ActionActivationTriggerEnum["OnRoute"] = 1] = "OnRoute"; // action is triggered for activation by route url
858
+ })(ActionActivationTriggerEnum || (ActionActivationTriggerEnum = {}));
859
+ var ActionTypeEnum;
860
+ (function (ActionTypeEnum) {
861
+ ActionTypeEnum[ActionTypeEnum["Direct"] = 0] = "Direct";
862
+ ActionTypeEnum[ActionTypeEnum["Editor"] = 1] = "Editor"; // editor providing middle step for activation
863
+ })(ActionTypeEnum || (ActionTypeEnum = {}));
864
+ var ActionLevelEnum;
865
+ (function (ActionLevelEnum) {
866
+ ActionLevelEnum[ActionLevelEnum["Default"] = 0] = "Default";
867
+ ActionLevelEnum[ActionLevelEnum["Primary"] = 1] = "Primary";
868
+ ActionLevelEnum[ActionLevelEnum["Secondary"] = 2] = "Secondary";
869
+ ActionLevelEnum[ActionLevelEnum["Info"] = 3] = "Info";
870
+ ActionLevelEnum[ActionLevelEnum["Help"] = 4] = "Help";
871
+ ActionLevelEnum[ActionLevelEnum["Success"] = 5] = "Success";
872
+ ActionLevelEnum[ActionLevelEnum["Warning"] = 6] = "Warning";
873
+ ActionLevelEnum[ActionLevelEnum["Danger"] = 7] = "Danger";
874
+ })(ActionLevelEnum || (ActionLevelEnum = {}));
725
875
 
726
- /* tslint:disable:no-angle-bracket-type-assertion no-trailing-whitespace member-ordering object-literal-key-quotes */
727
- const enumsMapBase = {
728
- FilterMatchType: MediusFilterMatchType,
729
- QueryMode: MediusQueryMode
730
- };
731
- const typeMapBase = {
732
- FilterParam: MediusFilterParam,
733
- QueryParam: MediusQueryParam,
734
- QueryResult: MediusQueryResult,
735
- QueryResultWithObject: MediusQueryResultWithObject
736
- };
737
-
738
- class TableviewDataProvider extends EditorDataProvider {
739
- constructor(modelType, serviceType) {
740
- super(modelType, serviceType);
741
- this._getAll = () => of(new MediusQueryResult());
742
- }
743
- get getAll() {
744
- return this._getAll;
876
+ class MngFormEditorSubmitEvent {
877
+ constructor(formItem) {
878
+ this.formItem = formItem;
879
+ this.success = true;
745
880
  }
746
- withGetAll(getAll) {
747
- this._getAll = getAll;
748
- return this;
881
+ }
882
+ var MngFormFieldEventTypeEnum;
883
+ (function (MngFormFieldEventTypeEnum) {
884
+ MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Component"] = 0] = "Component";
885
+ MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["ValueChange"] = 1] = "ValueChange";
886
+ MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["DataProvider"] = 2] = "DataProvider";
887
+ MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Dialog"] = 3] = "Dialog";
888
+ MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Other"] = 4] = "Other";
889
+ })(MngFormFieldEventTypeEnum || (MngFormFieldEventTypeEnum = {}));
890
+ class MngFormFieldEventComponentSubtype {
891
+ }
892
+ MngFormFieldEventComponentSubtype.ON_INIT = 'Component.OnInit';
893
+ MngFormFieldEventComponentSubtype.ON_VIEW_INIT = 'Component.OnViewInit';
894
+ MngFormFieldEventComponentSubtype.ON_CONTENT_INIT = 'Component.OnContentInit';
895
+ MngFormFieldEventComponentSubtype.ON_DESTROY = 'Component.OnDestroy';
896
+ class MngFormFieldEventDialogSubtype {
897
+ }
898
+ MngFormFieldEventDialogSubtype.VISIBILITY = 'Dialog.Visibility';
899
+ MngFormFieldEventDialogSubtype.TABLE_CAPTION_COMPONENT_INSTANCE = 'Dialog.MngTable.CaptionComponentInstance';
900
+ MngFormFieldEventDialogSubtype.TABLE_COLUMN_ACTIONS_COMPONENT_INSTANCE = 'Dialog.MngTable.ColumnActionsComponentInstance';
901
+ class MngFormFieldEvent {
902
+ constructor(type, componentType, componentInstance, data = {}) {
903
+ this.type = type;
904
+ this.componentType = componentType;
905
+ this.componentInstance = componentInstance;
906
+ this.data = data;
749
907
  }
750
908
  }
751
909
 
@@ -894,22 +1052,37 @@ class EditorDescriptor {
894
1052
  EditorDescriptor.defaultGroupName = '_default';
895
1053
  class AGenericFieldDescriptor {
896
1054
  constructor(editor) {
1055
+ this._config = {};
897
1056
  this._editor = editor;
898
1057
  }
899
1058
  get editor() {
900
1059
  return this._editor;
901
1060
  }
1061
+ get config() {
1062
+ return this._config;
1063
+ }
1064
+ withConfig(config) {
1065
+ this._config = config;
1066
+ return this;
1067
+ }
902
1068
  }
903
1069
  class AFieldDescriptor extends AGenericFieldDescriptor {
904
1070
  constructor(editor, property) {
905
1071
  super(editor);
906
1072
  this._required = false;
907
1073
  this._disabled = false;
908
- this._className = '';
909
1074
  this._validators = [];
1075
+ this._className = '';
1076
+ this._labelClassName = '';
1077
+ this._inputClassName = '';
1078
+ this._size = FieldDescriptor.SizeEnum.Normal;
1079
+ this._eventsSubject = new Subject();
910
1080
  this._property = property;
911
1081
  this._label = I18nUtil.getModelPropertyKey(this._editor.model, property);
912
1082
  }
1083
+ get property() {
1084
+ return this._property;
1085
+ }
913
1086
  get group() {
914
1087
  return this._group;
915
1088
  }
@@ -919,6 +1092,9 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
919
1092
  get placeholder() {
920
1093
  return this._placeholder;
921
1094
  }
1095
+ get helpText() {
1096
+ return this._helpText;
1097
+ }
922
1098
  get required() {
923
1099
  return this._required;
924
1100
  }
@@ -928,9 +1104,6 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
928
1104
  get defaultValue() {
929
1105
  return this._defaultValue;
930
1106
  }
931
- get className() {
932
- return this._className;
933
- }
934
1107
  get getter() {
935
1108
  return this._getter;
936
1109
  }
@@ -940,11 +1113,32 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
940
1113
  get validators() {
941
1114
  return this._validators;
942
1115
  }
943
- get disabledFunction() {
944
- return this._disabledFunction;
1116
+ get requiredExpression() {
1117
+ return this._requiredExpression;
945
1118
  }
946
- get property() {
947
- return this._property;
1119
+ get disabledExpression() {
1120
+ return this._disabledExpression;
1121
+ }
1122
+ get hiddenExpression() {
1123
+ return this._hiddenExpression;
1124
+ }
1125
+ get className() {
1126
+ return this._className;
1127
+ }
1128
+ get labelClassName() {
1129
+ return this._labelClassName;
1130
+ }
1131
+ get inputClassName() {
1132
+ return this._inputClassName;
1133
+ }
1134
+ get size() {
1135
+ return this._size;
1136
+ }
1137
+ get isSizeSmall() {
1138
+ return this._size === FieldDescriptor.SizeEnum.Small;
1139
+ }
1140
+ get isSizeLarge() {
1141
+ return this._size === FieldDescriptor.SizeEnum.Large;
948
1142
  }
949
1143
  withLabel(label) {
950
1144
  this._label = label;
@@ -954,23 +1148,30 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
954
1148
  this._placeholder = placeholder;
955
1149
  return this;
956
1150
  }
957
- withRequired(required = true) {
1151
+ withHelpText(helpText) {
1152
+ this._helpText = helpText;
1153
+ return this;
1154
+ }
1155
+ withRequired(required = true, requiredExpression) {
958
1156
  this._required = required;
1157
+ if (requiredExpression) {
1158
+ this._requiredExpression = requiredExpression;
1159
+ }
959
1160
  return this;
960
1161
  }
961
- withDisabled(disabled = true, disabledFunction) {
1162
+ withDisabled(disabled = true, disabledExpression) {
962
1163
  this._disabled = disabled;
963
- if (disabledFunction) {
964
- this._disabledFunction = disabledFunction;
1164
+ if (disabledExpression) {
1165
+ this._disabledExpression = disabledExpression;
965
1166
  }
966
1167
  return this;
967
1168
  }
968
- withDefaultValue(defaultValue) {
969
- this._defaultValue = defaultValue;
1169
+ withHidden(hiddenExpression) {
1170
+ this._hiddenExpression = hiddenExpression;
970
1171
  return this;
971
1172
  }
972
- withClassName(className) {
973
- this._className = className;
1173
+ withDefaultValue(defaultValue) {
1174
+ this._defaultValue = defaultValue;
974
1175
  return this;
975
1176
  }
976
1177
  withGetter(getter) {
@@ -985,23 +1186,53 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
985
1186
  this._validators.push(new FieldValidator(name, expression, message));
986
1187
  return this;
987
1188
  }
1189
+ withClassName(className, labelClassName = '', inputClassName = '') {
1190
+ this._className = className;
1191
+ this._labelClassName = labelClassName;
1192
+ this._inputClassName = inputClassName;
1193
+ return this;
1194
+ }
1195
+ withSize(size = FieldDescriptor.SizeEnum.Normal) {
1196
+ this._size = size;
1197
+ return this;
1198
+ }
1199
+ nextEvent(type, cmpType, cmpInstance, data) {
1200
+ this._eventsSubject.next(new MngFormFieldEvent(type, cmpType, cmpInstance, data));
1201
+ }
1202
+ get events$() {
1203
+ return this._eventsSubject.asObservable();
1204
+ }
988
1205
  copyFieldsTo(obj) {
989
1206
  obj._label = this._label;
990
1207
  obj._placeholder = this._placeholder;
1208
+ obj._helpText = this._helpText;
991
1209
  obj._required = this._required;
992
1210
  obj._disabled = this._disabled;
993
1211
  obj._defaultValue = this._defaultValue;
994
- obj._disabledFunction = this._disabledFunction;
1212
+ obj._requiredExpression = this._requiredExpression;
1213
+ obj._hiddenExpression = this._hiddenExpression;
1214
+ obj._disabledExpression = this._disabledExpression;
995
1215
  obj._className = this._className;
1216
+ obj._size = this.size;
996
1217
  obj._getter = this._getter;
997
1218
  obj._setter = this._setter;
998
1219
  obj._validators = this._validators;
999
1220
  }
1000
1221
  }
1222
+ var FieldDescriptor;
1223
+ (function (FieldDescriptor) {
1224
+ let SizeEnum;
1225
+ (function (SizeEnum) {
1226
+ SizeEnum[SizeEnum["Small"] = 0] = "Small";
1227
+ SizeEnum[SizeEnum["Normal"] = 1] = "Normal";
1228
+ SizeEnum[SizeEnum["Large"] = 2] = "Large";
1229
+ })(SizeEnum = FieldDescriptor.SizeEnum || (FieldDescriptor.SizeEnum = {}));
1230
+ })(FieldDescriptor || (FieldDescriptor = {}));
1001
1231
  class FieldInputDescriptor extends AFieldDescriptor {
1002
1232
  constructor(editor, property) {
1003
1233
  super(editor, property);
1004
1234
  this._fieldType = FieldInputDescriptor.TypeEnum.Text;
1235
+ this._numberUseGrouping = true;
1005
1236
  // radio specific properties
1006
1237
  this._radioOptions = [];
1007
1238
  this._datePickerShowTime = false;
@@ -1027,6 +1258,9 @@ class FieldInputDescriptor extends AFieldDescriptor {
1027
1258
  get numberMaxFractionDigits() {
1028
1259
  return this._numberMaxFractionDigits;
1029
1260
  }
1261
+ get numberUseGrouping() {
1262
+ return this._numberUseGrouping;
1263
+ }
1030
1264
  get radioOptions() {
1031
1265
  return this._radioOptions;
1032
1266
  }
@@ -1060,6 +1294,10 @@ class FieldInputDescriptor extends AFieldDescriptor {
1060
1294
  get customComponentName() {
1061
1295
  return this._customComponentName;
1062
1296
  }
1297
+ asHidden() {
1298
+ this._fieldType = FieldInputDescriptor.TypeEnum.Hidden;
1299
+ return this;
1300
+ }
1063
1301
  asText(minLength, maxLength, pattern, isEmail) {
1064
1302
  this._fieldType = FieldInputDescriptor.TypeEnum.Text;
1065
1303
  this._minLength = minLength;
@@ -1078,13 +1316,14 @@ class FieldInputDescriptor extends AFieldDescriptor {
1078
1316
  this._pattern = pattern;
1079
1317
  return this;
1080
1318
  }
1081
- asNumber(step, min, max, minFractionDigits, maxFractionDigits) {
1319
+ asNumber(step, min, max, minFractionDigits, maxFractionDigits, numberUseGrouping = true) {
1082
1320
  this._fieldType = FieldInputDescriptor.TypeEnum.Number;
1083
1321
  this._numberStep = step;
1084
1322
  this._numberMinFractionDigits = minFractionDigits;
1085
1323
  this._numberMaxFractionDigits = maxFractionDigits;
1086
1324
  this._numberMin = min !== null && min !== void 0 ? min : Number.MIN_SAFE_INTEGER;
1087
1325
  this._numberMax = max !== null && max !== void 0 ? max : Number.MAX_SAFE_INTEGER;
1326
+ this._numberUseGrouping = numberUseGrouping;
1088
1327
  return this;
1089
1328
  }
1090
1329
  asSwitch() {
@@ -1135,6 +1374,7 @@ class FieldInputDescriptor extends AFieldDescriptor {
1135
1374
  field._numberStep = this._numberStep;
1136
1375
  field._numberMinFractionDigits = this._numberMinFractionDigits;
1137
1376
  field._numberMaxFractionDigits = this._numberMaxFractionDigits;
1377
+ field._numberUseGrouping = this._numberUseGrouping;
1138
1378
  field._radioOptions = [...this._radioOptions];
1139
1379
  field._datePickerFormat = this._datePickerFormat;
1140
1380
  field._datePickerMin = this._datePickerMin;
@@ -1152,14 +1392,15 @@ class FieldInputDescriptor extends AFieldDescriptor {
1152
1392
  (function (FieldInputDescriptor) {
1153
1393
  let TypeEnum;
1154
1394
  (function (TypeEnum) {
1155
- TypeEnum[TypeEnum["Text"] = 0] = "Text";
1156
- TypeEnum[TypeEnum["Textarea"] = 1] = "Textarea";
1157
- TypeEnum[TypeEnum["Number"] = 2] = "Number";
1158
- TypeEnum[TypeEnum["Switch"] = 3] = "Switch";
1159
- TypeEnum[TypeEnum["Radio"] = 4] = "Radio";
1160
- TypeEnum[TypeEnum["Datepicker"] = 5] = "Datepicker";
1161
- TypeEnum[TypeEnum["Mask"] = 6] = "Mask";
1162
- TypeEnum[TypeEnum["Custom"] = 7] = "Custom";
1395
+ TypeEnum[TypeEnum["Hidden"] = 0] = "Hidden";
1396
+ TypeEnum[TypeEnum["Text"] = 1] = "Text";
1397
+ TypeEnum[TypeEnum["Textarea"] = 2] = "Textarea";
1398
+ TypeEnum[TypeEnum["Number"] = 3] = "Number";
1399
+ TypeEnum[TypeEnum["Switch"] = 4] = "Switch";
1400
+ TypeEnum[TypeEnum["Radio"] = 5] = "Radio";
1401
+ TypeEnum[TypeEnum["Datepicker"] = 6] = "Datepicker";
1402
+ TypeEnum[TypeEnum["Mask"] = 7] = "Mask";
1403
+ TypeEnum[TypeEnum["Custom"] = 8] = "Custom";
1163
1404
  })(TypeEnum = FieldInputDescriptor.TypeEnum || (FieldInputDescriptor.TypeEnum = {}));
1164
1405
  })(FieldInputDescriptor || (FieldInputDescriptor = {}));
1165
1406
  class FieldLookupDescriptor extends AFieldDescriptor {
@@ -1184,9 +1425,15 @@ class FieldLookupDescriptor extends AFieldDescriptor {
1184
1425
  get dataProvider() {
1185
1426
  return this._dataProvider;
1186
1427
  }
1428
+ get lookupTableDataProvider() {
1429
+ return this._lookupTableDataProvider;
1430
+ }
1187
1431
  get modelType() {
1188
1432
  return this._modelType;
1189
1433
  }
1434
+ get lookupTableDescriptor() {
1435
+ return this._lookupTableDescriptor;
1436
+ }
1190
1437
  withItemsLabelProperty(itemsLabelProperty) {
1191
1438
  this._itemsLabelProperty = itemsLabelProperty;
1192
1439
  return this;
@@ -1212,10 +1459,19 @@ class FieldLookupDescriptor extends AFieldDescriptor {
1212
1459
  this._dataProvider = dataProvider;
1213
1460
  return this;
1214
1461
  }
1462
+ withConfig(config) {
1463
+ return super.withConfig(config);
1464
+ }
1215
1465
  asAutocomplete() {
1216
1466
  this._lookupType = FieldLookupDescriptor.LookupTypeEnum.Autocomplete;
1217
1467
  return this;
1218
1468
  }
1469
+ asDialog(lookupTableDescriptor, tableDataProvider) {
1470
+ this._lookupType = FieldLookupDescriptor.LookupTypeEnum.Dialog;
1471
+ this._lookupTableDescriptor = lookupTableDescriptor;
1472
+ this._lookupTableDataProvider = tableDataProvider;
1473
+ return this;
1474
+ }
1219
1475
  copy() {
1220
1476
  const field = new FieldLookupDescriptor(this._editor, this._property, this._modelType);
1221
1477
  this.copyFieldsTo(field);
@@ -1224,6 +1480,7 @@ class FieldLookupDescriptor extends AFieldDescriptor {
1224
1480
  field._itemsValueProperty = this._itemsValueProperty;
1225
1481
  field._dataKeyProperty = this._dataKeyProperty;
1226
1482
  field._dataProvider = this._dataProvider;
1483
+ field._lookupTableDescriptor = this._lookupTableDescriptor;
1227
1484
  return field;
1228
1485
  }
1229
1486
  }
@@ -1232,6 +1489,7 @@ class FieldLookupDescriptor extends AFieldDescriptor {
1232
1489
  (function (LookupTypeEnum) {
1233
1490
  LookupTypeEnum[LookupTypeEnum["Dropdown"] = 0] = "Dropdown";
1234
1491
  LookupTypeEnum[LookupTypeEnum["Autocomplete"] = 1] = "Autocomplete";
1492
+ LookupTypeEnum[LookupTypeEnum["Dialog"] = 2] = "Dialog";
1235
1493
  })(LookupTypeEnum = FieldLookupDescriptor.LookupTypeEnum || (FieldLookupDescriptor.LookupTypeEnum = {}));
1236
1494
  })(FieldLookupDescriptor || (FieldLookupDescriptor = {}));
1237
1495
  class FieldLookupEnumDescriptor extends FieldLookupDescriptor {
@@ -2269,6 +2527,8 @@ class EditorFormlyUtil {
2269
2527
  field.templateOptions['descriptor'] = descriptor;
2270
2528
  if (descriptor instanceof FieldInputDescriptor) {
2271
2529
  switch (descriptor.fieldType) {
2530
+ case FieldInputDescriptor.TypeEnum.Hidden:
2531
+ break;
2272
2532
  case FieldInputDescriptor.TypeEnum.Textarea:
2273
2533
  field.type = 'textarea';
2274
2534
  break;
@@ -2308,6 +2568,9 @@ class EditorFormlyUtil {
2308
2568
  case FieldLookupDescriptor.LookupTypeEnum.Autocomplete:
2309
2569
  field.type = 'autocomplete';
2310
2570
  break;
2571
+ case FieldLookupDescriptor.LookupTypeEnum.Dialog:
2572
+ field.type = 'dialog';
2573
+ break;
2311
2574
  case FieldLookupDescriptor.LookupTypeEnum.Dropdown:
2312
2575
  default:
2313
2576
  field.type = 'dropdown';
@@ -2323,11 +2586,17 @@ class EditorFormlyUtil {
2323
2586
  if (descriptor.label) {
2324
2587
  field.templateOptions.label = descriptor.label;
2325
2588
  }
2589
+ if (descriptor.requiredExpression) {
2590
+ field.expressionProperties['templateOptions.required'] = descriptor.requiredExpression;
2591
+ }
2326
2592
  if (descriptor.required) {
2327
2593
  field.templateOptions.required = true;
2328
2594
  }
2329
- if (descriptor.disabledFunction) {
2330
- field.expressionProperties['templateOptions.disabled'] = descriptor.disabledFunction;
2595
+ if (descriptor.hiddenExpression) {
2596
+ field.expressionProperties['hide'] = descriptor.hiddenExpression;
2597
+ }
2598
+ if (descriptor.disabledExpression) {
2599
+ field.expressionProperties['templateOptions.disabled'] = descriptor.disabledExpression;
2331
2600
  }
2332
2601
  else if (descriptor.disabled) {
2333
2602
  field.templateOptions.disabled = true;
@@ -2625,8 +2894,16 @@ class ModelUtil {
2625
2894
  }
2626
2895
 
2627
2896
  class ToastUtil {
2628
- static tableNotificationError(translationService, table, error, tableview) {
2629
- var _a, _b, _c;
2897
+ static notification(viewContainer, title, message, severity = 'success') {
2898
+ const messageService = viewContainer === null || viewContainer === void 0 ? void 0 : viewContainer.getMessageService();
2899
+ if (!messageService) {
2900
+ console.warn(`No message service was provided through view container, message will not be displayed.`);
2901
+ return;
2902
+ }
2903
+ messageService.add({ severity: severity, summary: title, detail: message });
2904
+ }
2905
+ static tableNotificationError(translationService, table, error, viewContainer) {
2906
+ var _a, _b;
2630
2907
  const params = {};
2631
2908
  if (error === null || error === void 0 ? void 0 : error.message) {
2632
2909
  params.errorMessage = `: ${error.message}`;
@@ -2637,16 +2914,16 @@ class ToastUtil {
2637
2914
  console.log(params);
2638
2915
  const tableErrorTitle = (_a = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.title', undefined, undefined, 'general.error', params)) !== null && _a !== void 0 ? _a : undefined;
2639
2916
  const tableErrorMessage = (_b = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.message', undefined, undefined, 'general.errorMessage', params)) !== null && _b !== void 0 ? _b : undefined;
2640
- (_c = tableview === null || tableview === void 0 ? void 0 : tableview.messageService) === null || _c === void 0 ? void 0 : _c.add({ severity: 'error', summary: tableErrorTitle, detail: tableErrorMessage });
2917
+ ToastUtil.notification(viewContainer, tableErrorTitle, tableErrorMessage, 'error');
2641
2918
  }
2642
- static actionNotificationSuccess(translationService, action, functionName, customTitleKey, customMessageKey, tableview, item) {
2643
- var _a, _b, _c;
2919
+ static actionNotificationSuccess(translationService, action, functionName, customTitleKey, customMessageKey, viewContainer, item) {
2920
+ var _a, _b;
2644
2921
  const actionSuccessTitle = (_a = I18nUtil.instantActionTranslation(translationService, action, 'success.title', customTitleKey, item, 'general.success', functionName)) !== null && _a !== void 0 ? _a : undefined;
2645
2922
  const actionSuccessMessage = (_b = I18nUtil.instantActionTranslation(translationService, action, 'success.message', customMessageKey, item, 'general.successMessage', functionName)) !== null && _b !== void 0 ? _b : undefined;
2646
- (_c = tableview === null || tableview === void 0 ? void 0 : tableview.messageService) === null || _c === void 0 ? void 0 : _c.add({ severity: 'success', summary: actionSuccessTitle, detail: actionSuccessMessage });
2923
+ ToastUtil.notification(viewContainer, actionSuccessTitle, actionSuccessMessage);
2647
2924
  }
2648
- static actionNotificationError(translationService, action, error, functionName, tableview, item) {
2649
- var _a, _b, _c;
2925
+ static actionNotificationError(translationService, action, error, functionName, viewContainer, item) {
2926
+ var _a, _b;
2650
2927
  const params = {};
2651
2928
  if (error === null || error === void 0 ? void 0 : error.message) {
2652
2929
  params.errorMessage = `: ${error.message}`;
@@ -2656,7 +2933,7 @@ class ToastUtil {
2656
2933
  }
2657
2934
  const actionErrorTitle = (_a = I18nUtil.instantActionTranslation(translationService, action, 'error.title', action.runNotificationErrorTitle, item, 'general.error', functionName, params)) !== null && _a !== void 0 ? _a : undefined;
2658
2935
  const actionErrorMessage = (_b = I18nUtil.instantActionTranslation(translationService, action, 'error.message', action.runNotificationErrorMessage, item, 'general.errorMessage', functionName, params)) !== null && _b !== void 0 ? _b : undefined;
2659
- (_c = tableview === null || tableview === void 0 ? void 0 : tableview.messageService) === null || _c === void 0 ? void 0 : _c.add({ severity: 'error', summary: actionErrorTitle, detail: actionErrorMessage });
2936
+ ToastUtil.notification(viewContainer, actionErrorTitle, actionErrorMessage, 'error');
2660
2937
  }
2661
2938
  static getFormEditorWarningMessage(translationService, title, message) {
2662
2939
  var _a, _b;
@@ -3111,12 +3388,12 @@ MediusRestUtil.matchModeMapping = [
3111
3388
  ];
3112
3389
 
3113
3390
  class ActionExecContext {
3114
- constructor(dataProvider, serviceInstance, data, sourceComponent = null, tableview = null) {
3391
+ constructor(dataProvider, serviceInstance, data, sourceComponent = null, viewContainer = null) {
3115
3392
  this.dataProvider = dataProvider;
3116
3393
  this.serviceInstance = serviceInstance;
3117
3394
  this.data = data;
3118
3395
  this.sourceComponent = sourceComponent;
3119
- this.tableview = tableview;
3396
+ this.viewContainer = viewContainer;
3120
3397
  }
3121
3398
  }
3122
3399
  class ActionError {
@@ -3168,25 +3445,35 @@ class ActionTriggerResult {
3168
3445
  }
3169
3446
  }
3170
3447
 
3171
- class MngActionService {
3172
- constructor(injector, router, dialogService, confirmationService, translate) {
3448
+ const MNG_BROWSER_STORAGE_IT = new InjectionToken('Browser storage', {
3449
+ providedIn: 'root',
3450
+ factory: () => localStorage
3451
+ });
3452
+
3453
+ const ACTION_EDITOR_DIALOG_COMPONENT_SETTING = new InjectionToken('ACTION_EDITOR_DIALOG_COMPONENT_SETTING');
3454
+
3455
+ const MNG_MODULE_CONFIG_IT = new InjectionToken('MngModuleConfig');
3456
+
3457
+ class MngActionExecutorService {
3458
+ constructor(injector, router, dialogService, confirmationService, translate, defaultEditorDialogComponent) {
3173
3459
  this.injector = injector;
3174
3460
  this.router = router;
3175
3461
  this.dialogService = dialogService;
3176
3462
  this.confirmationService = confirmationService;
3177
3463
  this.translate = translate;
3464
+ this.defaultEditorDialogComponent = defaultEditorDialogComponent;
3178
3465
  }
3179
- getActionExecContext(action, itemId, item, dataProvider, tableview, sourceComponent, actionData) {
3180
- var _a;
3181
- return new ActionExecContext(dataProvider, (_a = this.getDataProviderService(dataProvider)) !== null && _a !== void 0 ? _a : undefined, {
3466
+ prepareActionExecContext(action, itemId, item, dataProvider, viewContainer, sourceComponent, actionData) {
3467
+ var _a, _b;
3468
+ return new ActionExecContext((_a = dataProvider !== null && dataProvider !== void 0 ? dataProvider : action.dataProvider) !== null && _a !== void 0 ? _a : viewContainer === null || viewContainer === void 0 ? void 0 : viewContainer.getDataProvider(), (_b = this.getDataProviderService(dataProvider)) !== null && _b !== void 0 ? _b : undefined, {
3182
3469
  item,
3183
3470
  itemId,
3184
3471
  actionData
3185
- }, sourceComponent, tableview);
3472
+ }, sourceComponent, viewContainer);
3186
3473
  }
3187
- runAction(action, itemId, item, dataProvider, sourceComponent, tableview, actionData) {
3474
+ runAction(action, itemId, item, dataProvider, sourceComponent, viewContainer, actionData) {
3188
3475
  var _a, _b, _c, _d;
3189
- const context = this.getActionExecContext(action, itemId, item, dataProvider, tableview, sourceComponent, actionData);
3476
+ const context = this.prepareActionExecContext(action, itemId, item, dataProvider, viewContainer, sourceComponent, actionData);
3190
3477
  if (action.hasRunConfirmation) {
3191
3478
  if (typeof (sourceComponent === null || sourceComponent === void 0 ? void 0 : sourceComponent.getConfirmationService) !== 'function' || typeof (sourceComponent === null || sourceComponent === void 0 ? void 0 : sourceComponent.getConfirmationServiceInstanceKey) !== 'function') {
3192
3479
  throw Error(`Source component ${sourceComponent} should be implementing IConfirmationService interface to be able to provide confirmation functionality.`);
@@ -3224,12 +3511,12 @@ class MngActionService {
3224
3511
  .runFunction(context)
3225
3512
  .pipe(first(), map(res => new ActionRunResult(context, res)), map(value => {
3226
3513
  if (action.hasRunNotificationSuccess) {
3227
- ToastUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, tableview, item);
3514
+ ToastUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, item);
3228
3515
  }
3229
3516
  return value;
3230
3517
  }), catchError(err => {
3231
3518
  if (action.hasRunNotificationError) {
3232
- ToastUtil.actionNotificationError(this.translate, action, err, 'run', tableview, item);
3519
+ ToastUtil.actionNotificationError(this.translate, action, err, 'run', viewContainer, item);
3233
3520
  }
3234
3521
  throw err;
3235
3522
  }))
@@ -3247,12 +3534,12 @@ class MngActionService {
3247
3534
  else {
3248
3535
  return action.runFunction(context).pipe(map(res => new ActionRunResult(context, res)), map(value => {
3249
3536
  if (action.hasRunNotificationSuccess) {
3250
- ToastUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, tableview, item);
3537
+ ToastUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, item);
3251
3538
  }
3252
3539
  return value;
3253
3540
  }), catchError(err => {
3254
3541
  if (action.hasRunNotificationError) {
3255
- ToastUtil.actionNotificationError(this.translate, action, err, 'run', tableview, item);
3542
+ ToastUtil.actionNotificationError(this.translate, action, err, 'run', viewContainer, item);
3256
3543
  }
3257
3544
  throw err;
3258
3545
  }));
@@ -3266,22 +3553,22 @@ class MngActionService {
3266
3553
  * @param formItem Item instance (from form).
3267
3554
  * @param dataProvider Data provider
3268
3555
  * @param sourceComponent Source component from where the fetch function was called.
3269
- * @param tableview Tableview component.
3556
+ * @param viewContainer View container/service.
3270
3557
  * @param actionData Additional action data.
3271
3558
  */
3272
- runEditorSave(action, itemId, formItem, dataProvider, sourceComponent, tableview, actionData) {
3273
- const context = this.prepareRunContextForEditor(formItem, itemId, dataProvider, sourceComponent, tableview, actionData);
3559
+ runEditorSave(action, itemId, formItem, dataProvider, sourceComponent, viewContainer, actionData) {
3560
+ const context = this.prepareExecContextForEditor(action, formItem, itemId, dataProvider, sourceComponent, viewContainer, actionData);
3274
3561
  if (typeof action.submitFunction !== 'function') {
3275
3562
  throw new Error(`Submit function for action ${action.actionName} cannot be invoked.`);
3276
3563
  }
3277
3564
  return action.submitFunction(context).pipe(map(res => new ActionRunResult(context, res)), map(value => {
3278
3565
  if (action.hasRunNotificationSuccess) {
3279
- ToastUtil.actionNotificationSuccess(this.translate, action, 'submit', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, tableview, formItem);
3566
+ ToastUtil.actionNotificationSuccess(this.translate, action, 'submit', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, formItem);
3280
3567
  }
3281
3568
  return value;
3282
3569
  }), catchError(err => {
3283
3570
  if (action.hasRunNotificationError) {
3284
- ToastUtil.actionNotificationError(this.translate, action, err, 'submit', tableview, formItem);
3571
+ ToastUtil.actionNotificationError(this.translate, action, err, 'submit', viewContainer, formItem);
3285
3572
  }
3286
3573
  throw err;
3287
3574
  }));
@@ -3293,31 +3580,41 @@ class MngActionService {
3293
3580
  * @param itemId Item id.
3294
3581
  * @param dataProvider Data provider
3295
3582
  * @param sourceComponent Source component from where the fetch function was called.
3296
- * @param tableview Tableview component.
3583
+ * @param viewContainer View container/service. Tableview component.
3297
3584
  * @param actionData Additional action data.
3298
3585
  */
3299
- runEditorFetch(action, itemId, dataProvider, sourceComponent, tableview, actionData) {
3300
- const context = this.prepareRunContextForEditor(undefined, itemId, dataProvider, sourceComponent, tableview, actionData);
3586
+ runEditorFetch(action, itemId, dataProvider, sourceComponent, viewContainer, actionData) {
3587
+ const context = this.prepareExecContextForEditor(action, undefined, itemId, dataProvider, sourceComponent, viewContainer, actionData);
3301
3588
  return action.fetchFunction(context).pipe(map(res => new ActionRunResult(context, res)));
3302
3589
  // TODO: error handling
3303
3590
  }
3304
3591
  /**
3305
- * Prepares action run context for action of type editor.
3592
+ * Prepares action exec context for action of type editor.
3306
3593
  *
3307
3594
  * @param item Item instance (if exists).
3308
3595
  * @param itemId Item id (if exists).
3309
3596
  * @param dataProvider Data provider.
3310
3597
  * @param sourceComponent Source component from where the context preparation was called.
3311
- * @param tableview Tableview component.
3598
+ * @param viewContainer View container/service.
3312
3599
  * @param actionData Additional action data.
3313
3600
  */
3314
- prepareRunContextForEditor(item, itemId, dataProvider, sourceComponent, tableview, actionData) {
3601
+ prepareExecContextForEditor(action, item, itemId, dataProvider, sourceComponent, viewContainer, actionData) {
3315
3602
  var _a;
3316
- const context = new ActionExecContext(dataProvider, (_a = this.getDataProviderService(dataProvider)) !== null && _a !== void 0 ? _a : undefined, {
3603
+ let ctxDataProvider = dataProvider;
3604
+ if (!ctxDataProvider && action.dataProvider) {
3605
+ ctxDataProvider = action.dataProvider;
3606
+ }
3607
+ if (!ctxDataProvider) {
3608
+ const viewContainerDataProvider = viewContainer === null || viewContainer === void 0 ? void 0 : viewContainer.getDataProvider();
3609
+ if (viewContainerDataProvider) {
3610
+ ctxDataProvider = action.dataProvider;
3611
+ }
3612
+ }
3613
+ const context = new ActionExecContext(ctxDataProvider, (_a = this.getDataProviderService(ctxDataProvider)) !== null && _a !== void 0 ? _a : undefined, {
3317
3614
  item,
3318
3615
  itemId,
3319
3616
  actionData
3320
- }, sourceComponent, tableview);
3617
+ }, sourceComponent, viewContainer);
3321
3618
  return context;
3322
3619
  }
3323
3620
  /**
@@ -3340,12 +3637,15 @@ class MngActionService {
3340
3637
  * @param item Item instance (if exists).
3341
3638
  * @param itemId Item id (if exists).
3342
3639
  * @param actionData Optional additional action data.
3343
- * @param tableview Tableview component.
3640
+ * @param viewContainer View container component/service.
3344
3641
  * @param sourceComponent Source activation component.
3345
3642
  */
3346
- activateAction(action, itemId, item, actionData, tableview, sourceComponent) {
3347
- var _a;
3643
+ activateAction(action, itemId, item, actionData, viewContainer, sourceComponent) {
3348
3644
  if (action.type === ActionTypeEnum.Editor) {
3645
+ let dialogComponent = this.defaultEditorDialogComponent;
3646
+ if (action instanceof ActionEditorDescriptor && action.editorComponent) {
3647
+ dialogComponent = action.editorComponent;
3648
+ }
3349
3649
  const dialogConfig = {
3350
3650
  data: {
3351
3651
  action
@@ -3361,18 +3661,18 @@ class MngActionService {
3361
3661
  if (actionData) {
3362
3662
  dialogConfig.data.actionData = actionData;
3363
3663
  }
3364
- if (tableview) {
3365
- dialogConfig.data.tableview = tableview;
3664
+ if (viewContainer) {
3665
+ dialogConfig.data.viewContainer = viewContainer;
3366
3666
  }
3367
3667
  if (sourceComponent) {
3368
3668
  dialogConfig.data.sourceComponent = sourceComponent;
3369
3669
  }
3370
- const dialogRef = this.dialogService.open(MngActionDialogComponent, dialogConfig);
3670
+ const dialogRef = this.dialogService.open(dialogComponent, dialogConfig);
3371
3671
  return of(new ActionActivationResult(undefined, dialogRef));
3372
3672
  }
3373
3673
  else {
3374
3674
  // directly execute action
3375
- return this.runAction(action, itemId, item, (_a = tableview === null || tableview === void 0 ? void 0 : tableview.dataProvider) !== null && _a !== void 0 ? _a : undefined, sourceComponent, tableview, actionData).pipe(map(res => new ActionActivationResult(res)));
3675
+ return this.runAction(action, itemId, item, undefined, sourceComponent, viewContainer, actionData).pipe(map(res => new ActionActivationResult(res)));
3376
3676
  }
3377
3677
  }
3378
3678
  /**
@@ -3396,7 +3696,7 @@ class MngActionService {
3396
3696
  * @param actionData Optional action data.
3397
3697
  * @param route Optional activated route.
3398
3698
  */
3399
- triggerAction(action, itemId, item, actionData, route, tableview, sourceComponent) {
3699
+ triggerAction(action, itemId, item, actionData, route, viewContainer, sourceComponent) {
3400
3700
  var _a;
3401
3701
  if (action.activationTrigger === ActionActivationTriggerEnum.OnRoute) {
3402
3702
  const baseUrl = this.router.url.split('?')[0];
@@ -3425,15 +3725,20 @@ class MngActionService {
3425
3725
  return of(new ActionTriggerResult(undefined, from(this.router.navigate([baseUrl, ...actionUrlSegments], { relativeTo: route, queryParams: parsedUrl.queryParams }))));
3426
3726
  }
3427
3727
  else {
3428
- return this.activateAction(action, itemId, item, actionData, tableview, sourceComponent).pipe(map(res => new ActionTriggerResult(res)));
3728
+ return this.activateAction(action, itemId, item, actionData, viewContainer, sourceComponent).pipe(map(res => new ActionTriggerResult(res)));
3429
3729
  }
3430
3730
  }
3431
3731
  }
3432
- 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 });
3433
- MngActionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionService });
3434
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionService, decorators: [{
3732
+ 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: ACTION_EDITOR_DIALOG_COMPONENT_SETTING }], target: i0.ɵɵFactoryTarget.Injectable });
3733
+ MngActionExecutorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionExecutorService });
3734
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionExecutorService, decorators: [{
3435
3735
  type: Injectable
3436
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i2.DialogService }, { type: i2$1.ConfirmationService }, { type: i2$2.TranslateService }]; } });
3736
+ }], ctorParameters: function () {
3737
+ return [{ type: i0.Injector }, { type: i1.Router }, { type: i3.DialogService }, { type: i2.ConfirmationService }, { type: i3$1.TranslateService }, { type: i0.Type, decorators: [{
3738
+ type: Inject,
3739
+ args: [ACTION_EDITOR_DIALOG_COMPONENT_SETTING]
3740
+ }] }];
3741
+ } });
3437
3742
 
3438
3743
  class MngConfigurationService {
3439
3744
  constructor(http) {
@@ -3477,7 +3782,7 @@ class MngConfigurationService {
3477
3782
  const pathSegments = url.split('/');
3478
3783
  pathSegments[pathSegments.length - 1] = 'env.json';
3479
3784
  return this.http.get(pathSegments.join('/'));
3480
- }), first(), map(res => {
3785
+ }), map(res => {
3481
3786
  this.jsonEnvironments.push(res);
3482
3787
  this.mergeConfigs();
3483
3788
  return true;
@@ -3511,13 +3816,6 @@ class MngConfigurationService {
3511
3816
  }
3512
3817
  MngConfigurationService._instance = null;
3513
3818
 
3514
- const MNG_BROWSER_STORAGE_IT = new InjectionToken('Browser storage', {
3515
- providedIn: 'root',
3516
- factory: () => localStorage
3517
- });
3518
-
3519
- const MNG_MODULE_CONFIG_IT = new InjectionToken('MngModuleConfig');
3520
-
3521
3819
  class MngCommonsService {
3522
3820
  constructor(router, primengConfig, translate, titleService, configurationService, moduleConfig, localStorage) {
3523
3821
  this.router = router;
@@ -3849,12 +4147,12 @@ class MngCommonsService {
3849
4147
  return titlePieces.join(' - ');
3850
4148
  }
3851
4149
  }
3852
- 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 });
4150
+ 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.Title }, { token: MngConfigurationService }, { token: MNG_MODULE_CONFIG_IT }, { token: MNG_BROWSER_STORAGE_IT }], target: i0.ɵɵFactoryTarget.Injectable });
3853
4151
  MngCommonsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService });
3854
4152
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService, decorators: [{
3855
4153
  type: Injectable
3856
4154
  }], ctorParameters: function () {
3857
- return [{ type: i1.Router }, { type: i2$1.PrimeNGConfig }, { type: i2$2.TranslateService }, { type: i4.Title }, { type: MngConfigurationService }, { type: undefined, decorators: [{
4155
+ return [{ type: i1.Router }, { type: i2.PrimeNGConfig }, { type: i3$1.TranslateService }, { type: i4.Title }, { type: MngConfigurationService }, { type: undefined, decorators: [{
3858
4156
  type: Inject,
3859
4157
  args: [MNG_MODULE_CONFIG_IT]
3860
4158
  }] }, { type: Storage, decorators: [{
@@ -3906,54 +4204,74 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
3906
4204
  type: Injectable
3907
4205
  }], ctorParameters: function () { return [{ type: i1.Router }, { type: i4$1.Location }]; } });
3908
4206
 
3909
- class TableviewComponentService {
3910
- constructor() {
4207
+ /**
4208
+ * Should be used with providers defined within component.
4209
+ */
4210
+ class MngViewContainerComponentService {
4211
+ constructor(messageService) {
4212
+ this.messageService = messageService;
3911
4213
  this.actions = [];
3912
4214
  this._reloadTableSubject = new Subject();
3913
4215
  }
4216
+ set dataProvider(dataProvider) {
4217
+ this._dataProvider = dataProvider;
4218
+ }
3914
4219
  get reloadTable$() {
3915
4220
  return this._reloadTableSubject.asObservable();
3916
4221
  }
3917
4222
  triggerTableReload(event) {
3918
4223
  this._reloadTableSubject.next(event);
3919
4224
  }
4225
+ getMessageService() {
4226
+ return this.messageService;
4227
+ }
4228
+ getDataProvider() {
4229
+ return this._dataProvider;
4230
+ }
3920
4231
  }
3921
- TableviewComponentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: TableviewComponentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3922
- TableviewComponentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: TableviewComponentService });
3923
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: TableviewComponentService, decorators: [{
4232
+ MngViewContainerComponentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngViewContainerComponentService, deps: [{ token: i2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
4233
+ MngViewContainerComponentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngViewContainerComponentService });
4234
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngViewContainerComponentService, decorators: [{
3924
4235
  type: Injectable
3925
- }] });
4236
+ }], ctorParameters: function () { return [{ type: i2.MessageService }]; } });
3926
4237
 
3927
4238
  class MngActionComponent {
3928
- constructor(route, translate, actionService, confirmationService, tableviewService) {
4239
+ constructor(route, translate, actionExecutor, confirmationService, viewContainerService) {
3929
4240
  this.route = route;
3930
4241
  this.translate = translate;
3931
- this.actionService = actionService;
4242
+ this.actionExecutor = actionExecutor;
3932
4243
  this.confirmationService = confirmationService;
3933
- this.tableviewService = tableviewService;
4244
+ this.viewContainerService = viewContainerService;
3934
4245
  this.loadingSubject = new ReplaySubject(1);
3935
4246
  this.$loading = this.loadingSubject.asObservable();
3936
4247
  this.cmpId = Math.random().toString(36).substring(2);
3937
4248
  this.loadingSubject.next(false);
3938
4249
  }
3939
4250
  ngOnInit() {
3940
- var _a, _b, _c, _d, _e, _f;
3941
- const context = this.actionService.getActionExecContext(this.action, this.itemId, this.item, (_b = (_a = this.tableviewService) === null || _a === void 0 ? void 0 : _a.dataProvider) !== null && _b !== void 0 ? _b : undefined, this.tableviewService, this, this.actionData);
4251
+ var _a, _b, _c, _d, _e, _f, _g;
4252
+ this.viewContainer = (_b = (_a = this.viewContainerInit) !== null && _a !== void 0 ? _a : this.viewContainerService) !== null && _b !== void 0 ? _b : undefined;
4253
+ const context = this.actionExecutor.prepareActionExecContext(this.action, this.itemId, this.item, this.dataProvider, (_c = this.viewContainer) !== null && _c !== void 0 ? _c : undefined, this, this.actionData);
3942
4254
  this.$isVisible = typeof this.action.isVisibleFunction === 'function' ? this.action.isVisibleFunction(context) : of(true);
3943
4255
  this.$isEnabled = typeof this.action.isEnabledFunction === 'function' ? this.action.isEnabledFunction(context) : of(true);
3944
- this.$label = I18nUtil.streamActionTranslation(this.translate, this.action, 'title', (_d = (_c = this.action) === null || _c === void 0 ? void 0 : _c.title) !== null && _d !== void 0 ? _d : undefined, this.item);
3945
- this.$tooltip = I18nUtil.streamActionTranslation(this.translate, this.action, 'tooltip', (_f = (_e = this.action) === null || _e === void 0 ? void 0 : _e.tooltip) !== null && _f !== void 0 ? _f : undefined, this.item);
4256
+ this.$label = I18nUtil.streamActionTranslation(this.translate, this.action, 'title', (_e = (_d = this.action) === null || _d === void 0 ? void 0 : _d.title) !== null && _e !== void 0 ? _e : undefined, this.item);
4257
+ this.$tooltip = I18nUtil.streamActionTranslation(this.translate, this.action, 'tooltip', (_g = (_f = this.action) === null || _f === void 0 ? void 0 : _f.tooltip) !== null && _g !== void 0 ? _g : undefined, this.item);
3946
4258
  }
3947
4259
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3948
4260
  triggerAction(event) {
3949
4261
  this.loadingSubject.next(true);
3950
4262
  const actionData = this.actionData ? this.actionData : {};
3951
4263
  actionData['cmpId'] = this.cmpId;
3952
- this.actionService
3953
- .triggerAction(this.action, this.itemId, this.item, actionData, this.route, this.tableviewService, this)
3954
- .pipe(first(), finalize(() => this.loadingSubject.next(false)))
3955
- // eslint-disable-next-line @typescript-eslint/no-empty-function
3956
- .subscribe(() => { });
4264
+ this.actionExecutor
4265
+ .triggerAction(this.action, this.itemId, this.item, actionData, this.route, this.viewContainer, this)
4266
+ .pipe(first())
4267
+ .subscribe({
4268
+ next: () => {
4269
+ this.loadingSubject.next(false);
4270
+ },
4271
+ error: err => {
4272
+ console.error(`Error occurred while executing action ${this.action.actionName}.`, err);
4273
+ }
4274
+ });
3957
4275
  }
3958
4276
  getConfirmationService() {
3959
4277
  return this.confirmationService;
@@ -3962,12 +4280,16 @@ class MngActionComponent {
3962
4280
  return `${action.actionName}_${this.cmpId}`;
3963
4281
  }
3964
4282
  }
3965
- 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 });
3966
- 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 });
4283
+ 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 });
4284
+ 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", viewContainerInit: ["viewContainer", "viewContainerInit"] }, 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\"\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.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\"\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-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: 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 });
3967
4285
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionComponent, decorators: [{
3968
4286
  type: Component,
3969
- 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" }]
3970
- }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i2$2.TranslateService }, { type: MngActionService }, { type: i2$1.ConfirmationService }, { type: TableviewComponentService }]; }, propDecorators: { action: [{
4287
+ 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\"\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.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\"\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-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" }]
4288
+ }], ctorParameters: function () {
4289
+ return [{ type: i1.ActivatedRoute }, { type: i3$1.TranslateService }, { type: MngActionExecutorService }, { type: i2.ConfirmationService }, { type: MngViewContainerComponentService, decorators: [{
4290
+ type: Optional
4291
+ }] }];
4292
+ }, propDecorators: { action: [{
3971
4293
  type: Input
3972
4294
  }], item: [{
3973
4295
  type: Input
@@ -3975,23 +4297,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
3975
4297
  type: Input
3976
4298
  }], actionData: [{
3977
4299
  type: Input
4300
+ }], dataProvider: [{
4301
+ type: Input
4302
+ }], viewContainerInit: [{
4303
+ type: Input,
4304
+ args: ['viewContainer']
3978
4305
  }] } });
3979
4306
 
3980
4307
  class MngActionRouteComponent {
3981
- constructor(router, route, confirmationService, navigationService, actionService, tableviewService) {
4308
+ constructor(router, route, confirmationService, navigationService, actionExecutor, viewContainerService) {
3982
4309
  this.router = router;
3983
4310
  this.route = route;
3984
4311
  this.confirmationService = confirmationService;
3985
4312
  this.navigationService = navigationService;
3986
- this.actionService = actionService;
3987
- this.tableviewService = tableviewService;
4313
+ this.actionExecutor = actionExecutor;
4314
+ this.viewContainerService = viewContainerService;
3988
4315
  this.cmpId = Math.random().toString(36).substring(2);
3989
4316
  this.actions = [];
3990
4317
  this.subscriptions = [];
3991
4318
  }
3992
4319
  ngOnInit() {
3993
4320
  var _a, _b;
3994
- this.actions = (_b = (_a = this.tableviewService) === null || _a === void 0 ? void 0 : _a.actions.filter(a => a.activationTrigger === ActionActivationTriggerEnum.OnRoute)) !== null && _b !== void 0 ? _b : [];
4321
+ this.actions = (_b = (_a = this.viewContainerService) === null || _a === void 0 ? void 0 : _a.actions.filter(a => a.activationTrigger === ActionActivationTriggerEnum.OnRoute)) !== null && _b !== void 0 ? _b : [];
3995
4322
  const subscription = this.route.params.subscribe(p => {
3996
4323
  const action = this.findActiveAction(p);
3997
4324
  if (action) {
@@ -4014,6 +4341,7 @@ class MngActionRouteComponent {
4014
4341
  return `actionRoute_${this.cmpId}`;
4015
4342
  }
4016
4343
  activateAction(action, p, qp) {
4344
+ var _a;
4017
4345
  this.activeAction = action;
4018
4346
  const itemId = p['itemId'];
4019
4347
  const actionData = {};
@@ -4026,18 +4354,21 @@ class MngActionRouteComponent {
4026
4354
  for (const key in qp) {
4027
4355
  actionData[key] = p[key];
4028
4356
  }
4029
- this.actionService
4030
- .activateAction(action, itemId, undefined, actionData, this.tableviewService, this)
4357
+ this.actionExecutor
4358
+ .activateAction(action, itemId, undefined, actionData, (_a = this.viewContainerService) !== null && _a !== void 0 ? _a : undefined, this)
4031
4359
  .pipe(first())
4032
4360
  .subscribe(res => {
4033
4361
  var _a;
4034
4362
  if (res.dialogRef) {
4035
4363
  this.dialogRef = res.dialogRef;
4036
4364
  this.dialogCloseSubscription = (_a = this.dialogRef) === null || _a === void 0 ? void 0 : _a.onClose.subscribe(e => {
4037
- var _a;
4365
+ var _a, _b;
4038
4366
  const actionEv = e;
4039
4367
  if (!(actionEv === null || actionEv === void 0 ? void 0 : actionEv.error) || !((_a = actionEv === null || actionEv === void 0 ? void 0 : actionEv.error) === null || _a === void 0 ? void 0 : _a.dismissed)) {
4040
- this.tableviewService.triggerTableReload(actionEv); // reload only if no error in action and
4368
+ if (!this.viewContainerService) {
4369
+ console.warn(`View container service could not be found, table reload will not be triggered.`);
4370
+ }
4371
+ (_b = this.viewContainerService) === null || _b === void 0 ? void 0 : _b.triggerTableReload(actionEv); // reload only if no error in action and
4041
4372
  }
4042
4373
  this.deactivateAction();
4043
4374
  });
@@ -4111,24 +4442,30 @@ class MngActionRouteComponent {
4111
4442
  return null;
4112
4443
  }
4113
4444
  }
4114
- 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 });
4445
+ 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 });
4115
4446
  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 });
4116
4447
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionRouteComponent, decorators: [{
4117
4448
  type: Component,
4118
4449
  args: [{ selector: 'mng-action-route', changeDetection: ChangeDetectionStrategy.OnPush, providers: [MessageService, ConfirmationService], template: "<p-confirmDialog [key]=\"'actionRoute_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n" }]
4119
- }], ctorParameters: function () { return [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2$1.ConfirmationService }, { type: MngNavigationService }, { type: MngActionService }, { type: TableviewComponentService }]; } });
4450
+ }], ctorParameters: function () {
4451
+ return [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2.ConfirmationService }, { type: MngNavigationService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService, decorators: [{
4452
+ type: Optional
4453
+ }] }];
4454
+ } });
4120
4455
 
4121
4456
  class MngComponentDirective {
4122
4457
  constructor(viewContainerRef) {
4123
4458
  this.viewContainerRef = viewContainerRef;
4459
+ this.componentInstanceEventEmitter = new EventEmitter();
4124
4460
  }
4125
4461
  ngOnInit() {
4126
4462
  this.viewContainerRef.clear();
4127
4463
  this.componentRef = this.viewContainerRef.createComponent(this.component);
4464
+ this.componentInstanceEventEmitter.next(this.componentRef.instance);
4128
4465
  }
4129
4466
  }
4130
4467
  MngComponentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngComponentDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
4131
- MngComponentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: MngComponentDirective, selector: "[mngComponent]", inputs: { component: ["mngComponent", "component"] }, ngImport: i0 });
4468
+ 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 });
4132
4469
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngComponentDirective, decorators: [{
4133
4470
  type: Directive,
4134
4471
  args: [{
@@ -4137,6 +4474,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4137
4474
  }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { component: [{
4138
4475
  type: Input,
4139
4476
  args: ['mngComponent']
4477
+ }], componentInstanceEventEmitter: [{
4478
+ type: Output,
4479
+ args: ['instanceCreated']
4140
4480
  }] } });
4141
4481
 
4142
4482
  class MngTemplateDirective {
@@ -4165,13 +4505,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4165
4505
  args: ['mngTemplate']
4166
4506
  }] } });
4167
4507
 
4168
- class MngFormEditorSubmitEvent {
4169
- constructor(formItem) {
4170
- this.formItem = formItem;
4171
- this.success = true;
4172
- }
4173
- }
4174
-
4175
4508
  class MngFormEditorComponent {
4176
4509
  constructor(translateService) {
4177
4510
  this.translateService = translateService;
@@ -4194,7 +4527,7 @@ class MngFormEditorComponent {
4194
4527
  this.subscriptions = [];
4195
4528
  }
4196
4529
  ngOnInit() {
4197
- this.updateFormModel(this.item);
4530
+ this.resetFormModel(this.item);
4198
4531
  this.submitLoading$ = this.submitLoading instanceof Observable ? this.submitLoading : of(this.submitLoading);
4199
4532
  // init fields for formly
4200
4533
  this.formFields = EditorFormlyUtil.createFormlyConfigFromDescriptor(this.descriptor);
@@ -4239,6 +4572,58 @@ class MngFormEditorComponent {
4239
4572
  });
4240
4573
  return formValue;
4241
4574
  }
4575
+ getFormField(key) {
4576
+ return this.findFormField(this.form, key.split('.'));
4577
+ }
4578
+ setFormFieldValue(key, value) {
4579
+ const control = this.getFormField(key);
4580
+ if (control) {
4581
+ control.setValue(value);
4582
+ }
4583
+ else {
4584
+ console.warn(`Value was not set, because field ${key} was not found.`);
4585
+ }
4586
+ }
4587
+ patchFormFieldValue(key, value) {
4588
+ const control = this.getFormField(key);
4589
+ if (control) {
4590
+ control.patchValue(value);
4591
+ }
4592
+ else {
4593
+ console.warn(`Value was not set, because field ${key} was not found.`);
4594
+ }
4595
+ }
4596
+ resetFormFieldValue(key, value) {
4597
+ const control = this.getFormField(key);
4598
+ if (control) {
4599
+ control.reset(value);
4600
+ }
4601
+ else {
4602
+ console.warn(`Value was not set, because field ${key} was not found.`);
4603
+ }
4604
+ }
4605
+ findFormField(control, keyPath) {
4606
+ if (keyPath.length === 0) {
4607
+ return control;
4608
+ }
4609
+ if (keyPath.length === 1) {
4610
+ return control.get(keyPath[0]);
4611
+ }
4612
+ let nextControl = null;
4613
+ if (control instanceof FormGroup) {
4614
+ nextControl = control.get(keyPath[0]);
4615
+ }
4616
+ else if (control instanceof FormArray) {
4617
+ const idx = +keyPath[0];
4618
+ if (!isNaN(idx)) {
4619
+ nextControl = control.at(idx);
4620
+ }
4621
+ }
4622
+ if (!control) {
4623
+ return null;
4624
+ }
4625
+ return this.findFormField(nextControl, keyPath.slice(1));
4626
+ }
4242
4627
  isAnyFieldInvalid(fields = []) {
4243
4628
  var _a;
4244
4629
  for (const field of fields) {
@@ -4255,7 +4640,7 @@ class MngFormEditorComponent {
4255
4640
  }
4256
4641
  return false;
4257
4642
  }
4258
- updateFormModel(item) {
4643
+ resetFormModel(item) {
4259
4644
  this.formOrigItem = item;
4260
4645
  // TODO: to check if this is ok, could be problems with dates, if so, try lodash
4261
4646
  const formModel = JSON.parse(JSON.stringify(item !== null && item !== void 0 ? item : {}));
@@ -4274,12 +4659,12 @@ class MngFormEditorComponent {
4274
4659
  this.formOptions.formState.disabled = this.isFormDisabled !== null ? this.isFormDisabled === true : this.descriptor.disabled;
4275
4660
  }
4276
4661
  }
4277
- 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 });
4278
- 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 });
4662
+ 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 });
4663
+ 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: i8.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }], pipes: { "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4279
4664
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormEditorComponent, decorators: [{
4280
4665
  type: Component,
4281
4666
  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" }]
4282
- }], ctorParameters: function () { return [{ type: i2$2.TranslateService }]; }, propDecorators: { descriptor: [{
4667
+ }], ctorParameters: function () { return [{ type: i3$1.TranslateService }]; }, propDecorators: { descriptor: [{
4283
4668
  type: Input
4284
4669
  }], submitLoading: [{
4285
4670
  type: Input
@@ -4331,11 +4716,13 @@ class MngAutocompleteComponent {
4331
4716
  console.warn(`Data provider should be provided for MngAutocompleteComponent.`);
4332
4717
  }
4333
4718
  }
4719
+ ngOnDestroy() {
4720
+ var _a;
4721
+ (_a = this.searchSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
4722
+ }
4334
4723
  onSearch(event) {
4335
- if (this.searchSubscription) {
4336
- // try to cancel existing HTTP request subscription
4337
- this.searchSubscription.unsubscribe();
4338
- }
4724
+ var _a;
4725
+ (_a = this.searchSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
4339
4726
  if (this.dataProvider) {
4340
4727
  this.isLoading = true;
4341
4728
  const queryParamBuilder = MediusQueryParamBuilder.create();
@@ -4345,11 +4732,14 @@ class MngAutocompleteComponent {
4345
4732
  if (event.query && event.query.length > 0 && this.itemsLabelProperty) {
4346
4733
  queryParamBuilder.withFilter(this.itemsLabelProperty, event.query, undefined, MediusFilterMatchType.StartsWith);
4347
4734
  }
4348
- this.searchSubscription = this.dataProvider
4349
- .lookup(queryParamBuilder.build(), this.dataProviderService, event.query)
4350
- .pipe(first(), finalize(() => (this.isLoading = false)))
4351
- .subscribe((res) => {
4352
- this.suggestionsSubject.next(res);
4735
+ this.searchSubscription = this.dataProvider.lookup(queryParamBuilder.build(), this.dataProviderService, event.query).subscribe({
4736
+ next: (res) => {
4737
+ this.suggestionsSubject.next(res);
4738
+ this.isLoading = false;
4739
+ },
4740
+ error: () => {
4741
+ this.isLoading = false;
4742
+ }
4353
4743
  });
4354
4744
  }
4355
4745
  }
@@ -4376,7 +4766,7 @@ class MngAutocompleteComponent {
4376
4766
  }
4377
4767
  }
4378
4768
  MngAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngAutocompleteComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
4379
- 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 });
4769
+ 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$1.AsyncPipe, "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4380
4770
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngAutocompleteComponent, decorators: [{
4381
4771
  type: Component,
4382
4772
  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,8 +4814,6 @@ class MngDropdownComponent {
4424
4814
  this.onTouchedFn = () => { };
4425
4815
  this.dropdownFormControl = new FormControl();
4426
4816
  this.items$ = this.itemsSubject.asObservable();
4427
- this.items = [];
4428
- this.itemsLoaded = false;
4429
4817
  }
4430
4818
  ngOnInit() {
4431
4819
  var _a;
@@ -4436,10 +4824,7 @@ class MngDropdownComponent {
4436
4824
  if (this.dataProvider) {
4437
4825
  this.dataProviderService = this.dataProvider.serviceType ? this.injector.get(this.dataProvider.serviceType) : null;
4438
4826
  const queryParamBuilder = MediusQueryParamBuilder.create();
4439
- this.dataProvider
4440
- .lookup(queryParamBuilder.build(), this.dataProviderService)
4441
- .pipe(first())
4442
- .subscribe(res => {
4827
+ this.itemsSubscription = this.dataProvider.lookup(queryParamBuilder.build(), this.dataProviderService).subscribe(res => {
4443
4828
  this.itemsSubject.next(res);
4444
4829
  });
4445
4830
  if (this.selectFirstItem && !((_a = this.dropdownFormControl) === null || _a === void 0 ? void 0 : _a.value)) {
@@ -4454,6 +4839,10 @@ class MngDropdownComponent {
4454
4839
  console.warn(`Data provider should be provided for MngDropdownComponent.`);
4455
4840
  }
4456
4841
  }
4842
+ ngOnDestroy() {
4843
+ var _a;
4844
+ (_a = this.itemsSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
4845
+ }
4457
4846
  registerOnChange(fn) {
4458
4847
  this.onChangeFn = fn;
4459
4848
  }
@@ -4473,7 +4862,7 @@ class MngDropdownComponent {
4473
4862
  }
4474
4863
  }
4475
4864
  MngDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngDropdownComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
4476
- 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 });
4865
+ 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$1.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$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4477
4866
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngDropdownComponent, decorators: [{
4478
4867
  type: Component,
4479
4868
  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" }]
@@ -4505,15 +4894,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4505
4894
  args: [Dropdown]
4506
4895
  }] } });
4507
4896
 
4508
- class MngActionDialogComponent {
4509
- constructor(injector, translate, dialogRef, dialogConfig, actionService, mngCommonsService) {
4897
+ class MngActionEditorComponent {
4898
+ constructor(injector, translate, actionExecutor, mngCommonsService, dialogRef, dialogConfig, viewContainerService) {
4510
4899
  this.injector = injector;
4511
4900
  this.translate = translate;
4901
+ this.actionExecutor = actionExecutor;
4902
+ this.mngCommonsService = mngCommonsService;
4512
4903
  this.dialogRef = dialogRef;
4513
4904
  this.dialogConfig = dialogConfig;
4514
- this.actionService = actionService;
4515
- this.mngCommonsService = mngCommonsService;
4905
+ this.viewContainerService = viewContainerService;
4516
4906
  this.cmpId = Math.random().toString(36).substring(2);
4907
+ this.isDialog = true;
4517
4908
  this.isSaveButton = true;
4518
4909
  this.loadingSubject = new ReplaySubject(1);
4519
4910
  this.loading$ = this.loadingSubject.asObservable();
@@ -4523,8 +4914,8 @@ class MngActionDialogComponent {
4523
4914
  this.subscriptions = [];
4524
4915
  }
4525
4916
  ngOnInit() {
4526
- var _a;
4527
- if (this.dialogConfig.data) {
4917
+ var _a, _b, _c;
4918
+ if ((_a = this.dialogConfig) === null || _a === void 0 ? void 0 : _a.data) {
4528
4919
  if (this.dialogConfig.data.action) {
4529
4920
  this.action = this.dialogConfig.data.action;
4530
4921
  }
@@ -4537,18 +4928,25 @@ class MngActionDialogComponent {
4537
4928
  if (this.dialogConfig.data.actionData) {
4538
4929
  this.actionData = this.dialogConfig.data.actionData;
4539
4930
  }
4540
- if (this.dialogConfig.data.tableview) {
4541
- this.tableviewService = this.dialogConfig.data.tableview;
4542
- if (!this.dataProvider && ((_a = this.tableviewService) === null || _a === void 0 ? void 0 : _a.dataProvider)) {
4543
- this.dataProvider = this.tableviewService.dataProvider;
4931
+ if (this.dialogConfig.data.viewContainer) {
4932
+ this.viewContainer = this.dialogConfig.data.viewContainer;
4933
+ if (!this.dataProvider && this.viewContainer) {
4934
+ const dataProvider = this.viewContainer.getDataProvider();
4935
+ if (dataProvider && typeof dataProvider['fetch'] === 'function') {
4936
+ this.dataProvider = dataProvider;
4937
+ }
4544
4938
  }
4545
4939
  }
4546
4940
  if (this.dialogConfig.data.sourceComponent) {
4547
4941
  this.sourceComponent = this.dialogConfig.data.sourceComponent;
4548
4942
  }
4549
4943
  }
4944
+ else {
4945
+ this.isDialog = false;
4946
+ this.viewContainer = (_c = (_b = this.viewContainerInit) !== null && _b !== void 0 ? _b : this.viewContainerService) !== null && _c !== void 0 ? _c : undefined;
4947
+ }
4550
4948
  this.isSaveButton = typeof this.action.submitFunction === 'function';
4551
- this.setDialogHeaderTitle();
4949
+ this.setTitle();
4552
4950
  this.loadItemWithDataProvider();
4553
4951
  }
4554
4952
  ngOnDestroy() {
@@ -4560,16 +4958,23 @@ class MngActionDialogComponent {
4560
4958
  return;
4561
4959
  }
4562
4960
  this.submitLoadingSubject.next(true);
4563
- this.actionService
4564
- .runEditorSave(this.action, this.itemId, event.formItem, this.dataProvider, this.sourceComponent, this.tableviewService, this.actionData)
4565
- .pipe(first(), finalize(() => this.submitLoadingSubject.next(false)))
4566
- .subscribe(res => {
4567
- this.closeDialog(res);
4961
+ this.actionExecutor
4962
+ .runEditorSave(this.action, this.itemId, event.formItem, this.dataProvider, this.sourceComponent, this.viewContainer, this.actionData)
4963
+ .pipe(first())
4964
+ .subscribe({
4965
+ next: res => {
4966
+ this.submitLoadingSubject.next(false);
4967
+ this.closeDialog(res);
4968
+ },
4969
+ error: () => {
4970
+ this.submitLoadingSubject.next(false);
4971
+ }
4568
4972
  });
4569
4973
  }
4570
4974
  }
4571
4975
  closeDialog(result) {
4572
- this.dialogRef.close(result ? result : new ActionRunResult(undefined, undefined, new ActionError(null, true)));
4976
+ var _a;
4977
+ (_a = this.dialogRef) === null || _a === void 0 ? void 0 : _a.close(result ? result : new ActionRunResult(undefined, undefined, new ActionError(null, true)));
4573
4978
  }
4574
4979
  saveItem() {
4575
4980
  this.editorComponent.submit();
@@ -4579,48 +4984,62 @@ class MngActionDialogComponent {
4579
4984
  return;
4580
4985
  }
4581
4986
  this.loadingSubject.next(true);
4582
- this.actionService
4583
- .runEditorFetch(this.action, this.itemId, this.dataProvider, this.sourceComponent, this.tableviewService)
4987
+ this.actionExecutor
4988
+ .runEditorFetch(this.action, this.itemId, this.dataProvider, this.sourceComponent, this.viewContainer)
4584
4989
  .pipe(first(), catchError(err => {
4585
4990
  if (this.action.hasRunNotificationError) {
4586
- ToastUtil.actionNotificationError(this.translate, this.action, err, 'fetch', this.tableviewService, this.item);
4991
+ ToastUtil.actionNotificationError(this.translate, this.action, err, 'fetch', this.viewContainer, this.item);
4587
4992
  }
4588
4993
  throw err;
4589
4994
  }), finalize(() => this.loadingSubject.next(false)))
4590
4995
  .subscribe(res => {
4591
4996
  this.item = res.result;
4592
4997
  if (this.action.hasFetchNotificationSuccess) {
4593
- ToastUtil.actionNotificationSuccess(this.translate, this.action, 'fetch', this.action.fetchNotificationSuccessTitle, this.action.fetchNotificationSuccessMessage, this.tableviewService, this.item);
4998
+ ToastUtil.actionNotificationSuccess(this.translate, this.action, 'fetch', this.action.fetchNotificationSuccessTitle, this.action.fetchNotificationSuccessMessage, this.viewContainer, this.item);
4594
4999
  }
4595
- this.setDialogHeaderTitle();
5000
+ this.setTitle();
4596
5001
  });
4597
5002
  }
4598
- setDialogHeaderTitle() {
5003
+ setTitle() {
4599
5004
  if (this.action.editorTitle === null) {
4600
- requestAnimationFrame(() => {
4601
- this.dialogConfig.header = undefined;
4602
- });
4603
- return;
5005
+ this.title = undefined;
5006
+ if (this.dialogConfig) {
5007
+ requestAnimationFrame(() => {
5008
+ this.dialogConfig.header = undefined;
5009
+ });
5010
+ return;
5011
+ }
4604
5012
  }
4605
5013
  const subscription = I18nUtil.streamActionTranslation(this.translate, this.action, 'dialog.title', undefined, this.item)
4606
5014
  .pipe(mergeMap(i18nDialogTitle => i18nDialogTitle === null
4607
5015
  ? I18nUtil.getActionTranslation(this.translate, this.action, 'title', this.action.editorTitle, this.item)
4608
5016
  : of(i18nDialogTitle)))
4609
5017
  .subscribe(t => {
4610
- requestAnimationFrame(() => {
4611
- this.dialogConfig.header = t !== null && t !== void 0 ? t : undefined;
4612
- this.mngCommonsService.setPageTitle(t !== null && t !== void 0 ? t : undefined);
4613
- });
5018
+ this.title = t !== null && t !== void 0 ? t : undefined;
5019
+ if (this.dialogConfig) {
5020
+ requestAnimationFrame(() => {
5021
+ this.dialogConfig.header = t !== null && t !== void 0 ? t : undefined;
5022
+ this.mngCommonsService.setPageTitle(t !== null && t !== void 0 ? t : undefined);
5023
+ });
5024
+ }
4614
5025
  });
4615
5026
  this.subscriptions.push(subscription);
4616
5027
  }
4617
5028
  }
4618
- 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 });
4619
- 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 });
4620
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionDialogComponent, decorators: [{
5029
+ 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: i3.DynamicDialogRef, optional: true }, { token: i3.DynamicDialogConfig, optional: true }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
5030
+ 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"] }, 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: "<h1 *ngIf=\"!isDialog && title\">{{ title }}</h1>\n<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: i5.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": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5031
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionEditorComponent, decorators: [{
4621
5032
  type: Component,
4622
- 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" }]
4623
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i2$2.TranslateService }, { type: i2.DynamicDialogRef }, { type: i2.DynamicDialogConfig }, { type: MngActionService }, { type: MngCommonsService }]; }, propDecorators: { action: [{
5033
+ args: [{ selector: 'mng-action-editor', changeDetection: ChangeDetectionStrategy.OnPush, template: "<h1 *ngIf=\"!isDialog && title\">{{ title }}</h1>\n<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" }]
5034
+ }], ctorParameters: function () {
5035
+ return [{ type: i0.Injector }, { type: i3$1.TranslateService }, { type: MngActionExecutorService }, { type: MngCommonsService }, { type: i3.DynamicDialogRef, decorators: [{
5036
+ type: Optional
5037
+ }] }, { type: i3.DynamicDialogConfig, decorators: [{
5038
+ type: Optional
5039
+ }] }, { type: MngViewContainerComponentService, decorators: [{
5040
+ type: Optional
5041
+ }] }];
5042
+ }, propDecorators: { action: [{
4624
5043
  type: Input
4625
5044
  }], itemId: [{
4626
5045
  type: Input
@@ -4630,6 +5049,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4630
5049
  type: Input
4631
5050
  }], dataProvider: [{
4632
5051
  type: Input
5052
+ }], viewContainerInit: [{
5053
+ type: Input,
5054
+ args: ['viewContainer']
4633
5055
  }], templates: [{
4634
5056
  type: ContentChildren,
4635
5057
  args: [MngTemplateDirective]
@@ -4648,10 +5070,10 @@ class MngFormlyFieldAutocompleteComponent extends FieldType {
4648
5070
  }
4649
5071
  }
4650
5072
  MngFormlyFieldAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldAutocompleteComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4651
- 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 });
5073
+ 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 });
4652
5074
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldAutocompleteComponent, decorators: [{
4653
5075
  type: Component,
4654
- 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" }]
5076
+ 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" }]
4655
5077
  }] });
4656
5078
 
4657
5079
  class MngFormlyFieldInputComponent extends FieldType {
@@ -4665,10 +5087,10 @@ class MngFormlyFieldInputComponent extends FieldType {
4665
5087
  }
4666
5088
  }
4667
5089
  MngFormlyFieldInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4668
- MngFormlyFieldInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldInputComponent, selector: "mng-formly-field-input", usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"option.value\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"option.value\" class=\"mng-radio-button-label\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <p-inputMask\n *ngSwitchCase=\"'mask'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [mask]=\"$any(descriptor.mask)\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [slotChar]=\"$any(descriptor.slotChar)\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n", components: [{ type: i1$3.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }, { type: i2$5.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabelledBy"], outputs: ["onChange"] }, { type: i3.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i4$3.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i5.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { type: i6$1.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "style", "inputId", "styleClass", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "disabled", "readonly", "unmask", "name", "required", "characterPattern", "autoFocus", "autocomplete", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown"] }], directives: [{ type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i4$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i10$1.InputText, selector: "[pInputText]" }], pipes: { "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5090
+ 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$3.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$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.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$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.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$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i10$1.InputText, selector: "[pInputText]" }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4669
5091
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, decorators: [{
4670
5092
  type: Component,
4671
- args: [{ selector: 'mng-formly-field-input', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"option.value\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"option.value\" class=\"mng-radio-button-label\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <p-inputMask\n *ngSwitchCase=\"'mask'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [mask]=\"$any(descriptor.mask)\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [slotChar]=\"$any(descriptor.slotChar)\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n" }]
5093
+ 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" }]
4672
5094
  }] });
4673
5095
 
4674
5096
  class MngFormlyFieldDropdownComponent extends FieldType {
@@ -4678,10 +5100,10 @@ class MngFormlyFieldDropdownComponent extends FieldType {
4678
5100
  }
4679
5101
  }
4680
5102
  MngFormlyFieldDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldDropdownComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4681
- 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 });
5103
+ 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 });
4682
5104
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldDropdownComponent, decorators: [{
4683
5105
  type: Component,
4684
- 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" }]
5106
+ 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" }]
4685
5107
  }] });
4686
5108
 
4687
5109
  class MngTableLoadEvent {
@@ -4765,12 +5187,12 @@ class MngTableColumnFilterComponent {
4765
5187
  }
4766
5188
  }
4767
5189
  }
4768
- 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 });
4769
- 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 } });
5190
+ MngTableColumnFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnFilterComponent, deps: [{ token: i2.PrimeNGConfig }], target: i0.ɵɵFactoryTarget.Component });
5191
+ 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.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.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 } });
4770
5192
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnFilterComponent, decorators: [{
4771
5193
  type: Component,
4772
5194
  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" }]
4773
- }], ctorParameters: function () { return [{ type: i2$1.PrimeNGConfig }]; }, propDecorators: { descriptor: [{
5195
+ }], ctorParameters: function () { return [{ type: i2.PrimeNGConfig }]; }, propDecorators: { descriptor: [{
4774
5196
  type: Input
4775
5197
  }], display: [{
4776
5198
  type: Input
@@ -4859,7 +5281,7 @@ class MngTableColumnValueComponent {
4859
5281
  }
4860
5282
  }
4861
5283
  MngTableColumnValueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4862
- 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 });
5284
+ 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": i3$1.TranslatePipe, "enum": MngEnumPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4863
5285
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnValueComponent, decorators: [{
4864
5286
  type: Component,
4865
5287
  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" }]
@@ -4887,21 +5309,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4887
5309
  var TypeEnum = FilterDescriptor.TypeEnum;
4888
5310
  var PaginationModeEnum = TableDescriptor.PaginationModeEnum;
4889
5311
  class MngTableComponent {
4890
- constructor(injector, router, activatedRoute, translate, tableviewService) {
5312
+ constructor(injector, router, activatedRoute, translate, viewContainerService) {
4891
5313
  this.injector = injector;
4892
5314
  this.router = router;
4893
5315
  this.activatedRoute = activatedRoute;
4894
5316
  this.translate = translate;
4895
- this.tableviewService = tableviewService;
5317
+ this.viewContainerService = viewContainerService;
4896
5318
  this.filterDisplayRow = TableDescriptor.FilterDisplayEnum.Row;
4897
5319
  this.filterDisplayMenu = TableDescriptor.FilterDisplayEnum.Menu;
4898
5320
  this.useQueryParams = false;
4899
5321
  // extra features input
5322
+ this.selectionMode = 'multiple';
4900
5323
  this.selectionEnabled = false;
4901
5324
  // event outputs
4902
5325
  this.loadEventEmitter = new EventEmitter();
4903
5326
  this.cellClickEventEmitter = new EventEmitter();
4904
5327
  this.selectionChangeEventEmitter = new EventEmitter();
5328
+ this.captionCmpInstEventEmitter = new EventEmitter();
5329
+ this.columnActionCmpInstEventEmitter = new EventEmitter();
4905
5330
  // data provider and items
4906
5331
  this.useDataProvider = false;
4907
5332
  this.useQueryParamsInitialized = false;
@@ -4931,251 +5356,570 @@ class MngTableComponent {
4931
5356
  this.subscriptions = [];
4932
5357
  }
4933
5358
  ngOnInit() {
4934
- this.filterDescriptors = this.descriptor.columns.filter(c => typeof c.filterDescriptor !== 'undefined').map(c => c.filterDescriptor);
4935
- if (this.descriptor.paginationMode === PaginationModeEnum.InfiniteScroll) {
4936
- this.infiniteScroll = true;
4937
- this.scrollHeight = 'flex';
4938
- this.rowHeight = this.descriptor.rowHeight;
4939
- this.useQueryParams = false;
4940
- }
4941
- // check if data provider is supplied, if is, use it primarily
5359
+ this.filterDescriptors = this.descriptor.columns.filter(c => typeof c.filterDescriptor !== 'undefined').map(c => c.filterDescriptor);
5360
+ if (this.descriptor.paginationMode === PaginationModeEnum.InfiniteScroll) {
5361
+ this.infiniteScroll = true;
5362
+ this.scrollHeight = 'flex';
5363
+ this.rowHeight = this.descriptor.rowHeight;
5364
+ this.useQueryParams = false;
5365
+ }
5366
+ // check if data provider is supplied, if is, use it primarily
5367
+ if (this.dataProvider) {
5368
+ // map subjects to observables and initiate data
5369
+ this.useDataProvider = true;
5370
+ this.queryResult$ = this.dataProviderQueryResultSubject.asObservable();
5371
+ this.loading$ = this.dataProviderLoadingSubject.asObservable();
5372
+ const emptyQueryResult = new MediusQueryResult();
5373
+ emptyQueryResult.pageData = [];
5374
+ emptyQueryResult.allDataCount = 0;
5375
+ this.dataProviderLoadingSubject.next(false);
5376
+ this.dataProviderQueryResultSubject.next(emptyQueryResult);
5377
+ // inject service
5378
+ if (this.dataProvider.serviceType) {
5379
+ this.dataProviderService = this.injector.get(this.dataProvider.serviceType);
5380
+ }
5381
+ }
5382
+ else {
5383
+ // if query result is provided, use it as secondary source or else try to use items
5384
+ if (this.queryResult) {
5385
+ this.queryResult$ = this.queryResult instanceof Observable ? this.queryResult : of(this.queryResult);
5386
+ }
5387
+ else if (!this.queryResult && this.items) {
5388
+ this.queryResult$ = (this.items instanceof Observable ? this.items : of(this.items)).pipe(
5389
+ // distinctUntilChanged((v1, v2) => v1.length === v2.length &&
5390
+ // v1.every((v1i, idx) => v1i[this.descriptor.dataKeyProperty] === v2[idx][this.descriptor.dataKeyProperty])),
5391
+ map(items => {
5392
+ const queryResult = new MediusQueryResult();
5393
+ queryResult.pageData = items;
5394
+ queryResult.allDataCount = items.length;
5395
+ return queryResult;
5396
+ }));
5397
+ }
5398
+ if (typeof this.loading !== 'undefined') {
5399
+ this.loading$ = this.loading instanceof Observable ? this.loading : of(this.loading);
5400
+ }
5401
+ }
5402
+ if (this.useQueryParams) {
5403
+ const subscription = this.activatedRoute.queryParams.subscribe(qp => {
5404
+ this.loadTableFromRouteUpdate(qp);
5405
+ });
5406
+ this.subscriptions.push(subscription);
5407
+ }
5408
+ else {
5409
+ // initialize default sort if present
5410
+ const defaultSort = this.getDefaultSortMeta();
5411
+ if (defaultSort.length > 0) {
5412
+ this.multiSortMeta = defaultSort;
5413
+ }
5414
+ }
5415
+ }
5416
+ ngAfterContentInit() {
5417
+ this.templates.forEach(template => {
5418
+ switch (template.getType()) {
5419
+ case 'caption':
5420
+ this.captionTemplate = template.template;
5421
+ break;
5422
+ case 'columnAction':
5423
+ this.columnActionTemplate = template.template;
5424
+ break;
5425
+ }
5426
+ });
5427
+ }
5428
+ ngOnDestroy() {
5429
+ var _a;
5430
+ (_a = this.dataProviderSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
5431
+ this.subscriptions.forEach(s => s.unsubscribe());
5432
+ }
5433
+ reload(emitEvent = false, resetParams = false) {
5434
+ var _a;
5435
+ this.loadTableWithDataProvider(resetParams ? MediusQueryParamBuilder.create(this.rowsPerPageOptions[0], 0).build() : (_a = this.dataProviderLatestQueryParam) !== null && _a !== void 0 ? _a : new MediusQueryParam(), emitEvent);
5436
+ }
5437
+ onTableLazyLoad(event) {
5438
+ this.dataProviderLatestLazyLoadEvent = event;
5439
+ this.dataProviderLatestLazyLoadEventVersion++;
5440
+ if (this.useQueryParams) {
5441
+ if (!event.multiSortMeta || event.multiSortMeta.length === 0) {
5442
+ // add default sort meta to event if not multisort meta is present
5443
+ event.multiSortMeta = this.getDefaultSortMeta();
5444
+ }
5445
+ this.router.navigate([], {
5446
+ relativeTo: this.activatedRoute,
5447
+ replaceUrl: true,
5448
+ queryParams: MediusRestUtil.fromPrimeLazyLoadEventToAngularQueryParams(event, this.rowsPerPageOptions[0])
5449
+ });
5450
+ }
5451
+ else {
5452
+ const mediusQueryParams = event ? MediusRestUtil.fromPrimeLazyLoadEventToMediusQueryParams(event) : new MediusQueryParam();
5453
+ this.loadTableWithDataProvider(mediusQueryParams);
5454
+ }
5455
+ }
5456
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
5457
+ onTableSort(event) {
5458
+ this.isSortChanged = true;
5459
+ }
5460
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
5461
+ onTableFilter(event) {
5462
+ this.isFilterChanged = true;
5463
+ }
5464
+ onCellClick(col, item, idx) {
5465
+ const mngEvent = new MngTableCellClickEvent(col, item, idx);
5466
+ this.cellClickEventEmitter.next(mngEvent);
5467
+ }
5468
+ onSelectionChange(event) {
5469
+ this.selectionChangeEventEmitter.emit(event);
5470
+ }
5471
+ onCaptionCmpInst(instance) {
5472
+ this.captionCmpInstEventEmitter.next(instance);
5473
+ }
5474
+ onColumnActionCmpInst(instance) {
5475
+ this.columnActionCmpInstEventEmitter.next(instance);
5476
+ }
5477
+ loadTableWithDataProvider(queryParam = null, emitEvent = true) {
5478
+ var _a, _b, _c;
5479
+ if (!this.useDataProvider) {
5480
+ return;
5481
+ }
5482
+ (_a = this.dataProviderSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
5483
+ this.dataProviderLoadingSubject.next(true);
5484
+ if (!queryParam) {
5485
+ queryParam = MediusQueryParamBuilder.create(this.rowsPerPageOptions[0]).build();
5486
+ }
5487
+ this.dataProviderLatestQueryParam = queryParam;
5488
+ this.dataProviderLatestQueryParamVersion++;
5489
+ this.dataProviderSubscription = (_b = this.dataProvider) === null || _b === void 0 ? void 0 : _b.getAll(queryParam, this.dataProviderService).subscribe(res => {
5490
+ var _a, _b, _c;
5491
+ if (this.infiniteScroll) {
5492
+ if (this.isFilterChanged || this.isSortChanged) {
5493
+ this.dataProviderInfiniteScrollItems = [];
5494
+ }
5495
+ this.dataProviderInfiniteScrollItems.splice((_a = queryParam.itemsOffset) !== null && _a !== void 0 ? _a : 0, (_b = queryParam.itemsPerPage) !== null && _b !== void 0 ? _b : this.rows, ...((_c = res.pageData) !== null && _c !== void 0 ? _c : []));
5496
+ this.dataProviderInfiniteScrollItems = [...this.dataProviderInfiniteScrollItems];
5497
+ }
5498
+ else {
5499
+ this.dataProviderQueryResultSubject.next(res);
5500
+ }
5501
+ this.isFilterChanged = false;
5502
+ this.isSortChanged = false;
5503
+ this.dataProviderLoadingSubject.next(false);
5504
+ }, err => {
5505
+ var _a;
5506
+ ToastUtil.tableNotificationError(this.translate, this.descriptor, err, (_a = this.viewContainerService) !== null && _a !== void 0 ? _a : undefined);
5507
+ const emptyQueryResult = new MediusQueryResult();
5508
+ emptyQueryResult.pageData = [];
5509
+ emptyQueryResult.allDataCount = 0;
5510
+ this.dataProviderQueryResultSubject.next(emptyQueryResult);
5511
+ this.dataProviderLoadingSubject.next(false);
5512
+ });
5513
+ if (emitEvent) {
5514
+ const mngEvent = new MngTableLoadEvent();
5515
+ mngEvent.originalEvent = (_c = this.dataProviderLatestLazyLoadEvent) !== null && _c !== void 0 ? _c : undefined;
5516
+ mngEvent.queryParam = queryParam;
5517
+ this.loadEventEmitter.next(mngEvent);
5518
+ }
5519
+ }
5520
+ loadTableFromRouteUpdate(params) {
5521
+ const mediusQueryParam = MediusRestUtil.fromAngularQueryParamsToMediusQueryParams(params, this.filterDescriptors, this.rowsPerPageOptions[0]);
5522
+ if (this.dataProviderLatestLazyLoadEventVersion < this.dataProviderLatestQueryParamVersion + 1) {
5523
+ // update only if new version from query params will be higher
5524
+ this.updatePrimeSortAndFilter(mediusQueryParam);
5525
+ }
5526
+ this.useQueryParamsInitialized = true;
5527
+ this.loadTableWithDataProvider(mediusQueryParam);
5528
+ }
5529
+ updatePrimeSortAndFilter(mediusQueryParam) {
5530
+ var _a, _b, _c, _d;
5531
+ const primeSortMeta = [];
5532
+ const primeFilterMeta = {};
5533
+ this.filterDescriptors.forEach(f => {
5534
+ primeFilterMeta[f.property] = {
5535
+ value: null,
5536
+ matchMode: f.filterType === TypeEnum.String ? 'contains' : 'equals'
5537
+ };
5538
+ });
5539
+ (_a = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.sortProperty) === null || _a === void 0 ? void 0 : _a.forEach((s, idx) => {
5540
+ var _a, _b;
5541
+ primeSortMeta.push({
5542
+ field: s,
5543
+ order: ((_b = (_a = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.sortAsc) === null || _a === void 0 ? void 0 : _a[idx]) !== null && _b !== void 0 ? _b : true) ? 1 : -1
5544
+ });
5545
+ });
5546
+ (_b = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.filterParams) === null || _b === void 0 ? void 0 : _b.forEach(f => {
5547
+ const descriptor = this.filterDescriptors.find(fd => fd.filterProperty === f.property || fd.property === f.property);
5548
+ const operator = MediusRestUtil.matchModeMapping.find(mapping => mapping[2] === f.filterMatchType);
5549
+ if (descriptor && operator) {
5550
+ primeFilterMeta[descriptor.property] = {
5551
+ value: f.filterValue,
5552
+ matchMode: operator[0]
5553
+ };
5554
+ }
5555
+ });
5556
+ this.multiSortMeta = primeSortMeta;
5557
+ this.filterMetadata = primeFilterMeta;
5558
+ this.rows = (_c = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.itemsPerPage) !== null && _c !== void 0 ? _c : this.rowsPerPageOptions[0];
5559
+ this.offset = (_d = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.itemsOffset) !== null && _d !== void 0 ? _d : 0;
5560
+ }
5561
+ getDefaultSortMeta() {
5562
+ if (this.descriptor.hasDefaultSort) {
5563
+ return this.descriptor.defaultSortProperty.map((p, idx) => ({
5564
+ field: p,
5565
+ order: this.descriptor.defaultSortAsc[idx] ? 1 : -1
5566
+ }));
5567
+ }
5568
+ else {
5569
+ return [];
5570
+ }
5571
+ }
5572
+ }
5573
+ 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 });
5574
+ 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$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: i4$4.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "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.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent"], outputs: ["instanceCreated"] }, { 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": i3$1.TranslatePipe, "i18nProperty": MngI18nPropertyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5575
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, decorators: [{
5576
+ type: Component,
5577
+ 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" }]
5578
+ }], ctorParameters: function () {
5579
+ return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i3$1.TranslateService }, { type: MngViewContainerComponentService, decorators: [{
5580
+ type: Optional
5581
+ }] }];
5582
+ }, propDecorators: { descriptor: [{
5583
+ type: Input
5584
+ }], items: [{
5585
+ type: Input
5586
+ }], queryResult: [{
5587
+ type: Input
5588
+ }], loading: [{
5589
+ type: Input
5590
+ }], dataProvider: [{
5591
+ type: Input
5592
+ }], useQueryParams: [{
5593
+ type: Input
5594
+ }], selectionMode: [{
5595
+ type: Input
5596
+ }], selectionEnabled: [{
5597
+ type: Input
5598
+ }], captionComponent: [{
5599
+ type: Input
5600
+ }], columnActionComponent: [{
5601
+ type: Input
5602
+ }], loadEventEmitter: [{
5603
+ type: Output,
5604
+ args: ['tableLoad']
5605
+ }], cellClickEventEmitter: [{
5606
+ type: Output,
5607
+ args: ['cellClick']
5608
+ }], selectionChangeEventEmitter: [{
5609
+ type: Output,
5610
+ args: ['selectionChange']
5611
+ }], captionCmpInstEventEmitter: [{
5612
+ type: Output,
5613
+ args: ['captionComponentInstance']
5614
+ }], columnActionCmpInstEventEmitter: [{
5615
+ type: Output,
5616
+ args: ['columnActionComponentInstance']
5617
+ }], templates: [{
5618
+ type: ContentChildren,
5619
+ args: [MngTemplateDirective]
5620
+ }], components: [{
5621
+ type: ViewChildren,
5622
+ args: [MngComponentDirective]
5623
+ }], primeTable: [{
5624
+ type: ViewChild,
5625
+ args: [Table]
5626
+ }] } });
5627
+
5628
+ class MngTableviewComponent {
5629
+ constructor(route, messageService, translateService, dialogService, confirmationService, actionExecutor, viewContainerService) {
5630
+ this.route = route;
5631
+ this.messageService = messageService;
5632
+ this.translateService = translateService;
5633
+ this.dialogService = dialogService;
5634
+ this.confirmationService = confirmationService;
5635
+ this.actionExecutor = actionExecutor;
5636
+ this.viewContainerService = viewContainerService;
5637
+ this.actions = [];
5638
+ this.tableComponent = null;
5639
+ this.rowClickActions = [];
5640
+ this.rowInlineActions = [];
5641
+ this.toolbarLeftActions = [];
5642
+ this.toolbarRightActions = [];
5643
+ this.subscriptions = [];
5644
+ }
5645
+ ngOnInit() {
5646
+ this.viewContainerService.actions = this.actions;
4942
5647
  if (this.dataProvider) {
4943
- // map subjects to observables and initiate data
4944
- this.useDataProvider = true;
4945
- this.queryResult$ = this.dataProviderQueryResultSubject.asObservable();
4946
- this.loading$ = this.dataProviderLoadingSubject.asObservable();
4947
- const emptyQueryResult = new MediusQueryResult();
4948
- emptyQueryResult.pageData = [];
4949
- emptyQueryResult.allDataCount = 0;
4950
- this.dataProviderLoadingSubject.next(false);
4951
- this.dataProviderQueryResultSubject.next(emptyQueryResult);
4952
- // inject service
4953
- if (this.dataProvider.serviceType) {
4954
- this.dataProviderService = this.injector.get(this.dataProvider.serviceType);
4955
- }
4956
- }
4957
- else {
4958
- // if query result is provided, use it as secondary source or else try to use items
4959
- if (this.queryResult) {
4960
- this.queryResult$ = this.queryResult instanceof Observable ? this.queryResult : of(this.queryResult);
4961
- }
4962
- else if (!this.queryResult && this.items) {
4963
- this.queryResult$ = (this.items instanceof Observable ? this.items : of(this.items)).pipe(
4964
- // distinctUntilChanged((v1, v2) => v1.length === v2.length &&
4965
- // v1.every((v1i, idx) => v1i[this.descriptor.dataKeyProperty] === v2[idx][this.descriptor.dataKeyProperty])),
4966
- map(items => {
4967
- const queryResult = new MediusQueryResult();
4968
- queryResult.pageData = items;
4969
- queryResult.allDataCount = items.length;
4970
- return queryResult;
4971
- }));
4972
- }
4973
- if (typeof this.loading !== 'undefined') {
4974
- this.loading$ = this.loading instanceof Observable ? this.loading : of(this.loading);
4975
- }
4976
- }
4977
- if (this.useQueryParams) {
4978
- const subscription = this.activatedRoute.queryParams.subscribe(qp => {
4979
- this.loadTableFromRouteUpdate(qp);
4980
- });
4981
- this.subscriptions.push(subscription);
4982
- }
4983
- else {
4984
- // initialize default sort if present
4985
- const defaultSort = this.getDefaultSortMeta();
4986
- if (defaultSort.length > 0) {
4987
- this.multiSortMeta = defaultSort;
4988
- }
5648
+ this.viewContainerService.dataProvider = this.dataProvider;
4989
5649
  }
4990
- }
4991
- ngAfterContentInit() {
4992
- this.templates.forEach(template => {
4993
- switch (template.getType()) {
4994
- case 'caption':
4995
- this.captionTemplate = template.template;
5650
+ const reloadTableSubscription = this.viewContainerService.reloadTable$.subscribe(() => {
5651
+ this.reloadTable();
5652
+ });
5653
+ this.subscriptions.push(reloadTableSubscription);
5654
+ for (const action of this.actions) {
5655
+ switch (action.position) {
5656
+ case ActionPositionEnum.RowClick:
5657
+ this.rowClickActions.push(action);
4996
5658
  break;
4997
- case 'columnAction':
4998
- this.columnActionTemplate = template.template;
5659
+ case ActionPositionEnum.RowInline:
5660
+ this.rowInlineActions.push(action);
5661
+ break;
5662
+ case ActionPositionEnum.ToolbarLeft:
5663
+ this.toolbarLeftActions.push(action);
5664
+ break;
5665
+ case ActionPositionEnum.ToolbarRight:
5666
+ this.toolbarRightActions.push(action);
4999
5667
  break;
5000
5668
  }
5001
- });
5669
+ }
5002
5670
  }
5003
5671
  ngOnDestroy() {
5004
5672
  this.subscriptions.forEach(s => s.unsubscribe());
5005
5673
  }
5006
- reload(emitEvent = false, resetParams = false) {
5674
+ getMessageService() {
5675
+ return this.messageService;
5676
+ }
5677
+ getDataProvider() {
5678
+ return this.dataProvider;
5679
+ }
5680
+ reloadTable() {
5007
5681
  var _a;
5008
- this.loadTableWithDataProvider(resetParams ? MediusQueryParamBuilder.create(this.rowsPerPageOptions[0], 0).build() : (_a = this.dataProviderLatestQueryParam) !== null && _a !== void 0 ? _a : new MediusQueryParam(), emitEvent);
5682
+ (_a = this.tableComponent) === null || _a === void 0 ? void 0 : _a.reload();
5009
5683
  }
5010
- onTableLazyLoad(event) {
5011
- this.dataProviderLatestLazyLoadEvent = event;
5012
- this.dataProviderLatestLazyLoadEventVersion++;
5013
- if (this.useQueryParams) {
5014
- if (!event.multiSortMeta || event.multiSortMeta.length === 0) {
5015
- // add default sort meta to event if not multisort meta is present
5016
- event.multiSortMeta = this.getDefaultSortMeta();
5684
+ onTableCellClick(event) {
5685
+ if (this.rowClickActions.length) {
5686
+ for (const action of this.rowClickActions) {
5687
+ this.actionExecutor.triggerRowClickAction(action, event, this.route);
5017
5688
  }
5018
- this.router.navigate([], {
5019
- relativeTo: this.activatedRoute,
5020
- replaceUrl: true,
5021
- queryParams: MediusRestUtil.fromPrimeLazyLoadEventToAngularQueryParams(event, this.rowsPerPageOptions[0])
5022
- });
5023
- }
5024
- else {
5025
- const mediusQueryParams = event ? MediusRestUtil.fromPrimeLazyLoadEventToMediusQueryParams(event) : new MediusQueryParam();
5026
- this.loadTableWithDataProvider(mediusQueryParams);
5027
5689
  }
5028
5690
  }
5029
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
5030
- onTableSort(event) {
5031
- this.isSortChanged = true;
5032
- }
5033
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
5034
- onTableFilter(event) {
5035
- this.isFilterChanged = true;
5691
+ }
5692
+ 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 });
5693
+ 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: 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", "dataProvider", "viewContainer"] }, { 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$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.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": i3$1.TranslatePipe } });
5694
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, decorators: [{
5695
+ type: Component,
5696
+ 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" }]
5697
+ }], 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: [{
5698
+ type: Input
5699
+ }], dataProvider: [{
5700
+ type: Input
5701
+ }], actions: [{
5702
+ type: Input
5703
+ }], tableComponent: [{
5704
+ type: ViewChild,
5705
+ args: [MngTableComponent]
5706
+ }] } });
5707
+
5708
+ class AMngTableviewRouteComponent {
5709
+ ngOnInit() {
5710
+ this.descriptor = this.createTableviewDescriptor();
5711
+ this.dataProvider = this.createTableviewDataProvider();
5712
+ this.actions = this.createActionDescriptors();
5036
5713
  }
5037
- onCellClick(col, item, idx) {
5038
- const mngEvent = new MngTableCellClickEvent(col, item, idx);
5039
- this.cellClickEventEmitter.next(mngEvent);
5714
+ createActionDescriptors() {
5715
+ const actions = [];
5716
+ actions.push(new ActionEditorDetailsDescriptor(this.descriptor.viewEditor));
5717
+ actions.push(new ActionEditorAddDescriptor(this.descriptor.addEditor));
5718
+ actions.push(new ActionEditorEditDescriptor(this.descriptor.editEditor));
5719
+ actions.push(new ActionDeleteDescriptor(this.descriptor.model));
5720
+ return actions;
5040
5721
  }
5041
- onSelectionChange(event) {
5042
- this.selectionChangeEventEmitter.emit(event);
5722
+ }
5723
+ AMngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: AMngTableviewRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
5724
+ AMngTableviewRouteComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: AMngTableviewRouteComponent, ngImport: i0 });
5725
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: AMngTableviewRouteComponent, decorators: [{
5726
+ type: Directive
5727
+ }] });
5728
+
5729
+ class MngTableviewRouteComponent extends AMngTableviewRouteComponent {
5730
+ constructor(route) {
5731
+ super();
5732
+ this.route = route;
5043
5733
  }
5044
- loadTableWithDataProvider(queryParam = null, emitEvent = true) {
5045
- var _a, _b;
5046
- if (!this.useDataProvider) {
5047
- return;
5734
+ createTableviewDescriptor() {
5735
+ if (!this.route.snapshot.data['tableviewData'].descriptor) {
5736
+ throw Error('Tableview requires a descriptor.');
5048
5737
  }
5049
- if (this.dataProviderSubscription) {
5050
- this.dataProviderSubscription.unsubscribe();
5738
+ return this.route.snapshot.data['tableviewData'].descriptor;
5739
+ }
5740
+ createTableviewDataProvider() {
5741
+ if (!this.route.snapshot.data['tableviewData'].dataProvider) {
5742
+ throw Error('Tableview requires a data provider.');
5051
5743
  }
5052
- this.dataProviderLoadingSubject.next(true);
5053
- if (!queryParam) {
5054
- queryParam = MediusQueryParamBuilder.create(this.rowsPerPageOptions[0]).build();
5744
+ return this.route.snapshot.data['tableviewData'].dataProvider;
5745
+ }
5746
+ createActionDescriptors() {
5747
+ var _a;
5748
+ return (_a = this.route.snapshot.data['tableviewData'].actions) !== null && _a !== void 0 ? _a : super.createActionDescriptors();
5749
+ }
5750
+ }
5751
+ MngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, deps: [{ token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
5752
+ 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"] }] });
5753
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, decorators: [{
5754
+ type: Component,
5755
+ 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" }]
5756
+ }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }]; } });
5757
+
5758
+ class MngFormlyFieldLookupDialogComponent extends FieldType {
5759
+ constructor(injector) {
5760
+ super();
5761
+ this.injector = injector;
5762
+ this.fieldLabelFormControl = new FormControl();
5763
+ this.itemsSubject = new ReplaySubject(1);
5764
+ this.itemsAsync = this.itemsSubject.asObservable();
5765
+ this.addItemsSubject = new ReplaySubject(1);
5766
+ this.addItemsAsync = this.addItemsSubject.asObservable();
5767
+ this.dialogUseDataProvider = false;
5768
+ this.dialogDataProviderService = null;
5769
+ this.dialogIsLoadingSubject = new ReplaySubject(1);
5770
+ this.isDialogVisible = false;
5771
+ this.dialogAreItemsLoaded = false;
5772
+ this.dialogSelectedItem = null;
5773
+ this.dialogMessages = [];
5774
+ this.dialogIsLoading$ = this.dialogIsLoadingSubject.asObservable();
5775
+ this.subscriptions = [];
5776
+ }
5777
+ ngOnInit() {
5778
+ var _a;
5779
+ this.descriptor = this.to['descriptor'];
5780
+ // emit lifecycle event
5781
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Component, MngFormlyFieldLookupDialogComponent, this, {
5782
+ eventSubtype: MngFormFieldEventComponentSubtype.ON_INIT
5783
+ });
5784
+ this.config = this.descriptor.config;
5785
+ if (!this.descriptor.lookupTableDataProvider && ((_a = this.descriptor.dataProvider) === null || _a === void 0 ? void 0 : _a.serviceType)) {
5786
+ this.dialogUseDataProvider = true;
5787
+ this.dialogDataProviderService = this.injector.get(this.descriptor.dataProvider.serviceType);
5055
5788
  }
5056
- this.dataProviderLatestQueryParam = queryParam;
5057
- this.dataProviderLatestQueryParamVersion++;
5058
- this.dataProviderSubscription = (_a = this.dataProvider) === null || _a === void 0 ? void 0 : _a.getAll(queryParam, this.dataProviderService).pipe(first(), finalize(() => this.dataProviderLoadingSubject.next(false))).subscribe(res => {
5059
- var _a, _b, _c;
5060
- if (this.infiniteScroll) {
5061
- if (this.isFilterChanged || this.isSortChanged) {
5062
- this.dataProviderInfiniteScrollItems = [];
5063
- }
5064
- this.dataProviderInfiniteScrollItems.splice((_a = queryParam.itemsOffset) !== null && _a !== void 0 ? _a : 0, (_b = queryParam.itemsPerPage) !== null && _b !== void 0 ? _b : this.rows, ...((_c = res.pageData) !== null && _c !== void 0 ? _c : []));
5065
- this.dataProviderInfiniteScrollItems = [...this.dataProviderInfiniteScrollItems];
5789
+ // init values
5790
+ this.setFieldLabelValue(this.formControl.value);
5791
+ const subscription = this.formControl.valueChanges.pipe(startWith(this.formControl.value), distinctUntilChanged((prev, curr) => {
5792
+ var _a;
5793
+ const compareProp = (_a = this.descriptor.lookupTableDescriptor.dataKeyProperty) !== null && _a !== void 0 ? _a : this.descriptor.lookupTableDescriptor.model.idPropertyName;
5794
+ if (compareProp && typeof prev === 'object' && typeof curr === 'object') {
5795
+ return prev[compareProp] === curr[compareProp];
5066
5796
  }
5067
5797
  else {
5068
- this.dataProviderQueryResultSubject.next(res);
5798
+ return prev === curr;
5069
5799
  }
5070
- this.isFilterChanged = false;
5071
- this.isSortChanged = false;
5072
- }, err => {
5073
- ToastUtil.tableNotificationError(this.translate, this.descriptor, err, this.tableviewService);
5074
- const emptyQueryResult = new MediusQueryResult();
5075
- emptyQueryResult.pageData = [];
5076
- emptyQueryResult.allDataCount = 0;
5077
- this.dataProviderQueryResultSubject.next(emptyQueryResult);
5800
+ })).subscribe(v => {
5801
+ this.setFieldLabelValue(v);
5802
+ this.itemsSubject.next(v);
5803
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.ValueChange, MngFormlyFieldLookupDialogComponent, this, {
5804
+ value: v
5805
+ });
5078
5806
  });
5079
- if (emitEvent) {
5080
- const mngEvent = new MngTableLoadEvent();
5081
- mngEvent.originalEvent = (_b = this.dataProviderLatestLazyLoadEvent) !== null && _b !== void 0 ? _b : undefined;
5082
- mngEvent.queryParam = queryParam;
5083
- this.loadEventEmitter.next(mngEvent);
5807
+ this.subscriptions.push(subscription);
5808
+ }
5809
+ ngAfterViewInit() {
5810
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Component, MngFormlyFieldLookupDialogComponent, this, {
5811
+ eventSubtype: MngFormFieldEventComponentSubtype.ON_VIEW_INIT
5812
+ });
5813
+ }
5814
+ ngOnDestroy() {
5815
+ var _a, _b;
5816
+ (_a = this.lookupDataProviderSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
5817
+ this.subscriptions.forEach(s => s.unsubscribe());
5818
+ // emit lifecycle event
5819
+ (_b = this.descriptor) === null || _b === void 0 ? void 0 : _b.nextEvent(MngFormFieldEventTypeEnum.Component, MngFormlyFieldLookupDialogComponent, this, {
5820
+ eventSubtype: MngFormFieldEventComponentSubtype.ON_DESTROY
5821
+ });
5822
+ }
5823
+ openSelectDialog() {
5824
+ var _a;
5825
+ if (!this.dialogAreItemsLoaded && this.dialogUseDataProvider) {
5826
+ this.dialogIsLoadingSubject.next(true);
5827
+ const queryParamBuilder = MediusQueryParamBuilder.create(50);
5828
+ if (this.descriptor.lookupTableDescriptor.hasDefaultSort) {
5829
+ this.descriptor.lookupTableDescriptor.defaultSortProperty.forEach((p, idx) => queryParamBuilder.withSort(p, this.descriptor.lookupTableDescriptor.defaultSortAsc[idx]));
5830
+ }
5831
+ this.lookupDataProviderSubscription = (_a = this.descriptor.dataProvider) === null || _a === void 0 ? void 0 : _a.lookup(queryParamBuilder.build(), this.dialogDataProviderService).subscribe({
5832
+ next: res => {
5833
+ const mqr = new MediusQueryResult();
5834
+ mqr.pageData = res;
5835
+ mqr.allDataCount = res.length;
5836
+ this.addItemsSubject.next(mqr);
5837
+ this.dialogAreItemsLoaded = true;
5838
+ this.dialogIsLoadingSubject.next(false);
5839
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.DataProvider, MngFormlyFieldLookupDialogComponent, this, {
5840
+ eventSubtype: 'LookupNext',
5841
+ queryResult: mqr
5842
+ });
5843
+ },
5844
+ error: err => {
5845
+ this.dialogIsLoadingSubject.next(false);
5846
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.DataProvider, MngFormlyFieldLookupDialogComponent, this, {
5847
+ eventSubtype: 'LookupError',
5848
+ queryResult: err
5849
+ });
5850
+ }
5851
+ });
5084
5852
  }
5853
+ this.dialogSelectedItem = null;
5854
+ this.isDialogVisible = true;
5855
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Dialog, MngFormlyFieldLookupDialogComponent, this, {
5856
+ eventSubtype: MngFormFieldEventDialogSubtype.VISIBILITY,
5857
+ dialogVisible: true
5858
+ });
5085
5859
  }
5086
- loadTableFromRouteUpdate(params) {
5087
- const mediusQueryParam = MediusRestUtil.fromAngularQueryParamsToMediusQueryParams(params, this.filterDescriptors, this.rowsPerPageOptions[0]);
5088
- if (this.dataProviderLatestLazyLoadEventVersion < this.dataProviderLatestQueryParamVersion + 1) {
5089
- // update only if new version from query params will be higher
5090
- this.updatePrimeSortAndFilter(mediusQueryParam);
5091
- }
5092
- this.useQueryParamsInitialized = true;
5093
- this.loadTableWithDataProvider(mediusQueryParam);
5860
+ onSelectionChange(item) {
5861
+ this.dialogSelectedItem = item;
5094
5862
  }
5095
- updatePrimeSortAndFilter(mediusQueryParam) {
5096
- var _a, _b, _c, _d;
5097
- const primeSortMeta = [];
5098
- const primeFilterMeta = {};
5099
- this.filterDescriptors.forEach(f => {
5100
- primeFilterMeta[f.property] = {
5101
- value: null,
5102
- matchMode: f.filterType === TypeEnum.String ? 'contains' : 'equals'
5103
- };
5863
+ onCaptionCmpInst(instance) {
5864
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Dialog, MngFormlyFieldLookupDialogComponent, this, {
5865
+ eventSubtype: MngFormFieldEventDialogSubtype.TABLE_CAPTION_COMPONENT_INSTANCE,
5866
+ captionComponentInstance: instance
5104
5867
  });
5105
- (_a = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.sortProperty) === null || _a === void 0 ? void 0 : _a.forEach((s, idx) => {
5106
- var _a, _b;
5107
- primeSortMeta.push({
5108
- field: s,
5109
- order: ((_b = (_a = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.sortAsc) === null || _a === void 0 ? void 0 : _a[idx]) !== null && _b !== void 0 ? _b : true) ? 1 : -1
5110
- });
5868
+ }
5869
+ onColumnActionCmpInst(instance) {
5870
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Dialog, MngFormlyFieldLookupDialogComponent, this, {
5871
+ eventSubtype: MngFormFieldEventDialogSubtype.TABLE_COLUMN_ACTIONS_COMPONENT_INSTANCE,
5872
+ captionComponentInstance: instance
5111
5873
  });
5112
- (_b = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.filterParams) === null || _b === void 0 ? void 0 : _b.forEach(f => {
5113
- const descriptor = this.filterDescriptors.find(fd => fd.filterProperty === f.property || fd.property === f.property);
5114
- const operator = MediusRestUtil.matchModeMapping.find(mapping => mapping[2] === f.filterMatchType);
5115
- if (descriptor && operator) {
5116
- primeFilterMeta[descriptor.property] = {
5117
- value: f.filterValue,
5118
- matchMode: operator[0]
5119
- };
5120
- }
5874
+ }
5875
+ clear() {
5876
+ this.formControl.setValue(undefined);
5877
+ this.dialogSelectedItem = null;
5878
+ this.dialogAreItemsLoaded = false;
5879
+ this.hideDialog();
5880
+ }
5881
+ hideDialog() {
5882
+ this.isDialogVisible = false;
5883
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Dialog, MngFormlyFieldLookupDialogComponent, this, {
5884
+ eventSubtype: MngFormFieldEventDialogSubtype.VISIBILITY,
5885
+ dialogVisible: false
5121
5886
  });
5122
- this.multiSortMeta = primeSortMeta;
5123
- this.filterMetadata = primeFilterMeta;
5124
- this.rows = (_c = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.itemsPerPage) !== null && _c !== void 0 ? _c : this.rowsPerPageOptions[0];
5125
- this.offset = (_d = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.itemsOffset) !== null && _d !== void 0 ? _d : 0;
5126
5887
  }
5127
- getDefaultSortMeta() {
5128
- if (this.descriptor.hasDefaultSort) {
5129
- return this.descriptor.defaultSortProperty.map((p, idx) => ({
5130
- field: p,
5131
- order: this.descriptor.defaultSortAsc[idx] ? 1 : -1
5132
- }));
5888
+ addItem() {
5889
+ this.formControl.setValue(this.dialogSelectedItem);
5890
+ this.dialogSelectedItem = null;
5891
+ this.dialogAreItemsLoaded = false;
5892
+ this.hideDialog();
5893
+ }
5894
+ setFieldLabelValue(value) {
5895
+ var _a, _b;
5896
+ if (!value) {
5897
+ this.fieldLabelFormControl.setValue('');
5898
+ return;
5899
+ }
5900
+ if (typeof value === 'object') {
5901
+ const labelProperty = (_a = this.descriptor.itemsLabelProperty) !== null && _a !== void 0 ? _a : (_b = this.descriptor.lookupTableDescriptor) === null || _b === void 0 ? void 0 : _b.model.titlePropertyName;
5902
+ if (!labelProperty) {
5903
+ throw new Error('Could not determine label property.');
5904
+ }
5905
+ this.fieldLabelFormControl.setValue(value[labelProperty]);
5133
5906
  }
5134
5907
  else {
5135
- return [];
5908
+ this.fieldLabelFormControl.setValue(value);
5136
5909
  }
5137
5910
  }
5138
5911
  }
5139
- 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 });
5140
- 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 });
5141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, decorators: [{
5912
+ MngFormlyFieldLookupDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
5913
+ 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$1.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$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.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i3$1.TranslatePipe, "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5914
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, decorators: [{
5142
5915
  type: Component,
5143
- 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" }]
5144
- }], ctorParameters: function () {
5145
- return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2$2.TranslateService }, { type: TableviewComponentService, decorators: [{
5146
- type: Optional
5147
- }] }];
5148
- }, propDecorators: { descriptor: [{
5149
- type: Input
5150
- }], items: [{
5151
- type: Input
5152
- }], queryResult: [{
5153
- type: Input
5154
- }], loading: [{
5155
- type: Input
5156
- }], dataProvider: [{
5157
- type: Input
5158
- }], useQueryParams: [{
5159
- type: Input
5160
- }], selectionEnabled: [{
5161
- type: Input
5162
- }], loadEventEmitter: [{
5163
- type: Output,
5164
- args: ['tableLoad']
5165
- }], cellClickEventEmitter: [{
5166
- type: Output,
5167
- args: ['cellClick']
5168
- }], selectionChangeEventEmitter: [{
5169
- type: Output,
5170
- args: ['selectionChange']
5171
- }], templates: [{
5172
- type: ContentChildren,
5173
- args: [MngTemplateDirective]
5174
- }], primeTable: [{
5916
+ 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" }]
5917
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { mngTable: [{
5175
5918
  type: ViewChild,
5176
- args: [Table]
5919
+ args: [MngTableComponent]
5177
5920
  }] } });
5178
5921
 
5922
+ var SizeEnum = ActionDescriptor.SizeEnum;
5179
5923
  class MngFormlyFieldTableDialogFormComponent extends FieldType {
5180
5924
  constructor() {
5181
5925
  super(...arguments);
@@ -5184,6 +5928,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5184
5928
  this.toolbarActions = [];
5185
5929
  this.rowActions = [];
5186
5930
  this.subscriptions = [];
5931
+ this.isDisabledSubject = new BehaviorSubject(false);
5932
+ this.isEnabled$ = this.isDisabledSubject.asObservable().pipe(distinctUntilChanged(), map(e => !e));
5187
5933
  }
5188
5934
  ngOnInit() {
5189
5935
  this.descriptor = this.to['descriptor'];
@@ -5195,6 +5941,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5195
5941
  .withTitle(null)
5196
5942
  .withIcon('pi pi-plus')
5197
5943
  .withClassName('mng-formly-field-table-form-dialog')
5944
+ .withSize(SizeEnum.ExtraSmall)
5198
5945
  .withSubmitFunction(ctx => {
5199
5946
  var _a;
5200
5947
  if (!((_a = ctx.data) === null || _a === void 0 ? void 0 : _a.item)) {
@@ -5206,7 +5953,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5206
5953
  this.formControl.patchValue(value);
5207
5954
  return of(ctx.data.item);
5208
5955
  })
5209
- .withIsVisibleFunction(() => { var _a; return of(!((_a = this.options) === null || _a === void 0 ? void 0 : _a.formState.disabled)); });
5956
+ .withIsVisibleFunction(() => { var _a; return of(!((_a = this.options) === null || _a === void 0 ? void 0 : _a.formState.disabled)); })
5957
+ .withIsEnabledFunction(() => this.isEnabled$);
5210
5958
  this.toolbarActions.push(addAction);
5211
5959
  }
5212
5960
  if (hasEditAction) {
@@ -5214,6 +5962,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5214
5962
  .withTitle(null)
5215
5963
  .withIcon('pi pi-pencil')
5216
5964
  .withClassName('mng-formly-field-table-form-dialog')
5965
+ .withSize(SizeEnum.ExtraSmall)
5217
5966
  .withSubmitFunction(ctx => {
5218
5967
  var _a, _b;
5219
5968
  if (!((_a = ctx.data) === null || _a === void 0 ? void 0 : _a.item)) {
@@ -5225,7 +5974,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5225
5974
  this.formControl.patchValue(formControlValue);
5226
5975
  return of(ctx.data.item);
5227
5976
  })
5228
- .withIsVisibleFunction(() => { var _a; return of(!((_a = this.options) === null || _a === void 0 ? void 0 : _a.formState.disabled)); });
5977
+ .withIsVisibleFunction(() => { var _a; return of(!((_a = this.formControl) === null || _a === void 0 ? void 0 : _a.disabled)); })
5978
+ .withIsEnabledFunction(() => this.isEnabled$);
5229
5979
  this.rowActions.push(editAction);
5230
5980
  }
5231
5981
  if (hasDeleteAction) {
@@ -5233,6 +5983,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5233
5983
  .withLevel(ActionLevelEnum.Danger)
5234
5984
  .withTitle(null)
5235
5985
  .withIcon('pi pi-trash')
5986
+ .withSize(SizeEnum.ExtraSmall)
5236
5987
  .withRunFunction(ctx => {
5237
5988
  var _a;
5238
5989
  if (!((_a = ctx.data) === null || _a === void 0 ? void 0 : _a.item)) {
@@ -5253,27 +6004,38 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5253
6004
  this.formControl.patchValue(formControlValue);
5254
6005
  return of(ctx.data.item);
5255
6006
  })
5256
- .withIsVisibleFunction(() => { var _a; return of(!((_a = this.options) === null || _a === void 0 ? void 0 : _a.formState.disabled)); });
6007
+ .withIsVisibleFunction(() => { var _a; return of(!((_a = this.options) === null || _a === void 0 ? void 0 : _a.formState.disabled)); })
6008
+ .withIsEnabledFunction(() => this.isEnabled$);
5257
6009
  this.rowActions.push(deleteAction);
5258
6010
  }
5259
6011
  // init values
5260
6012
  if (typeof this.formControl.value === 'undefined' || this.formControl.value === null) {
5261
6013
  this.formControl.patchValue([]);
5262
6014
  }
5263
- const subscription = this.formControl.valueChanges.pipe(startWith(this.formControl.value)).subscribe(v => {
6015
+ let subscription = this.formControl.valueChanges.pipe(startWith(this.formControl.value)).subscribe(v => {
5264
6016
  this.itemsSubject.next(v);
5265
6017
  });
5266
6018
  this.subscriptions.push(subscription);
6019
+ this.isDisabledSubject.next(this.formControl.disabled);
6020
+ subscription = this.formControl.statusChanges.pipe().subscribe(status => {
6021
+ if (status === 'DISABLED' && !this.isDisabledSubject.value) {
6022
+ this.isDisabledSubject.next(true);
6023
+ }
6024
+ else if (status !== 'DISABLED' && this.isDisabledSubject.value) {
6025
+ this.isDisabledSubject.next(false);
6026
+ }
6027
+ });
6028
+ this.subscriptions.push(subscription);
5267
6029
  }
5268
6030
  ngOnDestroy() {
5269
6031
  this.subscriptions.forEach(s => s.unsubscribe());
5270
6032
  }
5271
6033
  }
5272
6034
  MngFormlyFieldTableDialogFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
5273
- 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 });
6035
+ 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", "viewContainer"] }], 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": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5274
6036
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, decorators: [{
5275
6037
  type: Component,
5276
- 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"] }]
6038
+ 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"] }]
5277
6039
  }] });
5278
6040
 
5279
6041
  class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
@@ -5315,6 +6077,8 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
5315
6077
  this.subscriptions.push(subscription);
5316
6078
  }
5317
6079
  ngOnDestroy() {
6080
+ var _a;
6081
+ (_a = this.lookupDataProviderSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
5318
6082
  this.subscriptions.forEach(s => s.unsubscribe());
5319
6083
  }
5320
6084
  openAddDialog() {
@@ -5329,9 +6093,15 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
5329
6093
  const filterValues = this.formControl.value.map((i) => i[this.descriptor.excludeValueProperty]);
5330
6094
  queryParamBuilder.withFilter(this.descriptor.excludeFilterProperty, filterValues, undefined, MediusFilterMatchType.NotIn);
5331
6095
  }
5332
- (_a = this.descriptor.lookupTableDataProvider) === null || _a === void 0 ? void 0 : _a.getAll(queryParamBuilder.build(), this.dialogDataProviderService).pipe(first(), finalize(() => this.dialogIsLoadingSubject.next(false))).subscribe(res => {
5333
- this.addItemsSubject.next(res);
5334
- this.dialogAreItemsLoaded = true;
6096
+ this.lookupDataProviderSubscription = (_a = this.descriptor.lookupTableDataProvider) === null || _a === void 0 ? void 0 : _a.getAll(queryParamBuilder.build(), this.dialogDataProviderService).subscribe({
6097
+ next: res => {
6098
+ this.addItemsSubject.next(res);
6099
+ this.dialogAreItemsLoaded = true;
6100
+ this.dialogIsLoadingSubject.next(false);
6101
+ },
6102
+ error: () => {
6103
+ this.dialogIsLoadingSubject.next(false);
6104
+ }
5335
6105
  });
5336
6106
  }
5337
6107
  this.dialogSelectedAddItems = [];
@@ -5376,16 +6146,16 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
5376
6146
  }
5377
6147
  }
5378
6148
  MngFormlyFieldTableDialogMultiselectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
5379
- 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 });
6149
+ 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$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.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i3$1.TranslatePipe, "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5380
6150
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, decorators: [{
5381
6151
  type: Component,
5382
- 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" }]
6152
+ 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" }]
5383
6153
  }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
5384
6154
 
5385
6155
  class MngFormlyFieldTabsComponent extends FieldType {
5386
6156
  }
5387
6157
  MngFormlyFieldTabsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTabsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
5388
- 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 });
6158
+ 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$1.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 });
5389
6159
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTabsComponent, decorators: [{
5390
6160
  type: Component,
5391
6161
  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" }]
@@ -5394,7 +6164,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
5394
6164
  class MngFormlyFieldFieldsetComponent extends FieldType {
5395
6165
  }
5396
6166
  MngFormlyFieldFieldsetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldFieldsetComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
5397
- 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 });
6167
+ 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$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5398
6168
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldFieldsetComponent, decorators: [{
5399
6169
  type: Component,
5400
6170
  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" }]
@@ -5403,19 +6173,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
5403
6173
  class MngFormlyFieldWrapperComponent extends FieldWrapper {
5404
6174
  }
5405
6175
  MngFormlyFieldWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
5406
- 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 });
6176
+ 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$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5407
6177
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldWrapperComponent, decorators: [{
5408
6178
  type: Component,
5409
- 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" }]
6179
+ 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" }]
5410
6180
  }] });
5411
6181
 
5412
6182
  class MngFormlyTableWrapperComponent extends FieldWrapper {
5413
6183
  }
5414
6184
  MngFormlyTableWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyTableWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
5415
- 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 });
6185
+ 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$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5416
6186
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyTableWrapperComponent, decorators: [{
5417
6187
  type: Component,
5418
- 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" }]
6188
+ 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" }]
5419
6189
  }] });
5420
6190
 
5421
6191
  class MngBreadcrumbComponent {
@@ -5424,7 +6194,7 @@ class MngBreadcrumbComponent {
5424
6194
  }
5425
6195
  }
5426
6196
  MngBreadcrumbComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBreadcrumbComponent, deps: [{ token: MngCommonsService }], target: i0.ɵɵFactoryTarget.Component });
5427
- 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 });
6197
+ 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$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5428
6198
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBreadcrumbComponent, decorators: [{
5429
6199
  type: Component,
5430
6200
  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" }]
@@ -5437,7 +6207,7 @@ class MngFooterComponent {
5437
6207
  }
5438
6208
  }
5439
6209
  MngFooterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFooterComponent, deps: [{ token: MngCommonsService }], target: i0.ɵɵFactoryTarget.Component });
5440
- 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 });
6210
+ 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 });
5441
6211
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFooterComponent, decorators: [{
5442
6212
  type: Component,
5443
6213
  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" }]
@@ -5775,7 +6545,7 @@ class MngMenuItemComponent {
5775
6545
  }
5776
6546
  }
5777
6547
  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 });
5778
- 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: [
6548
+ 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": i3$1.TranslatePipe }, animations: [
5779
6549
  trigger('children', [
5780
6550
  state('void', style({
5781
6551
  height: '0px'
@@ -5874,8 +6644,6 @@ class MngTopbarComponent {
5874
6644
  this.mngCommons.user$.subscribe(u => {
5875
6645
  this.user = u;
5876
6646
  });
5877
- }
5878
- ngAfterViewInit() {
5879
6647
  this.mainLayoutService.innerWidth = window.innerWidth;
5880
6648
  }
5881
6649
  switchLanguage(language) {
@@ -5889,7 +6657,7 @@ class MngTopbarComponent {
5889
6657
  }
5890
6658
  }
5891
6659
  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 });
5892
- 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 });
6660
+ 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"], outputs: ["instanceCreated"] }, { type: i4$1.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$1.AsyncPipe, "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5893
6661
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTopbarComponent, decorators: [{
5894
6662
  type: Component,
5895
6663
  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" }]
@@ -5927,7 +6695,7 @@ class MngMainLayoutComponent {
5927
6695
  }
5928
6696
  }
5929
6697
  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 });
5930
- 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 });
6698
+ 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"], outputs: ["instanceCreated"] }, { 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 });
5931
6699
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngMainLayoutComponent, decorators: [{
5932
6700
  type: Component,
5933
6701
  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" }]
@@ -5939,129 +6707,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
5939
6707
  args: ['window:resize', ['$event']]
5940
6708
  }] } });
5941
6709
 
5942
- class MngTableviewComponent {
5943
- constructor(route, messageService, translateService, dialogService, confirmationService, actionService, tableviewService) {
5944
- this.route = route;
5945
- this.messageService = messageService;
5946
- this.translateService = translateService;
5947
- this.dialogService = dialogService;
5948
- this.confirmationService = confirmationService;
5949
- this.actionService = actionService;
5950
- this.tableviewService = tableviewService;
5951
- this.actions = [];
5952
- this.tableComponent = null;
5953
- this.rowClickActions = [];
5954
- this.rowInlineActions = [];
5955
- this.toolbarLeftActions = [];
5956
- this.toolbarRightActions = [];
5957
- this.subscriptions = [];
5958
- }
5959
- ngOnInit() {
5960
- this.tableviewService.actions = this.actions;
5961
- this.tableviewService.dataProvider = this.dataProvider;
5962
- this.tableviewService.messageService = this.messageService;
5963
- const reloadTableSubscription = this.tableviewService.reloadTable$.subscribe(() => {
5964
- this.reloadTable();
5965
- });
5966
- this.subscriptions.push(reloadTableSubscription);
5967
- for (const action of this.actions) {
5968
- switch (action.position) {
5969
- case ActionPositionEnum.RowClick:
5970
- this.rowClickActions.push(action);
5971
- break;
5972
- case ActionPositionEnum.RowInline:
5973
- this.rowInlineActions.push(action);
5974
- break;
5975
- case ActionPositionEnum.ToolbarLeft:
5976
- this.toolbarLeftActions.push(action);
5977
- break;
5978
- case ActionPositionEnum.ToolbarRight:
5979
- this.toolbarRightActions.push(action);
5980
- break;
5981
- }
5982
- }
5983
- }
5984
- ngOnDestroy() {
5985
- this.subscriptions.forEach(s => s.unsubscribe());
5986
- }
5987
- reloadTable() {
5988
- var _a;
5989
- (_a = this.tableComponent) === null || _a === void 0 ? void 0 : _a.reload();
5990
- }
5991
- onTableCellClick(event) {
5992
- if (this.rowClickActions.length) {
5993
- for (const action of this.rowClickActions) {
5994
- this.actionService.triggerRowClickAction(action, event, this.route);
5995
- }
5996
- }
5997
- }
5998
- }
5999
- 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 });
6000
- 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 } });
6001
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, decorators: [{
6002
- type: Component,
6003
- 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" }]
6004
- }], 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: [{
6005
- type: Input
6006
- }], dataProvider: [{
6007
- type: Input
6008
- }], actions: [{
6009
- type: Input
6010
- }], tableComponent: [{
6011
- type: ViewChild,
6012
- args: [MngTableComponent]
6013
- }] } });
6014
-
6015
- class AMngTableviewRouteComponent {
6016
- ngOnInit() {
6017
- this.descriptor = this.createTableviewDescriptor();
6018
- this.dataProvider = this.createTableviewDataProvider();
6019
- this.actions = this.createActionDescriptors();
6020
- }
6021
- createActionDescriptors() {
6022
- const actions = [];
6023
- actions.push(new ActionEditorDetailsDescriptor(this.descriptor.viewEditor));
6024
- actions.push(new ActionEditorAddDescriptor(this.descriptor.addEditor));
6025
- actions.push(new ActionEditorEditDescriptor(this.descriptor.editEditor));
6026
- actions.push(new ActionDeleteDescriptor(this.descriptor.model));
6027
- return actions;
6028
- }
6029
- }
6030
- AMngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: AMngTableviewRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
6031
- AMngTableviewRouteComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: AMngTableviewRouteComponent, ngImport: i0 });
6032
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: AMngTableviewRouteComponent, decorators: [{
6033
- type: Directive
6034
- }] });
6035
-
6036
- class MngTableviewRouteComponent extends AMngTableviewRouteComponent {
6037
- constructor(route) {
6038
- super();
6039
- this.route = route;
6040
- }
6041
- createTableviewDescriptor() {
6042
- if (!this.route.snapshot.data['tableviewData'].descriptor) {
6043
- throw Error('Tableview requires a descriptor.');
6044
- }
6045
- return this.route.snapshot.data['tableviewData'].descriptor;
6046
- }
6047
- createTableviewDataProvider() {
6048
- if (!this.route.snapshot.data['tableviewData'].dataProvider) {
6049
- throw Error('Tableview requires a data provider.');
6050
- }
6051
- return this.route.snapshot.data['tableviewData'].dataProvider;
6052
- }
6053
- createActionDescriptors() {
6054
- var _a;
6055
- return (_a = this.route.snapshot.data['tableviewData'].actions) !== null && _a !== void 0 ? _a : super.createActionDescriptors();
6056
- }
6057
- }
6058
- MngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, deps: [{ token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
6059
- 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"] }] });
6060
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, decorators: [{
6061
- type: Component,
6062
- 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" }]
6063
- }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }]; } });
6064
-
6065
6710
  function mngCommonsInitializerProvider(mngCommons) {
6066
6711
  return () => mngCommons.initialize();
6067
6712
  }
@@ -6171,6 +6816,11 @@ const formlyTypesConfig = [
6171
6816
  component: MngFormlyFieldAutocompleteComponent,
6172
6817
  wrappers: ['field']
6173
6818
  },
6819
+ {
6820
+ name: 'dialog',
6821
+ component: MngFormlyFieldLookupDialogComponent,
6822
+ wrappers: ['field']
6823
+ },
6174
6824
  {
6175
6825
  name: 'table-dialog-multiselect',
6176
6826
  component: MngFormlyFieldTableDialogMultiselectComponent,
@@ -6336,6 +6986,7 @@ const declarations = [
6336
6986
  MngFormlyFieldInputComponent,
6337
6987
  MngFormlyFieldDropdownComponent,
6338
6988
  MngFormlyFieldAutocompleteComponent,
6989
+ MngFormlyFieldLookupDialogComponent,
6339
6990
  MngFormlyFieldTableDialogMultiselectComponent,
6340
6991
  MngFormlyFieldTableDialogFormComponent,
6341
6992
  MngFormlyFieldTabsComponent,
@@ -6349,7 +7000,7 @@ const declarations = [
6349
7000
  // editor components
6350
7001
  MngFormEditorComponent,
6351
7002
  MngActionComponent,
6352
- MngActionDialogComponent,
7003
+ MngActionEditorComponent,
6353
7004
  MngActionRouteComponent
6354
7005
  ];
6355
7006
  class MngCommonsModule {
@@ -6361,12 +7012,12 @@ class MngCommonsModule {
6361
7012
  DialogService,
6362
7013
  MessageService,
6363
7014
  ConfirmationService,
6364
- MngActionService,
7015
+ MngActionExecutorService,
6365
7016
  MngNavigationService,
6366
7017
  MngCommonsService,
6367
7018
  // component service
6368
7019
  MngMainLayoutComponentService,
6369
- TableviewComponentService,
7020
+ MngViewContainerComponentService,
6370
7021
  {
6371
7022
  provide: MNG_MODULE_CONFIG_IT,
6372
7023
  useValue: config
@@ -6397,6 +7048,10 @@ class MngCommonsModule {
6397
7048
  multi: true,
6398
7049
  useFactory: mngFormlyConfigProvider,
6399
7050
  deps: [TranslateService, MNG_MODULE_CONFIG_IT]
7051
+ },
7052
+ {
7053
+ provide: ACTION_EDITOR_DIALOG_COMPONENT_SETTING,
7054
+ useValue: MngActionEditorComponent
6400
7055
  }
6401
7056
  ]
6402
7057
  };
@@ -6429,6 +7084,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
6429
7084
  MngFormlyFieldInputComponent,
6430
7085
  MngFormlyFieldDropdownComponent,
6431
7086
  MngFormlyFieldAutocompleteComponent,
7087
+ MngFormlyFieldLookupDialogComponent,
6432
7088
  MngFormlyFieldTableDialogMultiselectComponent,
6433
7089
  MngFormlyFieldTableDialogFormComponent,
6434
7090
  MngFormlyFieldTabsComponent,
@@ -6442,14 +7098,14 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
6442
7098
  // editor components
6443
7099
  MngFormEditorComponent,
6444
7100
  MngActionComponent,
6445
- MngActionDialogComponent,
7101
+ MngActionEditorComponent,
6446
7102
  MngActionRouteComponent
6447
7103
  ], imports: [
6448
7104
  // angular modules
6449
7105
  CommonModule,
6450
7106
  RouterModule,
6451
7107
  HttpClientModule,
6452
- ReactiveFormsModule, i2$2.TranslateModule, i3.FormlyModule, AutoCompleteModule,
7108
+ ReactiveFormsModule, i3$1.TranslateModule, i3$2.FormlyModule, AutoCompleteModule,
6453
7109
  BreadcrumbModule,
6454
7110
  ButtonModule,
6455
7111
  CalendarModule,
@@ -6542,6 +7198,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
6542
7198
  MngFormlyFieldInputComponent,
6543
7199
  MngFormlyFieldDropdownComponent,
6544
7200
  MngFormlyFieldAutocompleteComponent,
7201
+ MngFormlyFieldLookupDialogComponent,
6545
7202
  MngFormlyFieldTableDialogMultiselectComponent,
6546
7203
  MngFormlyFieldTableDialogFormComponent,
6547
7204
  MngFormlyFieldTabsComponent,
@@ -6555,7 +7212,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
6555
7212
  // editor components
6556
7213
  MngFormEditorComponent,
6557
7214
  MngActionComponent,
6558
- MngActionDialogComponent,
7215
+ MngActionEditorComponent,
6559
7216
  MngActionRouteComponent] });
6560
7217
  MngCommonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsModule, imports: [[
6561
7218
  // angular modules
@@ -6631,54 +7288,59 @@ class AMngCrudApiService {
6631
7288
  this.http = http;
6632
7289
  this.objectSerializer = ObjectSerializer.get();
6633
7290
  }
6634
- createPost(item) {
7291
+ createPost(item, params) {
6635
7292
  const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getCreatePostPath()}`;
6636
7293
  return this.http
6637
7294
  .post(url, this.objectSerializer.serializeClass(item, this.type), {
6638
7295
  withCredentials: true,
6639
7296
  observe: 'body',
6640
- reportProgress: false
7297
+ reportProgress: false,
7298
+ params: params
6641
7299
  })
6642
7300
  .pipe(map(res => this.objectSerializer.deserializeClass(res, this.type)));
6643
7301
  }
6644
- getAllPost(queryParam) {
7302
+ getAllPost(queryParamBody, params) {
6645
7303
  const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getGetAllPostPath()}`;
6646
7304
  return this.http
6647
- .post(url, this.objectSerializer.serialize(queryParam, 'QueryParam'), {
7305
+ .post(url, this.objectSerializer.serialize(queryParamBody, 'QueryParam'), {
6648
7306
  withCredentials: true,
6649
7307
  observe: 'body',
6650
- reportProgress: false
7308
+ reportProgress: false,
7309
+ params: params
6651
7310
  })
6652
7311
  .pipe(map(res => this.objectSerializer.deserializeClass(res, this.queryResultType)));
6653
7312
  }
6654
- getByIdGet(id) {
7313
+ getByIdGet(id, params) {
6655
7314
  const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getGetByIdGetPath(id)}`;
6656
7315
  return this.http
6657
7316
  .get(url, {
6658
7317
  withCredentials: true,
6659
7318
  observe: 'body',
6660
- reportProgress: false
7319
+ reportProgress: false,
7320
+ params: params
6661
7321
  })
6662
7322
  .pipe(map(res => this.objectSerializer.deserializeClass(res, this.type)));
6663
7323
  }
6664
- updatePut(id, item) {
7324
+ updatePut(id, item, params) {
6665
7325
  const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getUpdatePutPath(id, item)}`;
6666
7326
  return this.http
6667
7327
  .put(url, this.objectSerializer.serializeClass(item, this.type), {
6668
7328
  withCredentials: true,
6669
7329
  observe: 'body',
6670
- reportProgress: false
7330
+ reportProgress: false,
7331
+ params: params
6671
7332
  })
6672
7333
  .pipe(map(res => this.objectSerializer.deserializeClass(res, this.type)));
6673
7334
  }
6674
- removeDelete(id, item) {
7335
+ removeDelete(id, item, params) {
6675
7336
  const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getRemoveDeletePath(id, item)}`;
6676
7337
  return this.http
6677
7338
  .request('delete', url, {
6678
7339
  withCredentials: true,
6679
7340
  observe: 'body',
6680
7341
  reportProgress: false,
6681
- body: this.objectSerializer.serializeClass(item, this.type)
7342
+ body: item ? this.objectSerializer.serializeClass(item, this.type) : undefined,
7343
+ params: params
6682
7344
  })
6683
7345
  .pipe(map(res => this.objectSerializer.deserializeClass(res, this.type)));
6684
7346
  }
@@ -6729,12 +7391,30 @@ class RoutesBuilder {
6729
7391
  constructor(layoutRoute) {
6730
7392
  this.routes = [];
6731
7393
  this.layoutRoute = layoutRoute === null || layoutRoute === void 0 ? void 0 : layoutRoute.withRoot(this);
7394
+ this.currentRoute = layoutRoute;
6732
7395
  }
6733
7396
  static create() {
6734
7397
  return new RoutesBuilder();
6735
7398
  }
6736
- static createWithLayout(layoutComponent = MngMainLayoutComponent) {
6737
- const routesBuilder = new RoutesBuilder(RouteBuilder.create('', layoutComponent));
7399
+ static createWithLayout(layoutComponent = MngMainLayoutComponent, topbarComponent, breadcrumbComponent, menuComponent, footerComponent) {
7400
+ const layoutRoute = RouteBuilder.create('', layoutComponent);
7401
+ if (topbarComponent || breadcrumbComponent || menuComponent || footerComponent) {
7402
+ const dataBuilder = RouteDataBuilder.create();
7403
+ if (topbarComponent) {
7404
+ dataBuilder.withTopbarComponent(topbarComponent);
7405
+ }
7406
+ if (breadcrumbComponent) {
7407
+ dataBuilder.withBreadcrumbComponent(breadcrumbComponent);
7408
+ }
7409
+ if (menuComponent) {
7410
+ dataBuilder.withMenuComponent(menuComponent);
7411
+ }
7412
+ if (footerComponent) {
7413
+ dataBuilder.withFooterComponent(footerComponent);
7414
+ }
7415
+ layoutRoute.withDataBuilder(dataBuilder);
7416
+ }
7417
+ const routesBuilder = new RoutesBuilder(layoutRoute);
6738
7418
  return routesBuilder;
6739
7419
  }
6740
7420
  addAngularRoute(route) {
@@ -6824,15 +7504,9 @@ class RouteBuilder {
6824
7504
  static createFromRoute(route) {
6825
7505
  return new RouteBuilder(route);
6826
7506
  }
6827
- static createTableviewRoutes(path, descriptor, tableviewDataProvider, actions, hasDetails = true, hasEdit = true, hasAdd = true) {
7507
+ static createTableviewRoutes(path, descriptor, dataProvider, actions, hasDetails = true, hasEdit = true, hasAdd = true) {
6828
7508
  const tableviewRoute = RouteBuilder.createFromRoute({
6829
- data: {
6830
- tableviewData: {
6831
- descriptor: descriptor,
6832
- dataProvider: tableviewDataProvider,
6833
- actions: actions
6834
- }
6835
- },
7509
+ data: RouteDataBuilder.create().withTableview(descriptor, dataProvider, actions).build(),
6836
7510
  path: path,
6837
7511
  component: MngTableviewRouteComponent
6838
7512
  });
@@ -6914,6 +7588,10 @@ class RouteBuilder {
6914
7588
  this.route.data = data;
6915
7589
  return this;
6916
7590
  }
7591
+ withDataBuilder(dataBuilder) {
7592
+ this.route.data = dataBuilder.build();
7593
+ return this;
7594
+ }
6917
7595
  withMngMenuItem(menuItem) {
6918
7596
  this.menuItem = menuItem;
6919
7597
  return this;
@@ -7084,6 +7762,54 @@ class RouteBuilder {
7084
7762
  return guards;
7085
7763
  }
7086
7764
  }
7765
+ class RouteDataBuilder {
7766
+ constructor(init) {
7767
+ this.data = init !== null && init !== void 0 ? init : {};
7768
+ if (!this.data.breadcrumb) {
7769
+ this.data.breadcrumb = null;
7770
+ }
7771
+ }
7772
+ static create(data) {
7773
+ return new RouteDataBuilder(data);
7774
+ }
7775
+ withBreadcrumb(breadcrumb) {
7776
+ this.data.breadcrumb = breadcrumb;
7777
+ return this;
7778
+ }
7779
+ withPageTitle(pageTitle) {
7780
+ this.data.pageTitle = pageTitle;
7781
+ return this;
7782
+ }
7783
+ withTableview(descriptor, dataProvider, actions) {
7784
+ this.data.tableview = {
7785
+ descriptor: descriptor,
7786
+ dataProvider: dataProvider
7787
+ };
7788
+ if (actions) {
7789
+ this.data.tableview.actions = actions;
7790
+ }
7791
+ return this;
7792
+ }
7793
+ withTopbarComponent(component) {
7794
+ this.data.topbarComponent = component;
7795
+ return this;
7796
+ }
7797
+ withBreadcrumbComponent(component) {
7798
+ this.data.breadcrumbComponent = component;
7799
+ return this;
7800
+ }
7801
+ withMenuComponent(component) {
7802
+ this.data.menuComponent = component;
7803
+ return this;
7804
+ }
7805
+ withFooterComponent(component) {
7806
+ this.data.footerComponent = component;
7807
+ return this;
7808
+ }
7809
+ build() {
7810
+ return this.data;
7811
+ }
7812
+ }
7087
7813
 
7088
7814
  /*
7089
7815
  * Public API Surface of mng-commons
@@ -7093,5 +7819,5 @@ class RouteBuilder {
7093
7819
  * Generated bundle index. Do not edit.
7094
7820
  */
7095
7821
 
7096
- export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngCrudApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtil, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusQueryResultBase, MediusQueryResultWithObject, MediusRestUtil, MngActionComponent, MngActionDialogComponent, MngActionRouteComponent, MngActionService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngPropertyPathPipe, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, ModelDescriptor, ModelUtil, ObjectSerializer, RouteBuilder, RoutesBuilder, TableDescriptor, TableviewComponentService, TableviewDataProvider, TableviewDescriptor, ToastUtil, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngCommonsInitializerProvider, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
7822
+ 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, 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, 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, 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 };
7097
7823
  //# sourceMappingURL=mediusinc-mng-commons.mjs.map