@mediusinc/mng-commons 0.2.17 → 0.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/assets/i18n/en.json +7 -5
  2. package/assets/i18n/sl.json +23 -21
  3. package/esm2020/lib/api/services/crud-api.abstract.service.mjs +22 -17
  4. package/esm2020/lib/components/action/action.component.mjs +50 -23
  5. package/esm2020/lib/components/action/editor/action-editor.component.mjs +239 -0
  6. package/esm2020/lib/components/action/index.mjs +2 -2
  7. package/esm2020/lib/components/action/models/action-execution.model.mjs +3 -3
  8. package/esm2020/lib/components/action/route/action-route.component.mjs +19 -38
  9. package/esm2020/lib/components/form/autocomplete/autocomplete.component.mjs +9 -6
  10. package/esm2020/lib/components/form/editor/form-editor.component.mjs +56 -4
  11. package/esm2020/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +3 -3
  12. package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +3 -3
  13. package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
  14. package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +179 -0
  15. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +28 -9
  16. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +12 -9
  17. package/esm2020/lib/components/form/formly/fields/index.mjs +2 -1
  18. package/esm2020/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +3 -3
  19. package/esm2020/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.mjs +4 -3
  20. package/esm2020/lib/components/form/models/form-editor.event.mjs +28 -1
  21. package/esm2020/lib/components/layout/main-layout.component.mjs +1 -1
  22. package/esm2020/lib/components/layout/topbar.component.mjs +1 -1
  23. package/esm2020/lib/components/tableview/table/table.component.mjs +37 -12
  24. package/esm2020/lib/components/tableview/tableview.component.mjs +28 -21
  25. package/esm2020/lib/config/formly.config.mjs +7 -2
  26. package/esm2020/lib/config/models/mng-config.model.mjs +1 -1
  27. package/esm2020/lib/data-providers/table.data-provider.mjs +17 -2
  28. package/esm2020/lib/descriptors/action.descriptor.mjs +146 -2
  29. package/esm2020/lib/descriptors/editor.descriptor.interface.mjs +2 -0
  30. package/esm2020/lib/descriptors/editor.descriptor.mjs +122 -27
  31. package/esm2020/lib/directives/component.directive.mjs +8 -3
  32. package/esm2020/lib/mng-commons.module.mjs +21 -11
  33. package/esm2020/lib/models/error.model.mjs +2 -0
  34. package/esm2020/lib/models/index.mjs +3 -1
  35. package/esm2020/lib/models/view-container.model.mjs +2 -0
  36. package/esm2020/lib/services/action-executor.service.mjs +343 -0
  37. package/esm2020/lib/services/error-mapper.service.mjs +14 -0
  38. package/esm2020/lib/services/index.mjs +4 -2
  39. package/esm2020/lib/services/tokens/default-setting.token.mjs +3 -0
  40. package/esm2020/lib/services/tokens/index.mjs +2 -1
  41. package/esm2020/lib/services/view-container.component.service.mjs +35 -0
  42. package/esm2020/lib/utils/editor-formly.util.mjs +14 -3
  43. package/esm2020/lib/utils/i18n.util.mjs +29 -1
  44. package/esm2020/lib/utils/toast.util.mjs +18 -14
  45. package/esm2020/public-api.mjs +1 -2
  46. package/fesm2015/mediusinc-mng-commons.mjs +1818 -994
  47. package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
  48. package/fesm2020/mediusinc-mng-commons.mjs +1805 -998
  49. package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
  50. package/lib/api/services/crud-api.abstract.service.d.ts +9 -8
  51. package/lib/components/action/action.component.d.ts +16 -9
  52. package/lib/components/action/editor/action-editor.component.d.ts +59 -0
  53. package/lib/components/action/index.d.ts +1 -1
  54. package/lib/components/action/models/action-execution.model.d.ts +3 -3
  55. package/lib/components/action/route/action-route.component.d.ts +5 -6
  56. package/lib/components/form/editor/form-editor.component.d.ts +7 -2
  57. package/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +45 -0
  58. package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +2 -0
  59. package/lib/components/form/formly/fields/index.d.ts +1 -0
  60. package/lib/components/form/models/form-editor.event.d.ts +32 -0
  61. package/lib/components/tableview/table/table.component.d.ts +14 -6
  62. package/lib/components/tableview/tableview.component.d.ts +9 -7
  63. package/lib/data-providers/table.data-provider.d.ts +9 -1
  64. package/lib/descriptors/action.descriptor.d.ts +71 -16
  65. package/lib/descriptors/editor.descriptor.d.ts +59 -18
  66. package/lib/descriptors/editor.descriptor.interface.d.ts +9 -0
  67. package/lib/directives/component.directive.d.ts +5 -4
  68. package/lib/mng-commons.module.d.ts +55 -54
  69. package/lib/models/error.model.d.ts +12 -0
  70. package/lib/models/index.d.ts +2 -0
  71. package/lib/models/view-container.model.d.ts +6 -0
  72. package/lib/services/{action.service.d.ts → action-executor.service.d.ts} +25 -18
  73. package/lib/services/error-mapper.service.d.ts +7 -0
  74. package/lib/services/index.d.ts +3 -1
  75. package/lib/services/tokens/default-setting.token.d.ts +2 -0
  76. package/lib/services/tokens/index.d.ts +1 -0
  77. package/lib/services/view-container.component.service.d.ts +22 -0
  78. package/lib/utils/i18n.util.d.ts +3 -0
  79. package/lib/utils/toast.util.d.ts +5 -4
  80. package/package.json +1 -1
  81. package/public-api.d.ts +0 -1
  82. package/scss/mng-overrides/_layout_forms.scss +2 -0
  83. package/scss/mng-overrides/_mixins.scss +7 -0
  84. package/scss/mng-overrides/_theme_button.scss +57 -0
  85. package/scss/mng-overrides/_theme_dropdown.scss +17 -0
  86. package/scss/mng-overrides/_theme_styles.scss +2 -0
  87. package/scss/mng-overrides/_theme_toolbar.scss +5 -0
  88. package/scss/theme/default/_mng-variables-theme-dark.scss +3 -0
  89. package/scss/theme/default/_mng-variables-theme-light.scss +3 -0
  90. package/esm2020/lib/components/action/dialog/action-dialog.component.mjs +0 -151
  91. package/esm2020/lib/components/tableview/services/index.mjs +0 -2
  92. package/esm2020/lib/components/tableview/services/tableview.component.service.mjs +0 -21
  93. package/esm2020/lib/services/action.service.mjs +0 -273
  94. package/lib/components/action/dialog/action-dialog.component.d.ts +0 -47
  95. package/lib/components/tableview/services/index.d.ts +0 -1
  96. package/lib/components/tableview/services/tableview.component.service.d.ts +0 -14
@@ -1,484 +1,145 @@
1
- import * as i4$1 from '@angular/common';
1
+ import * as i4 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
- import { HttpClient, HttpClientModule } from '@angular/common/http';
3
+ import { HttpErrorResponse, HttpClient, HttpClientModule } from '@angular/common/http';
4
4
  import * as i0 from '@angular/core';
5
- import { Injectable, InjectionToken, Inject, Component, ChangeDetectionStrategy, Input, Directive, EventEmitter, Output, ContentChildren, ViewChild, forwardRef, Pipe, Optional, ViewChildren, HostListener, APP_INITIALIZER, NgModule } from '@angular/core';
6
- import * as i2$3 from '@angular/forms';
7
- import { Validators, FormGroup, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
5
+ import { InjectionToken, Injectable, Inject, EventEmitter, Component, ChangeDetectionStrategy, Optional, Input, Output, Directive, ContentChildren, ViewChild, forwardRef, Pipe, ViewChildren, HostListener, APP_INITIALIZER, NgModule } from '@angular/core';
6
+ import * as i4$2 from '@angular/forms';
7
+ import { Validators, FormGroup, FormArray, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
8
8
  import * as i1 from '@angular/router';
9
9
  import { NavigationEnd, GuardsCheckEnd, RouterModule } from '@angular/router';
10
- import * as i3 from '@ngx-formly/core';
10
+ import * as i3$2 from '@ngx-formly/core';
11
11
  import { FieldType, FieldWrapper, FORMLY_CONFIG, FormlyModule } from '@ngx-formly/core';
12
- import * as i2$2 from '@ngx-translate/core';
12
+ import * as i3$1 from '@ngx-translate/core';
13
13
  import { TranslateService, TranslateModule } from '@ngx-translate/core';
14
- import * as i2$1 from 'primeng/api';
15
- import { MessageService, ConfirmationService, FilterMatchMode } from 'primeng/api';
14
+ import * as i2 from 'primeng/api';
15
+ import { ConfirmationService, MessageService, FilterMatchMode } from 'primeng/api';
16
16
  import * as i1$1 from 'primeng/autocomplete';
17
17
  import { AutoComplete, AutoCompleteModule } from 'primeng/autocomplete';
18
- import * as i2$7 from 'primeng/breadcrumb';
18
+ import * as i2$3 from 'primeng/breadcrumb';
19
19
  import { BreadcrumbModule } from 'primeng/breadcrumb';
20
- import * as i8 from 'primeng/button';
20
+ import * as i7 from 'primeng/button';
21
21
  import { ButtonModule } from 'primeng/button';
22
- import * as i5 from 'primeng/calendar';
22
+ import * as i5$1 from 'primeng/calendar';
23
23
  import { CalendarModule } from 'primeng/calendar';
24
24
  import { CardModule } from 'primeng/card';
25
25
  import { CheckboxModule } from 'primeng/checkbox';
26
26
  import { ChipModule } from 'primeng/chip';
27
- import * as i6 from 'primeng/confirmdialog';
27
+ import * as i5 from 'primeng/confirmdialog';
28
28
  import { ConfirmDialogModule } from 'primeng/confirmdialog';
29
29
  import { ConfirmPopupModule } from 'primeng/confirmpopup';
30
- import * as i2$6 from 'primeng/dialog';
30
+ import * as i1$4 from 'primeng/dialog';
31
31
  import { DialogModule } from 'primeng/dialog';
32
32
  import * as i1$2 from 'primeng/dropdown';
33
33
  import { Dropdown, DropdownModule } from 'primeng/dropdown';
34
- import * as i2 from 'primeng/dynamicdialog';
34
+ import * as i3 from 'primeng/dynamicdialog';
35
35
  import { DynamicDialogModule, DialogService } from 'primeng/dynamicdialog';
36
- import * as i1$5 from 'primeng/fieldset';
36
+ import * as i1$6 from 'primeng/fieldset';
37
37
  import { FieldsetModule } from 'primeng/fieldset';
38
38
  import { FileUploadModule } from 'primeng/fileupload';
39
39
  import * as i6$1 from 'primeng/inputmask';
40
40
  import { InputMaskModule } from 'primeng/inputmask';
41
41
  import * as i1$3 from 'primeng/inputnumber';
42
42
  import { InputNumberModule } from 'primeng/inputnumber';
43
- import * as i2$5 from 'primeng/inputswitch';
43
+ import * as i2$2 from 'primeng/inputswitch';
44
44
  import { InputSwitchModule } from 'primeng/inputswitch';
45
- import * as i10$1 from 'primeng/inputtext';
45
+ import * as i10 from 'primeng/inputtext';
46
46
  import { InputTextModule } from 'primeng/inputtext';
47
47
  import * as i9$1 from 'primeng/inputtextarea';
48
48
  import { InputTextareaModule } from 'primeng/inputtextarea';
49
- import * as i3$1 from 'primeng/messages';
49
+ import * as i3$3 from 'primeng/messages';
50
50
  import { MessagesModule } from 'primeng/messages';
51
- import * as i2$4 from 'primeng/multiselect';
51
+ import * as i2$1 from 'primeng/multiselect';
52
52
  import { MultiSelectModule } from 'primeng/multiselect';
53
53
  import { PaginatorModule } from 'primeng/paginator';
54
- import * as i4$2 from 'primeng/progressspinner';
54
+ import * as i6 from 'primeng/progressspinner';
55
55
  import { ProgressSpinnerModule } from 'primeng/progressspinner';
56
- import * as i4$3 from 'primeng/radiobutton';
56
+ import * as i4$4 from 'primeng/radiobutton';
57
57
  import { RadioButtonModule } from 'primeng/radiobutton';
58
- import * as i9 from 'primeng/ripple';
58
+ import * as i8 from 'primeng/ripple';
59
59
  import { RippleModule } from 'primeng/ripple';
60
60
  import { SelectButtonModule } from 'primeng/selectbutton';
61
- import * as i7 from 'primeng/skeleton';
61
+ import * as i7$1 from 'primeng/skeleton';
62
62
  import { SkeletonModule } from 'primeng/skeleton';
63
- import * as i4$4 from 'primeng/table';
63
+ import * as i4$5 from 'primeng/table';
64
64
  import { Table, TableModule } from 'primeng/table';
65
- import * as i1$4 from 'primeng/tabview';
65
+ import * as i1$5 from 'primeng/tabview';
66
66
  import { TabViewModule } from 'primeng/tabview';
67
67
  import { TagModule } from 'primeng/tag';
68
- import * as i7$1 from 'primeng/toast';
68
+ import * as i6$2 from 'primeng/toast';
69
69
  import { ToastModule } from 'primeng/toast';
70
70
  import { ToggleButtonModule } from 'primeng/togglebutton';
71
- import * as i8$1 from 'primeng/toolbar';
71
+ import * as i4$3 from 'primeng/toolbar';
72
72
  import { ToolbarModule } from 'primeng/toolbar';
73
- import * as i10 from 'primeng/tooltip';
73
+ import * as i9 from 'primeng/tooltip';
74
74
  import { TooltipModule } from 'primeng/tooltip';
75
- import { of, throwError, Observable, from, BehaviorSubject, Subject, ReplaySubject, distinctUntilChanged, combineLatest } from 'rxjs';
75
+ import { throwError, of, Subject, Observable, from, BehaviorSubject, ReplaySubject, distinctUntilChanged, combineLatest } from 'rxjs';
76
76
  import 'reflect-metadata';
77
77
  import { mergeMap, map, first, catchError, filter, finalize, startWith } from 'rxjs/operators';
78
- import * as i4 from '@angular/platform-browser';
78
+ import * as i4$1 from '@angular/platform-browser';
79
79
  import { trigger, state, style, transition, animate } from '@angular/animations';
80
80
 
81
- class ActionDescriptor {
82
- constructor(model, actionName, parentType, parentProperty) {
83
- this._type = ActionTypeEnum.Direct;
84
- this._activationTrigger = ActionActivationTriggerEnum.OnClick;
85
- this._position = ActionPositionEnum.ToolbarRight;
86
- this._level = ActionLevelEnum.Default;
87
- this._routeUrl = null;
88
- this._className = '';
89
- this._hasRunConfirmation = false;
90
- this._hasRunNotificationSuccess = true;
91
- this._hasRunNotificationError = true;
92
- this._model = model;
93
- this._actionName = actionName;
94
- if ((parentType && !parentProperty) || (!parentProperty && parentProperty)) {
95
- throw new Error(`Provide both the parent type and parent property or none: ${parentType}, ${parentProperty}.`);
96
- }
97
- this._parentType = parentType;
98
- this._parentTypeName = parentType ? TypeUtil.findTypeName(parentType) : undefined;
99
- this._parentProperty = parentProperty;
100
- this._i18nModelActionBaseKey = this._parentTypeName
101
- ? `${this._parentTypeName}.actions.${this._parentProperty}_${actionName}`
102
- : `${this._model.typeName}.actions.${actionName}`;
103
- }
104
- get model() {
105
- return this._model;
106
- }
107
- get parentTypeName() {
108
- return this._parentTypeName;
109
- }
110
- get parentProperty() {
111
- return this._parentProperty;
112
- }
113
- get i18nModelActionBaseKey() {
114
- return this._i18nModelActionBaseKey;
115
- }
116
- get type() {
117
- return this._type;
118
- }
119
- get activationTrigger() {
120
- return this._activationTrigger;
121
- }
122
- get position() {
123
- return this._position;
124
- }
125
- get level() {
126
- return this._level;
127
- }
128
- get routeUrl() {
129
- return this._routeUrl;
130
- }
131
- get title() {
132
- return this._title;
133
- }
134
- get icon() {
135
- return this._icon;
136
- }
137
- get tooltip() {
138
- return this._tooltip;
139
- }
140
- get runFunction() {
141
- if (!this._runFunction) {
142
- throw new Error('Run function is not defined and cannot be invoked');
143
- }
144
- return this._runFunction;
145
- }
146
- get isVisibleFunction() {
147
- return this._isVisibleFunction;
148
- }
149
- get isEnabledFunction() {
150
- return this._isEnabledFunction;
151
- }
152
- get actionName() {
153
- return this._actionName;
154
- }
155
- get className() {
156
- return this._className;
157
- }
158
- get hasRunConfirmation() {
159
- return this._hasRunConfirmation;
160
- }
161
- get runConfirmationIcon() {
162
- return this._runConfirmationIcon;
163
- }
164
- get runConfirmationTitle() {
165
- return this._runConfirmationTitle;
166
- }
167
- get runConfirmationMessage() {
168
- return this._runConfirmationMessage;
169
- }
170
- get runConfirmationAcceptTitle() {
171
- return this._runConfirmationAcceptTitle;
172
- }
173
- get runConfirmationRejectTitle() {
174
- return this._runConfirmationRejectTitle;
175
- }
176
- get hasRunNotificationSuccess() {
177
- return this._hasRunNotificationSuccess;
178
- }
179
- get runNotificationSuccessTitle() {
180
- return this._runNotificationSuccessTitle;
181
- }
182
- get runNotificationSuccessMessage() {
183
- return this._runNotificationSuccessMessage;
184
- }
185
- get hasRunNotificationError() {
186
- return this._hasRunNotificationError;
187
- }
188
- get runNotificationErrorTitle() {
189
- return this._runNotificationErrorTitle;
190
- }
191
- get runNotificationErrorMessage() {
192
- return this._runNotificationErrorMessage;
81
+ class DataProvider {
82
+ constructor(modelType, serviceType) {
83
+ this._modelType = modelType;
84
+ this._serviceType = serviceType;
193
85
  }
194
- withRunFunction(fn) {
195
- this._runFunction = fn;
196
- return this;
86
+ get serviceType() {
87
+ return this._serviceType;
197
88
  }
198
- withIsVisibleFunction(fn) {
199
- this._isVisibleFunction = fn;
200
- return this;
89
+ get modelType() {
90
+ return this._modelType;
201
91
  }
202
- withIsEnabledFunction(fn) {
203
- this._isEnabledFunction = fn;
92
+ withServiceType(type) {
93
+ this._serviceType = type;
204
94
  return this;
205
95
  }
206
- withRouteTrigger(routeUrl) {
207
- this._activationTrigger = ActionActivationTriggerEnum.OnRoute;
208
- this._routeUrl = routeUrl;
209
- return this;
96
+ }
97
+
98
+ class EditorDataProvider extends DataProvider {
99
+ constructor(modelType, serviceType) {
100
+ super(modelType, serviceType);
101
+ this._fetch = id => throwError(`No fetch function provided for id ${id}.`);
210
102
  }
211
- withLevel(level) {
212
- this._level = level;
213
- return this;
103
+ get fetch() {
104
+ return this._fetch;
214
105
  }
215
- /**
216
- * Overrides default title key with model action key (${model.typeName}.actions.${actionName}). Not relevant if parentType name is provided.
217
- */
218
- withModelTitle() {
219
- this._title = `${this._i18nModelActionBaseKey}.title`;
220
- return this;
106
+ get create() {
107
+ return this._create;
221
108
  }
222
- /**
223
- * Overrides default title key (${actionName}.title). If null, no title will be shown.
224
- * @param title Title i18n key or title.
225
- */
226
- withTitle(title) {
227
- this._title = title;
228
- return this;
109
+ get update() {
110
+ return this._update;
229
111
  }
230
- withIcon(icon) {
231
- this._icon = icon;
232
- return this;
112
+ get delete() {
113
+ return this._delete;
233
114
  }
234
- withTooltip(tooltip) {
235
- this._title = tooltip;
115
+ withFetch(fetch) {
116
+ this._fetch = fetch;
236
117
  return this;
237
118
  }
238
- withClassName(className) {
239
- this._className = className;
119
+ withCreate(create) {
120
+ this._create = create;
240
121
  return this;
241
122
  }
242
- withPosition(position) {
243
- this._position = position;
123
+ withUpdate(update) {
124
+ this._update = update;
244
125
  return this;
245
126
  }
246
- withRunConfirmation(icon = 'pi pi-exclamation-triangle', title, message, acceptTitle, rejectTitle) {
247
- this._hasRunConfirmation = true;
248
- this._runConfirmationIcon = icon;
249
- this._runConfirmationTitle = title;
250
- this._runConfirmationMessage = message;
251
- this._runConfirmationAcceptTitle = acceptTitle;
252
- this._runConfirmationRejectTitle = rejectTitle;
127
+ withDelete(deleteFn) {
128
+ this._delete = deleteFn;
253
129
  return this;
254
130
  }
255
- withRunNotificationSuccess(title, message, hasNotification = true) {
256
- this._hasRunNotificationSuccess = hasNotification;
257
- this._runNotificationSuccessTitle = title;
258
- this._runNotificationSuccessMessage = message;
259
- }
260
- withRunNotificationError(title, message, hasNotification = true) {
261
- this._hasRunNotificationError = hasNotification;
262
- this._runNotificationErrorTitle = title;
263
- this._runNotificationErrorMessage = message;
264
- }
265
131
  }
266
- class ActionEditorDescriptor extends ActionDescriptor {
267
- constructor(editorDescriptor, actionName, parentType, parentProperty) {
268
- super(editorDescriptor.model, actionName, parentType, parentProperty);
269
- this._editorTitle = undefined;
270
- this._hasFetchNotificationSuccess = false;
271
- this._type = ActionTypeEnum.Editor;
272
- this._editorDescriptor = editorDescriptor;
273
- }
274
- get editorTitle() {
275
- return this._editorTitle;
276
- }
277
- get editorDescriptor() {
278
- return this._editorDescriptor;
279
- }
280
- get hasFetchNotificationSuccess() {
281
- return this._hasFetchNotificationSuccess;
282
- }
283
- get fetchNotificationSuccessTitle() {
284
- return this._fetchNotificationSuccessTitle;
285
- }
286
- get fetchNotificationSuccessMessage() {
287
- return this._fetchNotificationSuccessMessage;
288
- }
289
- get runFunction() {
290
- throw new Error('Run function cannot be used in editor action. Use submit function instead!');
291
- }
292
- get fetchFunction() {
293
- if (!this._fetchFunction) {
294
- return ctx => {
295
- 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
  }
@@ -680,74 +341,604 @@ class MediusQueryParamBuilder {
680
341
  constructor(queryParam) {
681
342
  this.queryParam = queryParam;
682
343
  }
683
- static create(itemsPerPage = 50, itemsOffset = 0) {
684
- const queryParam = new MediusQueryParam();
685
- queryParam.itemsPerPage = itemsPerPage;
686
- queryParam.itemsOffset = itemsOffset;
687
- return new MediusQueryParamBuilder(queryParam);
344
+ static create(itemsPerPage = 50, itemsOffset = 0) {
345
+ const queryParam = new MediusQueryParam();
346
+ queryParam.itemsPerPage = itemsPerPage;
347
+ queryParam.itemsOffset = itemsOffset;
348
+ return new MediusQueryParamBuilder(queryParam);
349
+ }
350
+ withItemsPerPage(itemsPerPage) {
351
+ this.queryParam.itemsPerPage = itemsPerPage;
352
+ return this;
353
+ }
354
+ withItemsOffset(itemsOffset) {
355
+ this.queryParam.itemsOffset = itemsOffset;
356
+ return this;
357
+ }
358
+ withSort(property, asc = true) {
359
+ if (!this.queryParam.sortProperty || !this.queryParam.sortAsc) {
360
+ this.queryParam.sortProperty = [];
361
+ this.queryParam.sortAsc = [];
362
+ }
363
+ this.queryParam.sortProperty.push(property);
364
+ this.queryParam.sortAsc.push(asc);
365
+ return this;
366
+ }
367
+ withFilter(property, value, valueTo = undefined, matchType = MediusFilterMatchType.Contains, matchCaseSensitive = false) {
368
+ if (!this.queryParam.filterParams) {
369
+ this.queryParam.filterParams = [];
370
+ }
371
+ const filterParam = new MediusFilterParam();
372
+ filterParam.property = property;
373
+ filterParam.filterValue = value;
374
+ filterParam.filterValueTo = valueTo;
375
+ filterParam.filterMatchType = matchType;
376
+ filterParam.filterMatchCaseSensitive = matchCaseSensitive;
377
+ this.queryParam.filterParams.push(filterParam);
378
+ return this;
379
+ }
380
+ build() {
381
+ const queryParam = this.queryParam;
382
+ this.queryParam = new MediusQueryParam();
383
+ return queryParam;
384
+ }
385
+ }
386
+
387
+ /* tslint:disable:no-angle-bracket-type-assertion no-trailing-whitespace member-ordering object-literal-key-quotes */
388
+ const enumsMapBase = {
389
+ FilterMatchType: MediusFilterMatchType,
390
+ QueryMode: MediusQueryMode
391
+ };
392
+ const typeMapBase = {
393
+ FilterParam: MediusFilterParam,
394
+ QueryParam: MediusQueryParam,
395
+ QueryResult: MediusQueryResult,
396
+ QueryResultWithObject: MediusQueryResultWithObject
397
+ };
398
+
399
+ class TableDataProvider extends DataProvider {
400
+ constructor(modelType, serviceType) {
401
+ super(modelType, serviceType);
402
+ this._getAll = () => of(new MediusQueryResult());
403
+ }
404
+ get getAll() {
405
+ return this._getAll;
406
+ }
407
+ withGetAll(getAll) {
408
+ this._getAll = getAll;
409
+ return this;
410
+ }
411
+ }
412
+
413
+ class TableviewDataProvider extends EditorDataProvider {
414
+ constructor(modelType, serviceType) {
415
+ super(modelType, serviceType);
416
+ this._getAll = () => of(new MediusQueryResult());
417
+ }
418
+ get getAll() {
419
+ return this._getAll;
420
+ }
421
+ withGetAll(getAll) {
422
+ this._getAll = getAll;
423
+ return this;
424
+ }
425
+ }
426
+
427
+ class ActionDescriptor {
428
+ constructor(model, actionName, parentType, parentProperty) {
429
+ this._type = ActionTypeEnum.Direct;
430
+ this._activationTrigger = ActionActivationTriggerEnum.OnClick;
431
+ this._position = ActionPositionEnum.ToolbarRight;
432
+ this._level = ActionLevelEnum.Default;
433
+ this._routeUrl = null;
434
+ this._className = '';
435
+ this._size = ActionDescriptor.SizeEnum.Normal;
436
+ this._hasRunConfirmation = false;
437
+ this._hasRunNotificationSuccess = true;
438
+ this._hasRunNotificationError = true;
439
+ this._model = model;
440
+ this._actionName = actionName;
441
+ if ((parentType && !parentProperty) || (!parentProperty && parentProperty)) {
442
+ throw new Error(`Provide both the parent type and parent property or none: ${parentType}, ${parentProperty}.`);
443
+ }
444
+ this._parentType = parentType;
445
+ this._parentTypeName = parentType ? TypeUtil.findTypeName(parentType) : undefined;
446
+ this._parentProperty = parentProperty;
447
+ this._i18nModelActionBaseKey = this._parentTypeName
448
+ ? `${this._parentTypeName}.actions.${this._parentProperty}_${actionName}`
449
+ : `${this._model.typeName}.actions.${actionName}`;
450
+ }
451
+ get model() {
452
+ return this._model;
453
+ }
454
+ get parentTypeName() {
455
+ return this._parentTypeName;
456
+ }
457
+ get parentProperty() {
458
+ return this._parentProperty;
459
+ }
460
+ get i18nModelActionBaseKey() {
461
+ return this._i18nModelActionBaseKey;
462
+ }
463
+ get type() {
464
+ return this._type;
465
+ }
466
+ get activationTrigger() {
467
+ return this._activationTrigger;
468
+ }
469
+ get position() {
470
+ return this._position;
471
+ }
472
+ get level() {
473
+ return this._level;
474
+ }
475
+ get routeUrl() {
476
+ return this._routeUrl;
477
+ }
478
+ get title() {
479
+ return this._title;
480
+ }
481
+ get icon() {
482
+ return this._icon;
483
+ }
484
+ get tooltip() {
485
+ return this._tooltip;
486
+ }
487
+ get dataProvider() {
488
+ return this._dataProvider;
489
+ }
490
+ get hasRunFunction() {
491
+ return typeof this._runFunction === 'function';
492
+ }
493
+ get runFunction() {
494
+ if (!this._runFunction) {
495
+ throw new Error('Run function is not defined and cannot be invoked');
496
+ }
497
+ return this._runFunction;
498
+ }
499
+ get isVisibleFunction() {
500
+ return this._isVisibleFunction;
501
+ }
502
+ get isEnabledFunction() {
503
+ return this._isEnabledFunction;
504
+ }
505
+ get actionName() {
506
+ return this._actionName;
507
+ }
508
+ get className() {
509
+ return this._className;
510
+ }
511
+ get size() {
512
+ return this._size;
513
+ }
514
+ get isSizeExtraSmall() {
515
+ return this._size === ActionDescriptor.SizeEnum.ExtraSmall;
516
+ }
517
+ get isSizeSmall() {
518
+ return this._size === ActionDescriptor.SizeEnum.Small;
519
+ }
520
+ get isSizeLarge() {
521
+ return this._size === ActionDescriptor.SizeEnum.Large;
522
+ }
523
+ get isSizeExtraLarge() {
524
+ return this._size === ActionDescriptor.SizeEnum.ExtraLarge;
525
+ }
526
+ get hasRunConfirmation() {
527
+ return this._hasRunConfirmation;
528
+ }
529
+ get runConfirmationIcon() {
530
+ return this._runConfirmationIcon;
531
+ }
532
+ get runConfirmationTitle() {
533
+ return this._runConfirmationTitle;
534
+ }
535
+ get runConfirmationMessage() {
536
+ return this._runConfirmationMessage;
537
+ }
538
+ get runConfirmationAcceptTitle() {
539
+ return this._runConfirmationAcceptTitle;
540
+ }
541
+ get runConfirmationRejectTitle() {
542
+ return this._runConfirmationRejectTitle;
543
+ }
544
+ get hasRunNotificationSuccess() {
545
+ return this._hasRunNotificationSuccess;
546
+ }
547
+ get runNotificationSuccessTitle() {
548
+ return this._runNotificationSuccessTitle;
549
+ }
550
+ get runNotificationSuccessMessage() {
551
+ return this._runNotificationSuccessMessage;
552
+ }
553
+ get hasRunNotificationError() {
554
+ return this._hasRunNotificationError;
555
+ }
556
+ get runNotificationErrorTitle() {
557
+ return this._runNotificationErrorTitle;
558
+ }
559
+ get runNotificationErrorMessage() {
560
+ return this._runNotificationErrorMessage;
561
+ }
562
+ withDataProvider(dataProvider) {
563
+ this._dataProvider = dataProvider;
564
+ return this;
565
+ }
566
+ withServiceType(serviceType) {
567
+ this._dataProvider = new DataProvider(this._model.type, serviceType);
568
+ return this;
569
+ }
570
+ withRunFunction(fn) {
571
+ this._runFunction = fn;
572
+ return this;
573
+ }
574
+ withIsVisibleFunction(fn) {
575
+ this._isVisibleFunction = fn;
576
+ return this;
577
+ }
578
+ withIsEnabledFunction(fn) {
579
+ this._isEnabledFunction = fn;
580
+ return this;
581
+ }
582
+ withRouteTrigger(routeUrl) {
583
+ this._activationTrigger = ActionActivationTriggerEnum.OnRoute;
584
+ this._routeUrl = routeUrl;
585
+ return this;
586
+ }
587
+ withLevel(level) {
588
+ this._level = level;
589
+ return this;
590
+ }
591
+ /**
592
+ * Overrides default title key with model action key (${model.typeName}.actions.${actionName}). Not relevant if parentType name is provided.
593
+ */
594
+ withModelTitle() {
595
+ this._title = `${this._i18nModelActionBaseKey}.title`;
596
+ return this;
597
+ }
598
+ /**
599
+ * Overrides default title key (${actionName}.title). If null, no title will be shown.
600
+ * @param title Title i18n key or title.
601
+ */
602
+ withTitle(title) {
603
+ this._title = title;
604
+ return this;
605
+ }
606
+ withIcon(icon) {
607
+ this._icon = icon;
608
+ return this;
609
+ }
610
+ withTooltip(tooltip) {
611
+ this._title = tooltip;
612
+ return this;
613
+ }
614
+ withClassName(className) {
615
+ this._className = className;
616
+ return this;
617
+ }
618
+ withSize(size = ActionDescriptor.SizeEnum.Normal) {
619
+ this._size = size;
620
+ return this;
621
+ }
622
+ withPosition(position) {
623
+ this._position = position;
624
+ return this;
625
+ }
626
+ withRunConfirmation(icon = 'pi pi-exclamation-triangle', title, message, acceptTitle, rejectTitle) {
627
+ this._hasRunConfirmation = true;
628
+ this._runConfirmationIcon = icon;
629
+ this._runConfirmationTitle = title;
630
+ this._runConfirmationMessage = message;
631
+ this._runConfirmationAcceptTitle = acceptTitle;
632
+ this._runConfirmationRejectTitle = rejectTitle;
633
+ return this;
634
+ }
635
+ withRunNotificationSuccess(title, message, hasNotification = true) {
636
+ this._hasRunNotificationSuccess = hasNotification;
637
+ this._runNotificationSuccessTitle = title;
638
+ this._runNotificationSuccessMessage = message;
639
+ }
640
+ withRunNotificationError(title, message, hasNotification = true) {
641
+ this._hasRunNotificationError = hasNotification;
642
+ this._runNotificationErrorTitle = title;
643
+ this._runNotificationErrorMessage = message;
644
+ }
645
+ }
646
+ (function (ActionDescriptor) {
647
+ let SizeEnum;
648
+ (function (SizeEnum) {
649
+ SizeEnum[SizeEnum["ExtraSmall"] = 0] = "ExtraSmall";
650
+ SizeEnum[SizeEnum["Small"] = 1] = "Small";
651
+ SizeEnum[SizeEnum["Normal"] = 2] = "Normal";
652
+ SizeEnum[SizeEnum["Large"] = 3] = "Large";
653
+ SizeEnum[SizeEnum["ExtraLarge"] = 4] = "ExtraLarge";
654
+ })(SizeEnum = ActionDescriptor.SizeEnum || (ActionDescriptor.SizeEnum = {}));
655
+ })(ActionDescriptor || (ActionDescriptor = {}));
656
+ class ActionEditorDescriptor extends ActionDescriptor {
657
+ constructor(editorDescriptor, actionName, parentType, parentProperty) {
658
+ super(editorDescriptor.model, actionName, parentType, parentProperty);
659
+ this._editorActions = [];
660
+ this._editorTitle = undefined;
661
+ this._hasFetchNotificationSuccess = false;
662
+ this._type = ActionTypeEnum.Editor;
663
+ this._editorDescriptor = editorDescriptor;
664
+ this._editorActions.push(new ActionEditorSubmitDescriptor(this), new ActionEditorSubmitDescriptor(this, ActionEditorSubmitDescriptor.TypeEnum.Cancel));
665
+ }
666
+ get editorTitle() {
667
+ return this._editorTitle;
668
+ }
669
+ get editorDescriptor() {
670
+ return this._editorDescriptor;
671
+ }
672
+ get hasFetchNotificationSuccess() {
673
+ return this._hasFetchNotificationSuccess;
674
+ }
675
+ get fetchNotificationSuccessTitle() {
676
+ return this._fetchNotificationSuccessTitle;
677
+ }
678
+ get fetchNotificationSuccessMessage() {
679
+ return this._fetchNotificationSuccessMessage;
680
+ }
681
+ get dataProvider() {
682
+ return this._dataProvider;
683
+ }
684
+ get runFunction() {
685
+ throw new Error('Run function cannot be used in editor action. Use submit function instead!');
686
+ }
687
+ get fetchFunction() {
688
+ if (!this._fetchFunction) {
689
+ return ctx => {
690
+ var _a, _b;
691
+ 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);
692
+ return of(((_b = ctx.data) === null || _b === void 0 ? void 0 : _b.item) ? ctx.data.item : {});
693
+ };
694
+ }
695
+ return this._fetchFunction;
696
+ }
697
+ get submitFunction() {
698
+ return this._submitFunction;
699
+ }
700
+ get editorActions() {
701
+ return this._editorActions;
702
+ }
703
+ get editorComponent() {
704
+ return this._editorComponent;
705
+ }
706
+ withEditorTitle(title) {
707
+ this._editorTitle = title;
708
+ return this;
709
+ }
710
+ withDataProvider(dataProvider) {
711
+ this._dataProvider = dataProvider;
712
+ return this;
713
+ }
714
+ withServiceType(serviceType) {
715
+ this._dataProvider = new EditorDataProvider(this._model.type, serviceType);
716
+ return this;
717
+ }
718
+ withRunFunction(fn) {
719
+ return this.withSubmitFunction(fn);
720
+ }
721
+ withFetchFunction(fn) {
722
+ this._fetchFunction = fn;
723
+ return this;
724
+ }
725
+ withSubmitFunction(fn) {
726
+ this._submitFunction = fn;
727
+ return this;
728
+ }
729
+ withFetchNotificationError(title, message, hasNotification = true) {
730
+ this._hasFetchNotificationSuccess = hasNotification;
731
+ this._fetchNotificationSuccessTitle = title;
732
+ this._fetchNotificationSuccessMessage = message;
733
+ return this;
734
+ }
735
+ withEditorAction(action) {
736
+ this._editorActions.push(action);
737
+ return this;
738
+ }
739
+ withEditorComponent(editorComponent) {
740
+ this._editorComponent = editorComponent;
741
+ return this;
742
+ }
743
+ }
744
+ class ActionEditorSubmitDescriptor extends ActionDescriptor {
745
+ constructor(editorAction, submitType = ActionEditorSubmitDescriptor.TypeEnum.Submit) {
746
+ super(editorAction.model, submitType === ActionEditorSubmitDescriptor.TypeEnum.Submit ? 'submit' : 'cancel');
747
+ this._editorAction = editorAction;
748
+ this._submitType = submitType;
749
+ this._position = ActionPositionEnum.FooterRight;
750
+ }
751
+ get submitType() {
752
+ return this._submitType;
753
+ }
754
+ }
755
+ (function (ActionEditorSubmitDescriptor) {
756
+ let TypeEnum;
757
+ (function (TypeEnum) {
758
+ TypeEnum[TypeEnum["Submit"] = 0] = "Submit";
759
+ TypeEnum[TypeEnum["Cancel"] = 1] = "Cancel";
760
+ })(TypeEnum = ActionEditorSubmitDescriptor.TypeEnum || (ActionEditorSubmitDescriptor.TypeEnum = {}));
761
+ })(ActionEditorSubmitDescriptor || (ActionEditorSubmitDescriptor = {}));
762
+ class ActionEditorDetailsDescriptor extends ActionEditorDescriptor {
763
+ constructor(editorDescriptor) {
764
+ super(editorDescriptor, 'details');
765
+ this.withPosition(ActionPositionEnum.RowClick);
766
+ this.withRouteTrigger(':itemId');
767
+ this.withFetchFunction(ctx => {
768
+ var _a, _b, _c, _d;
769
+ return ((_a = ctx.dataProvider) === null || _a === void 0 ? void 0 : _a.fetch) && ((_b = ctx.data) === null || _b === void 0 ? void 0 : _b.itemId)
770
+ ? ctx.dataProvider.fetch((_c = ctx.data) === null || _c === void 0 ? void 0 : _c.itemId, ctx.serviceInstance)
771
+ : throwError(new Error(`Data provider fetch function or item id ${(_d = ctx.data) === null || _d === void 0 ? void 0 : _d.itemId} is missing.`));
772
+ });
773
+ this.withClassName('mng-details-dynamic-dialog');
774
+ }
775
+ withServiceType(serviceType) {
776
+ return this.withServiceFetchFunction(serviceType);
688
777
  }
689
- withItemsPerPage(itemsPerPage) {
690
- this.queryParam.itemsPerPage = itemsPerPage;
778
+ withServiceFetchFunction(serviceType, fetchFn) {
779
+ const dataProvider = new EditorDataProvider(this._model.type, serviceType);
780
+ if (fetchFn) {
781
+ dataProvider.withFetch(fetchFn);
782
+ }
783
+ this._dataProvider = dataProvider;
691
784
  return this;
692
785
  }
693
- withItemsOffset(itemsOffset) {
694
- this.queryParam.itemsOffset = itemsOffset;
695
- return this;
786
+ }
787
+ class ActionEditorAddDescriptor extends ActionEditorDescriptor {
788
+ constructor(editorDescriptor) {
789
+ super(editorDescriptor, 'add');
790
+ this.withPosition(ActionPositionEnum.ToolbarLeft);
791
+ this.withRouteTrigger('add');
792
+ 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.`)); });
793
+ this.withLevel(ActionLevelEnum.Success);
794
+ this.withIcon('pi pi-plus');
795
+ this.withClassName('mng-details-dynamic-dialog');
696
796
  }
697
- withSort(property, asc = true) {
698
- if (!this.queryParam.sortProperty || !this.queryParam.sortAsc) {
699
- this.queryParam.sortProperty = [];
700
- this.queryParam.sortAsc = [];
797
+ withServiceType(serviceType) {
798
+ return this.withServiceSubmitFunction(serviceType);
799
+ }
800
+ withServiceSubmitFunction(serviceType, createFn, fetchFn) {
801
+ const dataProvider = new EditorDataProvider(this._model.type, serviceType);
802
+ if (createFn) {
803
+ dataProvider.withCreate(createFn);
701
804
  }
702
- this.queryParam.sortProperty.push(property);
703
- this.queryParam.sortAsc.push(asc);
805
+ if (fetchFn) {
806
+ dataProvider.withFetch(fetchFn);
807
+ }
808
+ this._dataProvider = dataProvider;
704
809
  return this;
705
810
  }
706
- withFilter(property, value, valueTo = undefined, matchType = MediusFilterMatchType.Contains, matchCaseSensitive = false) {
707
- if (!this.queryParam.filterParams) {
708
- this.queryParam.filterParams = [];
811
+ }
812
+ class ActionEditorEditDescriptor extends ActionEditorDescriptor {
813
+ constructor(editorDescriptor) {
814
+ super(editorDescriptor, 'edit');
815
+ this.withPosition(ActionPositionEnum.RowInline);
816
+ this.withTitle(null);
817
+ this.withRouteTrigger(':itemId/edit');
818
+ this.withFetchFunction(ctx => {
819
+ var _a, _b, _c;
820
+ return ((_a = ctx.dataProvider) === null || _a === void 0 ? void 0 : _a.fetch) && ((_b = ctx.data) === null || _b === void 0 ? void 0 : _b.itemId)
821
+ ? ctx.dataProvider.fetch(ctx.data.itemId, ctx.serviceInstance)
822
+ : throwError(new Error(`Data provider fetch function or item id ${(_c = ctx.data) === null || _c === void 0 ? void 0 : _c.itemId} is missing.`));
823
+ });
824
+ this.withSubmitFunction(ctx => {
825
+ var _a, _b, _c, _d;
826
+ return ((_a = ctx.dataProvider) === null || _a === void 0 ? void 0 : _a.update) && ((_b = ctx.data) === null || _b === void 0 ? void 0 : _b.itemId)
827
+ ? ctx.dataProvider.update(ctx.data.itemId, (_c = ctx.data) === null || _c === void 0 ? void 0 : _c.item, ctx.serviceInstance)
828
+ : throwError(new Error(`Data provider update function or item id ${(_d = ctx.data) === null || _d === void 0 ? void 0 : _d.itemId} is missing.`));
829
+ });
830
+ this.withIcon('pi pi-pencil');
831
+ this.withClassName('mng-details-dynamic-dialog');
832
+ }
833
+ withServiceType(serviceType) {
834
+ return this.withServiceSubmitFunction(serviceType);
835
+ }
836
+ withServiceSubmitFunction(serviceType, updateFn, fetchFn) {
837
+ const dataProvider = new EditorDataProvider(this._model.type, serviceType);
838
+ if (updateFn) {
839
+ dataProvider.withUpdate(updateFn);
709
840
  }
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);
841
+ if (fetchFn) {
842
+ dataProvider.withFetch(fetchFn);
843
+ }
844
+ this._dataProvider = dataProvider;
717
845
  return this;
718
846
  }
719
- build() {
720
- const queryParam = this.queryParam;
721
- this.queryParam = new MediusQueryParam();
722
- return queryParam;
723
- }
724
847
  }
725
-
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());
848
+ class ActionDeleteDescriptor extends ActionDescriptor {
849
+ constructor(model) {
850
+ super(model, 'delete');
851
+ this.withPosition(ActionPositionEnum.RowInline);
852
+ this.withTitle(null);
853
+ this.withRunFunction(ctx => {
854
+ var _a, _b;
855
+ const editorDataProvider = ctx.dataProvider;
856
+ return (editorDataProvider === null || editorDataProvider === void 0 ? void 0 : editorDataProvider.delete) && ((_a = ctx.data) === null || _a === void 0 ? void 0 : _a.itemId)
857
+ ? editorDataProvider.delete(ctx.data.itemId, ctx.data.item, ctx.serviceInstance)
858
+ : throwError(new Error(`Data provider delete function or item id ${(_b = ctx.data) === null || _b === void 0 ? void 0 : _b.itemId} is missing.`));
859
+ });
860
+ this.withLevel(ActionLevelEnum.Danger);
861
+ this.withIcon('pi pi-trash');
862
+ this.withRunConfirmation(undefined);
742
863
  }
743
- get getAll() {
744
- return this._getAll;
864
+ withServiceType(serviceType) {
865
+ return this.withServiceDeleteFunction(serviceType);
745
866
  }
746
- withGetAll(getAll) {
747
- this._getAll = getAll;
867
+ withServiceDeleteFunction(serviceType, deleteFn) {
868
+ const dataProvider = new EditorDataProvider(this._model.type, serviceType);
869
+ if (deleteFn) {
870
+ dataProvider.withDelete(deleteFn);
871
+ }
872
+ this._dataProvider = dataProvider;
748
873
  return this;
749
874
  }
750
875
  }
876
+ var ActionPositionEnum;
877
+ (function (ActionPositionEnum) {
878
+ ActionPositionEnum[ActionPositionEnum["ToolbarLeft"] = 0] = "ToolbarLeft";
879
+ ActionPositionEnum[ActionPositionEnum["ToolbarRight"] = 1] = "ToolbarRight";
880
+ ActionPositionEnum[ActionPositionEnum["TableHeader"] = 2] = "TableHeader";
881
+ ActionPositionEnum[ActionPositionEnum["RowInline"] = 3] = "RowInline";
882
+ ActionPositionEnum[ActionPositionEnum["RowClick"] = 4] = "RowClick";
883
+ ActionPositionEnum[ActionPositionEnum["FooterLeft"] = 5] = "FooterLeft";
884
+ ActionPositionEnum[ActionPositionEnum["FooterRight"] = 6] = "FooterRight";
885
+ })(ActionPositionEnum || (ActionPositionEnum = {}));
886
+ var ActionActivationTriggerEnum;
887
+ (function (ActionActivationTriggerEnum) {
888
+ ActionActivationTriggerEnum[ActionActivationTriggerEnum["OnClick"] = 0] = "OnClick";
889
+ ActionActivationTriggerEnum[ActionActivationTriggerEnum["OnRoute"] = 1] = "OnRoute"; // action is triggered for activation by route url
890
+ })(ActionActivationTriggerEnum || (ActionActivationTriggerEnum = {}));
891
+ var ActionTypeEnum;
892
+ (function (ActionTypeEnum) {
893
+ ActionTypeEnum[ActionTypeEnum["Direct"] = 0] = "Direct";
894
+ ActionTypeEnum[ActionTypeEnum["Event"] = 1] = "Event";
895
+ ActionTypeEnum[ActionTypeEnum["Editor"] = 2] = "Editor"; // editor providing middle step for activation
896
+ })(ActionTypeEnum || (ActionTypeEnum = {}));
897
+ var ActionLevelEnum;
898
+ (function (ActionLevelEnum) {
899
+ ActionLevelEnum[ActionLevelEnum["Default"] = 0] = "Default";
900
+ ActionLevelEnum[ActionLevelEnum["Primary"] = 1] = "Primary";
901
+ ActionLevelEnum[ActionLevelEnum["Secondary"] = 2] = "Secondary";
902
+ ActionLevelEnum[ActionLevelEnum["Info"] = 3] = "Info";
903
+ ActionLevelEnum[ActionLevelEnum["Help"] = 4] = "Help";
904
+ ActionLevelEnum[ActionLevelEnum["Success"] = 5] = "Success";
905
+ ActionLevelEnum[ActionLevelEnum["Warning"] = 6] = "Warning";
906
+ ActionLevelEnum[ActionLevelEnum["Danger"] = 7] = "Danger";
907
+ })(ActionLevelEnum || (ActionLevelEnum = {}));
908
+
909
+ class MngFormEditorSubmitEvent {
910
+ constructor(formItem) {
911
+ this.formItem = formItem;
912
+ this.success = true;
913
+ }
914
+ }
915
+ var MngFormFieldEventTypeEnum;
916
+ (function (MngFormFieldEventTypeEnum) {
917
+ MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Component"] = 0] = "Component";
918
+ MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["ValueChange"] = 1] = "ValueChange";
919
+ MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["DataProvider"] = 2] = "DataProvider";
920
+ MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Dialog"] = 3] = "Dialog";
921
+ MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Other"] = 4] = "Other";
922
+ })(MngFormFieldEventTypeEnum || (MngFormFieldEventTypeEnum = {}));
923
+ class MngFormFieldEventComponentSubtype {
924
+ }
925
+ MngFormFieldEventComponentSubtype.ON_INIT = 'Component.OnInit';
926
+ MngFormFieldEventComponentSubtype.ON_VIEW_INIT = 'Component.OnViewInit';
927
+ MngFormFieldEventComponentSubtype.ON_CONTENT_INIT = 'Component.OnContentInit';
928
+ MngFormFieldEventComponentSubtype.ON_DESTROY = 'Component.OnDestroy';
929
+ class MngFormFieldEventDialogSubtype {
930
+ }
931
+ MngFormFieldEventDialogSubtype.VISIBILITY = 'Dialog.Visibility';
932
+ MngFormFieldEventDialogSubtype.TABLE_CAPTION_COMPONENT_INSTANCE = 'Dialog.MngTable.CaptionComponentInstance';
933
+ MngFormFieldEventDialogSubtype.TABLE_COLUMN_ACTIONS_COMPONENT_INSTANCE = 'Dialog.MngTable.ColumnActionsComponentInstance';
934
+ class MngFormFieldEvent {
935
+ constructor(type, componentType, componentInstance, data = {}) {
936
+ this.type = type;
937
+ this.componentType = componentType;
938
+ this.componentInstance = componentInstance;
939
+ this.data = data;
940
+ }
941
+ }
751
942
 
752
943
  class EditorDescriptor {
753
944
  constructor(modelType, idProperty, titleProperty) {
@@ -894,22 +1085,37 @@ class EditorDescriptor {
894
1085
  EditorDescriptor.defaultGroupName = '_default';
895
1086
  class AGenericFieldDescriptor {
896
1087
  constructor(editor) {
1088
+ this._config = {};
897
1089
  this._editor = editor;
898
1090
  }
899
1091
  get editor() {
900
1092
  return this._editor;
901
1093
  }
1094
+ get config() {
1095
+ return this._config;
1096
+ }
1097
+ withConfig(config) {
1098
+ this._config = config;
1099
+ return this;
1100
+ }
902
1101
  }
903
1102
  class AFieldDescriptor extends AGenericFieldDescriptor {
904
1103
  constructor(editor, property) {
905
1104
  super(editor);
906
1105
  this._required = false;
907
1106
  this._disabled = false;
908
- this._className = '';
909
1107
  this._validators = [];
1108
+ this._className = '';
1109
+ this._labelClassName = '';
1110
+ this._inputClassName = '';
1111
+ this._size = FieldDescriptor.SizeEnum.Normal;
1112
+ this._eventsSubject = new Subject();
910
1113
  this._property = property;
911
1114
  this._label = I18nUtil.getModelPropertyKey(this._editor.model, property);
912
1115
  }
1116
+ get property() {
1117
+ return this._property;
1118
+ }
913
1119
  get group() {
914
1120
  return this._group;
915
1121
  }
@@ -919,6 +1125,9 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
919
1125
  get placeholder() {
920
1126
  return this._placeholder;
921
1127
  }
1128
+ get helpText() {
1129
+ return this._helpText;
1130
+ }
922
1131
  get required() {
923
1132
  return this._required;
924
1133
  }
@@ -928,9 +1137,6 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
928
1137
  get defaultValue() {
929
1138
  return this._defaultValue;
930
1139
  }
931
- get className() {
932
- return this._className;
933
- }
934
1140
  get getter() {
935
1141
  return this._getter;
936
1142
  }
@@ -940,11 +1146,32 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
940
1146
  get validators() {
941
1147
  return this._validators;
942
1148
  }
943
- get disabledFunction() {
944
- return this._disabledFunction;
1149
+ get requiredExpression() {
1150
+ return this._requiredExpression;
945
1151
  }
946
- get property() {
947
- return this._property;
1152
+ get disabledExpression() {
1153
+ return this._disabledExpression;
1154
+ }
1155
+ get hiddenExpression() {
1156
+ return this._hiddenExpression;
1157
+ }
1158
+ get className() {
1159
+ return this._className;
1160
+ }
1161
+ get labelClassName() {
1162
+ return this._labelClassName;
1163
+ }
1164
+ get inputClassName() {
1165
+ return this._inputClassName;
1166
+ }
1167
+ get size() {
1168
+ return this._size;
1169
+ }
1170
+ get isSizeSmall() {
1171
+ return this._size === FieldDescriptor.SizeEnum.Small;
1172
+ }
1173
+ get isSizeLarge() {
1174
+ return this._size === FieldDescriptor.SizeEnum.Large;
948
1175
  }
949
1176
  withLabel(label) {
950
1177
  this._label = label;
@@ -954,23 +1181,30 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
954
1181
  this._placeholder = placeholder;
955
1182
  return this;
956
1183
  }
957
- withRequired(required = true) {
1184
+ withHelpText(helpText) {
1185
+ this._helpText = helpText;
1186
+ return this;
1187
+ }
1188
+ withRequired(required = true, requiredExpression) {
958
1189
  this._required = required;
1190
+ if (requiredExpression) {
1191
+ this._requiredExpression = requiredExpression;
1192
+ }
959
1193
  return this;
960
1194
  }
961
- withDisabled(disabled = true, disabledFunction) {
1195
+ withDisabled(disabled = true, disabledExpression) {
962
1196
  this._disabled = disabled;
963
- if (disabledFunction) {
964
- this._disabledFunction = disabledFunction;
1197
+ if (disabledExpression) {
1198
+ this._disabledExpression = disabledExpression;
965
1199
  }
966
1200
  return this;
967
1201
  }
968
- withDefaultValue(defaultValue) {
969
- this._defaultValue = defaultValue;
1202
+ withHidden(hiddenExpression) {
1203
+ this._hiddenExpression = hiddenExpression;
970
1204
  return this;
971
1205
  }
972
- withClassName(className) {
973
- this._className = className;
1206
+ withDefaultValue(defaultValue) {
1207
+ this._defaultValue = defaultValue;
974
1208
  return this;
975
1209
  }
976
1210
  withGetter(getter) {
@@ -985,19 +1219,48 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
985
1219
  this._validators.push(new FieldValidator(name, expression, message));
986
1220
  return this;
987
1221
  }
1222
+ withClassName(className, labelClassName = '', inputClassName = '') {
1223
+ this._className = className;
1224
+ this._labelClassName = labelClassName;
1225
+ this._inputClassName = inputClassName;
1226
+ return this;
1227
+ }
1228
+ withSize(size = FieldDescriptor.SizeEnum.Normal) {
1229
+ this._size = size;
1230
+ return this;
1231
+ }
1232
+ nextEvent(type, cmpType, cmpInstance, data) {
1233
+ this._eventsSubject.next(new MngFormFieldEvent(type, cmpType, cmpInstance, data));
1234
+ }
1235
+ get events$() {
1236
+ return this._eventsSubject.asObservable();
1237
+ }
988
1238
  copyFieldsTo(obj) {
989
1239
  obj._label = this._label;
990
1240
  obj._placeholder = this._placeholder;
1241
+ obj._helpText = this._helpText;
991
1242
  obj._required = this._required;
992
1243
  obj._disabled = this._disabled;
993
1244
  obj._defaultValue = this._defaultValue;
994
- obj._disabledFunction = this._disabledFunction;
1245
+ obj._requiredExpression = this._requiredExpression;
1246
+ obj._hiddenExpression = this._hiddenExpression;
1247
+ obj._disabledExpression = this._disabledExpression;
995
1248
  obj._className = this._className;
1249
+ obj._size = this.size;
996
1250
  obj._getter = this._getter;
997
1251
  obj._setter = this._setter;
998
1252
  obj._validators = this._validators;
999
1253
  }
1000
1254
  }
1255
+ var FieldDescriptor;
1256
+ (function (FieldDescriptor) {
1257
+ let SizeEnum;
1258
+ (function (SizeEnum) {
1259
+ SizeEnum[SizeEnum["Small"] = 0] = "Small";
1260
+ SizeEnum[SizeEnum["Normal"] = 1] = "Normal";
1261
+ SizeEnum[SizeEnum["Large"] = 2] = "Large";
1262
+ })(SizeEnum = FieldDescriptor.SizeEnum || (FieldDescriptor.SizeEnum = {}));
1263
+ })(FieldDescriptor || (FieldDescriptor = {}));
1001
1264
  class FieldInputDescriptor extends AFieldDescriptor {
1002
1265
  constructor(editor, property) {
1003
1266
  super(editor, property);
@@ -1064,6 +1327,10 @@ class FieldInputDescriptor extends AFieldDescriptor {
1064
1327
  get customComponentName() {
1065
1328
  return this._customComponentName;
1066
1329
  }
1330
+ asHidden() {
1331
+ this._fieldType = FieldInputDescriptor.TypeEnum.Hidden;
1332
+ return this;
1333
+ }
1067
1334
  asText(minLength, maxLength, pattern, isEmail) {
1068
1335
  this._fieldType = FieldInputDescriptor.TypeEnum.Text;
1069
1336
  this._minLength = minLength;
@@ -1158,14 +1425,15 @@ class FieldInputDescriptor extends AFieldDescriptor {
1158
1425
  (function (FieldInputDescriptor) {
1159
1426
  let TypeEnum;
1160
1427
  (function (TypeEnum) {
1161
- TypeEnum[TypeEnum["Text"] = 0] = "Text";
1162
- TypeEnum[TypeEnum["Textarea"] = 1] = "Textarea";
1163
- TypeEnum[TypeEnum["Number"] = 2] = "Number";
1164
- TypeEnum[TypeEnum["Switch"] = 3] = "Switch";
1165
- TypeEnum[TypeEnum["Radio"] = 4] = "Radio";
1166
- TypeEnum[TypeEnum["Datepicker"] = 5] = "Datepicker";
1167
- TypeEnum[TypeEnum["Mask"] = 6] = "Mask";
1168
- TypeEnum[TypeEnum["Custom"] = 7] = "Custom";
1428
+ TypeEnum[TypeEnum["Hidden"] = 0] = "Hidden";
1429
+ TypeEnum[TypeEnum["Text"] = 1] = "Text";
1430
+ TypeEnum[TypeEnum["Textarea"] = 2] = "Textarea";
1431
+ TypeEnum[TypeEnum["Number"] = 3] = "Number";
1432
+ TypeEnum[TypeEnum["Switch"] = 4] = "Switch";
1433
+ TypeEnum[TypeEnum["Radio"] = 5] = "Radio";
1434
+ TypeEnum[TypeEnum["Datepicker"] = 6] = "Datepicker";
1435
+ TypeEnum[TypeEnum["Mask"] = 7] = "Mask";
1436
+ TypeEnum[TypeEnum["Custom"] = 8] = "Custom";
1169
1437
  })(TypeEnum = FieldInputDescriptor.TypeEnum || (FieldInputDescriptor.TypeEnum = {}));
1170
1438
  })(FieldInputDescriptor || (FieldInputDescriptor = {}));
1171
1439
  class FieldLookupDescriptor extends AFieldDescriptor {
@@ -1190,9 +1458,15 @@ class FieldLookupDescriptor extends AFieldDescriptor {
1190
1458
  get dataProvider() {
1191
1459
  return this._dataProvider;
1192
1460
  }
1461
+ get lookupTableDataProvider() {
1462
+ return this._lookupTableDataProvider;
1463
+ }
1193
1464
  get modelType() {
1194
1465
  return this._modelType;
1195
1466
  }
1467
+ get lookupTableDescriptor() {
1468
+ return this._lookupTableDescriptor;
1469
+ }
1196
1470
  withItemsLabelProperty(itemsLabelProperty) {
1197
1471
  this._itemsLabelProperty = itemsLabelProperty;
1198
1472
  return this;
@@ -1218,10 +1492,19 @@ class FieldLookupDescriptor extends AFieldDescriptor {
1218
1492
  this._dataProvider = dataProvider;
1219
1493
  return this;
1220
1494
  }
1495
+ withConfig(config) {
1496
+ return super.withConfig(config);
1497
+ }
1221
1498
  asAutocomplete() {
1222
1499
  this._lookupType = FieldLookupDescriptor.LookupTypeEnum.Autocomplete;
1223
1500
  return this;
1224
1501
  }
1502
+ asDialog(lookupTableDescriptor, tableDataProvider) {
1503
+ this._lookupType = FieldLookupDescriptor.LookupTypeEnum.Dialog;
1504
+ this._lookupTableDescriptor = lookupTableDescriptor;
1505
+ this._lookupTableDataProvider = tableDataProvider;
1506
+ return this;
1507
+ }
1225
1508
  copy() {
1226
1509
  const field = new FieldLookupDescriptor(this._editor, this._property, this._modelType);
1227
1510
  this.copyFieldsTo(field);
@@ -1230,6 +1513,7 @@ class FieldLookupDescriptor extends AFieldDescriptor {
1230
1513
  field._itemsValueProperty = this._itemsValueProperty;
1231
1514
  field._dataKeyProperty = this._dataKeyProperty;
1232
1515
  field._dataProvider = this._dataProvider;
1516
+ field._lookupTableDescriptor = this._lookupTableDescriptor;
1233
1517
  return field;
1234
1518
  }
1235
1519
  }
@@ -1238,6 +1522,7 @@ class FieldLookupDescriptor extends AFieldDescriptor {
1238
1522
  (function (LookupTypeEnum) {
1239
1523
  LookupTypeEnum[LookupTypeEnum["Dropdown"] = 0] = "Dropdown";
1240
1524
  LookupTypeEnum[LookupTypeEnum["Autocomplete"] = 1] = "Autocomplete";
1525
+ LookupTypeEnum[LookupTypeEnum["Dialog"] = 2] = "Dialog";
1241
1526
  })(LookupTypeEnum = FieldLookupDescriptor.LookupTypeEnum || (FieldLookupDescriptor.LookupTypeEnum = {}));
1242
1527
  })(FieldLookupDescriptor || (FieldLookupDescriptor = {}));
1243
1528
  class FieldLookupEnumDescriptor extends FieldLookupDescriptor {
@@ -2275,6 +2560,8 @@ class EditorFormlyUtil {
2275
2560
  field.templateOptions['descriptor'] = descriptor;
2276
2561
  if (descriptor instanceof FieldInputDescriptor) {
2277
2562
  switch (descriptor.fieldType) {
2563
+ case FieldInputDescriptor.TypeEnum.Hidden:
2564
+ break;
2278
2565
  case FieldInputDescriptor.TypeEnum.Textarea:
2279
2566
  field.type = 'textarea';
2280
2567
  break;
@@ -2314,6 +2601,9 @@ class EditorFormlyUtil {
2314
2601
  case FieldLookupDescriptor.LookupTypeEnum.Autocomplete:
2315
2602
  field.type = 'autocomplete';
2316
2603
  break;
2604
+ case FieldLookupDescriptor.LookupTypeEnum.Dialog:
2605
+ field.type = 'dialog';
2606
+ break;
2317
2607
  case FieldLookupDescriptor.LookupTypeEnum.Dropdown:
2318
2608
  default:
2319
2609
  field.type = 'dropdown';
@@ -2329,11 +2619,17 @@ class EditorFormlyUtil {
2329
2619
  if (descriptor.label) {
2330
2620
  field.templateOptions.label = descriptor.label;
2331
2621
  }
2622
+ if (descriptor.requiredExpression) {
2623
+ field.expressionProperties['templateOptions.required'] = descriptor.requiredExpression;
2624
+ }
2332
2625
  if (descriptor.required) {
2333
2626
  field.templateOptions.required = true;
2334
2627
  }
2335
- if (descriptor.disabledFunction) {
2336
- field.expressionProperties['templateOptions.disabled'] = descriptor.disabledFunction;
2628
+ if (descriptor.hiddenExpression) {
2629
+ field.expressionProperties['hide'] = descriptor.hiddenExpression;
2630
+ }
2631
+ if (descriptor.disabledExpression) {
2632
+ field.expressionProperties['templateOptions.disabled'] = descriptor.disabledExpression;
2337
2633
  }
2338
2634
  else if (descriptor.disabled) {
2339
2635
  field.templateOptions.disabled = true;
@@ -2500,6 +2796,34 @@ class I18nUtil {
2500
2796
  }
2501
2797
  return i18nParameters;
2502
2798
  }
2799
+ static instantErrorI18nTranslation(translate, error, i18nParameters = {}) {
2800
+ i18nParameters.errorStatus = '';
2801
+ i18nParameters.errorMessage = '';
2802
+ if (error.messageCode) {
2803
+ const params = I18nUtil.getErrorI18nParams(error);
2804
+ const keys = [`errors.${error.messageCode}`, `messages.${error.messageCode}`];
2805
+ const i18ns = translate.instant(keys, params);
2806
+ const i18n = I18nUtil.selectKeyByPriority(keys, i18ns);
2807
+ if (i18n) {
2808
+ return i18n;
2809
+ }
2810
+ }
2811
+ return translate.instant(error.message);
2812
+ }
2813
+ static getErrorI18nParams(error, i18nParameters = {}) {
2814
+ i18nParameters.errorStatus = '';
2815
+ i18nParameters.errorMessage = '';
2816
+ if (error.status) {
2817
+ i18nParameters.errorStatus = error.status;
2818
+ }
2819
+ if (error.message) {
2820
+ i18nParameters.errorMessage = error.message;
2821
+ }
2822
+ if (error.statusDescription) {
2823
+ i18nParameters.errorStatusDescription = error.statusDescription;
2824
+ }
2825
+ return i18nParameters;
2826
+ }
2503
2827
  static instantModelName(translate, model, singular) {
2504
2828
  const keys = I18nUtil.getModelNameKeys(model, singular);
2505
2829
  const i18n = translate.instant(keys);
@@ -2631,8 +2955,16 @@ class ModelUtil {
2631
2955
  }
2632
2956
 
2633
2957
  class ToastUtil {
2634
- static tableNotificationError(translationService, table, error, tableview) {
2635
- var _a, _b, _c;
2958
+ static notification(viewContainer, title, message, severity = 'success') {
2959
+ const messageService = viewContainer === null || viewContainer === void 0 ? void 0 : viewContainer.getMessageService();
2960
+ if (!messageService) {
2961
+ console.warn(`No message service was provided through view container, message will not be displayed.`);
2962
+ return;
2963
+ }
2964
+ messageService.add({ severity: severity, summary: title, detail: message, life: severity === 'error' ? 10000 : 5000 });
2965
+ }
2966
+ static tableNotificationError(translationService, table, error, viewContainer) {
2967
+ var _a, _b;
2636
2968
  const params = {};
2637
2969
  if (error === null || error === void 0 ? void 0 : error.message) {
2638
2970
  params.errorMessage = `: ${error.message}`;
@@ -2643,26 +2975,22 @@ class ToastUtil {
2643
2975
  console.log(params);
2644
2976
  const tableErrorTitle = (_a = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.title', undefined, undefined, 'general.error', params)) !== null && _a !== void 0 ? _a : undefined;
2645
2977
  const tableErrorMessage = (_b = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.message', undefined, undefined, 'general.errorMessage', params)) !== 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: 'error', summary: tableErrorTitle, detail: tableErrorMessage });
2978
+ ToastUtil.notification(viewContainer, tableErrorTitle, tableErrorMessage, 'error');
2647
2979
  }
2648
- static actionNotificationSuccess(translationService, action, functionName, customTitleKey, customMessageKey, tableview, item) {
2649
- var _a, _b, _c;
2980
+ static actionNotificationSuccess(translationService, action, functionName, customTitleKey, customMessageKey, viewContainer, item) {
2981
+ var _a, _b;
2650
2982
  const actionSuccessTitle = (_a = I18nUtil.instantActionTranslation(translationService, action, 'success.title', customTitleKey, item, 'general.success', functionName)) !== null && _a !== void 0 ? _a : undefined;
2651
2983
  const actionSuccessMessage = (_b = I18nUtil.instantActionTranslation(translationService, action, 'success.message', customMessageKey, item, 'general.successMessage', functionName)) !== null && _b !== void 0 ? _b : undefined;
2652
- (_c = tableview === null || tableview === void 0 ? void 0 : tableview.messageService) === null || _c === void 0 ? void 0 : _c.add({ severity: 'success', summary: actionSuccessTitle, detail: actionSuccessMessage });
2984
+ ToastUtil.notification(viewContainer, actionSuccessTitle, actionSuccessMessage);
2653
2985
  }
2654
- static actionNotificationError(translationService, action, error, functionName, tableview, item) {
2655
- var _a, _b, _c;
2656
- const params = {};
2657
- if (error === null || error === void 0 ? void 0 : error.message) {
2658
- params.errorMessage = `: ${error.message}`;
2659
- }
2660
- else {
2661
- params.errorMessage = '.';
2662
- }
2986
+ static actionNotificationError(translationService, action, error, functionName, viewContainer, item) {
2987
+ var _a, _b;
2988
+ const params = {
2989
+ errorMessage: I18nUtil.instantErrorI18nTranslation(translationService, error)
2990
+ };
2663
2991
  const actionErrorTitle = (_a = I18nUtil.instantActionTranslation(translationService, action, 'error.title', action.runNotificationErrorTitle, item, 'general.error', functionName, params)) !== null && _a !== void 0 ? _a : undefined;
2664
2992
  const actionErrorMessage = (_b = I18nUtil.instantActionTranslation(translationService, action, 'error.message', action.runNotificationErrorMessage, item, 'general.errorMessage', functionName, params)) !== null && _b !== void 0 ? _b : undefined;
2665
- (_c = tableview === null || tableview === void 0 ? void 0 : tableview.messageService) === null || _c === void 0 ? void 0 : _c.add({ severity: 'error', summary: actionErrorTitle, detail: actionErrorMessage });
2993
+ ToastUtil.notification(viewContainer, actionErrorTitle, actionErrorMessage, 'error');
2666
2994
  }
2667
2995
  static getFormEditorWarningMessage(translationService, title, message) {
2668
2996
  var _a, _b;
@@ -3117,12 +3445,12 @@ MediusRestUtil.matchModeMapping = [
3117
3445
  ];
3118
3446
 
3119
3447
  class ActionExecContext {
3120
- constructor(dataProvider, serviceInstance, data, sourceComponent = null, tableview = null) {
3448
+ constructor(dataProvider, serviceInstance, data, sourceComponent = null, viewContainer = null) {
3121
3449
  this.dataProvider = dataProvider;
3122
3450
  this.serviceInstance = serviceInstance;
3123
3451
  this.data = data;
3124
3452
  this.sourceComponent = sourceComponent;
3125
- this.tableview = tableview;
3453
+ this.viewContainer = viewContainer;
3126
3454
  }
3127
3455
  }
3128
3456
  class ActionError {
@@ -3160,39 +3488,109 @@ class ActionTriggerResult {
3160
3488
  this.activationResult = activationResult;
3161
3489
  this.routerNavigation = routerNavigation;
3162
3490
  }
3163
- get runContext() {
3164
- return this.activationResult ? this.activationResult.runResult : null;
3491
+ get runContext() {
3492
+ return this.activationResult ? this.activationResult.runResult : null;
3493
+ }
3494
+ get result() {
3495
+ return this.activationResult ? this.activationResult.result : null;
3496
+ }
3497
+ get error() {
3498
+ return this.activationResult ? this.activationResult.error : null;
3499
+ }
3500
+ get dialogRef() {
3501
+ return this.activationResult ? this.activationResult.dialogRef : null;
3502
+ }
3503
+ }
3504
+
3505
+ const MNG_BROWSER_STORAGE_IT = new InjectionToken('Browser storage', {
3506
+ providedIn: 'root',
3507
+ factory: () => localStorage
3508
+ });
3509
+
3510
+ const ACTION_EDITOR_DIALOG_COMPONENT_SETTING = new InjectionToken('ACTION_EDITOR_DIALOG_COMPONENT_SETTING');
3511
+
3512
+ const MNG_MODULE_CONFIG_IT = new InjectionToken('MngModuleConfig');
3513
+
3514
+ class MngNavigationService {
3515
+ constructor(router, location) {
3516
+ this.router = router;
3517
+ this.location = location;
3518
+ this.history = [];
3519
+ this.router.events.subscribe(event => {
3520
+ if (event instanceof NavigationEnd) {
3521
+ this.history.push(event.urlAfterRedirects);
3522
+ }
3523
+ });
3524
+ }
3525
+ getCurrentLocation() {
3526
+ if (this.history.length > 0) {
3527
+ return this.history[this.history.length - 1];
3528
+ }
3529
+ else {
3530
+ return null;
3531
+ }
3165
3532
  }
3166
- get result() {
3167
- return this.activationResult ? this.activationResult.result : null;
3533
+ getPreviousLocation() {
3534
+ if (this.history.length > 1) {
3535
+ return this.history[this.history.length - 2];
3536
+ }
3537
+ else {
3538
+ return null;
3539
+ }
3168
3540
  }
3169
- get error() {
3170
- return this.activationResult ? this.activationResult.error : null;
3541
+ back() {
3542
+ this.history.pop();
3543
+ if (this.history.length > 0) {
3544
+ this.location.back();
3545
+ }
3546
+ else {
3547
+ this.router.navigateByUrl('/');
3548
+ }
3171
3549
  }
3172
- get dialogRef() {
3173
- return this.activationResult ? this.activationResult.dialogRef : null;
3550
+ }
3551
+ MngNavigationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngNavigationService, deps: [{ token: i1.Router }, { token: i4.Location }], target: i0.ɵɵFactoryTarget.Injectable });
3552
+ MngNavigationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngNavigationService });
3553
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngNavigationService, decorators: [{
3554
+ type: Injectable
3555
+ }], ctorParameters: function () { return [{ type: i1.Router }, { type: i4.Location }]; } });
3556
+
3557
+ class MngErrorMapperService {
3558
+ }
3559
+ class DefaultMngErrorMapperService extends MngErrorMapperService {
3560
+ toMngError(error, mngError) {
3561
+ var _a, _b;
3562
+ if (!mngError) {
3563
+ mngError = {
3564
+ name: (_a = error === null || error === void 0 ? void 0 : error.name) !== null && _a !== void 0 ? _a : 'UnknownError',
3565
+ message: (_b = error.message) !== null && _b !== void 0 ? _b : 'Unknown error'
3566
+ };
3567
+ }
3568
+ return mngError;
3174
3569
  }
3175
3570
  }
3176
3571
 
3177
- class MngActionService {
3178
- constructor(injector, router, dialogService, confirmationService, translate) {
3572
+ class MngActionExecutorService {
3573
+ constructor(injector, router, dialogService, confirmationService, translate, navigationService, errorMapper, defaultEditorDialogComponent) {
3179
3574
  this.injector = injector;
3180
3575
  this.router = router;
3181
3576
  this.dialogService = dialogService;
3182
3577
  this.confirmationService = confirmationService;
3183
3578
  this.translate = translate;
3579
+ this.navigationService = navigationService;
3580
+ this.errorMapper = errorMapper;
3581
+ this.defaultEditorDialogComponent = defaultEditorDialogComponent;
3184
3582
  }
3185
- getActionExecContext(action, itemId, item, dataProvider, tableview, sourceComponent, actionData) {
3186
- var _a;
3187
- return new ActionExecContext(dataProvider, (_a = this.getDataProviderService(dataProvider)) !== null && _a !== void 0 ? _a : undefined, {
3583
+ prepareActionExecContext(action, itemId, item, dataProvider, viewContainer, sourceComponent, actionData) {
3584
+ var _a, _b;
3585
+ 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, {
3188
3586
  item,
3189
3587
  itemId,
3190
3588
  actionData
3191
- }, sourceComponent, tableview);
3589
+ }, sourceComponent, viewContainer);
3192
3590
  }
3193
- runAction(action, itemId, item, dataProvider, sourceComponent, tableview, actionData) {
3591
+ runAction(action, itemId, item, dataProvider, sourceComponent, viewContainer, actionData) {
3194
3592
  var _a, _b, _c, _d;
3195
- const context = this.getActionExecContext(action, itemId, item, dataProvider, tableview, sourceComponent, actionData);
3593
+ const context = this.prepareActionExecContext(action, itemId, item, dataProvider, viewContainer, sourceComponent, actionData);
3196
3594
  if (action.hasRunConfirmation) {
3197
3595
  if (typeof (sourceComponent === null || sourceComponent === void 0 ? void 0 : sourceComponent.getConfirmationService) !== 'function' || typeof (sourceComponent === null || sourceComponent === void 0 ? void 0 : sourceComponent.getConfirmationServiceInstanceKey) !== 'function') {
3198
3596
  throw Error(`Source component ${sourceComponent} should be implementing IConfirmationService interface to be able to provide confirmation functionality.`);
@@ -3230,17 +3628,19 @@ class MngActionService {
3230
3628
  .runFunction(context)
3231
3629
  .pipe(first(), map(res => new ActionRunResult(context, res)), map(value => {
3232
3630
  if (action.hasRunNotificationSuccess) {
3233
- ToastUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, tableview, item);
3631
+ ToastUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, item);
3234
3632
  }
3235
3633
  return value;
3236
3634
  }), catchError(err => {
3635
+ const actionError = this.toMngActionError(err);
3237
3636
  if (action.hasRunNotificationError) {
3238
- ToastUtil.actionNotificationError(this.translate, action, err, 'run', tableview, item);
3637
+ ToastUtil.actionNotificationError(this.translate, action, actionError, 'run', viewContainer, item);
3239
3638
  }
3240
- throw err;
3639
+ throw actionError;
3241
3640
  }))
3242
3641
  .subscribe(res => {
3243
3642
  observer.next(res);
3643
+ observer.complete();
3244
3644
  });
3245
3645
  };
3246
3646
  confirmParams.reject = () => {
@@ -3253,14 +3653,15 @@ class MngActionService {
3253
3653
  else {
3254
3654
  return action.runFunction(context).pipe(map(res => new ActionRunResult(context, res)), map(value => {
3255
3655
  if (action.hasRunNotificationSuccess) {
3256
- ToastUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, tableview, item);
3656
+ ToastUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, item);
3257
3657
  }
3258
3658
  return value;
3259
3659
  }), catchError(err => {
3660
+ const actionError = this.toMngActionError(err);
3260
3661
  if (action.hasRunNotificationError) {
3261
- ToastUtil.actionNotificationError(this.translate, action, err, 'run', tableview, item);
3662
+ ToastUtil.actionNotificationError(this.translate, action, actionError, 'run', viewContainer, item);
3262
3663
  }
3263
- throw err;
3664
+ throw actionError;
3264
3665
  }));
3265
3666
  }
3266
3667
  }
@@ -3272,24 +3673,25 @@ class MngActionService {
3272
3673
  * @param formItem Item instance (from form).
3273
3674
  * @param dataProvider Data provider
3274
3675
  * @param sourceComponent Source component from where the fetch function was called.
3275
- * @param tableview Tableview component.
3676
+ * @param viewContainer View container/service.
3276
3677
  * @param actionData Additional action data.
3277
3678
  */
3278
- runEditorSave(action, itemId, formItem, dataProvider, sourceComponent, tableview, actionData) {
3279
- const context = this.prepareRunContextForEditor(formItem, itemId, dataProvider, sourceComponent, tableview, actionData);
3679
+ runEditorSave(action, itemId, formItem, dataProvider, sourceComponent, viewContainer, actionData) {
3680
+ const context = this.prepareExecContextForEditor(action, formItem, itemId, dataProvider, sourceComponent, viewContainer, actionData);
3280
3681
  if (typeof action.submitFunction !== 'function') {
3281
3682
  throw new Error(`Submit function for action ${action.actionName} cannot be invoked.`);
3282
3683
  }
3283
3684
  return action.submitFunction(context).pipe(map(res => new ActionRunResult(context, res)), map(value => {
3284
3685
  if (action.hasRunNotificationSuccess) {
3285
- ToastUtil.actionNotificationSuccess(this.translate, action, 'submit', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, tableview, formItem);
3686
+ ToastUtil.actionNotificationSuccess(this.translate, action, 'submit', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, formItem);
3286
3687
  }
3287
3688
  return value;
3288
3689
  }), catchError(err => {
3690
+ const actionError = this.toMngActionError(err);
3289
3691
  if (action.hasRunNotificationError) {
3290
- ToastUtil.actionNotificationError(this.translate, action, err, 'submit', tableview, formItem);
3692
+ ToastUtil.actionNotificationError(this.translate, action, actionError, 'submit', viewContainer, formItem);
3291
3693
  }
3292
- throw err;
3694
+ throw actionError;
3293
3695
  }));
3294
3696
  }
3295
3697
  /**
@@ -3299,31 +3701,41 @@ class MngActionService {
3299
3701
  * @param itemId Item id.
3300
3702
  * @param dataProvider Data provider
3301
3703
  * @param sourceComponent Source component from where the fetch function was called.
3302
- * @param tableview Tableview component.
3704
+ * @param viewContainer View container/service. Tableview component.
3303
3705
  * @param actionData Additional action data.
3304
3706
  */
3305
- runEditorFetch(action, itemId, dataProvider, sourceComponent, tableview, actionData) {
3306
- const context = this.prepareRunContextForEditor(undefined, itemId, dataProvider, sourceComponent, tableview, actionData);
3707
+ runEditorFetch(action, itemId, dataProvider, sourceComponent, viewContainer, actionData) {
3708
+ const context = this.prepareExecContextForEditor(action, undefined, itemId, dataProvider, sourceComponent, viewContainer, actionData);
3307
3709
  return action.fetchFunction(context).pipe(map(res => new ActionRunResult(context, res)));
3308
3710
  // TODO: error handling
3309
3711
  }
3310
3712
  /**
3311
- * Prepares action run context for action of type editor.
3713
+ * Prepares action exec context for action of type editor.
3312
3714
  *
3313
3715
  * @param item Item instance (if exists).
3314
3716
  * @param itemId Item id (if exists).
3315
3717
  * @param dataProvider Data provider.
3316
3718
  * @param sourceComponent Source component from where the context preparation was called.
3317
- * @param tableview Tableview component.
3719
+ * @param viewContainer View container/service.
3318
3720
  * @param actionData Additional action data.
3319
3721
  */
3320
- prepareRunContextForEditor(item, itemId, dataProvider, sourceComponent, tableview, actionData) {
3722
+ prepareExecContextForEditor(action, item, itemId, dataProvider, sourceComponent, viewContainer, actionData) {
3321
3723
  var _a;
3322
- const context = new ActionExecContext(dataProvider, (_a = this.getDataProviderService(dataProvider)) !== null && _a !== void 0 ? _a : undefined, {
3724
+ let ctxDataProvider = dataProvider;
3725
+ if (!ctxDataProvider && action.dataProvider) {
3726
+ ctxDataProvider = action.dataProvider;
3727
+ }
3728
+ if (!ctxDataProvider) {
3729
+ const viewContainerDataProvider = viewContainer === null || viewContainer === void 0 ? void 0 : viewContainer.getDataProvider();
3730
+ if (viewContainerDataProvider) {
3731
+ ctxDataProvider = action.dataProvider;
3732
+ }
3733
+ }
3734
+ const context = new ActionExecContext(ctxDataProvider, (_a = this.getDataProviderService(ctxDataProvider)) !== null && _a !== void 0 ? _a : undefined, {
3323
3735
  item,
3324
3736
  itemId,
3325
3737
  actionData
3326
- }, sourceComponent, tableview);
3738
+ }, sourceComponent, viewContainer);
3327
3739
  return context;
3328
3740
  }
3329
3741
  /**
@@ -3346,12 +3758,15 @@ class MngActionService {
3346
3758
  * @param item Item instance (if exists).
3347
3759
  * @param itemId Item id (if exists).
3348
3760
  * @param actionData Optional additional action data.
3349
- * @param tableview Tableview component.
3761
+ * @param viewContainer View container component/service.
3350
3762
  * @param sourceComponent Source activation component.
3351
3763
  */
3352
- activateAction(action, itemId, item, actionData, tableview, sourceComponent) {
3353
- var _a;
3764
+ activateAction(action, itemId, item, actionData, viewContainer, sourceComponent) {
3354
3765
  if (action.type === ActionTypeEnum.Editor) {
3766
+ let dialogComponent = this.defaultEditorDialogComponent;
3767
+ if (action instanceof ActionEditorDescriptor && action.editorComponent) {
3768
+ dialogComponent = action.editorComponent;
3769
+ }
3355
3770
  const dialogConfig = {
3356
3771
  data: {
3357
3772
  action
@@ -3367,18 +3782,22 @@ class MngActionService {
3367
3782
  if (actionData) {
3368
3783
  dialogConfig.data.actionData = actionData;
3369
3784
  }
3370
- if (tableview) {
3371
- dialogConfig.data.tableview = tableview;
3785
+ if (viewContainer) {
3786
+ dialogConfig.data.viewContainer = viewContainer;
3372
3787
  }
3373
3788
  if (sourceComponent) {
3374
3789
  dialogConfig.data.sourceComponent = sourceComponent;
3375
3790
  }
3376
- const dialogRef = this.dialogService.open(MngActionDialogComponent, dialogConfig);
3791
+ const dialogRef = this.dialogService.open(dialogComponent, dialogConfig);
3377
3792
  return of(new ActionActivationResult(undefined, dialogRef));
3378
3793
  }
3794
+ else if (action.type === ActionTypeEnum.Event) {
3795
+ // just emit event
3796
+ return of(new ActionActivationResult(undefined));
3797
+ }
3379
3798
  else {
3380
3799
  // directly execute action
3381
- 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)));
3800
+ return this.runAction(action, itemId, item, undefined, sourceComponent, viewContainer, actionData).pipe(map(res => new ActionActivationResult(res)));
3382
3801
  }
3383
3802
  }
3384
3803
  /**
@@ -3402,7 +3821,7 @@ class MngActionService {
3402
3821
  * @param actionData Optional action data.
3403
3822
  * @param route Optional activated route.
3404
3823
  */
3405
- triggerAction(action, itemId, item, actionData, route, tableview, sourceComponent) {
3824
+ triggerAction(action, itemId, item, actionData, route, viewContainer, sourceComponent) {
3406
3825
  var _a;
3407
3826
  if (action.activationTrigger === ActionActivationTriggerEnum.OnRoute) {
3408
3827
  const baseUrl = this.router.url.split('?')[0];
@@ -3431,15 +3850,61 @@ class MngActionService {
3431
3850
  return of(new ActionTriggerResult(undefined, from(this.router.navigate([baseUrl, ...actionUrlSegments], { relativeTo: route, queryParams: parsedUrl.queryParams }))));
3432
3851
  }
3433
3852
  else {
3434
- return this.activateAction(action, itemId, item, actionData, tableview, sourceComponent).pipe(map(res => new ActionTriggerResult(res)));
3853
+ return this.activateAction(action, itemId, item, actionData, viewContainer, sourceComponent).pipe(map(res => new ActionTriggerResult(res)));
3854
+ }
3855
+ }
3856
+ deactivateAction(action) {
3857
+ var _a;
3858
+ if (this.navigationService.getPreviousLocation()) {
3859
+ // there are internal history records, so back can be normally called
3860
+ this.navigationService.back();
3861
+ }
3862
+ else {
3863
+ // there is no internal history records, figure out the base url by eliminating action specific url
3864
+ let url = this.navigationService.getCurrentLocation();
3865
+ if (!url) {
3866
+ this.navigationService.back();
3867
+ }
3868
+ else {
3869
+ if (url.startsWith('/')) {
3870
+ url = url.substring(1);
3871
+ }
3872
+ const urlPathSegments = url.split('?')[0].split('#')[0].split('/');
3873
+ let actionUrl = (_a = action === null || action === void 0 ? void 0 : action.routeUrl) !== null && _a !== void 0 ? _a : '';
3874
+ if (actionUrl.startsWith('/')) {
3875
+ actionUrl = actionUrl.substring(1);
3876
+ }
3877
+ const actionUrlSegments = actionUrl.split('/');
3878
+ const redirectUrl = urlPathSegments.slice(0, urlPathSegments.length - actionUrlSegments.length).join('/');
3879
+ this.router.navigateByUrl(`/${redirectUrl}`, { replaceUrl: true });
3880
+ }
3881
+ }
3882
+ }
3883
+ toMngActionError(error) {
3884
+ var _a, _b, _c;
3885
+ const actionError = {
3886
+ name: (_a = error === null || error === void 0 ? void 0 : error.name) !== null && _a !== void 0 ? _a : 'UnknownError',
3887
+ message: (_b = error === null || error === void 0 ? void 0 : error.message) !== null && _b !== void 0 ? _b : 'Unknown error',
3888
+ cause: error
3889
+ };
3890
+ if (error instanceof HttpErrorResponse) {
3891
+ actionError.status = error.status;
3892
+ actionError.statusDescription = error.statusText;
3893
+ actionError.url = (_c = error.url) !== null && _c !== void 0 ? _c : undefined;
3435
3894
  }
3895
+ return this.errorMapper.toMngError(error, actionError);
3436
3896
  }
3437
3897
  }
3438
- 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 });
3439
- MngActionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionService });
3440
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionService, decorators: [{
3898
+ MngActionExecutorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionExecutorService, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i3.DialogService }, { token: i2.ConfirmationService }, { token: i3$1.TranslateService }, { token: MngNavigationService }, { token: MngErrorMapperService }, { token: ACTION_EDITOR_DIALOG_COMPONENT_SETTING }], target: i0.ɵɵFactoryTarget.Injectable });
3899
+ MngActionExecutorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionExecutorService });
3900
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionExecutorService, decorators: [{
3441
3901
  type: Injectable
3442
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i2.DialogService }, { type: i2$1.ConfirmationService }, { type: i2$2.TranslateService }]; } });
3902
+ }], ctorParameters: function () {
3903
+ return [{ type: i0.Injector }, { type: i1.Router }, { type: i3.DialogService }, { type: i2.ConfirmationService }, { type: i3$1.TranslateService }, { type: MngNavigationService }, { type: MngErrorMapperService }, { type: i0.Type, decorators: [{
3904
+ type: Inject,
3905
+ args: [ACTION_EDITOR_DIALOG_COMPONENT_SETTING]
3906
+ }] }];
3907
+ } });
3443
3908
 
3444
3909
  class MngConfigurationService {
3445
3910
  constructor(http) {
@@ -3517,13 +3982,6 @@ class MngConfigurationService {
3517
3982
  }
3518
3983
  MngConfigurationService._instance = null;
3519
3984
 
3520
- const MNG_BROWSER_STORAGE_IT = new InjectionToken('Browser storage', {
3521
- providedIn: 'root',
3522
- factory: () => localStorage
3523
- });
3524
-
3525
- const MNG_MODULE_CONFIG_IT = new InjectionToken('MngModuleConfig');
3526
-
3527
3985
  class MngCommonsService {
3528
3986
  constructor(router, primengConfig, translate, titleService, configurationService, moduleConfig, localStorage) {
3529
3987
  this.router = router;
@@ -3855,12 +4313,12 @@ class MngCommonsService {
3855
4313
  return titlePieces.join(' - ');
3856
4314
  }
3857
4315
  }
3858
- 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 });
4316
+ MngCommonsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService, deps: [{ token: i1.Router }, { token: i2.PrimeNGConfig }, { token: i3$1.TranslateService }, { token: i4$1.Title }, { token: MngConfigurationService }, { token: MNG_MODULE_CONFIG_IT }, { token: MNG_BROWSER_STORAGE_IT }], target: i0.ɵɵFactoryTarget.Injectable });
3859
4317
  MngCommonsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService });
3860
4318
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService, decorators: [{
3861
4319
  type: Injectable
3862
4320
  }], ctorParameters: function () {
3863
- return [{ type: i1.Router }, { type: i2$1.PrimeNGConfig }, { type: i2$2.TranslateService }, { type: i4.Title }, { type: MngConfigurationService }, { type: undefined, decorators: [{
4321
+ return [{ type: i1.Router }, { type: i2.PrimeNGConfig }, { type: i3$1.TranslateService }, { type: i4$1.Title }, { type: MngConfigurationService }, { type: undefined, decorators: [{
3864
4322
  type: Inject,
3865
4323
  args: [MNG_MODULE_CONFIG_IT]
3866
4324
  }] }, { type: Storage, decorators: [{
@@ -3869,97 +4327,79 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
3869
4327
  }] }];
3870
4328
  } });
3871
4329
 
3872
- class MngNavigationService {
3873
- constructor(router, location) {
3874
- this.router = router;
3875
- this.location = location;
3876
- this.history = [];
3877
- this.router.events.subscribe(event => {
3878
- if (event instanceof NavigationEnd) {
3879
- this.history.push(event.urlAfterRedirects);
3880
- }
3881
- });
3882
- }
3883
- getCurrentLocation() {
3884
- if (this.history.length > 0) {
3885
- return this.history[this.history.length - 1];
3886
- }
3887
- else {
3888
- return null;
3889
- }
3890
- }
3891
- getPreviousLocation() {
3892
- if (this.history.length > 1) {
3893
- return this.history[this.history.length - 2];
3894
- }
3895
- else {
3896
- return null;
3897
- }
3898
- }
3899
- back() {
3900
- this.history.pop();
3901
- if (this.history.length > 0) {
3902
- this.location.back();
3903
- }
3904
- else {
3905
- this.router.navigateByUrl('/');
3906
- }
3907
- }
3908
- }
3909
- MngNavigationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngNavigationService, deps: [{ token: i1.Router }, { token: i4$1.Location }], target: i0.ɵɵFactoryTarget.Injectable });
3910
- MngNavigationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngNavigationService });
3911
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngNavigationService, decorators: [{
3912
- type: Injectable
3913
- }], ctorParameters: function () { return [{ type: i1.Router }, { type: i4$1.Location }]; } });
3914
-
3915
- class TableviewComponentService {
3916
- constructor() {
4330
+ /**
4331
+ * Should be used with providers defined within component.
4332
+ */
4333
+ class MngViewContainerComponentService {
4334
+ constructor(messageService) {
4335
+ this.messageService = messageService;
3917
4336
  this.actions = [];
3918
4337
  this._reloadTableSubject = new Subject();
3919
4338
  }
4339
+ set dataProvider(dataProvider) {
4340
+ this._dataProvider = dataProvider;
4341
+ }
3920
4342
  get reloadTable$() {
3921
4343
  return this._reloadTableSubject.asObservable();
3922
4344
  }
3923
4345
  triggerTableReload(event) {
3924
4346
  this._reloadTableSubject.next(event);
3925
4347
  }
4348
+ getMessageService() {
4349
+ return this.messageService;
4350
+ }
4351
+ getDataProvider() {
4352
+ return this._dataProvider;
4353
+ }
3926
4354
  }
3927
- TableviewComponentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: TableviewComponentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3928
- TableviewComponentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: TableviewComponentService });
3929
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: TableviewComponentService, decorators: [{
4355
+ MngViewContainerComponentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngViewContainerComponentService, deps: [{ token: i2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
4356
+ MngViewContainerComponentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngViewContainerComponentService });
4357
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngViewContainerComponentService, decorators: [{
3930
4358
  type: Injectable
3931
- }] });
4359
+ }], ctorParameters: function () { return [{ type: i2.MessageService }]; } });
3932
4360
 
3933
4361
  class MngActionComponent {
3934
- constructor(route, translate, actionService, confirmationService, tableviewService) {
4362
+ constructor(route, translate, actionExecutor, confirmationService, viewContainerService) {
3935
4363
  this.route = route;
3936
4364
  this.translate = translate;
3937
- this.actionService = actionService;
4365
+ this.actionExecutor = actionExecutor;
3938
4366
  this.confirmationService = confirmationService;
3939
- this.tableviewService = tableviewService;
4367
+ this.viewContainerService = viewContainerService;
4368
+ this.inputDisabled = of(false);
4369
+ this.inputLoading = of(false);
4370
+ this.triggerEventEmitter = new EventEmitter();
3940
4371
  this.loadingSubject = new ReplaySubject(1);
3941
4372
  this.$loading = this.loadingSubject.asObservable();
3942
4373
  this.cmpId = Math.random().toString(36).substring(2);
3943
4374
  this.loadingSubject.next(false);
3944
4375
  }
3945
4376
  ngOnInit() {
3946
- var _a, _b, _c, _d, _e, _f;
3947
- 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);
4377
+ var _a, _b, _c, _d, _e, _f, _g;
4378
+ this.viewContainer = (_b = (_a = this.viewContainerInit) !== null && _a !== void 0 ? _a : this.viewContainerService) !== null && _b !== void 0 ? _b : undefined;
4379
+ 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);
3948
4380
  this.$isVisible = typeof this.action.isVisibleFunction === 'function' ? this.action.isVisibleFunction(context) : of(true);
3949
4381
  this.$isEnabled = typeof this.action.isEnabledFunction === 'function' ? this.action.isEnabledFunction(context) : of(true);
3950
- 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);
3951
- 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);
4382
+ 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);
4383
+ 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);
3952
4384
  }
3953
4385
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3954
4386
  triggerAction(event) {
3955
4387
  this.loadingSubject.next(true);
3956
4388
  const actionData = this.actionData ? this.actionData : {};
3957
4389
  actionData['cmpId'] = this.cmpId;
3958
- this.actionService
3959
- .triggerAction(this.action, this.itemId, this.item, actionData, this.route, this.tableviewService, this)
3960
- .pipe(first(), finalize(() => this.loadingSubject.next(false)))
3961
- // eslint-disable-next-line @typescript-eslint/no-empty-function
3962
- .subscribe(() => { });
4390
+ this.actionExecutor
4391
+ .triggerAction(this.action, this.itemId, this.item, actionData, this.route, this.viewContainer, this)
4392
+ .pipe(first())
4393
+ .subscribe({
4394
+ next: atr => {
4395
+ this.triggerEventEmitter.next(atr);
4396
+ this.loadingSubject.next(false);
4397
+ },
4398
+ error: err => {
4399
+ console.error(`Error occurred while executing action ${this.action.actionName}.`, err);
4400
+ this.loadingSubject.next(false);
4401
+ }
4402
+ });
3963
4403
  }
3964
4404
  getConfirmationService() {
3965
4405
  return this.confirmationService;
@@ -3968,12 +4408,16 @@ class MngActionComponent {
3968
4408
  return `${action.actionName}_${this.cmpId}`;
3969
4409
  }
3970
4410
  }
3971
- 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 });
3972
- 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 });
4411
+ 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 });
4412
+ MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", dataProvider: "dataProvider", inputDisabled: ["disabled", "inputDisabled"], inputLoading: ["loading", "inputLoading"], viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { triggerEventEmitter: "trigger" }, providers: [ConfirmationService], ngImport: i0, template: "<ng-container *ngIf=\"$isVisible | async\">\n <button\n *ngIf=\"action.icon && action.title === null; else noIcon\"\n type=\"button\"\n pButton\n pRipple\n [icon]=\"action.icon\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false && ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n (click)=\"triggerAction($event)\"\n class=\"mng-action-button mng-action-button-icon p-button-rounded\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-primary]=\"action.level === 1\"\n [class.p-button-success]=\"action.level === 5\"\n [class.p-button-danger]=\"action.level === 7\"></button>\n <ng-template #noIcon>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [label]=\"($label | async) ?? ''\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false && ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n (click)=\"triggerAction($event)\"\n class=\"mng-action-button p-button-text\"\n [class.p-button-sm]=\"action.isSizeSmall\"\n [class.p-button-lg]=\"action.isSizeLarge\"\n [class.p-button-primary]=\"action.level === 1\"\n [class.p-button-success]=\"action.level === 5\"\n [class.p-button-danger]=\"action.level === 7\"></button>\n </ng-template>\n <p-confirmDialog *ngIf=\"action.hasRunConfirmation\" [key]=\"action.actionName + '_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n</ng-container>\n", components: [{ type: i5.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i9.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3973
4413
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionComponent, decorators: [{
3974
4414
  type: Component,
3975
- 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" }]
3976
- }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i2$2.TranslateService }, { type: MngActionService }, { type: i2$1.ConfirmationService }, { type: TableviewComponentService }]; }, propDecorators: { action: [{
4415
+ args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfirmationService], template: "<ng-container *ngIf=\"$isVisible | async\">\n <button\n *ngIf=\"action.icon && action.title === null; else noIcon\"\n type=\"button\"\n pButton\n pRipple\n [icon]=\"action.icon\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false && ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n (click)=\"triggerAction($event)\"\n class=\"mng-action-button mng-action-button-icon p-button-rounded\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-primary]=\"action.level === 1\"\n [class.p-button-success]=\"action.level === 5\"\n [class.p-button-danger]=\"action.level === 7\"></button>\n <ng-template #noIcon>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [label]=\"($label | async) ?? ''\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false && ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n (click)=\"triggerAction($event)\"\n class=\"mng-action-button p-button-text\"\n [class.p-button-sm]=\"action.isSizeSmall\"\n [class.p-button-lg]=\"action.isSizeLarge\"\n [class.p-button-primary]=\"action.level === 1\"\n [class.p-button-success]=\"action.level === 5\"\n [class.p-button-danger]=\"action.level === 7\"></button>\n </ng-template>\n <p-confirmDialog *ngIf=\"action.hasRunConfirmation\" [key]=\"action.actionName + '_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n</ng-container>\n" }]
4416
+ }], ctorParameters: function () {
4417
+ return [{ type: i1.ActivatedRoute }, { type: i3$1.TranslateService }, { type: MngActionExecutorService }, { type: i2.ConfirmationService }, { type: MngViewContainerComponentService, decorators: [{
4418
+ type: Optional
4419
+ }] }];
4420
+ }, propDecorators: { action: [{
3977
4421
  type: Input
3978
4422
  }], item: [{
3979
4423
  type: Input
@@ -3981,23 +4425,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
3981
4425
  type: Input
3982
4426
  }], actionData: [{
3983
4427
  type: Input
4428
+ }], dataProvider: [{
4429
+ type: Input
4430
+ }], inputDisabled: [{
4431
+ type: Input,
4432
+ args: ['disabled']
4433
+ }], inputLoading: [{
4434
+ type: Input,
4435
+ args: ['loading']
4436
+ }], viewContainerInit: [{
4437
+ type: Input,
4438
+ args: ['viewContainer']
4439
+ }], triggerEventEmitter: [{
4440
+ type: Output,
4441
+ args: ['trigger']
3984
4442
  }] } });
3985
4443
 
3986
4444
  class MngActionRouteComponent {
3987
- constructor(router, route, confirmationService, navigationService, actionService, tableviewService) {
4445
+ constructor(router, route, confirmationService, navigationService, actionExecutor, viewContainerService) {
3988
4446
  this.router = router;
3989
4447
  this.route = route;
3990
4448
  this.confirmationService = confirmationService;
3991
4449
  this.navigationService = navigationService;
3992
- this.actionService = actionService;
3993
- this.tableviewService = tableviewService;
4450
+ this.actionExecutor = actionExecutor;
4451
+ this.viewContainerService = viewContainerService;
3994
4452
  this.cmpId = Math.random().toString(36).substring(2);
3995
4453
  this.actions = [];
3996
4454
  this.subscriptions = [];
3997
4455
  }
3998
4456
  ngOnInit() {
3999
4457
  var _a, _b;
4000
- 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 : [];
4458
+ 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 : [];
4001
4459
  const subscription = this.route.params.subscribe(p => {
4002
4460
  const action = this.findActiveAction(p);
4003
4461
  if (action) {
@@ -4020,6 +4478,7 @@ class MngActionRouteComponent {
4020
4478
  return `actionRoute_${this.cmpId}`;
4021
4479
  }
4022
4480
  activateAction(action, p, qp) {
4481
+ var _a;
4023
4482
  this.activeAction = action;
4024
4483
  const itemId = p['itemId'];
4025
4484
  const actionData = {};
@@ -4032,18 +4491,21 @@ class MngActionRouteComponent {
4032
4491
  for (const key in qp) {
4033
4492
  actionData[key] = p[key];
4034
4493
  }
4035
- this.actionService
4036
- .activateAction(action, itemId, undefined, actionData, this.tableviewService, this)
4494
+ this.actionExecutor
4495
+ .activateAction(action, itemId, undefined, actionData, (_a = this.viewContainerService) !== null && _a !== void 0 ? _a : undefined, this)
4037
4496
  .pipe(first())
4038
4497
  .subscribe(res => {
4039
4498
  var _a;
4040
4499
  if (res.dialogRef) {
4041
4500
  this.dialogRef = res.dialogRef;
4042
4501
  this.dialogCloseSubscription = (_a = this.dialogRef) === null || _a === void 0 ? void 0 : _a.onClose.subscribe(e => {
4043
- var _a;
4502
+ var _a, _b;
4044
4503
  const actionEv = e;
4045
4504
  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)) {
4046
- this.tableviewService.triggerTableReload(actionEv); // reload only if no error in action and
4505
+ if (!this.viewContainerService) {
4506
+ console.warn(`View container service could not be found, table reload will not be triggered.`);
4507
+ }
4508
+ (_b = this.viewContainerService) === null || _b === void 0 ? void 0 : _b.triggerTableReload(actionEv); // reload only if no error in action and
4047
4509
  }
4048
4510
  this.deactivateAction();
4049
4511
  });
@@ -4051,35 +4513,11 @@ class MngActionRouteComponent {
4051
4513
  });
4052
4514
  }
4053
4515
  deactivateAction() {
4054
- var _a, _b;
4055
4516
  if (this.dialogCloseSubscription) {
4056
4517
  this.dialogCloseSubscription.unsubscribe();
4057
4518
  this.dialogCloseSubscription = undefined;
4058
4519
  }
4059
- if (this.navigationService.getPreviousLocation()) {
4060
- // there are internal history records, so back can be normally called
4061
- this.navigationService.back();
4062
- }
4063
- else {
4064
- // there is no internal history records, figure out the base url by eliminating action specific url
4065
- let url = this.navigationService.getCurrentLocation();
4066
- if (!url) {
4067
- this.navigationService.back();
4068
- }
4069
- else {
4070
- if (url.startsWith('/')) {
4071
- url = url.substring(1);
4072
- }
4073
- const urlPathSegments = url.split('?')[0].split('#')[0].split('/');
4074
- let actionUrl = (_b = (_a = this.activeAction) === null || _a === void 0 ? void 0 : _a.routeUrl) !== null && _b !== void 0 ? _b : '';
4075
- if (actionUrl.startsWith('/')) {
4076
- actionUrl = actionUrl.substring(1);
4077
- }
4078
- const actionUrlSegments = actionUrl.split('/');
4079
- const redirectUrl = urlPathSegments.slice(0, urlPathSegments.length - actionUrlSegments.length).join('/');
4080
- this.router.navigateByUrl(`/${redirectUrl}`, { replaceUrl: true });
4081
- }
4082
- }
4520
+ this.actionExecutor.deactivateAction(this.activeAction);
4083
4521
  this.activeAction = undefined;
4084
4522
  this.dialogRef = undefined;
4085
4523
  }
@@ -4117,24 +4555,30 @@ class MngActionRouteComponent {
4117
4555
  return null;
4118
4556
  }
4119
4557
  }
4120
- 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 });
4121
- 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 });
4558
+ 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 });
4559
+ MngActionRouteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngActionRouteComponent, selector: "mng-action-route", providers: [MessageService, ConfirmationService], ngImport: i0, template: "<p-confirmDialog [key]=\"'actionRoute_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n", components: [{ type: i5.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4122
4560
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionRouteComponent, decorators: [{
4123
4561
  type: Component,
4124
4562
  args: [{ selector: 'mng-action-route', changeDetection: ChangeDetectionStrategy.OnPush, providers: [MessageService, ConfirmationService], template: "<p-confirmDialog [key]=\"'actionRoute_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n" }]
4125
- }], ctorParameters: function () { return [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2$1.ConfirmationService }, { type: MngNavigationService }, { type: MngActionService }, { type: TableviewComponentService }]; } });
4563
+ }], ctorParameters: function () {
4564
+ return [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2.ConfirmationService }, { type: MngNavigationService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService, decorators: [{
4565
+ type: Optional
4566
+ }] }];
4567
+ } });
4126
4568
 
4127
4569
  class MngComponentDirective {
4128
4570
  constructor(viewContainerRef) {
4129
4571
  this.viewContainerRef = viewContainerRef;
4572
+ this.componentInstanceEventEmitter = new EventEmitter();
4130
4573
  }
4131
4574
  ngOnInit() {
4132
4575
  this.viewContainerRef.clear();
4133
4576
  this.componentRef = this.viewContainerRef.createComponent(this.component);
4577
+ this.componentInstanceEventEmitter.next(this.componentRef.instance);
4134
4578
  }
4135
4579
  }
4136
4580
  MngComponentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngComponentDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
4137
- MngComponentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: MngComponentDirective, selector: "[mngComponent]", inputs: { component: ["mngComponent", "component"] }, ngImport: i0 });
4581
+ 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 });
4138
4582
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngComponentDirective, decorators: [{
4139
4583
  type: Directive,
4140
4584
  args: [{
@@ -4143,6 +4587,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4143
4587
  }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { component: [{
4144
4588
  type: Input,
4145
4589
  args: ['mngComponent']
4590
+ }], componentInstanceEventEmitter: [{
4591
+ type: Output,
4592
+ args: ['instanceCreated']
4146
4593
  }] } });
4147
4594
 
4148
4595
  class MngTemplateDirective {
@@ -4171,13 +4618,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4171
4618
  args: ['mngTemplate']
4172
4619
  }] } });
4173
4620
 
4174
- class MngFormEditorSubmitEvent {
4175
- constructor(formItem) {
4176
- this.formItem = formItem;
4177
- this.success = true;
4178
- }
4179
- }
4180
-
4181
4621
  class MngFormEditorComponent {
4182
4622
  constructor(translateService) {
4183
4623
  this.translateService = translateService;
@@ -4200,7 +4640,7 @@ class MngFormEditorComponent {
4200
4640
  this.subscriptions = [];
4201
4641
  }
4202
4642
  ngOnInit() {
4203
- this.updateFormModel(this.item);
4643
+ this.resetFormModel(this.item);
4204
4644
  this.submitLoading$ = this.submitLoading instanceof Observable ? this.submitLoading : of(this.submitLoading);
4205
4645
  // init fields for formly
4206
4646
  this.formFields = EditorFormlyUtil.createFormlyConfigFromDescriptor(this.descriptor);
@@ -4245,6 +4685,58 @@ class MngFormEditorComponent {
4245
4685
  });
4246
4686
  return formValue;
4247
4687
  }
4688
+ getFormField(key) {
4689
+ return this.findFormField(this.form, key.split('.'));
4690
+ }
4691
+ setFormFieldValue(key, value) {
4692
+ const control = this.getFormField(key);
4693
+ if (control) {
4694
+ control.setValue(value);
4695
+ }
4696
+ else {
4697
+ console.warn(`Value was not set, because field ${key} was not found.`);
4698
+ }
4699
+ }
4700
+ patchFormFieldValue(key, value) {
4701
+ const control = this.getFormField(key);
4702
+ if (control) {
4703
+ control.patchValue(value);
4704
+ }
4705
+ else {
4706
+ console.warn(`Value was not set, because field ${key} was not found.`);
4707
+ }
4708
+ }
4709
+ resetFormFieldValue(key, value) {
4710
+ const control = this.getFormField(key);
4711
+ if (control) {
4712
+ control.reset(value);
4713
+ }
4714
+ else {
4715
+ console.warn(`Value was not set, because field ${key} was not found.`);
4716
+ }
4717
+ }
4718
+ findFormField(control, keyPath) {
4719
+ if (keyPath.length === 0) {
4720
+ return control;
4721
+ }
4722
+ if (keyPath.length === 1) {
4723
+ return control.get(keyPath[0]);
4724
+ }
4725
+ let nextControl = null;
4726
+ if (control instanceof FormGroup) {
4727
+ nextControl = control.get(keyPath[0]);
4728
+ }
4729
+ else if (control instanceof FormArray) {
4730
+ const idx = +keyPath[0];
4731
+ if (!isNaN(idx)) {
4732
+ nextControl = control.at(idx);
4733
+ }
4734
+ }
4735
+ if (!control) {
4736
+ return null;
4737
+ }
4738
+ return this.findFormField(nextControl, keyPath.slice(1));
4739
+ }
4248
4740
  isAnyFieldInvalid(fields = []) {
4249
4741
  var _a;
4250
4742
  for (const field of fields) {
@@ -4261,7 +4753,7 @@ class MngFormEditorComponent {
4261
4753
  }
4262
4754
  return false;
4263
4755
  }
4264
- updateFormModel(item) {
4756
+ resetFormModel(item) {
4265
4757
  this.formOrigItem = item;
4266
4758
  // TODO: to check if this is ok, could be problems with dates, if so, try lodash
4267
4759
  const formModel = JSON.parse(JSON.stringify(item !== null && item !== void 0 ? item : {}));
@@ -4280,12 +4772,12 @@ class MngFormEditorComponent {
4280
4772
  this.formOptions.formState.disabled = this.isFormDisabled !== null ? this.isFormDisabled === true : this.descriptor.disabled;
4281
4773
  }
4282
4774
  }
4283
- 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 });
4284
- 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 });
4775
+ 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 });
4776
+ MngFormEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormEditorComponent, selector: "mng-form-editor", inputs: { descriptor: "descriptor", submitLoading: "submitLoading", item: "item", isSubmitButtonVisible: "isSubmitButtonVisible", isFormDisabled: "isFormDisabled" }, outputs: { formSubmitEventEmitter: "formSubmit" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "submitButtonElementRef", first: true, predicate: ["submitButton"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit($event)\">\n <formly-form [form]=\"form\" [fields]=\"formFields\" [options]=\"formOptions\" [model]=\"formModel\"></formly-form>\n <button #submitButton pButton type=\"submit\" [class.hidden]=\"!isSubmitButtonVisible\" [disabled]=\"form.disabled\" [loading]=\"(submitLoading$ | async) ?? false\"></button>\n</form>\n<p-messages [value]=\"formMessages\" [enableService]=\"false\"></p-messages>\n", components: [{ type: i3$2.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { type: i3$3.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: i4$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4285
4777
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormEditorComponent, decorators: [{
4286
4778
  type: Component,
4287
4779
  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" }]
4288
- }], ctorParameters: function () { return [{ type: i2$2.TranslateService }]; }, propDecorators: { descriptor: [{
4780
+ }], ctorParameters: function () { return [{ type: i3$1.TranslateService }]; }, propDecorators: { descriptor: [{
4289
4781
  type: Input
4290
4782
  }], submitLoading: [{
4291
4783
  type: Input
@@ -4353,11 +4845,14 @@ class MngAutocompleteComponent {
4353
4845
  if (event.query && event.query.length > 0 && this.itemsLabelProperty) {
4354
4846
  queryParamBuilder.withFilter(this.itemsLabelProperty, event.query, undefined, MediusFilterMatchType.StartsWith);
4355
4847
  }
4356
- this.searchSubscription = this.dataProvider.lookup(queryParamBuilder.build(), this.dataProviderService, event.query).subscribe((res) => {
4357
- this.suggestionsSubject.next(res);
4358
- this.isLoading = false;
4359
- }, () => {
4360
- this.isLoading = false;
4848
+ this.searchSubscription = this.dataProvider.lookup(queryParamBuilder.build(), this.dataProviderService, event.query).subscribe({
4849
+ next: (res) => {
4850
+ this.suggestionsSubject.next(res);
4851
+ this.isLoading = false;
4852
+ },
4853
+ error: () => {
4854
+ this.isLoading = false;
4855
+ }
4361
4856
  });
4362
4857
  }
4363
4858
  }
@@ -4384,7 +4879,7 @@ class MngAutocompleteComponent {
4384
4879
  }
4385
4880
  }
4386
4881
  MngAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngAutocompleteComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
4387
- 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 });
4882
+ MngAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: { dataProvider: "dataProvider", dataKeyProperty: "dataKeyProperty", itemsLabelProperty: "itemsLabelProperty", multiselect: "multiselect", placeholder: "placeholder", className: "className", dropdownClassName: "dropdownClassName" }, outputs: { valueChangeEventEmitter: "valueChange" }, providers: [MNG_AUTOCOMPLETE_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeAutocomplete", first: true, predicate: AutoComplete, descendants: true }], ngImport: i0, template: "<p-autoComplete\n [formControl]=\"autocompleteFormControl\"\n [placeholder]=\"$any(placeholder)\"\n [dropdown]=\"true\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [field]=\"$any(itemsLabelProperty)\"\n [suggestions]=\"(suggestions$ | async) ?? []\"\n [multiple]=\"multiselect\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'mngAutocomplete.noMatches' | translate\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n (completeMethod)=\"onSearch($event)\"\n (onSelect)=\"onSelect($event)\"\n appendTo=\"body\"\n dropdownMode=\"current\">\n</p-autoComplete>\n", components: [{ type: i1$1.AutoComplete, selector: "p-autoComplete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "virtualScroll", "itemSize", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "field", "scrollHeight", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "suggestions"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide"] }], directives: [{ type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "async": i4.AsyncPipe, "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4388
4883
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngAutocompleteComponent, decorators: [{
4389
4884
  type: Component,
4390
4885
  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" }]
@@ -4480,7 +4975,7 @@ class MngDropdownComponent {
4480
4975
  }
4481
4976
  }
4482
4977
  MngDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngDropdownComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
4483
- 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 });
4978
+ MngDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngDropdownComponent, selector: "mng-dropdown", inputs: { dataProvider: "dataProvider", dataKeyProperty: "dataKeyProperty", itemsLabelProperty: "itemsLabelProperty", itemsValueProperty: "itemsValueProperty", multiselect: "multiselect", placeholder: "placeholder", showClear: "showClear", selectFirstItem: "selectFirstItem", className: "className", dropdownClassName: "dropdownClassName" }, outputs: { valueChangeEventEmitter: "valueChange" }, providers: [MNG_DROPDOWN_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeDropdown", first: true, predicate: Dropdown, descendants: true }], ngImport: i0, template: "<p-dropdown\n *ngIf=\"!multiselect; else pMultiselect\"\n [formControl]=\"dropdownFormControl\"\n [placeholder]=\"$any(placeholder)\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [optionLabel]=\"$any(itemsLabelProperty)\"\n [optionValue]=\"$any(itemsValueProperty)\"\n [options]=\"$any(items$ | async)\"\n [showClear]=\"showClear\"\n [autoDisplayFirst]=\"false\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n appendTo=\"body\">\n</p-dropdown>\n<ng-template #pMultiselect>\n <p-multiSelect\n display=\"chip\"\n [formControl]=\"dropdownFormControl\"\n [defaultLabel]=\"$any(placeholder)\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [optionLabel]=\"$any(itemsLabelProperty)\"\n [optionValue]=\"$any(itemsValueProperty)\"\n [options]=\"(items$ | async) ?? []\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n [filter]=\"false\"\n appendTo=\"body\">\n </p-multiSelect>\n</ng-template>\n", components: [{ type: i1$2.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "virtualScroll", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "disabled", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear"] }, { type: i2$1.MultiSelect, selector: "p-multiSelect", inputs: ["style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "autoZIndex", "baseZIndex", "filterBy", "virtualScroll", "itemSize", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "scrollHeight", "defaultLabel", "placeholder", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onPanelShow", "onPanelHide"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4484
4979
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngDropdownComponent, decorators: [{
4485
4980
  type: Component,
4486
4981
  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" }]
@@ -4512,16 +5007,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4512
5007
  args: [Dropdown]
4513
5008
  }] } });
4514
5009
 
4515
- class MngActionDialogComponent {
4516
- constructor(injector, translate, dialogRef, dialogConfig, actionService, mngCommonsService) {
5010
+ class MngActionEditorComponent {
5011
+ constructor(injector, translate, actionExecutor, mngCommonsService, navigationService, dialogRef, dialogConfig, viewContainerService) {
4517
5012
  this.injector = injector;
4518
5013
  this.translate = translate;
5014
+ this.actionExecutor = actionExecutor;
5015
+ this.mngCommonsService = mngCommonsService;
5016
+ this.navigationService = navigationService;
4519
5017
  this.dialogRef = dialogRef;
4520
5018
  this.dialogConfig = dialogConfig;
4521
- this.actionService = actionService;
4522
- this.mngCommonsService = mngCommonsService;
5019
+ this.viewContainerService = viewContainerService;
5020
+ this.actionRunEventEmitter = new EventEmitter();
4523
5021
  this.cmpId = Math.random().toString(36).substring(2);
5022
+ this.isDialog = true;
4524
5023
  this.isSaveButton = true;
5024
+ // actions
5025
+ this.toolbarLeftActions = [];
5026
+ this.toolbarRightActions = [];
5027
+ this.footerLeftActions = [];
5028
+ this.footerRightActions = [];
4525
5029
  this.loadingSubject = new ReplaySubject(1);
4526
5030
  this.loading$ = this.loadingSubject.asObservable();
4527
5031
  this.submitLoadingSubject = new ReplaySubject(1);
@@ -4530,8 +5034,8 @@ class MngActionDialogComponent {
4530
5034
  this.subscriptions = [];
4531
5035
  }
4532
5036
  ngOnInit() {
4533
- var _a;
4534
- if (this.dialogConfig.data) {
5037
+ var _a, _b, _c;
5038
+ if ((_a = this.dialogConfig) === null || _a === void 0 ? void 0 : _a.data) {
4535
5039
  if (this.dialogConfig.data.action) {
4536
5040
  this.action = this.dialogConfig.data.action;
4537
5041
  }
@@ -4544,18 +5048,65 @@ class MngActionDialogComponent {
4544
5048
  if (this.dialogConfig.data.actionData) {
4545
5049
  this.actionData = this.dialogConfig.data.actionData;
4546
5050
  }
4547
- if (this.dialogConfig.data.tableview) {
4548
- this.tableviewService = this.dialogConfig.data.tableview;
4549
- if (!this.dataProvider && ((_a = this.tableviewService) === null || _a === void 0 ? void 0 : _a.dataProvider)) {
4550
- this.dataProvider = this.tableviewService.dataProvider;
5051
+ if (this.dialogConfig.data.viewContainer) {
5052
+ this.viewContainer = this.dialogConfig.data.viewContainer;
5053
+ if (!this.dataProvider && this.viewContainer) {
5054
+ const dataProvider = this.viewContainer.getDataProvider();
5055
+ if (dataProvider && typeof dataProvider['fetch'] === 'function') {
5056
+ this.dataProvider = dataProvider;
5057
+ }
4551
5058
  }
4552
5059
  }
4553
5060
  if (this.dialogConfig.data.sourceComponent) {
4554
5061
  this.sourceComponent = this.dialogConfig.data.sourceComponent;
4555
5062
  }
4556
5063
  }
5064
+ else {
5065
+ this.isDialog = false;
5066
+ this.viewContainer = (_c = (_b = this.viewContainerInit) !== null && _b !== void 0 ? _b : this.viewContainerService) !== null && _c !== void 0 ? _c : undefined;
5067
+ }
4557
5068
  this.isSaveButton = typeof this.action.submitFunction === 'function';
4558
- this.setDialogHeaderTitle();
5069
+ this.setTitle();
5070
+ for (const action of this.action.editorActions) {
5071
+ if (action instanceof ActionEditorSubmitDescriptor) {
5072
+ if (typeof action.icon === 'undefined') {
5073
+ action.withIcon(action.submitType === ActionEditorSubmitDescriptor.TypeEnum.Submit ? 'pi pi-check' : 'pi pi-times');
5074
+ }
5075
+ if (typeof action.title === 'undefined') {
5076
+ action.withTitle(action.submitType === ActionEditorSubmitDescriptor.TypeEnum.Submit ? 'general.save' : this.isDialog ? 'general.close' : 'general.cancel');
5077
+ }
5078
+ // assign run operations
5079
+ action.withRunNotificationSuccess(undefined, undefined, false);
5080
+ if (action.submitType === ActionEditorSubmitDescriptor.TypeEnum.Submit) {
5081
+ action.withRunFunction(ctx => {
5082
+ this.triggerSubmit();
5083
+ return of(undefined);
5084
+ });
5085
+ }
5086
+ else {
5087
+ action.withRunFunction(ctx => {
5088
+ this.cancel();
5089
+ return of(undefined);
5090
+ });
5091
+ }
5092
+ }
5093
+ switch (action.position) {
5094
+ case ActionPositionEnum.ToolbarLeft:
5095
+ this.toolbarLeftActions.push(action);
5096
+ break;
5097
+ case ActionPositionEnum.ToolbarRight:
5098
+ this.toolbarRightActions.push(action);
5099
+ break;
5100
+ case ActionPositionEnum.FooterLeft:
5101
+ this.footerLeftActions.push(action);
5102
+ break;
5103
+ case ActionPositionEnum.FooterRight:
5104
+ this.footerRightActions.push(action);
5105
+ break;
5106
+ }
5107
+ }
5108
+ this.toolbarRightActions = this.toolbarRightActions.reverse();
5109
+ this.footerRightActions = this.footerRightActions.reverse();
4559
5110
  this.loadItemWithDataProvider();
4560
5111
  }
4561
5112
  ngOnDestroy() {
@@ -4567,18 +5118,31 @@ class MngActionDialogComponent {
4567
5118
  return;
4568
5119
  }
4569
5120
  this.submitLoadingSubject.next(true);
4570
- this.actionService
4571
- .runEditorSave(this.action, this.itemId, event.formItem, this.dataProvider, this.sourceComponent, this.tableviewService, this.actionData)
4572
- .pipe(first(), finalize(() => this.submitLoadingSubject.next(false)))
4573
- .subscribe(res => {
4574
- this.closeDialog(res);
5121
+ this.actionExecutor
5122
+ .runEditorSave(this.action, this.itemId, event.formItem, this.dataProvider, this.sourceComponent, this.viewContainer, this.actionData)
5123
+ .pipe(first())
5124
+ .subscribe({
5125
+ next: res => {
5126
+ this.submitLoadingSubject.next(false);
5127
+ this.cancel(res);
5128
+ },
5129
+ error: () => {
5130
+ this.submitLoadingSubject.next(false);
5131
+ }
4575
5132
  });
4576
5133
  }
4577
5134
  }
4578
- closeDialog(result) {
4579
- this.dialogRef.close(result ? result : new ActionRunResult(undefined, undefined, new ActionError(null, true)));
5135
+ cancel(result) {
5136
+ var _a;
5137
+ if (!result) {
5138
+ result = new ActionRunResult(undefined, undefined, new ActionError(null, true));
5139
+ }
5140
+ if (this.isDialog) {
5141
+ (_a = this.dialogRef) === null || _a === void 0 ? void 0 : _a.close(result);
5142
+ }
5143
+ this.actionRunEventEmitter.next(result);
4580
5144
  }
4581
- saveItem() {
5145
+ triggerSubmit() {
4582
5146
  this.editorComponent.submit();
4583
5147
  }
4584
5148
  loadItemWithDataProvider() {
@@ -4586,48 +5150,62 @@ class MngActionDialogComponent {
4586
5150
  return;
4587
5151
  }
4588
5152
  this.loadingSubject.next(true);
4589
- this.actionService
4590
- .runEditorFetch(this.action, this.itemId, this.dataProvider, this.sourceComponent, this.tableviewService)
5153
+ this.actionExecutor
5154
+ .runEditorFetch(this.action, this.itemId, this.dataProvider, this.sourceComponent, this.viewContainer)
4591
5155
  .pipe(first(), catchError(err => {
4592
5156
  if (this.action.hasRunNotificationError) {
4593
- ToastUtil.actionNotificationError(this.translate, this.action, err, 'fetch', this.tableviewService, this.item);
5157
+ ToastUtil.actionNotificationError(this.translate, this.action, err, 'fetch', this.viewContainer, this.item);
4594
5158
  }
4595
5159
  throw err;
4596
5160
  }), finalize(() => this.loadingSubject.next(false)))
4597
5161
  .subscribe(res => {
4598
5162
  this.item = res.result;
4599
5163
  if (this.action.hasFetchNotificationSuccess) {
4600
- ToastUtil.actionNotificationSuccess(this.translate, this.action, 'fetch', this.action.fetchNotificationSuccessTitle, this.action.fetchNotificationSuccessMessage, this.tableviewService, this.item);
5164
+ ToastUtil.actionNotificationSuccess(this.translate, this.action, 'fetch', this.action.fetchNotificationSuccessTitle, this.action.fetchNotificationSuccessMessage, this.viewContainer, this.item);
4601
5165
  }
4602
- this.setDialogHeaderTitle();
5166
+ this.setTitle();
4603
5167
  });
4604
5168
  }
4605
- setDialogHeaderTitle() {
5169
+ setTitle() {
4606
5170
  if (this.action.editorTitle === null) {
4607
- requestAnimationFrame(() => {
4608
- this.dialogConfig.header = undefined;
4609
- });
5171
+ this.title = undefined;
5172
+ if (this.dialogConfig) {
5173
+ requestAnimationFrame(() => {
5174
+ this.dialogConfig.header = undefined;
5175
+ });
5176
+ }
4610
5177
  return;
4611
5178
  }
4612
- const subscription = I18nUtil.streamActionTranslation(this.translate, this.action, 'dialog.title', undefined, this.item)
5179
+ const subscription = I18nUtil.streamActionTranslation(this.translate, this.action, 'editor.title', this.action.editorTitle, this.item)
4613
5180
  .pipe(mergeMap(i18nDialogTitle => i18nDialogTitle === null
4614
- ? I18nUtil.getActionTranslation(this.translate, this.action, 'title', this.action.editorTitle, this.item)
5181
+ ? I18nUtil.getActionTranslation(this.translate, this.action, 'title', undefined, this.item)
4615
5182
  : of(i18nDialogTitle)))
4616
5183
  .subscribe(t => {
4617
- requestAnimationFrame(() => {
4618
- this.dialogConfig.header = t !== null && t !== void 0 ? t : undefined;
4619
- this.mngCommonsService.setPageTitle(t !== null && t !== void 0 ? t : undefined);
4620
- });
5184
+ this.title = t !== null && t !== void 0 ? t : undefined;
5185
+ if (this.dialogConfig) {
5186
+ requestAnimationFrame(() => {
5187
+ this.dialogConfig.header = t !== null && t !== void 0 ? t : undefined;
5188
+ this.mngCommonsService.setPageTitle(t !== null && t !== void 0 ? t : undefined);
5189
+ });
5190
+ }
4621
5191
  });
4622
5192
  this.subscriptions.push(subscription);
4623
5193
  }
4624
5194
  }
4625
- 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 });
4626
- 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 });
4627
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionDialogComponent, decorators: [{
5195
+ MngActionEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionEditorComponent, deps: [{ token: i0.Injector }, { token: i3$1.TranslateService }, { token: MngActionExecutorService }, { token: MngCommonsService }, { token: MngNavigationService }, { token: i3.DynamicDialogRef, optional: true }, { token: i3.DynamicDialogConfig, optional: true }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
5196
+ MngActionEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngActionEditorComponent, selector: "mng-action-editor", inputs: { action: "action", itemId: "itemId", item: "item", actionData: "actionData", dataProvider: "dataProvider", viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { actionRunEventEmitter: "actionSubmit" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "submitButtonElementRef", first: true, predicate: ["submitButton"], descendants: true }, { propertyName: "editorComponent", first: true, predicate: MngFormEditorComponent, descendants: true }], ngImport: i0, template: "<h2 *ngIf=\"!isDialog && title\">{{ title }}</h2>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <p-toolbar styleClass=\"mng-action-editor-toolbar\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n </p-toolbar>\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n\n <div class=\"flex flex-row justify-content-between\">\n <div>\n <mng-action *ngFor=\"let action of footerLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n <div>\n <mng-action *ngFor=\"let action of footerRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n </div>\n</div>\n", components: [{ type: i4$3.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }, { type: i6.ProgressSpinner, selector: "p-progressSpinner", inputs: ["style", "styleClass", "strokeWidth", "fill", "animationDuration"] }, { type: MngFormEditorComponent, selector: "mng-form-editor", inputs: ["descriptor", "submitLoading", "item", "isSubmitButtonVisible", "isFormDisabled"], outputs: ["formSubmit"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5197
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionEditorComponent, decorators: [{
4628
5198
  type: Component,
4629
- 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" }]
4630
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i2$2.TranslateService }, { type: i2.DynamicDialogRef }, { type: i2.DynamicDialogConfig }, { type: MngActionService }, { type: MngCommonsService }]; }, propDecorators: { action: [{
5199
+ args: [{ selector: 'mng-action-editor', changeDetection: ChangeDetectionStrategy.OnPush, template: "<h2 *ngIf=\"!isDialog && title\">{{ title }}</h2>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <p-toolbar styleClass=\"mng-action-editor-toolbar\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n </p-toolbar>\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n\n <div class=\"flex flex-row justify-content-between\">\n <div>\n <mng-action *ngFor=\"let action of footerLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n <div>\n <mng-action *ngFor=\"let action of footerRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n </div>\n</div>\n" }]
5200
+ }], ctorParameters: function () {
5201
+ return [{ type: i0.Injector }, { type: i3$1.TranslateService }, { type: MngActionExecutorService }, { type: MngCommonsService }, { type: MngNavigationService }, { type: i3.DynamicDialogRef, decorators: [{
5202
+ type: Optional
5203
+ }] }, { type: i3.DynamicDialogConfig, decorators: [{
5204
+ type: Optional
5205
+ }] }, { type: MngViewContainerComponentService, decorators: [{
5206
+ type: Optional
5207
+ }] }];
5208
+ }, propDecorators: { action: [{
4631
5209
  type: Input
4632
5210
  }], itemId: [{
4633
5211
  type: Input
@@ -4637,6 +5215,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4637
5215
  type: Input
4638
5216
  }], dataProvider: [{
4639
5217
  type: Input
5218
+ }], viewContainerInit: [{
5219
+ type: Input,
5220
+ args: ['viewContainer']
5221
+ }], actionRunEventEmitter: [{
5222
+ type: Output,
5223
+ args: ['actionSubmit']
4640
5224
  }], templates: [{
4641
5225
  type: ContentChildren,
4642
5226
  args: [MngTemplateDirective]
@@ -4655,10 +5239,10 @@ class MngFormlyFieldAutocompleteComponent extends FieldType {
4655
5239
  }
4656
5240
  }
4657
5241
  MngFormlyFieldAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldAutocompleteComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4658
- 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 });
5242
+ 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 });
4659
5243
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldAutocompleteComponent, decorators: [{
4660
5244
  type: Component,
4661
- 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" }]
5245
+ 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" }]
4662
5246
  }] });
4663
5247
 
4664
5248
  class MngFormlyFieldInputComponent extends FieldType {
@@ -4672,10 +5256,10 @@ class MngFormlyFieldInputComponent extends FieldType {
4672
5256
  }
4673
5257
  }
4674
5258
  MngFormlyFieldInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4675
- MngFormlyFieldInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldInputComponent, selector: "mng-formly-field-input", usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"option.value\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"option.value\" class=\"mng-radio-button-label\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <p-inputMask\n *ngSwitchCase=\"'mask'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [mask]=\"$any(descriptor.mask)\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [slotChar]=\"$any(descriptor.slotChar)\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n", components: [{ type: i1$3.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }, { type: i2$5.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabelledBy"], outputs: ["onChange"] }, { type: i3.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i4$3.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i5.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { type: i6$1.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "style", "inputId", "styleClass", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "disabled", "readonly", "unmask", "name", "required", "characterPattern", "autoFocus", "autocomplete", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown"] }], directives: [{ type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i4$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i10$1.InputText, selector: "[pInputText]" }], pipes: { "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5259
+ MngFormlyFieldInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldInputComponent, selector: "mng-formly-field-input", usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\"\n [inputStyleClass]=\"descriptor.inputClassName\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\" [class]=\"descriptor.labelClassName\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [styleClass]=\"descriptor.inputClassName\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton\n [name]=\"$any(key)\"\n [value]=\"option.value\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [styleClass]=\"descriptor.inputClassName\"></p-radioButton>\n <label [for]=\"option.value\" [class]=\"'mng-radio-button-label ' + descriptor.labelClassName\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea\n *ngSwitchCase=\"'textarea'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [rows]=\"descriptor.rows ?? 3\"\n pInputTextarea\n [class]=\"descriptor.inputClassName\">\n </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\"\n [inputStyleClass]=\"descriptor.inputClassName\">\n </p-calendar>\n\n <p-inputMask\n *ngSwitchCase=\"'mask'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [mask]=\"$any(descriptor.mask)\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [slotChar]=\"$any(descriptor.slotChar)\"\n [styleClass]=\"descriptor.inputClassName\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n", components: [{ type: i1$3.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }, { type: i2$2.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabelledBy"], outputs: ["onChange"] }, { type: i3$2.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i4$4.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i5$1.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { type: i6$1.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "style", "inputId", "styleClass", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "disabled", "readonly", "unmask", "name", "required", "characterPattern", "autoFocus", "autocomplete", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown"] }], directives: [{ type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$2.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i10.InputText, selector: "[pInputText]" }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4676
5260
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, decorators: [{
4677
5261
  type: Component,
4678
- args: [{ selector: 'mng-formly-field-input', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"option.value\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"option.value\" class=\"mng-radio-button-label\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <p-inputMask\n *ngSwitchCase=\"'mask'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [mask]=\"$any(descriptor.mask)\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [slotChar]=\"$any(descriptor.slotChar)\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n" }]
5262
+ 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" }]
4679
5263
  }] });
4680
5264
 
4681
5265
  class MngFormlyFieldDropdownComponent extends FieldType {
@@ -4685,10 +5269,10 @@ class MngFormlyFieldDropdownComponent extends FieldType {
4685
5269
  }
4686
5270
  }
4687
5271
  MngFormlyFieldDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldDropdownComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4688
- 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 });
5272
+ 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 });
4689
5273
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldDropdownComponent, decorators: [{
4690
5274
  type: Component,
4691
- 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" }]
5275
+ 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" }]
4692
5276
  }] });
4693
5277
 
4694
5278
  class MngTableLoadEvent {
@@ -4772,12 +5356,12 @@ class MngTableColumnFilterComponent {
4772
5356
  }
4773
5357
  }
4774
5358
  }
4775
- 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 });
4776
- 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 } });
5359
+ MngTableColumnFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnFilterComponent, deps: [{ token: i2.PrimeNGConfig }], target: i0.ɵɵFactoryTarget.Component });
5360
+ MngTableColumnFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: { descriptor: "descriptor", display: "display" }, ngImport: i0, template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n matchMode=\"equals\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\">\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"true\"\n (valueChange)=\"filterCallback($event)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n", components: [{ type: i4$5.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping"] }, { type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "multiselect", "placeholder", "className", "dropdownClassName"], outputs: ["valueChange"] }, { type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsValueProperty", "multiselect", "placeholder", "showClear", "selectFirstItem", "className", "dropdownClassName"], outputs: ["valueChange"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "translate": i3$1.TranslatePipe } });
4777
5361
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnFilterComponent, decorators: [{
4778
5362
  type: Component,
4779
5363
  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" }]
4780
- }], ctorParameters: function () { return [{ type: i2$1.PrimeNGConfig }]; }, propDecorators: { descriptor: [{
5364
+ }], ctorParameters: function () { return [{ type: i2.PrimeNGConfig }]; }, propDecorators: { descriptor: [{
4781
5365
  type: Input
4782
5366
  }], display: [{
4783
5367
  type: Input
@@ -4866,7 +5450,7 @@ class MngTableColumnValueComponent {
4866
5450
  }
4867
5451
  }
4868
5452
  MngTableColumnValueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4869
- 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 });
5453
+ MngTableColumnValueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: { descriptor: "descriptor", item: "item" }, ngImport: i0, template: "<ng-container [ngSwitch]=\"descriptor.columnType\">\n <ng-container *ngSwitchCase=\"columnTypeString\">\n {{ descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property] }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeNumber\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | number: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeDate\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | date: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeBoolean\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | boolean }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeEnum\">\n {{\n (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property])\n | enum: descriptor.enumType:descriptor.enumTitlePath:descriptor.enumNameAsValue\n | translate\n }}\n </ng-container>\n</ng-container>\n", directives: [{ type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "propertyPath": MngPropertyPathPipe, "number": i4.DecimalPipe, "date": i4.DatePipe, "boolean": MngBooleanPipe, "translate": i3$1.TranslatePipe, "enum": MngEnumPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4870
5454
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnValueComponent, decorators: [{
4871
5455
  type: Component,
4872
5456
  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" }]
@@ -4894,21 +5478,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4894
5478
  var TypeEnum = FilterDescriptor.TypeEnum;
4895
5479
  var PaginationModeEnum = TableDescriptor.PaginationModeEnum;
4896
5480
  class MngTableComponent {
4897
- constructor(injector, router, activatedRoute, translate, tableviewService) {
5481
+ constructor(injector, router, activatedRoute, translate, viewContainerService) {
4898
5482
  this.injector = injector;
4899
5483
  this.router = router;
4900
5484
  this.activatedRoute = activatedRoute;
4901
5485
  this.translate = translate;
4902
- this.tableviewService = tableviewService;
5486
+ this.viewContainerService = viewContainerService;
4903
5487
  this.filterDisplayRow = TableDescriptor.FilterDisplayEnum.Row;
4904
5488
  this.filterDisplayMenu = TableDescriptor.FilterDisplayEnum.Menu;
4905
5489
  this.useQueryParams = false;
4906
5490
  // extra features input
5491
+ this.selectionMode = 'multiple';
4907
5492
  this.selectionEnabled = false;
4908
5493
  // event outputs
4909
5494
  this.loadEventEmitter = new EventEmitter();
4910
5495
  this.cellClickEventEmitter = new EventEmitter();
4911
5496
  this.selectionChangeEventEmitter = new EventEmitter();
5497
+ this.captionCmpInstEventEmitter = new EventEmitter();
5498
+ this.columnActionCmpInstEventEmitter = new EventEmitter();
4912
5499
  // data provider and items
4913
5500
  this.useDataProvider = false;
4914
5501
  this.useQueryParamsInitialized = false;
@@ -5050,6 +5637,12 @@ class MngTableComponent {
5050
5637
  onSelectionChange(event) {
5051
5638
  this.selectionChangeEventEmitter.emit(event);
5052
5639
  }
5640
+ onCaptionCmpInst(instance) {
5641
+ this.captionCmpInstEventEmitter.next(instance);
5642
+ }
5643
+ onColumnActionCmpInst(instance) {
5644
+ this.columnActionCmpInstEventEmitter.next(instance);
5645
+ }
5053
5646
  loadTableWithDataProvider(queryParam = null, emitEvent = true) {
5054
5647
  var _a, _b, _c;
5055
5648
  if (!this.useDataProvider) {
@@ -5078,113 +5671,425 @@ class MngTableComponent {
5078
5671
  this.isSortChanged = false;
5079
5672
  this.dataProviderLoadingSubject.next(false);
5080
5673
  }, err => {
5081
- ToastUtil.tableNotificationError(this.translate, this.descriptor, err, this.tableviewService);
5674
+ var _a;
5675
+ ToastUtil.tableNotificationError(this.translate, this.descriptor, err, (_a = this.viewContainerService) !== null && _a !== void 0 ? _a : undefined);
5082
5676
  const emptyQueryResult = new MediusQueryResult();
5083
5677
  emptyQueryResult.pageData = [];
5084
5678
  emptyQueryResult.allDataCount = 0;
5085
5679
  this.dataProviderQueryResultSubject.next(emptyQueryResult);
5086
5680
  this.dataProviderLoadingSubject.next(false);
5087
5681
  });
5088
- if (emitEvent) {
5089
- const mngEvent = new MngTableLoadEvent();
5090
- mngEvent.originalEvent = (_c = this.dataProviderLatestLazyLoadEvent) !== null && _c !== void 0 ? _c : undefined;
5091
- mngEvent.queryParam = queryParam;
5092
- this.loadEventEmitter.next(mngEvent);
5682
+ if (emitEvent) {
5683
+ const mngEvent = new MngTableLoadEvent();
5684
+ mngEvent.originalEvent = (_c = this.dataProviderLatestLazyLoadEvent) !== null && _c !== void 0 ? _c : undefined;
5685
+ mngEvent.queryParam = queryParam;
5686
+ this.loadEventEmitter.next(mngEvent);
5687
+ }
5688
+ }
5689
+ loadTableFromRouteUpdate(params) {
5690
+ const mediusQueryParam = MediusRestUtil.fromAngularQueryParamsToMediusQueryParams(params, this.filterDescriptors, this.rowsPerPageOptions[0]);
5691
+ if (this.dataProviderLatestLazyLoadEventVersion < this.dataProviderLatestQueryParamVersion + 1) {
5692
+ // update only if new version from query params will be higher
5693
+ this.updatePrimeSortAndFilter(mediusQueryParam);
5694
+ }
5695
+ this.useQueryParamsInitialized = true;
5696
+ this.loadTableWithDataProvider(mediusQueryParam);
5697
+ }
5698
+ updatePrimeSortAndFilter(mediusQueryParam) {
5699
+ var _a, _b, _c, _d;
5700
+ const primeSortMeta = [];
5701
+ const primeFilterMeta = {};
5702
+ this.filterDescriptors.forEach(f => {
5703
+ primeFilterMeta[f.property] = {
5704
+ value: null,
5705
+ matchMode: f.filterType === TypeEnum.String ? 'contains' : 'equals'
5706
+ };
5707
+ });
5708
+ (_a = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.sortProperty) === null || _a === void 0 ? void 0 : _a.forEach((s, idx) => {
5709
+ var _a, _b;
5710
+ primeSortMeta.push({
5711
+ field: s,
5712
+ 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
5713
+ });
5714
+ });
5715
+ (_b = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.filterParams) === null || _b === void 0 ? void 0 : _b.forEach(f => {
5716
+ const descriptor = this.filterDescriptors.find(fd => fd.filterProperty === f.property || fd.property === f.property);
5717
+ const operator = MediusRestUtil.matchModeMapping.find(mapping => mapping[2] === f.filterMatchType);
5718
+ if (descriptor && operator) {
5719
+ primeFilterMeta[descriptor.property] = {
5720
+ value: f.filterValue,
5721
+ matchMode: operator[0]
5722
+ };
5723
+ }
5724
+ });
5725
+ this.multiSortMeta = primeSortMeta;
5726
+ this.filterMetadata = primeFilterMeta;
5727
+ this.rows = (_c = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.itemsPerPage) !== null && _c !== void 0 ? _c : this.rowsPerPageOptions[0];
5728
+ this.offset = (_d = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.itemsOffset) !== null && _d !== void 0 ? _d : 0;
5729
+ }
5730
+ getDefaultSortMeta() {
5731
+ if (this.descriptor.hasDefaultSort) {
5732
+ return this.descriptor.defaultSortProperty.map((p, idx) => ({
5733
+ field: p,
5734
+ order: this.descriptor.defaultSortAsc[idx] ? 1 : -1
5735
+ }));
5736
+ }
5737
+ else {
5738
+ return [];
5739
+ }
5740
+ }
5741
+ }
5742
+ 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 });
5743
+ MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableComponent, selector: "mng-table", inputs: { descriptor: "descriptor", items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", captionComponent: "captionComponent", columnActionComponent: "columnActionComponent" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + descriptor.tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [rowHover]=\"true\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n [selectionMode]=\"selectionMode\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.property | i18nProperty: descriptor.model | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.property | i18nProperty: descriptor.model | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" class=\"clickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate || columnActionComponent\" class=\"text-right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponent\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponent>\n <span [mngComponent]=\"columnActionComponent!\" (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", components: [{ type: i4$5.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { type: i4$5.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { type: i4$5.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { type: i4$5.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { type: i4$5.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { type: i7$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent"], outputs: ["instanceCreated"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$5.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4.AsyncPipe, "translate": i3$1.TranslatePipe, "i18nProperty": MngI18nPropertyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5744
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, decorators: [{
5745
+ type: Component,
5746
+ 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" }]
5747
+ }], ctorParameters: function () {
5748
+ return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i3$1.TranslateService }, { type: MngViewContainerComponentService, decorators: [{
5749
+ type: Optional
5750
+ }] }];
5751
+ }, propDecorators: { descriptor: [{
5752
+ type: Input
5753
+ }], items: [{
5754
+ type: Input
5755
+ }], queryResult: [{
5756
+ type: Input
5757
+ }], loading: [{
5758
+ type: Input
5759
+ }], dataProvider: [{
5760
+ type: Input
5761
+ }], useQueryParams: [{
5762
+ type: Input
5763
+ }], selectionMode: [{
5764
+ type: Input
5765
+ }], selectionEnabled: [{
5766
+ type: Input
5767
+ }], captionComponent: [{
5768
+ type: Input
5769
+ }], columnActionComponent: [{
5770
+ type: Input
5771
+ }], loadEventEmitter: [{
5772
+ type: Output,
5773
+ args: ['tableLoad']
5774
+ }], cellClickEventEmitter: [{
5775
+ type: Output,
5776
+ args: ['cellClick']
5777
+ }], selectionChangeEventEmitter: [{
5778
+ type: Output,
5779
+ args: ['selectionChange']
5780
+ }], captionCmpInstEventEmitter: [{
5781
+ type: Output,
5782
+ args: ['captionComponentInstance']
5783
+ }], columnActionCmpInstEventEmitter: [{
5784
+ type: Output,
5785
+ args: ['columnActionComponentInstance']
5786
+ }], templates: [{
5787
+ type: ContentChildren,
5788
+ args: [MngTemplateDirective]
5789
+ }], components: [{
5790
+ type: ViewChildren,
5791
+ args: [MngComponentDirective]
5792
+ }], primeTable: [{
5793
+ type: ViewChild,
5794
+ args: [Table]
5795
+ }] } });
5796
+
5797
+ class MngTableviewComponent {
5798
+ constructor(route, messageService, translateService, dialogService, confirmationService, actionExecutor, viewContainerService) {
5799
+ this.route = route;
5800
+ this.messageService = messageService;
5801
+ this.translateService = translateService;
5802
+ this.dialogService = dialogService;
5803
+ this.confirmationService = confirmationService;
5804
+ this.actionExecutor = actionExecutor;
5805
+ this.viewContainerService = viewContainerService;
5806
+ this.actions = [];
5807
+ this.tableComponent = null;
5808
+ this.rowClickActions = [];
5809
+ this.rowInlineActions = [];
5810
+ this.toolbarLeftActions = [];
5811
+ this.toolbarRightActions = [];
5812
+ this.subscriptions = [];
5813
+ }
5814
+ ngOnInit() {
5815
+ this.viewContainerService.actions = this.actions;
5816
+ if (this.dataProvider) {
5817
+ this.viewContainerService.dataProvider = this.dataProvider;
5818
+ }
5819
+ const reloadTableSubscription = this.viewContainerService.reloadTable$.subscribe(() => {
5820
+ this.reloadTable();
5821
+ });
5822
+ this.subscriptions.push(reloadTableSubscription);
5823
+ for (const action of this.actions) {
5824
+ switch (action.position) {
5825
+ case ActionPositionEnum.RowClick:
5826
+ this.rowClickActions.push(action);
5827
+ break;
5828
+ case ActionPositionEnum.RowInline:
5829
+ this.rowInlineActions.push(action);
5830
+ break;
5831
+ case ActionPositionEnum.ToolbarLeft:
5832
+ this.toolbarLeftActions.push(action);
5833
+ break;
5834
+ case ActionPositionEnum.ToolbarRight:
5835
+ this.toolbarRightActions.push(action);
5836
+ break;
5837
+ }
5838
+ }
5839
+ this.toolbarRightActions = this.toolbarRightActions.reverse();
5840
+ }
5841
+ ngOnDestroy() {
5842
+ this.subscriptions.forEach(s => s.unsubscribe());
5843
+ }
5844
+ getMessageService() {
5845
+ return this.messageService;
5846
+ }
5847
+ getDataProvider() {
5848
+ return this.dataProvider;
5849
+ }
5850
+ reloadTable() {
5851
+ var _a;
5852
+ (_a = this.tableComponent) === null || _a === void 0 ? void 0 : _a.reload();
5853
+ }
5854
+ onTableCellClick(event) {
5855
+ if (this.rowClickActions.length) {
5856
+ for (const action of this.rowClickActions) {
5857
+ this.actionExecutor.triggerRowClickAction(action, event, this.route);
5858
+ }
5859
+ }
5860
+ }
5861
+ }
5862
+ 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 });
5863
+ MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, MngViewContainerComponentService], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table [descriptor]=\"descriptor.table\" [dataProvider]=\"dataProvider\" [useQueryParams]=\"true\" (cellClick)=\"onTableCellClick($event)\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle | translate }}</h5>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\">\n </mng-action>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n", components: [{ type: i6$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: i4$3.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "translate": i3$1.TranslatePipe } });
5864
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, decorators: [{
5865
+ type: Component,
5866
+ 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" }]
5867
+ }], 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: [{
5868
+ type: Input
5869
+ }], dataProvider: [{
5870
+ type: Input
5871
+ }], actions: [{
5872
+ type: Input
5873
+ }], tableComponent: [{
5874
+ type: ViewChild,
5875
+ args: [MngTableComponent]
5876
+ }] } });
5877
+
5878
+ class AMngTableviewRouteComponent {
5879
+ ngOnInit() {
5880
+ this.descriptor = this.createTableviewDescriptor();
5881
+ this.dataProvider = this.createTableviewDataProvider();
5882
+ this.actions = this.createActionDescriptors();
5883
+ }
5884
+ createActionDescriptors() {
5885
+ const actions = [];
5886
+ actions.push(new ActionEditorDetailsDescriptor(this.descriptor.viewEditor));
5887
+ actions.push(new ActionEditorAddDescriptor(this.descriptor.addEditor));
5888
+ actions.push(new ActionEditorEditDescriptor(this.descriptor.editEditor));
5889
+ actions.push(new ActionDeleteDescriptor(this.descriptor.model));
5890
+ return actions;
5891
+ }
5892
+ }
5893
+ AMngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: AMngTableviewRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
5894
+ AMngTableviewRouteComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: AMngTableviewRouteComponent, ngImport: i0 });
5895
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: AMngTableviewRouteComponent, decorators: [{
5896
+ type: Directive
5897
+ }] });
5898
+
5899
+ class MngTableviewRouteComponent extends AMngTableviewRouteComponent {
5900
+ constructor(route) {
5901
+ super();
5902
+ this.route = route;
5903
+ }
5904
+ createTableviewDescriptor() {
5905
+ if (!this.route.snapshot.data['tableviewData'].descriptor) {
5906
+ throw Error('Tableview requires a descriptor.');
5907
+ }
5908
+ return this.route.snapshot.data['tableviewData'].descriptor;
5909
+ }
5910
+ createTableviewDataProvider() {
5911
+ if (!this.route.snapshot.data['tableviewData'].dataProvider) {
5912
+ throw Error('Tableview requires a data provider.');
5913
+ }
5914
+ return this.route.snapshot.data['tableviewData'].dataProvider;
5915
+ }
5916
+ createActionDescriptors() {
5917
+ var _a;
5918
+ return (_a = this.route.snapshot.data['tableviewData'].actions) !== null && _a !== void 0 ? _a : super.createActionDescriptors();
5919
+ }
5920
+ }
5921
+ MngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, deps: [{ token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
5922
+ 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"] }] });
5923
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, decorators: [{
5924
+ type: Component,
5925
+ 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" }]
5926
+ }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }]; } });
5927
+
5928
+ class MngFormlyFieldLookupDialogComponent extends FieldType {
5929
+ constructor(injector) {
5930
+ super();
5931
+ this.injector = injector;
5932
+ this.fieldLabelFormControl = new FormControl();
5933
+ this.itemsSubject = new ReplaySubject(1);
5934
+ this.itemsAsync = this.itemsSubject.asObservable();
5935
+ this.addItemsSubject = new ReplaySubject(1);
5936
+ this.addItemsAsync = this.addItemsSubject.asObservable();
5937
+ this.dialogUseDataProvider = false;
5938
+ this.dialogDataProviderService = null;
5939
+ this.dialogIsLoadingSubject = new ReplaySubject(1);
5940
+ this.isDialogVisible = false;
5941
+ this.dialogAreItemsLoaded = false;
5942
+ this.dialogSelectedItem = null;
5943
+ this.dialogMessages = [];
5944
+ this.dialogIsLoading$ = this.dialogIsLoadingSubject.asObservable();
5945
+ this.subscriptions = [];
5946
+ }
5947
+ ngOnInit() {
5948
+ var _a;
5949
+ this.descriptor = this.to['descriptor'];
5950
+ // emit lifecycle event
5951
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Component, MngFormlyFieldLookupDialogComponent, this, {
5952
+ eventSubtype: MngFormFieldEventComponentSubtype.ON_INIT
5953
+ });
5954
+ this.config = this.descriptor.config;
5955
+ if (!this.descriptor.lookupTableDataProvider && ((_a = this.descriptor.dataProvider) === null || _a === void 0 ? void 0 : _a.serviceType)) {
5956
+ this.dialogUseDataProvider = true;
5957
+ this.dialogDataProviderService = this.injector.get(this.descriptor.dataProvider.serviceType);
5093
5958
  }
5959
+ // init values
5960
+ this.setFieldLabelValue(this.formControl.value);
5961
+ const subscription = this.formControl.valueChanges.pipe(startWith(this.formControl.value), distinctUntilChanged((prev, curr) => {
5962
+ var _a;
5963
+ const compareProp = (_a = this.descriptor.lookupTableDescriptor.dataKeyProperty) !== null && _a !== void 0 ? _a : this.descriptor.lookupTableDescriptor.model.idPropertyName;
5964
+ if (compareProp && typeof prev === 'object' && typeof curr === 'object') {
5965
+ return prev[compareProp] === curr[compareProp];
5966
+ }
5967
+ else {
5968
+ return prev === curr;
5969
+ }
5970
+ })).subscribe(v => {
5971
+ this.setFieldLabelValue(v);
5972
+ this.itemsSubject.next(v);
5973
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.ValueChange, MngFormlyFieldLookupDialogComponent, this, {
5974
+ value: v
5975
+ });
5976
+ });
5977
+ this.subscriptions.push(subscription);
5094
5978
  }
5095
- loadTableFromRouteUpdate(params) {
5096
- const mediusQueryParam = MediusRestUtil.fromAngularQueryParamsToMediusQueryParams(params, this.filterDescriptors, this.rowsPerPageOptions[0]);
5097
- if (this.dataProviderLatestLazyLoadEventVersion < this.dataProviderLatestQueryParamVersion + 1) {
5098
- // update only if new version from query params will be higher
5099
- this.updatePrimeSortAndFilter(mediusQueryParam);
5100
- }
5101
- this.useQueryParamsInitialized = true;
5102
- this.loadTableWithDataProvider(mediusQueryParam);
5979
+ ngAfterViewInit() {
5980
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Component, MngFormlyFieldLookupDialogComponent, this, {
5981
+ eventSubtype: MngFormFieldEventComponentSubtype.ON_VIEW_INIT
5982
+ });
5103
5983
  }
5104
- updatePrimeSortAndFilter(mediusQueryParam) {
5105
- var _a, _b, _c, _d;
5106
- const primeSortMeta = [];
5107
- const primeFilterMeta = {};
5108
- this.filterDescriptors.forEach(f => {
5109
- primeFilterMeta[f.property] = {
5110
- value: null,
5111
- matchMode: f.filterType === TypeEnum.String ? 'contains' : 'equals'
5112
- };
5984
+ ngOnDestroy() {
5985
+ var _a, _b;
5986
+ (_a = this.lookupDataProviderSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
5987
+ this.subscriptions.forEach(s => s.unsubscribe());
5988
+ // emit lifecycle event
5989
+ (_b = this.descriptor) === null || _b === void 0 ? void 0 : _b.nextEvent(MngFormFieldEventTypeEnum.Component, MngFormlyFieldLookupDialogComponent, this, {
5990
+ eventSubtype: MngFormFieldEventComponentSubtype.ON_DESTROY
5113
5991
  });
5114
- (_a = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.sortProperty) === null || _a === void 0 ? void 0 : _a.forEach((s, idx) => {
5115
- var _a, _b;
5116
- primeSortMeta.push({
5117
- field: s,
5118
- 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
5992
+ }
5993
+ openSelectDialog() {
5994
+ var _a;
5995
+ if (!this.dialogAreItemsLoaded && this.dialogUseDataProvider) {
5996
+ this.dialogIsLoadingSubject.next(true);
5997
+ const queryParamBuilder = MediusQueryParamBuilder.create(50);
5998
+ if (this.descriptor.lookupTableDescriptor.hasDefaultSort) {
5999
+ this.descriptor.lookupTableDescriptor.defaultSortProperty.forEach((p, idx) => queryParamBuilder.withSort(p, this.descriptor.lookupTableDescriptor.defaultSortAsc[idx]));
6000
+ }
6001
+ this.lookupDataProviderSubscription = (_a = this.descriptor.dataProvider) === null || _a === void 0 ? void 0 : _a.lookup(queryParamBuilder.build(), this.dialogDataProviderService).subscribe({
6002
+ next: res => {
6003
+ const mqr = new MediusQueryResult();
6004
+ mqr.pageData = res;
6005
+ mqr.allDataCount = res.length;
6006
+ this.addItemsSubject.next(mqr);
6007
+ this.dialogAreItemsLoaded = true;
6008
+ this.dialogIsLoadingSubject.next(false);
6009
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.DataProvider, MngFormlyFieldLookupDialogComponent, this, {
6010
+ eventSubtype: 'LookupNext',
6011
+ queryResult: mqr
6012
+ });
6013
+ },
6014
+ error: err => {
6015
+ this.dialogIsLoadingSubject.next(false);
6016
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.DataProvider, MngFormlyFieldLookupDialogComponent, this, {
6017
+ eventSubtype: 'LookupError',
6018
+ queryResult: err
6019
+ });
6020
+ }
5119
6021
  });
6022
+ }
6023
+ this.dialogSelectedItem = null;
6024
+ this.isDialogVisible = true;
6025
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Dialog, MngFormlyFieldLookupDialogComponent, this, {
6026
+ eventSubtype: MngFormFieldEventDialogSubtype.VISIBILITY,
6027
+ dialogVisible: true
5120
6028
  });
5121
- (_b = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.filterParams) === null || _b === void 0 ? void 0 : _b.forEach(f => {
5122
- const descriptor = this.filterDescriptors.find(fd => fd.filterProperty === f.property || fd.property === f.property);
5123
- const operator = MediusRestUtil.matchModeMapping.find(mapping => mapping[2] === f.filterMatchType);
5124
- if (descriptor && operator) {
5125
- primeFilterMeta[descriptor.property] = {
5126
- value: f.filterValue,
5127
- matchMode: operator[0]
5128
- };
5129
- }
6029
+ }
6030
+ onSelectionChange(item) {
6031
+ this.dialogSelectedItem = item;
6032
+ }
6033
+ onCaptionCmpInst(instance) {
6034
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Dialog, MngFormlyFieldLookupDialogComponent, this, {
6035
+ eventSubtype: MngFormFieldEventDialogSubtype.TABLE_CAPTION_COMPONENT_INSTANCE,
6036
+ captionComponentInstance: instance
5130
6037
  });
5131
- this.multiSortMeta = primeSortMeta;
5132
- this.filterMetadata = primeFilterMeta;
5133
- this.rows = (_c = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.itemsPerPage) !== null && _c !== void 0 ? _c : this.rowsPerPageOptions[0];
5134
- this.offset = (_d = mediusQueryParam === null || mediusQueryParam === void 0 ? void 0 : mediusQueryParam.itemsOffset) !== null && _d !== void 0 ? _d : 0;
5135
6038
  }
5136
- getDefaultSortMeta() {
5137
- if (this.descriptor.hasDefaultSort) {
5138
- return this.descriptor.defaultSortProperty.map((p, idx) => ({
5139
- field: p,
5140
- order: this.descriptor.defaultSortAsc[idx] ? 1 : -1
5141
- }));
6039
+ onColumnActionCmpInst(instance) {
6040
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Dialog, MngFormlyFieldLookupDialogComponent, this, {
6041
+ eventSubtype: MngFormFieldEventDialogSubtype.TABLE_COLUMN_ACTIONS_COMPONENT_INSTANCE,
6042
+ captionComponentInstance: instance
6043
+ });
6044
+ }
6045
+ clear() {
6046
+ this.formControl.setValue(undefined);
6047
+ this.dialogSelectedItem = null;
6048
+ this.dialogAreItemsLoaded = false;
6049
+ this.hideDialog();
6050
+ }
6051
+ hideDialog() {
6052
+ this.isDialogVisible = false;
6053
+ this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Dialog, MngFormlyFieldLookupDialogComponent, this, {
6054
+ eventSubtype: MngFormFieldEventDialogSubtype.VISIBILITY,
6055
+ dialogVisible: false
6056
+ });
6057
+ }
6058
+ addItem() {
6059
+ this.formControl.setValue(this.dialogSelectedItem);
6060
+ this.dialogSelectedItem = null;
6061
+ this.dialogAreItemsLoaded = false;
6062
+ this.hideDialog();
6063
+ }
6064
+ setFieldLabelValue(value) {
6065
+ var _a, _b;
6066
+ if (!value) {
6067
+ this.fieldLabelFormControl.setValue('');
6068
+ return;
6069
+ }
6070
+ if (typeof value === 'object') {
6071
+ const labelProperty = (_a = this.descriptor.itemsLabelProperty) !== null && _a !== void 0 ? _a : (_b = this.descriptor.lookupTableDescriptor) === null || _b === void 0 ? void 0 : _b.model.titlePropertyName;
6072
+ if (!labelProperty) {
6073
+ throw new Error('Could not determine label property.');
6074
+ }
6075
+ this.fieldLabelFormControl.setValue(value[labelProperty]);
5142
6076
  }
5143
6077
  else {
5144
- return [];
6078
+ this.fieldLabelFormControl.setValue(value);
5145
6079
  }
5146
6080
  }
5147
6081
  }
5148
- 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 });
5149
- 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 });
5150
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, decorators: [{
6082
+ MngFormlyFieldLookupDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
6083
+ MngFormlyFieldLookupDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldLookupDialogComponent, selector: "mng-formly-field-lookup-dialog", viewQueries: [{ propertyName: "mngTable", first: true, predicate: MngTableComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div [class]=\"'p-inputgroup mng-dropdown-dialog' + descriptor.inputClassName\" [class.p-inputtext-sm]=\"descriptor.isSizeSmall\" [class.p-inputtext-lg]=\"descriptor.isSizeLarge\">\n <input pInputText type=\"text\" [id]=\"$any(key)\" [readonly]=\"true\" [formlyAttributes]=\"field\" [formControl]=\"fieldLabelFormControl\" />\n <i class=\"mng-dropdown-clear-icon pi pi-times\" (click)=\"clear()\" *ngIf=\"!to.required && formControl?.value\"></i>\n <button pButton pRipple class=\"mng-dropdown-dialog-search-button\" type=\"button\" [label]=\"'general.search' | translate: {item: ''}\" (click)=\"openSelectDialog()\"></button>\n</div>\n\n<p-dialog\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.search' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-table-multiselect-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.lookupTableDescriptor!\"\n [dataProvider]=\"descriptor.lookupTableDataProvider\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [selectionMode]=\"'single'\"\n [loading]=\"dialogIsLoading$\"\n [captionComponent]=\"config?.table?.captionComponent\"\n [columnActionComponent]=\"config?.table?.columnActionComponent\"\n (selectionChange)=\"onSelectionChange($event)\"\n (captionComponentInstance)=\"onCaptionCmpInst($event)\"\n (columnActionComponentInstance)=\"onColumnActionCmpInst($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.select' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItem()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: i1$4.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i3$3.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10.InputText, selector: "[pInputText]" }, { type: i3$2.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i3$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6084
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, decorators: [{
5151
6085
  type: Component,
5152
- 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" }]
5153
- }], ctorParameters: function () {
5154
- return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2$2.TranslateService }, { type: TableviewComponentService, decorators: [{
5155
- type: Optional
5156
- }] }];
5157
- }, propDecorators: { descriptor: [{
5158
- type: Input
5159
- }], items: [{
5160
- type: Input
5161
- }], queryResult: [{
5162
- type: Input
5163
- }], loading: [{
5164
- type: Input
5165
- }], dataProvider: [{
5166
- type: Input
5167
- }], useQueryParams: [{
5168
- type: Input
5169
- }], selectionEnabled: [{
5170
- type: Input
5171
- }], loadEventEmitter: [{
5172
- type: Output,
5173
- args: ['tableLoad']
5174
- }], cellClickEventEmitter: [{
5175
- type: Output,
5176
- args: ['cellClick']
5177
- }], selectionChangeEventEmitter: [{
5178
- type: Output,
5179
- args: ['selectionChange']
5180
- }], templates: [{
5181
- type: ContentChildren,
5182
- args: [MngTemplateDirective]
5183
- }], primeTable: [{
6086
+ 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" }]
6087
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { mngTable: [{
5184
6088
  type: ViewChild,
5185
- args: [Table]
6089
+ args: [MngTableComponent]
5186
6090
  }] } });
5187
6091
 
6092
+ var SizeEnum = ActionDescriptor.SizeEnum;
5188
6093
  class MngFormlyFieldTableDialogFormComponent extends FieldType {
5189
6094
  constructor() {
5190
6095
  super(...arguments);
@@ -5193,6 +6098,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5193
6098
  this.toolbarActions = [];
5194
6099
  this.rowActions = [];
5195
6100
  this.subscriptions = [];
6101
+ this.isDisabledSubject = new BehaviorSubject(false);
6102
+ this.isEnabled$ = this.isDisabledSubject.asObservable().pipe(distinctUntilChanged(), map(e => !e));
5196
6103
  }
5197
6104
  ngOnInit() {
5198
6105
  this.descriptor = this.to['descriptor'];
@@ -5204,6 +6111,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5204
6111
  .withTitle(null)
5205
6112
  .withIcon('pi pi-plus')
5206
6113
  .withClassName('mng-formly-field-table-form-dialog')
6114
+ .withSize(SizeEnum.ExtraSmall)
5207
6115
  .withSubmitFunction(ctx => {
5208
6116
  var _a;
5209
6117
  if (!((_a = ctx.data) === null || _a === void 0 ? void 0 : _a.item)) {
@@ -5215,7 +6123,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5215
6123
  this.formControl.patchValue(value);
5216
6124
  return of(ctx.data.item);
5217
6125
  })
5218
- .withIsVisibleFunction(() => { var _a; return of(!((_a = this.options) === null || _a === void 0 ? void 0 : _a.formState.disabled)); });
6126
+ .withIsVisibleFunction(() => { var _a; return of(!((_a = this.options) === null || _a === void 0 ? void 0 : _a.formState.disabled)); })
6127
+ .withIsEnabledFunction(() => this.isEnabled$);
5219
6128
  this.toolbarActions.push(addAction);
5220
6129
  }
5221
6130
  if (hasEditAction) {
@@ -5223,6 +6132,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5223
6132
  .withTitle(null)
5224
6133
  .withIcon('pi pi-pencil')
5225
6134
  .withClassName('mng-formly-field-table-form-dialog')
6135
+ .withSize(SizeEnum.ExtraSmall)
5226
6136
  .withSubmitFunction(ctx => {
5227
6137
  var _a, _b;
5228
6138
  if (!((_a = ctx.data) === null || _a === void 0 ? void 0 : _a.item)) {
@@ -5234,7 +6144,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5234
6144
  this.formControl.patchValue(formControlValue);
5235
6145
  return of(ctx.data.item);
5236
6146
  })
5237
- .withIsVisibleFunction(() => { var _a; return of(!((_a = this.options) === null || _a === void 0 ? void 0 : _a.formState.disabled)); });
6147
+ .withIsVisibleFunction(() => { var _a; return of(!((_a = this.formControl) === null || _a === void 0 ? void 0 : _a.disabled)); })
6148
+ .withIsEnabledFunction(() => this.isEnabled$);
5238
6149
  this.rowActions.push(editAction);
5239
6150
  }
5240
6151
  if (hasDeleteAction) {
@@ -5242,6 +6153,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5242
6153
  .withLevel(ActionLevelEnum.Danger)
5243
6154
  .withTitle(null)
5244
6155
  .withIcon('pi pi-trash')
6156
+ .withSize(SizeEnum.ExtraSmall)
5245
6157
  .withRunFunction(ctx => {
5246
6158
  var _a;
5247
6159
  if (!((_a = ctx.data) === null || _a === void 0 ? void 0 : _a.item)) {
@@ -5262,27 +6174,38 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
5262
6174
  this.formControl.patchValue(formControlValue);
5263
6175
  return of(ctx.data.item);
5264
6176
  })
5265
- .withIsVisibleFunction(() => { var _a; return of(!((_a = this.options) === null || _a === void 0 ? void 0 : _a.formState.disabled)); });
6177
+ .withIsVisibleFunction(() => { var _a; return of(!((_a = this.options) === null || _a === void 0 ? void 0 : _a.formState.disabled)); })
6178
+ .withIsEnabledFunction(() => this.isEnabled$);
5266
6179
  this.rowActions.push(deleteAction);
5267
6180
  }
5268
6181
  // init values
5269
6182
  if (typeof this.formControl.value === 'undefined' || this.formControl.value === null) {
5270
6183
  this.formControl.patchValue([]);
5271
6184
  }
5272
- const subscription = this.formControl.valueChanges.pipe(startWith(this.formControl.value)).subscribe(v => {
6185
+ let subscription = this.formControl.valueChanges.pipe(startWith(this.formControl.value)).subscribe(v => {
5273
6186
  this.itemsSubject.next(v);
5274
6187
  });
5275
6188
  this.subscriptions.push(subscription);
6189
+ this.isDisabledSubject.next(this.formControl.disabled);
6190
+ subscription = this.formControl.statusChanges.pipe().subscribe(status => {
6191
+ if (status === 'DISABLED' && !this.isDisabledSubject.value) {
6192
+ this.isDisabledSubject.next(true);
6193
+ }
6194
+ else if (status !== 'DISABLED' && this.isDisabledSubject.value) {
6195
+ this.isDisabledSubject.next(false);
6196
+ }
6197
+ });
6198
+ this.subscriptions.push(subscription);
5276
6199
  }
5277
6200
  ngOnDestroy() {
5278
6201
  this.subscriptions.forEach(s => s.unsubscribe());
5279
6202
  }
5280
6203
  }
5281
6204
  MngFormlyFieldTableDialogFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
5282
- 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 });
6205
+ MngFormlyFieldTableDialogFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTableDialogFormComponent, selector: "mng-formly-table-dialog-form-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <mng-action *ngFor=\"let action of toolbarActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\" let-idx=\"rowIndex\">\n <mng-action\n *ngFor=\"let action of rowActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.tableviewDescriptor.model.idPropertyName ? item[descriptor.tableviewDescriptor.model.idPropertyName] : undefined\"\n [actionData]=\"{itemIndex: idx}\">\n </mng-action>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"], components: [{ type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5283
6206
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, decorators: [{
5284
6207
  type: Component,
5285
- 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"] }]
6208
+ 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"] }]
5286
6209
  }] });
5287
6210
 
5288
6211
  class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
@@ -5340,12 +6263,15 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
5340
6263
  const filterValues = this.formControl.value.map((i) => i[this.descriptor.excludeValueProperty]);
5341
6264
  queryParamBuilder.withFilter(this.descriptor.excludeFilterProperty, filterValues, undefined, MediusFilterMatchType.NotIn);
5342
6265
  }
5343
- this.lookupDataProviderSubscription = (_a = this.descriptor.lookupTableDataProvider) === null || _a === void 0 ? void 0 : _a.getAll(queryParamBuilder.build(), this.dialogDataProviderService).subscribe(res => {
5344
- this.addItemsSubject.next(res);
5345
- this.dialogAreItemsLoaded = true;
5346
- this.dialogIsLoadingSubject.next(false);
5347
- }, () => {
5348
- this.dialogIsLoadingSubject.next(false);
6266
+ this.lookupDataProviderSubscription = (_a = this.descriptor.lookupTableDataProvider) === null || _a === void 0 ? void 0 : _a.getAll(queryParamBuilder.build(), this.dialogDataProviderService).subscribe({
6267
+ next: res => {
6268
+ this.addItemsSubject.next(res);
6269
+ this.dialogAreItemsLoaded = true;
6270
+ this.dialogIsLoadingSubject.next(false);
6271
+ },
6272
+ error: () => {
6273
+ this.dialogIsLoadingSubject.next(false);
6274
+ }
5349
6275
  });
5350
6276
  }
5351
6277
  this.dialogSelectedAddItems = [];
@@ -5390,16 +6316,16 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
5390
6316
  }
5391
6317
  }
5392
6318
  MngFormlyFieldTableDialogMultiselectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
5393
- 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 });
6319
+ MngFormlyFieldTableDialogMultiselectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTableDialogMultiselectComponent, selector: "mng-formly-table-multiselect-add-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.mainTableDescriptor\" [items]=\"itemsAsync\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header pt-0\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <button\n *ngIf=\"hasAddAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-success mng-button-xs\"\n (click)=\"openAddDialog()\"\n [disabled]=\"formControl!.disabled\"></button>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <button\n *ngIf=\"hasDeleteAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-danger mng-button-xs\"\n (click)=\"removeItem(item)\"\n [disabled]=\"formControl!.disabled\"></button>\n </ng-template>\n</mng-table>\n\n<p-dialog\n *ngIf=\"hasAddAction\"\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.addItem' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-table-multiselect-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.mainTableDescriptor\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [loading]=\"dialogIsLoading$\"\n (selectionChange)=\"onSelectionChange($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.add' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItems()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i1$4.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: i3$3.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i3$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5394
6320
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, decorators: [{
5395
6321
  type: Component,
5396
- 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" }]
6322
+ 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" }]
5397
6323
  }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
5398
6324
 
5399
6325
  class MngFormlyFieldTabsComponent extends FieldType {
5400
6326
  }
5401
6327
  MngFormlyFieldTabsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTabsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
5402
- 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 });
6328
+ MngFormlyFieldTabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTabsComponent, selector: "mng-formly-field-tabs", usesInheritance: true, ngImport: i0, template: "<p-tabView>\n <p-tabPanel\n *ngFor=\"let tab of field.fieldGroup; let i = index; let last = last\"\n [header]=\"tab.templateOptions?.label! | translate\"\n [headerStyleClass]=\"$any(formControl!.valid ? 'p-tabview-title' : null)\">\n <ng-template pTemplate=\"header\">\n <span\n class=\"p-tabview-title\"\n [class.p-tabview-title-error]=\"formState.submittedOn && formState['tab_' + (tab.id ? tab.id : tab.templateOptions?.label!) + '_invalid']\"\n >{{ tab.templateOptions?.label! | translate }}</span\n >\n </ng-template>\n <formly-field [field]=\"tab\"></formly-field>\n </p-tabPanel>\n</p-tabView>\n", components: [{ type: i1$5.TabView, selector: "p-tabView", inputs: ["orientation", "style", "styleClass", "controlClose", "scrollable", "activeIndex"], outputs: ["onChange", "onClose", "activeIndexChange"] }, { type: i1$5.TabPanel, selector: "p-tabPanel", inputs: ["closable", "headerStyle", "headerStyleClass", "cache", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "selected", "disabled", "header", "leftIcon", "rightIcon"] }, { type: i3$2.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5403
6329
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTabsComponent, decorators: [{
5404
6330
  type: Component,
5405
6331
  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" }]
@@ -5408,7 +6334,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
5408
6334
  class MngFormlyFieldFieldsetComponent extends FieldType {
5409
6335
  }
5410
6336
  MngFormlyFieldFieldsetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldFieldsetComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
5411
- 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 });
6337
+ MngFormlyFieldFieldsetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldFieldsetComponent, selector: "mng-formly-field-fieldset", usesInheritance: true, ngImport: i0, template: "<ng-container *ngFor=\"let group of field.fieldGroup; let i = index; let last = last\">\n <p-fieldset *ngIf=\"!group.templateOptions?.['descriptor']?.default; else defaultSet\" [legend]=\"group.templateOptions?.label! | translate\">\n <formly-field [field]=\"group\"></formly-field>\n </p-fieldset>\n <ng-template #defaultSet>\n <formly-field [field]=\"group\"></formly-field>\n </ng-template>\n</ng-container>\n", components: [{ type: i1$6.Fieldset, selector: "p-fieldset", inputs: ["legend", "toggleable", "collapsed", "style", "styleClass", "transitionOptions"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }, { type: i3$2.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5412
6338
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldFieldsetComponent, decorators: [{
5413
6339
  type: Component,
5414
6340
  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" }]
@@ -5417,19 +6343,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
5417
6343
  class MngFormlyFieldWrapperComponent extends FieldWrapper {
5418
6344
  }
5419
6345
  MngFormlyFieldWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
5420
- 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 });
6346
+ MngFormlyFieldWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldWrapperComponent, selector: "mng-formly-field-wrapper", usesInheritance: true, ngImport: i0, template: "<div class=\"field\">\n <label [for]=\"key\" [class]=\"to?.['descriptor']?.['labelClassName'] ?? ''\"\n >{{ $any(to?.label) | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label\n >\n <ng-container #fieldComponent></ng-container>\n <small *ngIf=\"to?.['descriptor']?.['helpText']\">{{ to?.['descriptor']?.['helpText'] | translate }}</small>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n</div>\n", components: [{ type: i3$2.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5421
6347
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldWrapperComponent, decorators: [{
5422
6348
  type: Component,
5423
- 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" }]
6349
+ 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" }]
5424
6350
  }] });
5425
6351
 
5426
6352
  class MngFormlyTableWrapperComponent extends FieldWrapper {
5427
6353
  }
5428
6354
  MngFormlyTableWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyTableWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
5429
- 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 });
6355
+ MngFormlyTableWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyTableWrapperComponent, selector: "mng-formly-table-wrapper", usesInheritance: true, ngImport: i0, template: "<div class=\"field table\">\n <ng-container #fieldComponent></ng-container>\n <small *ngIf=\"to?.['descriptor']?.['helpText']\">{{ to?.['descriptor']?.['helpText'] | translate }}</small>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n</div>\n", components: [{ type: i3$2.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5430
6356
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyTableWrapperComponent, decorators: [{
5431
6357
  type: Component,
5432
- 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" }]
6358
+ 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" }]
5433
6359
  }] });
5434
6360
 
5435
6361
  class MngBreadcrumbComponent {
@@ -5438,7 +6364,7 @@ class MngBreadcrumbComponent {
5438
6364
  }
5439
6365
  }
5440
6366
  MngBreadcrumbComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBreadcrumbComponent, deps: [{ token: MngCommonsService }], target: i0.ɵɵFactoryTarget.Component });
5441
- 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 });
6367
+ MngBreadcrumbComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngBreadcrumbComponent, selector: "mng-breadcrumb", ngImport: i0, template: "<div class=\"layout-breadcrumb-container\">\n <div class=\"layout-breadcrumb\">\n <p-breadcrumb [home]=\"$any(mngCommons.breadcrumbHome$ | async)\" [model]=\"$any(mngCommons.breadcrumbs$ | async)\" styleClass=\"layout-breadcrumb py-2\"></p-breadcrumb>\n </div>\n</div>\n", components: [{ type: i2$3.Breadcrumb, selector: "p-breadcrumb", inputs: ["model", "style", "styleClass", "home", "homeAriaLabel"], outputs: ["onItemClick"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5442
6368
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBreadcrumbComponent, decorators: [{
5443
6369
  type: Component,
5444
6370
  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" }]
@@ -5451,7 +6377,7 @@ class MngFooterComponent {
5451
6377
  }
5452
6378
  }
5453
6379
  MngFooterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFooterComponent, deps: [{ token: MngCommonsService }], target: i0.ɵɵFactoryTarget.Component });
5454
- 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 });
6380
+ 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 });
5455
6381
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFooterComponent, decorators: [{
5456
6382
  type: Component,
5457
6383
  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" }]
@@ -5789,7 +6715,7 @@ class MngMenuItemComponent {
5789
6715
  }
5790
6716
  }
5791
6717
  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 });
5792
- 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: [
6718
+ MngMenuItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: { item: "item", index: "index", root: "root", parentKey: "parentKey" }, host: { properties: { "class.layout-root-menuitem": "root", "class.active-menuitem": "active" } }, ngImport: i0, template: "<ng-container>\n <div *ngIf=\"root && item.visible !== false && (isAllowed$ | async) === true\" class=\"layout-menuitem-root-text\">{{ item.label! | translate }}</div>\n <a\n *ngIf=\"(!item.routerLink || item.items) && item.visible !== false && (isAllowed$ | async) === true\"\n [attr.href]=\"item.href\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (keydown.enter)=\"itemClick($event)\"\n [routerLink]=\"item.routerLink\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <a\n *ngIf=\"item.routerLink && !item.items && item.visible !== false && (isAllowed$ | async) === true\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"hover = true\"\n (mouseleave)=\"hover = false\"\n [routerLink]=\"item.routerLink\"\n routerLinkActive=\"active-menuitem-routerlink\"\n [routerLinkActiveOptions]=\"{exact: true}\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <ul\n *ngIf=\"((item.items && active) || (item.items && (mngCommons.menuModeIsStatic$ | async) && (root || active))) && item.visible !== false && (isAllowed$ | async) === true\"\n [@children]=\"\n (mngCommons.menuModeIsSlim$ | async) && (mainLayoutService.isMobile$ | async) === false && root\n ? active\n ? 'visible'\n : 'hidden'\n : (mngCommons.menuModeIsStatic$ | async) && root && (mainLayoutService.isMobile$ | async) === false\n ? 'visible'\n : active\n ? 'visibleAnimated'\n : 'hiddenAnimated'\n \">\n <ng-template ngFor let-child let-i=\"index\" [ngForOf]=\"item.items\">\n <li mng-menuitem [item]=\"child\" [index]=\"i\" [parentKey]=\"key\" [class]=\"child.badgeClassName\"></li>\n </ng-template>\n </ul>\n</ng-container>\n", components: [{ type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: ["item", "index", "root", "parentKey"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4.AsyncPipe, "translate": i3$1.TranslatePipe }, animations: [
5793
6719
  trigger('children', [
5794
6720
  state('void', style({
5795
6721
  height: '0px'
@@ -5859,7 +6785,7 @@ class MngMenuComponent {
5859
6785
  }
5860
6786
  }
5861
6787
  MngMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngMenuComponent, deps: [{ token: MngCommonsService }, { token: MngMainLayoutComponentService }], target: i0.ɵɵFactoryTarget.Component });
5862
- MngMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMenuComponent, selector: "mng-menu", ngImport: i0, template: "<div\n class=\"layout-menu-wrapper\"\n [ngClass]=\"{'layout-sidebar-active': (mainLayoutService.sidebarActive$ | async)}\"\n (click)=\"mainLayoutService.onSidebarClick($event)\"\n (mouseover)=\"mainLayoutService.onSidebarMouseOver($event)\"\n (mouseleave)=\"mainLayoutService.onSidebarMouseLeave($event)\">\n <div class=\"menu-logo\">\n <a routerLink=\"/\" class=\"logo\">\n <img [src]=\"mngCommons.colorSchemeIsLight ? mngCommons.appLogoDark : mngCommons.appLogoLight\" />\n </a>\n\n <a routerLink=\"/\" class=\"app-name\" *ngIf=\"(mngCommons.menuModeIsSlim$ | async) === false || (mainLayoutService.isMobile$ | async)\">\n <img [src]=\"mngCommons.colorSchemeIsLight ? mngCommons.appLogoNameDark : mngCommons.appLogoNameLight\" />\n </a>\n <a *ngIf=\"mngCommons.menuPinEnabled\" class=\"menu-pin\" (click)=\"mainLayoutService.onToggleMenu($event)\">\n <span *ngIf=\"mngCommons.menuModeIsOverlay$ | async\" class=\"pi pi-times\"></span>\n <span\n *ngIf=\"(mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async) === false && (mainLayoutService.pinActive$ | async)\"\n class=\"pi pi-unlock\"></span>\n <span *ngIf=\"(mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async) && (mainLayoutService.pinActive$ | async)\" class=\"pi pi-lock\"></span>\n </a>\n </div>\n\n <div class=\"layout-menu-container\">\n <ul class=\"layout-menu\">\n <ng-container *ngFor=\"let item of mngCommons.menuItems; let i = index\">\n <li mng-menuitem *ngIf=\"!item.separator\" [item]=\"item\" [index]=\"i\" [root]=\"true\"></li>\n <li *ngIf=\"item.separator\" class=\"menu-separator\"></li>\n </ng-container>\n </ul>\n </div>\n</div>\n", components: [{ type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: ["item", "index", "root", "parentKey"] }], directives: [{ type: i4$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6788
+ MngMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMenuComponent, selector: "mng-menu", ngImport: i0, template: "<div\n class=\"layout-menu-wrapper\"\n [ngClass]=\"{'layout-sidebar-active': (mainLayoutService.sidebarActive$ | async)}\"\n (click)=\"mainLayoutService.onSidebarClick($event)\"\n (mouseover)=\"mainLayoutService.onSidebarMouseOver($event)\"\n (mouseleave)=\"mainLayoutService.onSidebarMouseLeave($event)\">\n <div class=\"menu-logo\">\n <a routerLink=\"/\" class=\"logo\">\n <img [src]=\"mngCommons.colorSchemeIsLight ? mngCommons.appLogoDark : mngCommons.appLogoLight\" />\n </a>\n\n <a routerLink=\"/\" class=\"app-name\" *ngIf=\"(mngCommons.menuModeIsSlim$ | async) === false || (mainLayoutService.isMobile$ | async)\">\n <img [src]=\"mngCommons.colorSchemeIsLight ? mngCommons.appLogoNameDark : mngCommons.appLogoNameLight\" />\n </a>\n <a *ngIf=\"mngCommons.menuPinEnabled\" class=\"menu-pin\" (click)=\"mainLayoutService.onToggleMenu($event)\">\n <span *ngIf=\"mngCommons.menuModeIsOverlay$ | async\" class=\"pi pi-times\"></span>\n <span\n *ngIf=\"(mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async) === false && (mainLayoutService.pinActive$ | async)\"\n class=\"pi pi-unlock\"></span>\n <span *ngIf=\"(mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async) && (mainLayoutService.pinActive$ | async)\" class=\"pi pi-lock\"></span>\n </a>\n </div>\n\n <div class=\"layout-menu-container\">\n <ul class=\"layout-menu\">\n <ng-container *ngFor=\"let item of mngCommons.menuItems; let i = index\">\n <li mng-menuitem *ngIf=\"!item.separator\" [item]=\"item\" [index]=\"i\" [root]=\"true\"></li>\n <li *ngIf=\"item.separator\" class=\"menu-separator\"></li>\n </ng-container>\n </ul>\n </div>\n</div>\n", components: [{ type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: ["item", "index", "root", "parentKey"] }], directives: [{ type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5863
6789
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngMenuComponent, decorators: [{
5864
6790
  type: Component,
5865
6791
  args: [{ selector: 'mng-menu', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"layout-menu-wrapper\"\n [ngClass]=\"{'layout-sidebar-active': (mainLayoutService.sidebarActive$ | async)}\"\n (click)=\"mainLayoutService.onSidebarClick($event)\"\n (mouseover)=\"mainLayoutService.onSidebarMouseOver($event)\"\n (mouseleave)=\"mainLayoutService.onSidebarMouseLeave($event)\">\n <div class=\"menu-logo\">\n <a routerLink=\"/\" class=\"logo\">\n <img [src]=\"mngCommons.colorSchemeIsLight ? mngCommons.appLogoDark : mngCommons.appLogoLight\" />\n </a>\n\n <a routerLink=\"/\" class=\"app-name\" *ngIf=\"(mngCommons.menuModeIsSlim$ | async) === false || (mainLayoutService.isMobile$ | async)\">\n <img [src]=\"mngCommons.colorSchemeIsLight ? mngCommons.appLogoNameDark : mngCommons.appLogoNameLight\" />\n </a>\n <a *ngIf=\"mngCommons.menuPinEnabled\" class=\"menu-pin\" (click)=\"mainLayoutService.onToggleMenu($event)\">\n <span *ngIf=\"mngCommons.menuModeIsOverlay$ | async\" class=\"pi pi-times\"></span>\n <span\n *ngIf=\"(mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async) === false && (mainLayoutService.pinActive$ | async)\"\n class=\"pi pi-unlock\"></span>\n <span *ngIf=\"(mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async) && (mainLayoutService.pinActive$ | async)\" class=\"pi pi-lock\"></span>\n </a>\n </div>\n\n <div class=\"layout-menu-container\">\n <ul class=\"layout-menu\">\n <ng-container *ngFor=\"let item of mngCommons.menuItems; let i = index\">\n <li mng-menuitem *ngIf=\"!item.separator\" [item]=\"item\" [index]=\"i\" [root]=\"true\"></li>\n <li *ngIf=\"item.separator\" class=\"menu-separator\"></li>\n </ng-container>\n </ul>\n </div>\n</div>\n" }]
@@ -5901,7 +6827,7 @@ class MngTopbarComponent {
5901
6827
  }
5902
6828
  }
5903
6829
  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 });
5904
- 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 });
6830
+ MngTopbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTopbarComponent, selector: "mng-topbar", viewQueries: [{ propertyName: "templates", predicate: MngTemplateDirective, descendants: true }], ngImport: i0, template: "<div class=\"layout-topbar\">\n <div class=\"layout-topbar-left\">\n <a\n href=\"#\"\n class=\"topbar-menu-button\"\n (click)=\"mainLayoutService.onMenuButtonClick($event)\"\n *ngIf=\"(mngCommons.menuModeIsOverlay$ | async) || (mainLayoutService.isMobile$ | async)\">\n <i class=\"pi pi-bars\"></i>\n </a>\n\n <ng-container [mngComponent]=\"breadcrumbComponent\"></ng-container>\n </div>\n\n <ng-container [mngComponent]=\"menuComponent\"></ng-container>\n\n <div class=\"layout-topbar-right\">\n <ul class=\"layout-topbar-right-items\">\n <li #profile class=\"profile-item\" [ngClass]=\"{'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile}\">\n <a href=\"#\" (click)=\"mainLayoutService.onTopbarItemClick($event, profile)\">\n <i class=\"pi pi-fw pi-user\"></i>\n </a>\n <ul class=\"fadeInDown\" *ngIf=\"user\">\n <li role=\"menuitem\">\n <a>\n {{ user?.displayName ?? user?.username }}\n </a>\n </li>\n <li role=\"menuitem\" *ngIf=\"user?.logout || user?.logoutUrl\">\n <a [href]=\"user?.logoutUrl\" (click)=\"logout(user, $event)\">\n <i class=\"pi pi-fw pi-sign-out\"></i>\n <span>{{ 'mngTopbar.logout' | translate }}</span>\n </a>\n </li>\n </ul>\n </li>\n <li *ngIf=\"languages.length > 1\" class=\"profile-item\" [ngClass]=\"{'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile}\">\n <i class=\"pi pi-fw pi-globe\"></i>\n <p-dropdown [ngModel]=\"selectedLanguage\" [options]=\"languages\" (onChange)=\"switchLanguage($event.value)\"></p-dropdown>\n </li>\n </ul>\n </div>\n</div>\n", components: [{ type: i1$2.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "virtualScroll", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "disabled", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent"], outputs: ["instanceCreated"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "async": i4.AsyncPipe, "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5905
6831
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTopbarComponent, decorators: [{
5906
6832
  type: Component,
5907
6833
  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" }]
@@ -5939,7 +6865,7 @@ class MngMainLayoutComponent {
5939
6865
  }
5940
6866
  }
5941
6867
  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 });
5942
- 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 });
6868
+ MngMainLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMainLayoutComponent, selector: "mng-main-layout", host: { listeners: { "window:resize": "onWindowResize($event)" } }, providers: [MngMainLayoutComponentService], viewQueries: [{ propertyName: "templates", predicate: MngTemplateDirective, descendants: true }], ngImport: i0, template: "<div\n class=\"layout-wrapper\"\n (click)=\"mainLayoutService.onLayoutClick()\"\n [ngClass]=\"{\n 'layout-static': mngCommons.menuModeIsStatic$ | async,\n 'layout-overlay': mngCommons.menuModeIsOverlay$ | async,\n 'layout-slim': mngCommons.menuModeIsSlim$ | async,\n 'layout-sidebar': mngCommons.menuModeIsSidebar$ | async,\n 'layout-sidebar-static': (mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async),\n 'layout-overlay-active': mainLayoutService.overlayMenuActive$ | async,\n 'layout-mobile-active': mainLayoutService.staticMenuMobileActive$ | async,\n 'layout-static-inactive': (mainLayoutService.staticMenuDesktopInactive$ | async) && (mngCommons.menuModeIsStatic$ | async)\n }\">\n <div class=\"layout-main\">\n <ng-container [mngComponent]=\"topbarComponent\"></ng-container>\n\n <ng-container\n *ngIf=\"\n (mainLayoutService.isMobile$ | async) === false &&\n ((mngCommons.menuModeIsStatic$ | async) || (mngCommons.menuModeIsSlim$ | async) || (mngCommons.menuModeIsSidebar$ | async))\n \"\n [mngComponent]=\"menuComponent\">\n </ng-container>\n\n <div class=\"layout-main-content\">\n <router-outlet></router-outlet>\n </div>\n\n <ng-container [mngComponent]=\"footerComponent\"></ng-container>\n </div>\n</div>\n", directives: [{ type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent"], outputs: ["instanceCreated"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5943
6869
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngMainLayoutComponent, decorators: [{
5944
6870
  type: Component,
5945
6871
  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" }]
@@ -5951,129 +6877,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
5951
6877
  args: ['window:resize', ['$event']]
5952
6878
  }] } });
5953
6879
 
5954
- class MngTableviewComponent {
5955
- constructor(route, messageService, translateService, dialogService, confirmationService, actionService, tableviewService) {
5956
- this.route = route;
5957
- this.messageService = messageService;
5958
- this.translateService = translateService;
5959
- this.dialogService = dialogService;
5960
- this.confirmationService = confirmationService;
5961
- this.actionService = actionService;
5962
- this.tableviewService = tableviewService;
5963
- this.actions = [];
5964
- this.tableComponent = null;
5965
- this.rowClickActions = [];
5966
- this.rowInlineActions = [];
5967
- this.toolbarLeftActions = [];
5968
- this.toolbarRightActions = [];
5969
- this.subscriptions = [];
5970
- }
5971
- ngOnInit() {
5972
- this.tableviewService.actions = this.actions;
5973
- this.tableviewService.dataProvider = this.dataProvider;
5974
- this.tableviewService.messageService = this.messageService;
5975
- const reloadTableSubscription = this.tableviewService.reloadTable$.subscribe(() => {
5976
- this.reloadTable();
5977
- });
5978
- this.subscriptions.push(reloadTableSubscription);
5979
- for (const action of this.actions) {
5980
- switch (action.position) {
5981
- case ActionPositionEnum.RowClick:
5982
- this.rowClickActions.push(action);
5983
- break;
5984
- case ActionPositionEnum.RowInline:
5985
- this.rowInlineActions.push(action);
5986
- break;
5987
- case ActionPositionEnum.ToolbarLeft:
5988
- this.toolbarLeftActions.push(action);
5989
- break;
5990
- case ActionPositionEnum.ToolbarRight:
5991
- this.toolbarRightActions.push(action);
5992
- break;
5993
- }
5994
- }
5995
- }
5996
- ngOnDestroy() {
5997
- this.subscriptions.forEach(s => s.unsubscribe());
5998
- }
5999
- reloadTable() {
6000
- var _a;
6001
- (_a = this.tableComponent) === null || _a === void 0 ? void 0 : _a.reload();
6002
- }
6003
- onTableCellClick(event) {
6004
- if (this.rowClickActions.length) {
6005
- for (const action of this.rowClickActions) {
6006
- this.actionService.triggerRowClickAction(action, event, this.route);
6007
- }
6008
- }
6009
- }
6010
- }
6011
- 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 });
6012
- 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 } });
6013
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, decorators: [{
6014
- type: Component,
6015
- 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" }]
6016
- }], 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: [{
6017
- type: Input
6018
- }], dataProvider: [{
6019
- type: Input
6020
- }], actions: [{
6021
- type: Input
6022
- }], tableComponent: [{
6023
- type: ViewChild,
6024
- args: [MngTableComponent]
6025
- }] } });
6026
-
6027
- class AMngTableviewRouteComponent {
6028
- ngOnInit() {
6029
- this.descriptor = this.createTableviewDescriptor();
6030
- this.dataProvider = this.createTableviewDataProvider();
6031
- this.actions = this.createActionDescriptors();
6032
- }
6033
- createActionDescriptors() {
6034
- const actions = [];
6035
- actions.push(new ActionEditorDetailsDescriptor(this.descriptor.viewEditor));
6036
- actions.push(new ActionEditorAddDescriptor(this.descriptor.addEditor));
6037
- actions.push(new ActionEditorEditDescriptor(this.descriptor.editEditor));
6038
- actions.push(new ActionDeleteDescriptor(this.descriptor.model));
6039
- return actions;
6040
- }
6041
- }
6042
- AMngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: AMngTableviewRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
6043
- AMngTableviewRouteComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: AMngTableviewRouteComponent, ngImport: i0 });
6044
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: AMngTableviewRouteComponent, decorators: [{
6045
- type: Directive
6046
- }] });
6047
-
6048
- class MngTableviewRouteComponent extends AMngTableviewRouteComponent {
6049
- constructor(route) {
6050
- super();
6051
- this.route = route;
6052
- }
6053
- createTableviewDescriptor() {
6054
- if (!this.route.snapshot.data['tableviewData'].descriptor) {
6055
- throw Error('Tableview requires a descriptor.');
6056
- }
6057
- return this.route.snapshot.data['tableviewData'].descriptor;
6058
- }
6059
- createTableviewDataProvider() {
6060
- if (!this.route.snapshot.data['tableviewData'].dataProvider) {
6061
- throw Error('Tableview requires a data provider.');
6062
- }
6063
- return this.route.snapshot.data['tableviewData'].dataProvider;
6064
- }
6065
- createActionDescriptors() {
6066
- var _a;
6067
- return (_a = this.route.snapshot.data['tableviewData'].actions) !== null && _a !== void 0 ? _a : super.createActionDescriptors();
6068
- }
6069
- }
6070
- MngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, deps: [{ token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
6071
- 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"] }] });
6072
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, decorators: [{
6073
- type: Component,
6074
- 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" }]
6075
- }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }]; } });
6076
-
6077
6880
  function mngCommonsInitializerProvider(mngCommons) {
6078
6881
  return () => mngCommons.initialize();
6079
6882
  }
@@ -6183,6 +6986,11 @@ const formlyTypesConfig = [
6183
6986
  component: MngFormlyFieldAutocompleteComponent,
6184
6987
  wrappers: ['field']
6185
6988
  },
6989
+ {
6990
+ name: 'dialog',
6991
+ component: MngFormlyFieldLookupDialogComponent,
6992
+ wrappers: ['field']
6993
+ },
6186
6994
  {
6187
6995
  name: 'table-dialog-multiselect',
6188
6996
  component: MngFormlyFieldTableDialogMultiselectComponent,
@@ -6348,6 +7156,7 @@ const declarations = [
6348
7156
  MngFormlyFieldInputComponent,
6349
7157
  MngFormlyFieldDropdownComponent,
6350
7158
  MngFormlyFieldAutocompleteComponent,
7159
+ MngFormlyFieldLookupDialogComponent,
6351
7160
  MngFormlyFieldTableDialogMultiselectComponent,
6352
7161
  MngFormlyFieldTableDialogFormComponent,
6353
7162
  MngFormlyFieldTabsComponent,
@@ -6361,7 +7170,7 @@ const declarations = [
6361
7170
  // editor components
6362
7171
  MngFormEditorComponent,
6363
7172
  MngActionComponent,
6364
- MngActionDialogComponent,
7173
+ MngActionEditorComponent,
6365
7174
  MngActionRouteComponent
6366
7175
  ];
6367
7176
  class MngCommonsModule {
@@ -6373,12 +7182,12 @@ class MngCommonsModule {
6373
7182
  DialogService,
6374
7183
  MessageService,
6375
7184
  ConfirmationService,
6376
- MngActionService,
7185
+ MngActionExecutorService,
6377
7186
  MngNavigationService,
6378
7187
  MngCommonsService,
6379
7188
  // component service
6380
7189
  MngMainLayoutComponentService,
6381
- TableviewComponentService,
7190
+ MngViewContainerComponentService,
6382
7191
  {
6383
7192
  provide: MNG_MODULE_CONFIG_IT,
6384
7193
  useValue: config
@@ -6409,6 +7218,14 @@ class MngCommonsModule {
6409
7218
  multi: true,
6410
7219
  useFactory: mngFormlyConfigProvider,
6411
7220
  deps: [TranslateService, MNG_MODULE_CONFIG_IT]
7221
+ },
7222
+ {
7223
+ provide: ACTION_EDITOR_DIALOG_COMPONENT_SETTING,
7224
+ useValue: MngActionEditorComponent
7225
+ },
7226
+ {
7227
+ provide: MngErrorMapperService,
7228
+ useClass: DefaultMngErrorMapperService
6412
7229
  }
6413
7230
  ]
6414
7231
  };
@@ -6441,6 +7258,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
6441
7258
  MngFormlyFieldInputComponent,
6442
7259
  MngFormlyFieldDropdownComponent,
6443
7260
  MngFormlyFieldAutocompleteComponent,
7261
+ MngFormlyFieldLookupDialogComponent,
6444
7262
  MngFormlyFieldTableDialogMultiselectComponent,
6445
7263
  MngFormlyFieldTableDialogFormComponent,
6446
7264
  MngFormlyFieldTabsComponent,
@@ -6454,14 +7272,14 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
6454
7272
  // editor components
6455
7273
  MngFormEditorComponent,
6456
7274
  MngActionComponent,
6457
- MngActionDialogComponent,
7275
+ MngActionEditorComponent,
6458
7276
  MngActionRouteComponent
6459
7277
  ], imports: [
6460
7278
  // angular modules
6461
7279
  CommonModule,
6462
7280
  RouterModule,
6463
7281
  HttpClientModule,
6464
- ReactiveFormsModule, i2$2.TranslateModule, i3.FormlyModule, AutoCompleteModule,
7282
+ ReactiveFormsModule, i3$1.TranslateModule, i3$2.FormlyModule, AutoCompleteModule,
6465
7283
  BreadcrumbModule,
6466
7284
  ButtonModule,
6467
7285
  CalendarModule,
@@ -6554,6 +7372,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
6554
7372
  MngFormlyFieldInputComponent,
6555
7373
  MngFormlyFieldDropdownComponent,
6556
7374
  MngFormlyFieldAutocompleteComponent,
7375
+ MngFormlyFieldLookupDialogComponent,
6557
7376
  MngFormlyFieldTableDialogMultiselectComponent,
6558
7377
  MngFormlyFieldTableDialogFormComponent,
6559
7378
  MngFormlyFieldTabsComponent,
@@ -6567,7 +7386,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
6567
7386
  // editor components
6568
7387
  MngFormEditorComponent,
6569
7388
  MngActionComponent,
6570
- MngActionDialogComponent,
7389
+ MngActionEditorComponent,
6571
7390
  MngActionRouteComponent] });
6572
7391
  MngCommonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsModule, imports: [[
6573
7392
  // angular modules
@@ -6643,54 +7462,59 @@ class AMngCrudApiService {
6643
7462
  this.http = http;
6644
7463
  this.objectSerializer = ObjectSerializer.get();
6645
7464
  }
6646
- createPost(item) {
6647
- const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getCreatePostPath()}`;
7465
+ createPost(item, params) {
7466
+ const url = `${this.getBasePath()}${this.getServiceBasePath()}${this.getCreatePostPath()}`;
6648
7467
  return this.http
6649
7468
  .post(url, this.objectSerializer.serializeClass(item, this.type), {
6650
7469
  withCredentials: true,
6651
7470
  observe: 'body',
6652
- reportProgress: false
7471
+ reportProgress: false,
7472
+ params: params
6653
7473
  })
6654
7474
  .pipe(map(res => this.objectSerializer.deserializeClass(res, this.type)));
6655
7475
  }
6656
- getAllPost(queryParam) {
6657
- const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getGetAllPostPath()}`;
7476
+ getAllPost(queryParamBody, params) {
7477
+ const url = `${this.getBasePath()}${this.getServiceBasePath()}${this.getGetAllPostPath()}`;
6658
7478
  return this.http
6659
- .post(url, this.objectSerializer.serialize(queryParam, 'QueryParam'), {
7479
+ .post(url, this.objectSerializer.serialize(queryParamBody, 'QueryParam'), {
6660
7480
  withCredentials: true,
6661
7481
  observe: 'body',
6662
- reportProgress: false
7482
+ reportProgress: false,
7483
+ params: params
6663
7484
  })
6664
7485
  .pipe(map(res => this.objectSerializer.deserializeClass(res, this.queryResultType)));
6665
7486
  }
6666
- getByIdGet(id) {
6667
- const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getGetByIdGetPath(id)}`;
7487
+ getByIdGet(id, params) {
7488
+ const url = `${this.getBasePath()}${this.getServiceBasePath()}${this.getGetByIdGetPath(id)}`;
6668
7489
  return this.http
6669
7490
  .get(url, {
6670
7491
  withCredentials: true,
6671
7492
  observe: 'body',
6672
- reportProgress: false
7493
+ reportProgress: false,
7494
+ params: params
6673
7495
  })
6674
7496
  .pipe(map(res => this.objectSerializer.deserializeClass(res, this.type)));
6675
7497
  }
6676
- updatePut(id, item) {
6677
- const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getUpdatePutPath(id, item)}`;
7498
+ updatePut(id, item, params) {
7499
+ const url = `${this.getBasePath()}${this.getServiceBasePath()}${this.getUpdatePutPath(id, item)}`;
6678
7500
  return this.http
6679
7501
  .put(url, this.objectSerializer.serializeClass(item, this.type), {
6680
7502
  withCredentials: true,
6681
7503
  observe: 'body',
6682
- reportProgress: false
7504
+ reportProgress: false,
7505
+ params: params
6683
7506
  })
6684
7507
  .pipe(map(res => this.objectSerializer.deserializeClass(res, this.type)));
6685
7508
  }
6686
- removeDelete(id, item) {
6687
- const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getRemoveDeletePath(id, item)}`;
7509
+ removeDelete(id, item, params) {
7510
+ const url = `${this.getBasePath()}${this.getServiceBasePath()}${this.getRemoveDeletePath(id, item)}`;
6688
7511
  return this.http
6689
7512
  .request('delete', url, {
6690
7513
  withCredentials: true,
6691
7514
  observe: 'body',
6692
7515
  reportProgress: false,
6693
- body: this.objectSerializer.serializeClass(item, this.type)
7516
+ body: item ? this.objectSerializer.serializeClass(item, this.type) : undefined,
7517
+ params: params
6694
7518
  })
6695
7519
  .pipe(map(res => this.objectSerializer.deserializeClass(res, this.type)));
6696
7520
  }
@@ -7169,5 +7993,5 @@ class RouteDataBuilder {
7169
7993
  * Generated bundle index. Do not edit.
7170
7994
  */
7171
7995
 
7172
- export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngCrudApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtil, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusQueryResultBase, MediusQueryResultWithObject, MediusRestUtil, MngActionComponent, MngActionDialogComponent, MngActionRouteComponent, MngActionService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngPropertyPathPipe, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, ModelDescriptor, ModelUtil, ObjectSerializer, RouteBuilder, RouteDataBuilder, RoutesBuilder, TableDescriptor, TableviewComponentService, TableviewDataProvider, TableviewDescriptor, ToastUtil, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngCommonsInitializerProvider, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
7996
+ export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngCrudApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, DefaultMngErrorMapperService, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldDescriptor, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtil, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusQueryResultBase, MediusQueryResultWithObject, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngPropertyPathPipe, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, ObjectSerializer, RouteBuilder, RouteDataBuilder, RoutesBuilder, TableDataProvider, TableDescriptor, TableviewDataProvider, TableviewDescriptor, ToastUtil, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngCommonsInitializerProvider, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
7173
7997
  //# sourceMappingURL=mediusinc-mng-commons.mjs.map