ngx-t-forms 2.0.8 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/fesm2022/{ngx-t-forms-api-value-access-rules.component-B9s7Hx-j.mjs → ngx-t-forms-api-value-access-rules.component-DjZDnTHz.mjs} +11 -11
  2. package/fesm2022/{ngx-t-forms-api-value-access-rules.component-B9s7Hx-j.mjs.map → ngx-t-forms-api-value-access-rules.component-DjZDnTHz.mjs.map} +1 -1
  3. package/fesm2022/ngx-t-forms-api-value-access-rules.component-Zg1ddSDb.mjs +813 -0
  4. package/fesm2022/ngx-t-forms-api-value-access-rules.component-Zg1ddSDb.mjs.map +1 -0
  5. package/fesm2022/{ngx-t-forms-calculated-field-rules.component-vhdr4NMu.mjs → ngx-t-forms-calculated-field-rules.component-E3l7DQo7.mjs} +11 -11
  6. package/fesm2022/{ngx-t-forms-calculated-field-rules.component-vhdr4NMu.mjs.map → ngx-t-forms-calculated-field-rules.component-E3l7DQo7.mjs.map} +1 -1
  7. package/fesm2022/ngx-t-forms-calculated-field-rules.component-ZepKycLR.mjs +532 -0
  8. package/fesm2022/ngx-t-forms-calculated-field-rules.component-ZepKycLR.mjs.map +1 -0
  9. package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-DLnB3R7t.mjs +297 -0
  10. package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-DLnB3R7t.mjs.map +1 -0
  11. package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-Br3EWLav.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-sOC54w4T.mjs} +9 -9
  12. package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-Br3EWLav.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-sOC54w4T.mjs.map} +1 -1
  13. package/fesm2022/ngx-t-forms-form-input-selector.component-BjwzDiCY.mjs +187 -0
  14. package/fesm2022/ngx-t-forms-form-input-selector.component-BjwzDiCY.mjs.map +1 -0
  15. package/fesm2022/{ngx-t-forms-form-input-selector.component-CR3ZVWLw.mjs → ngx-t-forms-form-input-selector.component-CB03sPjA.mjs} +6 -6
  16. package/fesm2022/{ngx-t-forms-form-input-selector.component-CR3ZVWLw.mjs.map → ngx-t-forms-form-input-selector.component-CB03sPjA.mjs.map} +1 -1
  17. package/fesm2022/{ngx-t-forms-form-json-view.component-CMdtaqhR.mjs → ngx-t-forms-form-json-view.component-C1AZujJH.mjs} +2 -2
  18. package/fesm2022/{ngx-t-forms-form-json-view.component-CMdtaqhR.mjs.map → ngx-t-forms-form-json-view.component-C1AZujJH.mjs.map} +1 -1
  19. package/fesm2022/ngx-t-forms-form-json-view.component-CqtTYCRH.mjs +28 -0
  20. package/fesm2022/ngx-t-forms-form-json-view.component-CqtTYCRH.mjs.map +1 -0
  21. package/fesm2022/ngx-t-forms-form-section-stepper.component-Ba5WCLzp.mjs +673 -0
  22. package/fesm2022/ngx-t-forms-form-section-stepper.component-Ba5WCLzp.mjs.map +1 -0
  23. package/fesm2022/ngx-t-forms-form-section-stepper.component-C_dciQhe.mjs +225 -0
  24. package/fesm2022/ngx-t-forms-form-section-stepper.component-C_dciQhe.mjs.map +1 -0
  25. package/fesm2022/{ngx-t-forms-forms-builder-menu.component-pWNcCGY8.mjs → ngx-t-forms-forms-builder-menu.component-CPIcPREp.mjs} +10 -10
  26. package/fesm2022/{ngx-t-forms-forms-builder-menu.component-pWNcCGY8.mjs.map → ngx-t-forms-forms-builder-menu.component-CPIcPREp.mjs.map} +1 -1
  27. package/fesm2022/ngx-t-forms-forms-builder-menu.component-DbxEBvpt.mjs +735 -0
  28. package/fesm2022/ngx-t-forms-forms-builder-menu.component-DbxEBvpt.mjs.map +1 -0
  29. package/fesm2022/ngx-t-forms-input-editor.component-BnsC-jsN.mjs +445 -0
  30. package/fesm2022/ngx-t-forms-input-editor.component-BnsC-jsN.mjs.map +1 -0
  31. package/fesm2022/{ngx-t-forms-input-editor.component-_ER-4SAR.mjs → ngx-t-forms-input-editor.component-__grERM8.mjs} +5 -5
  32. package/fesm2022/{ngx-t-forms-input-editor.component-_ER-4SAR.mjs.map → ngx-t-forms-input-editor.component-__grERM8.mjs.map} +1 -1
  33. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-DS6s98ZX.mjs +111 -0
  34. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-DS6s98ZX.mjs.map +1 -0
  35. package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-Bq0rr62p.mjs → ngx-t-forms-mat-chip-list-editor.component-DcdHYqhN.mjs} +2 -2
  36. package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-Bq0rr62p.mjs.map → ngx-t-forms-mat-chip-list-editor.component-DcdHYqhN.mjs.map} +1 -1
  37. package/fesm2022/{ngx-t-forms-mat-slider-editor.component-BOT4I9Wg.mjs → ngx-t-forms-mat-slider-editor.component-C9rintm4.mjs} +2 -2
  38. package/fesm2022/{ngx-t-forms-mat-slider-editor.component-BOT4I9Wg.mjs.map → ngx-t-forms-mat-slider-editor.component-C9rintm4.mjs.map} +1 -1
  39. package/fesm2022/ngx-t-forms-mat-slider-editor.component-ChiiJYK2.mjs +130 -0
  40. package/fesm2022/ngx-t-forms-mat-slider-editor.component-ChiiJYK2.mjs.map +1 -0
  41. package/fesm2022/{ngx-t-forms-mat-slider-toggle-editor.component-CawhiguI.mjs → ngx-t-forms-mat-slider-toggle-editor.component-CItK6kXf.mjs} +2 -2
  42. package/fesm2022/{ngx-t-forms-mat-slider-toggle-editor.component-CawhiguI.mjs.map → ngx-t-forms-mat-slider-toggle-editor.component-CItK6kXf.mjs.map} +1 -1
  43. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-DFcLzkSF.mjs +171 -0
  44. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-DFcLzkSF.mjs.map +1 -0
  45. package/fesm2022/ngx-t-forms-missing-form-configs.component-DNkGCH0e.mjs +104 -0
  46. package/fesm2022/ngx-t-forms-missing-form-configs.component-DNkGCH0e.mjs.map +1 -0
  47. package/fesm2022/{ngx-t-forms-missing-form-configs.component-DEx_YKAi.mjs → ngx-t-forms-missing-form-configs.component-Da3SdUn6.mjs} +4 -4
  48. package/fesm2022/{ngx-t-forms-missing-form-configs.component-DEx_YKAi.mjs.map → ngx-t-forms-missing-form-configs.component-Da3SdUn6.mjs.map} +1 -1
  49. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-4hrEpLk3.mjs +258 -0
  50. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-4hrEpLk3.mjs.map +1 -0
  51. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-CrHAIRAw.mjs +455 -0
  52. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-CrHAIRAw.mjs.map +1 -0
  53. package/fesm2022/{ngx-t-forms-ngx-t-forms-R8Bkco8q.mjs → ngx-t-forms-ngx-t-forms-1Roar4qK.mjs} +630 -175
  54. package/fesm2022/ngx-t-forms-ngx-t-forms-1Roar4qK.mjs.map +1 -0
  55. package/fesm2022/ngx-t-forms-ngx-t-forms-DaAFB-HX.mjs +14694 -0
  56. package/fesm2022/ngx-t-forms-ngx-t-forms-DaAFB-HX.mjs.map +1 -0
  57. package/fesm2022/{ngx-t-forms-pipeline-generator.component-CDCDamaQ.mjs → ngx-t-forms-pipeline-generator.component-BQDykLNH.mjs} +13 -13
  58. package/fesm2022/{ngx-t-forms-pipeline-generator.component-CDCDamaQ.mjs.map → ngx-t-forms-pipeline-generator.component-BQDykLNH.mjs.map} +1 -1
  59. package/fesm2022/ngx-t-forms-pipeline-generator.component-U0d8jQKW.mjs +1362 -0
  60. package/fesm2022/ngx-t-forms-pipeline-generator.component-U0d8jQKW.mjs.map +1 -0
  61. package/fesm2022/{ngx-t-forms-required-inputs.component-zHQPB3m_.mjs → ngx-t-forms-required-inputs.component-BGK3DNu0.mjs} +10 -10
  62. package/fesm2022/{ngx-t-forms-required-inputs.component-zHQPB3m_.mjs.map → ngx-t-forms-required-inputs.component-BGK3DNu0.mjs.map} +1 -1
  63. package/fesm2022/ngx-t-forms-required-inputs.component-S3cbA-zG.mjs +383 -0
  64. package/fesm2022/ngx-t-forms-required-inputs.component-S3cbA-zG.mjs.map +1 -0
  65. package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-CKStotqz.mjs → ngx-t-forms-rest-api-call-setup.component-CCaRUSVQ.mjs} +4 -4
  66. package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-CKStotqz.mjs.map → ngx-t-forms-rest-api-call-setup.component-CCaRUSVQ.mjs.map} +1 -1
  67. package/fesm2022/ngx-t-forms-rest-api-call-setup.component-DDg4fCFx.mjs +457 -0
  68. package/fesm2022/ngx-t-forms-rest-api-call-setup.component-DDg4fCFx.mjs.map +1 -0
  69. package/fesm2022/{ngx-t-forms-section-report.component-Us4jxjhq.mjs → ngx-t-forms-section-report.component-C8Ja_G_3.mjs} +5 -5
  70. package/fesm2022/{ngx-t-forms-section-report.component-Us4jxjhq.mjs.map → ngx-t-forms-section-report.component-C8Ja_G_3.mjs.map} +1 -1
  71. package/fesm2022/ngx-t-forms-section-report.component-C_h0KIR4.mjs +314 -0
  72. package/fesm2022/ngx-t-forms-section-report.component-C_h0KIR4.mjs.map +1 -0
  73. package/fesm2022/ngx-t-forms-selection-options-editor.component-CllhwZ5Y.mjs +231 -0
  74. package/fesm2022/ngx-t-forms-selection-options-editor.component-CllhwZ5Y.mjs.map +1 -0
  75. package/fesm2022/{ngx-t-forms-selection-options-editor.component-BwFboSq2.mjs → ngx-t-forms-selection-options-editor.component-cYkn1O48.mjs} +5 -5
  76. package/fesm2022/{ngx-t-forms-selection-options-editor.component-BwFboSq2.mjs.map → ngx-t-forms-selection-options-editor.component-cYkn1O48.mjs.map} +1 -1
  77. package/fesm2022/ngx-t-forms-validators-config.component-BPJZRtjT.mjs +434 -0
  78. package/fesm2022/ngx-t-forms-validators-config.component-BPJZRtjT.mjs.map +1 -0
  79. package/fesm2022/{ngx-t-forms-validators-config.component-CX0M2OH1.mjs → ngx-t-forms-validators-config.component-CGXCCl45.mjs} +7 -7
  80. package/fesm2022/{ngx-t-forms-validators-config.component-CX0M2OH1.mjs.map → ngx-t-forms-validators-config.component-CGXCCl45.mjs.map} +1 -1
  81. package/fesm2022/ngx-t-forms.mjs +1 -1
  82. package/lib/components/form-builder/elements/form-section-stepper/form-section-stepper.component.d.ts +2 -0
  83. package/lib/components/form-builder/elements/form-submissions-config/form-submissions-config.component.d.ts +1 -1
  84. package/lib/components/form-builder/elements/input-element-editor/input-element-editor.component.d.ts +2 -2
  85. package/lib/components/forms/forms.component.d.ts +1 -1
  86. package/lib/components/forms/store/Form-actions-formBuilder.d.ts +1 -0
  87. package/lib/components/forms/store/Form-selectors-FormBuilder.d.ts +1 -1
  88. package/lib/components/forms/store/forms-store.service.d.ts +2 -1
  89. package/lib/components/index.d.ts +2 -1
  90. package/lib/components/t-dynamic-data-edit/elements/mscoa-segment-config/mscoa-segment-config.component.d.ts +5 -9
  91. package/lib/components/t-form-input/elements/mscoa-form-input/elements/account-value/account-value.component.d.ts +3 -3
  92. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/mscoa-chart.component.d.ts +67 -52
  93. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-computation/mscoa-computation.component.d.ts +10 -10
  94. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-reactive-form-field/mscoa-reactive-form-field.component.d.ts +8 -6
  95. package/lib/components/t-form-input/elements/mscoa-form-input/elements/scoa-account-table/scoa-account-table.component.d.ts +8 -8
  96. package/lib/components/t-form-input/elements/mscoa-form-input/elements/scoa-input/scoa-input.component.d.ts +1 -1
  97. package/lib/components/t-form-input/elements/mscoa-form-input/mscoa-form-input.component.d.ts +4 -3
  98. package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-actions.d.ts +5 -5
  99. package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-component-store.service.d.ts +27 -31
  100. package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-effects.d.ts +2 -2
  101. package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-selectors.d.ts +20 -24
  102. package/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-table-edit/multiple-input-table-edit.component.d.ts +1 -1
  103. package/lib/components/t-form-input/elements/select-input-element/elements/select-input/select-input.component.d.ts +20 -0
  104. package/lib/components/t-form-input/elements/select-input-element/select-input-element.component.d.ts +0 -3
  105. package/lib/components/t-form-input/t-form-input.component.d.ts +3 -2
  106. package/lib/components/workflow-builder/store/workflow-builder-store.service.d.ts +18 -0
  107. package/lib/components/workflow-builder/store/workflowEditorActions.d.ts +4 -0
  108. package/lib/components/workflow-builder/store/workflowEditorEffects.d.ts +2 -0
  109. package/lib/components/workflow-builder/store/workflowEditorSelectors.d.ts +2 -0
  110. package/lib/components/workflow-builder/workflow-builder.component.d.ts +12 -0
  111. package/lib/services/core/t-form-builder/functions/addScoaExtensionInput.d.ts +2 -0
  112. package/lib/services/core/t-form-tower-controller/functions/allFormInputs.d.ts +2 -3
  113. package/lib/services/core/t-form-tower-controller/functions/getAllFunctionTypes.d.ts +2 -0
  114. package/package.json +3 -2
  115. package/fesm2022/ngx-t-forms-form-section-stepper.component-DEtijO30.mjs +0 -220
  116. package/fesm2022/ngx-t-forms-form-section-stepper.component-DEtijO30.mjs.map +0 -1
  117. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-CYWVyEYn.mjs +0 -230
  118. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-CYWVyEYn.mjs.map +0 -1
  119. package/fesm2022/ngx-t-forms-ngx-t-forms-R8Bkco8q.mjs.map +0 -1
@@ -0,0 +1,735 @@
1
+ import * as i2$1 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { inject, Component, computed } from '@angular/core';
5
+ import { g as getAvatar, F as FormsStoreService, M as MatModulesModule, D as DaysAgoPipe, N as NGX_T_FORMS_CONFIG_TOKEN, t as testAgainstItem, a as assignDeepPropertyToObject, T as TDynamicDataEditComponent } from './ngx-t-forms-ngx-t-forms-DaAFB-HX.mjs';
6
+ import { of, map, combineLatest, take } from 'rxjs';
7
+ import * as i1 from '@angular/material/dialog';
8
+ import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from '@angular/material/dialog';
9
+ import * as i2 from '@angular/material/button';
10
+ import * as i4 from '@angular/material/divider';
11
+ import * as i6 from '@angular/material/icon';
12
+ import * as i6$1 from '@angular/material/list';
13
+ import * as i7 from '@angular/material/progress-spinner';
14
+ import * as i8 from '@angular/material/tooltip';
15
+ import { ElementEditorTypes, SpecialElementKeys, validateApiDataFetchingConfiguration } from 'ngx-t-forms-types';
16
+ import { toSignal } from '@angular/core/rxjs-interop';
17
+ import * as i5 from '@angular/material/expansion';
18
+ import * as i3 from '@angular/material/form-field';
19
+ import * as i9 from '@angular/material/toolbar';
20
+ import * as i3$2 from '@angular/material/badge';
21
+ import * as i6$2 from '@angular/material/menu';
22
+ import * as i12 from '@angular/cdk/clipboard';
23
+ import * as i2$2 from '@angular/cdk/drag-drop';
24
+ import * as i3$1 from '@angular/material/card';
25
+
26
+ const _forTrack0$1 = ($index, $item) => $item._id;
27
+ function SelectFormTemplateComponent_Conditional_5_Template(rf, ctx) { if (rf & 1) {
28
+ i0.ɵɵelementStart(0, "div", 1);
29
+ i0.ɵɵelement(1, "mat-spinner", 4);
30
+ i0.ɵɵelementStart(2, "span");
31
+ i0.ɵɵtext(3, " Loading form templates... ");
32
+ i0.ɵɵelementEnd()();
33
+ } }
34
+ function SelectFormTemplateComponent_Conditional_7_For_2_Conditional_7_Template(rf, ctx) { if (rf & 1) {
35
+ i0.ɵɵelementStart(0, "span")(1, "mat-icon", 13);
36
+ i0.ɵɵtext(2, "error");
37
+ i0.ɵɵelementEnd();
38
+ i0.ɵɵelementStart(3, "small");
39
+ i0.ɵɵtext(4);
40
+ i0.ɵɵelementEnd()();
41
+ i0.ɵɵelementStart(5, "span", 12);
42
+ i0.ɵɵtext(6, "\u2022");
43
+ i0.ɵɵelementEnd();
44
+ } if (rf & 2) {
45
+ const form_r2 = i0.ɵɵnextContext().$implicit;
46
+ i0.ɵɵadvance(4);
47
+ i0.ɵɵtextInterpolate(form_r2.errors.length);
48
+ } }
49
+ function SelectFormTemplateComponent_Conditional_7_For_2_Template(rf, ctx) { if (rf & 1) {
50
+ const _r1 = i0.ɵɵgetCurrentView();
51
+ i0.ɵɵelementStart(0, "mat-list-item", 7);
52
+ i0.ɵɵlistener("click", function SelectFormTemplateComponent_Conditional_7_For_2_Template_mat_list_item_click_0_listener() { const form_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.selectForm(form_r2)); });
53
+ i0.ɵɵelement(1, "img", 8);
54
+ i0.ɵɵelementStart(2, "div", 9)(3, "div", 10);
55
+ i0.ɵɵtext(4);
56
+ i0.ɵɵpipe(5, "titlecase");
57
+ i0.ɵɵelementEnd();
58
+ i0.ɵɵelementStart(6, "div", 11);
59
+ i0.ɵɵtemplate(7, SelectFormTemplateComponent_Conditional_7_For_2_Conditional_7_Template, 7, 1);
60
+ i0.ɵɵelementStart(8, "span")(9, "mat-icon");
61
+ i0.ɵɵtext(10, "add_circle_outline");
62
+ i0.ɵɵelementEnd();
63
+ i0.ɵɵelementStart(11, "small");
64
+ i0.ɵɵtext(12);
65
+ i0.ɵɵpipe(13, "daysAgo");
66
+ i0.ɵɵelementEnd()();
67
+ i0.ɵɵelementStart(14, "span", 12);
68
+ i0.ɵɵtext(15, "\u2022");
69
+ i0.ɵɵelementEnd();
70
+ i0.ɵɵelementStart(16, "span")(17, "mat-icon");
71
+ i0.ɵɵtext(18, "update");
72
+ i0.ɵɵelementEnd();
73
+ i0.ɵɵelementStart(19, "small");
74
+ i0.ɵɵtext(20);
75
+ i0.ɵɵpipe(21, "daysAgo");
76
+ i0.ɵɵelementEnd()()()()();
77
+ } if (rf & 2) {
78
+ const form_r2 = ctx.$implicit;
79
+ const ctx_r2 = i0.ɵɵnextContext(2);
80
+ i0.ɵɵclassProp("mat-elevation-z1", true);
81
+ i0.ɵɵproperty("matTooltip", "Click to select this template");
82
+ i0.ɵɵadvance();
83
+ i0.ɵɵclassProp("error", form_r2.errors.length > 0);
84
+ i0.ɵɵproperty("src", ctx_r2.getFormAvatar(form_r2.formTitle), i0.ɵɵsanitizeUrl)("alt", "form image " + form_r2.formTitle);
85
+ i0.ɵɵadvance(3);
86
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(5, 11, form_r2.formTitle));
87
+ i0.ɵɵadvance(3);
88
+ i0.ɵɵconditional(form_r2.errors.length > 0 ? 7 : -1);
89
+ i0.ɵɵadvance(5);
90
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(13, 13, form_r2.createdAt));
91
+ i0.ɵɵadvance(8);
92
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(21, 15, form_r2.updatedAt), "");
93
+ } }
94
+ function SelectFormTemplateComponent_Conditional_7_Conditional_4_Template(rf, ctx) { if (rf & 1) {
95
+ i0.ɵɵelementStart(0, "p");
96
+ i0.ɵɵtext(1, " No form templates available. ");
97
+ i0.ɵɵelementEnd();
98
+ } }
99
+ function SelectFormTemplateComponent_Conditional_7_Template(rf, ctx) { if (rf & 1) {
100
+ i0.ɵɵelementStart(0, "mat-nav-list", 5);
101
+ i0.ɵɵrepeaterCreate(1, SelectFormTemplateComponent_Conditional_7_For_2_Template, 22, 17, "mat-list-item", 6, _forTrack0$1);
102
+ i0.ɵɵpipe(3, "async");
103
+ i0.ɵɵelementEnd();
104
+ i0.ɵɵtemplate(4, SelectFormTemplateComponent_Conditional_7_Conditional_4_Template, 2, 0, "p");
105
+ i0.ɵɵpipe(5, "async");
106
+ } if (rf & 2) {
107
+ let tmp_2_0;
108
+ const ctx_r2 = i0.ɵɵnextContext();
109
+ i0.ɵɵadvance();
110
+ i0.ɵɵrepeater(i0.ɵɵpipeBind1(3, 1, ctx_r2.selectForms$));
111
+ i0.ɵɵadvance(3);
112
+ i0.ɵɵconditional(((tmp_2_0 = i0.ɵɵpipeBind1(5, 3, ctx_r2.selectForms$)) == null ? null : tmp_2_0.length) === 0 ? 4 : -1);
113
+ } }
114
+ class SelectFormTemplateComponent {
115
+ constructor(store) {
116
+ this.store = store;
117
+ this.selectForms$ = this.store.selectors.selectForms$;
118
+ this.selectLoadingForms$ = this.store.selectors.selectLoadingForms$;
119
+ this.dialogRef = inject((MatDialogRef));
120
+ this.data = inject(MAT_DIALOG_DATA);
121
+ this.store.effects.loadForms$(of());
122
+ }
123
+ close() {
124
+ this.dialogRef.close();
125
+ }
126
+ selectForm(form) {
127
+ console.log(form);
128
+ this.dialogRef.close(form);
129
+ }
130
+ getFormAvatar(formTitle) {
131
+ return getAvatar(formTitle);
132
+ }
133
+ static { this.ɵfac = function SelectFormTemplateComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SelectFormTemplateComponent)(i0.ɵɵdirectiveInject(FormsStoreService)); }; }
134
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SelectFormTemplateComponent, selectors: [["lib-select-form-template"]], decls: 12, vars: 4, consts: [["mat-dialog-title", ""], [2, "display", "flex", "flex-direction", "column", "height", "calc(100% - 150px)", "justify-content", "center", "align-items", "center", "padding", "24px"], [3, "align"], ["mat-stroked-button", "", 2, "width", "100%", 3, "click"], [2, "margin-bottom", "16px"], [1, "form-template-list"], [1, "form-list-item", 3, "matTooltip", "mat-elevation-z1"], [1, "form-list-item", 3, "click", "matTooltip"], ["matListItemAvatar", "", 3, "src", "alt"], ["matListItemTitle", "", 1, "form-item-content"], [1, "form-title"], [1, "form-metadata"], [1, "metadata-divider"], ["color", "warn"]], template: function SelectFormTemplateComponent_Template(rf, ctx) { if (rf & 1) {
135
+ i0.ɵɵelementStart(0, "h2", 0);
136
+ i0.ɵɵtext(1, " Choose a Form Template\n");
137
+ i0.ɵɵelementEnd();
138
+ i0.ɵɵelementStart(2, "p");
139
+ i0.ɵɵtext(3, " Select a pre-built form template to start with. You can customize and save it as your own form after copying it to the editor. ");
140
+ i0.ɵɵelementEnd();
141
+ i0.ɵɵelementStart(4, "mat-dialog-content");
142
+ i0.ɵɵtemplate(5, SelectFormTemplateComponent_Conditional_5_Template, 4, 0, "div", 1);
143
+ i0.ɵɵpipe(6, "async");
144
+ i0.ɵɵtemplate(7, SelectFormTemplateComponent_Conditional_7_Template, 6, 5);
145
+ i0.ɵɵelementEnd();
146
+ i0.ɵɵelement(8, "mat-divider");
147
+ i0.ɵɵelementStart(9, "mat-dialog-actions", 2)(10, "button", 3);
148
+ i0.ɵɵlistener("click", function SelectFormTemplateComponent_Template_button_click_10_listener() { return ctx.close(); });
149
+ i0.ɵɵtext(11, " Close ");
150
+ i0.ɵɵelementEnd()();
151
+ } if (rf & 2) {
152
+ i0.ɵɵadvance(5);
153
+ i0.ɵɵconditional(i0.ɵɵpipeBind1(6, 2, ctx.selectLoadingForms$) ? 5 : 7);
154
+ i0.ɵɵadvance(4);
155
+ i0.ɵɵproperty("align", "end");
156
+ } }, dependencies: [MatModulesModule, i2.MatButton, i1.MatDialogTitle, i1.MatDialogActions, i1.MatDialogContent, i4.MatDivider, i6.MatIcon, i6$1.MatNavList, i6$1.MatListItem, i6$1.MatListItemAvatar, i6$1.MatListItemTitle, i7.MatProgressSpinner, i8.MatTooltip, CommonModule, i2$1.AsyncPipe, i2$1.TitleCasePipe, DaysAgoPipe], styles: ["p[_ngcontent-%COMP%]{max-width:368px;padding-right:28px;padding-left:28px}h2[_ngcontent-%COMP%]{margin-bottom:0}.form-list-item[_ngcontent-%COMP%]{margin:0;border-radius:8px!important;transition:background-color .2s ease;background:var(--mdc-elevated-card-container-color, var(--mat-app-surface-container-low));height:fit-content!important;min-width:280px;max-width:none;padding-top:8px;padding-bottom:8px}.form-metadata[_ngcontent-%COMP%]{color:#0009;font-size:14px;line-height:normal;display:flex}.form-metadata[_ngcontent-%COMP%] .metadata-divider[_ngcontent-%COMP%]{margin:0 8px}.form-metadata[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-flex;gap:4px}.form-metadata[_ngcontent-%COMP%] span[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:14px;height:14px;width:14px}"] }); }
157
+ }
158
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SelectFormTemplateComponent, [{
159
+ type: Component,
160
+ args: [{ selector: 'lib-select-form-template', standalone: true, imports: [MatModulesModule, CommonModule, DaysAgoPipe], template: "<h2 mat-dialog-title>\r\n Choose a Form Template\r\n</h2>\r\n\r\n <p>\r\n Select a pre-built form template to start with. You can customize and save it as your own form after copying \r\n it to the editor.\r\n </p>\r\n\r\n <mat-dialog-content>\r\n \r\n @if(selectLoadingForms$ |async){\r\n <div style=\"display: flex; flex-direction: column; height: calc(100% - 150px); justify-content: center; align-items: center; padding:24px\">\r\n <mat-spinner style=\"margin-bottom: 16px;\"></mat-spinner>\r\n <span>\r\n Loading form templates...\r\n </span>\r\n </div>\r\n }@else {\r\n <mat-nav-list class=\"form-template-list\">\r\n @for (form of selectForms$|async; track form._id) {\r\n \r\n <mat-list-item \r\n (click)=\"selectForm(form)\"\r\n [matTooltip]=\"'Click to select this template'\"\r\n\r\n \r\n [class.mat-elevation-z1]=\"true\"\r\n \r\n class=\"form-list-item\">\r\n <img [class.error]=\"form.errors.length > 0\" \r\n matListItemAvatar [src]=\"getFormAvatar(form.formTitle)\" [alt]=\"'form image ' + form.formTitle\">\r\n <div matListItemTitle class=\"form-item-content\">\r\n <div class=\"form-title\">{{ form.formTitle | titlecase }}</div>\r\n <div class=\"form-metadata\">\r\n \r\n @if(form.errors.length > 0) {\r\n <span><mat-icon color=\"warn\">error</mat-icon> <small>{{ form.errors.length}}</small></span>\r\n <span class=\"metadata-divider\">\u2022</span>\r\n }\r\n <span><mat-icon>add_circle_outline</mat-icon> <small>{{ form.createdAt | daysAgo }}</small> </span>\r\n <span class=\"metadata-divider\">\u2022</span>\r\n <span><mat-icon>update</mat-icon><small> {{ form.updatedAt | daysAgo }}</small></span>\r\n \r\n \r\n \r\n </div>\r\n </div>\r\n\r\n </mat-list-item>\r\n \r\n \r\n }\r\n </mat-nav-list>\r\n @if((selectForms$|async)?.length === 0){\r\n <p>\r\n No form templates available.\r\n </p>\r\n }\r\n \r\n }\r\n \r\n </mat-dialog-content>\r\n\r\n <mat-divider></mat-divider>\r\n<mat-dialog-actions [align]=\"'end'\">\r\n <button style=\"width: 100%;\" mat-stroked-button (click)=\"close()\">\r\n Close\r\n </button>\r\n </mat-dialog-actions>", styles: ["p{max-width:368px;padding-right:28px;padding-left:28px}h2{margin-bottom:0}.form-list-item{margin:0;border-radius:8px!important;transition:background-color .2s ease;background:var(--mdc-elevated-card-container-color, var(--mat-app-surface-container-low));height:fit-content!important;min-width:280px;max-width:none;padding-top:8px;padding-bottom:8px}.form-metadata{color:#0009;font-size:14px;line-height:normal;display:flex}.form-metadata .metadata-divider{margin:0 8px}.form-metadata span{display:inline-flex;gap:4px}.form-metadata span mat-icon{font-size:14px;height:14px;width:14px}\n"] }]
161
+ }], () => [{ type: FormsStoreService }], null); })();
162
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SelectFormTemplateComponent, { className: "SelectFormTemplateComponent", filePath: "lib/components/form-builder/elements/select-form-template/select-form-template.component.ts", lineNumber: 19 }); })();
163
+
164
+ function SubmissionAPIListItemConfig(environment) {
165
+ return [
166
+ {
167
+ id: '16140923-0542-4d5d-9b63-186c1e91b1a7',
168
+ name: SpecialElementKeys.MatOptionsApiCall,
169
+ editType: ElementEditorTypes.ApiCall,
170
+ required: true,
171
+ postmanCollectionConfig: {
172
+ collectionUrl: environment['POSTMAN_COLLECTION_URL'],
173
+ collectionKey: environment['POSTMAN_COLLECTION_KEY']
174
+ },
175
+ hint: `APIs are loaded from Postman collection. Configure required headers, payload format, and response mapping before use. Ensure API is documented in Postman.`,
176
+ deepBind: ['data'],
177
+ label: 'Select form submission api',
178
+ },
179
+ {
180
+ name: SpecialElementKeys.Default,
181
+ deepBind: [
182
+ 'data',
183
+ 'backEndConfig',
184
+ 'minimumInputRequired',
185
+ ],
186
+ additionalTest: [
187
+ {
188
+ testType: 'exists',
189
+ deepBind: [
190
+ 'data',
191
+ 'backEndConfig',
192
+ 'minimumInputRequired',
193
+ ],
194
+ }
195
+ ],
196
+ hint: `These are payload fields that are required to be filled in order to fetch data from the selected source`,
197
+ editType: ElementEditorTypes.RequiredInputs,
198
+ label: 'Set up required inputs',
199
+ id: "2d0f1e18-897b-4c28-97bc-3078be09f8ee"
200
+ },
201
+ {
202
+ name: SpecialElementKeys.Default,
203
+ deepBind: ['data', 'projectFormData'],
204
+ editType: ElementEditorTypes.Input,
205
+ label: 'Project form data',
206
+ hint: `example data:{$formValue}`,
207
+ id: "$2d0f1e18-897b-4c28-97bc-3078be09f8ee"
208
+ },
209
+ ];
210
+ }
211
+ const SubmissionAPIOtherConfig = [
212
+ {
213
+ id: "7acaa5d1-fb37-4dc0-9f1a-53b6f36534e0",
214
+ name: SpecialElementKeys.Default,
215
+ deepBind: ['submissionHandle', 'submissionMessage'],
216
+ editType: ElementEditorTypes.Input,
217
+ label: "Submission Message",
218
+ },
219
+ {
220
+ id: "5636c16c-be58-48d9-b701-81fe05573a39",
221
+ name: SpecialElementKeys.Default,
222
+ deepBind: ['submissionHandle', 'innerComponentShowSubmitButton'],
223
+ editType: ElementEditorTypes.Toggle,
224
+ label: "Show submit button in inner component form",
225
+ },
226
+ {
227
+ id: "c9103faa-eeba-4cf3-b3d0-f25fd05ccb3c",
228
+ name: SpecialElementKeys.Default,
229
+ deepBind: ['systemDefault'],
230
+ editType: ElementEditorTypes.Toggle,
231
+ label: "Is system default",
232
+ }
233
+ ];
234
+ const SubmissionDialogConfig = [
235
+ {
236
+ titleIcon: 'send',
237
+ id: '44023662-7343-4c93-999d-fc03c54438c3',
238
+ title: 'Form Submission Endpoint',
239
+ description: `Choose where to send your form data after submission. Connect to your database, data pipeline, or
240
+ third-party service.`,
241
+ primaryKey: 'submissionAPI',
242
+ elements: SubmissionAPIOtherConfig
243
+ },
244
+ {
245
+ titleIcon: 'rule',
246
+ title: 'Data Validationb Rules',
247
+ description: `Define validation rules to ensure data quality before form submission.
248
+ <br>
249
+ <strong>Note:</strong> All validation endpoints must return a boolean value -
250
+ <code>true</code> indicates valid data that will be submitted.`,
251
+ primaryKey: 'canSubmitAPI',
252
+ id: 'acac6045-5b13-4c8d-a7ee-da194ebbad41',
253
+ }
254
+ ];
255
+
256
+ const _c0 = () => [];
257
+ const _forTrack0 = ($index, $item) => $item.id;
258
+ const _forTrack1 = ($index, $item) => $item._id;
259
+ function FormSubmissionsConfigComponent_For_10_Conditional_9_For_1_Template(rf, ctx) { if (rf & 1) {
260
+ const _r1 = i0.ɵɵgetCurrentView();
261
+ i0.ɵɵelementStart(0, "div", 10)(1, "lib-t-dynamic-data-edit", 14);
262
+ i0.ɵɵlistener("valueChange", function FormSubmissionsConfigComponent_For_10_Conditional_9_For_1_Template_lib_t_dynamic_data_edit_valueChange_1_listener($event) { const edit_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r2.passFormChanges($event, edit_r2)); })("blur", function FormSubmissionsConfigComponent_For_10_Conditional_9_For_1_Template_lib_t_dynamic_data_edit_blur_1_listener($event) { const edit_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r2.elementBlur($event, edit_r2)); });
263
+ i0.ɵɵelementEnd()();
264
+ } if (rf & 2) {
265
+ const edit_r2 = ctx.$implicit;
266
+ const ctx_r2 = i0.ɵɵnextContext(3);
267
+ i0.ɵɵadvance();
268
+ i0.ɵɵproperty("editorConfig", edit_r2)("data", ctx_r2.form())("validationErrors", ctx_r2.computedErrors(edit_r2)() || i0.ɵɵpureFunction0(4, _c0))("formInputs", ctx_r2.formInputs() || i0.ɵɵpureFunction0(5, _c0));
269
+ } }
270
+ function FormSubmissionsConfigComponent_For_10_Conditional_9_Template(rf, ctx) { if (rf & 1) {
271
+ i0.ɵɵrepeaterCreate(0, FormSubmissionsConfigComponent_For_10_Conditional_9_For_1_Template, 2, 6, "div", 10, _forTrack0);
272
+ } if (rf & 2) {
273
+ const panel_r4 = i0.ɵɵnextContext().$implicit;
274
+ i0.ɵɵrepeater((panel_r4 == null ? null : panel_r4.elements) || i0.ɵɵpureFunction0(0, _c0));
275
+ } }
276
+ function FormSubmissionsConfigComponent_For_10_Conditional_14_Template(rf, ctx) { if (rf & 1) {
277
+ i0.ɵɵelementStart(0, "p", 15);
278
+ i0.ɵɵtext(1, " No submission endpoints configured. Add one to get started. ");
279
+ i0.ɵɵelementEnd();
280
+ } if (rf & 2) {
281
+ const panel_r4 = i0.ɵɵnextContext().$implicit;
282
+ i0.ɵɵstyleProp("color", panel_r4.error ? "var(--mat-form-field-error-text-color)" : "");
283
+ } }
284
+ function FormSubmissionsConfigComponent_For_10_For_16_Template(rf, ctx) { if (rf & 1) {
285
+ const _r5 = i0.ɵɵgetCurrentView();
286
+ i0.ɵɵelementStart(0, "mat-list-item", 16)(1, "span", 17);
287
+ i0.ɵɵtext(2);
288
+ i0.ɵɵelementEnd();
289
+ i0.ɵɵelementStart(3, "div", 18)(4, "div", 19)(5, "small")(6, "strong");
290
+ i0.ɵɵtext(7);
291
+ i0.ɵɵelementEnd()()();
292
+ i0.ɵɵelementStart(8, "div", 20)(9, "small");
293
+ i0.ɵɵtext(10);
294
+ i0.ɵɵelementEnd()()();
295
+ i0.ɵɵelementStart(11, "span", 21)(12, "button", 22);
296
+ i0.ɵɵlistener("click", function FormSubmissionsConfigComponent_For_10_For_16_Template_button_click_12_listener() { const api_r6 = i0.ɵɵrestoreView(_r5).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.removeSubmissionApi(api_r6)); });
297
+ i0.ɵɵelementStart(13, "mat-icon");
298
+ i0.ɵɵtext(14, "delete");
299
+ i0.ɵɵelementEnd()()()();
300
+ i0.ɵɵelement(15, "mat-divider");
301
+ } if (rf & 2) {
302
+ const api_r6 = ctx.$implicit;
303
+ i0.ɵɵadvance();
304
+ i0.ɵɵstyleProp("color", api_r6.httpMethod === "POST" ? "green" : "blue");
305
+ i0.ɵɵadvance();
306
+ i0.ɵɵtextInterpolate1(" ", api_r6.httpMethod, " ");
307
+ i0.ɵɵadvance(5);
308
+ i0.ɵɵtextInterpolate1(" ", api_r6.name, " ");
309
+ i0.ɵɵadvance(3);
310
+ i0.ɵɵtextInterpolate1(" ", api_r6.httpEndPoint, " ");
311
+ } }
312
+ function FormSubmissionsConfigComponent_For_10_Conditional_17_Template(rf, ctx) { if (rf & 1) {
313
+ const _r7 = i0.ɵɵgetCurrentView();
314
+ i0.ɵɵelementStart(0, "mat-toolbar", 13)(1, "button", 23);
315
+ i0.ɵɵlistener("click", function FormSubmissionsConfigComponent_For_10_Conditional_17_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r7); const panel_r4 = i0.ɵɵnextContext().$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.addNewSubmitApi(panel_r4.primaryKey)); });
316
+ i0.ɵɵtext(2, "Add new endpoint");
317
+ i0.ɵɵelementEnd()();
318
+ } }
319
+ function FormSubmissionsConfigComponent_For_10_Conditional_18_Template(rf, ctx) { if (rf & 1) {
320
+ i0.ɵɵelementStart(0, "mat-error");
321
+ i0.ɵɵtext(1);
322
+ i0.ɵɵelementEnd();
323
+ } if (rf & 2) {
324
+ const panel_r4 = i0.ɵɵnextContext().$implicit;
325
+ i0.ɵɵadvance();
326
+ i0.ɵɵtextInterpolate1(" ", panel_r4.error, " ");
327
+ } }
328
+ function FormSubmissionsConfigComponent_For_10_Conditional_19_For_2_Template(rf, ctx) { if (rf & 1) {
329
+ const _r9 = i0.ɵɵgetCurrentView();
330
+ i0.ɵɵelementStart(0, "lib-t-dynamic-data-edit", 14);
331
+ i0.ɵɵlistener("valueChange", function FormSubmissionsConfigComponent_For_10_Conditional_19_For_2_Template_lib_t_dynamic_data_edit_valueChange_0_listener($event) { const element_r10 = i0.ɵɵrestoreView(_r9).$implicit; const ctx_r2 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r2.inputChange($event, element_r10)); })("blur", function FormSubmissionsConfigComponent_For_10_Conditional_19_For_2_Template_lib_t_dynamic_data_edit_blur_0_listener($event) { const element_r10 = i0.ɵɵrestoreView(_r9).$implicit; const ctx_r2 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r2.elementBlur($event, element_r10)); });
332
+ i0.ɵɵelementEnd();
333
+ } if (rf & 2) {
334
+ const element_r10 = ctx.$implicit;
335
+ const ctx_r2 = i0.ɵɵnextContext(3);
336
+ i0.ɵɵproperty("editorConfig", element_r10)("data", ctx_r2.dataPlaceholder)("validationErrors", ctx_r2.validationErrors(element_r10))("formInputs", ctx_r2.formInputs() || i0.ɵɵpureFunction0(4, _c0));
337
+ } }
338
+ function FormSubmissionsConfigComponent_For_10_Conditional_19_Template(rf, ctx) { if (rf & 1) {
339
+ const _r8 = i0.ɵɵgetCurrentView();
340
+ i0.ɵɵelementStart(0, "div", 10);
341
+ i0.ɵɵrepeaterCreate(1, FormSubmissionsConfigComponent_For_10_Conditional_19_For_2_Template, 1, 5, "lib-t-dynamic-data-edit", 24, _forTrack0);
342
+ i0.ɵɵelement(3, "mat-divider");
343
+ i0.ɵɵelementStart(4, "mat-toolbar")(5, "button", 25);
344
+ i0.ɵɵlistener("click", function FormSubmissionsConfigComponent_For_10_Conditional_19_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r8); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.saveSubmitApi()); });
345
+ i0.ɵɵtext(6, "Save");
346
+ i0.ɵɵelementEnd();
347
+ i0.ɵɵelement(7, "span", 1);
348
+ i0.ɵɵelementStart(8, "button", 26);
349
+ i0.ɵɵlistener("click", function FormSubmissionsConfigComponent_For_10_Conditional_19_Template_button_click_8_listener() { i0.ɵɵrestoreView(_r8); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.cancelSubmitApi()); });
350
+ i0.ɵɵtext(9, "Cancel");
351
+ i0.ɵɵelementEnd()()();
352
+ } if (rf & 2) {
353
+ const ctx_r2 = i0.ɵɵnextContext(2);
354
+ i0.ɵɵadvance();
355
+ i0.ɵɵrepeater(ctx_r2.submissionApiListItemConfigElements);
356
+ } }
357
+ function FormSubmissionsConfigComponent_For_10_Template(rf, ctx) { if (rf & 1) {
358
+ i0.ɵɵelementStart(0, "mat-expansion-panel", 5)(1, "mat-expansion-panel-header")(2, "mat-panel-title")(3, "mat-icon", 6);
359
+ i0.ɵɵtext(4);
360
+ i0.ɵɵelementEnd();
361
+ i0.ɵɵtext(5);
362
+ i0.ɵɵelementEnd();
363
+ i0.ɵɵelement(6, "mat-divider", 7);
364
+ i0.ɵɵelementEnd();
365
+ i0.ɵɵelementStart(7, "div", 8);
366
+ i0.ɵɵelement(8, "p", 9);
367
+ i0.ɵɵtemplate(9, FormSubmissionsConfigComponent_For_10_Conditional_9_Template, 2, 1);
368
+ i0.ɵɵelementStart(10, "div", 10)(11, "mat-nav-list")(12, "h5", 11);
369
+ i0.ɵɵtext(13, " API Endpoints ");
370
+ i0.ɵɵelementEnd();
371
+ i0.ɵɵtemplate(14, FormSubmissionsConfigComponent_For_10_Conditional_14_Template, 2, 2, "p", 12);
372
+ i0.ɵɵrepeaterCreate(15, FormSubmissionsConfigComponent_For_10_For_16_Template, 16, 5, null, null, _forTrack1);
373
+ i0.ɵɵelementEnd();
374
+ i0.ɵɵtemplate(17, FormSubmissionsConfigComponent_For_10_Conditional_17_Template, 3, 0, "mat-toolbar", 13)(18, FormSubmissionsConfigComponent_For_10_Conditional_18_Template, 2, 1, "mat-error");
375
+ i0.ɵɵelementEnd();
376
+ i0.ɵɵtemplate(19, FormSubmissionsConfigComponent_For_10_Conditional_19_Template, 10, 0, "div", 10);
377
+ i0.ɵɵelementEnd()();
378
+ } if (rf & 2) {
379
+ const panel_r4 = ctx.$implicit;
380
+ const ctx_r2 = i0.ɵɵnextContext();
381
+ i0.ɵɵproperty("expanded", true);
382
+ i0.ɵɵadvance(3);
383
+ i0.ɵɵproperty("color", "primary");
384
+ i0.ɵɵadvance();
385
+ i0.ɵɵtextInterpolate1(" ", panel_r4.titleIcon, " ");
386
+ i0.ɵɵadvance();
387
+ i0.ɵɵtextInterpolate1(" ", panel_r4.title, " ");
388
+ i0.ɵɵadvance(3);
389
+ i0.ɵɵproperty("innerHTML", panel_r4.description, i0.ɵɵsanitizeHtml);
390
+ i0.ɵɵadvance();
391
+ i0.ɵɵconditional(((panel_r4 == null ? null : panel_r4.elements) || i0.ɵɵpureFunction0(12, _c0)).length > 0 ? 9 : -1);
392
+ i0.ɵɵadvance(3);
393
+ i0.ɵɵstyleProp("color", panel_r4.error ? "var(--mat-form-field-error-text-color)" : "");
394
+ i0.ɵɵadvance(2);
395
+ i0.ɵɵconditional(ctx_r2.getFormApis(panel_r4.primaryKey)().length === 0 ? 14 : -1);
396
+ i0.ɵɵadvance();
397
+ i0.ɵɵrepeater(ctx_r2.getFormApis(panel_r4.primaryKey)());
398
+ i0.ɵɵadvance(2);
399
+ i0.ɵɵconditional(ctx_r2.keyInEdit !== panel_r4.primaryKey ? 17 : -1);
400
+ i0.ɵɵadvance();
401
+ i0.ɵɵconditional(panel_r4.error ? 18 : -1);
402
+ i0.ɵɵadvance();
403
+ i0.ɵɵconditional(ctx_r2.keyInEdit === panel_r4.primaryKey ? 19 : -1);
404
+ } }
405
+ class FormSubmissionsConfigComponent {
406
+ getPanelError(panel) {
407
+ return computed(() => {
408
+ const form = this.form();
409
+ if (panel.primaryKey === 'submissionAPI') {
410
+ return (form?.submissionHandle?.submissionAPI || []).length === 0 ? 'At least one submission API is required' : undefined;
411
+ }
412
+ return undefined;
413
+ });
414
+ }
415
+ getFormApis(key) {
416
+ return computed(() => {
417
+ const form = this.form();
418
+ return form?.submissionHandle?.[key] || [];
419
+ });
420
+ }
421
+ // private dialogRef: MatDialogRef<FormSubmissionsConfigComponent>,
422
+ constructor() {
423
+ this.NGX_T_FORMS_CONFIG = inject(NGX_T_FORMS_CONFIG_TOKEN);
424
+ this.panels = computed(() => {
425
+ return SubmissionDialogConfig.map((panel) => {
426
+ const error = this.getPanelError(panel)();
427
+ return ({
428
+ ...panel,
429
+ error
430
+ });
431
+ });
432
+ });
433
+ this._data = inject(MAT_DIALOG_DATA);
434
+ this.store = this._data.store;
435
+ this.form = toSignal(this.store.selectors.selectFormInEdit$.pipe(map((form) => form?.form)), {
436
+ initialValue: undefined
437
+ });
438
+ this.formInputs = toSignal(this.store.formBuilderSelectors.getAllFormInputs$, {
439
+ initialValue: []
440
+ });
441
+ this.keyInEdit = undefined;
442
+ this.formValidationError = toSignal(this.store.formBuilderSelectors.formErrors$, {
443
+ initialValue: []
444
+ });
445
+ this.computedErrors = (element) => {
446
+ return computed(() => {
447
+ const allErrors = this.formValidationError();
448
+ const errors = allErrors?.filter(error => error.key === element.deepBind?.join('.')) || [];
449
+ return [...[], ...errors];
450
+ });
451
+ };
452
+ this.formInputChange = (value, ele) => this.store.actionsFormBuilder.formInputChange(ele, value);
453
+ this.matDialog = inject(MatDialog);
454
+ }
455
+ get submissionApiListItemConfigElements() {
456
+ return SubmissionAPIListItemConfig(this.NGX_T_FORMS_CONFIG).filter((el) => {
457
+ if (!el.additionalTest) {
458
+ return true;
459
+ }
460
+ return el.additionalTest.every((test) => {
461
+ return testAgainstItem(test, this.dataPlaceholder || { data: {} });
462
+ });
463
+ });
464
+ }
465
+ validationErrors(element) {
466
+ const val = validateApiDataFetchingConfiguration((this.dataPlaceholder || {})).map((error) => ({
467
+ message: error.message,
468
+ key: 'data.' + error.key
469
+ }));
470
+ const errors = val?.filter(error => error.key === element.deepBind?.join('.')) || [];
471
+ return errors;
472
+ }
473
+ elementBlur(event, element) {
474
+ console.info("[Admin Panel Input Element Editor] element blur", event);
475
+ }
476
+ inputChange(event, element) {
477
+ console.info("[Admin Panel Input Element Editor] input changed", event);
478
+ this.elementConfigurationChanged(event, element);
479
+ // this.elementConfigurationChanged(event?.target?.value, element)
480
+ }
481
+ passFormChanges(event, element) {
482
+ console.info("[Admin Panel Input Element Editor] pass form changes", event);
483
+ this.formInputChange(event, element);
484
+ }
485
+ elementConfigurationChanged(value, ele) {
486
+ //
487
+ const applyTo = { ...this.dataPlaceholder };
488
+ if (ele.clearOnChange) {
489
+ ele.clearOnChange.forEach((clear) => {
490
+ assignDeepPropertyToObject(applyTo, clear, undefined);
491
+ });
492
+ }
493
+ if (ele.deepBind) {
494
+ assignDeepPropertyToObject(applyTo, ele.deepBind, value);
495
+ }
496
+ this.dataPlaceholder = {
497
+ ...applyTo
498
+ };
499
+ // const formClass= this.formBuilder$$.value
500
+ // const form = formClass?.form
501
+ // if (form) {
502
+ // formClass?.refreshController(form)
503
+ // }
504
+ // this.formBuilder$$.value?.syncInputController();
505
+ // this.appStatesService.TFormBuilderService$.next(formClass)
506
+ }
507
+ addNewSubmitApi(submision) {
508
+ this.dataPlaceholder = {
509
+ data: {}
510
+ };
511
+ this.keyInEdit = submision;
512
+ }
513
+ saveSubmitApi() {
514
+ this.store.actionsFormBuilder.saveSubmitApi(this.dataPlaceholder, this.keyInEdit);
515
+ this.dataPlaceholder = undefined;
516
+ this.keyInEdit = undefined;
517
+ }
518
+ removeSubmissionApi(api) {
519
+ this.store.actionsFormBuilder.removeSubmissionApi(api, this.keyInEdit);
520
+ this.dataPlaceholder = undefined;
521
+ this.keyInEdit = undefined;
522
+ }
523
+ cancelSubmitApi() {
524
+ this.dataPlaceholder = undefined;
525
+ this.keyInEdit = undefined;
526
+ }
527
+ close() {
528
+ //close mat dialog
529
+ this.matDialog.closeAll();
530
+ }
531
+ static { this.ɵfac = function FormSubmissionsConfigComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FormSubmissionsConfigComponent)(); }; }
532
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FormSubmissionsConfigComponent, selectors: [["app-form-submissions-config"]], decls: 11, vars: 0, consts: [[1, "container"], [1, "spacer"], ["mat-icon-button", "", "mat-dialog-close", ""], [2, "padding", "0px 8px 8px 8px"], ["multi", ""], [3, "expanded"], [2, "margin-right", "8px", 3, "color"], [2, "position", "absolute", "bottom", "0px", "width", "100%", "left", "0"], [1, "content"], [1, "description", 2, "color", "var(--mat-text-secondary-color)", "margin-bottom", "16px", 3, "innerHTML"], [2, "background", "azure", "padding", "8px"], ["matSubheader", "", 1, "api-list-header"], [1, "no-api-list", 3, "color"], [2, "background", "none"], [3, "valueChange", "blur", "editorConfig", "data", "validationErrors", "formInputs"], [1, "no-api-list"], [1, "api-list-item"], ["matListItemIcon", "", 1, "tag"], ["matListItemTitle", ""], [2, "line-height", "normal"], [2, "line-height", "normal", "opacity", "0.6"], ["matListItemMeta", ""], ["mat-icon-button", "", 3, "click"], ["color", "primary", "mat-stroked-button", "", 2, "width", "100%", 3, "click"], [3, "editorConfig", "data", "validationErrors", "formInputs"], ["mat-flat-button", "", "color", "primary", 3, "click"], ["mat-button", "", "color", "warn", 3, "click"]], template: function FormSubmissionsConfigComponent_Template(rf, ctx) { if (rf & 1) {
533
+ i0.ɵɵelementStart(0, "div", 0)(1, "mat-toolbar");
534
+ i0.ɵɵtext(2, " Form Submission Configuration ");
535
+ i0.ɵɵelement(3, "span", 1);
536
+ i0.ɵɵelementStart(4, "button", 2)(5, "mat-icon");
537
+ i0.ɵɵtext(6, " close ");
538
+ i0.ɵɵelementEnd()()();
539
+ i0.ɵɵelementStart(7, "section", 3)(8, "mat-accordion", 4);
540
+ i0.ɵɵrepeaterCreate(9, FormSubmissionsConfigComponent_For_10_Template, 20, 13, "mat-expansion-panel", 5, _forTrack0);
541
+ i0.ɵɵelementEnd()()();
542
+ } if (rf & 2) {
543
+ i0.ɵɵadvance(9);
544
+ i0.ɵɵrepeater(ctx.panels());
545
+ } }, dependencies: [CommonModule, MatModulesModule, i2.MatButton, i2.MatIconButton, i1.MatDialogClose, i4.MatDivider, i5.MatAccordion, i5.MatExpansionPanel, i5.MatExpansionPanelHeader, i5.MatExpansionPanelTitle, i6.MatIcon, i6$1.MatNavList, i6$1.MatListItem, i6$1.MatListItemIcon, i6$1.MatListSubheaderCssMatStyler, i6$1.MatListItemTitle, i6$1.MatListItemMeta, i3.MatError, i9.MatToolbar, TDynamicDataEditComponent], styles: [".api-list-item[_ngcontent-%COMP%]{background:var(--mat-toolbar-container-background-color, var(--mat-app-surface))}.tag[_ngcontent-%COMP%]{width:fit-content;font-size:small;text-align:center}.api-list-header[_ngcontent-%COMP%]{padding-left:16px}.no-api-list[_ngcontent-%COMP%]{padding-left:16px;padding-right:16px;text-align:center;font-style:italic;font-size:small}.container[_ngcontent-%COMP%]{max-width:500px;max-height:calc(100vh - 24px);background:var(--mat-toolbar-container-background-color, var(--mat-app-surface));margin:0;border:solid 1px var(--mat-divider-color, var(--mat-app-outline))}.description[_ngcontent-%COMP%]{margin-top:16px;opacity:.6px}"] }); }
546
+ }
547
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FormSubmissionsConfigComponent, [{
548
+ type: Component,
549
+ args: [{ selector: 'app-form-submissions-config', standalone: true, imports: [CommonModule, MatModulesModule, TDynamicDataEditComponent], template: "<div class=\"container\">\r\n <mat-toolbar>\r\n\r\n Form Submission Configuration\r\n <span class=\"spacer\"></span>\r\n <button mat-icon-button mat-dialog-close>\r\n <mat-icon>\r\n close\r\n </mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n\r\n <section style=\"padding: 0px 8px 8px 8px;\">\r\n <mat-accordion multi>\r\n @for (panel of panels() ; track panel.id) {\r\n <mat-expansion-panel [expanded]=\"true\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title> <mat-icon [color]=\"'primary'\" style=\"margin-right: 8px;\">\r\n {{panel.titleIcon}}\r\n </mat-icon>\r\n {{panel.title}}\r\n </mat-panel-title>\r\n <mat-divider style=\" position: absolute;\r\n bottom: 0px;\r\n width: 100%;\r\n left: 0;\"></mat-divider>\r\n </mat-expansion-panel-header>\r\n <div class=\"content\">\r\n <p class=\"description\" [innerHTML]=\"panel.description\"\r\n style=\"color: var(--mat-text-secondary-color); margin-bottom: 16px;\">\r\n </p>\r\n @if ((panel?.elements||[]).length>0) {\r\n @for (edit of (panel?.elements||[]); track edit.id) {\r\n <div style=\"background:azure;padding: 8px;\">\r\n <lib-t-dynamic-data-edit [editorConfig]=\"edit\" [data]=\"form()\"\r\n [validationErrors]=\"(computedErrors(edit)())||[]\" (valueChange)=\"passFormChanges($event,edit)\"\r\n [formInputs]=\"(formInputs())||[]\" (blur)=\"elementBlur($event,edit)\">\r\n </lib-t-dynamic-data-edit>\r\n </div>\r\n }\r\n }\r\n <div style=\"background:azure;padding: 8px;\">\r\n\r\n <mat-nav-list>\r\n <h5 matSubheader [style.color]=\"(panel.error)?'var(--mat-form-field-error-text-color)':''\"\r\n class=\"api-list-header\">\r\n\r\n API Endpoints\r\n </h5>\r\n @if((getFormApis(panel.primaryKey)()).length === 0){\r\n <p [style.color]=\"(panel.error)?'var(--mat-form-field-error-text-color)':''\" class=\"no-api-list\">\r\n No submission endpoints configured. Add one to get started.\r\n </p>\r\n }\r\n @for (api of getFormApis(panel.primaryKey)(); track api._id) {\r\n\r\n <mat-list-item class=\"api-list-item\">\r\n <span matListItemIcon class=\"tag\" [style.color]=\"api.httpMethod === 'POST' ? 'green' : 'blue'\">\r\n\r\n {{api.httpMethod}}\r\n\r\n </span>\r\n\r\n <div matListItemTitle>\r\n <div style=\"line-height: normal;\">\r\n <small>\r\n <strong>\r\n {{api.name}}\r\n </strong>\r\n </small>\r\n\r\n </div>\r\n <div style=\"line-height: normal;opacity: 0.6;\">\r\n <small>\r\n {{api.httpEndPoint}}\r\n </small>\r\n </div>\r\n </div>\r\n <span matListItemMeta>\r\n <button (click)=\"removeSubmissionApi(api)\" mat-icon-button>\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </span>\r\n </mat-list-item>\r\n <mat-divider>\r\n </mat-divider>\r\n\r\n\r\n\r\n }\r\n\r\n\r\n </mat-nav-list>\r\n\r\n @if( keyInEdit !== panel.primaryKey ){\r\n <mat-toolbar style=\"background:none\">\r\n <button (click)=\"addNewSubmitApi(panel.primaryKey)\" style=\"width:100% ;\" color=\"primary\"\r\n mat-stroked-button>Add new\r\n endpoint</button>\r\n </mat-toolbar>\r\n }\r\n @if ((panel.error)) {\r\n\r\n <mat-error>\r\n {{panel.error}}\r\n </mat-error>\r\n\r\n }\r\n\r\n </div>\r\n\r\n\r\n\r\n @if( keyInEdit === panel.primaryKey ){\r\n <div style=\"background:azure;padding: 8px;\">\r\n @for (element of submissionApiListItemConfigElements; track element.id) {\r\n\r\n\r\n <lib-t-dynamic-data-edit [editorConfig]=\"element\" [data]=\"dataPlaceholder\"\r\n [validationErrors]=\"validationErrors(element)\" (valueChange)=\"inputChange($event,element)\"\r\n [formInputs]=\"(formInputs())||[]\" (blur)=\"elementBlur($event,element)\"></lib-t-dynamic-data-edit>\r\n }\r\n <mat-divider></mat-divider>\r\n <mat-toolbar>\r\n <button mat-flat-button (click)=\"saveSubmitApi()\" color=\"primary\">Save</button>\r\n <span class=\"spacer\"></span>\r\n <button mat-button (click)=\"cancelSubmitApi()\" color=\"warn\">Cancel</button>\r\n </mat-toolbar>\r\n </div>\r\n\r\n }\r\n\r\n\r\n\r\n </div>\r\n </mat-expansion-panel>\r\n }\r\n\r\n\r\n\r\n </mat-accordion>\r\n </section>\r\n\r\n\r\n</div>", styles: [".api-list-item{background:var(--mat-toolbar-container-background-color, var(--mat-app-surface))}.tag{width:fit-content;font-size:small;text-align:center}.api-list-header{padding-left:16px}.no-api-list{padding-left:16px;padding-right:16px;text-align:center;font-style:italic;font-size:small}.container{max-width:500px;max-height:calc(100vh - 24px);background:var(--mat-toolbar-container-background-color, var(--mat-app-surface));margin:0;border:solid 1px var(--mat-divider-color, var(--mat-app-outline))}.description{margin-top:16px;opacity:.6px}\n"] }]
550
+ }], () => [], null); })();
551
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FormSubmissionsConfigComponent, { className: "FormSubmissionsConfigComponent", filePath: "lib/components/form-builder/elements/form-submissions-config/form-submissions-config.component.ts", lineNumber: 30 }); })();
552
+
553
+ const FormsBuilderMenuComponent_ng_container_0_div_17_Defer_3_DepsFn = () => [i12.CdkCopyToClipboard, import('@angular/cdk/drag-drop').then(m => m.CdkDrag), i2$2.CdkDragHandle, i2.MatButton, i3$1.MatCard, i3$1.MatCardActions, i3$1.MatCardContent, i4.MatDivider, i6.MatIcon, i9.MatToolbar, i8.MatTooltip, import('./ngx-t-forms-form-json-view.component-CqtTYCRH.mjs').then(m => m.FormJsonViewComponent)];
554
+ function FormsBuilderMenuComponent_ng_container_0_For_10_Conditional_4_Template(rf, ctx) { if (rf & 1) {
555
+ i0.ɵɵelementStart(0, "div", 7);
556
+ i0.ɵɵtext(1);
557
+ i0.ɵɵelementEnd();
558
+ i0.ɵɵelementStart(2, "div", 8)(3, "mat-error")(4, "small");
559
+ i0.ɵɵtext(5, " Invalid configurations ");
560
+ i0.ɵɵelementEnd()()();
561
+ } if (rf & 2) {
562
+ const item_r3 = i0.ɵɵnextContext().$implicit;
563
+ i0.ɵɵadvance();
564
+ i0.ɵɵtextInterpolate1(" ", item_r3.label, " ");
565
+ } }
566
+ function FormsBuilderMenuComponent_ng_container_0_For_10_Conditional_5_Template(rf, ctx) { if (rf & 1) {
567
+ i0.ɵɵtext(0);
568
+ } if (rf & 2) {
569
+ const item_r3 = i0.ɵɵnextContext().$implicit;
570
+ i0.ɵɵtextInterpolate1(" ", item_r3.label, " ");
571
+ } }
572
+ function FormsBuilderMenuComponent_ng_container_0_For_10_Template(rf, ctx) { if (rf & 1) {
573
+ const _r2 = i0.ɵɵgetCurrentView();
574
+ i0.ɵɵelementStart(0, "button", 6);
575
+ i0.ɵɵlistener("click", function FormsBuilderMenuComponent_ng_container_0_For_10_Template_button_click_0_listener() { const item_r3 = i0.ɵɵrestoreView(_r2).$implicit; return i0.ɵɵresetView(item_r3 == null ? null : item_r3.action()); });
576
+ i0.ɵɵelementStart(1, "mat-icon");
577
+ i0.ɵɵtext(2);
578
+ i0.ɵɵelementEnd();
579
+ i0.ɵɵelementStart(3, "span");
580
+ i0.ɵɵtemplate(4, FormsBuilderMenuComponent_ng_container_0_For_10_Conditional_4_Template, 6, 1)(5, FormsBuilderMenuComponent_ng_container_0_For_10_Conditional_5_Template, 1, 1);
581
+ i0.ɵɵelementEnd()();
582
+ i0.ɵɵelement(6, "mat-divider");
583
+ } if (rf & 2) {
584
+ const item_r3 = ctx.$implicit;
585
+ i0.ɵɵproperty("matTooltip", item_r3.hint);
586
+ i0.ɵɵadvance(2);
587
+ i0.ɵɵtextInterpolate(item_r3.icon);
588
+ i0.ɵɵadvance(2);
589
+ i0.ɵɵconditional(item_r3.errors ? 4 : 5);
590
+ } }
591
+ function FormsBuilderMenuComponent_ng_container_0_div_17_Defer_1_Template(rf, ctx) { if (rf & 1) {
592
+ const _r5 = i0.ɵɵgetCurrentView();
593
+ i0.ɵɵelementStart(0, "mat-card", 10)(1, "mat-toolbar", 11)(2, "span");
594
+ i0.ɵɵtext(3, " Json Form Value ");
595
+ i0.ɵɵelementEnd();
596
+ i0.ɵɵelement(4, "span", 12);
597
+ i0.ɵɵelementStart(5, "mat-icon", 13);
598
+ i0.ɵɵtext(6, " drag_indicator ");
599
+ i0.ɵɵelementEnd()();
600
+ i0.ɵɵelement(7, "mat-divider", 14);
601
+ i0.ɵɵelementStart(8, "mat-card-content", 15);
602
+ i0.ɵɵelement(9, "app-form-json-view");
603
+ i0.ɵɵelementEnd();
604
+ i0.ɵɵelementStart(10, "mat-card-actions");
605
+ i0.ɵɵelement(11, "span", 12);
606
+ i0.ɵɵelementStart(12, "button", 16);
607
+ i0.ɵɵlistener("click", function FormsBuilderMenuComponent_ng_container_0_div_17_Defer_1_Template_button_click_12_listener() { i0.ɵɵrestoreView(_r5); const ctx_r3 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r3.showJson = false); });
608
+ i0.ɵɵtext(13, " Close ");
609
+ i0.ɵɵelementEnd();
610
+ i0.ɵɵelementStart(14, "button", 17);
611
+ i0.ɵɵtext(15, " Copy ");
612
+ i0.ɵɵelementEnd()()();
613
+ } if (rf & 2) {
614
+ const vm_r6 = i0.ɵɵnextContext(2).ngIf;
615
+ i0.ɵɵadvance(14);
616
+ i0.ɵɵproperty("cdkCopyToClipboard", vm_r6.formCopy || "");
617
+ } }
618
+ function FormsBuilderMenuComponent_ng_container_0_div_17_DeferPlaceholder_2_Template(rf, ctx) { if (rf & 1) {
619
+ i0.ɵɵelementStart(0, "div", 18);
620
+ i0.ɵɵelement(1, "mat-spinner", 19);
621
+ i0.ɵɵelementEnd();
622
+ } }
623
+ function FormsBuilderMenuComponent_ng_container_0_div_17_Template(rf, ctx) { if (rf & 1) {
624
+ i0.ɵɵelementStart(0, "div", 9);
625
+ i0.ɵɵtemplate(1, FormsBuilderMenuComponent_ng_container_0_div_17_Defer_1_Template, 16, 1)(2, FormsBuilderMenuComponent_ng_container_0_div_17_DeferPlaceholder_2_Template, 2, 0);
626
+ i0.ɵɵdefer(3, 1, FormsBuilderMenuComponent_ng_container_0_div_17_Defer_3_DepsFn, null, 2);
627
+ i0.ɵɵdeferOnViewport(0, -1);
628
+ i0.ɵɵelementEnd();
629
+ } }
630
+ function FormsBuilderMenuComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
631
+ const _r1 = i0.ɵɵgetCurrentView();
632
+ i0.ɵɵelementContainerStart(0);
633
+ i0.ɵɵelementStart(1, "button", 2);
634
+ i0.ɵɵtext(2, " Config ");
635
+ i0.ɵɵelementStart(3, "mat-icon");
636
+ i0.ɵɵtext(4, " settings_suggest ");
637
+ i0.ɵɵelementEnd()();
638
+ i0.ɵɵelementStart(5, "mat-menu", null, 0)(7, "div", 3);
639
+ i0.ɵɵtext(8, "Form edit options");
640
+ i0.ɵɵelementEnd();
641
+ i0.ɵɵrepeaterCreate(9, FormsBuilderMenuComponent_ng_container_0_For_10_Template, 7, 3, null, null, i0.ɵɵrepeaterTrackByIdentity);
642
+ i0.ɵɵelementStart(11, "button", 4);
643
+ i0.ɵɵlistener("click", function FormsBuilderMenuComponent_ng_container_0_Template_button_click_11_listener() { i0.ɵɵrestoreView(_r1); const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.showJson = !ctx_r3.showJson); });
644
+ i0.ɵɵelementStart(12, "mat-icon");
645
+ i0.ɵɵtext(13, "data_object");
646
+ i0.ɵɵelementEnd();
647
+ i0.ɵɵelementStart(14, "span")(15, "div");
648
+ i0.ɵɵtext(16, " Show json ");
649
+ i0.ɵɵelementEnd()()()();
650
+ i0.ɵɵtemplate(17, FormsBuilderMenuComponent_ng_container_0_div_17_Template, 5, 0, "div", 5);
651
+ i0.ɵɵelementContainerEnd();
652
+ } if (rf & 2) {
653
+ const vm_r6 = ctx.ngIf;
654
+ const configMenu_r7 = i0.ɵɵreference(6);
655
+ const ctx_r3 = i0.ɵɵnextContext();
656
+ i0.ɵɵadvance();
657
+ i0.ɵɵproperty("matBadge", "!")("matTooltip", vm_r6.configHasErrors === false ? "\n Click to view form configuration \n " : "Click to fix or add missing form configurations")("matBadgeHidden", !!vm_r6.configHasErrors === false)("matMenuTriggerFor", configMenu_r7);
658
+ i0.ɵɵadvance(8);
659
+ i0.ɵɵrepeater(vm_r6.items);
660
+ i0.ɵɵadvance(2);
661
+ i0.ɵɵproperty("matTooltip", ctx_r3.showJson ? "Hide json" : "Show json");
662
+ i0.ɵɵadvance(6);
663
+ i0.ɵɵproperty("ngIf", ctx_r3.showJson);
664
+ } }
665
+ class FormsBuilderMenuComponent {
666
+ constructor(store) {
667
+ this.store = store;
668
+ this.form$ = this.store.selectors.selectFormInEdit$.pipe(map((form) => form?.form));
669
+ this.showJson = false;
670
+ this.formCopy$ = this.form$.pipe(map((form) => JSON.stringify(form || {})));
671
+ this.dialog = inject(MatDialog);
672
+ this.applyFormTemplate = (form) => this.store.actionsFormBuilder.applyFormTemplate(form);
673
+ this.errors$ = this.store.formBuilderSelectors.formErrors$;
674
+ this.configHasErrors$ = this.errors$.pipe(map(errors => errors?.some(error => error.key.split('.')?.[0] === 'submissionHandle')));
675
+ this.items$ = this.configHasErrors$.pipe(map(configHasErrors => {
676
+ return [
677
+ {
678
+ label: "Templates",
679
+ icon: "content_copy",
680
+ hint: "Select a form to apply as a template",
681
+ action: () => this.openDialog()
682
+ },
683
+ {
684
+ label: "Submission Config",
685
+ hint: "Setup form submission api and other configurations",
686
+ icon: "api",
687
+ errors: configHasErrors,
688
+ action: () => this.openFormSubmissionDialog()
689
+ },
690
+ ];
691
+ }));
692
+ this.vm$ = combineLatest([
693
+ this.items$,
694
+ this.form$,
695
+ this.formCopy$,
696
+ this
697
+ .configHasErrors$
698
+ ]).pipe(map(([items, form, formCopy, configHasErrors]) => ({ items, form, formCopy, configHasErrors })));
699
+ }
700
+ openDialog() {
701
+ const dialogRef = this.dialog.open(SelectFormTemplateComponent);
702
+ dialogRef.afterClosed().pipe(take(1)).subscribe(form => {
703
+ if (form) {
704
+ this.applyFormTemplate(form);
705
+ }
706
+ });
707
+ }
708
+ openFormSubmissionDialog() {
709
+ const dialogRef = this.dialog.open(FormSubmissionsConfigComponent, {
710
+ data: {
711
+ store: this.store
712
+ }
713
+ });
714
+ dialogRef.afterClosed().pipe(take(1)).subscribe(data => {
715
+ if (data) {
716
+ console.log(data);
717
+ }
718
+ });
719
+ }
720
+ static { this.ɵfac = function FormsBuilderMenuComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FormsBuilderMenuComponent)(i0.ɵɵdirectiveInject(FormsStoreService)); }; }
721
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FormsBuilderMenuComponent, selectors: [["app-forms-builder-menu"]], decls: 2, vars: 3, consts: [["configMenu", "matMenu"], [4, "ngIf"], ["matBadgeColor", "warn", "mat-flat-button", "", 3, "matBadge", "matTooltip", "matBadgeHidden", "matMenuTriggerFor"], ["mat-subheader", "", 2, "padding-left", "16px"], ["mat-menu-item", "", 3, "click", "matTooltip"], ["class", "DragBoundary", 4, "ngIf"], ["matTooltipPosition", "right", "mat-menu-item", "", 2, "padding-top", "4px", "padding-bottom", "4px", 3, "click", "matTooltip"], ["ks", "", 2, "line-height", "normal"], [2, "line-height", "normal"], [1, "DragBoundary"], ["cdkDragBoundary", "DragBoundary", "cdkDrag", "", 1, "menuCard"], [2, "background", "var(--mat-sidenav-content-background-color)", "color", "var(--mdc-filled-button-label-text-color, var(--mat-app-on-primary))"], [1, "spacer"], ["cdkDragHandle", "", 2, "margin", "8px", "color", "var(--mat-divider-color, var(--mat-app-outline))"], [2, "margin-bottom", "12px"], [2, "overflow-y", "auto", "max-height", "calc(100vh - 150px)"], ["mat-flat-button", "", 3, "click"], ["color", "primary", "matTooltip", "Copy json to clipboard", "mat-flat-button", "", 3, "cdkCopyToClipboard"], [2, "padding", "50px", "display", "flex", "justify-content", "center", "align-items", "center", "text-align", "center"], ["diameter", "20"]], template: function FormsBuilderMenuComponent_Template(rf, ctx) { if (rf & 1) {
722
+ i0.ɵɵtemplate(0, FormsBuilderMenuComponent_ng_container_0_Template, 18, 6, "ng-container", 1);
723
+ i0.ɵɵpipe(1, "async");
724
+ } if (rf & 2) {
725
+ i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(1, 1, ctx.vm$));
726
+ } }, dependencies: [CommonModule, i2$1.NgIf, i2$1.AsyncPipe, MatModulesModule, i3$2.MatBadge, i2.MatButton, i4.MatDivider, i6.MatIcon, i6$1.MatListSubheaderCssMatStyler, i6$2.MatMenu, i6$2.MatMenuItem, i6$2.MatMenuTrigger, i7.MatProgressSpinner, i3.MatError, i8.MatTooltip], styles: [".menuCard[_ngcontent-%COMP%]{width:fit-content;margin:0;resize:horizontal;z-index:2}.DragBoundary[_ngcontent-%COMP%]{position:absolute;left:0;top:74px;width:100%;height:calc(100% - 74px)}"] }); }
727
+ }
728
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadataAsync(FormsBuilderMenuComponent, () => [import('@angular/cdk/drag-drop').then(m => m.CdkDrag), import('./ngx-t-forms-form-json-view.component-CqtTYCRH.mjs').then(m => m.FormJsonViewComponent)], (CdkDrag, FormJsonViewComponent) => { i0.ɵsetClassMetadata(FormsBuilderMenuComponent, [{
729
+ type: Component,
730
+ args: [{ selector: 'app-forms-builder-menu', standalone: true, imports: [CommonModule, MatModulesModule, FormJsonViewComponent, CdkDrag], template: "\r\n<ng-container *ngIf=\"( vm$|async) as vm\">\r\n\r\n <button [matBadge]=\"'!'\" matBadgeColor=\"warn\" [matTooltip]=\"vm.configHasErrors === false?'\r\n Click to view form configuration \r\n ':'Click to fix or add missing form configurations'\" [matBadgeHidden]=\"!!(vm.configHasErrors) === false\"\r\n [matMenuTriggerFor]=\"configMenu\" mat-flat-button>\r\n Config\r\n <mat-icon>\r\n settings_suggest\r\n </mat-icon>\r\n </button>\r\n \r\n <mat-menu #configMenu=\"matMenu\">\r\n \r\n \r\n <div mat-subheader style=\"padding-left: 16px;\">Form edit options</div>\r\n @for(item of vm.items;track item){\r\n <button [matTooltip]=\"item.hint\" matTooltipPosition=\"right\" style=\"padding-top:4px;padding-bottom:4px\"\r\n (click)=\"item?.action()\" mat-menu-item>\r\n <mat-icon>{{item.icon}}</mat-icon>\r\n \r\n <span>\r\n @if (item.errors) {\r\n <div style=\"line-height: normal;\"ks>\r\n {{item.label}}\r\n </div>\r\n <div style=\"line-height: normal;\">\r\n \r\n <mat-error>\r\n <small>\r\n Invalid configurations\r\n </small>\r\n \r\n </mat-error>\r\n </div>\r\n }@else {\r\n \r\n {{item.label}}\r\n \r\n }\r\n \r\n \r\n </span>\r\n \r\n </button>\r\n <mat-divider></mat-divider>\r\n }\r\n <button [matTooltip]=\"showJson?'Hide json':'Show json'\" (click)=\"showJson= !showJson\" mat-menu-item>\r\n <mat-icon>data_object</mat-icon>\r\n \r\n <span>\r\n <div>\r\n Show json\r\n </div>\r\n \r\n \r\n \r\n </span>\r\n </button>\r\n \r\n </mat-menu>\r\n \r\n <div *ngIf=\"showJson\" class=\"DragBoundary\">\r\n @defer (on viewport) {\r\n <mat-card cdkDragBoundary=\"DragBoundary\" cdkDrag class=\"menuCard\">\r\n <mat-toolbar\r\n style=\"background: var(--mat-sidenav-content-background-color);color:var(--mdc-filled-button-label-text-color, var(--mat-app-on-primary))\">\r\n <span>\r\n Json Form Value\r\n </span>\r\n <span class=\"spacer\"></span>\r\n \r\n <mat-icon cdkDragHandle style=\"\r\n margin:8px;\r\n color:var(--mat-divider-color, var(--mat-app-outline))\">\r\n drag_indicator\r\n </mat-icon>\r\n </mat-toolbar>\r\n <mat-divider style=\"margin-bottom: 12px;\"></mat-divider>\r\n \r\n \r\n <mat-card-content style=\" overflow-y: auto;\r\n max-height: calc(100vh - 150px);\">\r\n <app-form-json-view></app-form-json-view>\r\n </mat-card-content>\r\n <mat-card-actions>\r\n <span class=\"spacer\"></span>\r\n <button (click)=\"showJson = false\" mat-flat-button>\r\n Close\r\n </button>\r\n <button color=\"primary\" [cdkCopyToClipboard]=\"(vm.formCopy)||''\" matTooltip=\"Copy json to clipboard\"\r\n mat-flat-button>\r\n Copy\r\n </button>\r\n \r\n </mat-card-actions>\r\n \r\n \r\n </mat-card>\r\n }@placeholder {\r\n <div style=\"padding: 50px;display:flex;justify-content:center;align-items:center; text-align: center;\">\r\n <mat-spinner diameter=\"20\" />\r\n </div>\r\n \r\n }\r\n </div>\r\n</ng-container>\r\n", styles: [".menuCard{width:fit-content;margin:0;resize:horizontal;z-index:2}.DragBoundary{position:absolute;left:0;top:74px;width:100%;height:calc(100% - 74px)}\n"] }]
731
+ }], () => [{ type: FormsStoreService }], null); }); })();
732
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FormsBuilderMenuComponent, { className: "FormsBuilderMenuComponent", filePath: "lib/components/form-builder/elements/forms-builder-menu/forms-builder-menu.component.ts", lineNumber: 22 }); })();
733
+
734
+ export { FormsBuilderMenuComponent };
735
+ //# sourceMappingURL=ngx-t-forms-forms-builder-menu.component-DbxEBvpt.mjs.map