@mediusinc/mng-commons 0.2.16 → 0.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/i18n/en.json +4 -2
- package/assets/i18n/sl.json +19 -17
- package/esm2020/lib/api/models/filter-param.model.mjs +1 -1
- package/esm2020/lib/api/models/query-param.model.mjs +1 -1
- package/esm2020/lib/api/services/crud-api.abstract.service.mjs +17 -12
- package/esm2020/lib/components/action/action.component.mjs +32 -18
- package/esm2020/lib/components/action/editor/action-editor.component.mjs +182 -0
- package/esm2020/lib/components/action/index.mjs +2 -2
- package/esm2020/lib/components/action/models/action-execution.model.mjs +3 -3
- package/esm2020/lib/components/action/route/action-route.component.mjs +17 -12
- package/esm2020/lib/components/form/autocomplete/autocomplete.component.mjs +13 -11
- package/esm2020/lib/components/form/dropdown/dropdown.component.mjs +5 -7
- package/esm2020/lib/components/form/editor/form-editor.component.mjs +56 -4
- package/esm2020/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +179 -0
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +28 -9
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +14 -10
- package/esm2020/lib/components/form/formly/fields/index.mjs +2 -1
- package/esm2020/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.mjs +4 -3
- package/esm2020/lib/components/form/models/form-editor.event.mjs +28 -1
- package/esm2020/lib/components/layout/main-layout.component.mjs +1 -1
- package/esm2020/lib/components/layout/topbar.component.mjs +2 -4
- package/esm2020/lib/components/tableview/table/table.component.mjs +43 -20
- package/esm2020/lib/components/tableview/tableview.component.mjs +22 -15
- package/esm2020/lib/config/formly.config.mjs +7 -2
- package/esm2020/lib/data-providers/table.data-provider.mjs +17 -2
- package/esm2020/lib/descriptors/action.descriptor.mjs +112 -1
- package/esm2020/lib/descriptors/editor.descriptor.interface.mjs +2 -0
- package/esm2020/lib/descriptors/editor.descriptor.mjs +129 -28
- package/esm2020/lib/directives/component.directive.mjs +8 -3
- package/esm2020/lib/mng-commons.module.mjs +18 -11
- package/esm2020/lib/models/index.mjs +2 -1
- package/esm2020/lib/models/view-container.model.mjs +2 -0
- package/esm2020/lib/router/models/router.model.mjs +1 -1
- package/esm2020/lib/router/route-builder.mjs +75 -11
- package/esm2020/lib/services/action-executor.service.mjs +291 -0
- package/esm2020/lib/services/configuration.service.mjs +3 -3
- package/esm2020/lib/services/index.mjs +2 -2
- package/esm2020/lib/services/mng-view-container-component.service.mjs +35 -0
- package/esm2020/lib/services/tokens/default-setting.token.mjs +3 -0
- package/esm2020/lib/services/tokens/index.mjs +2 -1
- package/esm2020/lib/utils/editor-formly.util.mjs +14 -3
- package/esm2020/lib/utils/toast.util.mjs +15 -7
- package/esm2020/public-api.mjs +1 -2
- package/fesm2015/mediusinc-mng-commons.mjs +1738 -1012
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +1578 -878
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/models/filter-param.model.d.ts +1 -1
- package/lib/api/models/query-param.model.d.ts +1 -1
- package/lib/api/services/crud-api.abstract.service.d.ts +9 -8
- package/lib/components/action/action.component.d.ts +12 -7
- package/lib/components/action/{dialog/action-dialog.component.d.ts → editor/action-editor.component.d.ts} +18 -12
- package/lib/components/action/index.d.ts +1 -1
- package/lib/components/action/models/action-execution.model.d.ts +3 -3
- package/lib/components/action/route/action-route.component.d.ts +6 -6
- package/lib/components/form/autocomplete/autocomplete.component.d.ts +3 -2
- package/lib/components/form/dropdown/dropdown.component.d.ts +4 -4
- package/lib/components/form/editor/form-editor.component.d.ts +7 -2
- package/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +45 -0
- package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +2 -0
- package/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +1 -0
- package/lib/components/form/formly/fields/index.d.ts +1 -0
- package/lib/components/form/models/form-editor.event.d.ts +32 -0
- package/lib/components/layout/topbar.component.d.ts +2 -3
- package/lib/components/tableview/table/table.component.d.ts +14 -6
- package/lib/components/tableview/tableview.component.d.ts +10 -7
- package/lib/data-providers/table.data-provider.d.ts +9 -1
- package/lib/descriptors/action.descriptor.d.ts +41 -5
- package/lib/descriptors/editor.descriptor.d.ts +62 -19
- package/lib/descriptors/editor.descriptor.interface.d.ts +9 -0
- package/lib/directives/component.directive.d.ts +5 -4
- package/lib/mng-commons.module.d.ts +55 -54
- package/lib/models/index.d.ts +1 -0
- package/lib/models/view-container.model.d.ts +6 -0
- package/lib/router/models/router.model.d.ts +2 -2
- package/lib/router/route-builder.d.ts +18 -4
- package/lib/services/{action.service.d.ts → action-executor.service.d.ts} +19 -18
- package/lib/services/index.d.ts +1 -1
- package/lib/services/mng-view-container-component.service.d.ts +22 -0
- package/lib/services/tokens/default-setting.token.d.ts +2 -0
- package/lib/services/tokens/index.d.ts +1 -0
- package/lib/utils/toast.util.d.ts +5 -4
- package/package.json +1 -1
- package/public-api.d.ts +0 -1
- package/scss/mng-overrides/_layout_forms.scss +2 -0
- package/scss/mng-overrides/_mixins.scss +7 -0
- package/scss/mng-overrides/_theme_button.scss +58 -0
- package/scss/mng-overrides/_theme_dropdown.scss +17 -0
- package/scss/mng-overrides/_theme_styles.scss +1 -0
- package/scss/mng-overrides/_variables.scss +2 -0
- package/esm2020/lib/components/action/dialog/action-dialog.component.mjs +0 -151
- package/esm2020/lib/components/tableview/services/index.mjs +0 -2
- package/esm2020/lib/components/tableview/services/tableview.component.service.mjs +0 -21
- package/esm2020/lib/services/action.service.mjs +0 -273
- package/lib/components/tableview/services/index.d.ts +0 -1
- package/lib/components/tableview/services/tableview.component.service.d.ts +0 -14
|
@@ -2,24 +2,24 @@ import * as i4$1 from '@angular/common';
|
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import {
|
|
6
|
-
import * as
|
|
7
|
-
import { Validators, FormGroup, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { InjectionToken, Injectable, Inject, Component, ChangeDetectionStrategy, Optional, Input, EventEmitter, Directive, Output, ContentChildren, ViewChild, forwardRef, Pipe, ViewChildren, HostListener, APP_INITIALIZER, NgModule } from '@angular/core';
|
|
6
|
+
import * as i4$2 from '@angular/forms';
|
|
7
|
+
import { Validators, FormGroup, FormArray, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
8
8
|
import * as i1 from '@angular/router';
|
|
9
9
|
import { NavigationEnd, GuardsCheckEnd, RouterModule } from '@angular/router';
|
|
10
|
-
import * as i3 from '@ngx-formly/core';
|
|
10
|
+
import * as i3$2 from '@ngx-formly/core';
|
|
11
11
|
import { FieldType, FieldWrapper, FORMLY_CONFIG, FormlyModule } from '@ngx-formly/core';
|
|
12
|
-
import * as
|
|
12
|
+
import * as i3$1 from '@ngx-translate/core';
|
|
13
13
|
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
|
14
|
-
import * as i2
|
|
15
|
-
import {
|
|
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$
|
|
18
|
+
import * as i2$3 from 'primeng/breadcrumb';
|
|
19
19
|
import { BreadcrumbModule } from 'primeng/breadcrumb';
|
|
20
20
|
import * as i8 from 'primeng/button';
|
|
21
21
|
import { ButtonModule } from 'primeng/button';
|
|
22
|
-
import * as i5 from 'primeng/calendar';
|
|
22
|
+
import * as i5$1 from 'primeng/calendar';
|
|
23
23
|
import { CalendarModule } from 'primeng/calendar';
|
|
24
24
|
import { CardModule } from 'primeng/card';
|
|
25
25
|
import { CheckboxModule } from 'primeng/checkbox';
|
|
@@ -27,31 +27,31 @@ import { ChipModule } from 'primeng/chip';
|
|
|
27
27
|
import * as i6 from 'primeng/confirmdialog';
|
|
28
28
|
import { ConfirmDialogModule } from 'primeng/confirmdialog';
|
|
29
29
|
import { ConfirmPopupModule } from 'primeng/confirmpopup';
|
|
30
|
-
import * as
|
|
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
|
|
34
|
+
import * as i3 from 'primeng/dynamicdialog';
|
|
35
35
|
import { DynamicDialogModule, DialogService } from 'primeng/dynamicdialog';
|
|
36
|
-
import * as i1$
|
|
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$
|
|
43
|
+
import * as i2$2 from 'primeng/inputswitch';
|
|
44
44
|
import { InputSwitchModule } from 'primeng/inputswitch';
|
|
45
45
|
import * as i10$1 from 'primeng/inputtext';
|
|
46
46
|
import { InputTextModule } from 'primeng/inputtext';
|
|
47
47
|
import * as i9$1 from 'primeng/inputtextarea';
|
|
48
48
|
import { InputTextareaModule } from 'primeng/inputtextarea';
|
|
49
|
-
import * as i3$
|
|
49
|
+
import * as i3$3 from 'primeng/messages';
|
|
50
50
|
import { MessagesModule } from 'primeng/messages';
|
|
51
|
-
import * as i2$
|
|
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
|
|
54
|
+
import * as i5 from 'primeng/progressspinner';
|
|
55
55
|
import { ProgressSpinnerModule } from 'primeng/progressspinner';
|
|
56
56
|
import * as i4$3 from 'primeng/radiobutton';
|
|
57
57
|
import { RadioButtonModule } from 'primeng/radiobutton';
|
|
@@ -62,7 +62,7 @@ import * as i7 from 'primeng/skeleton';
|
|
|
62
62
|
import { SkeletonModule } from 'primeng/skeleton';
|
|
63
63
|
import * as i4$4 from 'primeng/table';
|
|
64
64
|
import { Table, TableModule } from 'primeng/table';
|
|
65
|
-
import * as i1$
|
|
65
|
+
import * as i1$5 from 'primeng/tabview';
|
|
66
66
|
import { TabViewModule } from 'primeng/tabview';
|
|
67
67
|
import { TagModule } from 'primeng/tag';
|
|
68
68
|
import * as i7$1 from 'primeng/toast';
|
|
@@ -72,402 +72,74 @@ import * as i8$1 from 'primeng/toolbar';
|
|
|
72
72
|
import { ToolbarModule } from 'primeng/toolbar';
|
|
73
73
|
import * as i10 from 'primeng/tooltip';
|
|
74
74
|
import { TooltipModule } from 'primeng/tooltip';
|
|
75
|
-
import { of,
|
|
75
|
+
import { throwError, of, Subject, Observable, from, BehaviorSubject, ReplaySubject, distinctUntilChanged, combineLatest } from 'rxjs';
|
|
76
76
|
import 'reflect-metadata';
|
|
77
77
|
import { mergeMap, map, first, catchError, filter, finalize, startWith } from 'rxjs/operators';
|
|
78
78
|
import * as i4 from '@angular/platform-browser';
|
|
79
79
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
80
80
|
|
|
81
|
-
class
|
|
82
|
-
constructor(
|
|
83
|
-
this.
|
|
84
|
-
this.
|
|
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
|
-
|
|
195
|
-
this.
|
|
196
|
-
return this;
|
|
86
|
+
get serviceType() {
|
|
87
|
+
return this._serviceType;
|
|
197
88
|
}
|
|
198
|
-
|
|
199
|
-
this.
|
|
200
|
-
return this;
|
|
89
|
+
get modelType() {
|
|
90
|
+
return this._modelType;
|
|
201
91
|
}
|
|
202
|
-
|
|
203
|
-
this.
|
|
92
|
+
withServiceType(type) {
|
|
93
|
+
this._serviceType = type;
|
|
204
94
|
return this;
|
|
205
95
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
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
|
-
|
|
212
|
-
this.
|
|
213
|
-
return this;
|
|
103
|
+
get fetch() {
|
|
104
|
+
return this._fetch;
|
|
214
105
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
*/
|
|
218
|
-
withModelTitle() {
|
|
219
|
-
this._title = `${this._i18nModelActionBaseKey}.title`;
|
|
220
|
-
return this;
|
|
106
|
+
get create() {
|
|
107
|
+
return this._create;
|
|
221
108
|
}
|
|
222
|
-
|
|
223
|
-
|
|
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
|
-
|
|
231
|
-
this.
|
|
232
|
-
return this;
|
|
112
|
+
get delete() {
|
|
113
|
+
return this._delete;
|
|
233
114
|
}
|
|
234
|
-
|
|
235
|
-
this.
|
|
115
|
+
withFetch(fetch) {
|
|
116
|
+
this._fetch = fetch;
|
|
236
117
|
return this;
|
|
237
118
|
}
|
|
238
|
-
|
|
239
|
-
this.
|
|
119
|
+
withCreate(create) {
|
|
120
|
+
this._create = create;
|
|
240
121
|
return this;
|
|
241
122
|
}
|
|
242
|
-
|
|
243
|
-
this.
|
|
123
|
+
withUpdate(update) {
|
|
124
|
+
this._update = update;
|
|
244
125
|
return this;
|
|
245
126
|
}
|
|
246
|
-
|
|
247
|
-
this.
|
|
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
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
this.
|
|
271
|
-
this._type = ActionTypeEnum.Editor;
|
|
272
|
-
this._editorDescriptor = editorDescriptor;
|
|
273
|
-
}
|
|
274
|
-
get editorTitle() {
|
|
275
|
-
return this._editorTitle;
|
|
276
|
-
}
|
|
277
|
-
get editorDescriptor() {
|
|
278
|
-
return this._editorDescriptor;
|
|
279
|
-
}
|
|
280
|
-
get hasFetchNotificationSuccess() {
|
|
281
|
-
return this._hasFetchNotificationSuccess;
|
|
282
|
-
}
|
|
283
|
-
get fetchNotificationSuccessTitle() {
|
|
284
|
-
return this._fetchNotificationSuccessTitle;
|
|
285
|
-
}
|
|
286
|
-
get fetchNotificationSuccessMessage() {
|
|
287
|
-
return this._fetchNotificationSuccessMessage;
|
|
288
|
-
}
|
|
289
|
-
get runFunction() {
|
|
290
|
-
throw new Error('Run function cannot be used in editor action. Use submit function instead!');
|
|
291
|
-
}
|
|
292
|
-
get fetchFunction() {
|
|
293
|
-
if (!this._fetchFunction) {
|
|
294
|
-
return ctx => {
|
|
295
|
-
console.warn(`Fetch function is not provided for function ${this._actionName}, using default and returning context item`, ctx.data?.item);
|
|
296
|
-
return of(ctx.data?.item ? ctx.data.item : {});
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
return this._fetchFunction;
|
|
300
|
-
}
|
|
301
|
-
get submitFunction() {
|
|
302
|
-
return this._submitFunction;
|
|
303
|
-
}
|
|
304
|
-
withEditorTitle(title) {
|
|
305
|
-
this._editorTitle = title;
|
|
306
|
-
return this;
|
|
307
|
-
}
|
|
308
|
-
withRunFunction(fn) {
|
|
309
|
-
return this.withSubmitFunction(fn);
|
|
132
|
+
|
|
133
|
+
class LookupDataProvider extends DataProvider {
|
|
134
|
+
constructor(modelType, serviceType) {
|
|
135
|
+
super(modelType, serviceType);
|
|
136
|
+
this._lookup = () => of([]);
|
|
310
137
|
}
|
|
311
|
-
|
|
312
|
-
this.
|
|
313
|
-
return this;
|
|
138
|
+
get lookup() {
|
|
139
|
+
return this._lookup;
|
|
314
140
|
}
|
|
315
|
-
|
|
316
|
-
this.
|
|
317
|
-
return this;
|
|
318
|
-
}
|
|
319
|
-
withFetchNotificationError(title, message, hasNotification = true) {
|
|
320
|
-
this._hasFetchNotificationSuccess = hasNotification;
|
|
321
|
-
this._fetchNotificationSuccessTitle = title;
|
|
322
|
-
this._fetchNotificationSuccessMessage = message;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
class ActionEditorDetailsDescriptor extends ActionEditorDescriptor {
|
|
326
|
-
constructor(editorDescriptor) {
|
|
327
|
-
super(editorDescriptor, 'details');
|
|
328
|
-
this.withPosition(ActionPositionEnum.RowClick);
|
|
329
|
-
this.withRouteTrigger(':itemId');
|
|
330
|
-
this.withFetchFunction(ctx => ctx.dataProvider?.fetch && ctx.data?.itemId
|
|
331
|
-
? ctx.dataProvider.fetch(ctx.data?.itemId, ctx.serviceInstance)
|
|
332
|
-
: throwError(new Error(`Data provider fetch function or item id ${ctx.data?.itemId} is missing.`)));
|
|
333
|
-
this.withClassName('mng-details-dynamic-dialog');
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
class ActionEditorAddDescriptor extends ActionEditorDescriptor {
|
|
337
|
-
constructor(editorDescriptor) {
|
|
338
|
-
super(editorDescriptor, 'add');
|
|
339
|
-
this.withPosition(ActionPositionEnum.ToolbarLeft);
|
|
340
|
-
this.withRouteTrigger('add');
|
|
341
|
-
this.withSubmitFunction(ctx => ctx.dataProvider?.create ? ctx.dataProvider.create(ctx.data?.item, ctx.serviceInstance) : throwError(new Error(`Data provider create function is missing.`)));
|
|
342
|
-
this.withLevel(ActionLevelEnum.Success);
|
|
343
|
-
this.withIcon('pi pi-plus');
|
|
344
|
-
this.withClassName('mng-details-dynamic-dialog');
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
class ActionEditorEditDescriptor extends ActionEditorDescriptor {
|
|
348
|
-
constructor(editorDescriptor) {
|
|
349
|
-
super(editorDescriptor, 'edit');
|
|
350
|
-
this.withPosition(ActionPositionEnum.RowInline);
|
|
351
|
-
this.withTitle(null);
|
|
352
|
-
this.withRouteTrigger(':itemId/edit');
|
|
353
|
-
this.withFetchFunction(ctx => ctx.dataProvider?.fetch && ctx.data?.itemId
|
|
354
|
-
? ctx.dataProvider.fetch(ctx.data.itemId, ctx.serviceInstance)
|
|
355
|
-
: throwError(new Error(`Data provider fetch function or item id ${ctx.data?.itemId} is missing.`)));
|
|
356
|
-
this.withSubmitFunction(ctx => ctx.dataProvider?.update && ctx.data?.itemId
|
|
357
|
-
? ctx.dataProvider.update(ctx.data.itemId, ctx.data?.item, ctx.serviceInstance)
|
|
358
|
-
: throwError(new Error(`Data provider update function or item id ${ctx.data?.itemId} is missing.`)));
|
|
359
|
-
this.withIcon('pi pi-pencil');
|
|
360
|
-
this.withClassName('mng-details-dynamic-dialog');
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
class ActionDeleteDescriptor extends ActionDescriptor {
|
|
364
|
-
constructor(model) {
|
|
365
|
-
super(model, 'delete');
|
|
366
|
-
this.withPosition(ActionPositionEnum.RowInline);
|
|
367
|
-
this.withTitle(null);
|
|
368
|
-
this.withRunFunction(ctx => {
|
|
369
|
-
const editorDataProvider = ctx.dataProvider;
|
|
370
|
-
return editorDataProvider?.delete && ctx.data?.itemId
|
|
371
|
-
? editorDataProvider.delete(ctx.data.itemId, ctx.data.item, ctx.serviceInstance)
|
|
372
|
-
: throwError(new Error(`Data provider delete function or item id ${ctx.data?.itemId} is missing.`));
|
|
373
|
-
});
|
|
374
|
-
this.withLevel(ActionLevelEnum.Danger);
|
|
375
|
-
this.withIcon('pi pi-trash');
|
|
376
|
-
this.withRunConfirmation(undefined);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
var ActionPositionEnum;
|
|
380
|
-
(function (ActionPositionEnum) {
|
|
381
|
-
ActionPositionEnum[ActionPositionEnum["ToolbarLeft"] = 0] = "ToolbarLeft";
|
|
382
|
-
ActionPositionEnum[ActionPositionEnum["ToolbarRight"] = 1] = "ToolbarRight";
|
|
383
|
-
ActionPositionEnum[ActionPositionEnum["TableHeader"] = 2] = "TableHeader";
|
|
384
|
-
ActionPositionEnum[ActionPositionEnum["RowInline"] = 3] = "RowInline";
|
|
385
|
-
ActionPositionEnum[ActionPositionEnum["RowClick"] = 4] = "RowClick";
|
|
386
|
-
})(ActionPositionEnum || (ActionPositionEnum = {}));
|
|
387
|
-
var ActionActivationTriggerEnum;
|
|
388
|
-
(function (ActionActivationTriggerEnum) {
|
|
389
|
-
ActionActivationTriggerEnum[ActionActivationTriggerEnum["OnClick"] = 0] = "OnClick";
|
|
390
|
-
ActionActivationTriggerEnum[ActionActivationTriggerEnum["OnRoute"] = 1] = "OnRoute"; // action is triggered for activation by route url
|
|
391
|
-
})(ActionActivationTriggerEnum || (ActionActivationTriggerEnum = {}));
|
|
392
|
-
var ActionTypeEnum;
|
|
393
|
-
(function (ActionTypeEnum) {
|
|
394
|
-
ActionTypeEnum[ActionTypeEnum["Direct"] = 0] = "Direct";
|
|
395
|
-
ActionTypeEnum[ActionTypeEnum["Editor"] = 1] = "Editor"; // editor providing middle step for activation
|
|
396
|
-
})(ActionTypeEnum || (ActionTypeEnum = {}));
|
|
397
|
-
var ActionLevelEnum;
|
|
398
|
-
(function (ActionLevelEnum) {
|
|
399
|
-
ActionLevelEnum[ActionLevelEnum["Default"] = 0] = "Default";
|
|
400
|
-
ActionLevelEnum[ActionLevelEnum["Primary"] = 1] = "Primary";
|
|
401
|
-
ActionLevelEnum[ActionLevelEnum["Secondary"] = 2] = "Secondary";
|
|
402
|
-
ActionLevelEnum[ActionLevelEnum["Info"] = 3] = "Info";
|
|
403
|
-
ActionLevelEnum[ActionLevelEnum["Help"] = 4] = "Help";
|
|
404
|
-
ActionLevelEnum[ActionLevelEnum["Success"] = 5] = "Success";
|
|
405
|
-
ActionLevelEnum[ActionLevelEnum["Warning"] = 6] = "Warning";
|
|
406
|
-
ActionLevelEnum[ActionLevelEnum["Danger"] = 7] = "Danger";
|
|
407
|
-
})(ActionLevelEnum || (ActionLevelEnum = {}));
|
|
408
|
-
|
|
409
|
-
class DataProvider {
|
|
410
|
-
constructor(modelType, serviceType) {
|
|
411
|
-
this._modelType = modelType;
|
|
412
|
-
this._serviceType = serviceType;
|
|
413
|
-
}
|
|
414
|
-
get serviceType() {
|
|
415
|
-
return this._serviceType;
|
|
416
|
-
}
|
|
417
|
-
get modelType() {
|
|
418
|
-
return this._modelType;
|
|
419
|
-
}
|
|
420
|
-
withServiceType(type) {
|
|
421
|
-
this._serviceType = type;
|
|
422
|
-
return this;
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
class EditorDataProvider extends DataProvider {
|
|
427
|
-
constructor(modelType, serviceType) {
|
|
428
|
-
super(modelType, serviceType);
|
|
429
|
-
this._fetch = id => throwError(`No fetch function provided for id ${id}.`);
|
|
430
|
-
}
|
|
431
|
-
get fetch() {
|
|
432
|
-
return this._fetch;
|
|
433
|
-
}
|
|
434
|
-
get create() {
|
|
435
|
-
return this._create;
|
|
436
|
-
}
|
|
437
|
-
get update() {
|
|
438
|
-
return this._update;
|
|
439
|
-
}
|
|
440
|
-
get delete() {
|
|
441
|
-
return this._delete;
|
|
442
|
-
}
|
|
443
|
-
withFetch(fetch) {
|
|
444
|
-
this._fetch = fetch;
|
|
445
|
-
return this;
|
|
446
|
-
}
|
|
447
|
-
withCreate(create) {
|
|
448
|
-
this._create = create;
|
|
449
|
-
return this;
|
|
450
|
-
}
|
|
451
|
-
withUpdate(update) {
|
|
452
|
-
this._update = update;
|
|
453
|
-
return this;
|
|
454
|
-
}
|
|
455
|
-
withDelete(deleteFn) {
|
|
456
|
-
this._delete = deleteFn;
|
|
457
|
-
return this;
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
class LookupDataProvider extends DataProvider {
|
|
462
|
-
constructor(modelType, serviceType) {
|
|
463
|
-
super(modelType, serviceType);
|
|
464
|
-
this._lookup = () => of([]);
|
|
465
|
-
}
|
|
466
|
-
get lookup() {
|
|
467
|
-
return this._lookup;
|
|
468
|
-
}
|
|
469
|
-
withLookup(lookup) {
|
|
470
|
-
this._lookup = lookup;
|
|
141
|
+
withLookup(lookup) {
|
|
142
|
+
this._lookup = lookup;
|
|
471
143
|
return this;
|
|
472
144
|
}
|
|
473
145
|
}
|
|
@@ -679,62 +351,548 @@ class MediusQueryParamBuilder {
|
|
|
679
351
|
this.queryParam.itemsPerPage = itemsPerPage;
|
|
680
352
|
return this;
|
|
681
353
|
}
|
|
682
|
-
withItemsOffset(itemsOffset) {
|
|
683
|
-
this.queryParam.itemsOffset = itemsOffset;
|
|
684
|
-
return this;
|
|
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 runFunction() {
|
|
491
|
+
if (!this._runFunction) {
|
|
492
|
+
throw new Error('Run function is not defined and cannot be invoked');
|
|
493
|
+
}
|
|
494
|
+
return this._runFunction;
|
|
495
|
+
}
|
|
496
|
+
get isVisibleFunction() {
|
|
497
|
+
return this._isVisibleFunction;
|
|
498
|
+
}
|
|
499
|
+
get isEnabledFunction() {
|
|
500
|
+
return this._isEnabledFunction;
|
|
501
|
+
}
|
|
502
|
+
get actionName() {
|
|
503
|
+
return this._actionName;
|
|
504
|
+
}
|
|
505
|
+
get className() {
|
|
506
|
+
return this._className;
|
|
507
|
+
}
|
|
508
|
+
get size() {
|
|
509
|
+
return this._size;
|
|
510
|
+
}
|
|
511
|
+
get isSizeExtraSmall() {
|
|
512
|
+
return this._size === ActionDescriptor.SizeEnum.ExtraSmall;
|
|
513
|
+
}
|
|
514
|
+
get isSizeSmall() {
|
|
515
|
+
return this._size === ActionDescriptor.SizeEnum.Small;
|
|
516
|
+
}
|
|
517
|
+
get isSizeLarge() {
|
|
518
|
+
return this._size === ActionDescriptor.SizeEnum.Large;
|
|
519
|
+
}
|
|
520
|
+
get isSizeExtraLarge() {
|
|
521
|
+
return this._size === ActionDescriptor.SizeEnum.ExtraLarge;
|
|
522
|
+
}
|
|
523
|
+
get hasRunConfirmation() {
|
|
524
|
+
return this._hasRunConfirmation;
|
|
525
|
+
}
|
|
526
|
+
get runConfirmationIcon() {
|
|
527
|
+
return this._runConfirmationIcon;
|
|
528
|
+
}
|
|
529
|
+
get runConfirmationTitle() {
|
|
530
|
+
return this._runConfirmationTitle;
|
|
531
|
+
}
|
|
532
|
+
get runConfirmationMessage() {
|
|
533
|
+
return this._runConfirmationMessage;
|
|
534
|
+
}
|
|
535
|
+
get runConfirmationAcceptTitle() {
|
|
536
|
+
return this._runConfirmationAcceptTitle;
|
|
537
|
+
}
|
|
538
|
+
get runConfirmationRejectTitle() {
|
|
539
|
+
return this._runConfirmationRejectTitle;
|
|
540
|
+
}
|
|
541
|
+
get hasRunNotificationSuccess() {
|
|
542
|
+
return this._hasRunNotificationSuccess;
|
|
543
|
+
}
|
|
544
|
+
get runNotificationSuccessTitle() {
|
|
545
|
+
return this._runNotificationSuccessTitle;
|
|
546
|
+
}
|
|
547
|
+
get runNotificationSuccessMessage() {
|
|
548
|
+
return this._runNotificationSuccessMessage;
|
|
549
|
+
}
|
|
550
|
+
get hasRunNotificationError() {
|
|
551
|
+
return this._hasRunNotificationError;
|
|
552
|
+
}
|
|
553
|
+
get runNotificationErrorTitle() {
|
|
554
|
+
return this._runNotificationErrorTitle;
|
|
555
|
+
}
|
|
556
|
+
get runNotificationErrorMessage() {
|
|
557
|
+
return this._runNotificationErrorMessage;
|
|
558
|
+
}
|
|
559
|
+
withDataProvider(dataProvider) {
|
|
560
|
+
this._dataProvider = dataProvider;
|
|
561
|
+
return this;
|
|
562
|
+
}
|
|
563
|
+
withServiceType(serviceType) {
|
|
564
|
+
this._dataProvider = new DataProvider(this._model.type, serviceType);
|
|
565
|
+
return this;
|
|
566
|
+
}
|
|
567
|
+
withRunFunction(fn) {
|
|
568
|
+
this._runFunction = fn;
|
|
569
|
+
return this;
|
|
570
|
+
}
|
|
571
|
+
withIsVisibleFunction(fn) {
|
|
572
|
+
this._isVisibleFunction = fn;
|
|
573
|
+
return this;
|
|
574
|
+
}
|
|
575
|
+
withIsEnabledFunction(fn) {
|
|
576
|
+
this._isEnabledFunction = fn;
|
|
577
|
+
return this;
|
|
578
|
+
}
|
|
579
|
+
withRouteTrigger(routeUrl) {
|
|
580
|
+
this._activationTrigger = ActionActivationTriggerEnum.OnRoute;
|
|
581
|
+
this._routeUrl = routeUrl;
|
|
582
|
+
return this;
|
|
583
|
+
}
|
|
584
|
+
withLevel(level) {
|
|
585
|
+
this._level = level;
|
|
586
|
+
return this;
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Overrides default title key with model action key (${model.typeName}.actions.${actionName}). Not relevant if parentType name is provided.
|
|
590
|
+
*/
|
|
591
|
+
withModelTitle() {
|
|
592
|
+
this._title = `${this._i18nModelActionBaseKey}.title`;
|
|
593
|
+
return this;
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* Overrides default title key (${actionName}.title). If null, no title will be shown.
|
|
597
|
+
* @param title Title i18n key or title.
|
|
598
|
+
*/
|
|
599
|
+
withTitle(title) {
|
|
600
|
+
this._title = title;
|
|
601
|
+
return this;
|
|
602
|
+
}
|
|
603
|
+
withIcon(icon) {
|
|
604
|
+
this._icon = icon;
|
|
605
|
+
return this;
|
|
606
|
+
}
|
|
607
|
+
withTooltip(tooltip) {
|
|
608
|
+
this._title = tooltip;
|
|
609
|
+
return this;
|
|
610
|
+
}
|
|
611
|
+
withClassName(className) {
|
|
612
|
+
this._className = className;
|
|
613
|
+
return this;
|
|
614
|
+
}
|
|
615
|
+
withSize(size = ActionDescriptor.SizeEnum.Normal) {
|
|
616
|
+
this._size = size;
|
|
617
|
+
return this;
|
|
618
|
+
}
|
|
619
|
+
withPosition(position) {
|
|
620
|
+
this._position = position;
|
|
621
|
+
return this;
|
|
622
|
+
}
|
|
623
|
+
withRunConfirmation(icon = 'pi pi-exclamation-triangle', title, message, acceptTitle, rejectTitle) {
|
|
624
|
+
this._hasRunConfirmation = true;
|
|
625
|
+
this._runConfirmationIcon = icon;
|
|
626
|
+
this._runConfirmationTitle = title;
|
|
627
|
+
this._runConfirmationMessage = message;
|
|
628
|
+
this._runConfirmationAcceptTitle = acceptTitle;
|
|
629
|
+
this._runConfirmationRejectTitle = rejectTitle;
|
|
630
|
+
return this;
|
|
631
|
+
}
|
|
632
|
+
withRunNotificationSuccess(title, message, hasNotification = true) {
|
|
633
|
+
this._hasRunNotificationSuccess = hasNotification;
|
|
634
|
+
this._runNotificationSuccessTitle = title;
|
|
635
|
+
this._runNotificationSuccessMessage = message;
|
|
636
|
+
}
|
|
637
|
+
withRunNotificationError(title, message, hasNotification = true) {
|
|
638
|
+
this._hasRunNotificationError = hasNotification;
|
|
639
|
+
this._runNotificationErrorTitle = title;
|
|
640
|
+
this._runNotificationErrorMessage = message;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
(function (ActionDescriptor) {
|
|
644
|
+
let SizeEnum;
|
|
645
|
+
(function (SizeEnum) {
|
|
646
|
+
SizeEnum[SizeEnum["ExtraSmall"] = 0] = "ExtraSmall";
|
|
647
|
+
SizeEnum[SizeEnum["Small"] = 1] = "Small";
|
|
648
|
+
SizeEnum[SizeEnum["Normal"] = 2] = "Normal";
|
|
649
|
+
SizeEnum[SizeEnum["Large"] = 3] = "Large";
|
|
650
|
+
SizeEnum[SizeEnum["ExtraLarge"] = 4] = "ExtraLarge";
|
|
651
|
+
})(SizeEnum = ActionDescriptor.SizeEnum || (ActionDescriptor.SizeEnum = {}));
|
|
652
|
+
})(ActionDescriptor || (ActionDescriptor = {}));
|
|
653
|
+
class ActionEditorDescriptor extends ActionDescriptor {
|
|
654
|
+
constructor(editorDescriptor, actionName, parentType, parentProperty) {
|
|
655
|
+
super(editorDescriptor.model, actionName, parentType, parentProperty);
|
|
656
|
+
this._editorTitle = undefined;
|
|
657
|
+
this._hasFetchNotificationSuccess = false;
|
|
658
|
+
this._type = ActionTypeEnum.Editor;
|
|
659
|
+
this._editorDescriptor = editorDescriptor;
|
|
660
|
+
}
|
|
661
|
+
get editorTitle() {
|
|
662
|
+
return this._editorTitle;
|
|
663
|
+
}
|
|
664
|
+
get editorDescriptor() {
|
|
665
|
+
return this._editorDescriptor;
|
|
666
|
+
}
|
|
667
|
+
get hasFetchNotificationSuccess() {
|
|
668
|
+
return this._hasFetchNotificationSuccess;
|
|
669
|
+
}
|
|
670
|
+
get fetchNotificationSuccessTitle() {
|
|
671
|
+
return this._fetchNotificationSuccessTitle;
|
|
672
|
+
}
|
|
673
|
+
get fetchNotificationSuccessMessage() {
|
|
674
|
+
return this._fetchNotificationSuccessMessage;
|
|
675
|
+
}
|
|
676
|
+
get dataProvider() {
|
|
677
|
+
return this._dataProvider;
|
|
678
|
+
}
|
|
679
|
+
get runFunction() {
|
|
680
|
+
throw new Error('Run function cannot be used in editor action. Use submit function instead!');
|
|
681
|
+
}
|
|
682
|
+
get fetchFunction() {
|
|
683
|
+
if (!this._fetchFunction) {
|
|
684
|
+
return ctx => {
|
|
685
|
+
console.warn(`Fetch function is not provided for function ${this._actionName}, using default and returning context item`, ctx.data?.item);
|
|
686
|
+
return of(ctx.data?.item ? ctx.data.item : {});
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
return this._fetchFunction;
|
|
690
|
+
}
|
|
691
|
+
get submitFunction() {
|
|
692
|
+
return this._submitFunction;
|
|
693
|
+
}
|
|
694
|
+
get editorComponent() {
|
|
695
|
+
return this._editorComponent;
|
|
696
|
+
}
|
|
697
|
+
withEditorTitle(title) {
|
|
698
|
+
this._editorTitle = title;
|
|
699
|
+
return this;
|
|
700
|
+
}
|
|
701
|
+
withDataProvider(dataProvider) {
|
|
702
|
+
this._dataProvider = dataProvider;
|
|
703
|
+
return this;
|
|
704
|
+
}
|
|
705
|
+
withServiceType(serviceType) {
|
|
706
|
+
this._dataProvider = new EditorDataProvider(this._model.type, serviceType);
|
|
707
|
+
return this;
|
|
708
|
+
}
|
|
709
|
+
withRunFunction(fn) {
|
|
710
|
+
return this.withSubmitFunction(fn);
|
|
711
|
+
}
|
|
712
|
+
withFetchFunction(fn) {
|
|
713
|
+
this._fetchFunction = fn;
|
|
714
|
+
return this;
|
|
715
|
+
}
|
|
716
|
+
withSubmitFunction(fn) {
|
|
717
|
+
this._submitFunction = fn;
|
|
718
|
+
return this;
|
|
719
|
+
}
|
|
720
|
+
withFetchNotificationError(title, message, hasNotification = true) {
|
|
721
|
+
this._hasFetchNotificationSuccess = hasNotification;
|
|
722
|
+
this._fetchNotificationSuccessTitle = title;
|
|
723
|
+
this._fetchNotificationSuccessMessage = message;
|
|
724
|
+
return this;
|
|
725
|
+
}
|
|
726
|
+
withEditorComponent(editorComponent) {
|
|
727
|
+
this._editorComponent = editorComponent;
|
|
728
|
+
return this;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
class ActionEditorDetailsDescriptor extends ActionEditorDescriptor {
|
|
732
|
+
constructor(editorDescriptor) {
|
|
733
|
+
super(editorDescriptor, 'details');
|
|
734
|
+
this.withPosition(ActionPositionEnum.RowClick);
|
|
735
|
+
this.withRouteTrigger(':itemId');
|
|
736
|
+
this.withFetchFunction(ctx => ctx.dataProvider?.fetch && ctx.data?.itemId
|
|
737
|
+
? ctx.dataProvider.fetch(ctx.data?.itemId, ctx.serviceInstance)
|
|
738
|
+
: throwError(new Error(`Data provider fetch function or item id ${ctx.data?.itemId} is missing.`)));
|
|
739
|
+
this.withClassName('mng-details-dynamic-dialog');
|
|
740
|
+
}
|
|
741
|
+
withServiceType(serviceType) {
|
|
742
|
+
return this.withServiceFetchFunction(serviceType);
|
|
743
|
+
}
|
|
744
|
+
withServiceFetchFunction(serviceType, fetchFn) {
|
|
745
|
+
const dataProvider = new EditorDataProvider(this._model.type, serviceType);
|
|
746
|
+
if (fetchFn) {
|
|
747
|
+
dataProvider.withFetch(fetchFn);
|
|
748
|
+
}
|
|
749
|
+
this._dataProvider = dataProvider;
|
|
750
|
+
return this;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
class ActionEditorAddDescriptor extends ActionEditorDescriptor {
|
|
754
|
+
constructor(editorDescriptor) {
|
|
755
|
+
super(editorDescriptor, 'add');
|
|
756
|
+
this.withPosition(ActionPositionEnum.ToolbarLeft);
|
|
757
|
+
this.withRouteTrigger('add');
|
|
758
|
+
this.withSubmitFunction(ctx => ctx.dataProvider?.create ? ctx.dataProvider.create(ctx.data?.item, ctx.serviceInstance) : throwError(new Error(`Data provider create function is missing.`)));
|
|
759
|
+
this.withLevel(ActionLevelEnum.Success);
|
|
760
|
+
this.withIcon('pi pi-plus');
|
|
761
|
+
this.withClassName('mng-details-dynamic-dialog');
|
|
762
|
+
}
|
|
763
|
+
withServiceType(serviceType) {
|
|
764
|
+
return this.withServiceSubmitFunction(serviceType);
|
|
765
|
+
}
|
|
766
|
+
withServiceSubmitFunction(serviceType, createFn, fetchFn) {
|
|
767
|
+
const dataProvider = new EditorDataProvider(this._model.type, serviceType);
|
|
768
|
+
if (createFn) {
|
|
769
|
+
dataProvider.withCreate(createFn);
|
|
770
|
+
}
|
|
771
|
+
if (fetchFn) {
|
|
772
|
+
dataProvider.withFetch(fetchFn);
|
|
773
|
+
}
|
|
774
|
+
this._dataProvider = dataProvider;
|
|
775
|
+
return this;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
class ActionEditorEditDescriptor extends ActionEditorDescriptor {
|
|
779
|
+
constructor(editorDescriptor) {
|
|
780
|
+
super(editorDescriptor, 'edit');
|
|
781
|
+
this.withPosition(ActionPositionEnum.RowInline);
|
|
782
|
+
this.withTitle(null);
|
|
783
|
+
this.withRouteTrigger(':itemId/edit');
|
|
784
|
+
this.withFetchFunction(ctx => ctx.dataProvider?.fetch && ctx.data?.itemId
|
|
785
|
+
? ctx.dataProvider.fetch(ctx.data.itemId, ctx.serviceInstance)
|
|
786
|
+
: throwError(new Error(`Data provider fetch function or item id ${ctx.data?.itemId} is missing.`)));
|
|
787
|
+
this.withSubmitFunction(ctx => ctx.dataProvider?.update && ctx.data?.itemId
|
|
788
|
+
? ctx.dataProvider.update(ctx.data.itemId, ctx.data?.item, ctx.serviceInstance)
|
|
789
|
+
: throwError(new Error(`Data provider update function or item id ${ctx.data?.itemId} is missing.`)));
|
|
790
|
+
this.withIcon('pi pi-pencil');
|
|
791
|
+
this.withClassName('mng-details-dynamic-dialog');
|
|
792
|
+
}
|
|
793
|
+
withServiceType(serviceType) {
|
|
794
|
+
return this.withServiceSubmitFunction(serviceType);
|
|
685
795
|
}
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
796
|
+
withServiceSubmitFunction(serviceType, updateFn, fetchFn) {
|
|
797
|
+
const dataProvider = new EditorDataProvider(this._model.type, serviceType);
|
|
798
|
+
if (updateFn) {
|
|
799
|
+
dataProvider.withUpdate(updateFn);
|
|
690
800
|
}
|
|
691
|
-
|
|
692
|
-
|
|
801
|
+
if (fetchFn) {
|
|
802
|
+
dataProvider.withFetch(fetchFn);
|
|
803
|
+
}
|
|
804
|
+
this._dataProvider = dataProvider;
|
|
693
805
|
return this;
|
|
694
806
|
}
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
807
|
+
}
|
|
808
|
+
class ActionDeleteDescriptor extends ActionDescriptor {
|
|
809
|
+
constructor(model) {
|
|
810
|
+
super(model, 'delete');
|
|
811
|
+
this.withPosition(ActionPositionEnum.RowInline);
|
|
812
|
+
this.withTitle(null);
|
|
813
|
+
this.withRunFunction(ctx => {
|
|
814
|
+
const editorDataProvider = ctx.dataProvider;
|
|
815
|
+
return editorDataProvider?.delete && ctx.data?.itemId
|
|
816
|
+
? editorDataProvider.delete(ctx.data.itemId, ctx.data.item, ctx.serviceInstance)
|
|
817
|
+
: throwError(new Error(`Data provider delete function or item id ${ctx.data?.itemId} is missing.`));
|
|
818
|
+
});
|
|
819
|
+
this.withLevel(ActionLevelEnum.Danger);
|
|
820
|
+
this.withIcon('pi pi-trash');
|
|
821
|
+
this.withRunConfirmation(undefined);
|
|
822
|
+
}
|
|
823
|
+
withServiceType(serviceType) {
|
|
824
|
+
return this.withServiceDeleteFunction(serviceType);
|
|
825
|
+
}
|
|
826
|
+
withServiceDeleteFunction(serviceType, deleteFn) {
|
|
827
|
+
const dataProvider = new EditorDataProvider(this._model.type, serviceType);
|
|
828
|
+
if (deleteFn) {
|
|
829
|
+
dataProvider.withDelete(deleteFn);
|
|
698
830
|
}
|
|
699
|
-
|
|
700
|
-
filterParam.property = property;
|
|
701
|
-
filterParam.filterValue = value;
|
|
702
|
-
filterParam.filterValueTo = valueTo;
|
|
703
|
-
filterParam.filterMatchType = matchType;
|
|
704
|
-
filterParam.filterMatchCaseSensitive = matchCaseSensitive;
|
|
705
|
-
this.queryParam.filterParams.push(filterParam);
|
|
831
|
+
this._dataProvider = dataProvider;
|
|
706
832
|
return this;
|
|
707
833
|
}
|
|
708
|
-
build() {
|
|
709
|
-
const queryParam = this.queryParam;
|
|
710
|
-
this.queryParam = new MediusQueryParam();
|
|
711
|
-
return queryParam;
|
|
712
|
-
}
|
|
713
834
|
}
|
|
835
|
+
var ActionPositionEnum;
|
|
836
|
+
(function (ActionPositionEnum) {
|
|
837
|
+
ActionPositionEnum[ActionPositionEnum["ToolbarLeft"] = 0] = "ToolbarLeft";
|
|
838
|
+
ActionPositionEnum[ActionPositionEnum["ToolbarRight"] = 1] = "ToolbarRight";
|
|
839
|
+
ActionPositionEnum[ActionPositionEnum["TableHeader"] = 2] = "TableHeader";
|
|
840
|
+
ActionPositionEnum[ActionPositionEnum["RowInline"] = 3] = "RowInline";
|
|
841
|
+
ActionPositionEnum[ActionPositionEnum["RowClick"] = 4] = "RowClick";
|
|
842
|
+
})(ActionPositionEnum || (ActionPositionEnum = {}));
|
|
843
|
+
var ActionActivationTriggerEnum;
|
|
844
|
+
(function (ActionActivationTriggerEnum) {
|
|
845
|
+
ActionActivationTriggerEnum[ActionActivationTriggerEnum["OnClick"] = 0] = "OnClick";
|
|
846
|
+
ActionActivationTriggerEnum[ActionActivationTriggerEnum["OnRoute"] = 1] = "OnRoute"; // action is triggered for activation by route url
|
|
847
|
+
})(ActionActivationTriggerEnum || (ActionActivationTriggerEnum = {}));
|
|
848
|
+
var ActionTypeEnum;
|
|
849
|
+
(function (ActionTypeEnum) {
|
|
850
|
+
ActionTypeEnum[ActionTypeEnum["Direct"] = 0] = "Direct";
|
|
851
|
+
ActionTypeEnum[ActionTypeEnum["Editor"] = 1] = "Editor"; // editor providing middle step for activation
|
|
852
|
+
})(ActionTypeEnum || (ActionTypeEnum = {}));
|
|
853
|
+
var ActionLevelEnum;
|
|
854
|
+
(function (ActionLevelEnum) {
|
|
855
|
+
ActionLevelEnum[ActionLevelEnum["Default"] = 0] = "Default";
|
|
856
|
+
ActionLevelEnum[ActionLevelEnum["Primary"] = 1] = "Primary";
|
|
857
|
+
ActionLevelEnum[ActionLevelEnum["Secondary"] = 2] = "Secondary";
|
|
858
|
+
ActionLevelEnum[ActionLevelEnum["Info"] = 3] = "Info";
|
|
859
|
+
ActionLevelEnum[ActionLevelEnum["Help"] = 4] = "Help";
|
|
860
|
+
ActionLevelEnum[ActionLevelEnum["Success"] = 5] = "Success";
|
|
861
|
+
ActionLevelEnum[ActionLevelEnum["Warning"] = 6] = "Warning";
|
|
862
|
+
ActionLevelEnum[ActionLevelEnum["Danger"] = 7] = "Danger";
|
|
863
|
+
})(ActionLevelEnum || (ActionLevelEnum = {}));
|
|
714
864
|
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
};
|
|
720
|
-
const typeMapBase = {
|
|
721
|
-
FilterParam: MediusFilterParam,
|
|
722
|
-
QueryParam: MediusQueryParam,
|
|
723
|
-
QueryResult: MediusQueryResult,
|
|
724
|
-
QueryResultWithObject: MediusQueryResultWithObject
|
|
725
|
-
};
|
|
726
|
-
|
|
727
|
-
class TableviewDataProvider extends EditorDataProvider {
|
|
728
|
-
constructor(modelType, serviceType) {
|
|
729
|
-
super(modelType, serviceType);
|
|
730
|
-
this._getAll = () => of(new MediusQueryResult());
|
|
731
|
-
}
|
|
732
|
-
get getAll() {
|
|
733
|
-
return this._getAll;
|
|
865
|
+
class MngFormEditorSubmitEvent {
|
|
866
|
+
constructor(formItem) {
|
|
867
|
+
this.formItem = formItem;
|
|
868
|
+
this.success = true;
|
|
734
869
|
}
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
870
|
+
}
|
|
871
|
+
var MngFormFieldEventTypeEnum;
|
|
872
|
+
(function (MngFormFieldEventTypeEnum) {
|
|
873
|
+
MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Component"] = 0] = "Component";
|
|
874
|
+
MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["ValueChange"] = 1] = "ValueChange";
|
|
875
|
+
MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["DataProvider"] = 2] = "DataProvider";
|
|
876
|
+
MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Dialog"] = 3] = "Dialog";
|
|
877
|
+
MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Other"] = 4] = "Other";
|
|
878
|
+
})(MngFormFieldEventTypeEnum || (MngFormFieldEventTypeEnum = {}));
|
|
879
|
+
class MngFormFieldEventComponentSubtype {
|
|
880
|
+
}
|
|
881
|
+
MngFormFieldEventComponentSubtype.ON_INIT = 'Component.OnInit';
|
|
882
|
+
MngFormFieldEventComponentSubtype.ON_VIEW_INIT = 'Component.OnViewInit';
|
|
883
|
+
MngFormFieldEventComponentSubtype.ON_CONTENT_INIT = 'Component.OnContentInit';
|
|
884
|
+
MngFormFieldEventComponentSubtype.ON_DESTROY = 'Component.OnDestroy';
|
|
885
|
+
class MngFormFieldEventDialogSubtype {
|
|
886
|
+
}
|
|
887
|
+
MngFormFieldEventDialogSubtype.VISIBILITY = 'Dialog.Visibility';
|
|
888
|
+
MngFormFieldEventDialogSubtype.TABLE_CAPTION_COMPONENT_INSTANCE = 'Dialog.MngTable.CaptionComponentInstance';
|
|
889
|
+
MngFormFieldEventDialogSubtype.TABLE_COLUMN_ACTIONS_COMPONENT_INSTANCE = 'Dialog.MngTable.ColumnActionsComponentInstance';
|
|
890
|
+
class MngFormFieldEvent {
|
|
891
|
+
constructor(type, componentType, componentInstance, data = {}) {
|
|
892
|
+
this.type = type;
|
|
893
|
+
this.componentType = componentType;
|
|
894
|
+
this.componentInstance = componentInstance;
|
|
895
|
+
this.data = data;
|
|
738
896
|
}
|
|
739
897
|
}
|
|
740
898
|
|
|
@@ -879,22 +1037,37 @@ class EditorDescriptor {
|
|
|
879
1037
|
EditorDescriptor.defaultGroupName = '_default';
|
|
880
1038
|
class AGenericFieldDescriptor {
|
|
881
1039
|
constructor(editor) {
|
|
1040
|
+
this._config = {};
|
|
882
1041
|
this._editor = editor;
|
|
883
1042
|
}
|
|
884
1043
|
get editor() {
|
|
885
1044
|
return this._editor;
|
|
886
1045
|
}
|
|
1046
|
+
get config() {
|
|
1047
|
+
return this._config;
|
|
1048
|
+
}
|
|
1049
|
+
withConfig(config) {
|
|
1050
|
+
this._config = config;
|
|
1051
|
+
return this;
|
|
1052
|
+
}
|
|
887
1053
|
}
|
|
888
1054
|
class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
889
1055
|
constructor(editor, property) {
|
|
890
1056
|
super(editor);
|
|
891
1057
|
this._required = false;
|
|
892
1058
|
this._disabled = false;
|
|
893
|
-
this._className = '';
|
|
894
1059
|
this._validators = [];
|
|
1060
|
+
this._className = '';
|
|
1061
|
+
this._labelClassName = '';
|
|
1062
|
+
this._inputClassName = '';
|
|
1063
|
+
this._size = FieldDescriptor.SizeEnum.Normal;
|
|
1064
|
+
this._eventsSubject = new Subject();
|
|
895
1065
|
this._property = property;
|
|
896
1066
|
this._label = I18nUtil.getModelPropertyKey(this._editor.model, property);
|
|
897
1067
|
}
|
|
1068
|
+
get property() {
|
|
1069
|
+
return this._property;
|
|
1070
|
+
}
|
|
898
1071
|
get group() {
|
|
899
1072
|
return this._group;
|
|
900
1073
|
}
|
|
@@ -904,6 +1077,9 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
904
1077
|
get placeholder() {
|
|
905
1078
|
return this._placeholder;
|
|
906
1079
|
}
|
|
1080
|
+
get helpText() {
|
|
1081
|
+
return this._helpText;
|
|
1082
|
+
}
|
|
907
1083
|
get required() {
|
|
908
1084
|
return this._required;
|
|
909
1085
|
}
|
|
@@ -913,9 +1089,6 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
913
1089
|
get defaultValue() {
|
|
914
1090
|
return this._defaultValue;
|
|
915
1091
|
}
|
|
916
|
-
get className() {
|
|
917
|
-
return this._className;
|
|
918
|
-
}
|
|
919
1092
|
get getter() {
|
|
920
1093
|
return this._getter;
|
|
921
1094
|
}
|
|
@@ -925,11 +1098,32 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
925
1098
|
get validators() {
|
|
926
1099
|
return this._validators;
|
|
927
1100
|
}
|
|
928
|
-
get
|
|
929
|
-
return this.
|
|
1101
|
+
get requiredExpression() {
|
|
1102
|
+
return this._requiredExpression;
|
|
930
1103
|
}
|
|
931
|
-
get
|
|
932
|
-
return this.
|
|
1104
|
+
get disabledExpression() {
|
|
1105
|
+
return this._disabledExpression;
|
|
1106
|
+
}
|
|
1107
|
+
get hiddenExpression() {
|
|
1108
|
+
return this._hiddenExpression;
|
|
1109
|
+
}
|
|
1110
|
+
get className() {
|
|
1111
|
+
return this._className;
|
|
1112
|
+
}
|
|
1113
|
+
get labelClassName() {
|
|
1114
|
+
return this._labelClassName;
|
|
1115
|
+
}
|
|
1116
|
+
get inputClassName() {
|
|
1117
|
+
return this._inputClassName;
|
|
1118
|
+
}
|
|
1119
|
+
get size() {
|
|
1120
|
+
return this._size;
|
|
1121
|
+
}
|
|
1122
|
+
get isSizeSmall() {
|
|
1123
|
+
return this._size === FieldDescriptor.SizeEnum.Small;
|
|
1124
|
+
}
|
|
1125
|
+
get isSizeLarge() {
|
|
1126
|
+
return this._size === FieldDescriptor.SizeEnum.Large;
|
|
933
1127
|
}
|
|
934
1128
|
withLabel(label) {
|
|
935
1129
|
this._label = label;
|
|
@@ -939,23 +1133,30 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
939
1133
|
this._placeholder = placeholder;
|
|
940
1134
|
return this;
|
|
941
1135
|
}
|
|
942
|
-
|
|
1136
|
+
withHelpText(helpText) {
|
|
1137
|
+
this._helpText = helpText;
|
|
1138
|
+
return this;
|
|
1139
|
+
}
|
|
1140
|
+
withRequired(required = true, requiredExpression) {
|
|
943
1141
|
this._required = required;
|
|
1142
|
+
if (requiredExpression) {
|
|
1143
|
+
this._requiredExpression = requiredExpression;
|
|
1144
|
+
}
|
|
944
1145
|
return this;
|
|
945
1146
|
}
|
|
946
|
-
withDisabled(disabled = true,
|
|
1147
|
+
withDisabled(disabled = true, disabledExpression) {
|
|
947
1148
|
this._disabled = disabled;
|
|
948
|
-
if (
|
|
949
|
-
this.
|
|
1149
|
+
if (disabledExpression) {
|
|
1150
|
+
this._disabledExpression = disabledExpression;
|
|
950
1151
|
}
|
|
951
1152
|
return this;
|
|
952
1153
|
}
|
|
953
|
-
|
|
954
|
-
this.
|
|
1154
|
+
withHidden(hiddenExpression) {
|
|
1155
|
+
this._hiddenExpression = hiddenExpression;
|
|
955
1156
|
return this;
|
|
956
1157
|
}
|
|
957
|
-
|
|
958
|
-
this.
|
|
1158
|
+
withDefaultValue(defaultValue) {
|
|
1159
|
+
this._defaultValue = defaultValue;
|
|
959
1160
|
return this;
|
|
960
1161
|
}
|
|
961
1162
|
withGetter(getter) {
|
|
@@ -970,23 +1171,53 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
970
1171
|
this._validators.push(new FieldValidator(name, expression, message));
|
|
971
1172
|
return this;
|
|
972
1173
|
}
|
|
1174
|
+
withClassName(className, labelClassName = '', inputClassName = '') {
|
|
1175
|
+
this._className = className;
|
|
1176
|
+
this._labelClassName = labelClassName;
|
|
1177
|
+
this._inputClassName = inputClassName;
|
|
1178
|
+
return this;
|
|
1179
|
+
}
|
|
1180
|
+
withSize(size = FieldDescriptor.SizeEnum.Normal) {
|
|
1181
|
+
this._size = size;
|
|
1182
|
+
return this;
|
|
1183
|
+
}
|
|
1184
|
+
nextEvent(type, cmpType, cmpInstance, data) {
|
|
1185
|
+
this._eventsSubject.next(new MngFormFieldEvent(type, cmpType, cmpInstance, data));
|
|
1186
|
+
}
|
|
1187
|
+
get events$() {
|
|
1188
|
+
return this._eventsSubject.asObservable();
|
|
1189
|
+
}
|
|
973
1190
|
copyFieldsTo(obj) {
|
|
974
1191
|
obj._label = this._label;
|
|
975
1192
|
obj._placeholder = this._placeholder;
|
|
1193
|
+
obj._helpText = this._helpText;
|
|
976
1194
|
obj._required = this._required;
|
|
977
1195
|
obj._disabled = this._disabled;
|
|
978
1196
|
obj._defaultValue = this._defaultValue;
|
|
979
|
-
obj.
|
|
1197
|
+
obj._requiredExpression = this._requiredExpression;
|
|
1198
|
+
obj._hiddenExpression = this._hiddenExpression;
|
|
1199
|
+
obj._disabledExpression = this._disabledExpression;
|
|
980
1200
|
obj._className = this._className;
|
|
1201
|
+
obj._size = this.size;
|
|
981
1202
|
obj._getter = this._getter;
|
|
982
1203
|
obj._setter = this._setter;
|
|
983
1204
|
obj._validators = this._validators;
|
|
984
1205
|
}
|
|
985
1206
|
}
|
|
1207
|
+
var FieldDescriptor;
|
|
1208
|
+
(function (FieldDescriptor) {
|
|
1209
|
+
let SizeEnum;
|
|
1210
|
+
(function (SizeEnum) {
|
|
1211
|
+
SizeEnum[SizeEnum["Small"] = 0] = "Small";
|
|
1212
|
+
SizeEnum[SizeEnum["Normal"] = 1] = "Normal";
|
|
1213
|
+
SizeEnum[SizeEnum["Large"] = 2] = "Large";
|
|
1214
|
+
})(SizeEnum = FieldDescriptor.SizeEnum || (FieldDescriptor.SizeEnum = {}));
|
|
1215
|
+
})(FieldDescriptor || (FieldDescriptor = {}));
|
|
986
1216
|
class FieldInputDescriptor extends AFieldDescriptor {
|
|
987
1217
|
constructor(editor, property) {
|
|
988
1218
|
super(editor, property);
|
|
989
1219
|
this._fieldType = FieldInputDescriptor.TypeEnum.Text;
|
|
1220
|
+
this._numberUseGrouping = true;
|
|
990
1221
|
// radio specific properties
|
|
991
1222
|
this._radioOptions = [];
|
|
992
1223
|
this._datePickerShowTime = false;
|
|
@@ -1012,6 +1243,9 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
1012
1243
|
get numberMaxFractionDigits() {
|
|
1013
1244
|
return this._numberMaxFractionDigits;
|
|
1014
1245
|
}
|
|
1246
|
+
get numberUseGrouping() {
|
|
1247
|
+
return this._numberUseGrouping;
|
|
1248
|
+
}
|
|
1015
1249
|
get radioOptions() {
|
|
1016
1250
|
return this._radioOptions;
|
|
1017
1251
|
}
|
|
@@ -1045,6 +1279,10 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
1045
1279
|
get customComponentName() {
|
|
1046
1280
|
return this._customComponentName;
|
|
1047
1281
|
}
|
|
1282
|
+
asHidden() {
|
|
1283
|
+
this._fieldType = FieldInputDescriptor.TypeEnum.Hidden;
|
|
1284
|
+
return this;
|
|
1285
|
+
}
|
|
1048
1286
|
asText(minLength, maxLength, pattern, isEmail) {
|
|
1049
1287
|
this._fieldType = FieldInputDescriptor.TypeEnum.Text;
|
|
1050
1288
|
this._minLength = minLength;
|
|
@@ -1063,13 +1301,14 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
1063
1301
|
this._pattern = pattern;
|
|
1064
1302
|
return this;
|
|
1065
1303
|
}
|
|
1066
|
-
asNumber(step, min, max, minFractionDigits, maxFractionDigits) {
|
|
1304
|
+
asNumber(step, min, max, minFractionDigits, maxFractionDigits, numberUseGrouping = true) {
|
|
1067
1305
|
this._fieldType = FieldInputDescriptor.TypeEnum.Number;
|
|
1068
1306
|
this._numberStep = step;
|
|
1069
1307
|
this._numberMinFractionDigits = minFractionDigits;
|
|
1070
1308
|
this._numberMaxFractionDigits = maxFractionDigits;
|
|
1071
1309
|
this._numberMin = min ?? Number.MIN_SAFE_INTEGER;
|
|
1072
1310
|
this._numberMax = max ?? Number.MAX_SAFE_INTEGER;
|
|
1311
|
+
this._numberUseGrouping = numberUseGrouping;
|
|
1073
1312
|
return this;
|
|
1074
1313
|
}
|
|
1075
1314
|
asSwitch() {
|
|
@@ -1120,6 +1359,7 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
1120
1359
|
field._numberStep = this._numberStep;
|
|
1121
1360
|
field._numberMinFractionDigits = this._numberMinFractionDigits;
|
|
1122
1361
|
field._numberMaxFractionDigits = this._numberMaxFractionDigits;
|
|
1362
|
+
field._numberUseGrouping = this._numberUseGrouping;
|
|
1123
1363
|
field._radioOptions = [...this._radioOptions];
|
|
1124
1364
|
field._datePickerFormat = this._datePickerFormat;
|
|
1125
1365
|
field._datePickerMin = this._datePickerMin;
|
|
@@ -1137,14 +1377,15 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
1137
1377
|
(function (FieldInputDescriptor) {
|
|
1138
1378
|
let TypeEnum;
|
|
1139
1379
|
(function (TypeEnum) {
|
|
1140
|
-
TypeEnum[TypeEnum["
|
|
1141
|
-
TypeEnum[TypeEnum["
|
|
1142
|
-
TypeEnum[TypeEnum["
|
|
1143
|
-
TypeEnum[TypeEnum["
|
|
1144
|
-
TypeEnum[TypeEnum["
|
|
1145
|
-
TypeEnum[TypeEnum["
|
|
1146
|
-
TypeEnum[TypeEnum["
|
|
1147
|
-
TypeEnum[TypeEnum["
|
|
1380
|
+
TypeEnum[TypeEnum["Hidden"] = 0] = "Hidden";
|
|
1381
|
+
TypeEnum[TypeEnum["Text"] = 1] = "Text";
|
|
1382
|
+
TypeEnum[TypeEnum["Textarea"] = 2] = "Textarea";
|
|
1383
|
+
TypeEnum[TypeEnum["Number"] = 3] = "Number";
|
|
1384
|
+
TypeEnum[TypeEnum["Switch"] = 4] = "Switch";
|
|
1385
|
+
TypeEnum[TypeEnum["Radio"] = 5] = "Radio";
|
|
1386
|
+
TypeEnum[TypeEnum["Datepicker"] = 6] = "Datepicker";
|
|
1387
|
+
TypeEnum[TypeEnum["Mask"] = 7] = "Mask";
|
|
1388
|
+
TypeEnum[TypeEnum["Custom"] = 8] = "Custom";
|
|
1148
1389
|
})(TypeEnum = FieldInputDescriptor.TypeEnum || (FieldInputDescriptor.TypeEnum = {}));
|
|
1149
1390
|
})(FieldInputDescriptor || (FieldInputDescriptor = {}));
|
|
1150
1391
|
class FieldLookupDescriptor extends AFieldDescriptor {
|
|
@@ -1169,9 +1410,15 @@ class FieldLookupDescriptor extends AFieldDescriptor {
|
|
|
1169
1410
|
get dataProvider() {
|
|
1170
1411
|
return this._dataProvider;
|
|
1171
1412
|
}
|
|
1413
|
+
get lookupTableDataProvider() {
|
|
1414
|
+
return this._lookupTableDataProvider;
|
|
1415
|
+
}
|
|
1172
1416
|
get modelType() {
|
|
1173
1417
|
return this._modelType;
|
|
1174
1418
|
}
|
|
1419
|
+
get lookupTableDescriptor() {
|
|
1420
|
+
return this._lookupTableDescriptor;
|
|
1421
|
+
}
|
|
1175
1422
|
withItemsLabelProperty(itemsLabelProperty) {
|
|
1176
1423
|
this._itemsLabelProperty = itemsLabelProperty;
|
|
1177
1424
|
return this;
|
|
@@ -1197,10 +1444,19 @@ class FieldLookupDescriptor extends AFieldDescriptor {
|
|
|
1197
1444
|
this._dataProvider = dataProvider;
|
|
1198
1445
|
return this;
|
|
1199
1446
|
}
|
|
1447
|
+
withConfig(config) {
|
|
1448
|
+
return super.withConfig(config);
|
|
1449
|
+
}
|
|
1200
1450
|
asAutocomplete() {
|
|
1201
1451
|
this._lookupType = FieldLookupDescriptor.LookupTypeEnum.Autocomplete;
|
|
1202
1452
|
return this;
|
|
1203
1453
|
}
|
|
1454
|
+
asDialog(lookupTableDescriptor, tableDataProvider) {
|
|
1455
|
+
this._lookupType = FieldLookupDescriptor.LookupTypeEnum.Dialog;
|
|
1456
|
+
this._lookupTableDescriptor = lookupTableDescriptor;
|
|
1457
|
+
this._lookupTableDataProvider = tableDataProvider;
|
|
1458
|
+
return this;
|
|
1459
|
+
}
|
|
1204
1460
|
copy() {
|
|
1205
1461
|
const field = new FieldLookupDescriptor(this._editor, this._property, this._modelType);
|
|
1206
1462
|
this.copyFieldsTo(field);
|
|
@@ -1209,6 +1465,7 @@ class FieldLookupDescriptor extends AFieldDescriptor {
|
|
|
1209
1465
|
field._itemsValueProperty = this._itemsValueProperty;
|
|
1210
1466
|
field._dataKeyProperty = this._dataKeyProperty;
|
|
1211
1467
|
field._dataProvider = this._dataProvider;
|
|
1468
|
+
field._lookupTableDescriptor = this._lookupTableDescriptor;
|
|
1212
1469
|
return field;
|
|
1213
1470
|
}
|
|
1214
1471
|
}
|
|
@@ -1217,6 +1474,7 @@ class FieldLookupDescriptor extends AFieldDescriptor {
|
|
|
1217
1474
|
(function (LookupTypeEnum) {
|
|
1218
1475
|
LookupTypeEnum[LookupTypeEnum["Dropdown"] = 0] = "Dropdown";
|
|
1219
1476
|
LookupTypeEnum[LookupTypeEnum["Autocomplete"] = 1] = "Autocomplete";
|
|
1477
|
+
LookupTypeEnum[LookupTypeEnum["Dialog"] = 2] = "Dialog";
|
|
1220
1478
|
})(LookupTypeEnum = FieldLookupDescriptor.LookupTypeEnum || (FieldLookupDescriptor.LookupTypeEnum = {}));
|
|
1221
1479
|
})(FieldLookupDescriptor || (FieldLookupDescriptor = {}));
|
|
1222
1480
|
class FieldLookupEnumDescriptor extends FieldLookupDescriptor {
|
|
@@ -2252,6 +2510,8 @@ class EditorFormlyUtil {
|
|
|
2252
2510
|
field.templateOptions['descriptor'] = descriptor;
|
|
2253
2511
|
if (descriptor instanceof FieldInputDescriptor) {
|
|
2254
2512
|
switch (descriptor.fieldType) {
|
|
2513
|
+
case FieldInputDescriptor.TypeEnum.Hidden:
|
|
2514
|
+
break;
|
|
2255
2515
|
case FieldInputDescriptor.TypeEnum.Textarea:
|
|
2256
2516
|
field.type = 'textarea';
|
|
2257
2517
|
break;
|
|
@@ -2291,6 +2551,9 @@ class EditorFormlyUtil {
|
|
|
2291
2551
|
case FieldLookupDescriptor.LookupTypeEnum.Autocomplete:
|
|
2292
2552
|
field.type = 'autocomplete';
|
|
2293
2553
|
break;
|
|
2554
|
+
case FieldLookupDescriptor.LookupTypeEnum.Dialog:
|
|
2555
|
+
field.type = 'dialog';
|
|
2556
|
+
break;
|
|
2294
2557
|
case FieldLookupDescriptor.LookupTypeEnum.Dropdown:
|
|
2295
2558
|
default:
|
|
2296
2559
|
field.type = 'dropdown';
|
|
@@ -2306,11 +2569,17 @@ class EditorFormlyUtil {
|
|
|
2306
2569
|
if (descriptor.label) {
|
|
2307
2570
|
field.templateOptions.label = descriptor.label;
|
|
2308
2571
|
}
|
|
2572
|
+
if (descriptor.requiredExpression) {
|
|
2573
|
+
field.expressionProperties['templateOptions.required'] = descriptor.requiredExpression;
|
|
2574
|
+
}
|
|
2309
2575
|
if (descriptor.required) {
|
|
2310
2576
|
field.templateOptions.required = true;
|
|
2311
2577
|
}
|
|
2312
|
-
if (descriptor.
|
|
2313
|
-
field.expressionProperties['
|
|
2578
|
+
if (descriptor.hiddenExpression) {
|
|
2579
|
+
field.expressionProperties['hide'] = descriptor.hiddenExpression;
|
|
2580
|
+
}
|
|
2581
|
+
if (descriptor.disabledExpression) {
|
|
2582
|
+
field.expressionProperties['templateOptions.disabled'] = descriptor.disabledExpression;
|
|
2314
2583
|
}
|
|
2315
2584
|
else if (descriptor.disabled) {
|
|
2316
2585
|
field.templateOptions.disabled = true;
|
|
@@ -2603,7 +2872,15 @@ class ModelUtil {
|
|
|
2603
2872
|
}
|
|
2604
2873
|
|
|
2605
2874
|
class ToastUtil {
|
|
2606
|
-
static
|
|
2875
|
+
static notification(viewContainer, title, message, severity = 'success') {
|
|
2876
|
+
const messageService = viewContainer?.getMessageService();
|
|
2877
|
+
if (!messageService) {
|
|
2878
|
+
console.warn(`No message service was provided through view container, message will not be displayed.`);
|
|
2879
|
+
return;
|
|
2880
|
+
}
|
|
2881
|
+
messageService.add({ severity: severity, summary: title, detail: message });
|
|
2882
|
+
}
|
|
2883
|
+
static tableNotificationError(translationService, table, error, viewContainer) {
|
|
2607
2884
|
const params = {};
|
|
2608
2885
|
if (error?.message) {
|
|
2609
2886
|
params.errorMessage = `: ${error.message}`;
|
|
@@ -2614,14 +2891,14 @@ class ToastUtil {
|
|
|
2614
2891
|
console.log(params);
|
|
2615
2892
|
const tableErrorTitle = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.title', undefined, undefined, 'general.error', params) ?? undefined;
|
|
2616
2893
|
const tableErrorMessage = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.message', undefined, undefined, 'general.errorMessage', params) ?? undefined;
|
|
2617
|
-
|
|
2894
|
+
ToastUtil.notification(viewContainer, tableErrorTitle, tableErrorMessage, 'error');
|
|
2618
2895
|
}
|
|
2619
|
-
static actionNotificationSuccess(translationService, action, functionName, customTitleKey, customMessageKey,
|
|
2896
|
+
static actionNotificationSuccess(translationService, action, functionName, customTitleKey, customMessageKey, viewContainer, item) {
|
|
2620
2897
|
const actionSuccessTitle = I18nUtil.instantActionTranslation(translationService, action, 'success.title', customTitleKey, item, 'general.success', functionName) ?? undefined;
|
|
2621
2898
|
const actionSuccessMessage = I18nUtil.instantActionTranslation(translationService, action, 'success.message', customMessageKey, item, 'general.successMessage', functionName) ?? undefined;
|
|
2622
|
-
|
|
2899
|
+
ToastUtil.notification(viewContainer, actionSuccessTitle, actionSuccessMessage);
|
|
2623
2900
|
}
|
|
2624
|
-
static actionNotificationError(translationService, action, error, functionName,
|
|
2901
|
+
static actionNotificationError(translationService, action, error, functionName, viewContainer, item) {
|
|
2625
2902
|
const params = {};
|
|
2626
2903
|
if (error?.message) {
|
|
2627
2904
|
params.errorMessage = `: ${error.message}`;
|
|
@@ -2632,7 +2909,7 @@ class ToastUtil {
|
|
|
2632
2909
|
const actionErrorTitle = I18nUtil.instantActionTranslation(translationService, action, 'error.title', action.runNotificationErrorTitle, item, 'general.error', functionName, params) ??
|
|
2633
2910
|
undefined;
|
|
2634
2911
|
const actionErrorMessage = I18nUtil.instantActionTranslation(translationService, action, 'error.message', action.runNotificationErrorMessage, item, 'general.errorMessage', functionName, params) ?? undefined;
|
|
2635
|
-
|
|
2912
|
+
ToastUtil.notification(viewContainer, actionErrorTitle, actionErrorMessage, 'error');
|
|
2636
2913
|
}
|
|
2637
2914
|
static getFormEditorWarningMessage(translationService, title, message) {
|
|
2638
2915
|
const actionErrorTitle = translationService.instant(title) ?? undefined;
|
|
@@ -3086,12 +3363,12 @@ MediusRestUtil.matchModeMapping = [
|
|
|
3086
3363
|
];
|
|
3087
3364
|
|
|
3088
3365
|
class ActionExecContext {
|
|
3089
|
-
constructor(dataProvider, serviceInstance, data, sourceComponent = null,
|
|
3366
|
+
constructor(dataProvider, serviceInstance, data, sourceComponent = null, viewContainer = null) {
|
|
3090
3367
|
this.dataProvider = dataProvider;
|
|
3091
3368
|
this.serviceInstance = serviceInstance;
|
|
3092
3369
|
this.data = data;
|
|
3093
3370
|
this.sourceComponent = sourceComponent;
|
|
3094
|
-
this.
|
|
3371
|
+
this.viewContainer = viewContainer;
|
|
3095
3372
|
}
|
|
3096
3373
|
}
|
|
3097
3374
|
class ActionError {
|
|
@@ -3143,23 +3420,33 @@ class ActionTriggerResult {
|
|
|
3143
3420
|
}
|
|
3144
3421
|
}
|
|
3145
3422
|
|
|
3146
|
-
|
|
3147
|
-
|
|
3423
|
+
const MNG_BROWSER_STORAGE_IT = new InjectionToken('Browser storage', {
|
|
3424
|
+
providedIn: 'root',
|
|
3425
|
+
factory: () => localStorage
|
|
3426
|
+
});
|
|
3427
|
+
|
|
3428
|
+
const ACTION_EDITOR_DIALOG_COMPONENT_SETTING = new InjectionToken('ACTION_EDITOR_DIALOG_COMPONENT_SETTING');
|
|
3429
|
+
|
|
3430
|
+
const MNG_MODULE_CONFIG_IT = new InjectionToken('MngModuleConfig');
|
|
3431
|
+
|
|
3432
|
+
class MngActionExecutorService {
|
|
3433
|
+
constructor(injector, router, dialogService, confirmationService, translate, defaultEditorDialogComponent) {
|
|
3148
3434
|
this.injector = injector;
|
|
3149
3435
|
this.router = router;
|
|
3150
3436
|
this.dialogService = dialogService;
|
|
3151
3437
|
this.confirmationService = confirmationService;
|
|
3152
3438
|
this.translate = translate;
|
|
3439
|
+
this.defaultEditorDialogComponent = defaultEditorDialogComponent;
|
|
3153
3440
|
}
|
|
3154
|
-
|
|
3155
|
-
return new ActionExecContext(dataProvider, this.getDataProviderService(dataProvider) ?? undefined, {
|
|
3441
|
+
prepareActionExecContext(action, itemId, item, dataProvider, viewContainer, sourceComponent, actionData) {
|
|
3442
|
+
return new ActionExecContext(dataProvider ?? action.dataProvider ?? viewContainer?.getDataProvider(), this.getDataProviderService(dataProvider) ?? undefined, {
|
|
3156
3443
|
item,
|
|
3157
3444
|
itemId,
|
|
3158
3445
|
actionData
|
|
3159
|
-
}, sourceComponent,
|
|
3446
|
+
}, sourceComponent, viewContainer);
|
|
3160
3447
|
}
|
|
3161
|
-
runAction(action, itemId, item, dataProvider, sourceComponent,
|
|
3162
|
-
const context = this.
|
|
3448
|
+
runAction(action, itemId, item, dataProvider, sourceComponent, viewContainer, actionData) {
|
|
3449
|
+
const context = this.prepareActionExecContext(action, itemId, item, dataProvider, viewContainer, sourceComponent, actionData);
|
|
3163
3450
|
if (action.hasRunConfirmation) {
|
|
3164
3451
|
if (typeof sourceComponent?.getConfirmationService !== 'function' || typeof sourceComponent?.getConfirmationServiceInstanceKey !== 'function') {
|
|
3165
3452
|
throw Error(`Source component ${sourceComponent} should be implementing IConfirmationService interface to be able to provide confirmation functionality.`);
|
|
@@ -3197,12 +3484,12 @@ class MngActionService {
|
|
|
3197
3484
|
.runFunction(context)
|
|
3198
3485
|
.pipe(first(), map(res => new ActionRunResult(context, res)), map(value => {
|
|
3199
3486
|
if (action.hasRunNotificationSuccess) {
|
|
3200
|
-
ToastUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage,
|
|
3487
|
+
ToastUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, item);
|
|
3201
3488
|
}
|
|
3202
3489
|
return value;
|
|
3203
3490
|
}), catchError(err => {
|
|
3204
3491
|
if (action.hasRunNotificationError) {
|
|
3205
|
-
ToastUtil.actionNotificationError(this.translate, action, err, 'run',
|
|
3492
|
+
ToastUtil.actionNotificationError(this.translate, action, err, 'run', viewContainer, item);
|
|
3206
3493
|
}
|
|
3207
3494
|
throw err;
|
|
3208
3495
|
}))
|
|
@@ -3220,12 +3507,12 @@ class MngActionService {
|
|
|
3220
3507
|
else {
|
|
3221
3508
|
return action.runFunction(context).pipe(map(res => new ActionRunResult(context, res)), map(value => {
|
|
3222
3509
|
if (action.hasRunNotificationSuccess) {
|
|
3223
|
-
ToastUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage,
|
|
3510
|
+
ToastUtil.actionNotificationSuccess(this.translate, action, 'run', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, item);
|
|
3224
3511
|
}
|
|
3225
3512
|
return value;
|
|
3226
3513
|
}), catchError(err => {
|
|
3227
3514
|
if (action.hasRunNotificationError) {
|
|
3228
|
-
ToastUtil.actionNotificationError(this.translate, action, err, 'run',
|
|
3515
|
+
ToastUtil.actionNotificationError(this.translate, action, err, 'run', viewContainer, item);
|
|
3229
3516
|
}
|
|
3230
3517
|
throw err;
|
|
3231
3518
|
}));
|
|
@@ -3239,22 +3526,22 @@ class MngActionService {
|
|
|
3239
3526
|
* @param formItem Item instance (from form).
|
|
3240
3527
|
* @param dataProvider Data provider
|
|
3241
3528
|
* @param sourceComponent Source component from where the fetch function was called.
|
|
3242
|
-
* @param
|
|
3529
|
+
* @param viewContainer View container/service.
|
|
3243
3530
|
* @param actionData Additional action data.
|
|
3244
3531
|
*/
|
|
3245
|
-
runEditorSave(action, itemId, formItem, dataProvider, sourceComponent,
|
|
3246
|
-
const context = this.
|
|
3532
|
+
runEditorSave(action, itemId, formItem, dataProvider, sourceComponent, viewContainer, actionData) {
|
|
3533
|
+
const context = this.prepareExecContextForEditor(action, formItem, itemId, dataProvider, sourceComponent, viewContainer, actionData);
|
|
3247
3534
|
if (typeof action.submitFunction !== 'function') {
|
|
3248
3535
|
throw new Error(`Submit function for action ${action.actionName} cannot be invoked.`);
|
|
3249
3536
|
}
|
|
3250
3537
|
return action.submitFunction(context).pipe(map(res => new ActionRunResult(context, res)), map(value => {
|
|
3251
3538
|
if (action.hasRunNotificationSuccess) {
|
|
3252
|
-
ToastUtil.actionNotificationSuccess(this.translate, action, 'submit', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage,
|
|
3539
|
+
ToastUtil.actionNotificationSuccess(this.translate, action, 'submit', action.runNotificationSuccessTitle, action.runNotificationSuccessMessage, viewContainer, formItem);
|
|
3253
3540
|
}
|
|
3254
3541
|
return value;
|
|
3255
3542
|
}), catchError(err => {
|
|
3256
3543
|
if (action.hasRunNotificationError) {
|
|
3257
|
-
ToastUtil.actionNotificationError(this.translate, action, err, 'submit',
|
|
3544
|
+
ToastUtil.actionNotificationError(this.translate, action, err, 'submit', viewContainer, formItem);
|
|
3258
3545
|
}
|
|
3259
3546
|
throw err;
|
|
3260
3547
|
}));
|
|
@@ -3266,30 +3553,40 @@ class MngActionService {
|
|
|
3266
3553
|
* @param itemId Item id.
|
|
3267
3554
|
* @param dataProvider Data provider
|
|
3268
3555
|
* @param sourceComponent Source component from where the fetch function was called.
|
|
3269
|
-
* @param
|
|
3556
|
+
* @param viewContainer View container/service. Tableview component.
|
|
3270
3557
|
* @param actionData Additional action data.
|
|
3271
3558
|
*/
|
|
3272
|
-
runEditorFetch(action, itemId, dataProvider, sourceComponent,
|
|
3273
|
-
const context = this.
|
|
3559
|
+
runEditorFetch(action, itemId, dataProvider, sourceComponent, viewContainer, actionData) {
|
|
3560
|
+
const context = this.prepareExecContextForEditor(action, undefined, itemId, dataProvider, sourceComponent, viewContainer, actionData);
|
|
3274
3561
|
return action.fetchFunction(context).pipe(map(res => new ActionRunResult(context, res)));
|
|
3275
3562
|
// TODO: error handling
|
|
3276
3563
|
}
|
|
3277
3564
|
/**
|
|
3278
|
-
* Prepares action
|
|
3565
|
+
* Prepares action exec context for action of type editor.
|
|
3279
3566
|
*
|
|
3280
3567
|
* @param item Item instance (if exists).
|
|
3281
3568
|
* @param itemId Item id (if exists).
|
|
3282
3569
|
* @param dataProvider Data provider.
|
|
3283
3570
|
* @param sourceComponent Source component from where the context preparation was called.
|
|
3284
|
-
* @param
|
|
3571
|
+
* @param viewContainer View container/service.
|
|
3285
3572
|
* @param actionData Additional action data.
|
|
3286
3573
|
*/
|
|
3287
|
-
|
|
3288
|
-
|
|
3574
|
+
prepareExecContextForEditor(action, item, itemId, dataProvider, sourceComponent, viewContainer, actionData) {
|
|
3575
|
+
let ctxDataProvider = dataProvider;
|
|
3576
|
+
if (!ctxDataProvider && action.dataProvider) {
|
|
3577
|
+
ctxDataProvider = action.dataProvider;
|
|
3578
|
+
}
|
|
3579
|
+
if (!ctxDataProvider) {
|
|
3580
|
+
const viewContainerDataProvider = viewContainer?.getDataProvider();
|
|
3581
|
+
if (viewContainerDataProvider) {
|
|
3582
|
+
ctxDataProvider = action.dataProvider;
|
|
3583
|
+
}
|
|
3584
|
+
}
|
|
3585
|
+
const context = new ActionExecContext(ctxDataProvider, this.getDataProviderService(ctxDataProvider) ?? undefined, {
|
|
3289
3586
|
item,
|
|
3290
3587
|
itemId,
|
|
3291
3588
|
actionData
|
|
3292
|
-
}, sourceComponent,
|
|
3589
|
+
}, sourceComponent, viewContainer);
|
|
3293
3590
|
return context;
|
|
3294
3591
|
}
|
|
3295
3592
|
/**
|
|
@@ -3312,11 +3609,15 @@ class MngActionService {
|
|
|
3312
3609
|
* @param item Item instance (if exists).
|
|
3313
3610
|
* @param itemId Item id (if exists).
|
|
3314
3611
|
* @param actionData Optional additional action data.
|
|
3315
|
-
* @param
|
|
3612
|
+
* @param viewContainer View container component/service.
|
|
3316
3613
|
* @param sourceComponent Source activation component.
|
|
3317
3614
|
*/
|
|
3318
|
-
activateAction(action, itemId, item, actionData,
|
|
3615
|
+
activateAction(action, itemId, item, actionData, viewContainer, sourceComponent) {
|
|
3319
3616
|
if (action.type === ActionTypeEnum.Editor) {
|
|
3617
|
+
let dialogComponent = this.defaultEditorDialogComponent;
|
|
3618
|
+
if (action instanceof ActionEditorDescriptor && action.editorComponent) {
|
|
3619
|
+
dialogComponent = action.editorComponent;
|
|
3620
|
+
}
|
|
3320
3621
|
const dialogConfig = {
|
|
3321
3622
|
data: {
|
|
3322
3623
|
action
|
|
@@ -3332,18 +3633,18 @@ class MngActionService {
|
|
|
3332
3633
|
if (actionData) {
|
|
3333
3634
|
dialogConfig.data.actionData = actionData;
|
|
3334
3635
|
}
|
|
3335
|
-
if (
|
|
3336
|
-
dialogConfig.data.
|
|
3636
|
+
if (viewContainer) {
|
|
3637
|
+
dialogConfig.data.viewContainer = viewContainer;
|
|
3337
3638
|
}
|
|
3338
3639
|
if (sourceComponent) {
|
|
3339
3640
|
dialogConfig.data.sourceComponent = sourceComponent;
|
|
3340
3641
|
}
|
|
3341
|
-
const dialogRef = this.dialogService.open(
|
|
3642
|
+
const dialogRef = this.dialogService.open(dialogComponent, dialogConfig);
|
|
3342
3643
|
return of(new ActionActivationResult(undefined, dialogRef));
|
|
3343
3644
|
}
|
|
3344
3645
|
else {
|
|
3345
3646
|
// directly execute action
|
|
3346
|
-
return this.runAction(action, itemId, item,
|
|
3647
|
+
return this.runAction(action, itemId, item, undefined, sourceComponent, viewContainer, actionData).pipe(map(res => new ActionActivationResult(res)));
|
|
3347
3648
|
}
|
|
3348
3649
|
}
|
|
3349
3650
|
/**
|
|
@@ -3367,7 +3668,7 @@ class MngActionService {
|
|
|
3367
3668
|
* @param actionData Optional action data.
|
|
3368
3669
|
* @param route Optional activated route.
|
|
3369
3670
|
*/
|
|
3370
|
-
triggerAction(action, itemId, item, actionData, route,
|
|
3671
|
+
triggerAction(action, itemId, item, actionData, route, viewContainer, sourceComponent) {
|
|
3371
3672
|
if (action.activationTrigger === ActionActivationTriggerEnum.OnRoute) {
|
|
3372
3673
|
const baseUrl = this.router.url.split('?')[0];
|
|
3373
3674
|
const parsedUrl = this.router.parseUrl(this.router.url);
|
|
@@ -3394,15 +3695,18 @@ class MngActionService {
|
|
|
3394
3695
|
return of(new ActionTriggerResult(undefined, from(this.router.navigate([baseUrl, ...actionUrlSegments], { relativeTo: route, queryParams: parsedUrl.queryParams }))));
|
|
3395
3696
|
}
|
|
3396
3697
|
else {
|
|
3397
|
-
return this.activateAction(action, itemId, item, actionData,
|
|
3698
|
+
return this.activateAction(action, itemId, item, actionData, viewContainer, sourceComponent).pipe(map(res => new ActionTriggerResult(res)));
|
|
3398
3699
|
}
|
|
3399
3700
|
}
|
|
3400
3701
|
}
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type:
|
|
3702
|
+
MngActionExecutorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionExecutorService, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i3.DialogService }, { token: i2.ConfirmationService }, { token: i3$1.TranslateService }, { token: ACTION_EDITOR_DIALOG_COMPONENT_SETTING }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3703
|
+
MngActionExecutorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionExecutorService });
|
|
3704
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionExecutorService, decorators: [{
|
|
3404
3705
|
type: Injectable
|
|
3405
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type:
|
|
3706
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i3.DialogService }, { type: i2.ConfirmationService }, { type: i3$1.TranslateService }, { type: i0.Type, decorators: [{
|
|
3707
|
+
type: Inject,
|
|
3708
|
+
args: [ACTION_EDITOR_DIALOG_COMPONENT_SETTING]
|
|
3709
|
+
}] }]; } });
|
|
3406
3710
|
|
|
3407
3711
|
class MngConfigurationService {
|
|
3408
3712
|
constructor(http) {
|
|
@@ -3446,7 +3750,7 @@ class MngConfigurationService {
|
|
|
3446
3750
|
const pathSegments = url.split('/');
|
|
3447
3751
|
pathSegments[pathSegments.length - 1] = 'env.json';
|
|
3448
3752
|
return this.http.get(pathSegments.join('/'));
|
|
3449
|
-
}),
|
|
3753
|
+
}), map(res => {
|
|
3450
3754
|
this.jsonEnvironments.push(res);
|
|
3451
3755
|
this.mergeConfigs();
|
|
3452
3756
|
return true;
|
|
@@ -3480,13 +3784,6 @@ class MngConfigurationService {
|
|
|
3480
3784
|
}
|
|
3481
3785
|
MngConfigurationService._instance = null;
|
|
3482
3786
|
|
|
3483
|
-
const MNG_BROWSER_STORAGE_IT = new InjectionToken('Browser storage', {
|
|
3484
|
-
providedIn: 'root',
|
|
3485
|
-
factory: () => localStorage
|
|
3486
|
-
});
|
|
3487
|
-
|
|
3488
|
-
const MNG_MODULE_CONFIG_IT = new InjectionToken('MngModuleConfig');
|
|
3489
|
-
|
|
3490
3787
|
class MngCommonsService {
|
|
3491
3788
|
constructor(router, primengConfig, translate, titleService, configurationService, moduleConfig, localStorage) {
|
|
3492
3789
|
this.router = router;
|
|
@@ -3809,11 +4106,11 @@ class MngCommonsService {
|
|
|
3809
4106
|
return titlePieces.join(' - ');
|
|
3810
4107
|
}
|
|
3811
4108
|
}
|
|
3812
|
-
MngCommonsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService, deps: [{ token: i1.Router }, { token: i2
|
|
4109
|
+
MngCommonsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService, deps: [{ token: i1.Router }, { token: i2.PrimeNGConfig }, { token: i3$1.TranslateService }, { token: i4.Title }, { token: MngConfigurationService }, { token: MNG_MODULE_CONFIG_IT }, { token: MNG_BROWSER_STORAGE_IT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3813
4110
|
MngCommonsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService });
|
|
3814
4111
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService, decorators: [{
|
|
3815
4112
|
type: Injectable
|
|
3816
|
-
}], ctorParameters: function () { return [{ type: i1.Router }, { type: i2
|
|
4113
|
+
}], ctorParameters: function () { return [{ type: i1.Router }, { type: i2.PrimeNGConfig }, { type: i3$1.TranslateService }, { type: i4.Title }, { type: MngConfigurationService }, { type: undefined, decorators: [{
|
|
3817
4114
|
type: Inject,
|
|
3818
4115
|
args: [MNG_MODULE_CONFIG_IT]
|
|
3819
4116
|
}] }, { type: Storage, decorators: [{
|
|
@@ -3864,38 +4161,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
3864
4161
|
type: Injectable
|
|
3865
4162
|
}], ctorParameters: function () { return [{ type: i1.Router }, { type: i4$1.Location }]; } });
|
|
3866
4163
|
|
|
3867
|
-
|
|
3868
|
-
|
|
4164
|
+
/**
|
|
4165
|
+
* Should be used with providers defined within component.
|
|
4166
|
+
*/
|
|
4167
|
+
class MngViewContainerComponentService {
|
|
4168
|
+
constructor(messageService) {
|
|
4169
|
+
this.messageService = messageService;
|
|
3869
4170
|
this.actions = [];
|
|
3870
4171
|
this._reloadTableSubject = new Subject();
|
|
3871
4172
|
}
|
|
4173
|
+
set dataProvider(dataProvider) {
|
|
4174
|
+
this._dataProvider = dataProvider;
|
|
4175
|
+
}
|
|
3872
4176
|
get reloadTable$() {
|
|
3873
4177
|
return this._reloadTableSubject.asObservable();
|
|
3874
4178
|
}
|
|
3875
4179
|
triggerTableReload(event) {
|
|
3876
4180
|
this._reloadTableSubject.next(event);
|
|
3877
4181
|
}
|
|
4182
|
+
getMessageService() {
|
|
4183
|
+
return this.messageService;
|
|
4184
|
+
}
|
|
4185
|
+
getDataProvider() {
|
|
4186
|
+
return this._dataProvider;
|
|
4187
|
+
}
|
|
3878
4188
|
}
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type:
|
|
4189
|
+
MngViewContainerComponentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngViewContainerComponentService, deps: [{ token: i2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4190
|
+
MngViewContainerComponentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngViewContainerComponentService });
|
|
4191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngViewContainerComponentService, decorators: [{
|
|
3882
4192
|
type: Injectable
|
|
3883
|
-
}] });
|
|
4193
|
+
}], ctorParameters: function () { return [{ type: i2.MessageService }]; } });
|
|
3884
4194
|
|
|
3885
4195
|
class MngActionComponent {
|
|
3886
|
-
constructor(route, translate,
|
|
4196
|
+
constructor(route, translate, actionExecutor, confirmationService, viewContainerService) {
|
|
3887
4197
|
this.route = route;
|
|
3888
4198
|
this.translate = translate;
|
|
3889
|
-
this.
|
|
4199
|
+
this.actionExecutor = actionExecutor;
|
|
3890
4200
|
this.confirmationService = confirmationService;
|
|
3891
|
-
this.
|
|
4201
|
+
this.viewContainerService = viewContainerService;
|
|
3892
4202
|
this.loadingSubject = new ReplaySubject(1);
|
|
3893
4203
|
this.$loading = this.loadingSubject.asObservable();
|
|
3894
4204
|
this.cmpId = Math.random().toString(36).substring(2);
|
|
3895
4205
|
this.loadingSubject.next(false);
|
|
3896
4206
|
}
|
|
3897
4207
|
ngOnInit() {
|
|
3898
|
-
|
|
4208
|
+
this.viewContainer = this.viewContainerInit ?? this.viewContainerService ?? undefined;
|
|
4209
|
+
const context = this.actionExecutor.prepareActionExecContext(this.action, this.itemId, this.item, this.dataProvider, this.viewContainer ?? undefined, this, this.actionData);
|
|
3899
4210
|
this.$isVisible = typeof this.action.isVisibleFunction === 'function' ? this.action.isVisibleFunction(context) : of(true);
|
|
3900
4211
|
this.$isEnabled = typeof this.action.isEnabledFunction === 'function' ? this.action.isEnabledFunction(context) : of(true);
|
|
3901
4212
|
this.$label = I18nUtil.streamActionTranslation(this.translate, this.action, 'title', this.action?.title ?? undefined, this.item);
|
|
@@ -3906,11 +4217,17 @@ class MngActionComponent {
|
|
|
3906
4217
|
this.loadingSubject.next(true);
|
|
3907
4218
|
const actionData = this.actionData ? this.actionData : {};
|
|
3908
4219
|
actionData['cmpId'] = this.cmpId;
|
|
3909
|
-
this.
|
|
3910
|
-
.triggerAction(this.action, this.itemId, this.item, actionData, this.route, this.
|
|
3911
|
-
.pipe(first()
|
|
3912
|
-
|
|
3913
|
-
|
|
4220
|
+
this.actionExecutor
|
|
4221
|
+
.triggerAction(this.action, this.itemId, this.item, actionData, this.route, this.viewContainer, this)
|
|
4222
|
+
.pipe(first())
|
|
4223
|
+
.subscribe({
|
|
4224
|
+
next: () => {
|
|
4225
|
+
this.loadingSubject.next(false);
|
|
4226
|
+
},
|
|
4227
|
+
error: err => {
|
|
4228
|
+
console.error(`Error occurred while executing action ${this.action.actionName}.`, err);
|
|
4229
|
+
}
|
|
4230
|
+
});
|
|
3914
4231
|
}
|
|
3915
4232
|
getConfirmationService() {
|
|
3916
4233
|
return this.confirmationService;
|
|
@@ -3919,12 +4236,14 @@ class MngActionComponent {
|
|
|
3919
4236
|
return `${action.actionName}_${this.cmpId}`;
|
|
3920
4237
|
}
|
|
3921
4238
|
}
|
|
3922
|
-
MngActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionComponent, deps: [{ token: i1.ActivatedRoute }, { token:
|
|
3923
|
-
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: [
|
|
4239
|
+
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 });
|
|
4240
|
+
MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", dataProvider: "dataProvider", viewContainerInit: ["viewContainer", "viewContainerInit"] }, providers: [ConfirmationService], ngImport: i0, template: "<ng-container *ngIf=\"$isVisible | async\">\n <button\n *ngIf=\"action.icon && action.title === null; else noIcon\"\n type=\"button\"\n pButton\n pRipple\n [icon]=\"action.icon\"\n [loading]=\"($loading | async) ?? false\"\n [disabled]=\"($isEnabled | async) === false\"\n [pTooltip]=\"$any($tooltip | async)\"\n (click)=\"triggerAction($event)\"\n class=\"mng-action-button mng-action-button-icon p-button-rounded\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-primary]=\"action.level === 1\"\n [class.p-button-success]=\"action.level === 5\"\n [class.p-button-danger]=\"action.level === 7\"></button>\n <ng-template #noIcon>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [label]=\"($label | async) ?? ''\"\n [loading]=\"($loading | async) ?? false\"\n [disabled]=\"($isEnabled | async) === false\"\n [pTooltip]=\"$any($tooltip | async)\"\n (click)=\"triggerAction($event)\"\n class=\"mng-action-button p-button-text\"\n [class.p-button-sm]=\"action.isSizeSmall\"\n [class.p-button-lg]=\"action.isSizeLarge\"\n [class.p-button-primary]=\"action.level === 1\"\n [class.p-button-success]=\"action.level === 5\"\n [class.p-button-danger]=\"action.level === 7\"></button>\n </ng-template>\n <p-confirmDialog *ngIf=\"action.hasRunConfirmation\" [key]=\"action.actionName + '_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n</ng-container>\n", components: [{ type: i6.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i9.Ripple, selector: "[pRipple]" }, { type: i10.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }], pipes: { "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3924
4241
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionComponent, decorators: [{
|
|
3925
4242
|
type: Component,
|
|
3926
|
-
args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
3927
|
-
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type:
|
|
4243
|
+
args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfirmationService], template: "<ng-container *ngIf=\"$isVisible | async\">\n <button\n *ngIf=\"action.icon && action.title === null; else noIcon\"\n type=\"button\"\n pButton\n pRipple\n [icon]=\"action.icon\"\n [loading]=\"($loading | async) ?? false\"\n [disabled]=\"($isEnabled | async) === false\"\n [pTooltip]=\"$any($tooltip | async)\"\n (click)=\"triggerAction($event)\"\n class=\"mng-action-button mng-action-button-icon p-button-rounded\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-primary]=\"action.level === 1\"\n [class.p-button-success]=\"action.level === 5\"\n [class.p-button-danger]=\"action.level === 7\"></button>\n <ng-template #noIcon>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [label]=\"($label | async) ?? ''\"\n [loading]=\"($loading | async) ?? false\"\n [disabled]=\"($isEnabled | async) === false\"\n [pTooltip]=\"$any($tooltip | async)\"\n (click)=\"triggerAction($event)\"\n class=\"mng-action-button p-button-text\"\n [class.p-button-sm]=\"action.isSizeSmall\"\n [class.p-button-lg]=\"action.isSizeLarge\"\n [class.p-button-primary]=\"action.level === 1\"\n [class.p-button-success]=\"action.level === 5\"\n [class.p-button-danger]=\"action.level === 7\"></button>\n </ng-template>\n <p-confirmDialog *ngIf=\"action.hasRunConfirmation\" [key]=\"action.actionName + '_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n</ng-container>\n" }]
|
|
4244
|
+
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i3$1.TranslateService }, { type: MngActionExecutorService }, { type: i2.ConfirmationService }, { type: MngViewContainerComponentService, decorators: [{
|
|
4245
|
+
type: Optional
|
|
4246
|
+
}] }]; }, propDecorators: { action: [{
|
|
3928
4247
|
type: Input
|
|
3929
4248
|
}], item: [{
|
|
3930
4249
|
type: Input
|
|
@@ -3932,22 +4251,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
3932
4251
|
type: Input
|
|
3933
4252
|
}], actionData: [{
|
|
3934
4253
|
type: Input
|
|
4254
|
+
}], dataProvider: [{
|
|
4255
|
+
type: Input
|
|
4256
|
+
}], viewContainerInit: [{
|
|
4257
|
+
type: Input,
|
|
4258
|
+
args: ['viewContainer']
|
|
3935
4259
|
}] } });
|
|
3936
4260
|
|
|
3937
4261
|
class MngActionRouteComponent {
|
|
3938
|
-
constructor(router, route, confirmationService, navigationService,
|
|
4262
|
+
constructor(router, route, confirmationService, navigationService, actionExecutor, viewContainerService) {
|
|
3939
4263
|
this.router = router;
|
|
3940
4264
|
this.route = route;
|
|
3941
4265
|
this.confirmationService = confirmationService;
|
|
3942
4266
|
this.navigationService = navigationService;
|
|
3943
|
-
this.
|
|
3944
|
-
this.
|
|
4267
|
+
this.actionExecutor = actionExecutor;
|
|
4268
|
+
this.viewContainerService = viewContainerService;
|
|
3945
4269
|
this.cmpId = Math.random().toString(36).substring(2);
|
|
3946
4270
|
this.actions = [];
|
|
3947
4271
|
this.subscriptions = [];
|
|
3948
4272
|
}
|
|
3949
4273
|
ngOnInit() {
|
|
3950
|
-
this.actions = this.
|
|
4274
|
+
this.actions = this.viewContainerService?.actions.filter(a => a.activationTrigger === ActionActivationTriggerEnum.OnRoute) ?? [];
|
|
3951
4275
|
const subscription = this.route.params.subscribe(p => {
|
|
3952
4276
|
const action = this.findActiveAction(p);
|
|
3953
4277
|
if (action) {
|
|
@@ -3982,8 +4306,8 @@ class MngActionRouteComponent {
|
|
|
3982
4306
|
for (const key in qp) {
|
|
3983
4307
|
actionData[key] = p[key];
|
|
3984
4308
|
}
|
|
3985
|
-
this.
|
|
3986
|
-
.activateAction(action, itemId, undefined, actionData, this.
|
|
4309
|
+
this.actionExecutor
|
|
4310
|
+
.activateAction(action, itemId, undefined, actionData, this.viewContainerService ?? undefined, this)
|
|
3987
4311
|
.pipe(first())
|
|
3988
4312
|
.subscribe(res => {
|
|
3989
4313
|
if (res.dialogRef) {
|
|
@@ -3991,7 +4315,10 @@ class MngActionRouteComponent {
|
|
|
3991
4315
|
this.dialogCloseSubscription = this.dialogRef?.onClose.subscribe(e => {
|
|
3992
4316
|
const actionEv = e;
|
|
3993
4317
|
if (!actionEv?.error || !actionEv?.error?.dismissed) {
|
|
3994
|
-
this.
|
|
4318
|
+
if (!this.viewContainerService) {
|
|
4319
|
+
console.warn(`View container service could not be found, table reload will not be triggered.`);
|
|
4320
|
+
}
|
|
4321
|
+
this.viewContainerService?.triggerTableReload(actionEv); // reload only if no error in action and
|
|
3995
4322
|
}
|
|
3996
4323
|
this.deactivateAction();
|
|
3997
4324
|
});
|
|
@@ -4063,24 +4390,28 @@ class MngActionRouteComponent {
|
|
|
4063
4390
|
return null;
|
|
4064
4391
|
}
|
|
4065
4392
|
}
|
|
4066
|
-
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
|
|
4393
|
+
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 });
|
|
4067
4394
|
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 });
|
|
4068
4395
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionRouteComponent, decorators: [{
|
|
4069
4396
|
type: Component,
|
|
4070
4397
|
args: [{ selector: 'mng-action-route', changeDetection: ChangeDetectionStrategy.OnPush, providers: [MessageService, ConfirmationService], template: "<p-confirmDialog [key]=\"'actionRoute_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n" }]
|
|
4071
|
-
}], ctorParameters: function () { return [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2
|
|
4398
|
+
}], ctorParameters: function () { return [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2.ConfirmationService }, { type: MngNavigationService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService, decorators: [{
|
|
4399
|
+
type: Optional
|
|
4400
|
+
}] }]; } });
|
|
4072
4401
|
|
|
4073
4402
|
class MngComponentDirective {
|
|
4074
4403
|
constructor(viewContainerRef) {
|
|
4075
4404
|
this.viewContainerRef = viewContainerRef;
|
|
4405
|
+
this.componentInstanceEventEmitter = new EventEmitter();
|
|
4076
4406
|
}
|
|
4077
4407
|
ngOnInit() {
|
|
4078
4408
|
this.viewContainerRef.clear();
|
|
4079
4409
|
this.componentRef = this.viewContainerRef.createComponent(this.component);
|
|
4410
|
+
this.componentInstanceEventEmitter.next(this.componentRef.instance);
|
|
4080
4411
|
}
|
|
4081
4412
|
}
|
|
4082
4413
|
MngComponentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngComponentDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4083
|
-
MngComponentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: MngComponentDirective, selector: "[mngComponent]", inputs: { component: ["mngComponent", "component"] }, ngImport: i0 });
|
|
4414
|
+
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 });
|
|
4084
4415
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngComponentDirective, decorators: [{
|
|
4085
4416
|
type: Directive,
|
|
4086
4417
|
args: [{
|
|
@@ -4089,6 +4420,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
4089
4420
|
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { component: [{
|
|
4090
4421
|
type: Input,
|
|
4091
4422
|
args: ['mngComponent']
|
|
4423
|
+
}], componentInstanceEventEmitter: [{
|
|
4424
|
+
type: Output,
|
|
4425
|
+
args: ['instanceCreated']
|
|
4092
4426
|
}] } });
|
|
4093
4427
|
|
|
4094
4428
|
class MngTemplateDirective {
|
|
@@ -4117,13 +4451,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
4117
4451
|
args: ['mngTemplate']
|
|
4118
4452
|
}] } });
|
|
4119
4453
|
|
|
4120
|
-
class MngFormEditorSubmitEvent {
|
|
4121
|
-
constructor(formItem) {
|
|
4122
|
-
this.formItem = formItem;
|
|
4123
|
-
this.success = true;
|
|
4124
|
-
}
|
|
4125
|
-
}
|
|
4126
|
-
|
|
4127
4454
|
class MngFormEditorComponent {
|
|
4128
4455
|
constructor(translateService) {
|
|
4129
4456
|
this.translateService = translateService;
|
|
@@ -4146,7 +4473,7 @@ class MngFormEditorComponent {
|
|
|
4146
4473
|
this.subscriptions = [];
|
|
4147
4474
|
}
|
|
4148
4475
|
ngOnInit() {
|
|
4149
|
-
this.
|
|
4476
|
+
this.resetFormModel(this.item);
|
|
4150
4477
|
this.submitLoading$ = this.submitLoading instanceof Observable ? this.submitLoading : of(this.submitLoading);
|
|
4151
4478
|
// init fields for formly
|
|
4152
4479
|
this.formFields = EditorFormlyUtil.createFormlyConfigFromDescriptor(this.descriptor);
|
|
@@ -4189,6 +4516,58 @@ class MngFormEditorComponent {
|
|
|
4189
4516
|
});
|
|
4190
4517
|
return formValue;
|
|
4191
4518
|
}
|
|
4519
|
+
getFormField(key) {
|
|
4520
|
+
return this.findFormField(this.form, key.split('.'));
|
|
4521
|
+
}
|
|
4522
|
+
setFormFieldValue(key, value) {
|
|
4523
|
+
const control = this.getFormField(key);
|
|
4524
|
+
if (control) {
|
|
4525
|
+
control.setValue(value);
|
|
4526
|
+
}
|
|
4527
|
+
else {
|
|
4528
|
+
console.warn(`Value was not set, because field ${key} was not found.`);
|
|
4529
|
+
}
|
|
4530
|
+
}
|
|
4531
|
+
patchFormFieldValue(key, value) {
|
|
4532
|
+
const control = this.getFormField(key);
|
|
4533
|
+
if (control) {
|
|
4534
|
+
control.patchValue(value);
|
|
4535
|
+
}
|
|
4536
|
+
else {
|
|
4537
|
+
console.warn(`Value was not set, because field ${key} was not found.`);
|
|
4538
|
+
}
|
|
4539
|
+
}
|
|
4540
|
+
resetFormFieldValue(key, value) {
|
|
4541
|
+
const control = this.getFormField(key);
|
|
4542
|
+
if (control) {
|
|
4543
|
+
control.reset(value);
|
|
4544
|
+
}
|
|
4545
|
+
else {
|
|
4546
|
+
console.warn(`Value was not set, because field ${key} was not found.`);
|
|
4547
|
+
}
|
|
4548
|
+
}
|
|
4549
|
+
findFormField(control, keyPath) {
|
|
4550
|
+
if (keyPath.length === 0) {
|
|
4551
|
+
return control;
|
|
4552
|
+
}
|
|
4553
|
+
if (keyPath.length === 1) {
|
|
4554
|
+
return control.get(keyPath[0]);
|
|
4555
|
+
}
|
|
4556
|
+
let nextControl = null;
|
|
4557
|
+
if (control instanceof FormGroup) {
|
|
4558
|
+
nextControl = control.get(keyPath[0]);
|
|
4559
|
+
}
|
|
4560
|
+
else if (control instanceof FormArray) {
|
|
4561
|
+
const idx = +keyPath[0];
|
|
4562
|
+
if (!isNaN(idx)) {
|
|
4563
|
+
nextControl = control.at(idx);
|
|
4564
|
+
}
|
|
4565
|
+
}
|
|
4566
|
+
if (!control) {
|
|
4567
|
+
return null;
|
|
4568
|
+
}
|
|
4569
|
+
return this.findFormField(nextControl, keyPath.slice(1));
|
|
4570
|
+
}
|
|
4192
4571
|
isAnyFieldInvalid(fields = []) {
|
|
4193
4572
|
for (const field of fields) {
|
|
4194
4573
|
let fieldInvalid = false;
|
|
@@ -4204,7 +4583,7 @@ class MngFormEditorComponent {
|
|
|
4204
4583
|
}
|
|
4205
4584
|
return false;
|
|
4206
4585
|
}
|
|
4207
|
-
|
|
4586
|
+
resetFormModel(item) {
|
|
4208
4587
|
this.formOrigItem = item;
|
|
4209
4588
|
// TODO: to check if this is ok, could be problems with dates, if so, try lodash
|
|
4210
4589
|
const formModel = JSON.parse(JSON.stringify(item ?? {}));
|
|
@@ -4223,12 +4602,12 @@ class MngFormEditorComponent {
|
|
|
4223
4602
|
this.formOptions.formState.disabled = this.isFormDisabled !== null ? this.isFormDisabled === true : this.descriptor.disabled;
|
|
4224
4603
|
}
|
|
4225
4604
|
}
|
|
4226
|
-
MngFormEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormEditorComponent, deps: [{ token:
|
|
4227
|
-
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$
|
|
4605
|
+
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 });
|
|
4606
|
+
MngFormEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormEditorComponent, selector: "mng-form-editor", inputs: { descriptor: "descriptor", submitLoading: "submitLoading", item: "item", isSubmitButtonVisible: "isSubmitButtonVisible", isFormDisabled: "isFormDisabled" }, outputs: { formSubmitEventEmitter: "formSubmit" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "submitButtonElementRef", first: true, predicate: ["submitButton"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit($event)\">\n <formly-form [form]=\"form\" [fields]=\"formFields\" [options]=\"formOptions\" [model]=\"formModel\"></formly-form>\n <button #submitButton pButton type=\"submit\" [class.hidden]=\"!isSubmitButtonVisible\" [disabled]=\"form.disabled\" [loading]=\"(submitLoading$ | async) ?? false\"></button>\n</form>\n<p-messages [value]=\"formMessages\" [enableService]=\"false\"></p-messages>\n", components: [{ type: i3$2.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { type: i3$3.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: i4$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i8.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }], pipes: { "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4228
4607
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormEditorComponent, decorators: [{
|
|
4229
4608
|
type: Component,
|
|
4230
4609
|
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" }]
|
|
4231
|
-
}], ctorParameters: function () { return [{ type:
|
|
4610
|
+
}], ctorParameters: function () { return [{ type: i3$1.TranslateService }]; }, propDecorators: { descriptor: [{
|
|
4232
4611
|
type: Input
|
|
4233
4612
|
}], submitLoading: [{
|
|
4234
4613
|
type: Input
|
|
@@ -4280,11 +4659,11 @@ class MngAutocompleteComponent {
|
|
|
4280
4659
|
console.warn(`Data provider should be provided for MngAutocompleteComponent.`);
|
|
4281
4660
|
}
|
|
4282
4661
|
}
|
|
4662
|
+
ngOnDestroy() {
|
|
4663
|
+
this.searchSubscription?.unsubscribe();
|
|
4664
|
+
}
|
|
4283
4665
|
onSearch(event) {
|
|
4284
|
-
|
|
4285
|
-
// try to cancel existing HTTP request subscription
|
|
4286
|
-
this.searchSubscription.unsubscribe();
|
|
4287
|
-
}
|
|
4666
|
+
this.searchSubscription?.unsubscribe();
|
|
4288
4667
|
if (this.dataProvider) {
|
|
4289
4668
|
this.isLoading = true;
|
|
4290
4669
|
const queryParamBuilder = MediusQueryParamBuilder.create();
|
|
@@ -4294,11 +4673,14 @@ class MngAutocompleteComponent {
|
|
|
4294
4673
|
if (event.query && event.query.length > 0 && this.itemsLabelProperty) {
|
|
4295
4674
|
queryParamBuilder.withFilter(this.itemsLabelProperty, event.query, undefined, MediusFilterMatchType.StartsWith);
|
|
4296
4675
|
}
|
|
4297
|
-
this.searchSubscription = this.dataProvider
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4676
|
+
this.searchSubscription = this.dataProvider.lookup(queryParamBuilder.build(), this.dataProviderService, event.query).subscribe({
|
|
4677
|
+
next: (res) => {
|
|
4678
|
+
this.suggestionsSubject.next(res);
|
|
4679
|
+
this.isLoading = false;
|
|
4680
|
+
},
|
|
4681
|
+
error: () => {
|
|
4682
|
+
this.isLoading = false;
|
|
4683
|
+
}
|
|
4302
4684
|
});
|
|
4303
4685
|
}
|
|
4304
4686
|
}
|
|
@@ -4325,7 +4707,7 @@ class MngAutocompleteComponent {
|
|
|
4325
4707
|
}
|
|
4326
4708
|
}
|
|
4327
4709
|
MngAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngAutocompleteComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
4328
|
-
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:
|
|
4710
|
+
MngAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: { dataProvider: "dataProvider", dataKeyProperty: "dataKeyProperty", itemsLabelProperty: "itemsLabelProperty", multiselect: "multiselect", placeholder: "placeholder", className: "className", dropdownClassName: "dropdownClassName" }, outputs: { valueChangeEventEmitter: "valueChange" }, providers: [MNG_AUTOCOMPLETE_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeAutocomplete", first: true, predicate: AutoComplete, descendants: true }], ngImport: i0, template: "<p-autoComplete\n [formControl]=\"autocompleteFormControl\"\n [placeholder]=\"$any(placeholder)\"\n [dropdown]=\"true\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [field]=\"$any(itemsLabelProperty)\"\n [suggestions]=\"(suggestions$ | async) ?? []\"\n [multiple]=\"multiselect\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'mngAutocomplete.noMatches' | translate\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n (completeMethod)=\"onSearch($event)\"\n (onSelect)=\"onSelect($event)\"\n appendTo=\"body\"\n dropdownMode=\"current\">\n</p-autoComplete>\n", components: [{ type: i1$1.AutoComplete, selector: "p-autoComplete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "virtualScroll", "itemSize", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "field", "scrollHeight", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "suggestions"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide"] }], directives: [{ type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4329
4711
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngAutocompleteComponent, decorators: [{
|
|
4330
4712
|
type: Component,
|
|
4331
4713
|
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" }]
|
|
@@ -4373,8 +4755,6 @@ class MngDropdownComponent {
|
|
|
4373
4755
|
this.onTouchedFn = () => { };
|
|
4374
4756
|
this.dropdownFormControl = new FormControl();
|
|
4375
4757
|
this.items$ = this.itemsSubject.asObservable();
|
|
4376
|
-
this.items = [];
|
|
4377
|
-
this.itemsLoaded = false;
|
|
4378
4758
|
}
|
|
4379
4759
|
ngOnInit() {
|
|
4380
4760
|
this.dropdownFormControl.valueChanges.subscribe(v => {
|
|
@@ -4384,10 +4764,7 @@ class MngDropdownComponent {
|
|
|
4384
4764
|
if (this.dataProvider) {
|
|
4385
4765
|
this.dataProviderService = this.dataProvider.serviceType ? this.injector.get(this.dataProvider.serviceType) : null;
|
|
4386
4766
|
const queryParamBuilder = MediusQueryParamBuilder.create();
|
|
4387
|
-
this.dataProvider
|
|
4388
|
-
.lookup(queryParamBuilder.build(), this.dataProviderService)
|
|
4389
|
-
.pipe(first())
|
|
4390
|
-
.subscribe(res => {
|
|
4767
|
+
this.itemsSubscription = this.dataProvider.lookup(queryParamBuilder.build(), this.dataProviderService).subscribe(res => {
|
|
4391
4768
|
this.itemsSubject.next(res);
|
|
4392
4769
|
});
|
|
4393
4770
|
if (this.selectFirstItem && !this.dropdownFormControl?.value) {
|
|
@@ -4401,6 +4778,9 @@ class MngDropdownComponent {
|
|
|
4401
4778
|
console.warn(`Data provider should be provided for MngDropdownComponent.`);
|
|
4402
4779
|
}
|
|
4403
4780
|
}
|
|
4781
|
+
ngOnDestroy() {
|
|
4782
|
+
this.itemsSubscription?.unsubscribe();
|
|
4783
|
+
}
|
|
4404
4784
|
registerOnChange(fn) {
|
|
4405
4785
|
this.onChangeFn = fn;
|
|
4406
4786
|
}
|
|
@@ -4420,7 +4800,7 @@ class MngDropdownComponent {
|
|
|
4420
4800
|
}
|
|
4421
4801
|
}
|
|
4422
4802
|
MngDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngDropdownComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
4423
|
-
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$
|
|
4803
|
+
MngDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngDropdownComponent, selector: "mng-dropdown", inputs: { dataProvider: "dataProvider", dataKeyProperty: "dataKeyProperty", itemsLabelProperty: "itemsLabelProperty", itemsValueProperty: "itemsValueProperty", multiselect: "multiselect", placeholder: "placeholder", showClear: "showClear", selectFirstItem: "selectFirstItem", className: "className", dropdownClassName: "dropdownClassName" }, outputs: { valueChangeEventEmitter: "valueChange" }, providers: [MNG_DROPDOWN_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeDropdown", first: true, predicate: Dropdown, descendants: true }], ngImport: i0, template: "<p-dropdown\n *ngIf=\"!multiselect; else pMultiselect\"\n [formControl]=\"dropdownFormControl\"\n [placeholder]=\"$any(placeholder)\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [optionLabel]=\"$any(itemsLabelProperty)\"\n [optionValue]=\"$any(itemsValueProperty)\"\n [options]=\"$any(items$ | async)\"\n [showClear]=\"showClear\"\n [autoDisplayFirst]=\"false\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n appendTo=\"body\">\n</p-dropdown>\n<ng-template #pMultiselect>\n <p-multiSelect\n display=\"chip\"\n [formControl]=\"dropdownFormControl\"\n [defaultLabel]=\"$any(placeholder)\"\n [dataKey]=\"$any(dataKeyProperty)\"\n [optionLabel]=\"$any(itemsLabelProperty)\"\n [optionValue]=\"$any(itemsValueProperty)\"\n [options]=\"(items$ | async) ?? []\"\n [styleClass]=\"$any(className)\"\n [panelStyleClass]=\"$any(dropdownClassName)\"\n [filter]=\"false\"\n appendTo=\"body\">\n </p-multiSelect>\n</ng-template>\n", components: [{ type: i1$2.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "virtualScroll", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "disabled", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear"] }, { type: i2$1.MultiSelect, selector: "p-multiSelect", inputs: ["style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "autoZIndex", "baseZIndex", "filterBy", "virtualScroll", "itemSize", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "scrollHeight", "defaultLabel", "placeholder", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onPanelShow", "onPanelHide"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4424
4804
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngDropdownComponent, decorators: [{
|
|
4425
4805
|
type: Component,
|
|
4426
4806
|
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" }]
|
|
@@ -4452,15 +4832,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
4452
4832
|
args: [Dropdown]
|
|
4453
4833
|
}] } });
|
|
4454
4834
|
|
|
4455
|
-
class
|
|
4456
|
-
constructor(injector, translate, dialogRef, dialogConfig,
|
|
4835
|
+
class MngActionEditorComponent {
|
|
4836
|
+
constructor(injector, translate, actionExecutor, mngCommonsService, dialogRef, dialogConfig, viewContainerService) {
|
|
4457
4837
|
this.injector = injector;
|
|
4458
4838
|
this.translate = translate;
|
|
4839
|
+
this.actionExecutor = actionExecutor;
|
|
4840
|
+
this.mngCommonsService = mngCommonsService;
|
|
4459
4841
|
this.dialogRef = dialogRef;
|
|
4460
4842
|
this.dialogConfig = dialogConfig;
|
|
4461
|
-
this.
|
|
4462
|
-
this.mngCommonsService = mngCommonsService;
|
|
4843
|
+
this.viewContainerService = viewContainerService;
|
|
4463
4844
|
this.cmpId = Math.random().toString(36).substring(2);
|
|
4845
|
+
this.isDialog = true;
|
|
4464
4846
|
this.isSaveButton = true;
|
|
4465
4847
|
this.loadingSubject = new ReplaySubject(1);
|
|
4466
4848
|
this.loading$ = this.loadingSubject.asObservable();
|
|
@@ -4470,7 +4852,7 @@ class MngActionDialogComponent {
|
|
|
4470
4852
|
this.subscriptions = [];
|
|
4471
4853
|
}
|
|
4472
4854
|
ngOnInit() {
|
|
4473
|
-
if (this.dialogConfig
|
|
4855
|
+
if (this.dialogConfig?.data) {
|
|
4474
4856
|
if (this.dialogConfig.data.action) {
|
|
4475
4857
|
this.action = this.dialogConfig.data.action;
|
|
4476
4858
|
}
|
|
@@ -4483,18 +4865,25 @@ class MngActionDialogComponent {
|
|
|
4483
4865
|
if (this.dialogConfig.data.actionData) {
|
|
4484
4866
|
this.actionData = this.dialogConfig.data.actionData;
|
|
4485
4867
|
}
|
|
4486
|
-
if (this.dialogConfig.data.
|
|
4487
|
-
this.
|
|
4488
|
-
if (!this.dataProvider && this.
|
|
4489
|
-
|
|
4868
|
+
if (this.dialogConfig.data.viewContainer) {
|
|
4869
|
+
this.viewContainer = this.dialogConfig.data.viewContainer;
|
|
4870
|
+
if (!this.dataProvider && this.viewContainer) {
|
|
4871
|
+
const dataProvider = this.viewContainer.getDataProvider();
|
|
4872
|
+
if (dataProvider && typeof dataProvider['fetch'] === 'function') {
|
|
4873
|
+
this.dataProvider = dataProvider;
|
|
4874
|
+
}
|
|
4490
4875
|
}
|
|
4491
4876
|
}
|
|
4492
4877
|
if (this.dialogConfig.data.sourceComponent) {
|
|
4493
4878
|
this.sourceComponent = this.dialogConfig.data.sourceComponent;
|
|
4494
4879
|
}
|
|
4495
4880
|
}
|
|
4881
|
+
else {
|
|
4882
|
+
this.isDialog = false;
|
|
4883
|
+
this.viewContainer = this.viewContainerInit ?? this.viewContainerService ?? undefined;
|
|
4884
|
+
}
|
|
4496
4885
|
this.isSaveButton = typeof this.action.submitFunction === 'function';
|
|
4497
|
-
this.
|
|
4886
|
+
this.setTitle();
|
|
4498
4887
|
this.loadItemWithDataProvider();
|
|
4499
4888
|
}
|
|
4500
4889
|
ngOnDestroy() {
|
|
@@ -4506,16 +4895,22 @@ class MngActionDialogComponent {
|
|
|
4506
4895
|
return;
|
|
4507
4896
|
}
|
|
4508
4897
|
this.submitLoadingSubject.next(true);
|
|
4509
|
-
this.
|
|
4510
|
-
.runEditorSave(this.action, this.itemId, event.formItem, this.dataProvider, this.sourceComponent, this.
|
|
4511
|
-
.pipe(first()
|
|
4512
|
-
.subscribe(
|
|
4513
|
-
|
|
4898
|
+
this.actionExecutor
|
|
4899
|
+
.runEditorSave(this.action, this.itemId, event.formItem, this.dataProvider, this.sourceComponent, this.viewContainer, this.actionData)
|
|
4900
|
+
.pipe(first())
|
|
4901
|
+
.subscribe({
|
|
4902
|
+
next: res => {
|
|
4903
|
+
this.submitLoadingSubject.next(false);
|
|
4904
|
+
this.closeDialog(res);
|
|
4905
|
+
},
|
|
4906
|
+
error: () => {
|
|
4907
|
+
this.submitLoadingSubject.next(false);
|
|
4908
|
+
}
|
|
4514
4909
|
});
|
|
4515
4910
|
}
|
|
4516
4911
|
}
|
|
4517
4912
|
closeDialog(result) {
|
|
4518
|
-
this.dialogRef
|
|
4913
|
+
this.dialogRef?.close(result ? result : new ActionRunResult(undefined, undefined, new ActionError(null, true)));
|
|
4519
4914
|
}
|
|
4520
4915
|
saveItem() {
|
|
4521
4916
|
this.editorComponent.submit();
|
|
@@ -4525,48 +4920,60 @@ class MngActionDialogComponent {
|
|
|
4525
4920
|
return;
|
|
4526
4921
|
}
|
|
4527
4922
|
this.loadingSubject.next(true);
|
|
4528
|
-
this.
|
|
4529
|
-
.runEditorFetch(this.action, this.itemId, this.dataProvider, this.sourceComponent, this.
|
|
4923
|
+
this.actionExecutor
|
|
4924
|
+
.runEditorFetch(this.action, this.itemId, this.dataProvider, this.sourceComponent, this.viewContainer)
|
|
4530
4925
|
.pipe(first(), catchError(err => {
|
|
4531
4926
|
if (this.action.hasRunNotificationError) {
|
|
4532
|
-
ToastUtil.actionNotificationError(this.translate, this.action, err, 'fetch', this.
|
|
4927
|
+
ToastUtil.actionNotificationError(this.translate, this.action, err, 'fetch', this.viewContainer, this.item);
|
|
4533
4928
|
}
|
|
4534
4929
|
throw err;
|
|
4535
4930
|
}), finalize(() => this.loadingSubject.next(false)))
|
|
4536
4931
|
.subscribe(res => {
|
|
4537
4932
|
this.item = res.result;
|
|
4538
4933
|
if (this.action.hasFetchNotificationSuccess) {
|
|
4539
|
-
ToastUtil.actionNotificationSuccess(this.translate, this.action, 'fetch', this.action.fetchNotificationSuccessTitle, this.action.fetchNotificationSuccessMessage, this.
|
|
4934
|
+
ToastUtil.actionNotificationSuccess(this.translate, this.action, 'fetch', this.action.fetchNotificationSuccessTitle, this.action.fetchNotificationSuccessMessage, this.viewContainer, this.item);
|
|
4540
4935
|
}
|
|
4541
|
-
this.
|
|
4936
|
+
this.setTitle();
|
|
4542
4937
|
});
|
|
4543
4938
|
}
|
|
4544
|
-
|
|
4939
|
+
setTitle() {
|
|
4545
4940
|
if (this.action.editorTitle === null) {
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4941
|
+
this.title = undefined;
|
|
4942
|
+
if (this.dialogConfig) {
|
|
4943
|
+
requestAnimationFrame(() => {
|
|
4944
|
+
this.dialogConfig.header = undefined;
|
|
4945
|
+
});
|
|
4946
|
+
return;
|
|
4947
|
+
}
|
|
4550
4948
|
}
|
|
4551
4949
|
const subscription = I18nUtil.streamActionTranslation(this.translate, this.action, 'dialog.title', undefined, this.item)
|
|
4552
4950
|
.pipe(mergeMap(i18nDialogTitle => i18nDialogTitle === null
|
|
4553
4951
|
? I18nUtil.getActionTranslation(this.translate, this.action, 'title', this.action.editorTitle, this.item)
|
|
4554
4952
|
: of(i18nDialogTitle)))
|
|
4555
4953
|
.subscribe(t => {
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4954
|
+
this.title = t ?? undefined;
|
|
4955
|
+
if (this.dialogConfig) {
|
|
4956
|
+
requestAnimationFrame(() => {
|
|
4957
|
+
this.dialogConfig.header = t ?? undefined;
|
|
4958
|
+
this.mngCommonsService.setPageTitle(t ?? undefined);
|
|
4959
|
+
});
|
|
4960
|
+
}
|
|
4560
4961
|
});
|
|
4561
4962
|
this.subscriptions.push(subscription);
|
|
4562
4963
|
}
|
|
4563
4964
|
}
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type:
|
|
4965
|
+
MngActionEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionEditorComponent, deps: [{ token: i0.Injector }, { token: i3$1.TranslateService }, { token: MngActionExecutorService }, { token: MngCommonsService }, { token: i3.DynamicDialogRef, optional: true }, { token: i3.DynamicDialogConfig, optional: true }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
4966
|
+
MngActionEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngActionEditorComponent, selector: "mng-action-editor", inputs: { action: "action", itemId: "itemId", item: "item", actionData: "actionData", dataProvider: "dataProvider", viewContainerInit: ["viewContainer", "viewContainerInit"] }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "submitButtonElementRef", first: true, predicate: ["submitButton"], descendants: true }, { propertyName: "editorComponent", first: true, predicate: MngFormEditorComponent, descendants: true }], ngImport: i0, template: "<h1 *ngIf=\"!isDialog && title\">{{ title }}</h1>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n <div class=\"flex flex-row justify-content-between\">\n <div></div>\n <div>\n <button\n type=\"button\"\n pButton\n pRipple\n [label]=\"'general.close' | translate\"\n icon=\"pi pi-times\"\n class=\"p-button-text\"\n (click)=\"closeDialog()\"\n [disabled]=\"submitLoading$ | async\"></button>\n <button\n *ngIf=\"isSaveButton\"\n #submitButton\n type=\"button\"\n pButton\n pRipple\n [label]=\"'general.save' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"saveItem()\"\n [loading]=\"(submitLoading$ | async) ?? false\"\n [disabled]=\"(submitLoading$ | async) ?? false\"></button>\n </div>\n </div>\n</div>\n", components: [{ type: i5.ProgressSpinner, selector: "p-progressSpinner", inputs: ["style", "styleClass", "strokeWidth", "fill", "animationDuration"] }, { type: MngFormEditorComponent, selector: "mng-form-editor", inputs: ["descriptor", "submitLoading", "item", "isSubmitButtonVisible", "isFormDisabled"], outputs: ["formSubmit"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i9.Ripple, selector: "[pRipple]" }], pipes: { "async": i4$1.AsyncPipe, "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4967
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionEditorComponent, decorators: [{
|
|
4567
4968
|
type: Component,
|
|
4568
|
-
args: [{ selector: 'mng-action-
|
|
4569
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }, { type:
|
|
4969
|
+
args: [{ selector: 'mng-action-editor', changeDetection: ChangeDetectionStrategy.OnPush, template: "<h1 *ngIf=\"!isDialog && title\">{{ title }}</h1>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n <div class=\"flex flex-row justify-content-between\">\n <div></div>\n <div>\n <button\n type=\"button\"\n pButton\n pRipple\n [label]=\"'general.close' | translate\"\n icon=\"pi pi-times\"\n class=\"p-button-text\"\n (click)=\"closeDialog()\"\n [disabled]=\"submitLoading$ | async\"></button>\n <button\n *ngIf=\"isSaveButton\"\n #submitButton\n type=\"button\"\n pButton\n pRipple\n [label]=\"'general.save' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"saveItem()\"\n [loading]=\"(submitLoading$ | async) ?? false\"\n [disabled]=\"(submitLoading$ | async) ?? false\"></button>\n </div>\n </div>\n</div>\n" }]
|
|
4970
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i3$1.TranslateService }, { type: MngActionExecutorService }, { type: MngCommonsService }, { type: i3.DynamicDialogRef, decorators: [{
|
|
4971
|
+
type: Optional
|
|
4972
|
+
}] }, { type: i3.DynamicDialogConfig, decorators: [{
|
|
4973
|
+
type: Optional
|
|
4974
|
+
}] }, { type: MngViewContainerComponentService, decorators: [{
|
|
4975
|
+
type: Optional
|
|
4976
|
+
}] }]; }, propDecorators: { action: [{
|
|
4570
4977
|
type: Input
|
|
4571
4978
|
}], itemId: [{
|
|
4572
4979
|
type: Input
|
|
@@ -4576,6 +4983,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
4576
4983
|
type: Input
|
|
4577
4984
|
}], dataProvider: [{
|
|
4578
4985
|
type: Input
|
|
4986
|
+
}], viewContainerInit: [{
|
|
4987
|
+
type: Input,
|
|
4988
|
+
args: ['viewContainer']
|
|
4579
4989
|
}], templates: [{
|
|
4580
4990
|
type: ContentChildren,
|
|
4581
4991
|
args: [MngTemplateDirective]
|
|
@@ -4594,10 +5004,10 @@ class MngFormlyFieldAutocompleteComponent extends FieldType {
|
|
|
4594
5004
|
}
|
|
4595
5005
|
}
|
|
4596
5006
|
MngFormlyFieldAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldAutocompleteComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
4597
|
-
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:
|
|
5007
|
+
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 });
|
|
4598
5008
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldAutocompleteComponent, decorators: [{
|
|
4599
5009
|
type: Component,
|
|
4600
|
-
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" }]
|
|
5010
|
+
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" }]
|
|
4601
5011
|
}] });
|
|
4602
5012
|
|
|
4603
5013
|
class MngFormlyFieldInputComponent extends FieldType {
|
|
@@ -4611,10 +5021,10 @@ class MngFormlyFieldInputComponent extends FieldType {
|
|
|
4611
5021
|
}
|
|
4612
5022
|
}
|
|
4613
5023
|
MngFormlyFieldInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
4614
|
-
MngFormlyFieldInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldInputComponent, selector: "mng-formly-field-input", usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton
|
|
5024
|
+
MngFormlyFieldInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldInputComponent, selector: "mng-formly-field-input", usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\"\n [inputStyleClass]=\"descriptor.inputClassName\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\" [class]=\"descriptor.labelClassName\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [styleClass]=\"descriptor.inputClassName\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton\n [name]=\"$any(key)\"\n [value]=\"option.value\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [styleClass]=\"descriptor.inputClassName\"></p-radioButton>\n <label [for]=\"option.value\" [class]=\"'mng-radio-button-label ' + descriptor.labelClassName\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea\n *ngSwitchCase=\"'textarea'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [rows]=\"descriptor.rows ?? 3\"\n pInputTextarea\n [class]=\"descriptor.inputClassName\">\n </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\"\n [inputStyleClass]=\"descriptor.inputClassName\">\n </p-calendar>\n\n <p-inputMask\n *ngSwitchCase=\"'mask'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [mask]=\"$any(descriptor.mask)\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [slotChar]=\"$any(descriptor.slotChar)\"\n [styleClass]=\"descriptor.inputClassName\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n", components: [{ type: i1$3.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }, { type: i2$2.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabelledBy"], outputs: ["onChange"] }, { type: i3$2.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i4$3.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i5$1.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { type: i6$1.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "style", "inputId", "styleClass", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "disabled", "readonly", "unmask", "name", "required", "characterPattern", "autoFocus", "autocomplete", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown"] }], directives: [{ type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$2.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i4$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i10$1.InputText, selector: "[pInputText]" }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4615
5025
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, decorators: [{
|
|
4616
5026
|
type: Component,
|
|
4617
|
-
args: [{ selector: 'mng-formly-field-input', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton
|
|
5027
|
+
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" }]
|
|
4618
5028
|
}] });
|
|
4619
5029
|
|
|
4620
5030
|
class MngFormlyFieldDropdownComponent extends FieldType {
|
|
@@ -4624,10 +5034,10 @@ class MngFormlyFieldDropdownComponent extends FieldType {
|
|
|
4624
5034
|
}
|
|
4625
5035
|
}
|
|
4626
5036
|
MngFormlyFieldDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldDropdownComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
4627
|
-
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]=\"!
|
|
5037
|
+
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 });
|
|
4628
5038
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldDropdownComponent, decorators: [{
|
|
4629
5039
|
type: Component,
|
|
4630
|
-
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]=\"!
|
|
5040
|
+
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" }]
|
|
4631
5041
|
}] });
|
|
4632
5042
|
|
|
4633
5043
|
class MngTableLoadEvent {
|
|
@@ -4710,12 +5120,12 @@ class MngTableColumnFilterComponent {
|
|
|
4710
5120
|
}
|
|
4711
5121
|
}
|
|
4712
5122
|
}
|
|
4713
|
-
MngTableColumnFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnFilterComponent, deps: [{ token: i2
|
|
4714
|
-
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
|
|
5123
|
+
MngTableColumnFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnFilterComponent, deps: [{ token: i2.PrimeNGConfig }], target: i0.ɵɵFactoryTarget.Component });
|
|
5124
|
+
MngTableColumnFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: { descriptor: "descriptor", display: "display" }, ngImport: i0, template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n matchMode=\"equals\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\">\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"true\"\n (valueChange)=\"filterCallback($event)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n", components: [{ type: i4$4.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping"] }, { type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "multiselect", "placeholder", "className", "dropdownClassName"], outputs: ["valueChange"] }, { type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsValueProperty", "multiselect", "placeholder", "showClear", "selectFirstItem", "className", "dropdownClassName"], outputs: ["valueChange"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "translate": i3$1.TranslatePipe } });
|
|
4715
5125
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnFilterComponent, decorators: [{
|
|
4716
5126
|
type: Component,
|
|
4717
5127
|
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" }]
|
|
4718
|
-
}], ctorParameters: function () { return [{ type: i2
|
|
5128
|
+
}], ctorParameters: function () { return [{ type: i2.PrimeNGConfig }]; }, propDecorators: { descriptor: [{
|
|
4719
5129
|
type: Input
|
|
4720
5130
|
}], display: [{
|
|
4721
5131
|
type: Input
|
|
@@ -4804,7 +5214,7 @@ class MngTableColumnValueComponent {
|
|
|
4804
5214
|
}
|
|
4805
5215
|
}
|
|
4806
5216
|
MngTableColumnValueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4807
|
-
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":
|
|
5217
|
+
MngTableColumnValueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: { descriptor: "descriptor", item: "item" }, ngImport: i0, template: "<ng-container [ngSwitch]=\"descriptor.columnType\">\n <ng-container *ngSwitchCase=\"columnTypeString\">\n {{ descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property] }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeNumber\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | number: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeDate\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | date: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeBoolean\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | boolean }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeEnum\">\n {{\n (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property])\n | enum: descriptor.enumType:descriptor.enumTitlePath:descriptor.enumNameAsValue\n | translate\n }}\n </ng-container>\n</ng-container>\n", directives: [{ type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "propertyPath": MngPropertyPathPipe, "number": i4$1.DecimalPipe, "date": i4$1.DatePipe, "boolean": MngBooleanPipe, "translate": i3$1.TranslatePipe, "enum": MngEnumPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4808
5218
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnValueComponent, decorators: [{
|
|
4809
5219
|
type: Component,
|
|
4810
5220
|
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" }]
|
|
@@ -4832,21 +5242,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
4832
5242
|
var TypeEnum = FilterDescriptor.TypeEnum;
|
|
4833
5243
|
var PaginationModeEnum = TableDescriptor.PaginationModeEnum;
|
|
4834
5244
|
class MngTableComponent {
|
|
4835
|
-
constructor(injector, router, activatedRoute, translate,
|
|
5245
|
+
constructor(injector, router, activatedRoute, translate, viewContainerService) {
|
|
4836
5246
|
this.injector = injector;
|
|
4837
5247
|
this.router = router;
|
|
4838
5248
|
this.activatedRoute = activatedRoute;
|
|
4839
5249
|
this.translate = translate;
|
|
4840
|
-
this.
|
|
5250
|
+
this.viewContainerService = viewContainerService;
|
|
4841
5251
|
this.filterDisplayRow = TableDescriptor.FilterDisplayEnum.Row;
|
|
4842
5252
|
this.filterDisplayMenu = TableDescriptor.FilterDisplayEnum.Menu;
|
|
4843
5253
|
this.useQueryParams = false;
|
|
4844
5254
|
// extra features input
|
|
5255
|
+
this.selectionMode = 'multiple';
|
|
4845
5256
|
this.selectionEnabled = false;
|
|
4846
5257
|
// event outputs
|
|
4847
5258
|
this.loadEventEmitter = new EventEmitter();
|
|
4848
5259
|
this.cellClickEventEmitter = new EventEmitter();
|
|
4849
5260
|
this.selectionChangeEventEmitter = new EventEmitter();
|
|
5261
|
+
this.captionCmpInstEventEmitter = new EventEmitter();
|
|
5262
|
+
this.columnActionCmpInstEventEmitter = new EventEmitter();
|
|
4850
5263
|
// data provider and items
|
|
4851
5264
|
this.useDataProvider = false;
|
|
4852
5265
|
this.useQueryParamsInitialized = false;
|
|
@@ -4946,6 +5359,7 @@ class MngTableComponent {
|
|
|
4946
5359
|
});
|
|
4947
5360
|
}
|
|
4948
5361
|
ngOnDestroy() {
|
|
5362
|
+
this.dataProviderSubscription?.unsubscribe();
|
|
4949
5363
|
this.subscriptions.forEach(s => s.unsubscribe());
|
|
4950
5364
|
}
|
|
4951
5365
|
reload(emitEvent = false, resetParams = false) {
|
|
@@ -4985,23 +5399,24 @@ class MngTableComponent {
|
|
|
4985
5399
|
onSelectionChange(event) {
|
|
4986
5400
|
this.selectionChangeEventEmitter.emit(event);
|
|
4987
5401
|
}
|
|
5402
|
+
onCaptionCmpInst(instance) {
|
|
5403
|
+
this.captionCmpInstEventEmitter.next(instance);
|
|
5404
|
+
}
|
|
5405
|
+
onColumnActionCmpInst(instance) {
|
|
5406
|
+
this.columnActionCmpInstEventEmitter.next(instance);
|
|
5407
|
+
}
|
|
4988
5408
|
loadTableWithDataProvider(queryParam = null, emitEvent = true) {
|
|
4989
5409
|
if (!this.useDataProvider) {
|
|
4990
5410
|
return;
|
|
4991
5411
|
}
|
|
4992
|
-
|
|
4993
|
-
this.dataProviderSubscription.unsubscribe();
|
|
4994
|
-
}
|
|
5412
|
+
this.dataProviderSubscription?.unsubscribe();
|
|
4995
5413
|
this.dataProviderLoadingSubject.next(true);
|
|
4996
5414
|
if (!queryParam) {
|
|
4997
5415
|
queryParam = MediusQueryParamBuilder.create(this.rowsPerPageOptions[0]).build();
|
|
4998
5416
|
}
|
|
4999
5417
|
this.dataProviderLatestQueryParam = queryParam;
|
|
5000
5418
|
this.dataProviderLatestQueryParamVersion++;
|
|
5001
|
-
this.dataProviderSubscription = this.dataProvider
|
|
5002
|
-
?.getAll(queryParam, this.dataProviderService)
|
|
5003
|
-
.pipe(first(), finalize(() => this.dataProviderLoadingSubject.next(false)))
|
|
5004
|
-
.subscribe(res => {
|
|
5419
|
+
this.dataProviderSubscription = this.dataProvider?.getAll(queryParam, this.dataProviderService).subscribe(res => {
|
|
5005
5420
|
if (this.infiniteScroll) {
|
|
5006
5421
|
if (this.isFilterChanged || this.isSortChanged) {
|
|
5007
5422
|
this.dataProviderInfiniteScrollItems = [];
|
|
@@ -5014,12 +5429,14 @@ class MngTableComponent {
|
|
|
5014
5429
|
}
|
|
5015
5430
|
this.isFilterChanged = false;
|
|
5016
5431
|
this.isSortChanged = false;
|
|
5432
|
+
this.dataProviderLoadingSubject.next(false);
|
|
5017
5433
|
}, err => {
|
|
5018
|
-
ToastUtil.tableNotificationError(this.translate, this.descriptor, err, this.
|
|
5434
|
+
ToastUtil.tableNotificationError(this.translate, this.descriptor, err, this.viewContainerService ?? undefined);
|
|
5019
5435
|
const emptyQueryResult = new MediusQueryResult();
|
|
5020
5436
|
emptyQueryResult.pageData = [];
|
|
5021
5437
|
emptyQueryResult.allDataCount = 0;
|
|
5022
5438
|
this.dataProviderQueryResultSubject.next(emptyQueryResult);
|
|
5439
|
+
this.dataProviderLoadingSubject.next(false);
|
|
5023
5440
|
});
|
|
5024
5441
|
if (emitEvent) {
|
|
5025
5442
|
const mngEvent = new MngTableLoadEvent();
|
|
@@ -5028,95 +5445,398 @@ class MngTableComponent {
|
|
|
5028
5445
|
this.loadEventEmitter.next(mngEvent);
|
|
5029
5446
|
}
|
|
5030
5447
|
}
|
|
5031
|
-
loadTableFromRouteUpdate(params) {
|
|
5032
|
-
const mediusQueryParam = MediusRestUtil.fromAngularQueryParamsToMediusQueryParams(params, this.filterDescriptors, this.rowsPerPageOptions[0]);
|
|
5033
|
-
if (this.dataProviderLatestLazyLoadEventVersion < this.dataProviderLatestQueryParamVersion + 1) {
|
|
5034
|
-
// update only if new version from query params will be higher
|
|
5035
|
-
this.updatePrimeSortAndFilter(mediusQueryParam);
|
|
5448
|
+
loadTableFromRouteUpdate(params) {
|
|
5449
|
+
const mediusQueryParam = MediusRestUtil.fromAngularQueryParamsToMediusQueryParams(params, this.filterDescriptors, this.rowsPerPageOptions[0]);
|
|
5450
|
+
if (this.dataProviderLatestLazyLoadEventVersion < this.dataProviderLatestQueryParamVersion + 1) {
|
|
5451
|
+
// update only if new version from query params will be higher
|
|
5452
|
+
this.updatePrimeSortAndFilter(mediusQueryParam);
|
|
5453
|
+
}
|
|
5454
|
+
this.useQueryParamsInitialized = true;
|
|
5455
|
+
this.loadTableWithDataProvider(mediusQueryParam);
|
|
5456
|
+
}
|
|
5457
|
+
updatePrimeSortAndFilter(mediusQueryParam) {
|
|
5458
|
+
const primeSortMeta = [];
|
|
5459
|
+
const primeFilterMeta = {};
|
|
5460
|
+
this.filterDescriptors.forEach(f => {
|
|
5461
|
+
primeFilterMeta[f.property] = {
|
|
5462
|
+
value: null,
|
|
5463
|
+
matchMode: f.filterType === TypeEnum.String ? 'contains' : 'equals'
|
|
5464
|
+
};
|
|
5465
|
+
});
|
|
5466
|
+
mediusQueryParam?.sortProperty?.forEach((s, idx) => {
|
|
5467
|
+
primeSortMeta.push({
|
|
5468
|
+
field: s,
|
|
5469
|
+
order: mediusQueryParam?.sortAsc?.[idx] ?? true ? 1 : -1
|
|
5470
|
+
});
|
|
5471
|
+
});
|
|
5472
|
+
mediusQueryParam?.filterParams?.forEach(f => {
|
|
5473
|
+
const descriptor = this.filterDescriptors.find(fd => fd.filterProperty === f.property || fd.property === f.property);
|
|
5474
|
+
const operator = MediusRestUtil.matchModeMapping.find(mapping => mapping[2] === f.filterMatchType);
|
|
5475
|
+
if (descriptor && operator) {
|
|
5476
|
+
primeFilterMeta[descriptor.property] = {
|
|
5477
|
+
value: f.filterValue,
|
|
5478
|
+
matchMode: operator[0]
|
|
5479
|
+
};
|
|
5480
|
+
}
|
|
5481
|
+
});
|
|
5482
|
+
this.multiSortMeta = primeSortMeta;
|
|
5483
|
+
this.filterMetadata = primeFilterMeta;
|
|
5484
|
+
this.rows = mediusQueryParam?.itemsPerPage ?? this.rowsPerPageOptions[0];
|
|
5485
|
+
this.offset = mediusQueryParam?.itemsOffset ?? 0;
|
|
5486
|
+
}
|
|
5487
|
+
getDefaultSortMeta() {
|
|
5488
|
+
if (this.descriptor.hasDefaultSort) {
|
|
5489
|
+
return this.descriptor.defaultSortProperty.map((p, idx) => ({
|
|
5490
|
+
field: p,
|
|
5491
|
+
order: this.descriptor.defaultSortAsc[idx] ? 1 : -1
|
|
5492
|
+
}));
|
|
5493
|
+
}
|
|
5494
|
+
else {
|
|
5495
|
+
return [];
|
|
5496
|
+
}
|
|
5497
|
+
}
|
|
5498
|
+
}
|
|
5499
|
+
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 });
|
|
5500
|
+
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableComponent, selector: "mng-table", inputs: { descriptor: "descriptor", items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", captionComponent: "captionComponent", columnActionComponent: "columnActionComponent" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + descriptor.tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [rowHover]=\"true\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n [selectionMode]=\"selectionMode\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.property | i18nProperty: descriptor.model | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.property | i18nProperty: descriptor.model | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" class=\"clickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate || columnActionComponent\" class=\"text-right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponent\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponent>\n <span [mngComponent]=\"columnActionComponent!\" (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", components: [{ type: i4$4.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { type: i4$4.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { type: i4$4.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { type: i4$4.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { type: i4$4.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { type: i7.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent"], outputs: ["instanceCreated"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$4.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i4$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i3$1.TranslatePipe, "i18nProperty": MngI18nPropertyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5501
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, decorators: [{
|
|
5502
|
+
type: Component,
|
|
5503
|
+
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" }]
|
|
5504
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i3$1.TranslateService }, { type: MngViewContainerComponentService, decorators: [{
|
|
5505
|
+
type: Optional
|
|
5506
|
+
}] }]; }, propDecorators: { descriptor: [{
|
|
5507
|
+
type: Input
|
|
5508
|
+
}], items: [{
|
|
5509
|
+
type: Input
|
|
5510
|
+
}], queryResult: [{
|
|
5511
|
+
type: Input
|
|
5512
|
+
}], loading: [{
|
|
5513
|
+
type: Input
|
|
5514
|
+
}], dataProvider: [{
|
|
5515
|
+
type: Input
|
|
5516
|
+
}], useQueryParams: [{
|
|
5517
|
+
type: Input
|
|
5518
|
+
}], selectionMode: [{
|
|
5519
|
+
type: Input
|
|
5520
|
+
}], selectionEnabled: [{
|
|
5521
|
+
type: Input
|
|
5522
|
+
}], captionComponent: [{
|
|
5523
|
+
type: Input
|
|
5524
|
+
}], columnActionComponent: [{
|
|
5525
|
+
type: Input
|
|
5526
|
+
}], loadEventEmitter: [{
|
|
5527
|
+
type: Output,
|
|
5528
|
+
args: ['tableLoad']
|
|
5529
|
+
}], cellClickEventEmitter: [{
|
|
5530
|
+
type: Output,
|
|
5531
|
+
args: ['cellClick']
|
|
5532
|
+
}], selectionChangeEventEmitter: [{
|
|
5533
|
+
type: Output,
|
|
5534
|
+
args: ['selectionChange']
|
|
5535
|
+
}], captionCmpInstEventEmitter: [{
|
|
5536
|
+
type: Output,
|
|
5537
|
+
args: ['captionComponentInstance']
|
|
5538
|
+
}], columnActionCmpInstEventEmitter: [{
|
|
5539
|
+
type: Output,
|
|
5540
|
+
args: ['columnActionComponentInstance']
|
|
5541
|
+
}], templates: [{
|
|
5542
|
+
type: ContentChildren,
|
|
5543
|
+
args: [MngTemplateDirective]
|
|
5544
|
+
}], components: [{
|
|
5545
|
+
type: ViewChildren,
|
|
5546
|
+
args: [MngComponentDirective]
|
|
5547
|
+
}], primeTable: [{
|
|
5548
|
+
type: ViewChild,
|
|
5549
|
+
args: [Table]
|
|
5550
|
+
}] } });
|
|
5551
|
+
|
|
5552
|
+
class MngTableviewComponent {
|
|
5553
|
+
constructor(route, messageService, translateService, dialogService, confirmationService, actionExecutor, viewContainerService) {
|
|
5554
|
+
this.route = route;
|
|
5555
|
+
this.messageService = messageService;
|
|
5556
|
+
this.translateService = translateService;
|
|
5557
|
+
this.dialogService = dialogService;
|
|
5558
|
+
this.confirmationService = confirmationService;
|
|
5559
|
+
this.actionExecutor = actionExecutor;
|
|
5560
|
+
this.viewContainerService = viewContainerService;
|
|
5561
|
+
this.actions = [];
|
|
5562
|
+
this.tableComponent = null;
|
|
5563
|
+
this.rowClickActions = [];
|
|
5564
|
+
this.rowInlineActions = [];
|
|
5565
|
+
this.toolbarLeftActions = [];
|
|
5566
|
+
this.toolbarRightActions = [];
|
|
5567
|
+
this.subscriptions = [];
|
|
5568
|
+
}
|
|
5569
|
+
ngOnInit() {
|
|
5570
|
+
this.viewContainerService.actions = this.actions;
|
|
5571
|
+
if (this.dataProvider) {
|
|
5572
|
+
this.viewContainerService.dataProvider = this.dataProvider;
|
|
5573
|
+
}
|
|
5574
|
+
const reloadTableSubscription = this.viewContainerService.reloadTable$.subscribe(() => {
|
|
5575
|
+
this.reloadTable();
|
|
5576
|
+
});
|
|
5577
|
+
this.subscriptions.push(reloadTableSubscription);
|
|
5578
|
+
for (const action of this.actions) {
|
|
5579
|
+
switch (action.position) {
|
|
5580
|
+
case ActionPositionEnum.RowClick:
|
|
5581
|
+
this.rowClickActions.push(action);
|
|
5582
|
+
break;
|
|
5583
|
+
case ActionPositionEnum.RowInline:
|
|
5584
|
+
this.rowInlineActions.push(action);
|
|
5585
|
+
break;
|
|
5586
|
+
case ActionPositionEnum.ToolbarLeft:
|
|
5587
|
+
this.toolbarLeftActions.push(action);
|
|
5588
|
+
break;
|
|
5589
|
+
case ActionPositionEnum.ToolbarRight:
|
|
5590
|
+
this.toolbarRightActions.push(action);
|
|
5591
|
+
break;
|
|
5592
|
+
}
|
|
5593
|
+
}
|
|
5594
|
+
}
|
|
5595
|
+
ngOnDestroy() {
|
|
5596
|
+
this.subscriptions.forEach(s => s.unsubscribe());
|
|
5597
|
+
}
|
|
5598
|
+
getMessageService() {
|
|
5599
|
+
return this.messageService;
|
|
5600
|
+
}
|
|
5601
|
+
getDataProvider() {
|
|
5602
|
+
return this.dataProvider;
|
|
5603
|
+
}
|
|
5604
|
+
reloadTable() {
|
|
5605
|
+
this.tableComponent?.reload();
|
|
5606
|
+
}
|
|
5607
|
+
onTableCellClick(event) {
|
|
5608
|
+
if (this.rowClickActions.length) {
|
|
5609
|
+
for (const action of this.rowClickActions) {
|
|
5610
|
+
this.actionExecutor.triggerRowClickAction(action, event, this.route);
|
|
5611
|
+
}
|
|
5612
|
+
}
|
|
5613
|
+
}
|
|
5614
|
+
}
|
|
5615
|
+
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 });
|
|
5616
|
+
MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, MngViewContainerComponentService], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table [descriptor]=\"descriptor.table\" [dataProvider]=\"dataProvider\" [useQueryParams]=\"true\" (cellClick)=\"onTableCellClick($event)\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle | translate }}</h5>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\">\n </mng-action>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n", components: [{ type: i7$1.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: i8$1.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "viewContainer"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "translate": i3$1.TranslatePipe } });
|
|
5617
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, decorators: [{
|
|
5618
|
+
type: Component,
|
|
5619
|
+
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" }]
|
|
5620
|
+
}], 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: [{
|
|
5621
|
+
type: Input
|
|
5622
|
+
}], dataProvider: [{
|
|
5623
|
+
type: Input
|
|
5624
|
+
}], actions: [{
|
|
5625
|
+
type: Input
|
|
5626
|
+
}], tableComponent: [{
|
|
5627
|
+
type: ViewChild,
|
|
5628
|
+
args: [MngTableComponent]
|
|
5629
|
+
}] } });
|
|
5630
|
+
|
|
5631
|
+
class AMngTableviewRouteComponent {
|
|
5632
|
+
ngOnInit() {
|
|
5633
|
+
this.descriptor = this.createTableviewDescriptor();
|
|
5634
|
+
this.dataProvider = this.createTableviewDataProvider();
|
|
5635
|
+
this.actions = this.createActionDescriptors();
|
|
5636
|
+
}
|
|
5637
|
+
createActionDescriptors() {
|
|
5638
|
+
const actions = [];
|
|
5639
|
+
actions.push(new ActionEditorDetailsDescriptor(this.descriptor.viewEditor));
|
|
5640
|
+
actions.push(new ActionEditorAddDescriptor(this.descriptor.addEditor));
|
|
5641
|
+
actions.push(new ActionEditorEditDescriptor(this.descriptor.editEditor));
|
|
5642
|
+
actions.push(new ActionDeleteDescriptor(this.descriptor.model));
|
|
5643
|
+
return actions;
|
|
5644
|
+
}
|
|
5645
|
+
}
|
|
5646
|
+
AMngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: AMngTableviewRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
5647
|
+
AMngTableviewRouteComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: AMngTableviewRouteComponent, ngImport: i0 });
|
|
5648
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: AMngTableviewRouteComponent, decorators: [{
|
|
5649
|
+
type: Directive
|
|
5650
|
+
}] });
|
|
5651
|
+
|
|
5652
|
+
class MngTableviewRouteComponent extends AMngTableviewRouteComponent {
|
|
5653
|
+
constructor(route) {
|
|
5654
|
+
super();
|
|
5655
|
+
this.route = route;
|
|
5656
|
+
}
|
|
5657
|
+
createTableviewDescriptor() {
|
|
5658
|
+
if (!this.route.snapshot.data['tableviewData'].descriptor) {
|
|
5659
|
+
throw Error('Tableview requires a descriptor.');
|
|
5660
|
+
}
|
|
5661
|
+
return this.route.snapshot.data['tableviewData'].descriptor;
|
|
5662
|
+
}
|
|
5663
|
+
createTableviewDataProvider() {
|
|
5664
|
+
if (!this.route.snapshot.data['tableviewData'].dataProvider) {
|
|
5665
|
+
throw Error('Tableview requires a data provider.');
|
|
5666
|
+
}
|
|
5667
|
+
return this.route.snapshot.data['tableviewData'].dataProvider;
|
|
5668
|
+
}
|
|
5669
|
+
createActionDescriptors() {
|
|
5670
|
+
return this.route.snapshot.data['tableviewData'].actions ?? super.createActionDescriptors();
|
|
5671
|
+
}
|
|
5672
|
+
}
|
|
5673
|
+
MngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, deps: [{ token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
5674
|
+
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"] }] });
|
|
5675
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, decorators: [{
|
|
5676
|
+
type: Component,
|
|
5677
|
+
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" }]
|
|
5678
|
+
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }]; } });
|
|
5679
|
+
|
|
5680
|
+
class MngFormlyFieldLookupDialogComponent extends FieldType {
|
|
5681
|
+
constructor(injector) {
|
|
5682
|
+
super();
|
|
5683
|
+
this.injector = injector;
|
|
5684
|
+
this.fieldLabelFormControl = new FormControl();
|
|
5685
|
+
this.itemsSubject = new ReplaySubject(1);
|
|
5686
|
+
this.itemsAsync = this.itemsSubject.asObservable();
|
|
5687
|
+
this.addItemsSubject = new ReplaySubject(1);
|
|
5688
|
+
this.addItemsAsync = this.addItemsSubject.asObservable();
|
|
5689
|
+
this.dialogUseDataProvider = false;
|
|
5690
|
+
this.dialogDataProviderService = null;
|
|
5691
|
+
this.dialogIsLoadingSubject = new ReplaySubject(1);
|
|
5692
|
+
this.isDialogVisible = false;
|
|
5693
|
+
this.dialogAreItemsLoaded = false;
|
|
5694
|
+
this.dialogSelectedItem = null;
|
|
5695
|
+
this.dialogMessages = [];
|
|
5696
|
+
this.dialogIsLoading$ = this.dialogIsLoadingSubject.asObservable();
|
|
5697
|
+
this.subscriptions = [];
|
|
5698
|
+
}
|
|
5699
|
+
ngOnInit() {
|
|
5700
|
+
this.descriptor = this.to['descriptor'];
|
|
5701
|
+
// emit lifecycle event
|
|
5702
|
+
this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Component, MngFormlyFieldLookupDialogComponent, this, {
|
|
5703
|
+
eventSubtype: MngFormFieldEventComponentSubtype.ON_INIT
|
|
5704
|
+
});
|
|
5705
|
+
this.config = this.descriptor.config;
|
|
5706
|
+
if (!this.descriptor.lookupTableDataProvider && this.descriptor.dataProvider?.serviceType) {
|
|
5707
|
+
this.dialogUseDataProvider = true;
|
|
5708
|
+
this.dialogDataProviderService = this.injector.get(this.descriptor.dataProvider.serviceType);
|
|
5709
|
+
}
|
|
5710
|
+
// init values
|
|
5711
|
+
this.setFieldLabelValue(this.formControl.value);
|
|
5712
|
+
const subscription = this.formControl.valueChanges.pipe(startWith(this.formControl.value), distinctUntilChanged((prev, curr) => {
|
|
5713
|
+
const compareProp = this.descriptor.lookupTableDescriptor.dataKeyProperty ?? this.descriptor.lookupTableDescriptor.model.idPropertyName;
|
|
5714
|
+
if (compareProp && typeof prev === 'object' && typeof curr === 'object') {
|
|
5715
|
+
return prev[compareProp] === curr[compareProp];
|
|
5716
|
+
}
|
|
5717
|
+
else {
|
|
5718
|
+
return prev === curr;
|
|
5719
|
+
}
|
|
5720
|
+
})).subscribe(v => {
|
|
5721
|
+
this.setFieldLabelValue(v);
|
|
5722
|
+
this.itemsSubject.next(v);
|
|
5723
|
+
this.descriptor.nextEvent(MngFormFieldEventTypeEnum.ValueChange, MngFormlyFieldLookupDialogComponent, this, {
|
|
5724
|
+
value: v
|
|
5725
|
+
});
|
|
5726
|
+
});
|
|
5727
|
+
this.subscriptions.push(subscription);
|
|
5728
|
+
}
|
|
5729
|
+
ngAfterViewInit() {
|
|
5730
|
+
this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Component, MngFormlyFieldLookupDialogComponent, this, {
|
|
5731
|
+
eventSubtype: MngFormFieldEventComponentSubtype.ON_VIEW_INIT
|
|
5732
|
+
});
|
|
5733
|
+
}
|
|
5734
|
+
ngOnDestroy() {
|
|
5735
|
+
this.lookupDataProviderSubscription?.unsubscribe();
|
|
5736
|
+
this.subscriptions.forEach(s => s.unsubscribe());
|
|
5737
|
+
// emit lifecycle event
|
|
5738
|
+
this.descriptor?.nextEvent(MngFormFieldEventTypeEnum.Component, MngFormlyFieldLookupDialogComponent, this, {
|
|
5739
|
+
eventSubtype: MngFormFieldEventComponentSubtype.ON_DESTROY
|
|
5740
|
+
});
|
|
5741
|
+
}
|
|
5742
|
+
openSelectDialog() {
|
|
5743
|
+
if (!this.dialogAreItemsLoaded && this.dialogUseDataProvider) {
|
|
5744
|
+
this.dialogIsLoadingSubject.next(true);
|
|
5745
|
+
const queryParamBuilder = MediusQueryParamBuilder.create(50);
|
|
5746
|
+
if (this.descriptor.lookupTableDescriptor.hasDefaultSort) {
|
|
5747
|
+
this.descriptor.lookupTableDescriptor.defaultSortProperty.forEach((p, idx) => queryParamBuilder.withSort(p, this.descriptor.lookupTableDescriptor.defaultSortAsc[idx]));
|
|
5748
|
+
}
|
|
5749
|
+
this.lookupDataProviderSubscription = this.descriptor.dataProvider?.lookup(queryParamBuilder.build(), this.dialogDataProviderService).subscribe({
|
|
5750
|
+
next: res => {
|
|
5751
|
+
const mqr = new MediusQueryResult();
|
|
5752
|
+
mqr.pageData = res;
|
|
5753
|
+
mqr.allDataCount = res.length;
|
|
5754
|
+
this.addItemsSubject.next(mqr);
|
|
5755
|
+
this.dialogAreItemsLoaded = true;
|
|
5756
|
+
this.dialogIsLoadingSubject.next(false);
|
|
5757
|
+
this.descriptor.nextEvent(MngFormFieldEventTypeEnum.DataProvider, MngFormlyFieldLookupDialogComponent, this, {
|
|
5758
|
+
eventSubtype: 'LookupNext',
|
|
5759
|
+
queryResult: mqr
|
|
5760
|
+
});
|
|
5761
|
+
},
|
|
5762
|
+
error: err => {
|
|
5763
|
+
this.dialogIsLoadingSubject.next(false);
|
|
5764
|
+
this.descriptor.nextEvent(MngFormFieldEventTypeEnum.DataProvider, MngFormlyFieldLookupDialogComponent, this, {
|
|
5765
|
+
eventSubtype: 'LookupError',
|
|
5766
|
+
queryResult: err
|
|
5767
|
+
});
|
|
5768
|
+
}
|
|
5769
|
+
});
|
|
5036
5770
|
}
|
|
5037
|
-
this.
|
|
5038
|
-
this.
|
|
5771
|
+
this.dialogSelectedItem = null;
|
|
5772
|
+
this.isDialogVisible = true;
|
|
5773
|
+
this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Dialog, MngFormlyFieldLookupDialogComponent, this, {
|
|
5774
|
+
eventSubtype: MngFormFieldEventDialogSubtype.VISIBILITY,
|
|
5775
|
+
dialogVisible: true
|
|
5776
|
+
});
|
|
5039
5777
|
}
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
};
|
|
5778
|
+
onSelectionChange(item) {
|
|
5779
|
+
this.dialogSelectedItem = item;
|
|
5780
|
+
}
|
|
5781
|
+
onCaptionCmpInst(instance) {
|
|
5782
|
+
this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Dialog, MngFormlyFieldLookupDialogComponent, this, {
|
|
5783
|
+
eventSubtype: MngFormFieldEventDialogSubtype.TABLE_CAPTION_COMPONENT_INSTANCE,
|
|
5784
|
+
captionComponentInstance: instance
|
|
5048
5785
|
});
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5786
|
+
}
|
|
5787
|
+
onColumnActionCmpInst(instance) {
|
|
5788
|
+
this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Dialog, MngFormlyFieldLookupDialogComponent, this, {
|
|
5789
|
+
eventSubtype: MngFormFieldEventDialogSubtype.TABLE_COLUMN_ACTIONS_COMPONENT_INSTANCE,
|
|
5790
|
+
captionComponentInstance: instance
|
|
5054
5791
|
});
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5792
|
+
}
|
|
5793
|
+
clear() {
|
|
5794
|
+
this.formControl.setValue(undefined);
|
|
5795
|
+
this.dialogSelectedItem = null;
|
|
5796
|
+
this.dialogAreItemsLoaded = false;
|
|
5797
|
+
this.hideDialog();
|
|
5798
|
+
}
|
|
5799
|
+
hideDialog() {
|
|
5800
|
+
this.isDialogVisible = false;
|
|
5801
|
+
this.descriptor.nextEvent(MngFormFieldEventTypeEnum.Dialog, MngFormlyFieldLookupDialogComponent, this, {
|
|
5802
|
+
eventSubtype: MngFormFieldEventDialogSubtype.VISIBILITY,
|
|
5803
|
+
dialogVisible: false
|
|
5064
5804
|
});
|
|
5065
|
-
this.multiSortMeta = primeSortMeta;
|
|
5066
|
-
this.filterMetadata = primeFilterMeta;
|
|
5067
|
-
this.rows = mediusQueryParam?.itemsPerPage ?? this.rowsPerPageOptions[0];
|
|
5068
|
-
this.offset = mediusQueryParam?.itemsOffset ?? 0;
|
|
5069
5805
|
}
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5806
|
+
addItem() {
|
|
5807
|
+
this.formControl.setValue(this.dialogSelectedItem);
|
|
5808
|
+
this.dialogSelectedItem = null;
|
|
5809
|
+
this.dialogAreItemsLoaded = false;
|
|
5810
|
+
this.hideDialog();
|
|
5811
|
+
}
|
|
5812
|
+
setFieldLabelValue(value) {
|
|
5813
|
+
if (!value) {
|
|
5814
|
+
this.fieldLabelFormControl.setValue('');
|
|
5815
|
+
return;
|
|
5816
|
+
}
|
|
5817
|
+
if (typeof value === 'object') {
|
|
5818
|
+
const labelProperty = this.descriptor.itemsLabelProperty ?? this.descriptor.lookupTableDescriptor?.model.titlePropertyName;
|
|
5819
|
+
if (!labelProperty) {
|
|
5820
|
+
throw new Error('Could not determine label property.');
|
|
5821
|
+
}
|
|
5822
|
+
this.fieldLabelFormControl.setValue(value[labelProperty]);
|
|
5076
5823
|
}
|
|
5077
5824
|
else {
|
|
5078
|
-
|
|
5825
|
+
this.fieldLabelFormControl.setValue(value);
|
|
5079
5826
|
}
|
|
5080
5827
|
}
|
|
5081
5828
|
}
|
|
5082
|
-
|
|
5083
|
-
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 });
|
|
5084
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type:
|
|
5829
|
+
MngFormlyFieldLookupDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
5830
|
+
MngFormlyFieldLookupDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldLookupDialogComponent, selector: "mng-formly-field-lookup-dialog", viewQueries: [{ propertyName: "mngTable", first: true, predicate: MngTableComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div [class]=\"'p-inputgroup mng-dropdown-dialog' + descriptor.inputClassName\" [class.p-inputtext-sm]=\"descriptor.isSizeSmall\" [class.p-inputtext-lg]=\"descriptor.isSizeLarge\">\n <input pInputText type=\"text\" [id]=\"$any(key)\" [readonly]=\"true\" [formlyAttributes]=\"field\" [formControl]=\"fieldLabelFormControl\" />\n <i class=\"mng-dropdown-clear-icon pi pi-times\" (click)=\"clear()\" *ngIf=\"!to.required && formControl?.value\"></i>\n <button pButton pRipple class=\"mng-dropdown-dialog-search-button\" type=\"button\" [label]=\"'general.search' | translate: {item: ''}\" (click)=\"openSelectDialog()\"></button>\n</div>\n\n<p-dialog\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.search' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-table-multiselect-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.lookupTableDescriptor!\"\n [dataProvider]=\"descriptor.lookupTableDataProvider\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [selectionMode]=\"'single'\"\n [loading]=\"dialogIsLoading$\"\n [captionComponent]=\"config?.table?.captionComponent\"\n [columnActionComponent]=\"config?.table?.columnActionComponent\"\n (selectionChange)=\"onSelectionChange($event)\"\n (captionComponentInstance)=\"onCaptionCmpInst($event)\"\n (columnActionComponentInstance)=\"onColumnActionCmpInst($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.select' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItem()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: i1$4.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i3$3.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10$1.InputText, selector: "[pInputText]" }, { type: i3$2.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i9.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i3$1.TranslatePipe, "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5831
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, decorators: [{
|
|
5085
5832
|
type: Component,
|
|
5086
|
-
args: [{ selector: 'mng-
|
|
5087
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }
|
|
5088
|
-
type: Optional
|
|
5089
|
-
}] }]; }, propDecorators: { descriptor: [{
|
|
5090
|
-
type: Input
|
|
5091
|
-
}], items: [{
|
|
5092
|
-
type: Input
|
|
5093
|
-
}], queryResult: [{
|
|
5094
|
-
type: Input
|
|
5095
|
-
}], loading: [{
|
|
5096
|
-
type: Input
|
|
5097
|
-
}], dataProvider: [{
|
|
5098
|
-
type: Input
|
|
5099
|
-
}], useQueryParams: [{
|
|
5100
|
-
type: Input
|
|
5101
|
-
}], selectionEnabled: [{
|
|
5102
|
-
type: Input
|
|
5103
|
-
}], loadEventEmitter: [{
|
|
5104
|
-
type: Output,
|
|
5105
|
-
args: ['tableLoad']
|
|
5106
|
-
}], cellClickEventEmitter: [{
|
|
5107
|
-
type: Output,
|
|
5108
|
-
args: ['cellClick']
|
|
5109
|
-
}], selectionChangeEventEmitter: [{
|
|
5110
|
-
type: Output,
|
|
5111
|
-
args: ['selectionChange']
|
|
5112
|
-
}], templates: [{
|
|
5113
|
-
type: ContentChildren,
|
|
5114
|
-
args: [MngTemplateDirective]
|
|
5115
|
-
}], primeTable: [{
|
|
5833
|
+
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" }]
|
|
5834
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { mngTable: [{
|
|
5116
5835
|
type: ViewChild,
|
|
5117
|
-
args: [
|
|
5836
|
+
args: [MngTableComponent]
|
|
5118
5837
|
}] } });
|
|
5119
5838
|
|
|
5839
|
+
var SizeEnum = ActionDescriptor.SizeEnum;
|
|
5120
5840
|
class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
5121
5841
|
constructor() {
|
|
5122
5842
|
super(...arguments);
|
|
@@ -5125,6 +5845,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
5125
5845
|
this.toolbarActions = [];
|
|
5126
5846
|
this.rowActions = [];
|
|
5127
5847
|
this.subscriptions = [];
|
|
5848
|
+
this.isDisabledSubject = new BehaviorSubject(false);
|
|
5849
|
+
this.isEnabled$ = this.isDisabledSubject.asObservable().pipe(distinctUntilChanged(), map(e => !e));
|
|
5128
5850
|
}
|
|
5129
5851
|
ngOnInit() {
|
|
5130
5852
|
this.descriptor = this.to['descriptor'];
|
|
@@ -5136,6 +5858,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
5136
5858
|
.withTitle(null)
|
|
5137
5859
|
.withIcon('pi pi-plus')
|
|
5138
5860
|
.withClassName('mng-formly-field-table-form-dialog')
|
|
5861
|
+
.withSize(SizeEnum.ExtraSmall)
|
|
5139
5862
|
.withSubmitFunction(ctx => {
|
|
5140
5863
|
if (!ctx.data?.item) {
|
|
5141
5864
|
throw new Error(`No item was provided in context, edit cannot be done.`);
|
|
@@ -5146,7 +5869,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
5146
5869
|
this.formControl.patchValue(value);
|
|
5147
5870
|
return of(ctx.data.item);
|
|
5148
5871
|
})
|
|
5149
|
-
.withIsVisibleFunction(() => of(!this.options?.formState.disabled))
|
|
5872
|
+
.withIsVisibleFunction(() => of(!this.options?.formState.disabled))
|
|
5873
|
+
.withIsEnabledFunction(() => this.isEnabled$);
|
|
5150
5874
|
this.toolbarActions.push(addAction);
|
|
5151
5875
|
}
|
|
5152
5876
|
if (hasEditAction) {
|
|
@@ -5154,6 +5878,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
5154
5878
|
.withTitle(null)
|
|
5155
5879
|
.withIcon('pi pi-pencil')
|
|
5156
5880
|
.withClassName('mng-formly-field-table-form-dialog')
|
|
5881
|
+
.withSize(SizeEnum.ExtraSmall)
|
|
5157
5882
|
.withSubmitFunction(ctx => {
|
|
5158
5883
|
if (!ctx.data?.item) {
|
|
5159
5884
|
throw new Error(`No item was provided in context, edit cannot be done.`);
|
|
@@ -5164,7 +5889,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
5164
5889
|
this.formControl.patchValue(formControlValue);
|
|
5165
5890
|
return of(ctx.data.item);
|
|
5166
5891
|
})
|
|
5167
|
-
.withIsVisibleFunction(() => of(!this.
|
|
5892
|
+
.withIsVisibleFunction(() => of(!this.formControl?.disabled))
|
|
5893
|
+
.withIsEnabledFunction(() => this.isEnabled$);
|
|
5168
5894
|
this.rowActions.push(editAction);
|
|
5169
5895
|
}
|
|
5170
5896
|
if (hasDeleteAction) {
|
|
@@ -5172,6 +5898,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
5172
5898
|
.withLevel(ActionLevelEnum.Danger)
|
|
5173
5899
|
.withTitle(null)
|
|
5174
5900
|
.withIcon('pi pi-trash')
|
|
5901
|
+
.withSize(SizeEnum.ExtraSmall)
|
|
5175
5902
|
.withRunFunction(ctx => {
|
|
5176
5903
|
if (!ctx.data?.item) {
|
|
5177
5904
|
throw new Error(`No item was provided in context, delete cannot be done.`);
|
|
@@ -5191,27 +5918,38 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
5191
5918
|
this.formControl.patchValue(formControlValue);
|
|
5192
5919
|
return of(ctx.data.item);
|
|
5193
5920
|
})
|
|
5194
|
-
.withIsVisibleFunction(() => of(!this.options?.formState.disabled))
|
|
5921
|
+
.withIsVisibleFunction(() => of(!this.options?.formState.disabled))
|
|
5922
|
+
.withIsEnabledFunction(() => this.isEnabled$);
|
|
5195
5923
|
this.rowActions.push(deleteAction);
|
|
5196
5924
|
}
|
|
5197
5925
|
// init values
|
|
5198
5926
|
if (typeof this.formControl.value === 'undefined' || this.formControl.value === null) {
|
|
5199
5927
|
this.formControl.patchValue([]);
|
|
5200
5928
|
}
|
|
5201
|
-
|
|
5929
|
+
let subscription = this.formControl.valueChanges.pipe(startWith(this.formControl.value)).subscribe(v => {
|
|
5202
5930
|
this.itemsSubject.next(v);
|
|
5203
5931
|
});
|
|
5204
5932
|
this.subscriptions.push(subscription);
|
|
5933
|
+
this.isDisabledSubject.next(this.formControl.disabled);
|
|
5934
|
+
subscription = this.formControl.statusChanges.pipe().subscribe(status => {
|
|
5935
|
+
if (status === 'DISABLED' && !this.isDisabledSubject.value) {
|
|
5936
|
+
this.isDisabledSubject.next(true);
|
|
5937
|
+
}
|
|
5938
|
+
else if (status !== 'DISABLED' && this.isDisabledSubject.value) {
|
|
5939
|
+
this.isDisabledSubject.next(false);
|
|
5940
|
+
}
|
|
5941
|
+
});
|
|
5942
|
+
this.subscriptions.push(subscription);
|
|
5205
5943
|
}
|
|
5206
5944
|
ngOnDestroy() {
|
|
5207
5945
|
this.subscriptions.forEach(s => s.unsubscribe());
|
|
5208
5946
|
}
|
|
5209
5947
|
}
|
|
5210
5948
|
MngFormlyFieldTableDialogFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
5211
|
-
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":
|
|
5949
|
+
MngFormlyFieldTableDialogFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTableDialogFormComponent, selector: "mng-formly-table-dialog-form-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <mng-action *ngFor=\"let action of toolbarActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\" let-idx=\"rowIndex\">\n <mng-action\n *ngFor=\"let action of rowActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.tableviewDescriptor.model.idPropertyName ? item[descriptor.tableviewDescriptor.model.idPropertyName] : undefined\"\n [actionData]=\"{itemIndex: idx}\">\n </mng-action>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"], components: [{ type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "viewContainer"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5212
5950
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, decorators: [{
|
|
5213
5951
|
type: Component,
|
|
5214
|
-
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"] }]
|
|
5952
|
+
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"] }]
|
|
5215
5953
|
}] });
|
|
5216
5954
|
|
|
5217
5955
|
class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
|
|
@@ -5252,6 +5990,7 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
|
|
|
5252
5990
|
this.subscriptions.push(subscription);
|
|
5253
5991
|
}
|
|
5254
5992
|
ngOnDestroy() {
|
|
5993
|
+
this.lookupDataProviderSubscription?.unsubscribe();
|
|
5255
5994
|
this.subscriptions.forEach(s => s.unsubscribe());
|
|
5256
5995
|
}
|
|
5257
5996
|
openAddDialog() {
|
|
@@ -5265,12 +6004,15 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
|
|
|
5265
6004
|
const filterValues = this.formControl.value.map((i) => i[this.descriptor.excludeValueProperty]);
|
|
5266
6005
|
queryParamBuilder.withFilter(this.descriptor.excludeFilterProperty, filterValues, undefined, MediusFilterMatchType.NotIn);
|
|
5267
6006
|
}
|
|
5268
|
-
this.descriptor.lookupTableDataProvider
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
6007
|
+
this.lookupDataProviderSubscription = this.descriptor.lookupTableDataProvider?.getAll(queryParamBuilder.build(), this.dialogDataProviderService).subscribe({
|
|
6008
|
+
next: res => {
|
|
6009
|
+
this.addItemsSubject.next(res);
|
|
6010
|
+
this.dialogAreItemsLoaded = true;
|
|
6011
|
+
this.dialogIsLoadingSubject.next(false);
|
|
6012
|
+
},
|
|
6013
|
+
error: () => {
|
|
6014
|
+
this.dialogIsLoadingSubject.next(false);
|
|
6015
|
+
}
|
|
5274
6016
|
});
|
|
5275
6017
|
}
|
|
5276
6018
|
this.dialogSelectedAddItems = [];
|
|
@@ -5315,16 +6057,16 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
|
|
|
5315
6057
|
}
|
|
5316
6058
|
}
|
|
5317
6059
|
MngFormlyFieldTableDialogMultiselectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
5318
|
-
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 && !
|
|
6060
|
+
MngFormlyFieldTableDialogMultiselectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTableDialogMultiselectComponent, selector: "mng-formly-table-multiselect-add-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.mainTableDescriptor\" [items]=\"itemsAsync\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header pt-0\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <button\n *ngIf=\"hasAddAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-success mng-button-xs\"\n (click)=\"openAddDialog()\"\n [disabled]=\"formControl!.disabled\"></button>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <button\n *ngIf=\"hasDeleteAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-danger mng-button-xs\"\n (click)=\"removeItem(item)\"\n [disabled]=\"formControl!.disabled\"></button>\n </ng-template>\n</mng-table>\n\n<p-dialog\n *ngIf=\"hasAddAction\"\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.addItem' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-table-multiselect-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.mainTableDescriptor\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [loading]=\"dialogIsLoading$\"\n (selectionChange)=\"onSelectionChange($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.add' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItems()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i1$4.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: i3$3.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i9.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i3$1.TranslatePipe, "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5319
6061
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, decorators: [{
|
|
5320
6062
|
type: Component,
|
|
5321
|
-
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 && !
|
|
6063
|
+
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" }]
|
|
5322
6064
|
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
5323
6065
|
|
|
5324
6066
|
class MngFormlyFieldTabsComponent extends FieldType {
|
|
5325
6067
|
}
|
|
5326
6068
|
MngFormlyFieldTabsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTabsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
5327
|
-
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$
|
|
6069
|
+
MngFormlyFieldTabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTabsComponent, selector: "mng-formly-field-tabs", usesInheritance: true, ngImport: i0, template: "<p-tabView>\n <p-tabPanel\n *ngFor=\"let tab of field.fieldGroup; let i = index; let last = last\"\n [header]=\"tab.templateOptions?.label! | translate\"\n [headerStyleClass]=\"$any(formControl!.valid ? 'p-tabview-title' : null)\">\n <ng-template pTemplate=\"header\">\n <span\n class=\"p-tabview-title\"\n [class.p-tabview-title-error]=\"formState.submittedOn && formState['tab_' + (tab.id ? tab.id : tab.templateOptions?.label!) + '_invalid']\"\n >{{ tab.templateOptions?.label! | translate }}</span\n >\n </ng-template>\n <formly-field [field]=\"tab\"></formly-field>\n </p-tabPanel>\n</p-tabView>\n", components: [{ type: i1$5.TabView, selector: "p-tabView", inputs: ["orientation", "style", "styleClass", "controlClose", "scrollable", "activeIndex"], outputs: ["onChange", "onClose", "activeIndexChange"] }, { type: i1$5.TabPanel, selector: "p-tabPanel", inputs: ["closable", "headerStyle", "headerStyleClass", "cache", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "selected", "disabled", "header", "leftIcon", "rightIcon"] }, { type: i3$2.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5328
6070
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTabsComponent, decorators: [{
|
|
5329
6071
|
type: Component,
|
|
5330
6072
|
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" }]
|
|
@@ -5333,7 +6075,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
5333
6075
|
class MngFormlyFieldFieldsetComponent extends FieldType {
|
|
5334
6076
|
}
|
|
5335
6077
|
MngFormlyFieldFieldsetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldFieldsetComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
5336
|
-
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$
|
|
6078
|
+
MngFormlyFieldFieldsetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldFieldsetComponent, selector: "mng-formly-field-fieldset", usesInheritance: true, ngImport: i0, template: "<ng-container *ngFor=\"let group of field.fieldGroup; let i = index; let last = last\">\n <p-fieldset *ngIf=\"!group.templateOptions?.['descriptor']?.default; else defaultSet\" [legend]=\"group.templateOptions?.label! | translate\">\n <formly-field [field]=\"group\"></formly-field>\n </p-fieldset>\n <ng-template #defaultSet>\n <formly-field [field]=\"group\"></formly-field>\n </ng-template>\n</ng-container>\n", components: [{ type: i1$6.Fieldset, selector: "p-fieldset", inputs: ["legend", "toggleable", "collapsed", "style", "styleClass", "transitionOptions"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }, { type: i3$2.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5337
6079
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldFieldsetComponent, decorators: [{
|
|
5338
6080
|
type: Component,
|
|
5339
6081
|
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" }]
|
|
@@ -5342,19 +6084,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
5342
6084
|
class MngFormlyFieldWrapperComponent extends FieldWrapper {
|
|
5343
6085
|
}
|
|
5344
6086
|
MngFormlyFieldWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
5345
|
-
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":
|
|
6087
|
+
MngFormlyFieldWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldWrapperComponent, selector: "mng-formly-field-wrapper", usesInheritance: true, ngImport: i0, template: "<div class=\"field\">\n <label [for]=\"key\" [class]=\"to?.['descriptor']?.['labelClassName'] ?? ''\"\n >{{ $any(to?.label) | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label\n >\n <ng-container #fieldComponent></ng-container>\n <small *ngIf=\"to?.['descriptor']?.['helpText']\">{{ to?.['descriptor']?.['helpText'] | translate }}</small>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n</div>\n", components: [{ type: i3$2.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5346
6088
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldWrapperComponent, decorators: [{
|
|
5347
6089
|
type: Component,
|
|
5348
|
-
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" }]
|
|
6090
|
+
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" }]
|
|
5349
6091
|
}] });
|
|
5350
6092
|
|
|
5351
6093
|
class MngFormlyTableWrapperComponent extends FieldWrapper {
|
|
5352
6094
|
}
|
|
5353
6095
|
MngFormlyTableWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyTableWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
5354
|
-
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 });
|
|
6096
|
+
MngFormlyTableWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyTableWrapperComponent, selector: "mng-formly-table-wrapper", usesInheritance: true, ngImport: i0, template: "<div class=\"field table\">\n <ng-container #fieldComponent></ng-container>\n <small *ngIf=\"to?.['descriptor']?.['helpText']\">{{ to?.['descriptor']?.['helpText'] | translate }}</small>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n</div>\n", components: [{ type: i3$2.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5355
6097
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyTableWrapperComponent, decorators: [{
|
|
5356
6098
|
type: Component,
|
|
5357
|
-
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" }]
|
|
6099
|
+
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" }]
|
|
5358
6100
|
}] });
|
|
5359
6101
|
|
|
5360
6102
|
class MngBreadcrumbComponent {
|
|
@@ -5363,7 +6105,7 @@ class MngBreadcrumbComponent {
|
|
|
5363
6105
|
}
|
|
5364
6106
|
}
|
|
5365
6107
|
MngBreadcrumbComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBreadcrumbComponent, deps: [{ token: MngCommonsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5366
|
-
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$
|
|
6108
|
+
MngBreadcrumbComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngBreadcrumbComponent, selector: "mng-breadcrumb", ngImport: i0, template: "<div class=\"layout-breadcrumb-container\">\n <div class=\"layout-breadcrumb\">\n <p-breadcrumb [home]=\"$any(mngCommons.breadcrumbHome$ | async)\" [model]=\"$any(mngCommons.breadcrumbs$ | async)\" styleClass=\"layout-breadcrumb py-2\"></p-breadcrumb>\n </div>\n</div>\n", components: [{ type: i2$3.Breadcrumb, selector: "p-breadcrumb", inputs: ["model", "style", "styleClass", "home", "homeAriaLabel"], outputs: ["onItemClick"] }], pipes: { "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5367
6109
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngBreadcrumbComponent, decorators: [{
|
|
5368
6110
|
type: Component,
|
|
5369
6111
|
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" }]
|
|
@@ -5376,7 +6118,7 @@ class MngFooterComponent {
|
|
|
5376
6118
|
}
|
|
5377
6119
|
}
|
|
5378
6120
|
MngFooterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFooterComponent, deps: [{ token: MngCommonsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5379
|
-
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\">© {{ mngCommons.appOwner | translate }} - {{ currentYear }}</span>\n</div>\n", pipes: { "translate":
|
|
6121
|
+
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\">© {{ mngCommons.appOwner | translate }} - {{ currentYear }}</span>\n</div>\n", pipes: { "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5380
6122
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFooterComponent, decorators: [{
|
|
5381
6123
|
type: Component,
|
|
5382
6124
|
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\">© {{ mngCommons.appOwner | translate }} - {{ currentYear }}</span>\n</div>\n" }]
|
|
@@ -5712,7 +6454,7 @@ class MngMenuItemComponent {
|
|
|
5712
6454
|
}
|
|
5713
6455
|
}
|
|
5714
6456
|
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 });
|
|
5715
|
-
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":
|
|
6457
|
+
MngMenuItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: { item: "item", index: "index", root: "root", parentKey: "parentKey" }, host: { properties: { "class.layout-root-menuitem": "root", "class.active-menuitem": "active" } }, ngImport: i0, template: "<ng-container>\n <div *ngIf=\"root && item.visible !== false && (isAllowed$ | async) === true\" class=\"layout-menuitem-root-text\">{{ item.label! | translate }}</div>\n <a\n *ngIf=\"(!item.routerLink || item.items) && item.visible !== false && (isAllowed$ | async) === true\"\n [attr.href]=\"item.href\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (keydown.enter)=\"itemClick($event)\"\n [routerLink]=\"item.routerLink\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <a\n *ngIf=\"item.routerLink && !item.items && item.visible !== false && (isAllowed$ | async) === true\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"hover = true\"\n (mouseleave)=\"hover = false\"\n [routerLink]=\"item.routerLink\"\n routerLinkActive=\"active-menuitem-routerlink\"\n [routerLinkActiveOptions]=\"{exact: true}\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <ul\n *ngIf=\"((item.items && active) || (item.items && (mngCommons.menuModeIsStatic$ | async) && (root || active))) && item.visible !== false && (isAllowed$ | async) === true\"\n [@children]=\"\n (mngCommons.menuModeIsSlim$ | async) && (mainLayoutService.isMobile$ | async) === false && root\n ? active\n ? 'visible'\n : 'hidden'\n : (mngCommons.menuModeIsStatic$ | async) && root && (mainLayoutService.isMobile$ | async) === false\n ? 'visible'\n : active\n ? 'visibleAnimated'\n : 'hiddenAnimated'\n \">\n <ng-template ngFor let-child let-i=\"index\" [ngForOf]=\"item.items\">\n <li mng-menuitem [item]=\"child\" [index]=\"i\" [parentKey]=\"key\" [class]=\"child.badgeClassName\"></li>\n </ng-template>\n </ul>\n</ng-container>\n", components: [{ type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: ["item", "index", "root", "parentKey"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i9.Ripple, selector: "[pRipple]" }, { type: i4$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i3$1.TranslatePipe }, animations: [
|
|
5716
6458
|
trigger('children', [
|
|
5717
6459
|
state('void', style({
|
|
5718
6460
|
height: '0px'
|
|
@@ -5811,8 +6553,6 @@ class MngTopbarComponent {
|
|
|
5811
6553
|
this.mngCommons.user$.subscribe(u => {
|
|
5812
6554
|
this.user = u;
|
|
5813
6555
|
});
|
|
5814
|
-
}
|
|
5815
|
-
ngAfterViewInit() {
|
|
5816
6556
|
this.mainLayoutService.innerWidth = window.innerWidth;
|
|
5817
6557
|
}
|
|
5818
6558
|
switchLanguage(language) {
|
|
@@ -5826,7 +6566,7 @@ class MngTopbarComponent {
|
|
|
5826
6566
|
}
|
|
5827
6567
|
}
|
|
5828
6568
|
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 });
|
|
5829
|
-
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:
|
|
6569
|
+
MngTopbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTopbarComponent, selector: "mng-topbar", viewQueries: [{ propertyName: "templates", predicate: MngTemplateDirective, descendants: true }], ngImport: i0, template: "<div class=\"layout-topbar\">\n <div class=\"layout-topbar-left\">\n <a\n href=\"#\"\n class=\"topbar-menu-button\"\n (click)=\"mainLayoutService.onMenuButtonClick($event)\"\n *ngIf=\"(mngCommons.menuModeIsOverlay$ | async) || (mainLayoutService.isMobile$ | async)\">\n <i class=\"pi pi-bars\"></i>\n </a>\n\n <ng-container [mngComponent]=\"breadcrumbComponent\"></ng-container>\n </div>\n\n <ng-container [mngComponent]=\"menuComponent\"></ng-container>\n\n <div class=\"layout-topbar-right\">\n <ul class=\"layout-topbar-right-items\">\n <li #profile class=\"profile-item\" [ngClass]=\"{'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile}\">\n <a href=\"#\" (click)=\"mainLayoutService.onTopbarItemClick($event, profile)\">\n <i class=\"pi pi-fw pi-user\"></i>\n </a>\n <ul class=\"fadeInDown\" *ngIf=\"user\">\n <li role=\"menuitem\">\n <a>\n {{ user?.displayName ?? user?.username }}\n </a>\n </li>\n <li role=\"menuitem\" *ngIf=\"user?.logout || user?.logoutUrl\">\n <a [href]=\"user?.logoutUrl\" (click)=\"logout(user, $event)\">\n <i class=\"pi pi-fw pi-sign-out\"></i>\n <span>{{ 'mngTopbar.logout' | translate }}</span>\n </a>\n </li>\n </ul>\n </li>\n <li *ngIf=\"languages.length > 1\" class=\"profile-item\" [ngClass]=\"{'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile}\">\n <i class=\"pi pi-fw pi-globe\"></i>\n <p-dropdown [ngModel]=\"selectedLanguage\" [options]=\"languages\" (onChange)=\"switchLanguage($event.value)\"></p-dropdown>\n </li>\n </ul>\n </div>\n</div>\n", components: [{ type: i1$2.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "virtualScroll", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "disabled", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent"], outputs: ["instanceCreated"] }, { type: i4$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i3$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5830
6570
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTopbarComponent, decorators: [{
|
|
5831
6571
|
type: Component,
|
|
5832
6572
|
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" }]
|
|
@@ -5863,7 +6603,7 @@ class MngMainLayoutComponent {
|
|
|
5863
6603
|
}
|
|
5864
6604
|
}
|
|
5865
6605
|
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 });
|
|
5866
|
-
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 });
|
|
6606
|
+
MngMainLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMainLayoutComponent, selector: "mng-main-layout", host: { listeners: { "window:resize": "onWindowResize($event)" } }, providers: [MngMainLayoutComponentService], viewQueries: [{ propertyName: "templates", predicate: MngTemplateDirective, descendants: true }], ngImport: i0, template: "<div\n class=\"layout-wrapper\"\n (click)=\"mainLayoutService.onLayoutClick()\"\n [ngClass]=\"{\n 'layout-static': mngCommons.menuModeIsStatic$ | async,\n 'layout-overlay': mngCommons.menuModeIsOverlay$ | async,\n 'layout-slim': mngCommons.menuModeIsSlim$ | async,\n 'layout-sidebar': mngCommons.menuModeIsSidebar$ | async,\n 'layout-sidebar-static': (mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async),\n 'layout-overlay-active': mainLayoutService.overlayMenuActive$ | async,\n 'layout-mobile-active': mainLayoutService.staticMenuMobileActive$ | async,\n 'layout-static-inactive': (mainLayoutService.staticMenuDesktopInactive$ | async) && (mngCommons.menuModeIsStatic$ | async)\n }\">\n <div class=\"layout-main\">\n <ng-container [mngComponent]=\"topbarComponent\"></ng-container>\n\n <ng-container\n *ngIf=\"\n (mainLayoutService.isMobile$ | async) === false &&\n ((mngCommons.menuModeIsStatic$ | async) || (mngCommons.menuModeIsSlim$ | async) || (mngCommons.menuModeIsSidebar$ | async))\n \"\n [mngComponent]=\"menuComponent\">\n </ng-container>\n\n <div class=\"layout-main-content\">\n <router-outlet></router-outlet>\n </div>\n\n <ng-container [mngComponent]=\"footerComponent\"></ng-container>\n </div>\n</div>\n", directives: [{ type: i4$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent"], outputs: ["instanceCreated"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "async": i4$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5867
6607
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngMainLayoutComponent, decorators: [{
|
|
5868
6608
|
type: Component,
|
|
5869
6609
|
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" }]
|
|
@@ -5875,127 +6615,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
5875
6615
|
args: ['window:resize', ['$event']]
|
|
5876
6616
|
}] } });
|
|
5877
6617
|
|
|
5878
|
-
class MngTableviewComponent {
|
|
5879
|
-
constructor(route, messageService, translateService, dialogService, confirmationService, actionService, tableviewService) {
|
|
5880
|
-
this.route = route;
|
|
5881
|
-
this.messageService = messageService;
|
|
5882
|
-
this.translateService = translateService;
|
|
5883
|
-
this.dialogService = dialogService;
|
|
5884
|
-
this.confirmationService = confirmationService;
|
|
5885
|
-
this.actionService = actionService;
|
|
5886
|
-
this.tableviewService = tableviewService;
|
|
5887
|
-
this.actions = [];
|
|
5888
|
-
this.tableComponent = null;
|
|
5889
|
-
this.rowClickActions = [];
|
|
5890
|
-
this.rowInlineActions = [];
|
|
5891
|
-
this.toolbarLeftActions = [];
|
|
5892
|
-
this.toolbarRightActions = [];
|
|
5893
|
-
this.subscriptions = [];
|
|
5894
|
-
}
|
|
5895
|
-
ngOnInit() {
|
|
5896
|
-
this.tableviewService.actions = this.actions;
|
|
5897
|
-
this.tableviewService.dataProvider = this.dataProvider;
|
|
5898
|
-
this.tableviewService.messageService = this.messageService;
|
|
5899
|
-
const reloadTableSubscription = this.tableviewService.reloadTable$.subscribe(() => {
|
|
5900
|
-
this.reloadTable();
|
|
5901
|
-
});
|
|
5902
|
-
this.subscriptions.push(reloadTableSubscription);
|
|
5903
|
-
for (const action of this.actions) {
|
|
5904
|
-
switch (action.position) {
|
|
5905
|
-
case ActionPositionEnum.RowClick:
|
|
5906
|
-
this.rowClickActions.push(action);
|
|
5907
|
-
break;
|
|
5908
|
-
case ActionPositionEnum.RowInline:
|
|
5909
|
-
this.rowInlineActions.push(action);
|
|
5910
|
-
break;
|
|
5911
|
-
case ActionPositionEnum.ToolbarLeft:
|
|
5912
|
-
this.toolbarLeftActions.push(action);
|
|
5913
|
-
break;
|
|
5914
|
-
case ActionPositionEnum.ToolbarRight:
|
|
5915
|
-
this.toolbarRightActions.push(action);
|
|
5916
|
-
break;
|
|
5917
|
-
}
|
|
5918
|
-
}
|
|
5919
|
-
}
|
|
5920
|
-
ngOnDestroy() {
|
|
5921
|
-
this.subscriptions.forEach(s => s.unsubscribe());
|
|
5922
|
-
}
|
|
5923
|
-
reloadTable() {
|
|
5924
|
-
this.tableComponent?.reload();
|
|
5925
|
-
}
|
|
5926
|
-
onTableCellClick(event) {
|
|
5927
|
-
if (this.rowClickActions.length) {
|
|
5928
|
-
for (const action of this.rowClickActions) {
|
|
5929
|
-
this.actionService.triggerRowClickAction(action, event, this.route);
|
|
5930
|
-
}
|
|
5931
|
-
}
|
|
5932
|
-
}
|
|
5933
|
-
}
|
|
5934
|
-
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 });
|
|
5935
|
-
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 } });
|
|
5936
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, decorators: [{
|
|
5937
|
-
type: Component,
|
|
5938
|
-
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" }]
|
|
5939
|
-
}], 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: [{
|
|
5940
|
-
type: Input
|
|
5941
|
-
}], dataProvider: [{
|
|
5942
|
-
type: Input
|
|
5943
|
-
}], actions: [{
|
|
5944
|
-
type: Input
|
|
5945
|
-
}], tableComponent: [{
|
|
5946
|
-
type: ViewChild,
|
|
5947
|
-
args: [MngTableComponent]
|
|
5948
|
-
}] } });
|
|
5949
|
-
|
|
5950
|
-
class AMngTableviewRouteComponent {
|
|
5951
|
-
ngOnInit() {
|
|
5952
|
-
this.descriptor = this.createTableviewDescriptor();
|
|
5953
|
-
this.dataProvider = this.createTableviewDataProvider();
|
|
5954
|
-
this.actions = this.createActionDescriptors();
|
|
5955
|
-
}
|
|
5956
|
-
createActionDescriptors() {
|
|
5957
|
-
const actions = [];
|
|
5958
|
-
actions.push(new ActionEditorDetailsDescriptor(this.descriptor.viewEditor));
|
|
5959
|
-
actions.push(new ActionEditorAddDescriptor(this.descriptor.addEditor));
|
|
5960
|
-
actions.push(new ActionEditorEditDescriptor(this.descriptor.editEditor));
|
|
5961
|
-
actions.push(new ActionDeleteDescriptor(this.descriptor.model));
|
|
5962
|
-
return actions;
|
|
5963
|
-
}
|
|
5964
|
-
}
|
|
5965
|
-
AMngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: AMngTableviewRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
5966
|
-
AMngTableviewRouteComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: AMngTableviewRouteComponent, ngImport: i0 });
|
|
5967
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: AMngTableviewRouteComponent, decorators: [{
|
|
5968
|
-
type: Directive
|
|
5969
|
-
}] });
|
|
5970
|
-
|
|
5971
|
-
class MngTableviewRouteComponent extends AMngTableviewRouteComponent {
|
|
5972
|
-
constructor(route) {
|
|
5973
|
-
super();
|
|
5974
|
-
this.route = route;
|
|
5975
|
-
}
|
|
5976
|
-
createTableviewDescriptor() {
|
|
5977
|
-
if (!this.route.snapshot.data['tableviewData'].descriptor) {
|
|
5978
|
-
throw Error('Tableview requires a descriptor.');
|
|
5979
|
-
}
|
|
5980
|
-
return this.route.snapshot.data['tableviewData'].descriptor;
|
|
5981
|
-
}
|
|
5982
|
-
createTableviewDataProvider() {
|
|
5983
|
-
if (!this.route.snapshot.data['tableviewData'].dataProvider) {
|
|
5984
|
-
throw Error('Tableview requires a data provider.');
|
|
5985
|
-
}
|
|
5986
|
-
return this.route.snapshot.data['tableviewData'].dataProvider;
|
|
5987
|
-
}
|
|
5988
|
-
createActionDescriptors() {
|
|
5989
|
-
return this.route.snapshot.data['tableviewData'].actions ?? super.createActionDescriptors();
|
|
5990
|
-
}
|
|
5991
|
-
}
|
|
5992
|
-
MngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, deps: [{ token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
5993
|
-
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"] }] });
|
|
5994
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewRouteComponent, decorators: [{
|
|
5995
|
-
type: Component,
|
|
5996
|
-
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" }]
|
|
5997
|
-
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }]; } });
|
|
5998
|
-
|
|
5999
6618
|
function mngCommonsInitializerProvider(mngCommons) {
|
|
6000
6619
|
return () => mngCommons.initialize();
|
|
6001
6620
|
}
|
|
@@ -6103,6 +6722,11 @@ const formlyTypesConfig = [
|
|
|
6103
6722
|
component: MngFormlyFieldAutocompleteComponent,
|
|
6104
6723
|
wrappers: ['field']
|
|
6105
6724
|
},
|
|
6725
|
+
{
|
|
6726
|
+
name: 'dialog',
|
|
6727
|
+
component: MngFormlyFieldLookupDialogComponent,
|
|
6728
|
+
wrappers: ['field']
|
|
6729
|
+
},
|
|
6106
6730
|
{
|
|
6107
6731
|
name: 'table-dialog-multiselect',
|
|
6108
6732
|
component: MngFormlyFieldTableDialogMultiselectComponent,
|
|
@@ -6262,6 +6886,7 @@ const declarations = [
|
|
|
6262
6886
|
MngFormlyFieldInputComponent,
|
|
6263
6887
|
MngFormlyFieldDropdownComponent,
|
|
6264
6888
|
MngFormlyFieldAutocompleteComponent,
|
|
6889
|
+
MngFormlyFieldLookupDialogComponent,
|
|
6265
6890
|
MngFormlyFieldTableDialogMultiselectComponent,
|
|
6266
6891
|
MngFormlyFieldTableDialogFormComponent,
|
|
6267
6892
|
MngFormlyFieldTabsComponent,
|
|
@@ -6275,7 +6900,7 @@ const declarations = [
|
|
|
6275
6900
|
// editor components
|
|
6276
6901
|
MngFormEditorComponent,
|
|
6277
6902
|
MngActionComponent,
|
|
6278
|
-
|
|
6903
|
+
MngActionEditorComponent,
|
|
6279
6904
|
MngActionRouteComponent
|
|
6280
6905
|
];
|
|
6281
6906
|
class MngCommonsModule {
|
|
@@ -6287,12 +6912,12 @@ class MngCommonsModule {
|
|
|
6287
6912
|
DialogService,
|
|
6288
6913
|
MessageService,
|
|
6289
6914
|
ConfirmationService,
|
|
6290
|
-
|
|
6915
|
+
MngActionExecutorService,
|
|
6291
6916
|
MngNavigationService,
|
|
6292
6917
|
MngCommonsService,
|
|
6293
6918
|
// component service
|
|
6294
6919
|
MngMainLayoutComponentService,
|
|
6295
|
-
|
|
6920
|
+
MngViewContainerComponentService,
|
|
6296
6921
|
{
|
|
6297
6922
|
provide: MNG_MODULE_CONFIG_IT,
|
|
6298
6923
|
useValue: config
|
|
@@ -6323,6 +6948,10 @@ class MngCommonsModule {
|
|
|
6323
6948
|
multi: true,
|
|
6324
6949
|
useFactory: mngFormlyConfigProvider,
|
|
6325
6950
|
deps: [TranslateService, MNG_MODULE_CONFIG_IT]
|
|
6951
|
+
},
|
|
6952
|
+
{
|
|
6953
|
+
provide: ACTION_EDITOR_DIALOG_COMPONENT_SETTING,
|
|
6954
|
+
useValue: MngActionEditorComponent
|
|
6326
6955
|
}
|
|
6327
6956
|
]
|
|
6328
6957
|
};
|
|
@@ -6355,6 +6984,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
|
|
|
6355
6984
|
MngFormlyFieldInputComponent,
|
|
6356
6985
|
MngFormlyFieldDropdownComponent,
|
|
6357
6986
|
MngFormlyFieldAutocompleteComponent,
|
|
6987
|
+
MngFormlyFieldLookupDialogComponent,
|
|
6358
6988
|
MngFormlyFieldTableDialogMultiselectComponent,
|
|
6359
6989
|
MngFormlyFieldTableDialogFormComponent,
|
|
6360
6990
|
MngFormlyFieldTabsComponent,
|
|
@@ -6368,13 +6998,13 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
|
|
|
6368
6998
|
// editor components
|
|
6369
6999
|
MngFormEditorComponent,
|
|
6370
7000
|
MngActionComponent,
|
|
6371
|
-
|
|
7001
|
+
MngActionEditorComponent,
|
|
6372
7002
|
MngActionRouteComponent], imports: [
|
|
6373
7003
|
// angular modules
|
|
6374
7004
|
CommonModule,
|
|
6375
7005
|
RouterModule,
|
|
6376
7006
|
HttpClientModule,
|
|
6377
|
-
ReactiveFormsModule,
|
|
7007
|
+
ReactiveFormsModule, i3$1.TranslateModule, i3$2.FormlyModule, AutoCompleteModule,
|
|
6378
7008
|
BreadcrumbModule,
|
|
6379
7009
|
ButtonModule,
|
|
6380
7010
|
CalendarModule,
|
|
@@ -6466,6 +7096,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
|
|
|
6466
7096
|
MngFormlyFieldInputComponent,
|
|
6467
7097
|
MngFormlyFieldDropdownComponent,
|
|
6468
7098
|
MngFormlyFieldAutocompleteComponent,
|
|
7099
|
+
MngFormlyFieldLookupDialogComponent,
|
|
6469
7100
|
MngFormlyFieldTableDialogMultiselectComponent,
|
|
6470
7101
|
MngFormlyFieldTableDialogFormComponent,
|
|
6471
7102
|
MngFormlyFieldTabsComponent,
|
|
@@ -6479,7 +7110,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
|
|
|
6479
7110
|
// editor components
|
|
6480
7111
|
MngFormEditorComponent,
|
|
6481
7112
|
MngActionComponent,
|
|
6482
|
-
|
|
7113
|
+
MngActionEditorComponent,
|
|
6483
7114
|
MngActionRouteComponent] });
|
|
6484
7115
|
MngCommonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsModule, imports: [[
|
|
6485
7116
|
// angular modules
|
|
@@ -6555,54 +7186,59 @@ class AMngCrudApiService {
|
|
|
6555
7186
|
this.http = http;
|
|
6556
7187
|
this.objectSerializer = ObjectSerializer.get();
|
|
6557
7188
|
}
|
|
6558
|
-
createPost(item) {
|
|
7189
|
+
createPost(item, params) {
|
|
6559
7190
|
const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getCreatePostPath()}`;
|
|
6560
7191
|
return this.http
|
|
6561
7192
|
.post(url, this.objectSerializer.serializeClass(item, this.type), {
|
|
6562
7193
|
withCredentials: true,
|
|
6563
7194
|
observe: 'body',
|
|
6564
|
-
reportProgress: false
|
|
7195
|
+
reportProgress: false,
|
|
7196
|
+
params: params
|
|
6565
7197
|
})
|
|
6566
7198
|
.pipe(map(res => this.objectSerializer.deserializeClass(res, this.type)));
|
|
6567
7199
|
}
|
|
6568
|
-
getAllPost(
|
|
7200
|
+
getAllPost(queryParamBody, params) {
|
|
6569
7201
|
const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getGetAllPostPath()}`;
|
|
6570
7202
|
return this.http
|
|
6571
|
-
.post(url, this.objectSerializer.serialize(
|
|
7203
|
+
.post(url, this.objectSerializer.serialize(queryParamBody, 'QueryParam'), {
|
|
6572
7204
|
withCredentials: true,
|
|
6573
7205
|
observe: 'body',
|
|
6574
|
-
reportProgress: false
|
|
7206
|
+
reportProgress: false,
|
|
7207
|
+
params: params
|
|
6575
7208
|
})
|
|
6576
7209
|
.pipe(map(res => this.objectSerializer.deserializeClass(res, this.queryResultType)));
|
|
6577
7210
|
}
|
|
6578
|
-
getByIdGet(id) {
|
|
7211
|
+
getByIdGet(id, params) {
|
|
6579
7212
|
const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getGetByIdGetPath(id)}`;
|
|
6580
7213
|
return this.http
|
|
6581
7214
|
.get(url, {
|
|
6582
7215
|
withCredentials: true,
|
|
6583
7216
|
observe: 'body',
|
|
6584
|
-
reportProgress: false
|
|
7217
|
+
reportProgress: false,
|
|
7218
|
+
params: params
|
|
6585
7219
|
})
|
|
6586
7220
|
.pipe(map(res => this.objectSerializer.deserializeClass(res, this.type)));
|
|
6587
7221
|
}
|
|
6588
|
-
updatePut(id, item) {
|
|
7222
|
+
updatePut(id, item, params) {
|
|
6589
7223
|
const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getUpdatePutPath(id, item)}`;
|
|
6590
7224
|
return this.http
|
|
6591
7225
|
.put(url, this.objectSerializer.serializeClass(item, this.type), {
|
|
6592
7226
|
withCredentials: true,
|
|
6593
7227
|
observe: 'body',
|
|
6594
|
-
reportProgress: false
|
|
7228
|
+
reportProgress: false,
|
|
7229
|
+
params: params
|
|
6595
7230
|
})
|
|
6596
7231
|
.pipe(map(res => this.objectSerializer.deserializeClass(res, this.type)));
|
|
6597
7232
|
}
|
|
6598
|
-
removeDelete(id, item) {
|
|
7233
|
+
removeDelete(id, item, params) {
|
|
6599
7234
|
const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getRemoveDeletePath(id, item)}`;
|
|
6600
7235
|
return this.http
|
|
6601
7236
|
.request('delete', url, {
|
|
6602
7237
|
withCredentials: true,
|
|
6603
7238
|
observe: 'body',
|
|
6604
7239
|
reportProgress: false,
|
|
6605
|
-
body: this.objectSerializer.serializeClass(item, this.type)
|
|
7240
|
+
body: item ? this.objectSerializer.serializeClass(item, this.type) : undefined,
|
|
7241
|
+
params: params
|
|
6606
7242
|
})
|
|
6607
7243
|
.pipe(map(res => this.objectSerializer.deserializeClass(res, this.type)));
|
|
6608
7244
|
}
|
|
@@ -6653,12 +7289,30 @@ class RoutesBuilder {
|
|
|
6653
7289
|
constructor(layoutRoute) {
|
|
6654
7290
|
this.routes = [];
|
|
6655
7291
|
this.layoutRoute = layoutRoute?.withRoot(this);
|
|
7292
|
+
this.currentRoute = layoutRoute;
|
|
6656
7293
|
}
|
|
6657
7294
|
static create() {
|
|
6658
7295
|
return new RoutesBuilder();
|
|
6659
7296
|
}
|
|
6660
|
-
static createWithLayout(layoutComponent = MngMainLayoutComponent) {
|
|
6661
|
-
const
|
|
7297
|
+
static createWithLayout(layoutComponent = MngMainLayoutComponent, topbarComponent, breadcrumbComponent, menuComponent, footerComponent) {
|
|
7298
|
+
const layoutRoute = RouteBuilder.create('', layoutComponent);
|
|
7299
|
+
if (topbarComponent || breadcrumbComponent || menuComponent || footerComponent) {
|
|
7300
|
+
const dataBuilder = RouteDataBuilder.create();
|
|
7301
|
+
if (topbarComponent) {
|
|
7302
|
+
dataBuilder.withTopbarComponent(topbarComponent);
|
|
7303
|
+
}
|
|
7304
|
+
if (breadcrumbComponent) {
|
|
7305
|
+
dataBuilder.withBreadcrumbComponent(breadcrumbComponent);
|
|
7306
|
+
}
|
|
7307
|
+
if (menuComponent) {
|
|
7308
|
+
dataBuilder.withMenuComponent(menuComponent);
|
|
7309
|
+
}
|
|
7310
|
+
if (footerComponent) {
|
|
7311
|
+
dataBuilder.withFooterComponent(footerComponent);
|
|
7312
|
+
}
|
|
7313
|
+
layoutRoute.withDataBuilder(dataBuilder);
|
|
7314
|
+
}
|
|
7315
|
+
const routesBuilder = new RoutesBuilder(layoutRoute);
|
|
6662
7316
|
return routesBuilder;
|
|
6663
7317
|
}
|
|
6664
7318
|
addAngularRoute(route) {
|
|
@@ -6748,15 +7402,9 @@ class RouteBuilder {
|
|
|
6748
7402
|
static createFromRoute(route) {
|
|
6749
7403
|
return new RouteBuilder(route);
|
|
6750
7404
|
}
|
|
6751
|
-
static createTableviewRoutes(path, descriptor,
|
|
7405
|
+
static createTableviewRoutes(path, descriptor, dataProvider, actions, hasDetails = true, hasEdit = true, hasAdd = true) {
|
|
6752
7406
|
const tableviewRoute = RouteBuilder.createFromRoute({
|
|
6753
|
-
data:
|
|
6754
|
-
tableviewData: {
|
|
6755
|
-
descriptor: descriptor,
|
|
6756
|
-
dataProvider: tableviewDataProvider,
|
|
6757
|
-
actions: actions
|
|
6758
|
-
}
|
|
6759
|
-
},
|
|
7407
|
+
data: RouteDataBuilder.create().withTableview(descriptor, dataProvider, actions).build(),
|
|
6760
7408
|
path: path,
|
|
6761
7409
|
component: MngTableviewRouteComponent
|
|
6762
7410
|
});
|
|
@@ -6837,6 +7485,10 @@ class RouteBuilder {
|
|
|
6837
7485
|
this.route.data = data;
|
|
6838
7486
|
return this;
|
|
6839
7487
|
}
|
|
7488
|
+
withDataBuilder(dataBuilder) {
|
|
7489
|
+
this.route.data = dataBuilder.build();
|
|
7490
|
+
return this;
|
|
7491
|
+
}
|
|
6840
7492
|
withMngMenuItem(menuItem) {
|
|
6841
7493
|
this.menuItem = menuItem;
|
|
6842
7494
|
return this;
|
|
@@ -7006,6 +7658,54 @@ class RouteBuilder {
|
|
|
7006
7658
|
return guards;
|
|
7007
7659
|
}
|
|
7008
7660
|
}
|
|
7661
|
+
class RouteDataBuilder {
|
|
7662
|
+
constructor(init) {
|
|
7663
|
+
this.data = init ?? {};
|
|
7664
|
+
if (!this.data.breadcrumb) {
|
|
7665
|
+
this.data.breadcrumb = null;
|
|
7666
|
+
}
|
|
7667
|
+
}
|
|
7668
|
+
static create(data) {
|
|
7669
|
+
return new RouteDataBuilder(data);
|
|
7670
|
+
}
|
|
7671
|
+
withBreadcrumb(breadcrumb) {
|
|
7672
|
+
this.data.breadcrumb = breadcrumb;
|
|
7673
|
+
return this;
|
|
7674
|
+
}
|
|
7675
|
+
withPageTitle(pageTitle) {
|
|
7676
|
+
this.data.pageTitle = pageTitle;
|
|
7677
|
+
return this;
|
|
7678
|
+
}
|
|
7679
|
+
withTableview(descriptor, dataProvider, actions) {
|
|
7680
|
+
this.data.tableview = {
|
|
7681
|
+
descriptor: descriptor,
|
|
7682
|
+
dataProvider: dataProvider
|
|
7683
|
+
};
|
|
7684
|
+
if (actions) {
|
|
7685
|
+
this.data.tableview.actions = actions;
|
|
7686
|
+
}
|
|
7687
|
+
return this;
|
|
7688
|
+
}
|
|
7689
|
+
withTopbarComponent(component) {
|
|
7690
|
+
this.data.topbarComponent = component;
|
|
7691
|
+
return this;
|
|
7692
|
+
}
|
|
7693
|
+
withBreadcrumbComponent(component) {
|
|
7694
|
+
this.data.breadcrumbComponent = component;
|
|
7695
|
+
return this;
|
|
7696
|
+
}
|
|
7697
|
+
withMenuComponent(component) {
|
|
7698
|
+
this.data.menuComponent = component;
|
|
7699
|
+
return this;
|
|
7700
|
+
}
|
|
7701
|
+
withFooterComponent(component) {
|
|
7702
|
+
this.data.footerComponent = component;
|
|
7703
|
+
return this;
|
|
7704
|
+
}
|
|
7705
|
+
build() {
|
|
7706
|
+
return this.data;
|
|
7707
|
+
}
|
|
7708
|
+
}
|
|
7009
7709
|
|
|
7010
7710
|
/*
|
|
7011
7711
|
* Public API Surface of mng-commons
|
|
@@ -7015,5 +7715,5 @@ class RouteBuilder {
|
|
|
7015
7715
|
* Generated bundle index. Do not edit.
|
|
7016
7716
|
*/
|
|
7017
7717
|
|
|
7018
|
-
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,
|
|
7718
|
+
export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngCrudApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldDescriptor, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtil, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusQueryResultBase, MediusQueryResultWithObject, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngPropertyPathPipe, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, ModelDescriptor, ModelUtil, ObjectSerializer, RouteBuilder, RouteDataBuilder, RoutesBuilder, TableDataProvider, TableDescriptor, TableviewDataProvider, TableviewDescriptor, ToastUtil, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngCommonsInitializerProvider, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
|
|
7019
7719
|
//# sourceMappingURL=mediusinc-mng-commons.mjs.map
|