ngx-t-forms 2.0.9 → 2.0.10
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/fesm2022/{ngx-t-forms-api-value-access-rules.component-DjZDnTHz.mjs → ngx-t-forms-api-value-access-rules.component-N3ygU2OC.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-api-value-access-rules.component-DjZDnTHz.mjs.map → ngx-t-forms-api-value-access-rules.component-N3ygU2OC.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-E3l7DQo7.mjs → ngx-t-forms-calculated-field-rules.component-BLWcl6vn.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-E3l7DQo7.mjs.map → ngx-t-forms-calculated-field-rules.component-BLWcl6vn.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-sOC54w4T.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-CPerh2tW.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-sOC54w4T.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-CPerh2tW.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-input-selector.component-CB03sPjA.mjs → ngx-t-forms-form-input-selector.component-CPP9vk2K.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-input-selector.component-CB03sPjA.mjs.map → ngx-t-forms-form-input-selector.component-CPP9vk2K.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-json-view.component-C1AZujJH.mjs → ngx-t-forms-form-json-view.component-DrYn49ee.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-json-view.component-C1AZujJH.mjs.map → ngx-t-forms-form-json-view.component-DrYn49ee.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-C_dciQhe.mjs → ngx-t-forms-form-section-stepper.component-8D5I7skU.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-C_dciQhe.mjs.map → ngx-t-forms-form-section-stepper.component-8D5I7skU.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-CPIcPREp.mjs → ngx-t-forms-forms-builder-menu.component-CIpEQV76.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-CPIcPREp.mjs.map → ngx-t-forms-forms-builder-menu.component-CIpEQV76.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-input-editor.component-__grERM8.mjs → ngx-t-forms-input-editor.component-S5vwN832.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-input-editor.component-__grERM8.mjs.map → ngx-t-forms-input-editor.component-S5vwN832.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-DcdHYqhN.mjs → ngx-t-forms-mat-chip-list-editor.component-cuh6pUIa.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-DcdHYqhN.mjs.map → ngx-t-forms-mat-chip-list-editor.component-cuh6pUIa.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mat-slider-editor.component-C9rintm4.mjs → ngx-t-forms-mat-slider-editor.component-0oKVJ6ZR.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mat-slider-editor.component-C9rintm4.mjs.map → ngx-t-forms-mat-slider-editor.component-0oKVJ6ZR.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mat-slider-toggle-editor.component-CItK6kXf.mjs → ngx-t-forms-mat-slider-toggle-editor.component-CH979aIj.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mat-slider-toggle-editor.component-CItK6kXf.mjs.map → ngx-t-forms-mat-slider-toggle-editor.component-CH979aIj.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-Da3SdUn6.mjs → ngx-t-forms-missing-form-configs.component-DO5tei0F.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-Da3SdUn6.mjs.map → ngx-t-forms-missing-form-configs.component-DO5tei0F.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-4hrEpLk3.mjs → ngx-t-forms-mscoa-segment-config.component-DVLk9GU0.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-4hrEpLk3.mjs.map → ngx-t-forms-mscoa-segment-config.component-DVLk9GU0.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-ngx-t-forms-1Roar4qK.mjs → ngx-t-forms-ngx-t-forms-dXesQz32.mjs} +8 -6
- package/fesm2022/ngx-t-forms-ngx-t-forms-dXesQz32.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-BQDykLNH.mjs → ngx-t-forms-pipeline-generator.component-CwqafpEq.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-BQDykLNH.mjs.map → ngx-t-forms-pipeline-generator.component-CwqafpEq.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-required-inputs.component-BGK3DNu0.mjs → ngx-t-forms-required-inputs.component-Cle4WsPa.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-required-inputs.component-BGK3DNu0.mjs.map → ngx-t-forms-required-inputs.component-Cle4WsPa.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-CCaRUSVQ.mjs → ngx-t-forms-rest-api-call-setup.component-N7z59aKu.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-CCaRUSVQ.mjs.map → ngx-t-forms-rest-api-call-setup.component-N7z59aKu.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-section-report.component-C8Ja_G_3.mjs → ngx-t-forms-section-report.component-CRJIa-3A.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-section-report.component-C8Ja_G_3.mjs.map → ngx-t-forms-section-report.component-CRJIa-3A.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-cYkn1O48.mjs → ngx-t-forms-selection-options-editor.component-Cm41dBKq.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-cYkn1O48.mjs.map → ngx-t-forms-selection-options-editor.component-Cm41dBKq.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-validators-config.component-CGXCCl45.mjs → ngx-t-forms-validators-config.component-CAdn7-Nn.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-validators-config.component-CGXCCl45.mjs.map → ngx-t-forms-validators-config.component-CAdn7-Nn.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms.mjs +1 -1
- package/lib/components/forms/forms.component.d.ts +1 -1
- package/lib/components/t-form-input/elements/editor-input-element/core/form-input-rich-text-editor/config.d.ts +1 -0
- package/package.json +1 -1
- package/fesm2022/ngx-t-forms-api-value-access-rules.component-Zg1ddSDb.mjs +0 -813
- package/fesm2022/ngx-t-forms-api-value-access-rules.component-Zg1ddSDb.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-ZepKycLR.mjs +0 -532
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-ZepKycLR.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-DLnB3R7t.mjs +0 -297
- package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-DLnB3R7t.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-form-input-selector.component-BjwzDiCY.mjs +0 -187
- package/fesm2022/ngx-t-forms-form-input-selector.component-BjwzDiCY.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-form-json-view.component-CqtTYCRH.mjs +0 -28
- package/fesm2022/ngx-t-forms-form-json-view.component-CqtTYCRH.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-form-section-stepper.component-Ba5WCLzp.mjs +0 -673
- package/fesm2022/ngx-t-forms-form-section-stepper.component-Ba5WCLzp.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-DbxEBvpt.mjs +0 -735
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-DbxEBvpt.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-input-editor.component-BnsC-jsN.mjs +0 -445
- package/fesm2022/ngx-t-forms-input-editor.component-BnsC-jsN.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-DS6s98ZX.mjs +0 -111
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-DS6s98ZX.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mat-slider-editor.component-ChiiJYK2.mjs +0 -130
- package/fesm2022/ngx-t-forms-mat-slider-editor.component-ChiiJYK2.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-DFcLzkSF.mjs +0 -171
- package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-DFcLzkSF.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-missing-form-configs.component-DNkGCH0e.mjs +0 -104
- package/fesm2022/ngx-t-forms-missing-form-configs.component-DNkGCH0e.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-CrHAIRAw.mjs +0 -455
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-CrHAIRAw.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-1Roar4qK.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-DaAFB-HX.mjs +0 -14694
- package/fesm2022/ngx-t-forms-ngx-t-forms-DaAFB-HX.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-pipeline-generator.component-U0d8jQKW.mjs +0 -1362
- package/fesm2022/ngx-t-forms-pipeline-generator.component-U0d8jQKW.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-required-inputs.component-S3cbA-zG.mjs +0 -383
- package/fesm2022/ngx-t-forms-required-inputs.component-S3cbA-zG.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-DDg4fCFx.mjs +0 -457
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-DDg4fCFx.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-section-report.component-C_h0KIR4.mjs +0 -314
- package/fesm2022/ngx-t-forms-section-report.component-C_h0KIR4.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-selection-options-editor.component-CllhwZ5Y.mjs +0 -231
- package/fesm2022/ngx-t-forms-selection-options-editor.component-CllhwZ5Y.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-validators-config.component-BPJZRtjT.mjs +0 -434
- package/fesm2022/ngx-t-forms-validators-config.component-BPJZRtjT.mjs.map +0 -1
|
@@ -1,813 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, ElementRef, Component, ViewChild, Output, Input, Optional, Self, HostBinding } from '@angular/core';
|
|
3
|
-
import * as i2 from '@angular/common';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
import * as i1 from '@angular/forms';
|
|
6
|
-
import { FormsModule } from '@angular/forms';
|
|
7
|
-
import { e as TreeComponent, M as MatModulesModule } from './ngx-t-forms-ngx-t-forms-DaAFB-HX.mjs';
|
|
8
|
-
import * as i3 from '@angular/material/core';
|
|
9
|
-
import * as i2$1 from '@angular/material/button';
|
|
10
|
-
import * as i3$1 from '@angular/material/checkbox';
|
|
11
|
-
import * as i4 from '@angular/material/divider';
|
|
12
|
-
import * as i5 from '@angular/material/expansion';
|
|
13
|
-
import * as i6 from '@angular/material/icon';
|
|
14
|
-
import * as i6$1 from '@angular/material/list';
|
|
15
|
-
import * as i3$2 from '@angular/material/form-field';
|
|
16
|
-
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
17
|
-
import * as i7 from '@angular/material/select';
|
|
18
|
-
import * as i9 from '@angular/material/toolbar';
|
|
19
|
-
import * as i8 from '@angular/material/tooltip';
|
|
20
|
-
import * as i3$3 from '@angular/material/tree';
|
|
21
|
-
import * as i12 from '@angular/material/input';
|
|
22
|
-
import { Subject, take, tap, catchError, throwError } from 'rxjs';
|
|
23
|
-
import * as i1$1 from '@angular/common/http';
|
|
24
|
-
import { HttpErrorResponse } from '@angular/common/http';
|
|
25
|
-
import _ from 'lodash';
|
|
26
|
-
import { f as flatApiList } from './ngx-t-forms-convertPostmanCollectionToTree-DktdVBeQ.mjs';
|
|
27
|
-
|
|
28
|
-
function searchAndOrderArray(arr, searchTerm, filterBy) {
|
|
29
|
-
// Filter the array based on the search term
|
|
30
|
-
const filteredArr = arr.filter((obj) => searchTerm
|
|
31
|
-
? obj[filterBy].toLowerCase().includes(searchTerm.toLowerCase())
|
|
32
|
-
: true);
|
|
33
|
-
// Order the filtered array alphabetically by name
|
|
34
|
-
const orderedArr = filteredArr.sort((a, b) => a[filterBy].localeCompare(b[filterBy]));
|
|
35
|
-
return orderedArr;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const _c0$1 = ["textarea"];
|
|
39
|
-
function DataTreeComponent_mat_tree_node_15_Template(rf, ctx) { if (rf & 1) {
|
|
40
|
-
const _r1 = i0.ɵɵgetCurrentView();
|
|
41
|
-
i0.ɵɵelementStart(0, "mat-tree-node", 15);
|
|
42
|
-
i0.ɵɵelement(1, "button", 16);
|
|
43
|
-
i0.ɵɵelementStart(2, "mat-checkbox", 17);
|
|
44
|
-
i0.ɵɵlistener("change", function DataTreeComponent_mat_tree_node_15_Template_mat_checkbox_change_2_listener() { const node_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.update(node_r2)); });
|
|
45
|
-
i0.ɵɵelementStart(3, "span", 18);
|
|
46
|
-
i0.ɵɵtext(4);
|
|
47
|
-
i0.ɵɵelementEnd();
|
|
48
|
-
i0.ɵɵelementStart(5, "span", 19);
|
|
49
|
-
i0.ɵɵtext(6);
|
|
50
|
-
i0.ɵɵelementEnd()()();
|
|
51
|
-
} if (rf & 2) {
|
|
52
|
-
const node_r2 = ctx.$implicit;
|
|
53
|
-
const ctx_r2 = i0.ɵɵnextContext();
|
|
54
|
-
i0.ɵɵadvance(2);
|
|
55
|
-
i0.ɵɵproperty("checked", ctx_r2.nodeIsChecked(node_r2))("matTooltip", "Map data field: " + node_r2.key);
|
|
56
|
-
i0.ɵɵadvance();
|
|
57
|
-
i0.ɵɵattribute("aria-label", "Field name: " + node_r2.key);
|
|
58
|
-
i0.ɵɵadvance();
|
|
59
|
-
i0.ɵɵtextInterpolate1("", node_r2.key, ":");
|
|
60
|
-
i0.ɵɵadvance();
|
|
61
|
-
i0.ɵɵstyleProp("color", ctx_r2.getNodeValueColor(node_r2.value));
|
|
62
|
-
i0.ɵɵattribute("aria-label", "Field value: " + node_r2.value);
|
|
63
|
-
i0.ɵɵadvance();
|
|
64
|
-
i0.ɵɵtextInterpolate1(" ", node_r2.value, " ");
|
|
65
|
-
} }
|
|
66
|
-
function DataTreeComponent_mat_tree_node_16_Template(rf, ctx) { if (rf & 1) {
|
|
67
|
-
const _r4 = i0.ɵɵgetCurrentView();
|
|
68
|
-
i0.ɵɵelementStart(0, "mat-tree-node", 15)(1, "button", 20)(2, "mat-icon");
|
|
69
|
-
i0.ɵɵtext(3);
|
|
70
|
-
i0.ɵɵelementEnd()();
|
|
71
|
-
i0.ɵɵelementStart(4, "mat-checkbox", 21);
|
|
72
|
-
i0.ɵɵlistener("change", function DataTreeComponent_mat_tree_node_16_Template_mat_checkbox_change_4_listener() { const node_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.update(node_r5)); });
|
|
73
|
-
i0.ɵɵelementStart(5, "span", 18);
|
|
74
|
-
i0.ɵɵtext(6);
|
|
75
|
-
i0.ɵɵelementEnd()()();
|
|
76
|
-
} if (rf & 2) {
|
|
77
|
-
const node_r5 = ctx.$implicit;
|
|
78
|
-
const ctx_r2 = i0.ɵɵnextContext();
|
|
79
|
-
i0.ɵɵadvance();
|
|
80
|
-
i0.ɵɵattribute("aria-label", "Toggle " + node_r5.key);
|
|
81
|
-
i0.ɵɵadvance(2);
|
|
82
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r2.treeClass.treeControl.isExpanded(node_r5) ? "expand_more" : "chevron_right", " ");
|
|
83
|
-
i0.ɵɵadvance();
|
|
84
|
-
i0.ɵɵproperty("checked", ctx_r2.nodeIsChecked(node_r5))("matTooltip", "Select " + node_r5.key);
|
|
85
|
-
i0.ɵɵadvance(2);
|
|
86
|
-
i0.ɵɵtextInterpolate(node_r5.key);
|
|
87
|
-
} }
|
|
88
|
-
function DataTreeComponent_div_24_Template(rf, ctx) { if (rf & 1) {
|
|
89
|
-
i0.ɵɵelementStart(0, "div", 4)(1, "mat-icon", 5);
|
|
90
|
-
i0.ɵɵtext(2, "info");
|
|
91
|
-
i0.ɵɵelementEnd();
|
|
92
|
-
i0.ɵɵelementStart(3, "span");
|
|
93
|
-
i0.ɵɵtext(4, "Select a node from the tree above to begin mapping data");
|
|
94
|
-
i0.ɵɵelementEnd()();
|
|
95
|
-
} }
|
|
96
|
-
function DataTreeComponent_ng_container_28_button_1_Template(rf, ctx) { if (rf & 1) {
|
|
97
|
-
const _r6 = i0.ɵɵgetCurrentView();
|
|
98
|
-
i0.ɵɵelementStart(0, "button", 25);
|
|
99
|
-
i0.ɵɵlistener("click", function DataTreeComponent_ng_container_28_button_1_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r6); const path_r7 = i0.ɵɵnextContext().$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.setupPath(path_r7)); });
|
|
100
|
-
i0.ɵɵelementStart(1, "mat-icon");
|
|
101
|
-
i0.ɵɵtext(2);
|
|
102
|
-
i0.ɵɵelementEnd();
|
|
103
|
-
i0.ɵɵelementStart(3, "span");
|
|
104
|
-
i0.ɵɵtext(4);
|
|
105
|
-
i0.ɵɵelementEnd()();
|
|
106
|
-
} if (rf & 2) {
|
|
107
|
-
const path_r7 = i0.ɵɵnextContext().$implicit;
|
|
108
|
-
i0.ɵɵproperty("disabled", !path_r7.keyIsArrayIndex)("color", path_r7.functions.length > 0 ? "accent" : "");
|
|
109
|
-
i0.ɵɵadvance(2);
|
|
110
|
-
i0.ɵɵtextInterpolate(path_r7.keyIsArrayIndex ? "filter_none" : "folder");
|
|
111
|
-
i0.ɵɵadvance(2);
|
|
112
|
-
i0.ɵɵtextInterpolate(path_r7.key);
|
|
113
|
-
} }
|
|
114
|
-
function DataTreeComponent_ng_container_28_button_2_Template(rf, ctx) { if (rf & 1) {
|
|
115
|
-
const _r8 = i0.ɵɵgetCurrentView();
|
|
116
|
-
i0.ɵɵelementStart(0, "button", 26);
|
|
117
|
-
i0.ɵɵlistener("click", function DataTreeComponent_ng_container_28_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r8); const path_r7 = i0.ɵɵnextContext().$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.removeFunction(path_r7.key)); });
|
|
118
|
-
i0.ɵɵelementStart(1, "mat-icon");
|
|
119
|
-
i0.ɵɵtext(2, "check_circle");
|
|
120
|
-
i0.ɵɵelementEnd();
|
|
121
|
-
i0.ɵɵelementStart(3, "span");
|
|
122
|
-
i0.ɵɵtext(4);
|
|
123
|
-
i0.ɵɵelementEnd()();
|
|
124
|
-
} if (rf & 2) {
|
|
125
|
-
const path_r7 = i0.ɵɵnextContext().$implicit;
|
|
126
|
-
i0.ɵɵadvance(4);
|
|
127
|
-
i0.ɵɵtextInterpolate(path_r7.key);
|
|
128
|
-
} }
|
|
129
|
-
function DataTreeComponent_ng_container_28_mat_icon_3_Template(rf, ctx) { if (rf & 1) {
|
|
130
|
-
i0.ɵɵelementStart(0, "mat-icon", 27);
|
|
131
|
-
i0.ɵɵtext(1, "chevron_right");
|
|
132
|
-
i0.ɵɵelementEnd();
|
|
133
|
-
} }
|
|
134
|
-
function DataTreeComponent_ng_container_28_Template(rf, ctx) { if (rf & 1) {
|
|
135
|
-
i0.ɵɵelementContainerStart(0);
|
|
136
|
-
i0.ɵɵtemplate(1, DataTreeComponent_ng_container_28_button_1_Template, 5, 4, "button", 22)(2, DataTreeComponent_ng_container_28_button_2_Template, 5, 1, "button", 23)(3, DataTreeComponent_ng_container_28_mat_icon_3_Template, 2, 0, "mat-icon", 24);
|
|
137
|
-
i0.ɵɵelementContainerEnd();
|
|
138
|
-
} if (rf & 2) {
|
|
139
|
-
const path_r7 = ctx.$implicit;
|
|
140
|
-
const isLast_r9 = ctx.last;
|
|
141
|
-
i0.ɵɵadvance();
|
|
142
|
-
i0.ɵɵproperty("ngIf", !path_r7.inEdit);
|
|
143
|
-
i0.ɵɵadvance();
|
|
144
|
-
i0.ɵɵproperty("ngIf", !!path_r7.inEdit);
|
|
145
|
-
i0.ɵɵadvance();
|
|
146
|
-
i0.ɵɵproperty("ngIf", !isLast_r9);
|
|
147
|
-
} }
|
|
148
|
-
function DataTreeComponent_div_29_ng_container_2_div_11_mat_form_field_2_Template(rf, ctx) { if (rf & 1) {
|
|
149
|
-
const _r14 = i0.ɵɵgetCurrentView();
|
|
150
|
-
i0.ɵɵelementStart(0, "mat-form-field", 44)(1, "mat-label");
|
|
151
|
-
i0.ɵɵtext(2, "Array function");
|
|
152
|
-
i0.ɵɵelementEnd();
|
|
153
|
-
i0.ɵɵelementStart(3, "mat-select", 45);
|
|
154
|
-
i0.ɵɵlistener("selectionChange", function DataTreeComponent_div_29_ng_container_2_div_11_mat_form_field_2_Template_mat_select_selectionChange_3_listener($event) { i0.ɵɵrestoreView(_r14); const ctx_r2 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r2.functionChanged($event)); });
|
|
155
|
-
i0.ɵɵelementStart(4, "mat-option", 46);
|
|
156
|
-
i0.ɵɵtext(5, "filter");
|
|
157
|
-
i0.ɵɵelementEnd();
|
|
158
|
-
i0.ɵɵelementStart(6, "mat-option", 47);
|
|
159
|
-
i0.ɵɵtext(7, "find");
|
|
160
|
-
i0.ɵɵelementEnd();
|
|
161
|
-
i0.ɵɵelementStart(8, "mat-option", 48);
|
|
162
|
-
i0.ɵɵtext(9, "map");
|
|
163
|
-
i0.ɵɵelementEnd()();
|
|
164
|
-
i0.ɵɵelementStart(10, "mat-hint");
|
|
165
|
-
i0.ɵɵtext(11, " Choose a function to run on the array ");
|
|
166
|
-
i0.ɵɵelementEnd()();
|
|
167
|
-
} if (rf & 2) {
|
|
168
|
-
let tmp_6_0;
|
|
169
|
-
const ctx_r2 = i0.ɵɵnextContext(4);
|
|
170
|
-
i0.ɵɵadvance(3);
|
|
171
|
-
i0.ɵɵproperty("value", (tmp_6_0 = ctx_r2.getFunctionInEdit()) == null ? null : tmp_6_0.function);
|
|
172
|
-
} }
|
|
173
|
-
function DataTreeComponent_div_29_ng_container_2_div_11_mat_form_field_3_Template(rf, ctx) { if (rf & 1) {
|
|
174
|
-
const _r15 = i0.ɵɵgetCurrentView();
|
|
175
|
-
i0.ɵɵelementStart(0, "mat-form-field", 49)(1, "mat-label");
|
|
176
|
-
i0.ɵɵtext(2, "Condition expression");
|
|
177
|
-
i0.ɵɵelementEnd();
|
|
178
|
-
i0.ɵɵelementStart(3, "textarea", 50, 0);
|
|
179
|
-
i0.ɵɵlistener("input", function DataTreeComponent_div_29_ng_container_2_div_11_mat_form_field_3_Template_textarea_input_3_listener($event) { i0.ɵɵrestoreView(_r15); const ctx_r2 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r2.onTextChange($event)); })("focus", function DataTreeComponent_div_29_ng_container_2_div_11_mat_form_field_3_Template_textarea_focus_3_listener($event) { i0.ɵɵrestoreView(_r15); const ctx_r2 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r2.onFocus($event)); });
|
|
180
|
-
i0.ɵɵelementEnd();
|
|
181
|
-
i0.ɵɵelementStart(5, "mat-hint");
|
|
182
|
-
i0.ɵɵtext(6);
|
|
183
|
-
i0.ɵɵelementEnd()();
|
|
184
|
-
} if (rf & 2) {
|
|
185
|
-
let tmp_7_0;
|
|
186
|
-
const ctx_r2 = i0.ɵɵnextContext(4);
|
|
187
|
-
i0.ɵɵadvance(3);
|
|
188
|
-
i0.ɵɵproperty("value", (tmp_7_0 = ctx_r2.getFunctionInEdit()) == null ? null : tmp_7_0.expression);
|
|
189
|
-
i0.ɵɵadvance(3);
|
|
190
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r2.showSuggestions ? "Suggestions are enabled" : "Enter a condition expression to transform the array", " ");
|
|
191
|
-
} }
|
|
192
|
-
function DataTreeComponent_div_29_ng_container_2_div_11_section_4_button_8_Template(rf, ctx) { if (rf & 1) {
|
|
193
|
-
const _r16 = i0.ɵɵgetCurrentView();
|
|
194
|
-
i0.ɵɵelementStart(0, "button", 58);
|
|
195
|
-
i0.ɵɵlistener("click", function DataTreeComponent_div_29_ng_container_2_div_11_section_4_button_8_Template_button_click_0_listener() { const method_r17 = i0.ɵɵrestoreView(_r16).$implicit; const ctx_r2 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r2.selectSuggestionInput(method_r17.value)); });
|
|
196
|
-
i0.ɵɵtext(1);
|
|
197
|
-
i0.ɵɵpipe(2, "titlecase");
|
|
198
|
-
i0.ɵɵelementEnd();
|
|
199
|
-
} if (rf & 2) {
|
|
200
|
-
const method_r17 = ctx.$implicit;
|
|
201
|
-
i0.ɵɵadvance();
|
|
202
|
-
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, method_r17.label), " ");
|
|
203
|
-
} }
|
|
204
|
-
function DataTreeComponent_div_29_ng_container_2_div_11_section_4_button_13_Template(rf, ctx) { if (rf & 1) {
|
|
205
|
-
const _r18 = i0.ɵɵgetCurrentView();
|
|
206
|
-
i0.ɵɵelementStart(0, "button", 59);
|
|
207
|
-
i0.ɵɵlistener("click", function DataTreeComponent_div_29_ng_container_2_div_11_section_4_button_13_Template_button_click_0_listener() { const input_r19 = i0.ɵɵrestoreView(_r18).$implicit; const ctx_r2 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r2.selectSuggestionInput(input_r19.formControlName)); });
|
|
208
|
-
i0.ɵɵtext(1);
|
|
209
|
-
i0.ɵɵpipe(2, "titlecase");
|
|
210
|
-
i0.ɵɵelementEnd();
|
|
211
|
-
} if (rf & 2) {
|
|
212
|
-
const input_r19 = ctx.$implicit;
|
|
213
|
-
i0.ɵɵadvance();
|
|
214
|
-
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, input_r19.label), " ");
|
|
215
|
-
} }
|
|
216
|
-
function DataTreeComponent_div_29_ng_container_2_div_11_section_4_Template(rf, ctx) { if (rf & 1) {
|
|
217
|
-
i0.ɵɵelementStart(0, "section", 51);
|
|
218
|
-
i0.ɵɵelement(1, "mat-divider");
|
|
219
|
-
i0.ɵɵelementStart(2, "div", 52)(3, "div", 53)(4, "div", 54)(5, "h5");
|
|
220
|
-
i0.ɵɵtext(6, "Logical Operators");
|
|
221
|
-
i0.ɵɵelementEnd();
|
|
222
|
-
i0.ɵɵelementStart(7, "div", 55);
|
|
223
|
-
i0.ɵɵtemplate(8, DataTreeComponent_div_29_ng_container_2_div_11_section_4_button_8_Template, 3, 3, "button", 56);
|
|
224
|
-
i0.ɵɵelementEnd()();
|
|
225
|
-
i0.ɵɵelementStart(9, "div", 54)(10, "h5");
|
|
226
|
-
i0.ɵɵtext(11, "Add Input as a Variable");
|
|
227
|
-
i0.ɵɵelementEnd();
|
|
228
|
-
i0.ɵɵelementStart(12, "div", 55);
|
|
229
|
-
i0.ɵɵtemplate(13, DataTreeComponent_div_29_ng_container_2_div_11_section_4_button_13_Template, 3, 3, "button", 57);
|
|
230
|
-
i0.ɵɵelementEnd()()();
|
|
231
|
-
i0.ɵɵelement(14, "div", 53);
|
|
232
|
-
i0.ɵɵelementEnd()();
|
|
233
|
-
} if (rf & 2) {
|
|
234
|
-
const ctx_r2 = i0.ɵɵnextContext(4);
|
|
235
|
-
i0.ɵɵadvance(8);
|
|
236
|
-
i0.ɵɵproperty("ngForOf", ctx_r2.getMethods());
|
|
237
|
-
i0.ɵɵadvance(5);
|
|
238
|
-
i0.ɵɵproperty("ngForOf", ctx_r2.getAllInputs());
|
|
239
|
-
} }
|
|
240
|
-
function DataTreeComponent_div_29_ng_container_2_div_11_Template(rf, ctx) { if (rf & 1) {
|
|
241
|
-
const _r13 = i0.ɵɵgetCurrentView();
|
|
242
|
-
i0.ɵɵelementStart(0, "div", 36);
|
|
243
|
-
i0.ɵɵelement(1, "mat-divider");
|
|
244
|
-
i0.ɵɵtemplate(2, DataTreeComponent_div_29_ng_container_2_div_11_mat_form_field_2_Template, 12, 1, "mat-form-field", 37)(3, DataTreeComponent_div_29_ng_container_2_div_11_mat_form_field_3_Template, 7, 2, "mat-form-field", 38)(4, DataTreeComponent_div_29_ng_container_2_div_11_section_4_Template, 15, 2, "section", 39);
|
|
245
|
-
i0.ɵɵelementStart(5, "mat-toolbar", 40);
|
|
246
|
-
i0.ɵɵelement(6, "span", 41);
|
|
247
|
-
i0.ɵɵelementStart(7, "button", 42);
|
|
248
|
-
i0.ɵɵlistener("click", function DataTreeComponent_div_29_ng_container_2_div_11_Template_button_click_7_listener() { i0.ɵɵrestoreView(_r13); const ctx_r2 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r2.reset()); });
|
|
249
|
-
i0.ɵɵtext(8, " reset ");
|
|
250
|
-
i0.ɵɵelementEnd();
|
|
251
|
-
i0.ɵɵelementStart(9, "button", 43);
|
|
252
|
-
i0.ɵɵlistener("click", function DataTreeComponent_div_29_ng_container_2_div_11_Template_button_click_9_listener() { i0.ɵɵrestoreView(_r13); const ctx_r2 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r2.saveNodeInEdit()); });
|
|
253
|
-
i0.ɵɵtext(10, " save ");
|
|
254
|
-
i0.ɵɵelementEnd()()();
|
|
255
|
-
} if (rf & 2) {
|
|
256
|
-
const function_r12 = i0.ɵɵnextContext().$implicit;
|
|
257
|
-
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
258
|
-
i0.ɵɵadvance(2);
|
|
259
|
-
i0.ɵɵproperty("ngIf", ctx_r2.treeClass.pathInEdit == null ? null : ctx_r2.treeClass.pathInEdit.functions);
|
|
260
|
-
i0.ɵɵadvance();
|
|
261
|
-
i0.ɵɵproperty("ngIf", ctx_r2.treeClass.pathInEdit == null ? null : ctx_r2.treeClass.pathInEdit.functions);
|
|
262
|
-
i0.ɵɵadvance();
|
|
263
|
-
i0.ɵɵproperty("ngIf", ctx_r2.showSuggestions);
|
|
264
|
-
i0.ɵɵadvance(5);
|
|
265
|
-
i0.ɵɵproperty("disabled", !function_r12.expression && !function_r12.function);
|
|
266
|
-
} }
|
|
267
|
-
function DataTreeComponent_div_29_ng_container_2_Template(rf, ctx) { if (rf & 1) {
|
|
268
|
-
const _r11 = i0.ɵɵgetCurrentView();
|
|
269
|
-
i0.ɵɵelementContainerStart(0);
|
|
270
|
-
i0.ɵɵelementStart(1, "mat-list-item", 30)(2, "span", 31)(3, "strong");
|
|
271
|
-
i0.ɵɵtext(4);
|
|
272
|
-
i0.ɵɵelementEnd()();
|
|
273
|
-
i0.ɵɵelementStart(5, "a", 32);
|
|
274
|
-
i0.ɵɵlistener("click", function DataTreeComponent_div_29_ng_container_2_Template_a_click_5_listener() { const function_r12 = i0.ɵɵrestoreView(_r11).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.editFunction(function_r12.id)); });
|
|
275
|
-
i0.ɵɵtext(6);
|
|
276
|
-
i0.ɵɵpipe(7, "titlecase");
|
|
277
|
-
i0.ɵɵelementEnd();
|
|
278
|
-
i0.ɵɵelementStart(8, "button", 33);
|
|
279
|
-
i0.ɵɵlistener("click", function DataTreeComponent_div_29_ng_container_2_Template_button_click_8_listener() { const function_r12 = i0.ɵɵrestoreView(_r11).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.removeFunction(function_r12.id)); });
|
|
280
|
-
i0.ɵɵelementStart(9, "mat-icon", 34);
|
|
281
|
-
i0.ɵɵtext(10);
|
|
282
|
-
i0.ɵɵelementEnd()()();
|
|
283
|
-
i0.ɵɵtemplate(11, DataTreeComponent_div_29_ng_container_2_div_11_Template, 11, 4, "div", 35);
|
|
284
|
-
i0.ɵɵelement(12, "mat-divider");
|
|
285
|
-
i0.ɵɵelementContainerEnd();
|
|
286
|
-
} if (rf & 2) {
|
|
287
|
-
const function_r12 = ctx.$implicit;
|
|
288
|
-
const i_r20 = ctx.index;
|
|
289
|
-
i0.ɵɵadvance();
|
|
290
|
-
i0.ɵɵproperty("activated", !!function_r12.inEdit);
|
|
291
|
-
i0.ɵɵadvance(3);
|
|
292
|
-
i0.ɵɵtextInterpolate1(" ", i_r20 + 1, " ");
|
|
293
|
-
i0.ɵɵadvance(2);
|
|
294
|
-
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(7, 6, function_r12.function) || "Function configurations required", "");
|
|
295
|
-
i0.ɵɵadvance(3);
|
|
296
|
-
i0.ɵɵproperty("color", function_r12.function && function_r12.expression ? "" : "warn");
|
|
297
|
-
i0.ɵɵadvance();
|
|
298
|
-
i0.ɵɵtextInterpolate(!function_r12.inEdit ? "close" : "check_circle");
|
|
299
|
-
i0.ɵɵadvance();
|
|
300
|
-
i0.ɵɵproperty("ngIf", function_r12.inEdit);
|
|
301
|
-
} }
|
|
302
|
-
function DataTreeComponent_div_29_Template(rf, ctx) { if (rf & 1) {
|
|
303
|
-
const _r10 = i0.ɵɵgetCurrentView();
|
|
304
|
-
i0.ɵɵelementStart(0, "div")(1, "mat-nav-list");
|
|
305
|
-
i0.ɵɵtemplate(2, DataTreeComponent_div_29_ng_container_2_Template, 13, 8, "ng-container", 28);
|
|
306
|
-
i0.ɵɵelementEnd();
|
|
307
|
-
i0.ɵɵelement(3, "ol");
|
|
308
|
-
i0.ɵɵelementStart(4, "button", 29);
|
|
309
|
-
i0.ɵɵlistener("click", function DataTreeComponent_div_29_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r10); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.addNewFunction()); });
|
|
310
|
-
i0.ɵɵtext(5, "+ Add function ");
|
|
311
|
-
i0.ɵɵelementEnd()();
|
|
312
|
-
} if (rf & 2) {
|
|
313
|
-
const ctx_r2 = i0.ɵɵnextContext();
|
|
314
|
-
i0.ɵɵadvance(2);
|
|
315
|
-
i0.ɵɵproperty("ngForOf", ctx_r2.treeClass.pathInEdit == null ? null : ctx_r2.treeClass.pathInEdit.functions);
|
|
316
|
-
} }
|
|
317
|
-
;
|
|
318
|
-
class DataTreeComponent {
|
|
319
|
-
constructor() {
|
|
320
|
-
this.value = [];
|
|
321
|
-
this.formInputs = [];
|
|
322
|
-
this.pathChanged = new EventEmitter();
|
|
323
|
-
this._value = [];
|
|
324
|
-
this.showSuggestions = false;
|
|
325
|
-
this.suggestions = ['$option1', '$option2', '$option3', '$custom'];
|
|
326
|
-
this.filteredSuggestions = [];
|
|
327
|
-
this.cursorPosition = 0;
|
|
328
|
-
this.methods = [
|
|
329
|
-
// Logical Operators
|
|
330
|
-
{
|
|
331
|
-
label: 'logical AND (&&)',
|
|
332
|
-
value: '&&'
|
|
333
|
-
},
|
|
334
|
-
{
|
|
335
|
-
label: 'logical OR (||)',
|
|
336
|
-
value: '||'
|
|
337
|
-
},
|
|
338
|
-
// Comparison Operators
|
|
339
|
-
{
|
|
340
|
-
label: 'strict equality (===)',
|
|
341
|
-
value: '==='
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
label: 'loose equality (==)',
|
|
345
|
-
value: '=='
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
label: 'strict inequality (!==)',
|
|
349
|
-
value: '!=='
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
label: 'loose inequality (!=)',
|
|
353
|
-
value: '!='
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
label: 'greater than (>)',
|
|
357
|
-
value: '>'
|
|
358
|
-
},
|
|
359
|
-
{
|
|
360
|
-
label: 'less than (<)',
|
|
361
|
-
value: '<'
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
label: 'greater than or equal to (>=)',
|
|
365
|
-
value: '>='
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
label: 'less than or equal to (<=)',
|
|
369
|
-
value: '<='
|
|
370
|
-
}
|
|
371
|
-
];
|
|
372
|
-
this.showValue = false;
|
|
373
|
-
this.treeClass = new TreeComponent();
|
|
374
|
-
}
|
|
375
|
-
ngOnChanges(changes) {
|
|
376
|
-
if (changes['data']) {
|
|
377
|
-
if (JSON.stringify(this._data) !== JSON.stringify(changes['data'].currentValue)) {
|
|
378
|
-
this._data = changes['data'].currentValue;
|
|
379
|
-
this.treeClass.computeTreeData(changes['data'].currentValue);
|
|
380
|
-
if (this.value && Array.isArray(this.value) && this.value.length > 0 && 'functions' in (this.value?.[0] || {})) {
|
|
381
|
-
this.treeClass.updateStateFromPath(this.value);
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
if (changes['value']) {
|
|
386
|
-
this.valueChangedSetPath(changes['value'].currentValue);
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
ngOnInit() {
|
|
390
|
-
}
|
|
391
|
-
valueChangedSetPath(newPath) {
|
|
392
|
-
const isSameAsNewPath = typeof newPath === typeof this._value && JSON.stringify(newPath) === JSON.stringify(this._value);
|
|
393
|
-
if (!isSameAsNewPath && Array.isArray(newPath)) {
|
|
394
|
-
this._value = newPath;
|
|
395
|
-
this.treeClass.updateStateFromPath(newPath);
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
async onTextChange(event) {
|
|
399
|
-
const newValue = event.target.value;
|
|
400
|
-
const functions = this.treeClass.pathInEdit.functions.find(f => f.inEdit);
|
|
401
|
-
functions.expression = newValue;
|
|
402
|
-
this.treeClass.pathInEdit.functions.map(f => {
|
|
403
|
-
if (f.inEdit) {
|
|
404
|
-
return functions;
|
|
405
|
-
}
|
|
406
|
-
return f;
|
|
407
|
-
});
|
|
408
|
-
const textarea = this.textareaElementRef.nativeElement;
|
|
409
|
-
this.cursorPosition = textarea.selectionStart || 0;
|
|
410
|
-
const lastChar = newValue[this.cursorPosition - 1];
|
|
411
|
-
if (lastChar === '$') {
|
|
412
|
-
this.showSuggestions = true;
|
|
413
|
-
this.filteredSuggestions = this.suggestions;
|
|
414
|
-
}
|
|
415
|
-
else {
|
|
416
|
-
this.showSuggestions = false;
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
functionChanged(event) {
|
|
420
|
-
this.treeClass.functionChanged(event.value);
|
|
421
|
-
}
|
|
422
|
-
addNewFunction() {
|
|
423
|
-
this.treeClass.addNewFunction();
|
|
424
|
-
}
|
|
425
|
-
editFunction(id) {
|
|
426
|
-
this.treeClass.pathInEdit.functions = this.treeClass.pathInEdit.functions?.map(f => {
|
|
427
|
-
if (f.id === id) {
|
|
428
|
-
return { ...f, inEdit: true };
|
|
429
|
-
}
|
|
430
|
-
return { ...f, inEdit: false };
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
selectSuggestionInput(suggestion) {
|
|
434
|
-
const functions = this.treeClass.pathInEdit.functions.find(f => f.inEdit) || {};
|
|
435
|
-
const value = functions?.expression || '';
|
|
436
|
-
const beforeCursor = value.slice(0, this.cursorPosition - 1);
|
|
437
|
-
const afterCursor = value.slice(this.cursorPosition);
|
|
438
|
-
functions.expression = beforeCursor + suggestion + ' ' + afterCursor;
|
|
439
|
-
this.treeClass.pathInEdit.functions.map(f => {
|
|
440
|
-
if (f.inEdit) {
|
|
441
|
-
return functions;
|
|
442
|
-
}
|
|
443
|
-
return f;
|
|
444
|
-
});
|
|
445
|
-
this.showSuggestions = false;
|
|
446
|
-
const textarea = this.textareaElementRef.nativeElement;
|
|
447
|
-
textarea.focus();
|
|
448
|
-
const newCursorPosition = this.cursorPosition + suggestion.length;
|
|
449
|
-
setTimeout(() => {
|
|
450
|
-
textarea.setSelectionRange(newCursorPosition, newCursorPosition);
|
|
451
|
-
}, 0);
|
|
452
|
-
}
|
|
453
|
-
onFocus(event) {
|
|
454
|
-
const textarea = this.textareaElementRef.nativeElement;
|
|
455
|
-
this.cursorPosition = textarea.selectionStart || 0;
|
|
456
|
-
}
|
|
457
|
-
nodeIsChecked(node) {
|
|
458
|
-
return this.treeClass.nodeIsChecked(node);
|
|
459
|
-
}
|
|
460
|
-
hasANodeInEdit() {
|
|
461
|
-
return this.treeClass.hasANodeInEdit();
|
|
462
|
-
}
|
|
463
|
-
showNode(node) {
|
|
464
|
-
return this.treeClass.showNode(node);
|
|
465
|
-
}
|
|
466
|
-
onSearchChange(event) {
|
|
467
|
-
this.optionsSearch = event.target.value;
|
|
468
|
-
}
|
|
469
|
-
getMethods() {
|
|
470
|
-
return searchAndOrderArray(this.methods, this.optionsSearch, 'label');
|
|
471
|
-
}
|
|
472
|
-
getNodeValueColor(v) {
|
|
473
|
-
const valueType = typeof v;
|
|
474
|
-
switch (valueType) {
|
|
475
|
-
case 'string':
|
|
476
|
-
return '#c56100';
|
|
477
|
-
case 'number':
|
|
478
|
-
return 'mediumblue';
|
|
479
|
-
case 'boolean':
|
|
480
|
-
return 'forestgreen';
|
|
481
|
-
case 'object':
|
|
482
|
-
return '#005959';
|
|
483
|
-
default:
|
|
484
|
-
return 'currentcolor';
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
setupPath(node) {
|
|
488
|
-
return this.treeClass.setupPath(node);
|
|
489
|
-
}
|
|
490
|
-
trackByFn(index, node) {
|
|
491
|
-
return node.path.join('.');
|
|
492
|
-
}
|
|
493
|
-
getAllInputs() {
|
|
494
|
-
const inputs = this.formInputs
|
|
495
|
-
.filter((inp) => !inp.multipleInputInEditId);
|
|
496
|
-
return searchAndOrderArray(inputs || [], this.optionsSearch, 'label');
|
|
497
|
-
}
|
|
498
|
-
getValueVariables() {
|
|
499
|
-
const isObject = typeof this.value === 'object';
|
|
500
|
-
if (!this.value) {
|
|
501
|
-
return [];
|
|
502
|
-
}
|
|
503
|
-
if (!isObject && !!this.value) {
|
|
504
|
-
return [this.value];
|
|
505
|
-
}
|
|
506
|
-
if (Array.isArray(this.value)) {
|
|
507
|
-
return this.value.map((v, i) => (i));
|
|
508
|
-
}
|
|
509
|
-
return Object.keys(this.value);
|
|
510
|
-
}
|
|
511
|
-
saveNodeInEdit() {
|
|
512
|
-
const newP = this.treeClass.saveNodeInEdit();
|
|
513
|
-
if (newP) {
|
|
514
|
-
this.pathChanged.emit(newP);
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
closeEdit() {
|
|
518
|
-
this.treeClass.closeEdit();
|
|
519
|
-
}
|
|
520
|
-
reset() {
|
|
521
|
-
this.treeClass.resetNode();
|
|
522
|
-
}
|
|
523
|
-
getFunctionInEdit() {
|
|
524
|
-
const node = this.treeClass.pathInEdit;
|
|
525
|
-
return node?.functions?.find(f => f.inEdit);
|
|
526
|
-
}
|
|
527
|
-
get getValue() {
|
|
528
|
-
return this.treeClass.getValue();
|
|
529
|
-
}
|
|
530
|
-
removeFunction(id) {
|
|
531
|
-
this.treeClass.removeFunction(id);
|
|
532
|
-
}
|
|
533
|
-
update(node) {
|
|
534
|
-
const path = this.treeClass.selectNode(node)?.map(p => ({
|
|
535
|
-
...p,
|
|
536
|
-
children: undefined,
|
|
537
|
-
value: undefined
|
|
538
|
-
}));
|
|
539
|
-
this.pathChanged.emit(path);
|
|
540
|
-
}
|
|
541
|
-
static { this.ɵfac = function DataTreeComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DataTreeComponent)(); }; }
|
|
542
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DataTreeComponent, selectors: [["app-data-tree"]], viewQuery: function DataTreeComponent_Query(rf, ctx) { if (rf & 1) {
|
|
543
|
-
i0.ɵɵviewQuery(_c0$1, 5, ElementRef);
|
|
544
|
-
} if (rf & 2) {
|
|
545
|
-
let _t;
|
|
546
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.textareaElementRef = _t.first);
|
|
547
|
-
} }, inputs: { data: "data", value: "value", formInputs: "formInputs" }, outputs: { pathChanged: "pathChanged" }, features: [i0.ɵɵNgOnChangesFeature], decls: 42, vars: 10, consts: [["textarea", ""], ["multi", ""], [1, "title-icon"], [1, "content"], [1, "tree-instructions"], ["color", "primary", 1, "info-icon"], [3, "dataSource", "treeControl"], ["matTreeNodePadding", "", 4, "matTreeNodeDef"], ["matTreeNodePadding", "", 4, "matTreeNodeDef", "matTreeNodeDefWhen"], ["class", "tree-instructions", 4, "ngIf"], [2, "height", "fit-content", "background", "inherit"], [1, "breadcrumb-container"], [4, "ngFor", "ngForOf", "ngForTrackBy"], [4, "ngIf"], [2, "padding", "16px", "background", "black", "color", "cadetblue", "border-radius", "8px", "min-width", "fit-content"], ["matTreeNodePadding", ""], ["disabled", "", "aria-hidden", "true", "mat-icon-button", "", 1, "node-spacer"], [1, "node-checkbox", 3, "change", "checked", "matTooltip"], [1, "node-key"], [1, "node-value", 2, "white-space", "nowrap"], ["mat-icon-button", "", "matTreeNodeToggle", "", 2, "padding", "0px", "width", "24px"], [3, "change", "checked", "matTooltip"], ["matTooltip", "Click to edit", "mat-button", "", "class", "breadcrumb-item", 3, "disabled", "color", "click", 4, "ngIf"], ["matTooltip", "Currently editing", "mat-raised-button", "", "color", "primary", "class", "breadcrumb-item", 3, "click", 4, "ngIf"], ["class", "breadcrumb-separator", 4, "ngIf"], ["matTooltip", "Click to edit", "mat-button", "", 1, "breadcrumb-item", 3, "click", "disabled", "color"], ["matTooltip", "Currently editing", "mat-raised-button", "", "color", "primary", 1, "breadcrumb-item", 3, "click"], [1, "breadcrumb-separator"], [4, "ngFor", "ngForOf"], ["mat-button", "", 3, "click"], [1, "functions", 2, "height", "fit-content", 3, "activated"], ["matListItemIcon", "", 1, "function-number"], ["matListItemTitle", "", 2, "font-size", "14px", "white-space", "nowrap", "overflow", "hidden", "text-overflow", "ellipsis", 3, "click"], ["mat-icon-button", "", "matListItemMeta", "", 3, "click"], [3, "color"], ["class", "function-edit-container", 4, "ngIf"], [1, "function-edit-container"], ["style", " margin-bottom: 8px;", "appearance", "outline", 4, "ngIf"], ["appearance", "outline", 4, "ngIf"], ["class", "showSuggestionContainer", 4, "ngIf"], [2, "background", "none"], [1, "spacer"], ["mat-flat-button", "", 3, "click"], ["mat-flat-button", "", "color", "primary", 3, "click", "disabled"], ["appearance", "outline", 2, "margin-bottom", "8px"], ["matNativeControl", "", "placeholder", "ChooseFunctionToRun", 3, "selectionChange", "value"], ["value", "filter"], ["value", "find"], ["value", "map"], ["appearance", "outline"], ["matInput", "", "placeholder", "Enter a validation string for the function", 3, "input", "focus", "value"], [1, "showSuggestionContainer"], [1, "", 2, "padding", "8px"], [1, "suggestion-container"], [1, "suggestion-column"], [1, "button-container"], ["color", "primary", "mat-flat-button", "", "class", "suggestion-button", 3, "click", 4, "ngFor", "ngForOf"], ["mat-flat-button", "", "class", "suggestion-button", 3, "click", 4, "ngFor", "ngForOf"], ["color", "primary", "mat-flat-button", "", 1, "suggestion-button", 3, "click"], ["mat-flat-button", "", 1, "suggestion-button", 3, "click"]], template: function DataTreeComponent_Template(rf, ctx) { if (rf & 1) {
|
|
548
|
-
i0.ɵɵelementStart(0, "mat-accordion", 1)(1, "mat-expansion-panel")(2, "mat-expansion-panel-header")(3, "mat-panel-title")(4, "mat-icon", 2);
|
|
549
|
-
i0.ɵɵtext(5, "dataset_linked");
|
|
550
|
-
i0.ɵɵelementEnd();
|
|
551
|
-
i0.ɵɵtext(6, " Navigate and select data fields for mapping ");
|
|
552
|
-
i0.ɵɵelementEnd()();
|
|
553
|
-
i0.ɵɵelementStart(7, "div", 3)(8, "div", 4)(9, "mat-icon", 5);
|
|
554
|
-
i0.ɵɵtext(10, "info");
|
|
555
|
-
i0.ɵɵelementEnd();
|
|
556
|
-
i0.ɵɵelementStart(11, "span");
|
|
557
|
-
i0.ɵɵtext(12, "Click checkboxes to select fields for mapping. Selected paths will be highlighted.");
|
|
558
|
-
i0.ɵɵelementEnd()();
|
|
559
|
-
i0.ɵɵelement(13, "mat-divider");
|
|
560
|
-
i0.ɵɵelementStart(14, "mat-tree", 6);
|
|
561
|
-
i0.ɵɵtemplate(15, DataTreeComponent_mat_tree_node_15_Template, 7, 8, "mat-tree-node", 7)(16, DataTreeComponent_mat_tree_node_16_Template, 7, 5, "mat-tree-node", 8);
|
|
562
|
-
i0.ɵɵelementEnd()()();
|
|
563
|
-
i0.ɵɵelementStart(17, "mat-expansion-panel")(18, "mat-expansion-panel-header")(19, "mat-panel-title")(20, "mat-icon", 2);
|
|
564
|
-
i0.ɵɵtext(21, "rebase_edit");
|
|
565
|
-
i0.ɵɵelementEnd();
|
|
566
|
-
i0.ɵɵtext(22, " Configure and transform your data path ");
|
|
567
|
-
i0.ɵɵelementEnd()();
|
|
568
|
-
i0.ɵɵelementStart(23, "div", 3);
|
|
569
|
-
i0.ɵɵtemplate(24, DataTreeComponent_div_24_Template, 5, 0, "div", 9);
|
|
570
|
-
i0.ɵɵelement(25, "mat-divider");
|
|
571
|
-
i0.ɵɵelementStart(26, "mat-toolbar", 10)(27, "div", 11);
|
|
572
|
-
i0.ɵɵtemplate(28, DataTreeComponent_ng_container_28_Template, 4, 3, "ng-container", 12);
|
|
573
|
-
i0.ɵɵelementEnd()();
|
|
574
|
-
i0.ɵɵtemplate(29, DataTreeComponent_div_29_Template, 6, 1, "div", 13);
|
|
575
|
-
i0.ɵɵelementEnd()();
|
|
576
|
-
i0.ɵɵelementStart(30, "mat-expansion-panel")(31, "mat-expansion-panel-header")(32, "mat-panel-title")(33, "mat-icon", 2);
|
|
577
|
-
i0.ɵɵtext(34, "dataset");
|
|
578
|
-
i0.ɵɵelementEnd();
|
|
579
|
-
i0.ɵɵtext(35, " Mapped Data Value Based on the Active Path ");
|
|
580
|
-
i0.ɵɵelementEnd()();
|
|
581
|
-
i0.ɵɵelementStart(36, "div", 3);
|
|
582
|
-
i0.ɵɵelement(37, "mat-divider");
|
|
583
|
-
i0.ɵɵelementStart(38, "div", 14)(39, "pre");
|
|
584
|
-
i0.ɵɵtext(40);
|
|
585
|
-
i0.ɵɵpipe(41, "json");
|
|
586
|
-
i0.ɵɵelementEnd()()()()();
|
|
587
|
-
} if (rf & 2) {
|
|
588
|
-
i0.ɵɵadvance(14);
|
|
589
|
-
i0.ɵɵproperty("dataSource", ctx.treeClass.dataSource)("treeControl", ctx.treeClass.treeControl);
|
|
590
|
-
i0.ɵɵadvance(2);
|
|
591
|
-
i0.ɵɵproperty("matTreeNodeDefWhen", ctx.treeClass.hasChild);
|
|
592
|
-
i0.ɵɵadvance(8);
|
|
593
|
-
i0.ɵɵproperty("ngIf", ctx.treeClass.activePath.length === 0);
|
|
594
|
-
i0.ɵɵadvance(4);
|
|
595
|
-
i0.ɵɵproperty("ngForOf", ctx.treeClass.activePath)("ngForTrackBy", ctx.trackByFn);
|
|
596
|
-
i0.ɵɵadvance();
|
|
597
|
-
i0.ɵɵproperty("ngIf", !!ctx.hasANodeInEdit());
|
|
598
|
-
i0.ɵɵadvance(11);
|
|
599
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(41, 8, ctx.getValue));
|
|
600
|
-
} }, dependencies: [CommonModule, i2.NgForOf, i2.NgIf, i2.JsonPipe, i2.TitleCasePipe, MatModulesModule, i3.MatOption, i2$1.MatButton, i2$1.MatIconButton, i3$1.MatCheckbox, i4.MatDivider, i5.MatAccordion, i5.MatExpansionPanel, i5.MatExpansionPanelHeader, i5.MatExpansionPanelTitle, i6.MatIcon, i6$1.MatNavList, i6$1.MatListItem, i6$1.MatListItemIcon, i6$1.MatListItemTitle, i6$1.MatListItemMeta, i3$2.MatFormField, i3$2.MatLabel, i3$2.MatHint, i7.MatSelect, i9.MatToolbar, i8.MatTooltip, i3$3.MatTreeNodeDef, i3$3.MatTreeNodePadding, i3$3.MatTreeNodeToggle, i3$3.MatTree, i3$3.MatTreeNode, i12.MatInput, FormsModule], styles: ["mat-tree[_ngcontent-%COMP%]{min-width:fit-content;background:azure}mat-tree-node[_ngcontent-%COMP%]{min-height:28px!important;height:32px!important}.breadcrumb-container[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:wrap;padding:8px 0}.breadcrumb-item[_ngcontent-%COMP%]{display:inline-flex;align-items:center;margin:0;transition:background-color .3s ease}.breadcrumb-separator[_ngcontent-%COMP%]{margin:0}.breadcrumb-separator[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px}.info-icon[_ngcontent-%COMP%]{width:38px}mat-expansion-panel-header[_ngcontent-%COMP%]{padding-left:16px;padding-right:16px}mat-expansion-panel[_ngcontent-%COMP%]{background:var(--mat-toolbar-container-background-color, var(--mat-app-surface))}.tree-instructions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:12px;background:var(--mdc-elevated-card-container-color, var(--mat-app-surface-container-low));border-radius:4px;margin-bottom:16px}.node-spacer[_ngcontent-%COMP%]{width:24px;padding:0}.node-checkbox[_ngcontent-%COMP%]{width:100%}.node-key[_ngcontent-%COMP%]{font-weight:500;color:#2c2c2c}.node-value[_ngcontent-%COMP%]{font-family:monospace;padding:2px 6px;background:#f8f9fa;border-radius:3px;font-size:.9em}.suggestion-container[_ngcontent-%COMP%]{display:flex;width:100%;gap:14px}.suggestion-column[_ngcontent-%COMP%]{flex:1;min-width:0}.button-container[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.suggestion-button[_ngcontent-%COMP%]{height:auto;text-transform:capitalize;margin:2px;padding:8px;line-height:normal;text-align:left;font-size:.8em}h5[_ngcontent-%COMP%]{margin-bottom:8px;font-size:1em}.title-icon[_ngcontent-%COMP%]{margin-right:8px;vertical-align:middle}mat-form-field[_ngcontent-%COMP%]{width:100%;background:azure}.functions[_ngcontent-%COMP%]{color:var(--mat-full-pseudo-checkbox-selected-icon-color)}.function-number[_ngcontent-%COMP%]{font-size:smaller;display:flex;align-items:center;justify-content:center;margin-right:8px;margin-left:8px}.search-field[_ngcontent-%COMP%]{width:100%;padding:8px;border:1px solid var(--mat-divider-color, var(--mat-app-outline));border-radius:4px;margin-left:0}.search-container[_ngcontent-%COMP%]{padding-left:8px;padding-right:8px;height:48px;background:inherit;margin-top:0;height:fit-content}.showSuggestionContainer[_ngcontent-%COMP%]{background:azure}"] }); }
|
|
601
|
-
}
|
|
602
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DataTreeComponent, [{
|
|
603
|
-
type: Component,
|
|
604
|
-
args: [{ selector: 'app-data-tree', standalone: true, imports: [CommonModule, MatModulesModule, FormsModule], template: "<mat-accordion multi>\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon class=\"title-icon\">dataset_linked</mat-icon>\n Navigate and select data fields for mapping\n </mat-panel-title>\n </mat-expansion-panel-header>\n\n <div class=\"content\">\n <div class=\"tree-instructions\">\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\n <span>Click checkboxes to select fields for mapping. Selected paths will be highlighted.</span>\n </div>\n <mat-divider></mat-divider>\n\n <mat-tree [dataSource]=\"treeClass.dataSource\" \n [treeControl]=\"treeClass.treeControl\">\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding>\n <button disabled class=\"node-spacer\" aria-hidden=\"true\" mat-icon-button>\n\n </button>\n <mat-checkbox (change)=\"update(node)\" [checked]=\"nodeIsChecked(node)\" class=\"node-checkbox\"\n [matTooltip]=\"'Map data field: ' + node.key\">\n <span class=\"node-key\" [attr.aria-label]=\"'Field name: ' + node.key\">{{ node.key }}:</span>\n <span [attr.aria-label]=\"'Field value: ' + node.value\" style=\" white-space: nowrap;\" class=\"node-value\"\n [style.color]=\"getNodeValueColor(node.value)\">\n {{ node.value }}\n </span>\n </mat-checkbox>\n </mat-tree-node>\n\n <mat-tree-node *matTreeNodeDef=\"let node; when: treeClass.hasChild\" matTreeNodePadding>\n <button style=\"padding: 0px; \n width: 24px;\" mat-icon-button matTreeNodeToggle [attr.aria-label]=\"'Toggle ' + node.key\">\n <mat-icon>\n {{ treeClass.treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\n </mat-icon>\n </button>\n <mat-checkbox (change)=\"update(node)\" [checked]=\"nodeIsChecked(node)\" [matTooltip]=\"'Select ' + node.key\">\n <span class=\"node-key\">{{ node.key }}</span>\n </mat-checkbox>\n </mat-tree-node>\n </mat-tree>\n </div>\n </mat-expansion-panel>\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon class=\"title-icon\">rebase_edit</mat-icon>\n Configure and transform your data path\n </mat-panel-title>\n </mat-expansion-panel-header>\n\n <div class=\"content\">\n <div class=\"tree-instructions\" *ngIf=\"treeClass.activePath.length === 0\">\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\n <span>Select a node from the tree above to begin mapping data</span>\n </div>\n <mat-divider></mat-divider>\n <mat-toolbar style=\" height: fit-content; background: inherit;\">\n <div class=\"breadcrumb-container\">\n\n <ng-container *ngFor=\"let path of treeClass.activePath; trackBy: trackByFn; last as isLast; index as i\">\n <button *ngIf=\"!path.inEdit\" matTooltip=\"Click to edit\" (click)=\"setupPath(path)\" mat-button\n [disabled]=\"!path.keyIsArrayIndex\" [color]=\"path.functions.length> 0 ? 'accent' : ''\"\n class=\"breadcrumb-item\">\n <mat-icon>{{ path.keyIsArrayIndex ? 'filter_none' : 'folder' }}</mat-icon>\n <span>{{ path.key }}</span>\n </button>\n\n\n <button *ngIf=\"!!path.inEdit\" matTooltip=\"Currently editing\" (click)=\"removeFunction(path.key)\"\n mat-raised-button color=\"primary\" class=\"breadcrumb-item\">\n <mat-icon>check_circle</mat-icon>\n <span>{{ path.key }}</span>\n </button>\n <mat-icon *ngIf=\"!isLast\" class=\"breadcrumb-separator\">chevron_right</mat-icon>\n </ng-container>\n </div>\n </mat-toolbar>\n <div *ngIf=\"!!hasANodeInEdit()\">\n\n <mat-nav-list>\n\n <ng-container *ngFor=\"let function of this.treeClass.pathInEdit?.functions;index as i\">\n <mat-list-item \n [activated]=\"!!function.inEdit\"\n class=\"functions\" style=\"height: fit-content;\">\n <span matListItemIcon class=\"function-number\" > \n <strong> {{i+1}} </strong>\n </span>\n <a \n\n (click)=\"editFunction(function.id)\"\n \n style=\"font-size: 14px; white-space: nowrap;overflow: hidden;text-overflow: ellipsis;\"\n matListItemTitle> {{ (function.function |titlecase) ||\n 'Function configurations required'}}</a>\n <button mat-icon-button \n (click)=\"removeFunction(function.id)\" matListItemMeta>\n\n <mat-icon [color]=\"function.function && function.expression?'':'warn'\">{{!function.inEdit? 'close':'check_circle'}}</mat-icon>\n </button>\n \n \n </mat-list-item>\n \n <div class=\"function-edit-container\" *ngIf=\"function.inEdit\">\n <mat-divider></mat-divider>\n <mat-form-field style=\" margin-bottom: 8px;\" appearance=\"outline\" *ngIf=\"this.treeClass.pathInEdit?.functions\">\n <mat-label>Array function</mat-label>\n <mat-select matNativeControl [value]=\"getFunctionInEdit()?.function\"\n (selectionChange)=\"functionChanged($event)\" placeholder=\"ChooseFunctionToRun\">\n <mat-option value=\"filter\">filter</mat-option>\n <mat-option value=\"find\">find</mat-option>\n <mat-option value=\"map\">map</mat-option>\n </mat-select>\n <mat-hint>\n Choose a function to run on the array\n </mat-hint>\n </mat-form-field>\n <mat-form-field appearance=\"outline\" *ngIf=\"this.treeClass.pathInEdit?.functions\">\n <mat-label >Condition expression</mat-label>\n <textarea matInput #textarea \n [value]=\"getFunctionInEdit()?.expression\"\n (input)=\"onTextChange($event)\" (focus)=\"onFocus($event)\"\n \n placeholder=\"Enter a validation string for the function\"></textarea>\n <mat-hint>\n {{ showSuggestions ? 'Suggestions are enabled' : 'Enter a condition expression to transform the array' }}\n </mat-hint>\n </mat-form-field>\n <section *ngIf=\"showSuggestions\" \n class=\"showSuggestionContainer\">\n <!-- <mat-toolbar class=\"search-container\" style=\"background: inherit;\">\n \n \n <input type=\"search\" \n placeholder=\"Search api\" \n class=\"search-field\"\n (change)=\"onSearchChange($event)\"> \n \n <mat-icon>\n search\n </mat-icon>\n </mat-toolbar> -->\n <mat-divider></mat-divider>\n <div style=\"padding: 8px;\" class=\"\">\n <div class=\"suggestion-container\">\n <div class=\"suggestion-column\">\n <h5>Logical Operators</h5>\n <div class=\"button-container\">\n <button \n color=\"primary\" \n mat-flat-button *ngFor=\"let method of getMethods()\"\n (click)=\"selectSuggestionInput(method.value)\" class=\"suggestion-button\">\n {{ method.label | titlecase }}\n </button>\n </div>\n </div>\n <div class=\"suggestion-column\">\n <h5>Add Input as a Variable</h5>\n <div class=\"button-container\">\n <button *ngFor=\"let input of getAllInputs()\"\n mat-flat-button\n (click)=\"selectSuggestionInput(input.formControlName)\" class=\"suggestion-button\">\n {{ input.label | titlecase }}\n </button>\n </div>\n </div>\n <!-- <div class=\"suggestion-column\">\n <h5>Array path Object </h5>\n <div class=\"button-container\">\n <button *ngFor=\"let input of getValueVariables()\"\n color=\"accent\"\n mat-flat-button\n (click)=\"selectSuggestionInput(input)\" class=\"suggestion-button\">\n {{ input}}\n </button>\n </div>\n </div> -->\n </div>\n <div class=\"suggestion-container\">\n \n </div>\n \n </div>\n </section>\n \n\n <mat-toolbar style=\"background:none\">\n <span class=\"spacer\"></span>\n\n <button (click)=\"reset()\" mat-flat-button>\n reset\n </button>\n <button (click)=\"saveNodeInEdit()\" [disabled]=\"!function.expression && !function.function\" mat-flat-button\n color=\"primary\">\n save\n </button>\n\n </mat-toolbar>\n </div>\n <mat-divider></mat-divider>\n </ng-container>\n\n </mat-nav-list>\n <ol>\n\n </ol>\n <button (click)=\"addNewFunction()\" mat-button>+ Add function </button>\n </div>\n </div>\n </mat-expansion-panel>\n\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon class=\"title-icon\">dataset</mat-icon>\n Mapped Data Value Based on the Active Path\n </mat-panel-title>\n\n </mat-expansion-panel-header>\n\n <div class=\"content\">\n <mat-divider></mat-divider>\n\n <div style=\"padding: 16px;background: black;\n color: cadetblue; border-radius:8px;min-width:fit-content\">\n <pre>{{getValue|json}}</pre>\n </div>\n </div>\n </mat-expansion-panel>\n\n\n</mat-accordion>", styles: ["mat-tree{min-width:fit-content;background:azure}mat-tree-node{min-height:28px!important;height:32px!important}.breadcrumb-container{display:flex;align-items:center;flex-wrap:wrap;padding:8px 0}.breadcrumb-item{display:inline-flex;align-items:center;margin:0;transition:background-color .3s ease}.breadcrumb-separator{margin:0}.breadcrumb-separator .mat-icon{font-size:16px;width:16px;height:16px}.info-icon{width:38px}mat-expansion-panel-header{padding-left:16px;padding-right:16px}mat-expansion-panel{background:var(--mat-toolbar-container-background-color, var(--mat-app-surface))}.tree-instructions{display:flex;align-items:center;gap:8px;padding:12px;background:var(--mdc-elevated-card-container-color, var(--mat-app-surface-container-low));border-radius:4px;margin-bottom:16px}.node-spacer{width:24px;padding:0}.node-checkbox{width:100%}.node-key{font-weight:500;color:#2c2c2c}.node-value{font-family:monospace;padding:2px 6px;background:#f8f9fa;border-radius:3px;font-size:.9em}.suggestion-container{display:flex;width:100%;gap:14px}.suggestion-column{flex:1;min-width:0}.button-container{display:flex;flex-wrap:wrap}.suggestion-button{height:auto;text-transform:capitalize;margin:2px;padding:8px;line-height:normal;text-align:left;font-size:.8em}h5{margin-bottom:8px;font-size:1em}.title-icon{margin-right:8px;vertical-align:middle}mat-form-field{width:100%;background:azure}.functions{color:var(--mat-full-pseudo-checkbox-selected-icon-color)}.function-number{font-size:smaller;display:flex;align-items:center;justify-content:center;margin-right:8px;margin-left:8px}.search-field{width:100%;padding:8px;border:1px solid var(--mat-divider-color, var(--mat-app-outline));border-radius:4px;margin-left:0}.search-container{padding-left:8px;padding-right:8px;height:48px;background:inherit;margin-top:0;height:fit-content}.showSuggestionContainer{background:azure}\n"] }]
|
|
605
|
-
}], () => [], { data: [{
|
|
606
|
-
type: Input
|
|
607
|
-
}], value: [{
|
|
608
|
-
type: Input
|
|
609
|
-
}], formInputs: [{
|
|
610
|
-
type: Input
|
|
611
|
-
}], pathChanged: [{
|
|
612
|
-
type: Output
|
|
613
|
-
}], textareaElementRef: [{
|
|
614
|
-
type: ViewChild,
|
|
615
|
-
args: ['textarea', { read: ElementRef, static: false }]
|
|
616
|
-
}] }); })();
|
|
617
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DataTreeComponent, { className: "DataTreeComponent", filePath: "lib/components/t-dynamic-data-edit/elements/api-value-access-rules/elements/data-tree/data-tree.component.ts", lineNumber: 25 }); })();
|
|
618
|
-
|
|
619
|
-
const _c0 = () => [];
|
|
620
|
-
function ApiValueAccessRulesComponent_section_0_Template(rf, ctx) { if (rf & 1) {
|
|
621
|
-
const _r1 = i0.ɵɵgetCurrentView();
|
|
622
|
-
i0.ɵɵelementStart(0, "section")(1, "label", 2);
|
|
623
|
-
i0.ɵɵtext(2, "Map ");
|
|
624
|
-
i0.ɵɵelementStart(3, "strong");
|
|
625
|
-
i0.ɵɵtext(4);
|
|
626
|
-
i0.ɵɵelementEnd()();
|
|
627
|
-
i0.ɵɵelementStart(5, "app-data-tree", 3);
|
|
628
|
-
i0.ɵɵlistener("pathChanged", function ApiValueAccessRulesComponent_section_0_Template_app_data_tree_pathChanged_5_listener($event) { const controlName_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.pathChanged($event, controlName_r2)); });
|
|
629
|
-
i0.ɵɵelementEnd()();
|
|
630
|
-
} if (rf & 2) {
|
|
631
|
-
const controlName_r2 = ctx.$implicit;
|
|
632
|
-
const ctx_r2 = i0.ɵɵnextContext();
|
|
633
|
-
i0.ɵɵadvance();
|
|
634
|
-
i0.ɵɵproperty("for", controlName_r2);
|
|
635
|
-
i0.ɵɵadvance(3);
|
|
636
|
-
i0.ɵɵtextInterpolate(controlName_r2);
|
|
637
|
-
i0.ɵɵadvance();
|
|
638
|
-
i0.ɵɵproperty("formInputs", ctx_r2.formInputs)("data", ctx_r2.postmanResponseBody)("value", ctx_r2.computedValue[controlName_r2] || "");
|
|
639
|
-
} }
|
|
640
|
-
function ApiValueAccessRulesComponent_app_data_tree_1_Template(rf, ctx) { if (rf & 1) {
|
|
641
|
-
const _r4 = i0.ɵɵgetCurrentView();
|
|
642
|
-
i0.ɵɵelementStart(0, "app-data-tree", 3);
|
|
643
|
-
i0.ɵɵlistener("pathChanged", function ApiValueAccessRulesComponent_app_data_tree_1_Template_app_data_tree_pathChanged_0_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.pathChanged($event)); });
|
|
644
|
-
i0.ɵɵelementEnd();
|
|
645
|
-
} if (rf & 2) {
|
|
646
|
-
const ctx_r2 = i0.ɵɵnextContext();
|
|
647
|
-
i0.ɵɵproperty("formInputs", ctx_r2.formInputs)("data", ctx_r2.postmanResponseBody)("value", ctx_r2.computedValue);
|
|
648
|
-
} }
|
|
649
|
-
class ApiValueAccessRulesComponent {
|
|
650
|
-
static { this.nextId = 0; }
|
|
651
|
-
constructor(ngControl, _elementRef, httpClient) {
|
|
652
|
-
this.ngControl = ngControl;
|
|
653
|
-
this._elementRef = _elementRef;
|
|
654
|
-
this.httpClient = httpClient;
|
|
655
|
-
this.stateChanges = new Subject();
|
|
656
|
-
this.id = `app-api-value-access-rules-${ApiValueAccessRulesComponent.nextId++}`;
|
|
657
|
-
this.placeholder = '';
|
|
658
|
-
this.focused = false;
|
|
659
|
-
this.required = false;
|
|
660
|
-
this.disabled = false;
|
|
661
|
-
this.touched = false;
|
|
662
|
-
this.onTouched = () => { };
|
|
663
|
-
this.errors = [];
|
|
664
|
-
this.value = [];
|
|
665
|
-
this.formInputs = [];
|
|
666
|
-
this.valueChanged = new EventEmitter();
|
|
667
|
-
this.reload = new EventEmitter();
|
|
668
|
-
this.loading = false;
|
|
669
|
-
this.postManFolderItems = [];
|
|
670
|
-
}
|
|
671
|
-
get empty() {
|
|
672
|
-
return !this.value;
|
|
673
|
-
}
|
|
674
|
-
get shouldLabelFloat() {
|
|
675
|
-
return this.focused || !this.empty;
|
|
676
|
-
}
|
|
677
|
-
get errorState() {
|
|
678
|
-
const hasError = !!this.ngControl?.control?.errors || (this.errors || []).length > 0 && this.touched;
|
|
679
|
-
return !this.value && !!this.required || hasError;
|
|
680
|
-
}
|
|
681
|
-
setDescribedByIds(ids) {
|
|
682
|
-
// Ensure the component view is initialized
|
|
683
|
-
if (this._elementRef && this._elementRef.nativeElement) {
|
|
684
|
-
const controlElement = this._elementRef.nativeElement.querySelector('.app-api-value-access-rules');
|
|
685
|
-
// Check if the controlElement exists before attempting to set its attribute
|
|
686
|
-
if (controlElement) {
|
|
687
|
-
controlElement.setAttribute('aria-describedby', ids.join(' '));
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
onContainerClick(event) {
|
|
692
|
-
this.markAsTouched();
|
|
693
|
-
this.stateChanges.next();
|
|
694
|
-
}
|
|
695
|
-
markAsTouched() {
|
|
696
|
-
console.log('markAsTouched');
|
|
697
|
-
if (!this.touched) {
|
|
698
|
-
this.onTouched();
|
|
699
|
-
this.touched = true;
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
set postmanCollectionConfig(postmanCollectionConfig) {
|
|
703
|
-
if (!_.isEqual(this._postManCollectionConfig, postmanCollectionConfig)) {
|
|
704
|
-
this._postManCollectionConfig = postmanCollectionConfig;
|
|
705
|
-
this.initializePostmanService();
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
get postmanCollectionConfig() {
|
|
709
|
-
return this._postManCollectionConfig;
|
|
710
|
-
}
|
|
711
|
-
get computedValue() {
|
|
712
|
-
const invalidType = this.value instanceof Array || typeof this.value === 'string';
|
|
713
|
-
if (this.multipleBind && invalidType && !this.value) {
|
|
714
|
-
return {};
|
|
715
|
-
}
|
|
716
|
-
return this.value;
|
|
717
|
-
}
|
|
718
|
-
pathChanged(path, control) {
|
|
719
|
-
if (!Array.isArray(path)) {
|
|
720
|
-
return;
|
|
721
|
-
}
|
|
722
|
-
if (!control) {
|
|
723
|
-
this.valueChanged.emit(path);
|
|
724
|
-
return;
|
|
725
|
-
}
|
|
726
|
-
if (this.value instanceof Array || typeof this.value === 'string') {
|
|
727
|
-
this.value = {};
|
|
728
|
-
}
|
|
729
|
-
const newValue = { ...this.value };
|
|
730
|
-
newValue[control] = path;
|
|
731
|
-
this.valueChanged.emit(newValue);
|
|
732
|
-
}
|
|
733
|
-
isValidConfig(config) {
|
|
734
|
-
return Boolean(config?.collectionUrl && config?.collectionKey);
|
|
735
|
-
}
|
|
736
|
-
initializePostmanService() {
|
|
737
|
-
8;
|
|
738
|
-
const isValidConfig = this.isValidConfig(this.postmanCollectionConfig);
|
|
739
|
-
if (!isValidConfig) {
|
|
740
|
-
this.error = new HttpErrorResponse({
|
|
741
|
-
error: 'Invalid Postman Collection Config',
|
|
742
|
-
});
|
|
743
|
-
return;
|
|
744
|
-
}
|
|
745
|
-
const { collectionUrl, collectionKey } = this.postmanCollectionConfig;
|
|
746
|
-
const requestOptions = {
|
|
747
|
-
params: {
|
|
748
|
-
apikey: collectionKey,
|
|
749
|
-
clearSystemHeaders: true
|
|
750
|
-
},
|
|
751
|
-
headers: {
|
|
752
|
-
'Content-Type': 'application/json',
|
|
753
|
-
}
|
|
754
|
-
};
|
|
755
|
-
this.loading = true;
|
|
756
|
-
this.httpClient.get(collectionUrl, requestOptions).pipe(take(1), tap((data) => {
|
|
757
|
-
// To ensure the data can be shown as a tree
|
|
758
|
-
this.postManFolderItems = flatApiList(data.collection.item);
|
|
759
|
-
this.error = undefined;
|
|
760
|
-
this.loading = false;
|
|
761
|
-
}), catchError((err) => {
|
|
762
|
-
this.loading = false;
|
|
763
|
-
this.error = err;
|
|
764
|
-
console.error(err);
|
|
765
|
-
return throwError(err);
|
|
766
|
-
})).subscribe();
|
|
767
|
-
}
|
|
768
|
-
get postmanResponseBody() {
|
|
769
|
-
const { response } = this.postManFolderItems.find((item) => item.id === this.mapToData) || {};
|
|
770
|
-
let responseBody = JSON.parse(response?.[0]?.body || '{}');
|
|
771
|
-
return responseBody;
|
|
772
|
-
}
|
|
773
|
-
static { this.ɵfac = function ApiValueAccessRulesComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ApiValueAccessRulesComponent)(i0.ɵɵdirectiveInject(i1.NgControl, 10), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i1$1.HttpClient)); }; }
|
|
774
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ApiValueAccessRulesComponent, selectors: [["app-api-value-access-rules"]], hostVars: 1, hostBindings: function ApiValueAccessRulesComponent_HostBindings(rf, ctx) { if (rf & 2) {
|
|
775
|
-
i0.ɵɵhostProperty("id", ctx.id);
|
|
776
|
-
} }, inputs: { multipleBind: "multipleBind", errors: "errors", value: "value", mapToData: "mapToData", formInputs: "formInputs", postmanCollectionConfig: "postmanCollectionConfig" }, outputs: { valueChanged: "valueChanged", reload: "reload" }, features: [i0.ɵɵProvidersFeature([{ provide: MatFormFieldControl, useExisting: ApiValueAccessRulesComponent }])], decls: 2, vars: 3, consts: [[4, "ngFor", "ngForOf"], [3, "formInputs", "data", "value", "pathChanged", 4, "ngIf"], [3, "for"], [3, "pathChanged", "formInputs", "data", "value"]], template: function ApiValueAccessRulesComponent_Template(rf, ctx) { if (rf & 1) {
|
|
777
|
-
i0.ɵɵtemplate(0, ApiValueAccessRulesComponent_section_0_Template, 6, 5, "section", 0)(1, ApiValueAccessRulesComponent_app_data_tree_1_Template, 1, 3, "app-data-tree", 1);
|
|
778
|
-
} if (rf & 2) {
|
|
779
|
-
i0.ɵɵproperty("ngForOf", ctx.multipleBind || i0.ɵɵpureFunction0(2, _c0));
|
|
780
|
-
i0.ɵɵadvance();
|
|
781
|
-
i0.ɵɵproperty("ngIf", !ctx.multipleBind);
|
|
782
|
-
} }, dependencies: [CommonModule, i2.NgForOf, i2.NgIf, DataTreeComponent], styles: [".labelM[_ngcontent-%COMP%]{font-size:13px}"] }); }
|
|
783
|
-
}
|
|
784
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ApiValueAccessRulesComponent, [{
|
|
785
|
-
type: Component,
|
|
786
|
-
args: [{ selector: 'app-api-value-access-rules', standalone: true, imports: [CommonModule, DataTreeComponent], providers: [{ provide: MatFormFieldControl, useExisting: ApiValueAccessRulesComponent }], template: "\r\n\r\n\r\n<section *ngFor=\"let controlName of multipleBind||[]\">\r\n <label [for]=\"controlName\">Map <strong>{{controlName}}</strong></label>\r\n <app-data-tree \r\n [formInputs]=\"formInputs\"\r\n (pathChanged)=\"pathChanged($event,controlName)\" \r\n [data]=\"postmanResponseBody\" [value]=\"computedValue[controlName]||''\" ></app-data-tree>\r\n</section>\r\n\r\n\r\n<app-data-tree \r\n*ngIf=\"!multipleBind\"\r\n(pathChanged)=\"pathChanged($event)\" \r\n [formInputs]=\"formInputs\"\r\n[data]=\"postmanResponseBody\" [value]=\"computedValue\"></app-data-tree>\r\n\r\n", styles: [".labelM{font-size:13px}\n"] }]
|
|
787
|
-
}], () => [{ type: i1.NgControl, decorators: [{
|
|
788
|
-
type: Optional
|
|
789
|
-
}, {
|
|
790
|
-
type: Self
|
|
791
|
-
}] }, { type: i0.ElementRef }, { type: i1$1.HttpClient }], { id: [{
|
|
792
|
-
type: HostBinding
|
|
793
|
-
}], multipleBind: [{
|
|
794
|
-
type: Input
|
|
795
|
-
}], errors: [{
|
|
796
|
-
type: Input
|
|
797
|
-
}], value: [{
|
|
798
|
-
type: Input
|
|
799
|
-
}], mapToData: [{
|
|
800
|
-
type: Input
|
|
801
|
-
}], formInputs: [{
|
|
802
|
-
type: Input
|
|
803
|
-
}], valueChanged: [{
|
|
804
|
-
type: Output
|
|
805
|
-
}], reload: [{
|
|
806
|
-
type: Output
|
|
807
|
-
}], postmanCollectionConfig: [{
|
|
808
|
-
type: Input
|
|
809
|
-
}] }); })();
|
|
810
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ApiValueAccessRulesComponent, { className: "ApiValueAccessRulesComponent", filePath: "lib/components/t-dynamic-data-edit/elements/api-value-access-rules/api-value-access-rules.component.ts", lineNumber: 38 }); })();
|
|
811
|
-
|
|
812
|
-
export { ApiValueAccessRulesComponent };
|
|
813
|
-
//# sourceMappingURL=ngx-t-forms-api-value-access-rules.component-Zg1ddSDb.mjs.map
|