mis-crystal-design-system 18.1.6-test-1 → 18.1.6-test-3
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/dynamic-form/dynamic-form.component.d.ts +0 -15
- package/esm2022/dynamic-form/dynamic-form.component.mjs +99 -205
- package/esm2022/input/mis-input.component.mjs +19 -14
- package/esm2022/timerangepicker/timerangepicker.component.mjs +45 -3
- package/fesm2022/mis-crystal-design-system-dynamic-form.mjs +98 -204
- package/fesm2022/mis-crystal-design-system-dynamic-form.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-input.mjs +18 -13
- package/fesm2022/mis-crystal-design-system-input.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-timerangepicker.mjs +44 -2
- package/fesm2022/mis-crystal-design-system-timerangepicker.mjs.map +1 -1
- package/package.json +7 -7
- package/timerangepicker/timerangepicker.component.d.ts +2 -0
|
@@ -99,15 +99,19 @@ function DynamicFormComponent_ng_template_3_ng_container_0_ng_template_2_ng_cont
|
|
|
99
99
|
} if (rf & 2) {
|
|
100
100
|
const control_r10 = i0.ɵɵnextContext(3).control;
|
|
101
101
|
i0.ɵɵnextContext();
|
|
102
|
-
const
|
|
103
|
-
i0.ɵɵproperty("ngTemplateOutlet",
|
|
102
|
+
const dynamicFieldErrors_r13 = i0.ɵɵreference(6);
|
|
103
|
+
i0.ɵɵproperty("ngTemplateOutlet", dynamicFieldErrors_r13)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c13, control_r10.errors));
|
|
104
104
|
} }
|
|
105
105
|
function DynamicFormComponent_ng_template_3_ng_container_0_ng_template_2_Template(rf, ctx) { if (rf & 1) {
|
|
106
|
+
const _r12 = i0.ɵɵgetCurrentView();
|
|
106
107
|
i0.ɵɵelementStart(0, "div", 21)(1, "p", 22);
|
|
107
108
|
i0.ɵɵtext(2);
|
|
108
109
|
i0.ɵɵtemplate(3, DynamicFormComponent_ng_template_3_ng_container_0_ng_template_2_span_3_Template, 2, 0, "span", 19);
|
|
109
110
|
i0.ɵɵelementEnd();
|
|
110
|
-
i0.ɵɵelement(4, "div", 23)
|
|
111
|
+
i0.ɵɵelement(4, "div", 23);
|
|
112
|
+
i0.ɵɵelementStart(5, "input", 24);
|
|
113
|
+
i0.ɵɵlistener("ngModelChange", function DynamicFormComponent_ng_template_3_ng_container_0_ng_template_2_Template_input_ngModelChange_5_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r7 = i0.ɵɵnextContext(2); const field_r9 = ctx_r7.$implicit; const formgroup_r11 = ctx_r7.formGroup; const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r5.updateSubDynamicFields(field_r9, formgroup_r11, $event)); });
|
|
114
|
+
i0.ɵɵelementEnd();
|
|
111
115
|
i0.ɵɵtemplate(6, DynamicFormComponent_ng_template_3_ng_container_0_ng_template_2_ng_container_6_Template, 1, 4, "ng-container", 25);
|
|
112
116
|
i0.ɵɵelementEnd();
|
|
113
117
|
} if (rf & 2) {
|
|
@@ -131,10 +135,10 @@ function DynamicFormComponent_ng_template_3_ng_container_0_Template(rf, ctx) { i
|
|
|
131
135
|
i0.ɵɵtemplate(1, DynamicFormComponent_ng_template_3_ng_container_0_ng_container_1_Template, 2, 6, "ng-container", 20)(2, DynamicFormComponent_ng_template_3_ng_container_0_ng_template_2_Template, 7, 13, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor);
|
|
132
136
|
i0.ɵɵelementContainerEnd();
|
|
133
137
|
} if (rf & 2) {
|
|
134
|
-
const
|
|
138
|
+
const defaultInputTextNumber_r14 = i0.ɵɵreference(3);
|
|
135
139
|
const ctx_r5 = i0.ɵɵnextContext(2);
|
|
136
140
|
i0.ɵɵadvance();
|
|
137
|
-
i0.ɵɵproperty("ngIf", ctx_r5.customInputTextNumber)("ngIfElse",
|
|
141
|
+
i0.ɵɵproperty("ngIf", ctx_r5.customInputTextNumber)("ngIfElse", defaultInputTextNumber_r14);
|
|
138
142
|
} }
|
|
139
143
|
function DynamicFormComponent_ng_template_3_ng_container_1_ng_container_1_ng_template_1_Template(rf, ctx) { }
|
|
140
144
|
function DynamicFormComponent_ng_template_3_ng_container_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -160,15 +164,19 @@ function DynamicFormComponent_ng_template_3_ng_container_1_ng_template_2_ng_cont
|
|
|
160
164
|
} if (rf & 2) {
|
|
161
165
|
const control_r10 = i0.ɵɵnextContext(3).control;
|
|
162
166
|
i0.ɵɵnextContext();
|
|
163
|
-
const
|
|
164
|
-
i0.ɵɵproperty("ngTemplateOutlet",
|
|
167
|
+
const dynamicFieldErrors_r13 = i0.ɵɵreference(6);
|
|
168
|
+
i0.ɵɵproperty("ngTemplateOutlet", dynamicFieldErrors_r13)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c13, control_r10.errors));
|
|
165
169
|
} }
|
|
166
170
|
function DynamicFormComponent_ng_template_3_ng_container_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
|
|
171
|
+
const _r15 = i0.ɵɵgetCurrentView();
|
|
167
172
|
i0.ɵɵelementStart(0, "div", 21)(1, "p", 22);
|
|
168
173
|
i0.ɵɵtext(2);
|
|
169
174
|
i0.ɵɵtemplate(3, DynamicFormComponent_ng_template_3_ng_container_1_ng_template_2_span_3_Template, 2, 0, "span", 19);
|
|
170
175
|
i0.ɵɵelementEnd();
|
|
171
|
-
i0.ɵɵelement(4, "div", 23)
|
|
176
|
+
i0.ɵɵelement(4, "div", 23);
|
|
177
|
+
i0.ɵɵelementStart(5, "textarea", 26);
|
|
178
|
+
i0.ɵɵlistener("ngModelChange", function DynamicFormComponent_ng_template_3_ng_container_1_ng_template_2_Template_textarea_ngModelChange_5_listener($event) { i0.ɵɵrestoreView(_r15); const ctx_r7 = i0.ɵɵnextContext(2); const field_r9 = ctx_r7.$implicit; const formgroup_r11 = ctx_r7.formGroup; const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r5.updateSubDynamicFields(field_r9, formgroup_r11, $event)); });
|
|
179
|
+
i0.ɵɵelementEnd();
|
|
172
180
|
i0.ɵɵtemplate(6, DynamicFormComponent_ng_template_3_ng_container_1_ng_template_2_ng_container_6_Template, 1, 4, "ng-container", 25);
|
|
173
181
|
i0.ɵɵelementEnd();
|
|
174
182
|
} if (rf & 2) {
|
|
@@ -192,10 +200,10 @@ function DynamicFormComponent_ng_template_3_ng_container_1_Template(rf, ctx) { i
|
|
|
192
200
|
i0.ɵɵtemplate(1, DynamicFormComponent_ng_template_3_ng_container_1_ng_container_1_Template, 2, 6, "ng-container", 20)(2, DynamicFormComponent_ng_template_3_ng_container_1_ng_template_2_Template, 7, 11, "ng-template", null, 3, i0.ɵɵtemplateRefExtractor);
|
|
193
201
|
i0.ɵɵelementContainerEnd();
|
|
194
202
|
} if (rf & 2) {
|
|
195
|
-
const
|
|
203
|
+
const defaultInputTextarea_r16 = i0.ɵɵreference(3);
|
|
196
204
|
const ctx_r5 = i0.ɵɵnextContext(2);
|
|
197
205
|
i0.ɵɵadvance();
|
|
198
|
-
i0.ɵɵproperty("ngIf", ctx_r5.customInputTextarea)("ngIfElse",
|
|
206
|
+
i0.ɵɵproperty("ngIf", ctx_r5.customInputTextarea)("ngIfElse", defaultInputTextarea_r16);
|
|
199
207
|
} }
|
|
200
208
|
function DynamicFormComponent_ng_template_3_ng_container_2_ng_container_1_ng_template_1_Template(rf, ctx) { }
|
|
201
209
|
function DynamicFormComponent_ng_template_3_ng_container_2_ng_container_1_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -217,9 +225,9 @@ function DynamicFormComponent_ng_template_3_ng_container_2_ng_template_2_div_0_s
|
|
|
217
225
|
i0.ɵɵelementEnd();
|
|
218
226
|
} }
|
|
219
227
|
function DynamicFormComponent_ng_template_3_ng_container_2_ng_template_2_div_0_img_7_Template(rf, ctx) { if (rf & 1) {
|
|
220
|
-
const
|
|
228
|
+
const _r18 = i0.ɵɵgetCurrentView();
|
|
221
229
|
i0.ɵɵelementStart(0, "img", 33);
|
|
222
|
-
i0.ɵɵlistener("click", function DynamicFormComponent_ng_template_3_ng_container_2_ng_template_2_div_0_img_7_Template_img_click_0_listener() { i0.ɵɵrestoreView(
|
|
230
|
+
i0.ɵɵlistener("click", function DynamicFormComponent_ng_template_3_ng_container_2_ng_template_2_div_0_img_7_Template_img_click_0_listener() { i0.ɵɵrestoreView(_r18); i0.ɵɵnextContext(); const dp_r19 = i0.ɵɵreference(6); return i0.ɵɵresetView(dp_r19.click()); });
|
|
223
231
|
i0.ɵɵelementEnd();
|
|
224
232
|
} if (rf & 2) {
|
|
225
233
|
const ctx_r5 = i0.ɵɵnextContext(5);
|
|
@@ -230,17 +238,17 @@ function DynamicFormComponent_ng_template_3_ng_container_2_ng_template_2_div_0_n
|
|
|
230
238
|
} if (rf & 2) {
|
|
231
239
|
const control_r10 = i0.ɵɵnextContext(4).control;
|
|
232
240
|
i0.ɵɵnextContext();
|
|
233
|
-
const
|
|
234
|
-
i0.ɵɵproperty("ngTemplateOutlet",
|
|
241
|
+
const dynamicFieldErrors_r13 = i0.ɵɵreference(6);
|
|
242
|
+
i0.ɵɵproperty("ngTemplateOutlet", dynamicFieldErrors_r13)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c13, control_r10.errors));
|
|
235
243
|
} }
|
|
236
244
|
function DynamicFormComponent_ng_template_3_ng_container_2_ng_template_2_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
237
|
-
const
|
|
245
|
+
const _r17 = i0.ɵɵgetCurrentView();
|
|
238
246
|
i0.ɵɵelementStart(0, "div", 28)(1, "p", 29);
|
|
239
247
|
i0.ɵɵtext(2);
|
|
240
248
|
i0.ɵɵtemplate(3, DynamicFormComponent_ng_template_3_ng_container_2_ng_template_2_div_0_span_3_Template, 2, 0, "span", 19);
|
|
241
249
|
i0.ɵɵelementEnd();
|
|
242
250
|
i0.ɵɵelementStart(4, "div", 30)(5, "input", 31, 5);
|
|
243
|
-
i0.ɵɵlistener("dateChange", function DynamicFormComponent_ng_template_3_ng_container_2_ng_template_2_div_0_Template_input_dateChange_5_listener($event) { i0.ɵɵrestoreView(
|
|
251
|
+
i0.ɵɵlistener("dateChange", function DynamicFormComponent_ng_template_3_ng_container_2_ng_template_2_div_0_Template_input_dateChange_5_listener($event) { i0.ɵɵrestoreView(_r17); const control_r10 = i0.ɵɵnextContext(3).control; return i0.ɵɵresetView(control_r10.setValue($event)); });
|
|
244
252
|
i0.ɵɵelementEnd();
|
|
245
253
|
i0.ɵɵtemplate(7, DynamicFormComponent_ng_template_3_ng_container_2_ng_template_2_div_0_img_7_Template, 1, 1, "img", 32);
|
|
246
254
|
i0.ɵɵelementEnd();
|
|
@@ -275,10 +283,10 @@ function DynamicFormComponent_ng_template_3_ng_container_2_Template(rf, ctx) { i
|
|
|
275
283
|
i0.ɵɵtemplate(1, DynamicFormComponent_ng_template_3_ng_container_2_ng_container_1_Template, 2, 6, "ng-container", 20)(2, DynamicFormComponent_ng_template_3_ng_container_2_ng_template_2_Template, 1, 1, "ng-template", null, 4, i0.ɵɵtemplateRefExtractor);
|
|
276
284
|
i0.ɵɵelementContainerEnd();
|
|
277
285
|
} if (rf & 2) {
|
|
278
|
-
const
|
|
286
|
+
const defaultInputDate_r20 = i0.ɵɵreference(3);
|
|
279
287
|
const ctx_r5 = i0.ɵɵnextContext(2);
|
|
280
288
|
i0.ɵɵadvance();
|
|
281
|
-
i0.ɵɵproperty("ngIf", ctx_r5.customInputDate)("ngIfElse",
|
|
289
|
+
i0.ɵɵproperty("ngIf", ctx_r5.customInputDate)("ngIfElse", defaultInputDate_r20);
|
|
282
290
|
} }
|
|
283
291
|
function DynamicFormComponent_ng_template_3_ng_container_3_ng_container_1_ng_template_1_Template(rf, ctx) { }
|
|
284
292
|
function DynamicFormComponent_ng_template_3_ng_container_3_ng_container_1_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -304,17 +312,17 @@ function DynamicFormComponent_ng_template_3_ng_container_3_ng_template_2_ng_cont
|
|
|
304
312
|
} if (rf & 2) {
|
|
305
313
|
const control_r10 = i0.ɵɵnextContext(3).control;
|
|
306
314
|
i0.ɵɵnextContext();
|
|
307
|
-
const
|
|
308
|
-
i0.ɵɵproperty("ngTemplateOutlet",
|
|
315
|
+
const dynamicFieldErrors_r13 = i0.ɵɵreference(6);
|
|
316
|
+
i0.ɵɵproperty("ngTemplateOutlet", dynamicFieldErrors_r13)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c13, control_r10.errors));
|
|
309
317
|
} }
|
|
310
318
|
function DynamicFormComponent_ng_template_3_ng_container_3_ng_template_2_Template(rf, ctx) { if (rf & 1) {
|
|
311
|
-
const
|
|
319
|
+
const _r21 = i0.ɵɵgetCurrentView();
|
|
312
320
|
i0.ɵɵelementStart(0, "div", 28)(1, "p", 29);
|
|
313
321
|
i0.ɵɵtext(2);
|
|
314
322
|
i0.ɵɵtemplate(3, DynamicFormComponent_ng_template_3_ng_container_3_ng_template_2_span_3_Template, 2, 0, "span", 19);
|
|
315
323
|
i0.ɵɵelementEnd();
|
|
316
324
|
i0.ɵɵelementStart(4, "mis-switch", 34);
|
|
317
|
-
i0.ɵɵlistener("valueChanged", function DynamicFormComponent_ng_template_3_ng_container_3_ng_template_2_Template_mis_switch_valueChanged_4_listener($event) { i0.ɵɵrestoreView(
|
|
325
|
+
i0.ɵɵlistener("valueChanged", function DynamicFormComponent_ng_template_3_ng_container_3_ng_template_2_Template_mis_switch_valueChanged_4_listener($event) { i0.ɵɵrestoreView(_r21); const ctx_r7 = i0.ɵɵnextContext(2); const field_r9 = ctx_r7.$implicit; const formgroup_r11 = ctx_r7.formGroup; const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r5.updateSubDynamicFields(field_r9, formgroup_r11, $event)); });
|
|
318
326
|
i0.ɵɵelementEnd();
|
|
319
327
|
i0.ɵɵtemplate(5, DynamicFormComponent_ng_template_3_ng_container_3_ng_template_2_ng_container_5_Template, 1, 4, "ng-container", 25);
|
|
320
328
|
i0.ɵɵelementEnd();
|
|
@@ -339,10 +347,10 @@ function DynamicFormComponent_ng_template_3_ng_container_3_Template(rf, ctx) { i
|
|
|
339
347
|
i0.ɵɵtemplate(1, DynamicFormComponent_ng_template_3_ng_container_3_ng_container_1_Template, 2, 6, "ng-container", 20)(2, DynamicFormComponent_ng_template_3_ng_container_3_ng_template_2_Template, 6, 7, "ng-template", null, 6, i0.ɵɵtemplateRefExtractor);
|
|
340
348
|
i0.ɵɵelementContainerEnd();
|
|
341
349
|
} if (rf & 2) {
|
|
342
|
-
const
|
|
350
|
+
const defaultBooleanToggle_r22 = i0.ɵɵreference(3);
|
|
343
351
|
const ctx_r5 = i0.ɵɵnextContext(2);
|
|
344
352
|
i0.ɵɵadvance();
|
|
345
|
-
i0.ɵɵproperty("ngIf", ctx_r5.customBooleanToggle)("ngIfElse",
|
|
353
|
+
i0.ɵɵproperty("ngIf", ctx_r5.customBooleanToggle)("ngIfElse", defaultBooleanToggle_r22);
|
|
346
354
|
} }
|
|
347
355
|
function DynamicFormComponent_ng_template_3_ng_container_4_ng_container_1_ng_template_1_Template(rf, ctx) { }
|
|
348
356
|
function DynamicFormComponent_ng_template_3_ng_container_4_ng_container_1_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -364,9 +372,9 @@ function DynamicFormComponent_ng_template_3_ng_container_4_ng_template_2_span_3_
|
|
|
364
372
|
i0.ɵɵelementEnd();
|
|
365
373
|
} }
|
|
366
374
|
function DynamicFormComponent_ng_template_3_ng_container_4_ng_template_2_img_6_Template(rf, ctx) { if (rf & 1) {
|
|
367
|
-
const
|
|
375
|
+
const _r24 = i0.ɵɵgetCurrentView();
|
|
368
376
|
i0.ɵɵelementStart(0, "img", 38);
|
|
369
|
-
i0.ɵɵlistener("click", function DynamicFormComponent_ng_template_3_ng_container_4_ng_template_2_img_6_Template_img_click_0_listener() { i0.ɵɵrestoreView(
|
|
377
|
+
i0.ɵɵlistener("click", function DynamicFormComponent_ng_template_3_ng_container_4_ng_template_2_img_6_Template_img_click_0_listener() { i0.ɵɵrestoreView(_r24); const field_r9 = i0.ɵɵnextContext(3).$implicit; const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r5.fieldRemoved.emit(field_r9)); });
|
|
370
378
|
i0.ɵɵelementEnd();
|
|
371
379
|
} if (rf & 2) {
|
|
372
380
|
const ctx_r5 = i0.ɵɵnextContext(4);
|
|
@@ -377,17 +385,17 @@ function DynamicFormComponent_ng_template_3_ng_container_4_ng_template_2_ng_cont
|
|
|
377
385
|
} if (rf & 2) {
|
|
378
386
|
const control_r10 = i0.ɵɵnextContext(3).control;
|
|
379
387
|
i0.ɵɵnextContext();
|
|
380
|
-
const
|
|
381
|
-
i0.ɵɵproperty("ngTemplateOutlet",
|
|
388
|
+
const dynamicFieldErrors_r13 = i0.ɵɵreference(6);
|
|
389
|
+
i0.ɵɵproperty("ngTemplateOutlet", dynamicFieldErrors_r13)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c13, control_r10.errors));
|
|
382
390
|
} }
|
|
383
391
|
function DynamicFormComponent_ng_template_3_ng_container_4_ng_template_2_Template(rf, ctx) { if (rf & 1) {
|
|
384
|
-
const
|
|
392
|
+
const _r23 = i0.ɵɵgetCurrentView();
|
|
385
393
|
i0.ɵɵelementStart(0, "div", 28)(1, "p", 29);
|
|
386
394
|
i0.ɵɵtext(2);
|
|
387
395
|
i0.ɵɵtemplate(3, DynamicFormComponent_ng_template_3_ng_container_4_ng_template_2_span_3_Template, 2, 0, "span", 19);
|
|
388
396
|
i0.ɵɵelementEnd();
|
|
389
397
|
i0.ɵɵelementStart(4, "div", 35)(5, "mis-dropdown", 36);
|
|
390
|
-
i0.ɵɵlistener("onChange", function DynamicFormComponent_ng_template_3_ng_container_4_ng_template_2_Template_mis_dropdown_onChange_5_listener($event) { i0.ɵɵrestoreView(
|
|
398
|
+
i0.ɵɵlistener("onChange", function DynamicFormComponent_ng_template_3_ng_container_4_ng_template_2_Template_mis_dropdown_onChange_5_listener($event) { i0.ɵɵrestoreView(_r23); const ctx_r7 = i0.ɵɵnextContext(2); const field_r9 = ctx_r7.$implicit; const control_r10 = ctx_r7.control; const formgroup_r11 = ctx_r7.formGroup; const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r5.updateSelectedValueForSingleSelect(field_r9, control_r10, formgroup_r11, $event)); });
|
|
391
399
|
i0.ɵɵelementEnd();
|
|
392
400
|
i0.ɵɵtemplate(6, DynamicFormComponent_ng_template_3_ng_container_4_ng_template_2_img_6_Template, 1, 1, "img", 37);
|
|
393
401
|
i0.ɵɵelementEnd();
|
|
@@ -418,10 +426,10 @@ function DynamicFormComponent_ng_template_3_ng_container_4_Template(rf, ctx) { i
|
|
|
418
426
|
i0.ɵɵtemplate(1, DynamicFormComponent_ng_template_3_ng_container_4_ng_container_1_Template, 2, 6, "ng-container", 20)(2, DynamicFormComponent_ng_template_3_ng_container_4_ng_template_2_Template, 8, 14, "ng-template", null, 7, i0.ɵɵtemplateRefExtractor);
|
|
419
427
|
i0.ɵɵelementContainerEnd();
|
|
420
428
|
} if (rf & 2) {
|
|
421
|
-
const
|
|
429
|
+
const defaultSingleSelectDropdown_r25 = i0.ɵɵreference(3);
|
|
422
430
|
const ctx_r5 = i0.ɵɵnextContext(2);
|
|
423
431
|
i0.ɵɵadvance();
|
|
424
|
-
i0.ɵɵproperty("ngIf", ctx_r5.customSingleSelectDropdown)("ngIfElse",
|
|
432
|
+
i0.ɵɵproperty("ngIf", ctx_r5.customSingleSelectDropdown)("ngIfElse", defaultSingleSelectDropdown_r25);
|
|
425
433
|
} }
|
|
426
434
|
function DynamicFormComponent_ng_template_3_ng_container_5_ng_container_1_ng_template_1_Template(rf, ctx) { }
|
|
427
435
|
function DynamicFormComponent_ng_template_3_ng_container_5_ng_container_1_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -449,30 +457,30 @@ function DynamicFormComponent_ng_template_3_ng_container_5_ng_template_2_div_6_i
|
|
|
449
457
|
i0.ɵɵproperty("src", ctx_r5.activeBtnIconUrl(), i0.ɵɵsanitizeUrl);
|
|
450
458
|
} }
|
|
451
459
|
function DynamicFormComponent_ng_template_3_ng_container_5_ng_template_2_div_6_Template(rf, ctx) { if (rf & 1) {
|
|
452
|
-
const
|
|
460
|
+
const _r26 = i0.ɵɵgetCurrentView();
|
|
453
461
|
i0.ɵɵelementStart(0, "div", 41);
|
|
454
|
-
i0.ɵɵlistener("click", function DynamicFormComponent_ng_template_3_ng_container_5_ng_template_2_div_6_Template_div_click_0_listener() { const
|
|
462
|
+
i0.ɵɵlistener("click", function DynamicFormComponent_ng_template_3_ng_container_5_ng_template_2_div_6_Template_div_click_0_listener() { const item_r27 = i0.ɵɵrestoreView(_r26).$implicit; const ctx_r7 = i0.ɵɵnextContext(3); const field_r9 = ctx_r7.$implicit; const control_r10 = ctx_r7.control; const formgroup_r11 = ctx_r7.formGroup; const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r5.updateSelectedValueForSingleSelect(field_r9, control_r10, formgroup_r11, item_r27)); });
|
|
455
463
|
i0.ɵɵtemplate(1, DynamicFormComponent_ng_template_3_ng_container_5_ng_template_2_div_6_img_1_Template, 1, 1, "img", 42);
|
|
456
464
|
i0.ɵɵelementStart(2, "p", 29);
|
|
457
465
|
i0.ɵɵtext(3);
|
|
458
466
|
i0.ɵɵelementEnd()();
|
|
459
467
|
} if (rf & 2) {
|
|
460
|
-
const
|
|
468
|
+
const item_r27 = ctx.$implicit;
|
|
461
469
|
const control_r10 = i0.ɵɵnextContext(3).control;
|
|
462
470
|
const ctx_r5 = i0.ɵɵnextContext();
|
|
463
|
-
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c15,
|
|
471
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c15, item_r27.label === (control_r10.value == null ? null : control_r10.value.label)));
|
|
464
472
|
i0.ɵɵadvance();
|
|
465
|
-
i0.ɵɵproperty("ngIf",
|
|
473
|
+
i0.ɵɵproperty("ngIf", item_r27.label === (control_r10.value == null ? null : control_r10.value.label) && ctx_r5.activeBtnIconUrl());
|
|
466
474
|
i0.ɵɵadvance(2);
|
|
467
|
-
i0.ɵɵtextInterpolate(
|
|
475
|
+
i0.ɵɵtextInterpolate(item_r27.label);
|
|
468
476
|
} }
|
|
469
477
|
function DynamicFormComponent_ng_template_3_ng_container_5_ng_template_2_ng_container_7_Template(rf, ctx) { if (rf & 1) {
|
|
470
478
|
i0.ɵɵelementContainer(0, 15);
|
|
471
479
|
} if (rf & 2) {
|
|
472
480
|
const control_r10 = i0.ɵɵnextContext(3).control;
|
|
473
481
|
i0.ɵɵnextContext();
|
|
474
|
-
const
|
|
475
|
-
i0.ɵɵproperty("ngTemplateOutlet",
|
|
482
|
+
const dynamicFieldErrors_r13 = i0.ɵɵreference(6);
|
|
483
|
+
i0.ɵɵproperty("ngTemplateOutlet", dynamicFieldErrors_r13)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c13, control_r10.errors));
|
|
476
484
|
} }
|
|
477
485
|
function DynamicFormComponent_ng_template_3_ng_container_5_ng_template_2_Template(rf, ctx) { if (rf & 1) {
|
|
478
486
|
i0.ɵɵelementStart(0, "div", 21)(1, "p", 22);
|
|
@@ -506,10 +514,10 @@ function DynamicFormComponent_ng_template_3_ng_container_5_Template(rf, ctx) { i
|
|
|
506
514
|
i0.ɵɵtemplate(1, DynamicFormComponent_ng_template_3_ng_container_5_ng_container_1_Template, 2, 6, "ng-container", 20)(2, DynamicFormComponent_ng_template_3_ng_container_5_ng_template_2_Template, 8, 7, "ng-template", null, 8, i0.ɵɵtemplateRefExtractor);
|
|
507
515
|
i0.ɵɵelementContainerEnd();
|
|
508
516
|
} if (rf & 2) {
|
|
509
|
-
const
|
|
517
|
+
const defaultSingleSelectRadio_r28 = i0.ɵɵreference(3);
|
|
510
518
|
const ctx_r5 = i0.ɵɵnextContext(2);
|
|
511
519
|
i0.ɵɵadvance();
|
|
512
|
-
i0.ɵɵproperty("ngIf", ctx_r5.customSingleSelectRadio)("ngIfElse",
|
|
520
|
+
i0.ɵɵproperty("ngIf", ctx_r5.customSingleSelectRadio)("ngIfElse", defaultSingleSelectRadio_r28);
|
|
513
521
|
} }
|
|
514
522
|
function DynamicFormComponent_ng_template_3_ng_container_6_ng_container_1_ng_template_1_Template(rf, ctx) { }
|
|
515
523
|
function DynamicFormComponent_ng_template_3_ng_container_6_ng_container_1_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -537,30 +545,30 @@ function DynamicFormComponent_ng_template_3_ng_container_6_ng_template_2_div_6_i
|
|
|
537
545
|
i0.ɵɵproperty("src", ctx_r5.activeBtnIconUrl(), i0.ɵɵsanitizeUrl);
|
|
538
546
|
} }
|
|
539
547
|
function DynamicFormComponent_ng_template_3_ng_container_6_ng_template_2_div_6_Template(rf, ctx) { if (rf & 1) {
|
|
540
|
-
const
|
|
548
|
+
const _r29 = i0.ɵɵgetCurrentView();
|
|
541
549
|
i0.ɵɵelementStart(0, "div", 41);
|
|
542
|
-
i0.ɵɵlistener("click", function DynamicFormComponent_ng_template_3_ng_container_6_ng_template_2_div_6_Template_div_click_0_listener() { const
|
|
550
|
+
i0.ɵɵlistener("click", function DynamicFormComponent_ng_template_3_ng_container_6_ng_template_2_div_6_Template_div_click_0_listener() { const item_r30 = i0.ɵɵrestoreView(_r29).$implicit; const ctx_r7 = i0.ɵɵnextContext(3); const field_r9 = ctx_r7.$implicit; const control_r10 = ctx_r7.control; const formgroup_r11 = ctx_r7.formGroup; const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r5.updateSelectedValueForMultiSelect(field_r9, control_r10, formgroup_r11, [item_r30])); });
|
|
543
551
|
i0.ɵɵtemplate(1, DynamicFormComponent_ng_template_3_ng_container_6_ng_template_2_div_6_img_1_Template, 1, 1, "img", 42);
|
|
544
552
|
i0.ɵɵelementStart(2, "p", 29);
|
|
545
553
|
i0.ɵɵtext(3);
|
|
546
554
|
i0.ɵɵelementEnd()();
|
|
547
555
|
} if (rf & 2) {
|
|
548
|
-
const
|
|
556
|
+
const item_r30 = ctx.$implicit;
|
|
549
557
|
const control_r10 = i0.ɵɵnextContext(3).control;
|
|
550
558
|
const ctx_r5 = i0.ɵɵnextContext();
|
|
551
|
-
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c15, ctx_r5.isCheckBoxSelected(
|
|
559
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c15, ctx_r5.isCheckBoxSelected(item_r30.label, control_r10.value)));
|
|
552
560
|
i0.ɵɵadvance();
|
|
553
|
-
i0.ɵɵproperty("ngIf", ctx_r5.isCheckBoxSelected(
|
|
561
|
+
i0.ɵɵproperty("ngIf", ctx_r5.isCheckBoxSelected(item_r30.label, control_r10.value) && ctx_r5.activeBtnIconUrl());
|
|
554
562
|
i0.ɵɵadvance(2);
|
|
555
|
-
i0.ɵɵtextInterpolate(
|
|
563
|
+
i0.ɵɵtextInterpolate(item_r30.label);
|
|
556
564
|
} }
|
|
557
565
|
function DynamicFormComponent_ng_template_3_ng_container_6_ng_template_2_ng_container_7_Template(rf, ctx) { if (rf & 1) {
|
|
558
566
|
i0.ɵɵelementContainer(0, 15);
|
|
559
567
|
} if (rf & 2) {
|
|
560
568
|
const control_r10 = i0.ɵɵnextContext(3).control;
|
|
561
569
|
i0.ɵɵnextContext();
|
|
562
|
-
const
|
|
563
|
-
i0.ɵɵproperty("ngTemplateOutlet",
|
|
570
|
+
const dynamicFieldErrors_r13 = i0.ɵɵreference(6);
|
|
571
|
+
i0.ɵɵproperty("ngTemplateOutlet", dynamicFieldErrors_r13)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c13, control_r10.errors));
|
|
564
572
|
} }
|
|
565
573
|
function DynamicFormComponent_ng_template_3_ng_container_6_ng_template_2_Template(rf, ctx) { if (rf & 1) {
|
|
566
574
|
i0.ɵɵelementStart(0, "div", 21)(1, "p", 22);
|
|
@@ -594,10 +602,10 @@ function DynamicFormComponent_ng_template_3_ng_container_6_Template(rf, ctx) { i
|
|
|
594
602
|
i0.ɵɵtemplate(1, DynamicFormComponent_ng_template_3_ng_container_6_ng_container_1_Template, 2, 6, "ng-container", 20)(2, DynamicFormComponent_ng_template_3_ng_container_6_ng_template_2_Template, 8, 7, "ng-template", null, 9, i0.ɵɵtemplateRefExtractor);
|
|
595
603
|
i0.ɵɵelementContainerEnd();
|
|
596
604
|
} if (rf & 2) {
|
|
597
|
-
const
|
|
605
|
+
const defaultMultiSelectCheckbox_r31 = i0.ɵɵreference(3);
|
|
598
606
|
const ctx_r5 = i0.ɵɵnextContext(2);
|
|
599
607
|
i0.ɵɵadvance();
|
|
600
|
-
i0.ɵɵproperty("ngIf", ctx_r5.customMultiSelectCheckbox)("ngIfElse",
|
|
608
|
+
i0.ɵɵproperty("ngIf", ctx_r5.customMultiSelectCheckbox)("ngIfElse", defaultMultiSelectCheckbox_r31);
|
|
601
609
|
} }
|
|
602
610
|
function DynamicFormComponent_ng_template_3_ng_container_7_ng_container_1_ng_template_1_Template(rf, ctx) { }
|
|
603
611
|
function DynamicFormComponent_ng_template_3_ng_container_7_ng_container_1_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -623,17 +631,17 @@ function DynamicFormComponent_ng_template_3_ng_container_7_ng_template_2_ng_cont
|
|
|
623
631
|
} if (rf & 2) {
|
|
624
632
|
const control_r10 = i0.ɵɵnextContext(3).control;
|
|
625
633
|
i0.ɵɵnextContext();
|
|
626
|
-
const
|
|
627
|
-
i0.ɵɵproperty("ngTemplateOutlet",
|
|
634
|
+
const dynamicFieldErrors_r13 = i0.ɵɵreference(6);
|
|
635
|
+
i0.ɵɵproperty("ngTemplateOutlet", dynamicFieldErrors_r13)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c13, control_r10.errors));
|
|
628
636
|
} }
|
|
629
637
|
function DynamicFormComponent_ng_template_3_ng_container_7_ng_template_2_Template(rf, ctx) { if (rf & 1) {
|
|
630
|
-
const
|
|
638
|
+
const _r32 = i0.ɵɵgetCurrentView();
|
|
631
639
|
i0.ɵɵelementStart(0, "div", 28)(1, "p", 29);
|
|
632
640
|
i0.ɵɵtext(2);
|
|
633
641
|
i0.ɵɵtemplate(3, DynamicFormComponent_ng_template_3_ng_container_7_ng_template_2_span_3_Template, 2, 0, "span", 19);
|
|
634
642
|
i0.ɵɵelementEnd();
|
|
635
643
|
i0.ɵɵelementStart(4, "mis-multi-select-dropdown", 44);
|
|
636
|
-
i0.ɵɵlistener("onChange", function DynamicFormComponent_ng_template_3_ng_container_7_ng_template_2_Template_mis_multi_select_dropdown_onChange_4_listener($event) { i0.ɵɵrestoreView(
|
|
644
|
+
i0.ɵɵlistener("onChange", function DynamicFormComponent_ng_template_3_ng_container_7_ng_template_2_Template_mis_multi_select_dropdown_onChange_4_listener($event) { i0.ɵɵrestoreView(_r32); const ctx_r7 = i0.ɵɵnextContext(2); const field_r9 = ctx_r7.$implicit; const control_r10 = ctx_r7.control; const formgroup_r11 = ctx_r7.formGroup; const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r5.updateSelectedValueForMultiSelect(field_r9, control_r10, formgroup_r11, $event)); });
|
|
637
645
|
i0.ɵɵelementEnd();
|
|
638
646
|
i0.ɵɵtemplate(5, DynamicFormComponent_ng_template_3_ng_container_7_ng_template_2_ng_container_5_Template, 1, 4, "ng-container", 25);
|
|
639
647
|
i0.ɵɵelementEnd();
|
|
@@ -658,10 +666,10 @@ function DynamicFormComponent_ng_template_3_ng_container_7_Template(rf, ctx) { i
|
|
|
658
666
|
i0.ɵɵtemplate(1, DynamicFormComponent_ng_template_3_ng_container_7_ng_container_1_Template, 2, 6, "ng-container", 20)(2, DynamicFormComponent_ng_template_3_ng_container_7_ng_template_2_Template, 6, 13, "ng-template", null, 10, i0.ɵɵtemplateRefExtractor);
|
|
659
667
|
i0.ɵɵelementContainerEnd();
|
|
660
668
|
} if (rf & 2) {
|
|
661
|
-
const
|
|
669
|
+
const defaultMultiSelectDropdown_r33 = i0.ɵɵreference(3);
|
|
662
670
|
const ctx_r5 = i0.ɵɵnextContext(2);
|
|
663
671
|
i0.ɵɵadvance();
|
|
664
|
-
i0.ɵɵproperty("ngIf", ctx_r5.customMultiSelectDropdown)("ngIfElse",
|
|
672
|
+
i0.ɵɵproperty("ngIf", ctx_r5.customMultiSelectDropdown)("ngIfElse", defaultMultiSelectDropdown_r33);
|
|
665
673
|
} }
|
|
666
674
|
function DynamicFormComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) {
|
|
667
675
|
i0.ɵɵtemplate(0, DynamicFormComponent_ng_template_3_ng_container_0_Template, 4, 2, "ng-container", 19)(1, DynamicFormComponent_ng_template_3_ng_container_1_Template, 4, 2, "ng-container", 19)(2, DynamicFormComponent_ng_template_3_ng_container_2_Template, 4, 2, "ng-container", 19)(3, DynamicFormComponent_ng_template_3_ng_container_3_Template, 4, 2, "ng-container", 19)(4, DynamicFormComponent_ng_template_3_ng_container_4_Template, 4, 2, "ng-container", 19)(5, DynamicFormComponent_ng_template_3_ng_container_5_Template, 4, 2, "ng-container", 19)(6, DynamicFormComponent_ng_template_3_ng_container_6_Template, 4, 2, "ng-container", 19)(7, DynamicFormComponent_ng_template_3_ng_container_7_Template, 4, 2, "ng-container", 19);
|
|
@@ -691,9 +699,9 @@ function DynamicFormComponent_ng_template_5_ng_container_1_Template(rf, ctx) { i
|
|
|
691
699
|
i0.ɵɵelement(3, "div", 47);
|
|
692
700
|
i0.ɵɵelementContainerEnd();
|
|
693
701
|
} if (rf & 2) {
|
|
694
|
-
const
|
|
702
|
+
const error_r34 = ctx.$implicit;
|
|
695
703
|
i0.ɵɵadvance(2);
|
|
696
|
-
i0.ɵɵtextInterpolate1(" ", " \u2022 \u00A0" +
|
|
704
|
+
i0.ɵɵtextInterpolate1(" ", " \u2022 \u00A0" + error_r34.value, " ");
|
|
697
705
|
i0.ɵɵadvance();
|
|
698
706
|
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction0(2, _c16));
|
|
699
707
|
} }
|
|
@@ -703,9 +711,9 @@ function DynamicFormComponent_ng_template_5_Template(rf, ctx) { if (rf & 1) {
|
|
|
703
711
|
i0.ɵɵpipe(2, "keyvalue");
|
|
704
712
|
i0.ɵɵelementEnd();
|
|
705
713
|
} if (rf & 2) {
|
|
706
|
-
const
|
|
714
|
+
const errors_r35 = ctx.$implicit;
|
|
707
715
|
i0.ɵɵadvance();
|
|
708
|
-
i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(2, 1,
|
|
716
|
+
i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(2, 1, errors_r35));
|
|
709
717
|
} }
|
|
710
718
|
dayjs.extend(timezone);
|
|
711
719
|
dayjs.extend(customParseFormat);
|
|
@@ -714,6 +722,7 @@ class DynamicFormComponent {
|
|
|
714
722
|
get formFieldsArray() {
|
|
715
723
|
return this.formFields();
|
|
716
724
|
}
|
|
725
|
+
// dynamic-form.component.ts (in constructor)
|
|
717
726
|
constructor() {
|
|
718
727
|
/**
|
|
719
728
|
* formFields: Dynamic fields recieved from the API metadata to build a dynamic form
|
|
@@ -747,50 +756,25 @@ class DynamicFormComponent {
|
|
|
747
756
|
this.dynamicFormSignal = signal(null);
|
|
748
757
|
this.dynamicFormAPISignal = signal(null);
|
|
749
758
|
this.valueChangesSubscriptionSignal = signal(null);
|
|
750
|
-
this.previousFormFields = null;
|
|
751
|
-
this.isInternalUpdate = false; // Flag to prevent regeneration during internal updates
|
|
752
759
|
// Computed properties for template access
|
|
753
760
|
this.dynamicForm = computed(() => this.dynamicFormSignal());
|
|
754
761
|
this.dynamicFormAPI = computed(() => this.dynamicFormAPISignal());
|
|
755
762
|
this.valueChangesSubscription$ = computed(() => this.valueChangesSubscriptionSignal());
|
|
756
|
-
|
|
757
|
-
* Handles subfield updates when parent field values change
|
|
758
|
-
* This is called from the form valueChanges subscription
|
|
759
|
-
* Uses a debounce mechanism to prevent excessive updates
|
|
760
|
-
*/
|
|
761
|
-
this.subFieldUpdateTimeout = null;
|
|
762
|
-
this.previousFieldValues = new Map();
|
|
763
|
-
// Watch for changes in formFields (structure changes) - regenerate form
|
|
763
|
+
// Watch for changes in **form structure/metadata (formFields)** and update the form accordingly
|
|
764
764
|
effect(() => {
|
|
765
765
|
const formFields = this.formFields();
|
|
766
|
-
//
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
JSON.stringify(this.previousFormFields) !== JSON.stringify(formFields);
|
|
770
|
-
if (formFields && fieldsChanged) {
|
|
771
|
-
this.previousFormFields = JSON.parse(JSON.stringify(formFields)); // Deep copy
|
|
766
|
+
// Use untracked to access formValues so that this effect only runs when formFields changes,
|
|
767
|
+
// not when the formValues output (which feeds back as an input) changes.
|
|
768
|
+
untracked(() => {
|
|
772
769
|
const formValues = this.formValues();
|
|
773
|
-
//
|
|
774
|
-
|
|
770
|
+
// Only update if we have form fields
|
|
771
|
+
if (formFields) {
|
|
775
772
|
const form = this.generateDynamicForm(formFields, formValues);
|
|
776
773
|
this.dynamicFormSignal.set(form);
|
|
777
|
-
// Initialize previous field values map
|
|
778
|
-
this.previousFieldValues.clear();
|
|
779
|
-
const formArray = form.get('dynamicFields');
|
|
780
|
-
if (formArray) {
|
|
781
|
-
formArray.controls.forEach((fieldGroup, index) => {
|
|
782
|
-
const control = fieldGroup.get('value');
|
|
783
|
-
if (control) {
|
|
784
|
-
this.previousFieldValues.set(index, JSON.parse(JSON.stringify(control.value)));
|
|
785
|
-
}
|
|
786
|
-
});
|
|
787
|
-
}
|
|
788
774
|
// Re-subscribe to form changes
|
|
789
775
|
this.valueChangesSubscriptionSignal()?.unsubscribe();
|
|
790
776
|
this.valueChangesSubscriptionSignal.set(form.valueChanges.subscribe(formValue => {
|
|
791
777
|
this.onFormValueChanges();
|
|
792
|
-
// Handle subfield updates when parent field values change
|
|
793
|
-
this.handleSubFieldUpdates(form);
|
|
794
778
|
}));
|
|
795
779
|
// Emit form validity status
|
|
796
780
|
this.formValid.emit(form.valid);
|
|
@@ -800,49 +784,10 @@ class DynamicFormComponent {
|
|
|
800
784
|
return this.generateDynamicFieldsValueObject(form.value.dynamicFields);
|
|
801
785
|
}
|
|
802
786
|
});
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
});
|
|
806
|
-
// Watch for changes in formValues (data changes) - patch existing form values
|
|
807
|
-
effect(() => {
|
|
808
|
-
const formValues = this.formValues();
|
|
809
|
-
const currentForm = this.dynamicFormSignal();
|
|
810
|
-
// Only patch if form exists and this is not an internal update
|
|
811
|
-
if (currentForm && !this.isInternalUpdate && formValues) {
|
|
812
|
-
untracked(() => {
|
|
813
|
-
this.patchFormValues(currentForm, formValues);
|
|
814
|
-
});
|
|
815
|
-
}
|
|
816
|
-
});
|
|
817
|
-
}
|
|
818
|
-
/**
|
|
819
|
-
* Patches form values without regenerating the form structure
|
|
820
|
-
* This prevents focus loss when only values change
|
|
821
|
-
*/
|
|
822
|
-
patchFormValues(form, formValues) {
|
|
823
|
-
const formArray = form.get('dynamicFields');
|
|
824
|
-
if (!formArray)
|
|
825
|
-
return;
|
|
826
|
-
const fields = this.formFields();
|
|
827
|
-
formArray.controls.forEach((fieldGroup, index) => {
|
|
828
|
-
const field = fields[index];
|
|
829
|
-
if (!field)
|
|
830
|
-
return;
|
|
831
|
-
const fieldValue = formValues[field.configName];
|
|
832
|
-
if (fieldValue !== undefined) {
|
|
833
|
-
const control = fieldGroup.get('value');
|
|
834
|
-
if (control) {
|
|
835
|
-
const mappedValue = this.mapFormValueToFormField(field, fieldValue).value;
|
|
836
|
-
// Only update if value actually changed to prevent unnecessary updates
|
|
837
|
-
if (JSON.stringify(control.value) !== JSON.stringify(mappedValue)) {
|
|
838
|
-
control.setValue(mappedValue, { emitEvent: false });
|
|
839
|
-
}
|
|
787
|
+
// Also, emit the initial or updated values right after generating the form
|
|
788
|
+
this.onFormValueChanges();
|
|
840
789
|
}
|
|
841
|
-
|
|
842
|
-
if (fieldValue?.subFields && field.subFields?.length > 0) {
|
|
843
|
-
this.updateSubDynamicFields(field, fieldGroup, control?.value);
|
|
844
|
-
}
|
|
845
|
-
}
|
|
790
|
+
});
|
|
846
791
|
});
|
|
847
792
|
}
|
|
848
793
|
ngOnInit() {
|
|
@@ -864,21 +809,8 @@ class DynamicFormComponent {
|
|
|
864
809
|
// Subscribing to form changes and emiting values.
|
|
865
810
|
const currentForm = this.dynamicFormSignal();
|
|
866
811
|
if (currentForm) {
|
|
867
|
-
// Initialize previous field values map
|
|
868
|
-
this.previousFieldValues.clear();
|
|
869
|
-
const formArray = currentForm.get('dynamicFields');
|
|
870
|
-
if (formArray) {
|
|
871
|
-
formArray.controls.forEach((fieldGroup, index) => {
|
|
872
|
-
const control = fieldGroup.get('value');
|
|
873
|
-
if (control) {
|
|
874
|
-
this.previousFieldValues.set(index, JSON.parse(JSON.stringify(control.value)));
|
|
875
|
-
}
|
|
876
|
-
});
|
|
877
|
-
}
|
|
878
812
|
this.valueChangesSubscriptionSignal.set(currentForm.valueChanges.subscribe(formValue => {
|
|
879
813
|
this.onFormValueChanges();
|
|
880
|
-
// Handle subfield updates when parent field values change
|
|
881
|
-
this.handleSubFieldUpdates(currentForm);
|
|
882
814
|
}));
|
|
883
815
|
}
|
|
884
816
|
//api to expose functions
|
|
@@ -892,21 +824,12 @@ class DynamicFormComponent {
|
|
|
892
824
|
}
|
|
893
825
|
ngOnDestroy() {
|
|
894
826
|
this.valueChangesSubscription$()?.unsubscribe();
|
|
895
|
-
if (this.subFieldUpdateTimeout) {
|
|
896
|
-
clearTimeout(this.subFieldUpdateTimeout);
|
|
897
|
-
}
|
|
898
827
|
}
|
|
899
828
|
onFormValueChanges() {
|
|
900
|
-
// Set flag to prevent formValues effect from triggering during internal updates
|
|
901
|
-
this.isInternalUpdate = true;
|
|
902
829
|
let formValues = this.generateDynamicFieldsValueObject(this.dynamicForm().value.dynamicFields);
|
|
903
830
|
this.formValid.emit(this.dynamicForm().valid);
|
|
904
831
|
this.formUpdated.emit(formValues);
|
|
905
832
|
console.log(formValues);
|
|
906
|
-
// Reset flag after a microtask to allow external updates
|
|
907
|
-
Promise.resolve().then(() => {
|
|
908
|
-
this.isInternalUpdate = false;
|
|
909
|
-
});
|
|
910
833
|
}
|
|
911
834
|
generateDynamicFieldsValueObject(formValues) {
|
|
912
835
|
let dynamicFieldsValue = {};
|
|
@@ -955,45 +878,11 @@ class DynamicFormComponent {
|
|
|
955
878
|
getDynamicFieldsControls() {
|
|
956
879
|
return this.dynamicForm().get("dynamicFields");
|
|
957
880
|
}
|
|
958
|
-
handleSubFieldUpdates(form) {
|
|
959
|
-
// Clear any pending updates
|
|
960
|
-
if (this.subFieldUpdateTimeout) {
|
|
961
|
-
clearTimeout(this.subFieldUpdateTimeout);
|
|
962
|
-
}
|
|
963
|
-
// Debounce subfield updates to prevent excessive calls
|
|
964
|
-
this.subFieldUpdateTimeout = setTimeout(() => {
|
|
965
|
-
const formArray = form.get('dynamicFields');
|
|
966
|
-
if (!formArray)
|
|
967
|
-
return;
|
|
968
|
-
const fields = this.formFields();
|
|
969
|
-
formArray.controls.forEach((fieldGroup, index) => {
|
|
970
|
-
const field = fields[index];
|
|
971
|
-
if (!field || !field.subFields?.length)
|
|
972
|
-
return;
|
|
973
|
-
const control = fieldGroup.get('value');
|
|
974
|
-
if (control) {
|
|
975
|
-
const currentValue = control.value;
|
|
976
|
-
const previousValue = this.previousFieldValues.get(index);
|
|
977
|
-
// Only update subfields if parent field value actually changed
|
|
978
|
-
if (JSON.stringify(currentValue) !== JSON.stringify(previousValue)) {
|
|
979
|
-
this.previousFieldValues.set(index, JSON.parse(JSON.stringify(currentValue)));
|
|
980
|
-
this.updateSubDynamicFields(field, fieldGroup, currentValue);
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
});
|
|
984
|
-
}, 100); // Small debounce to batch updates
|
|
985
|
-
}
|
|
986
881
|
updateSubDynamicFields(field, formGroup, value) {
|
|
987
882
|
if (field.subFields?.length > 0) {
|
|
988
|
-
// Set flag to prevent form regeneration during subfield updates
|
|
989
|
-
this.isInternalUpdate = true;
|
|
990
883
|
let subFieldsControls = this.generateSubDynamicFields(this.formValues(), field, value);
|
|
991
884
|
formGroup.removeControl('subFields');
|
|
992
885
|
formGroup.addControl('subFields', subFieldsControls);
|
|
993
|
-
// Reset flag after update
|
|
994
|
-
Promise.resolve().then(() => {
|
|
995
|
-
this.isInternalUpdate = false;
|
|
996
|
-
});
|
|
997
886
|
}
|
|
998
887
|
}
|
|
999
888
|
updateSelectedValueForSingleSelect(field, control, formGroup, value) {
|
|
@@ -1061,21 +950,26 @@ class DynamicFormComponent {
|
|
|
1061
950
|
mapFormValueToFormField(formField, formValue) {
|
|
1062
951
|
let validators = formField.validators ? [dynamicFieldValidator(formField.validators)] : [];
|
|
1063
952
|
let control = new UntypedFormControl(null, validators);
|
|
953
|
+
/**
|
|
954
|
+
* Extract actual value if formValue has nested structure (for fields with subFields)
|
|
955
|
+
* Format: { value: "actualValue", subFields: {...} }
|
|
956
|
+
*/
|
|
957
|
+
const actualValue = formValue?.value !== undefined ? formValue.value : formValue;
|
|
1064
958
|
if (formField.fieldType === "input") {
|
|
1065
959
|
if (formField.fieldInputType === "text" || formField.fieldInputType === "textarea")
|
|
1066
|
-
control.setValue(
|
|
960
|
+
control.setValue(actualValue ? actualValue : "");
|
|
1067
961
|
else if (formField.fieldInputType === "number")
|
|
1068
|
-
control.setValue(
|
|
962
|
+
control.setValue(actualValue ? actualValue : 0);
|
|
1069
963
|
else if (formField.fieldInputType === "date") {
|
|
1070
|
-
if (
|
|
964
|
+
if (actualValue && typeof actualValue === "number") {
|
|
1071
965
|
const timezone = (formField.fieldConfig && formField.fieldConfig.timezone) || 'Asia/Kolkata';
|
|
1072
966
|
const format = (formField.fieldConfig && formField.fieldConfig.format) || 'DD/MM/YYYY';
|
|
1073
|
-
control.setValue(dayjs(
|
|
967
|
+
control.setValue(dayjs(actualValue).tz(timezone).format(format));
|
|
1074
968
|
}
|
|
1075
|
-
else if (
|
|
969
|
+
else if (actualValue && typeof actualValue === "string") {
|
|
1076
970
|
const timezone = (formField.fieldConfig && formField.fieldConfig.timezone) || 'Asia/Kolkata';
|
|
1077
971
|
const format = (formField.fieldConfig && formField.fieldConfig.format) || 'DD/MM/YYYY';
|
|
1078
|
-
control.setValue(dayjs.tz(
|
|
972
|
+
control.setValue(dayjs.tz(actualValue, format, timezone).format(format));
|
|
1079
973
|
}
|
|
1080
974
|
else {
|
|
1081
975
|
const timezone = (formField.fieldConfig && formField.fieldConfig.timezone) || 'Asia/Kolkata';
|
|
@@ -1086,11 +980,11 @@ class DynamicFormComponent {
|
|
|
1086
980
|
}
|
|
1087
981
|
else if (formField.fieldType === "singleSelect") {
|
|
1088
982
|
const findSelectedValue = () => {
|
|
1089
|
-
let index = formField.itemsList.findIndex(item => item.value ===
|
|
983
|
+
let index = formField.itemsList.findIndex(item => item.value === actualValue);
|
|
1090
984
|
return index >= 0 ? formField.itemsList[index] : "";
|
|
1091
985
|
};
|
|
1092
986
|
if (formField.fieldInputType === "dropdown") {
|
|
1093
|
-
if (!
|
|
987
|
+
if (!actualValue)
|
|
1094
988
|
control.setValue(formField.itemsList[0]);
|
|
1095
989
|
else
|
|
1096
990
|
control.setValue(findSelectedValue());
|
|
@@ -1100,9 +994,9 @@ class DynamicFormComponent {
|
|
|
1100
994
|
}
|
|
1101
995
|
}
|
|
1102
996
|
else if (formField.fieldType === "multiSelect") {
|
|
1103
|
-
if (
|
|
997
|
+
if (actualValue && Array.isArray(actualValue)) {
|
|
1104
998
|
let selectedValues = [];
|
|
1105
|
-
for (let value of
|
|
999
|
+
for (let value of actualValue) {
|
|
1106
1000
|
let index = formField.itemsList.findIndex(item => item.value === value);
|
|
1107
1001
|
if (index > -1)
|
|
1108
1002
|
selectedValues.push({ ...formField.itemsList[index] });
|
|
@@ -1114,7 +1008,7 @@ class DynamicFormComponent {
|
|
|
1114
1008
|
}
|
|
1115
1009
|
}
|
|
1116
1010
|
else if (formField.fieldType === "boolean") {
|
|
1117
|
-
control.setValue(!!
|
|
1011
|
+
control.setValue(!!actualValue);
|
|
1118
1012
|
}
|
|
1119
1013
|
else
|
|
1120
1014
|
control.setValue(null);
|
|
@@ -1164,7 +1058,7 @@ class DynamicFormComponent {
|
|
|
1164
1058
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.customSingleSelectRadio = _t.first);
|
|
1165
1059
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.customMultiSelectCheckbox = _t.first);
|
|
1166
1060
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.customMultiSelectDropdown = _t.first);
|
|
1167
|
-
} }, inputs: { formFields: [1, "formFields"], formValues: [1, "formValues"], activeBtnIconUrl: [1, "activeBtnIconUrl"], calendarIconUrl: [1, "calendarIconUrl"], removeIconUrl: [1, "removeIconUrl"], removeSepratorForSubFields: [1, "removeSepratorForSubFields"] }, outputs: { formUpdated: "formUpdated", formValid: "formValid", formInitialized: "formInitialized", fieldRemoved: "fieldRemoved" }, decls: 7, vars: 2, consts: [["dynamicField", ""], ["dynamicFieldErrors", ""], ["defaultInputTextNumber", ""], ["defaultInputTextarea", ""], ["defaultInputDate", ""], ["dp", ""], ["defaultBooleanToggle", ""], ["defaultSingleSelectDropdown", ""], ["defaultSingleSelectRadio", ""], ["defaultMultiSelectCheckbox", ""], ["defaultMultiSelectDropdown", ""], [3, "formGroup"], ["formArrayName", "dynamicFields"], [3, "formGroupName", 4, "ngFor", "ngForOf"], [3, "formGroupName"], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], ["class", "sub-dynamic-form", 4, "ngIf"], [1, "sub-dynamic-form"], [4, "ngFor", "ngForOf"], [4, "ngIf"], [4, "ngIf", "ngIfElse"], [1, "dynamic-field", "multi-line-field-container", 3, "ngStyle"], [1, "h7", "field-title-sm"], [2, "flex-basis", "100%"], [1, "input-field", "ip-text", 3, "type", "formControl", "ngStyle", "placeholder", "min"], [3, "ngTemplateOutlet", "ngTemplateOutletContext", 4, "ngIf"], ["type", "text", 1, "input-field", "ip-textarea", 3, "ngStyle", "placeholder", "formControl"], ["class", "dynamic-field single-line-field-container", 3, "ngStyle", 4, "ngIf"], [1, "dynamic-field", "single-line-field-container", 3, "ngStyle"], [1, "h6"], [1, "date-picker-container"], ["readonly", "", "misTzDp", "", 1, "date-picker", 3, "dateChange", "dpConfig", "selectedDate", "offsetY", "value"], ["alt", "data-picker", "class", "date-picker-icon", 3, "src", "click", 4, "ngIf"], ["alt", "data-picker", 1, "date-picker-icon", 3, "click", "src"], [3, "valueChanged", "control"], [3, "ngClass"], [3, "onChange", "searchEnabled", "width", "data", "selectedItem"], ["class", "remove-icon", 3, "src", "click", 4, "ngIf"], [1, "remove-icon", 3, "click", "src"], ["id", "checkboxes-container"], ["class", "radio-checkbox-common", 3, "ngClass", "click", 4, "ngFor", "ngForOf"], [1, "radio-checkbox-common", 3, "click", "ngClass"], ["alt", "", 3, "src", 4, "ngIf"], ["alt", "", 3, "src"], [3, "onChange", "width", "showSelectedCount", "dropdownListWidth", "searchEnabled", "hideApplyButton", "data", "selectedItems"], ["id", "error-messages-container"], [1, "h8"], [3, "ngStyle"]], template: function DynamicFormComponent_Template(rf, ctx) { if (rf & 1) {
|
|
1061
|
+
} }, inputs: { formFields: [1, "formFields"], formValues: [1, "formValues"], activeBtnIconUrl: [1, "activeBtnIconUrl"], calendarIconUrl: [1, "calendarIconUrl"], removeIconUrl: [1, "removeIconUrl"], removeSepratorForSubFields: [1, "removeSepratorForSubFields"] }, outputs: { formUpdated: "formUpdated", formValid: "formValid", formInitialized: "formInitialized", fieldRemoved: "fieldRemoved" }, decls: 7, vars: 2, consts: [["dynamicField", ""], ["dynamicFieldErrors", ""], ["defaultInputTextNumber", ""], ["defaultInputTextarea", ""], ["defaultInputDate", ""], ["dp", ""], ["defaultBooleanToggle", ""], ["defaultSingleSelectDropdown", ""], ["defaultSingleSelectRadio", ""], ["defaultMultiSelectCheckbox", ""], ["defaultMultiSelectDropdown", ""], [3, "formGroup"], ["formArrayName", "dynamicFields"], [3, "formGroupName", 4, "ngFor", "ngForOf"], [3, "formGroupName"], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], ["class", "sub-dynamic-form", 4, "ngIf"], [1, "sub-dynamic-form"], [4, "ngFor", "ngForOf"], [4, "ngIf"], [4, "ngIf", "ngIfElse"], [1, "dynamic-field", "multi-line-field-container", 3, "ngStyle"], [1, "h7", "field-title-sm"], [2, "flex-basis", "100%"], [1, "input-field", "ip-text", 3, "ngModelChange", "type", "formControl", "ngStyle", "placeholder", "min"], [3, "ngTemplateOutlet", "ngTemplateOutletContext", 4, "ngIf"], ["type", "text", 1, "input-field", "ip-textarea", 3, "ngModelChange", "ngStyle", "placeholder", "formControl"], ["class", "dynamic-field single-line-field-container", 3, "ngStyle", 4, "ngIf"], [1, "dynamic-field", "single-line-field-container", 3, "ngStyle"], [1, "h6"], [1, "date-picker-container"], ["readonly", "", "misTzDp", "", 1, "date-picker", 3, "dateChange", "dpConfig", "selectedDate", "offsetY", "value"], ["alt", "data-picker", "class", "date-picker-icon", 3, "src", "click", 4, "ngIf"], ["alt", "data-picker", 1, "date-picker-icon", 3, "click", "src"], [3, "valueChanged", "control"], [3, "ngClass"], [3, "onChange", "searchEnabled", "width", "data", "selectedItem"], ["class", "remove-icon", 3, "src", "click", 4, "ngIf"], [1, "remove-icon", 3, "click", "src"], ["id", "checkboxes-container"], ["class", "radio-checkbox-common", 3, "ngClass", "click", 4, "ngFor", "ngForOf"], [1, "radio-checkbox-common", 3, "click", "ngClass"], ["alt", "", 3, "src", 4, "ngIf"], ["alt", "", 3, "src"], [3, "onChange", "width", "showSelectedCount", "dropdownListWidth", "searchEnabled", "hideApplyButton", "data", "selectedItems"], ["id", "error-messages-container"], [1, "h8"], [3, "ngStyle"]], template: function DynamicFormComponent_Template(rf, ctx) { if (rf & 1) {
|
|
1168
1062
|
i0.ɵɵelementStart(0, "form", 11);
|
|
1169
1063
|
i0.ɵɵelementContainerStart(1, 12);
|
|
1170
1064
|
i0.ɵɵtemplate(2, DynamicFormComponent_ng_container_2_Template, 3, 8, "ng-container", 13);
|
|
@@ -1179,7 +1073,7 @@ class DynamicFormComponent {
|
|
|
1179
1073
|
}
|
|
1180
1074
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DynamicFormComponent, [{
|
|
1181
1075
|
type: Component,
|
|
1182
|
-
args: [{ selector: "mis-dynamic-form", template: "<form [formGroup]=\"dynamicForm()\">\n <ng-container formArrayName=\"dynamicFields\">\n <ng-container [formGroupName]=\"i\" *ngFor=\"let fieldControl of getDynamicFieldsControls().controls; let i = index\">\n <ng-container\n [ngTemplateOutlet]=\"dynamicField\"\n [ngTemplateOutletContext]=\"{\n $implicit: formFieldsArray?.[i],\n formGroup: fieldControl,\n control: fieldControl.controls.value\n }\"\n >\n </ng-container>\n <div class=\"sub-dynamic-form\" *ngIf=\"fieldControl?.value && (!!formFieldsArray?.[i]?.subFields && formFieldsArray?.[i]?.subFields?.length > 0 && matchParentConfig(formFieldsArray?.[i]?.subFields, fieldControl?.controls?.value?.value?.value))\">\n <ng-container *ngFor=\"let subFieldControl of fieldControl.controls.subFields.controls; let j = index\">\n <ng-container\n [ngTemplateOutlet]=\"dynamicField\"\n [ngTemplateOutletContext]=\"{\n $implicit: findSelectedSubFieldConfig(formFieldsArray?.[i]?.subFields, fieldControl.controls.value.value.value,j),\n control: subFieldControl\n }\">\n </ng-container>\n </ng-container>\n </div>\n </ng-container>\n </ng-container>\n</form>\n\n\n<ng-template #dynamicField let-field let-control=\"control\" let-formgroup=\"formGroup\">\n\n <!-- fieldType: 'input' fieldInputType: 'text' | 'number' -->\n <ng-container *ngIf=\"field.fieldType === 'input' && (field.fieldInputType === 'text' || field.fieldInputType === 'number')\">\n <ng-container *ngIf=\"customInputTextNumber; else defaultInputTextNumber\">\n <ng-template\n [ngTemplateOutlet]=\"customInputTextNumber\"\n [ngTemplateOutletContext]=\"{ field: field, control: control, formgroup: formgroup }\"\n ></ng-template>\n </ng-container>\n <ng-template #defaultInputTextNumber>\n <div class=\"dynamic-field multi-line-field-container\"\n [ngStyle]=\"{'border-bottom': (formgroup?.controls?.subFields?.controls?.length && removeSepratorForSubFields) ? 'none':''}\">\n <p class=\"h7 field-title-sm\">\n {{ field?.title }} <span *ngIf=\"field.validators && field.validators.length > 0\"> *</span>\n </p>\n <div style=\"flex-basis: 100%\"></div>\n <input class=\"input-field ip-text\" [type]=\"field.fieldInputType\" [formControl]=\"control\"\n [ngStyle]=\"{'border': control.touched && control.errors ? '1px solid #B00020': ''}\"\n [placeholder]=\"field.placeholderText ? field.placeholderText : 'Input Text'\" \n [min]=\"field.fieldInputType === 'number' ? 0 : '' \"/>\n <ng-container *ngIf=\"control.touched && control.errors\"\n [ngTemplateOutlet]=\"dynamicFieldErrors\" \n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\"\n >\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n \n <!-- fieldType: 'input' fieldInputType: 'textarea' -->\n <ng-container *ngIf=\"field.fieldType === 'input' && field.fieldInputType === 'textarea'\">\n <ng-container *ngIf=\"customInputTextarea; else defaultInputTextarea\">\n <ng-template\n [ngTemplateOutlet]=\"customInputTextarea\"\n [ngTemplateOutletContext]=\"{ field: field, control: control, formgroup: formgroup }\"\n ></ng-template>\n </ng-container>\n <ng-template #defaultInputTextarea>\n <div class=\"dynamic-field multi-line-field-container\"\n [ngStyle]=\"{'border-bottom': (formgroup?.controls?.subFields?.controls?.length && removeSepratorForSubFields) ? 'none':''}\">\n <p class=\"h7 field-title-sm\">\n {{ field.title }}<span *ngIf=\"field.validators && field.validators.length > 0\"> *</span>\n </p>\n <div style=\"flex-basis: 100%\"></div>\n <textarea class=\"input-field ip-textarea\" type=\"text\"\n [ngStyle]=\"{'border': control.touched && control.errors ? '1px solid #B00020': ''}\"\n [placeholder]=\"field.placeholderText ? field.placeholderText : 'Input Text'\" [formControl]=\"control\"></textarea>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n \n <!-- fieldType: 'input' fieldInputType: 'date' -->\n <ng-container *ngIf=\"field.fieldType === 'input' && field.fieldInputType === 'date'\">\n <ng-container *ngIf=\"customInputDate; else defaultInputDate\">\n <ng-template\n [ngTemplateOutlet]=\"customInputDate\"\n [ngTemplateOutletContext]=\"{ field: field, control: control, formgroup: formgroup }\"\n ></ng-template>\n </ng-container>\n <ng-template #defaultInputDate>\n <div class=\"dynamic-field single-line-field-container\"\n [ngStyle]=\"{'border-bottom': (formgroup?.controls?.subFields?.controls?.length && removeSepratorForSubFields) ? 'none':''}\"\n *ngIf=\"field.fieldType === 'input' && field.fieldInputType === 'date'\">\n <p class=\"h6\">\n {{ field.title }} <span *ngIf=\"field.validators && field.validators.length > 0\"> *</span>\n </p>\n <div class=\"date-picker-container\">\n <input class=\"date-picker\" readonly misTzDp [dpConfig]=\"field.fieldConfig\"\n (dateChange)=\"control.setValue($event)\" [selectedDate]=\"control.value\" [offsetY]=\"0\"\n [value]=\"control.value\" #dp />\n <img alt=\"data-picker\" *ngIf=\"calendarIconUrl()\" class=\"date-picker-icon\" [src]=\"calendarIconUrl()\"\n (click)=\"dp.click()\" />\n </div>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n\n <!-- fieldType: 'boolean' fieldInputType: 'toggle' -->\n <ng-container *ngIf=\"field.fieldType === 'boolean' && field.fieldInputType === 'toggle'\">\n <ng-container *ngIf=\"customBooleanToggle; else defaultBooleanToggle\">\n <ng-template\n [ngTemplateOutlet]=\"customBooleanToggle\"\n [ngTemplateOutletContext]=\"{ field: field, control: control, formgroup: formgroup }\"\n ></ng-template>\n </ng-container>\n <ng-template #defaultBooleanToggle>\n <div class=\"dynamic-field single-line-field-container\"\n [ngStyle]=\"{'border-bottom': (formgroup?.controls?.subFields?.controls?.length && removeSepratorForSubFields) ? 'none':''}\">\n <p class=\"h6\">\n {{ field.title }}<span *ngIf=\"field.validators && field.validators.length > 0\"> *</span>\n </p>\n <mis-switch [control]=\"control\" (valueChanged)=\"updateSubDynamicFields(field, formgroup, $event)\"></mis-switch>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div> \n </ng-template>\n </ng-container>\n\n <!-- fieldType: 'singleSelect' fieldInputType: 'dropdown' -->\n <ng-container *ngIf=\"field.fieldType === 'singleSelect' && field.fieldInputType === 'dropdown'\">\n <ng-container *ngIf=\"customSingleSelectDropdown; else defaultSingleSelectDropdown\">\n <ng-template\n [ngTemplateOutlet]=\"customSingleSelectDropdown\"\n [ngTemplateOutletContext]=\"{ field: field, control: control, formgroup: formgroup }\"\n ></ng-template>\n </ng-container>\n <ng-template #defaultSingleSelectDropdown>\n <div class=\"dynamic-field single-line-field-container\"\n [ngStyle]=\"{'border-bottom': (formgroup?.controls?.subFields?.controls?.length && removeSepratorForSubFields) ? 'none':''}\">\n <p class=\"h6\">\n {{ field.title }}<span *ngIf=\"field.validators && field.validators.length > 0\"> *</span>\n </p>\n <div [ngClass]=\"{'removeable-container' : field?.isRemoveable}\">\n <mis-dropdown [searchEnabled]=\"false\" [width]=\"'140px'\" [data]=\"field.itemsList\" [selectedItem]=\"control.value\"\n (onChange)=\"updateSelectedValueForSingleSelect(field, control, formgroup, $event);\">\n </mis-dropdown>\n <img *ngIf=\"field.isRemoveable && removeIconUrl()\" class=\"remove-icon\" [src]=\"removeIconUrl()\" (click)=\"fieldRemoved.emit(field)\">\n </div>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n </ng-template>\n </ng-container >\n \n\n <!-- fieldType: 'singleSelect' fieldInputType: 'radio' -->\n <ng-container *ngIf=\"field.fieldType === 'singleSelect' && field.fieldInputType === 'radio'\">\n <ng-container *ngIf=\"customSingleSelectRadio; else defaultSingleSelectRadio\">\n <ng-template\n [ngTemplateOutlet]=\"customSingleSelectRadio\"\n [ngTemplateOutletContext]=\"{ field: field, control: control, formgroup: formgroup }\"\n ></ng-template>\n </ng-container>\n <ng-template #defaultSingleSelectRadio>\n <div class=\"dynamic-field multi-line-field-container\"\n [ngStyle]=\"{'border-bottom': (formgroup?.controls?.subFields?.controls?.length && removeSepratorForSubFields) ? 'none':''}\">\n <p class=\"h7 field-title-sm\">\n {{ field.title }}<span *ngIf=\"field.validators && field.validators.length > 0\"> *</span>\n </p>\n <div style=\"flex-basis: 100%\"></div>\n <div id=\"checkboxes-container\">\n <div class=\"radio-checkbox-common\" *ngFor=\"let item of field.itemsList\"\n [ngClass]=\"{ 'checkbox-active': item.label === control.value?.label }\"\n (click)=\"updateSelectedValueForSingleSelect(field, control, formgroup, item);\">\n <img *ngIf=\"(item.label === control.value?.label) && activeBtnIconUrl()\" [src]=\"activeBtnIconUrl()\" alt=\"\" />\n <p class=\"h6\">{{ item.label }}</p>\n </div>\n </div>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n \n\n <!-- fieldType: 'multiSelect' fieldInputType: 'checkbox' -->\n <ng-container *ngIf=\"field.fieldType === 'multiSelect' && field.fieldInputType === 'checkbox'\">\n <ng-container *ngIf=\"customMultiSelectCheckbox; else defaultMultiSelectCheckbox\">\n <ng-template\n [ngTemplateOutlet]=\"customMultiSelectCheckbox\"\n [ngTemplateOutletContext]=\"{ field: field, control: control, formgroup: formgroup }\"\n ></ng-template>\n </ng-container>\n <ng-template #defaultMultiSelectCheckbox>\n <div class=\"dynamic-field multi-line-field-container\"\n [ngStyle]=\"{'border-bottom': (formgroup?.controls?.subFields?.controls?.length && removeSepratorForSubFields) ? 'none':''}\">\n <p class=\"h7 field-title-sm\">\n {{ field.title }}<span *ngIf=\"field.validators && field.validators.length > 0\"> *</span>\n </p>\n <div style=\"flex-basis: 100%\"></div>\n <div id=\"checkboxes-container\">\n <div class=\"radio-checkbox-common\" *ngFor=\"let item of field.itemsList\"\n [ngClass]=\"{ 'checkbox-active': isCheckBoxSelected(item.label, control.value) }\"\n (click)=\"updateSelectedValueForMultiSelect(field, control, formgroup, [item])\">\n <img *ngIf=\"isCheckBoxSelected(item.label, control.value) && activeBtnIconUrl()\" [src]=\"activeBtnIconUrl()\"\n alt=\"\" />\n <p class=\"h6\">{{ item.label }}</p>\n </div>\n </div>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n\n\n <!-- fieldType: 'multiSelect' fieldInputType: 'dropdown' -->\n <ng-container *ngIf=\"field.fieldType === 'multiSelect' && field.fieldInputType === 'dropdown'\">\n <ng-container *ngIf=\"customMultiSelectDropdown; else defaultMultiSelectDropdown\">\n <ng-template\n [ngTemplateOutlet]=\"customMultiSelectDropdown\"\n [ngTemplateOutletContext]=\"{ field: field, control: control, formgroup: formgroup }\"\n ></ng-template>\n </ng-container>\n <ng-template #defaultMultiSelectDropdown>\n <div class=\"dynamic-field single-line-field-container\"\n [ngStyle]=\"{'border-bottom': (formgroup?.controls?.subFields?.controls?.length && removeSepratorForSubFields) ? 'none':''}\">\n <p class=\"h6\">\n {{ field.title }}<span *ngIf=\"field.validators && field.validators.length > 0\"> *</span>\n </p>\n <mis-multi-select-dropdown [width]=\"'140px'\" [showSelectedCount]=\"true\" [dropdownListWidth]=\"'256px'\"\n [searchEnabled]=\"false\" [hideApplyButton]=\"true\" [data]=\"field.itemsList\"\n [selectedItems]=\"control.value\" (onChange)=\"updateSelectedValueForMultiSelect(field, control, formgroup, $event);\"></mis-multi-select-dropdown>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n\n</ng-template>\n\n<ng-template #dynamicFieldErrors let-errors>\n <div id=\"error-messages-container\">\n <ng-container *ngFor=\"let error of errors | keyvalue\">\n <p class=\"h8\">\n {{\" \u2022 \" + error.value}}\n </p>\n <div [ngStyle]=\"{ 'flex-basis': '100%', 'height': '0' }\"></div>\n </ng-container>\n </div>\n</ng-template>", styles: [":root{--pmry-200: #99BAF7;--pmry-100: #CBDDFB;--pmry-500: #0937B2;--pmry-400: #3C68D0;--pmry-600: #062A99;--pmry-700: #041F80;--pmry-300: #638FE7;--pmry-800: #021567;--pmry-900: #010F55;--sec-d-purple: #40447F;--sec-maroon: #6B034E;--sec-mud-red: #B23600;--sec-orange: #ED711C;--sec-purple: #815FD5;--sec-teal: #10ADAE;--sec-yellow: #D4900C;--sec-green: #547F40;--sec-bright-green: #27D22E;--sec-dark-teal: #035F6B;--sec-chocolate: #7C2F33;--sec-rube-pink: #C13D6D;--sec-cerulean: #0087B2;--sem-error: #B00020;--sem-info: #0091FF;--sem-warning: #FF9D00;--sem-success: #38AF49;--grey-bg-1: #FAFAFA;--grey-bg: #F5F5F5;--grey-seperators: #E0E0E0;--grey-disabled: #C8CDD3;--grey-hover: #F5F7FC;--grey-pressed: #E6EBF7;--grey-row: #F5F7FC;--dec-light-yellow: #F4E7C3;--dec-light-purple: #DACFF9;--dec-light-green: #E4F5E9;--dec-light-green2: #F1FFF3;--dec-light-pink: #FAE1EA;--dec-: #F4CBC1;--dec-lt-orange: #FAEFED;--dec-light-blue: #CFECF9;--dec-row-selection: #F1FDF8;--dec-row-selection2: #F2FBFF;--dec-row-lines: #D3E1E9;--text-white: #FFFFFF;--text-muted: #6A737D;--text-black: #181F33;--MR-solid-blue2:#C8D5F6;--MR-solid-purple:#C9C3FB;--MR-solid-orange:#EEAC9F;--MR-solid-green:#ACDADA;--MR-solid-brown:#E8C8AF;--MR-solid-yellow:#FFEFC7;--MR-solid-blue:#BBE6FF;--MR-solid-pink:#FFC6F2;--tr-hover:#F0F3FA;--tr-pressed:#DAE1F3;--brand-primary: #0937B2;--brand-primary-light: #3C68D0;--brand-primary-dark: #062A99;--brand-primary-darker: #041F80;--brand-primary-lighter: #638FE7;--brand-primary-lightest: #CBDDFB;--brand-primary-hover: #F0F3FA;--brand-primary-active: #DAE1F3;--brand-secondary: #ED711C;--brand-secondary-light: #F09E65;--brand-secondary-dark: #B23600;--brand-secondary-lighter: #FFC6F2;--brand-accent: #10ADAE;--brand-accent-light: #16CBBC;--brand-accent-dark: #035F6B;--brand-accent-lighter: #ACDADA;--brand-success: #38AF49;--brand-success-light: #4CAF50;--brand-success-dark: #216531;--brand-success-lighter: #E4F5E9;--brand-success-lightest: #F1FFF3;--brand-error: #B00020;--brand-error-light: #F04E4E;--brand-error-dark: #A60060;--brand-error-lighter: #FAE1EA;--brand-error-lightest: #FDF2F2;--brand-warning: #FF9D00;--brand-warning-light: #D4900C;--brand-warning-dark: #624000;--brand-warning-lighter: #F4E7C3;--brand-warning-lightest: #FAEFED;--brand-info: #0091FF;--brand-info-light: #35A1FF;--brand-info-dark: #0087B2;--brand-info-lighter: #CFECF9;--text-primary: #181F33;--text-secondary: #6A737D;--text-tertiary: #929DAB;--text-disabled: #929DAB;--text-primary-87: rgba(24, 31, 51, .87);--text-primary-60: rgba(24, 31, 51, .6);--text-primary-38: rgba(24, 31, 51, .38);--text-primary-12: rgba(24, 31, 51, .12);--bg-primary: #FFFFFF;--bg-secondary: #FAFAFA;--bg-tertiary: #F5F5F5;--bg-overlay: rgba(0, 0, 0, .32);--bg-overlay-light: rgba(0, 0, 0, .12);--bg-overlay-lighter: rgba(0, 0, 0, .08);--bg-overlay-lightest: rgba(0, 0, 0, .04);--border-primary: #E0E0E0;--border-secondary: #D6DCE2;--border-tertiary: #C8CDD3;--border-light: #F1F4F8;--border-primary-12: rgba(0, 0, 0, .12);--border-primary-08: rgba(0, 0, 0, .08);--border-primary-06: rgba(0, 0, 0, .06);--shadow-primary: rgba(0, 0, 0, .12);--shadow-secondary: rgba(0, 0, 0, .08);--shadow-tertiary: rgba(0, 0, 0, .04);--shadow-light: rgba(0, 0, 0, .06);--status-available: #929DAB;--status-unavailable: #CCD3DA;--status-hotseat: #857BFF;--status-multiteam: #10ADAE;--status-selected: #10ADAE;--status-upcoming: #D4900C;--status-room: #38AF49;--status-room-booked: #B23600;--status-room-unavailable: #181F33;--team-color-1: #F8C52E;--team-color-2: #FA8E20;--team-color-3: #987CDD;--team-color-4: #16CBBC;--team-color-5: #E65010;--team-color-6: #A60060;--team-color-7: #ED323B;--team-color-8: #35A1FF;--team-color-9: #80D348}p{margin:0;cursor:default}::ng-deep .main-container{margin:0;max-width:100%}.sub-dynamic-form{padding-left:24px;border-bottom:1px solid var(--border-primary, #E0E0E0)}.dynamic-field ::ng-deep .container{height:32px!important}.single-line-field-container{display:flex;justify-content:space-between;align-items:center;padding:28px 16px;border-bottom:1px solid var(--border-primary, #E0E0E0)}.multi-line-field-container{display:flex;justify-content:flex-start;align-items:flex-start;padding:28px 16px;flex-wrap:wrap;border-bottom:1px solid var(--border-primary, #E0E0E0)}.field-title-sm{margin-bottom:8px;cursor:default}.input-field{width:100%;background-color:var(--bg-secondary, #FAFAFA);border:1px solid var(--border-primary, #E0E0E0);border-radius:6px}.ip-text{height:44px;padding:8px 12px}.ip-textarea{max-height:94px;padding:8px}input:focus{outline:none}input::placeholder{color:var(--border-primary, #E0E0E0)}textarea:focus{outline:none}.date-picker-container{position:relative;width:140px}.date-picker-container .date-picker{cursor:pointer;height:32px;width:100%;font-size:14px;border-radius:6px;padding:0 12px;border:1px solid var(--border-primary, #E0E0E0);inset:10px auto auto 80px;background-color:var(--bg-primary, #FFFFFF)}.date-picker-container .date-picker:hover{background-color:var(--brand-primary-hover, #F0F3FA)}.date-picker-container .date-picker-icon{position:absolute;top:50%;right:12px;transform:translateY(-50%);cursor:pointer}form .dynamic-field:last-child{border-bottom:none!important}#checkboxes-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.radio-checkbox-common{display:flex;justify-content:center;align-items:center;cursor:pointer;margin-right:8px;margin-bottom:8px;background-color:var(--bg-primary, #FFFFFF);padding:12px 16px;border:1px solid var(--text-secondary, #6A737D);border-radius:8px}.radio-checkbox-common p{color:var(--text-secondary, #6A737D);cursor:pointer}.radio-checkbox-common img{margin-right:8px}.checkbox-active{background-color:var(--brand-primary, #0937B2)}.checkbox-active p{color:var(--bg-primary, #FFFFFF)}#error-messages-container{margin-top:4px;width:100%;display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}#error-messages-container p{color:var(--brand-error, #B00020)}.removeable-container{display:flex;justify-content:center;align-items:center}.removeable-container .remove-icon{cursor:pointer;margin-left:8px;max-width:24px}span{color:var(--brand-error, #B00020)}\n"] }]
|
|
1076
|
+
args: [{ selector: "mis-dynamic-form", template: "<form [formGroup]=\"dynamicForm()\">\n <ng-container formArrayName=\"dynamicFields\">\n <ng-container [formGroupName]=\"i\" *ngFor=\"let fieldControl of getDynamicFieldsControls().controls; let i = index\">\n <ng-container\n [ngTemplateOutlet]=\"dynamicField\"\n [ngTemplateOutletContext]=\"{\n $implicit: formFieldsArray?.[i],\n formGroup: fieldControl,\n control: fieldControl.controls.value\n }\"\n >\n </ng-container>\n <div class=\"sub-dynamic-form\" *ngIf=\"fieldControl?.value && (!!formFieldsArray?.[i]?.subFields && formFieldsArray?.[i]?.subFields?.length > 0 && matchParentConfig(formFieldsArray?.[i]?.subFields, fieldControl?.controls?.value?.value?.value))\">\n <ng-container *ngFor=\"let subFieldControl of fieldControl.controls.subFields.controls; let j = index\">\n <ng-container\n [ngTemplateOutlet]=\"dynamicField\"\n [ngTemplateOutletContext]=\"{\n $implicit: findSelectedSubFieldConfig(formFieldsArray?.[i]?.subFields, fieldControl.controls.value.value.value,j),\n control: subFieldControl\n }\">\n </ng-container>\n </ng-container>\n </div>\n </ng-container>\n </ng-container>\n</form>\n\n\n<ng-template #dynamicField let-field let-control=\"control\" let-formgroup=\"formGroup\">\n\n <!-- fieldType: 'input' fieldInputType: 'text' | 'number' -->\n <ng-container *ngIf=\"field.fieldType === 'input' && (field.fieldInputType === 'text' || field.fieldInputType === 'number')\">\n <ng-container *ngIf=\"customInputTextNumber; else defaultInputTextNumber\">\n <ng-template\n [ngTemplateOutlet]=\"customInputTextNumber\"\n [ngTemplateOutletContext]=\"{ field: field, control: control, formgroup: formgroup }\"\n ></ng-template>\n </ng-container>\n <ng-template #defaultInputTextNumber>\n <div class=\"dynamic-field multi-line-field-container\"\n [ngStyle]=\"{'border-bottom': (formgroup?.controls?.subFields?.controls?.length && removeSepratorForSubFields) ? 'none':''}\">\n <p class=\"h7 field-title-sm\">\n {{ field?.title }} <span *ngIf=\"field.validators && field.validators.length > 0\"> *</span>\n </p>\n <div style=\"flex-basis: 100%\"></div>\n <input class=\"input-field ip-text\" [type]=\"field.fieldInputType\" [formControl]=\"control\"\n (ngModelChange)=\"updateSubDynamicFields(field, formgroup, $event)\" \n [ngStyle]=\"{'border': control.touched && control.errors ? '1px solid #B00020': ''}\"\n [placeholder]=\"field.placeholderText ? field.placeholderText : 'Input Text'\" \n [min]=\"field.fieldInputType === 'number' ? 0 : '' \"/>\n <ng-container *ngIf=\"control.touched && control.errors\"\n [ngTemplateOutlet]=\"dynamicFieldErrors\" \n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\"\n >\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n \n <!-- fieldType: 'input' fieldInputType: 'textarea' -->\n <ng-container *ngIf=\"field.fieldType === 'input' && field.fieldInputType === 'textarea'\">\n <ng-container *ngIf=\"customInputTextarea; else defaultInputTextarea\">\n <ng-template\n [ngTemplateOutlet]=\"customInputTextarea\"\n [ngTemplateOutletContext]=\"{ field: field, control: control, formgroup: formgroup }\"\n ></ng-template>\n </ng-container>\n <ng-template #defaultInputTextarea>\n <div class=\"dynamic-field multi-line-field-container\"\n [ngStyle]=\"{'border-bottom': (formgroup?.controls?.subFields?.controls?.length && removeSepratorForSubFields) ? 'none':''}\">\n <p class=\"h7 field-title-sm\">\n {{ field.title }}<span *ngIf=\"field.validators && field.validators.length > 0\"> *</span>\n </p>\n <div style=\"flex-basis: 100%\"></div>\n <textarea class=\"input-field ip-textarea\" type=\"text\"\n [ngStyle]=\"{'border': control.touched && control.errors ? '1px solid #B00020': ''}\"\n [placeholder]=\"field.placeholderText ? field.placeholderText : 'Input Text'\" [formControl]=\"control\" (ngModelChange)=\"updateSubDynamicFields(field, formgroup, $event)\"></textarea>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n \n <!-- fieldType: 'input' fieldInputType: 'date' -->\n <ng-container *ngIf=\"field.fieldType === 'input' && field.fieldInputType === 'date'\">\n <ng-container *ngIf=\"customInputDate; else defaultInputDate\">\n <ng-template\n [ngTemplateOutlet]=\"customInputDate\"\n [ngTemplateOutletContext]=\"{ field: field, control: control, formgroup: formgroup }\"\n ></ng-template>\n </ng-container>\n <ng-template #defaultInputDate>\n <div class=\"dynamic-field single-line-field-container\"\n [ngStyle]=\"{'border-bottom': (formgroup?.controls?.subFields?.controls?.length && removeSepratorForSubFields) ? 'none':''}\"\n *ngIf=\"field.fieldType === 'input' && field.fieldInputType === 'date'\">\n <p class=\"h6\">\n {{ field.title }} <span *ngIf=\"field.validators && field.validators.length > 0\"> *</span>\n </p>\n <div class=\"date-picker-container\">\n <input class=\"date-picker\" readonly misTzDp [dpConfig]=\"field.fieldConfig\"\n (dateChange)=\"control.setValue($event)\" [selectedDate]=\"control.value\" [offsetY]=\"0\"\n [value]=\"control.value\" #dp />\n <img alt=\"data-picker\" *ngIf=\"calendarIconUrl()\" class=\"date-picker-icon\" [src]=\"calendarIconUrl()\"\n (click)=\"dp.click()\" />\n </div>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n\n <!-- fieldType: 'boolean' fieldInputType: 'toggle' -->\n <ng-container *ngIf=\"field.fieldType === 'boolean' && field.fieldInputType === 'toggle'\">\n <ng-container *ngIf=\"customBooleanToggle; else defaultBooleanToggle\">\n <ng-template\n [ngTemplateOutlet]=\"customBooleanToggle\"\n [ngTemplateOutletContext]=\"{ field: field, control: control, formgroup: formgroup }\"\n ></ng-template>\n </ng-container>\n <ng-template #defaultBooleanToggle>\n <div class=\"dynamic-field single-line-field-container\"\n [ngStyle]=\"{'border-bottom': (formgroup?.controls?.subFields?.controls?.length && removeSepratorForSubFields) ? 'none':''}\">\n <p class=\"h6\">\n {{ field.title }}<span *ngIf=\"field.validators && field.validators.length > 0\"> *</span>\n </p>\n <mis-switch [control]=\"control\" (valueChanged)=\"updateSubDynamicFields(field, formgroup, $event)\"></mis-switch>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div> \n </ng-template>\n </ng-container>\n\n <!-- fieldType: 'singleSelect' fieldInputType: 'dropdown' -->\n <ng-container *ngIf=\"field.fieldType === 'singleSelect' && field.fieldInputType === 'dropdown'\">\n <ng-container *ngIf=\"customSingleSelectDropdown; else defaultSingleSelectDropdown\">\n <ng-template\n [ngTemplateOutlet]=\"customSingleSelectDropdown\"\n [ngTemplateOutletContext]=\"{ field: field, control: control, formgroup: formgroup }\"\n ></ng-template>\n </ng-container>\n <ng-template #defaultSingleSelectDropdown>\n <div class=\"dynamic-field single-line-field-container\"\n [ngStyle]=\"{'border-bottom': (formgroup?.controls?.subFields?.controls?.length && removeSepratorForSubFields) ? 'none':''}\">\n <p class=\"h6\">\n {{ field.title }}<span *ngIf=\"field.validators && field.validators.length > 0\"> *</span>\n </p>\n <div [ngClass]=\"{'removeable-container' : field?.isRemoveable}\">\n <mis-dropdown [searchEnabled]=\"false\" [width]=\"'140px'\" [data]=\"field.itemsList\" [selectedItem]=\"control.value\"\n (onChange)=\"updateSelectedValueForSingleSelect(field, control, formgroup, $event);\">\n </mis-dropdown>\n <img *ngIf=\"field.isRemoveable && removeIconUrl()\" class=\"remove-icon\" [src]=\"removeIconUrl()\" (click)=\"fieldRemoved.emit(field)\">\n </div>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n </ng-template>\n </ng-container >\n \n\n <!-- fieldType: 'singleSelect' fieldInputType: 'radio' -->\n <ng-container *ngIf=\"field.fieldType === 'singleSelect' && field.fieldInputType === 'radio'\">\n <ng-container *ngIf=\"customSingleSelectRadio; else defaultSingleSelectRadio\">\n <ng-template\n [ngTemplateOutlet]=\"customSingleSelectRadio\"\n [ngTemplateOutletContext]=\"{ field: field, control: control, formgroup: formgroup }\"\n ></ng-template>\n </ng-container>\n <ng-template #defaultSingleSelectRadio>\n <div class=\"dynamic-field multi-line-field-container\"\n [ngStyle]=\"{'border-bottom': (formgroup?.controls?.subFields?.controls?.length && removeSepratorForSubFields) ? 'none':''}\">\n <p class=\"h7 field-title-sm\">\n {{ field.title }}<span *ngIf=\"field.validators && field.validators.length > 0\"> *</span>\n </p>\n <div style=\"flex-basis: 100%\"></div>\n <div id=\"checkboxes-container\">\n <div class=\"radio-checkbox-common\" *ngFor=\"let item of field.itemsList\"\n [ngClass]=\"{ 'checkbox-active': item.label === control.value?.label }\"\n (click)=\"updateSelectedValueForSingleSelect(field, control, formgroup, item);\">\n <img *ngIf=\"(item.label === control.value?.label) && activeBtnIconUrl()\" [src]=\"activeBtnIconUrl()\" alt=\"\" />\n <p class=\"h6\">{{ item.label }}</p>\n </div>\n </div>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n \n\n <!-- fieldType: 'multiSelect' fieldInputType: 'checkbox' -->\n <ng-container *ngIf=\"field.fieldType === 'multiSelect' && field.fieldInputType === 'checkbox'\">\n <ng-container *ngIf=\"customMultiSelectCheckbox; else defaultMultiSelectCheckbox\">\n <ng-template\n [ngTemplateOutlet]=\"customMultiSelectCheckbox\"\n [ngTemplateOutletContext]=\"{ field: field, control: control, formgroup: formgroup }\"\n ></ng-template>\n </ng-container>\n <ng-template #defaultMultiSelectCheckbox>\n <div class=\"dynamic-field multi-line-field-container\"\n [ngStyle]=\"{'border-bottom': (formgroup?.controls?.subFields?.controls?.length && removeSepratorForSubFields) ? 'none':''}\">\n <p class=\"h7 field-title-sm\">\n {{ field.title }}<span *ngIf=\"field.validators && field.validators.length > 0\"> *</span>\n </p>\n <div style=\"flex-basis: 100%\"></div>\n <div id=\"checkboxes-container\">\n <div class=\"radio-checkbox-common\" *ngFor=\"let item of field.itemsList\"\n [ngClass]=\"{ 'checkbox-active': isCheckBoxSelected(item.label, control.value) }\"\n (click)=\"updateSelectedValueForMultiSelect(field, control, formgroup, [item])\">\n <img *ngIf=\"isCheckBoxSelected(item.label, control.value) && activeBtnIconUrl()\" [src]=\"activeBtnIconUrl()\"\n alt=\"\" />\n <p class=\"h6\">{{ item.label }}</p>\n </div>\n </div>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n\n\n <!-- fieldType: 'multiSelect' fieldInputType: 'dropdown' -->\n <ng-container *ngIf=\"field.fieldType === 'multiSelect' && field.fieldInputType === 'dropdown'\">\n <ng-container *ngIf=\"customMultiSelectDropdown; else defaultMultiSelectDropdown\">\n <ng-template\n [ngTemplateOutlet]=\"customMultiSelectDropdown\"\n [ngTemplateOutletContext]=\"{ field: field, control: control, formgroup: formgroup }\"\n ></ng-template>\n </ng-container>\n <ng-template #defaultMultiSelectDropdown>\n <div class=\"dynamic-field single-line-field-container\"\n [ngStyle]=\"{'border-bottom': (formgroup?.controls?.subFields?.controls?.length && removeSepratorForSubFields) ? 'none':''}\">\n <p class=\"h6\">\n {{ field.title }}<span *ngIf=\"field.validators && field.validators.length > 0\"> *</span>\n </p>\n <mis-multi-select-dropdown [width]=\"'140px'\" [showSelectedCount]=\"true\" [dropdownListWidth]=\"'256px'\"\n [searchEnabled]=\"false\" [hideApplyButton]=\"true\" [data]=\"field.itemsList\"\n [selectedItems]=\"control.value\" (onChange)=\"updateSelectedValueForMultiSelect(field, control, formgroup, $event);\"></mis-multi-select-dropdown>\n <ng-container *ngIf=\"control.touched && control.errors\" [ngTemplateOutlet]=\"dynamicFieldErrors\"\n [ngTemplateOutletContext]=\"{ $implicit: control.errors }\">\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n\n</ng-template>\n\n<ng-template #dynamicFieldErrors let-errors>\n <div id=\"error-messages-container\">\n <ng-container *ngFor=\"let error of errors | keyvalue\">\n <p class=\"h8\">\n {{\" \u2022 \" + error.value}}\n </p>\n <div [ngStyle]=\"{ 'flex-basis': '100%', 'height': '0' }\"></div>\n </ng-container>\n </div>\n</ng-template>", styles: [":root{--pmry-200: #99BAF7;--pmry-100: #CBDDFB;--pmry-500: #0937B2;--pmry-400: #3C68D0;--pmry-600: #062A99;--pmry-700: #041F80;--pmry-300: #638FE7;--pmry-800: #021567;--pmry-900: #010F55;--sec-d-purple: #40447F;--sec-maroon: #6B034E;--sec-mud-red: #B23600;--sec-orange: #ED711C;--sec-purple: #815FD5;--sec-teal: #10ADAE;--sec-yellow: #D4900C;--sec-green: #547F40;--sec-bright-green: #27D22E;--sec-dark-teal: #035F6B;--sec-chocolate: #7C2F33;--sec-rube-pink: #C13D6D;--sec-cerulean: #0087B2;--sem-error: #B00020;--sem-info: #0091FF;--sem-warning: #FF9D00;--sem-success: #38AF49;--grey-bg-1: #FAFAFA;--grey-bg: #F5F5F5;--grey-seperators: #E0E0E0;--grey-disabled: #C8CDD3;--grey-hover: #F5F7FC;--grey-pressed: #E6EBF7;--grey-row: #F5F7FC;--dec-light-yellow: #F4E7C3;--dec-light-purple: #DACFF9;--dec-light-green: #E4F5E9;--dec-light-green2: #F1FFF3;--dec-light-pink: #FAE1EA;--dec-: #F4CBC1;--dec-lt-orange: #FAEFED;--dec-light-blue: #CFECF9;--dec-row-selection: #F1FDF8;--dec-row-selection2: #F2FBFF;--dec-row-lines: #D3E1E9;--text-white: #FFFFFF;--text-muted: #6A737D;--text-black: #181F33;--MR-solid-blue2:#C8D5F6;--MR-solid-purple:#C9C3FB;--MR-solid-orange:#EEAC9F;--MR-solid-green:#ACDADA;--MR-solid-brown:#E8C8AF;--MR-solid-yellow:#FFEFC7;--MR-solid-blue:#BBE6FF;--MR-solid-pink:#FFC6F2;--tr-hover:#F0F3FA;--tr-pressed:#DAE1F3;--brand-primary: #0937B2;--brand-primary-light: #3C68D0;--brand-primary-dark: #062A99;--brand-primary-darker: #041F80;--brand-primary-lighter: #638FE7;--brand-primary-lightest: #CBDDFB;--brand-primary-hover: #F0F3FA;--brand-primary-active: #DAE1F3;--brand-secondary: #ED711C;--brand-secondary-light: #F09E65;--brand-secondary-dark: #B23600;--brand-secondary-lighter: #FFC6F2;--brand-accent: #10ADAE;--brand-accent-light: #16CBBC;--brand-accent-dark: #035F6B;--brand-accent-lighter: #ACDADA;--brand-success: #38AF49;--brand-success-light: #4CAF50;--brand-success-dark: #216531;--brand-success-lighter: #E4F5E9;--brand-success-lightest: #F1FFF3;--brand-error: #B00020;--brand-error-light: #F04E4E;--brand-error-dark: #A60060;--brand-error-lighter: #FAE1EA;--brand-error-lightest: #FDF2F2;--brand-warning: #FF9D00;--brand-warning-light: #D4900C;--brand-warning-dark: #624000;--brand-warning-lighter: #F4E7C3;--brand-warning-lightest: #FAEFED;--brand-info: #0091FF;--brand-info-light: #35A1FF;--brand-info-dark: #0087B2;--brand-info-lighter: #CFECF9;--text-primary: #181F33;--text-secondary: #6A737D;--text-tertiary: #929DAB;--text-disabled: #929DAB;--text-primary-87: rgba(24, 31, 51, .87);--text-primary-60: rgba(24, 31, 51, .6);--text-primary-38: rgba(24, 31, 51, .38);--text-primary-12: rgba(24, 31, 51, .12);--bg-primary: #FFFFFF;--bg-secondary: #FAFAFA;--bg-tertiary: #F5F5F5;--bg-overlay: rgba(0, 0, 0, .32);--bg-overlay-light: rgba(0, 0, 0, .12);--bg-overlay-lighter: rgba(0, 0, 0, .08);--bg-overlay-lightest: rgba(0, 0, 0, .04);--border-primary: #E0E0E0;--border-secondary: #D6DCE2;--border-tertiary: #C8CDD3;--border-light: #F1F4F8;--border-primary-12: rgba(0, 0, 0, .12);--border-primary-08: rgba(0, 0, 0, .08);--border-primary-06: rgba(0, 0, 0, .06);--shadow-primary: rgba(0, 0, 0, .12);--shadow-secondary: rgba(0, 0, 0, .08);--shadow-tertiary: rgba(0, 0, 0, .04);--shadow-light: rgba(0, 0, 0, .06);--status-available: #929DAB;--status-unavailable: #CCD3DA;--status-hotseat: #857BFF;--status-multiteam: #10ADAE;--status-selected: #10ADAE;--status-upcoming: #D4900C;--status-room: #38AF49;--status-room-booked: #B23600;--status-room-unavailable: #181F33;--team-color-1: #F8C52E;--team-color-2: #FA8E20;--team-color-3: #987CDD;--team-color-4: #16CBBC;--team-color-5: #E65010;--team-color-6: #A60060;--team-color-7: #ED323B;--team-color-8: #35A1FF;--team-color-9: #80D348}p{margin:0;cursor:default}::ng-deep .main-container{margin:0;max-width:100%}.sub-dynamic-form{padding-left:24px;border-bottom:1px solid var(--border-primary, #E0E0E0)}.dynamic-field ::ng-deep .container{height:32px!important}.single-line-field-container{display:flex;justify-content:space-between;align-items:center;padding:28px 16px;border-bottom:1px solid var(--border-primary, #E0E0E0)}.multi-line-field-container{display:flex;justify-content:flex-start;align-items:flex-start;padding:28px 16px;flex-wrap:wrap;border-bottom:1px solid var(--border-primary, #E0E0E0)}.field-title-sm{margin-bottom:8px;cursor:default}.input-field{width:100%;background-color:var(--bg-secondary, #FAFAFA);border:1px solid var(--border-primary, #E0E0E0);border-radius:6px}.ip-text{height:44px;padding:8px 12px}.ip-textarea{max-height:94px;padding:8px}input:focus{outline:none}input::placeholder{color:var(--border-primary, #E0E0E0)}textarea:focus{outline:none}.date-picker-container{position:relative;width:140px}.date-picker-container .date-picker{cursor:pointer;height:32px;width:100%;font-size:14px;border-radius:6px;padding:0 12px;border:1px solid var(--border-primary, #E0E0E0);inset:10px auto auto 80px;background-color:var(--bg-primary, #FFFFFF)}.date-picker-container .date-picker:hover{background-color:var(--brand-primary-hover, #F0F3FA)}.date-picker-container .date-picker-icon{position:absolute;top:50%;right:12px;transform:translateY(-50%);cursor:pointer}form .dynamic-field:last-child{border-bottom:none!important}#checkboxes-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.radio-checkbox-common{display:flex;justify-content:center;align-items:center;cursor:pointer;margin-right:8px;margin-bottom:8px;background-color:var(--bg-primary, #FFFFFF);padding:12px 16px;border:1px solid var(--text-secondary, #6A737D);border-radius:8px}.radio-checkbox-common p{color:var(--text-secondary, #6A737D);cursor:pointer}.radio-checkbox-common img{margin-right:8px}.checkbox-active{background-color:var(--brand-primary, #0937B2)}.checkbox-active p{color:var(--bg-primary, #FFFFFF)}#error-messages-container{margin-top:4px;width:100%;display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}#error-messages-container p{color:var(--brand-error, #B00020)}.removeable-container{display:flex;justify-content:center;align-items:center}.removeable-container .remove-icon{cursor:pointer;margin-left:8px;max-width:24px}span{color:var(--brand-error, #B00020)}\n"] }]
|
|
1183
1077
|
}], () => [], { customInputTextNumber: [{
|
|
1184
1078
|
type: ContentChild,
|
|
1185
1079
|
args: ["customInputTextNumber", { static: false }]
|