ngx-t-forms 0.0.1
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/README.md +27 -0
- package/fesm2022/ngx-t-forms-api-value-access-rules.component-4ZPgovTx.mjs +436 -0
- package/fesm2022/ngx-t-forms-api-value-access-rules.component-4ZPgovTx.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-tCsyuHd3.mjs +311 -0
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-tCsyuHd3.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-C8jU6DUH.mjs +208 -0
- package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-C8jU6DUH.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-convertPostmanCollectionToTree-DktdVBeQ.mjs +29 -0
- package/fesm2022/ngx-t-forms-convertPostmanCollectionToTree-DktdVBeQ.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-form-input-selector.component-6eGpxdN5.mjs +132 -0
- package/fesm2022/ngx-t-forms-form-input-selector.component-6eGpxdN5.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-form-json-view.component-DwEXL85v.mjs +22 -0
- package/fesm2022/ngx-t-forms-form-json-view.component-DwEXL85v.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-form-section-stepper.component-B5gtKLLC.mjs +220 -0
- package/fesm2022/ngx-t-forms-form-section-stepper.component-B5gtKLLC.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-Bo1CKQsC.mjs +347 -0
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-Bo1CKQsC.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-getInputIllustration-GCSKx5e5.mjs +9 -0
- package/fesm2022/ngx-t-forms-getInputIllustration-GCSKx5e5.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-input-editor.component-C1kH_GDD.mjs +126 -0
- package/fesm2022/ngx-t-forms-input-editor.component-C1kH_GDD.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-DY7Tsn5l.mjs +88 -0
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-DY7Tsn5l.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-mat-slider-editor.component-Dgd5gyUu.mjs +108 -0
- package/fesm2022/ngx-t-forms-mat-slider-editor.component-Dgd5gyUu.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-ClM2gqVq.mjs +153 -0
- package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-ClM2gqVq.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-missing-form-configs.component-DubPFwTw.mjs +32 -0
- package/fesm2022/ngx-t-forms-missing-form-configs.component-DubPFwTw.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-DtmVJG6v.mjs +230 -0
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-DtmVJG6v.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-ngx-t-forms-B-w5W1gG.mjs +9292 -0
- package/fesm2022/ngx-t-forms-ngx-t-forms-B-w5W1gG.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-pipeline-generator.component-DieETx2I.mjs +776 -0
- package/fesm2022/ngx-t-forms-pipeline-generator.component-DieETx2I.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-required-inputs.component-Bi1wJdw3.mjs +188 -0
- package/fesm2022/ngx-t-forms-required-inputs.component-Bi1wJdw3.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-Cd59pfG7.mjs +292 -0
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-Cd59pfG7.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-section-report.component-CBXHr1qQ.mjs +156 -0
- package/fesm2022/ngx-t-forms-section-report.component-CBXHr1qQ.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-selection-options-editor.component-DBlBUGkw.mjs +143 -0
- package/fesm2022/ngx-t-forms-selection-options-editor.component-DBlBUGkw.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-validators-config.component-gtr6Ohn3.mjs +216 -0
- package/fesm2022/ngx-t-forms-validators-config.component-gtr6Ohn3.mjs.map +1 -0
- package/fesm2022/ngx-t-forms.mjs +2 -0
- package/fesm2022/ngx-t-forms.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/dialog-template/dialog-template.component.d.ts +10 -0
- package/lib/components/form-builder/elements/default-element/default-element.component.d.ts +12 -0
- package/lib/components/form-builder/elements/form-json-view/form-json-view.component.d.ts +9 -0
- package/lib/components/form-builder/elements/form-section-stepper/form-section-stepper.component.d.ts +146 -0
- package/lib/components/form-builder/elements/form-submissions-config/config.d.ts +18 -0
- package/lib/components/form-builder/elements/form-submissions-config/form-submissions-config.component.d.ts +61 -0
- package/lib/components/form-builder/elements/forms-builder-menu/forms-builder-menu.component.d.ts +35 -0
- package/lib/components/form-builder/elements/input-editor/input-editor.component.d.ts +18 -0
- package/lib/components/form-builder/elements/input-element-editor/input-element-editor.component.d.ts +42 -0
- package/lib/components/form-builder/elements/missing-form-configs/missing-form-configs.component.d.ts +12 -0
- package/lib/components/form-builder/elements/section-report/section-report.component.d.ts +23 -0
- package/lib/components/form-builder/elements/select-form-template/select-form-template.component.d.ts +17 -0
- package/lib/components/form-builder/form-builder.component.d.ts +29 -0
- package/lib/components/forms/forms.component.d.ts +44 -0
- package/lib/components/forms/functions/cloneCopyFormInput.d.ts +3 -0
- package/lib/components/forms/functions/elementBlur.d.ts +2 -0
- package/lib/components/forms/functions/elementConfigurationChanged.d.ts +2 -0
- package/lib/components/forms/functions/findFormInput.d.ts +2 -0
- package/lib/components/forms/functions/formHttpSubmissions.d.ts +6 -0
- package/lib/components/forms/functions/selectInputTemplate.d.ts +3 -0
- package/lib/components/forms/store/Form-actions-formBuilder.d.ts +34 -0
- package/lib/components/forms/store/Form-selectors-FormBuilder.d.ts +42 -0
- package/lib/components/forms/store/Forms-Actions.d.ts +75 -0
- package/lib/components/forms/store/Forms-Effects.d.ts +14 -0
- package/lib/components/forms/store/Forms-selectors.d.ts +24 -0
- package/lib/components/forms/store/forms-store.service.d.ts +246 -0
- package/lib/components/index.d.ts +11 -0
- package/lib/components/t-dynamic-data-edit/elements/api-value-access-rules/api-value-access-rules.component.d.ts +59 -0
- package/lib/components/t-dynamic-data-edit/elements/api-value-access-rules/elements/data-tree/data-tree.component.d.ts +60 -0
- package/lib/components/t-dynamic-data-edit/elements/api-value-access-rules/functions/convertDataToTree.d.ts +57 -0
- package/lib/components/t-dynamic-data-edit/elements/api-value-access-rules/functions/extractNodeFromTree.d.ts +3 -0
- package/lib/components/t-dynamic-data-edit/elements/calculated-field-rules/calculated-field-rules.component.d.ts +92 -0
- package/lib/components/t-dynamic-data-edit/elements/config-mscoa-additional-inputs/config-mscoa-additional-inputs.component.d.ts +73 -0
- package/lib/components/t-dynamic-data-edit/elements/form-input-selector/form-input-selector.component.d.ts +48 -0
- package/lib/components/t-dynamic-data-edit/elements/json-editor/json-editor.component.d.ts +26 -0
- package/lib/components/t-dynamic-data-edit/elements/mat-chip-list-editor/mat-chip-list-editor.component.d.ts +43 -0
- package/lib/components/t-dynamic-data-edit/elements/mat-slider-editor/mat-slider-editor.component.d.ts +44 -0
- package/lib/components/t-dynamic-data-edit/elements/mat-slider-toggle-editor/mat-slider-toggle-editor.component.d.ts +48 -0
- package/lib/components/t-dynamic-data-edit/elements/mscoa-segment-config/mscoa-segment-config.component.d.ts +75 -0
- package/lib/components/t-dynamic-data-edit/elements/pipeline-generator/elements/aggregate-stage-editor/aggregate-stage-editor.component.d.ts +33 -0
- package/lib/components/t-dynamic-data-edit/elements/pipeline-generator/pipeline-generator.component.d.ts +92 -0
- package/lib/components/t-dynamic-data-edit/elements/postman-collections/functions/convertPostmanCollectionToTree.d.ts +4 -0
- package/lib/components/t-dynamic-data-edit/elements/postman-collections/functions/filterCollectionItems.d.ts +3 -0
- package/lib/components/t-dynamic-data-edit/elements/postman-collections/functions/methodColors.d.ts +1 -0
- package/lib/components/t-dynamic-data-edit/elements/postman-collections/postman-collections.component.d.ts +28 -0
- package/lib/components/t-dynamic-data-edit/elements/required-inputs/required-inputs.component.d.ts +57 -0
- package/lib/components/t-dynamic-data-edit/elements/rest-api-call-setup/rest-api-call-setup.component.d.ts +46 -0
- package/lib/components/t-dynamic-data-edit/elements/selection-options-editor/selection-options-editor.component.d.ts +48 -0
- package/lib/components/t-dynamic-data-edit/elements/t-workflow-picker/t-workflow-picker.component.d.ts +19 -0
- package/lib/components/t-dynamic-data-edit/elements/validators-config/validators-config.component.d.ts +60 -0
- package/lib/components/t-dynamic-data-edit/functions/testData.d.ts +2 -0
- package/lib/components/t-dynamic-data-edit/t-dynamic-data-edit.component.d.ts +48 -0
- package/lib/components/t-dynamic-data-view/t-dynamic-data-view.component.d.ts +14 -0
- package/lib/components/t-form-input/elements/Geo-location-form-input/elements/geo-location-form-input/geo-location-form-input.component.d.ts +18 -0
- package/lib/components/t-form-input/elements/Geo-location-form-input/functions/getGeoLocation.d.ts +2 -0
- package/lib/components/t-form-input/elements/Geo-location-form-input/geo-location.component.d.ts +16 -0
- package/lib/components/t-form-input/elements/auto-complete-input-element/auto-complete-input-element.component.d.ts +14 -0
- package/lib/components/t-form-input/elements/basic-input-input-element/basic-input-input-element.component.d.ts +17 -0
- package/lib/components/t-form-input/elements/basic-input-input-element/core/input-custom/input-custom.component.d.ts +17 -0
- package/lib/components/t-form-input/elements/date-picker-input-element/date-picker-input-element.component.d.ts +14 -0
- package/lib/components/t-form-input/elements/date-range-picker-input-element/date-range-picker-input-element.component.d.ts +14 -0
- package/lib/components/t-form-input/elements/editor-input-element/core/editor-js-input/editor-js-input.component.d.ts +18 -0
- package/lib/components/t-form-input/elements/editor-input-element/core/form-input-rich-text-editor/config.d.ts +9 -0
- package/lib/components/t-form-input/elements/editor-input-element/core/form-input-rich-text-editor/form-input-rich-text-editor.component.d.ts +14 -0
- package/lib/components/t-form-input/elements/editor-input-element/core/form-input-rich-text-editor/sync-editor/sync-editor.component.d.ts +10 -0
- package/lib/components/t-form-input/elements/editor-input-element/editor-input-element.component.d.ts +14 -0
- package/lib/components/t-form-input/elements/file-upload-input-element/core/file-uploader/camera-functions.d.ts +3 -0
- package/lib/components/t-form-input/elements/file-upload-input-element/core/file-uploader/file-uploader.component.d.ts +30 -0
- package/lib/components/t-form-input/elements/file-upload-input-element/file-upload-input-element.component.d.ts +14 -0
- package/lib/components/t-form-input/elements/image-capture-input-element/core/camera-capture/camera-capture.component.d.ts +28 -0
- package/lib/components/t-form-input/elements/image-capture-input-element/image-capture-input-element.component.d.ts +13 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/account-value/account-value.component.d.ts +37 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/mscoa-chart.component.d.ts +93 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-computation/mscoa-computation.component.d.ts +62 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-reactive-form-field/mscoa-reactive-form-field.component.d.ts +21 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/scoa-account-table/scoa-account-table.component.d.ts +83 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/scoa-input/scoa-input.component.d.ts +27 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/mscoa-form-input.component.d.ts +16 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/store/accountConstants.d.ts +5 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-actions.d.ts +19 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-component-store.service.d.ts +61 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-effects.d.ts +8 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-selectors.d.ts +32 -0
- package/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-table/multiple-input-table.component.d.ts +37 -0
- package/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-table-edit/multiple-input-table-edit.component.d.ts +52 -0
- package/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-table-view/multiple-input-table-view.component.d.ts +39 -0
- package/lib/components/t-form-input/elements/multiple-input-input-element/functions/getListCalculated.d.ts +2 -0
- package/lib/components/t-form-input/elements/multiple-input-input-element/multiple-input-input-element.component.d.ts +16 -0
- package/lib/components/t-form-input/elements/section-title/section-title.component.d.ts +7 -0
- package/lib/components/t-form-input/elements/select-input-element/select-input-element.component.d.ts +23 -0
- package/lib/components/t-form-input/elements/select-table-input/elements/input-table/input-table.component.d.ts +29 -0
- package/lib/components/t-form-input/elements/select-table-input/select-table-input.component.d.ts +13 -0
- package/lib/components/t-form-input/elements/signature-input-element/config/signature.d.ts +2 -0
- package/lib/components/t-form-input/elements/signature-input-element/core/signature-pad-input/signature-pad-input.component.d.ts +40 -0
- package/lib/components/t-form-input/elements/signature-input-element/signature-input-element.component.d.ts +13 -0
- package/lib/components/t-form-input/elements/textarea-input-element/textarea-input-element.component.d.ts +13 -0
- package/lib/components/t-form-input/elements/toggle-input-element/core/toggle/toggle.component.d.ts +15 -0
- package/lib/components/t-form-input/elements/toggle-input-element/toggle-input-element.component.d.ts +13 -0
- package/lib/components/t-form-input/t-form-input.component.d.ts +24 -0
- package/lib/components/t-form-input-status/t-form-input-status.component.d.ts +10 -0
- package/lib/components/user-form-stepper/user-form-stepper.component.d.ts +23 -0
- package/lib/injection-tokens/index.d.ts +14 -0
- package/lib/ngx-t-forms.component.d.ts +5 -0
- package/lib/ngx-t-forms.service.d.ts +6 -0
- package/lib/services/core/t-form-builder/functions/addFormInputToForm.d.ts +8 -0
- package/lib/services/core/t-form-builder/functions/addMultipleInputFunction.d.ts +2 -0
- package/lib/services/core/t-form-builder/functions/addNewSection.d.ts +2 -0
- package/lib/services/core/t-form-builder/functions/deleteSection.d.ts +2 -0
- package/lib/services/core/t-form-builder/functions/formCanSave.d.ts +3 -0
- package/lib/services/core/t-form-builder/functions/inputElementEditorConfigs.d.ts +91 -0
- package/lib/services/core/t-form-builder/functions/moveFormInput.d.ts +4 -0
- package/lib/services/core/t-form-builder/functions/moveInputToDiffSection.d.ts +2 -0
- package/lib/services/core/t-form-builder/functions/multipleInputToggleLabel.d.ts +2 -0
- package/lib/services/core/t-form-builder/functions/removeItem.d.ts +7 -0
- package/lib/services/core/t-form-builder/functions/sectionDrop.d.ts +3 -0
- package/lib/services/core/t-form-builder/functions/stepTitleChangeStep.d.ts +14 -0
- package/lib/services/core/t-form-controller/function/calculateInputValue.d.ts +11 -0
- package/lib/services/core/t-form-controller/function/getApiDataFetching.d.ts +4 -0
- package/lib/services/core/t-form-controller/function/postApiDataFetching.d.ts +16 -0
- package/lib/services/core/t-form-controller/function/validateMinInputForPostRequest.d.ts +8 -0
- package/lib/services/core/t-form-environment-injection/functions/provideNgxTforms.d.ts +3 -0
- package/lib/services/core/t-form-section-controller/Functions/commonFormOperations.d.ts +21 -0
- package/lib/services/core/t-form-section-controller/Functions/errorResolver.d.ts +7 -0
- package/lib/services/core/t-form-section-controller/Functions/formGenerator.d.ts +29 -0
- package/lib/services/core/t-form-section-controller/Functions/getValueFromPathMap.d.ts +6 -0
- package/lib/services/core/t-form-tower-controller/form-tower-controller.service.d.ts +99 -0
- package/lib/services/core/t-form-tower-controller/functions/allFormInputs.d.ts +3 -0
- package/lib/services/core/t-form-tower-controller/functions/createEmptyForm.d.ts +2 -0
- package/lib/services/core/t-form-tower-controller/functions/extractInitFunctions.d.ts +8 -0
- package/lib/services/core/t-form-tower-controller/functions/getAllFunctionTypes.d.ts +12 -0
- package/lib/services/core/t-form-tower-controller/functions/getFormValue.d.ts +3 -0
- package/lib/services/core/t-form-tower-controller/functions/getSubmissionStatus.d.ts +7 -0
- package/lib/services/core/t-form-tower-controller/functions/handleStepChange.d.ts +3 -0
- package/lib/services/core/t-form-tower-controller/functions/multipleInputRowIDControllInput.d.ts +2 -0
- package/lib/services/core/t-form-tower-controller/functions/prePoPulateForm.d.ts +85 -0
- package/lib/services/core/t-form-tower-controller/functions/saveMultipleInputForm.d.ts +10 -0
- package/lib/services/core/t-form-tower-controller/functions/selectFormSteps.d.ts +4 -0
- package/lib/services/core/t-form-tower-controller/functions/setControlTempErrors.d.ts +3 -0
- package/lib/services/core/t-form-tower-controller/functions/setInputAsTouchedAndDirty.d.ts +2 -0
- package/lib/services/core/t-form-tower-controller/functions/setInputError.d.ts +5 -0
- package/lib/services/core/t-form-tower-controller/functions/setInputStatus.d.ts +3 -0
- package/lib/services/core/t-form-tower-controller/functions/setSectionAsSeen.d.ts +3 -0
- package/lib/services/core/t-form-tower-controller/functions/startTowerFormChangesEventListener.d.ts +10 -0
- package/lib/services/core/t-form-tower-controller/functions/toggleMultipleInput.d.ts +5 -0
- package/lib/services/core/t-form-tower-controller/functions/updateChangeHistory.d.ts +2 -0
- package/lib/services/core/t-form-tower-controller/functions/updateFormInputConfig.d.ts +6 -0
- package/lib/services/core/t-form-tower-controller/functions/updateValue.d.ts +2 -0
- package/lib/services/core/t-input-controller/functions/baseCustomInput.d.ts +104 -0
- package/lib/services/core/t-input-controller/functions/colorCoding.d.ts +24 -0
- package/lib/services/core/t-input-controller/functions/configureCols.d.ts +5 -0
- package/lib/services/core/t-input-controller/functions/generateInputSecret.d.ts +2 -0
- package/lib/services/core/t-input-controller/functions/inputErrorMessage.d.ts +3 -0
- package/lib/services/hhtpResources/Pipeline/pipeline.service.d.ts +80 -0
- package/lib/services/index.d.ts +5 -0
- package/lib/shared/functions/assignDeepPropertyToObject.d.ts +1 -0
- package/lib/shared/functions/camelize.d.ts +6 -0
- package/lib/shared/functions/daysAgoTransform.d.ts +1 -0
- package/lib/shared/functions/enryption.d.ts +9 -0
- package/lib/shared/functions/evaluateArrayAccessRules.d.ts +14 -0
- package/lib/shared/functions/getAvatar.d.ts +1 -0
- package/lib/shared/functions/getDeepObject.d.ts +138 -0
- package/lib/shared/functions/getInputIllustration.d.ts +2 -0
- package/lib/shared/functions/isEqual.d.ts +12 -0
- package/lib/shared/functions/migrationCheck.d.ts +3 -0
- package/lib/shared/functions/replaceUrlVariables.d.ts +2 -0
- package/lib/shared/functions/searchArray.d.ts +1 -0
- package/lib/shared/functions/textIconsForUserHints.d.ts +20 -0
- package/lib/shared/index.d.ts +6 -0
- package/lib/shared/modules/mat-modules.module.d.ts +50 -0
- package/lib/shared/pipes/date/days-ago.pipe.d.ts +7 -0
- package/package.json +67 -0
- package/public-api.d.ts +6 -0
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# NgxTForms
|
|
2
|
+
atar
|
|
3
|
+
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.2.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
ng generate s tets --project ngx-t-forms
|
|
8
|
+
|
|
9
|
+
Run `ng generate component component-name --project ngx-t-forms` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-t-forms`.
|
|
10
|
+
> Note: Don't forget to add `--project ngx-t-forms` or else it will be added to the default project in your `angular.json` file.
|
|
11
|
+
|
|
12
|
+
## Build
|
|
13
|
+
|
|
14
|
+
Run `ng build ngx-t-forms` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
15
|
+
`ng build ngx-t-forms --configuration production`
|
|
16
|
+
|
|
17
|
+
## Publishing
|
|
18
|
+
|
|
19
|
+
After building your library with `ng build ngx-t-forms`, go to the dist folder `cd dist/ngx-t-forms` and run `npm publish`.
|
|
20
|
+
|
|
21
|
+
## Running unit tests
|
|
22
|
+
|
|
23
|
+
Run `ng test ngx-t-forms` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
24
|
+
|
|
25
|
+
## Further help
|
|
26
|
+
|
|
27
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, ElementRef, ViewChild, Output, Input, Component, HostBinding, Optional, Self } 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-B-w5W1gG.mjs';
|
|
8
|
+
import * as i2$1 from '@angular/material/core';
|
|
9
|
+
import * as i3 from '@angular/material/button';
|
|
10
|
+
import * as i3$1 from '@angular/material/checkbox';
|
|
11
|
+
import * as i5 from '@angular/material/divider';
|
|
12
|
+
import * as i3$2 from '@angular/material/expansion';
|
|
13
|
+
import * as i5$1 from '@angular/material/icon';
|
|
14
|
+
import * as i6 from '@angular/material/list';
|
|
15
|
+
import * as i4 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 i5$2 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
|
+
;
|
|
39
|
+
class DataTreeComponent {
|
|
40
|
+
constructor() {
|
|
41
|
+
this.value = [];
|
|
42
|
+
this.formInputs = [];
|
|
43
|
+
this.pathChanged = new EventEmitter();
|
|
44
|
+
this._value = [];
|
|
45
|
+
this.showSuggestions = false;
|
|
46
|
+
this.suggestions = ['$option1', '$option2', '$option3', '$custom'];
|
|
47
|
+
this.filteredSuggestions = [];
|
|
48
|
+
this.cursorPosition = 0;
|
|
49
|
+
this.methods = [
|
|
50
|
+
// Logical Operators
|
|
51
|
+
{
|
|
52
|
+
label: 'logical AND (&&)',
|
|
53
|
+
value: '&&'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: 'logical OR (||)',
|
|
57
|
+
value: '||'
|
|
58
|
+
},
|
|
59
|
+
// Comparison Operators
|
|
60
|
+
{
|
|
61
|
+
label: 'strict equality (===)',
|
|
62
|
+
value: '==='
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: 'loose equality (==)',
|
|
66
|
+
value: '=='
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: 'strict inequality (!==)',
|
|
70
|
+
value: '!=='
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: 'loose inequality (!=)',
|
|
74
|
+
value: '!='
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: 'greater than (>)',
|
|
78
|
+
value: '>'
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
label: 'less than (<)',
|
|
82
|
+
value: '<'
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
label: 'greater than or equal to (>=)',
|
|
86
|
+
value: '>='
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
label: 'less than or equal to (<=)',
|
|
90
|
+
value: '<='
|
|
91
|
+
}
|
|
92
|
+
];
|
|
93
|
+
this.showValue = false;
|
|
94
|
+
this.treeClass = new TreeComponent();
|
|
95
|
+
}
|
|
96
|
+
ngOnChanges(changes) {
|
|
97
|
+
if (changes['data']) {
|
|
98
|
+
if (JSON.stringify(this._data) !== JSON.stringify(changes['data'].currentValue)) {
|
|
99
|
+
this._data = changes['data'].currentValue;
|
|
100
|
+
this.treeClass.computeTreeData(changes['data'].currentValue);
|
|
101
|
+
if (this.value && Array.isArray(this.value) && this.value.length > 0 && 'functions' in (this.value?.[0] || {})) {
|
|
102
|
+
this.treeClass.updateStateFromPath(this.value);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (changes['value']) {
|
|
107
|
+
this.valueChangedSetPath(changes['value'].currentValue);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
ngOnInit() {
|
|
111
|
+
}
|
|
112
|
+
valueChangedSetPath(newPath) {
|
|
113
|
+
const isSameAsNewPath = typeof newPath === typeof this._value && JSON.stringify(newPath) === JSON.stringify(this._value);
|
|
114
|
+
if (!isSameAsNewPath && Array.isArray(newPath)) {
|
|
115
|
+
this._value = newPath;
|
|
116
|
+
this.treeClass.updateStateFromPath(newPath);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
async onTextChange(event) {
|
|
120
|
+
const newValue = event.target.value;
|
|
121
|
+
const functions = this.treeClass.pathInEdit.functions.find(f => f.inEdit);
|
|
122
|
+
functions.expression = newValue;
|
|
123
|
+
this.treeClass.pathInEdit.functions.map(f => {
|
|
124
|
+
if (f.inEdit) {
|
|
125
|
+
return functions;
|
|
126
|
+
}
|
|
127
|
+
return f;
|
|
128
|
+
});
|
|
129
|
+
const textarea = this.textareaElementRef.nativeElement;
|
|
130
|
+
this.cursorPosition = textarea.selectionStart || 0;
|
|
131
|
+
const lastChar = newValue[this.cursorPosition - 1];
|
|
132
|
+
if (lastChar === '$') {
|
|
133
|
+
this.showSuggestions = true;
|
|
134
|
+
this.filteredSuggestions = this.suggestions;
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
this.showSuggestions = false;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
functionChanged(event) {
|
|
141
|
+
this.treeClass.functionChanged(event.value);
|
|
142
|
+
}
|
|
143
|
+
addNewFunction() {
|
|
144
|
+
this.treeClass.addNewFunction();
|
|
145
|
+
}
|
|
146
|
+
editFunction(id) {
|
|
147
|
+
this.treeClass.pathInEdit.functions = this.treeClass.pathInEdit.functions?.map(f => {
|
|
148
|
+
if (f.id === id) {
|
|
149
|
+
return { ...f, inEdit: true };
|
|
150
|
+
}
|
|
151
|
+
return { ...f, inEdit: false };
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
selectSuggestionInput(suggestion) {
|
|
155
|
+
const functions = this.treeClass.pathInEdit.functions.find(f => f.inEdit) || {};
|
|
156
|
+
const value = functions?.expression || '';
|
|
157
|
+
const beforeCursor = value.slice(0, this.cursorPosition - 1);
|
|
158
|
+
const afterCursor = value.slice(this.cursorPosition);
|
|
159
|
+
functions.expression = beforeCursor + suggestion + ' ' + afterCursor;
|
|
160
|
+
this.treeClass.pathInEdit.functions.map(f => {
|
|
161
|
+
if (f.inEdit) {
|
|
162
|
+
return functions;
|
|
163
|
+
}
|
|
164
|
+
return f;
|
|
165
|
+
});
|
|
166
|
+
this.showSuggestions = false;
|
|
167
|
+
const textarea = this.textareaElementRef.nativeElement;
|
|
168
|
+
textarea.focus();
|
|
169
|
+
const newCursorPosition = this.cursorPosition + suggestion.length;
|
|
170
|
+
setTimeout(() => {
|
|
171
|
+
textarea.setSelectionRange(newCursorPosition, newCursorPosition);
|
|
172
|
+
}, 0);
|
|
173
|
+
}
|
|
174
|
+
onFocus(event) {
|
|
175
|
+
const textarea = this.textareaElementRef.nativeElement;
|
|
176
|
+
this.cursorPosition = textarea.selectionStart || 0;
|
|
177
|
+
}
|
|
178
|
+
nodeIsChecked(node) {
|
|
179
|
+
return this.treeClass.nodeIsChecked(node);
|
|
180
|
+
}
|
|
181
|
+
hasANodeInEdit() {
|
|
182
|
+
return this.treeClass.hasANodeInEdit();
|
|
183
|
+
}
|
|
184
|
+
showNode(node) {
|
|
185
|
+
return this.treeClass.showNode(node);
|
|
186
|
+
}
|
|
187
|
+
onSearchChange(event) {
|
|
188
|
+
this.optionsSearch = event.target.value;
|
|
189
|
+
}
|
|
190
|
+
getMethods() {
|
|
191
|
+
return searchAndOrderArray(this.methods, this.optionsSearch, 'label');
|
|
192
|
+
}
|
|
193
|
+
getNodeValueColor(v) {
|
|
194
|
+
const valueType = typeof v;
|
|
195
|
+
switch (valueType) {
|
|
196
|
+
case 'string':
|
|
197
|
+
return '#c56100';
|
|
198
|
+
case 'number':
|
|
199
|
+
return 'mediumblue';
|
|
200
|
+
case 'boolean':
|
|
201
|
+
return 'forestgreen';
|
|
202
|
+
case 'object':
|
|
203
|
+
return '#005959';
|
|
204
|
+
default:
|
|
205
|
+
return 'currentcolor';
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
setupPath(node) {
|
|
209
|
+
return this.treeClass.setupPath(node);
|
|
210
|
+
}
|
|
211
|
+
trackByFn(index, node) {
|
|
212
|
+
return node.path.join('.');
|
|
213
|
+
}
|
|
214
|
+
getAllInputs() {
|
|
215
|
+
const inputs = this.formInputs
|
|
216
|
+
.filter((inp) => !inp.multipleInputInEditId);
|
|
217
|
+
return searchAndOrderArray(inputs || [], this.optionsSearch, 'label');
|
|
218
|
+
}
|
|
219
|
+
getValueVariables() {
|
|
220
|
+
const isObject = typeof this.value === 'object';
|
|
221
|
+
if (!this.value) {
|
|
222
|
+
return [];
|
|
223
|
+
}
|
|
224
|
+
if (!isObject && !!this.value) {
|
|
225
|
+
return [this.value];
|
|
226
|
+
}
|
|
227
|
+
if (Array.isArray(this.value)) {
|
|
228
|
+
return this.value.map((v, i) => (i));
|
|
229
|
+
}
|
|
230
|
+
return Object.keys(this.value);
|
|
231
|
+
}
|
|
232
|
+
saveNodeInEdit() {
|
|
233
|
+
const newP = this.treeClass.saveNodeInEdit();
|
|
234
|
+
if (newP) {
|
|
235
|
+
this.pathChanged.emit(newP);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
closeEdit() {
|
|
239
|
+
this.treeClass.closeEdit();
|
|
240
|
+
}
|
|
241
|
+
reset() {
|
|
242
|
+
this.treeClass.resetNode();
|
|
243
|
+
}
|
|
244
|
+
getFunctionInEdit() {
|
|
245
|
+
const node = this.treeClass.pathInEdit;
|
|
246
|
+
return node?.functions?.find(f => f.inEdit);
|
|
247
|
+
}
|
|
248
|
+
get getValue() {
|
|
249
|
+
return this.treeClass.getValue();
|
|
250
|
+
}
|
|
251
|
+
removeFunction(id) {
|
|
252
|
+
this.treeClass.removeFunction(id);
|
|
253
|
+
}
|
|
254
|
+
update(node) {
|
|
255
|
+
const path = this.treeClass.selectNode(node)?.map(p => ({
|
|
256
|
+
...p,
|
|
257
|
+
children: undefined,
|
|
258
|
+
value: undefined
|
|
259
|
+
}));
|
|
260
|
+
this.pathChanged.emit(path);
|
|
261
|
+
}
|
|
262
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DataTreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
263
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: DataTreeComponent, isStandalone: true, selector: "app-data-tree", inputs: { data: "data", value: "value", formInputs: "formInputs" }, outputs: { pathChanged: "pathChanged" }, viewQueries: [{ propertyName: "textareaElementRef", first: true, predicate: ["textarea"], descendants: true, read: ElementRef }], usesOnChanges: true, ngImport: i0, 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"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.JsonPipe, name: "json" }, { kind: "pipe", type: i2.TitleCasePipe, name: "titlecase" }, { kind: "ngmodule", type: MatModulesModule }, { kind: "component", type: i2$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: i3$2.MatAccordion, selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i3$2.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i3$2.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i3$2.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i6.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i6.MatListItemIcon, selector: "[matListItemIcon]" }, { kind: "directive", type: i6.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "directive", type: i6.MatListItemMeta, selector: "[matListItemMeta]" }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i9.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: i3$3.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i3$3.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { kind: "directive", type: i3$3.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i3$3.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i3$3.MatTreeNode, selector: "mat-tree-node", inputs: ["tabIndex", "disabled"], outputs: ["activation", "expandedChange"], exportAs: ["matTreeNode"] }, { kind: "directive", type: i5$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }] }); }
|
|
264
|
+
}
|
|
265
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DataTreeComponent, decorators: [{
|
|
266
|
+
type: Component,
|
|
267
|
+
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"] }]
|
|
268
|
+
}], ctorParameters: () => [], propDecorators: { data: [{
|
|
269
|
+
type: Input
|
|
270
|
+
}], value: [{
|
|
271
|
+
type: Input
|
|
272
|
+
}], formInputs: [{
|
|
273
|
+
type: Input
|
|
274
|
+
}], pathChanged: [{
|
|
275
|
+
type: Output
|
|
276
|
+
}], textareaElementRef: [{
|
|
277
|
+
type: ViewChild,
|
|
278
|
+
args: ['textarea', { read: ElementRef, static: false }]
|
|
279
|
+
}] } });
|
|
280
|
+
|
|
281
|
+
class ApiValueAccessRulesComponent {
|
|
282
|
+
static { this.nextId = 0; }
|
|
283
|
+
constructor(ngControl, _elementRef, httpClient) {
|
|
284
|
+
this.ngControl = ngControl;
|
|
285
|
+
this._elementRef = _elementRef;
|
|
286
|
+
this.httpClient = httpClient;
|
|
287
|
+
this.stateChanges = new Subject();
|
|
288
|
+
this.id = `app-api-value-access-rules-${ApiValueAccessRulesComponent.nextId++}`;
|
|
289
|
+
this.placeholder = '';
|
|
290
|
+
this.focused = false;
|
|
291
|
+
this.required = false;
|
|
292
|
+
this.disabled = false;
|
|
293
|
+
this.touched = false;
|
|
294
|
+
this.onTouched = () => { };
|
|
295
|
+
this.errors = [];
|
|
296
|
+
this.value = [];
|
|
297
|
+
this.formInputs = [];
|
|
298
|
+
this.valueChanged = new EventEmitter();
|
|
299
|
+
this.reload = new EventEmitter();
|
|
300
|
+
this.loading = false;
|
|
301
|
+
this.postManFolderItems = [];
|
|
302
|
+
}
|
|
303
|
+
get empty() {
|
|
304
|
+
return !this.value;
|
|
305
|
+
}
|
|
306
|
+
get shouldLabelFloat() {
|
|
307
|
+
return this.focused || !this.empty;
|
|
308
|
+
}
|
|
309
|
+
get errorState() {
|
|
310
|
+
const hasError = !!this.ngControl?.control?.errors || (this.errors || []).length > 0 && this.touched;
|
|
311
|
+
return !this.value && !!this.required || hasError;
|
|
312
|
+
}
|
|
313
|
+
setDescribedByIds(ids) {
|
|
314
|
+
// Ensure the component view is initialized
|
|
315
|
+
if (this._elementRef && this._elementRef.nativeElement) {
|
|
316
|
+
const controlElement = this._elementRef.nativeElement.querySelector('.app-api-value-access-rules');
|
|
317
|
+
// Check if the controlElement exists before attempting to set its attribute
|
|
318
|
+
if (controlElement) {
|
|
319
|
+
controlElement.setAttribute('aria-describedby', ids.join(' '));
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
onContainerClick(event) {
|
|
324
|
+
this.markAsTouched();
|
|
325
|
+
this.stateChanges.next();
|
|
326
|
+
}
|
|
327
|
+
markAsTouched() {
|
|
328
|
+
console.log('markAsTouched');
|
|
329
|
+
if (!this.touched) {
|
|
330
|
+
this.onTouched();
|
|
331
|
+
this.touched = true;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
set postmanCollectionConfig(postmanCollectionConfig) {
|
|
335
|
+
if (!_.isEqual(this._postManCollectionConfig, postmanCollectionConfig)) {
|
|
336
|
+
this._postManCollectionConfig = postmanCollectionConfig;
|
|
337
|
+
this.initializePostmanService();
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
get postmanCollectionConfig() {
|
|
341
|
+
return this._postManCollectionConfig;
|
|
342
|
+
}
|
|
343
|
+
get computedValue() {
|
|
344
|
+
const invalidType = this.value instanceof Array || typeof this.value === 'string';
|
|
345
|
+
if (this.multipleBind && invalidType && !this.value) {
|
|
346
|
+
return {};
|
|
347
|
+
}
|
|
348
|
+
return this.value;
|
|
349
|
+
}
|
|
350
|
+
pathChanged(path, control) {
|
|
351
|
+
if (!Array.isArray(path)) {
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
if (!control) {
|
|
355
|
+
this.valueChanged.emit(path);
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
if (this.value instanceof Array || typeof this.value === 'string') {
|
|
359
|
+
this.value = {};
|
|
360
|
+
}
|
|
361
|
+
const newValue = { ...this.value };
|
|
362
|
+
newValue[control] = path;
|
|
363
|
+
this.valueChanged.emit(newValue);
|
|
364
|
+
}
|
|
365
|
+
isValidConfig(config) {
|
|
366
|
+
return Boolean(config?.collectionUrl && config?.collectionKey);
|
|
367
|
+
}
|
|
368
|
+
initializePostmanService() {
|
|
369
|
+
8;
|
|
370
|
+
const isValidConfig = this.isValidConfig(this.postmanCollectionConfig);
|
|
371
|
+
if (!isValidConfig) {
|
|
372
|
+
this.error = new HttpErrorResponse({
|
|
373
|
+
error: 'Invalid Postman Collection Config',
|
|
374
|
+
});
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
const { collectionUrl, collectionKey } = this.postmanCollectionConfig;
|
|
378
|
+
const requestOptions = {
|
|
379
|
+
params: {
|
|
380
|
+
apikey: collectionKey,
|
|
381
|
+
clearSystemHeaders: true
|
|
382
|
+
},
|
|
383
|
+
headers: {
|
|
384
|
+
'Content-Type': 'application/json',
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
this.loading = true;
|
|
388
|
+
this.httpClient.get(collectionUrl, requestOptions).pipe(take(1), tap((data) => {
|
|
389
|
+
// To ensure the data can be shown as a tree
|
|
390
|
+
this.postManFolderItems = flatApiList(data.collection.item);
|
|
391
|
+
this.error = undefined;
|
|
392
|
+
this.loading = false;
|
|
393
|
+
}), catchError((err) => {
|
|
394
|
+
this.loading = false;
|
|
395
|
+
this.error = err;
|
|
396
|
+
console.error(err);
|
|
397
|
+
return throwError(err);
|
|
398
|
+
})).subscribe();
|
|
399
|
+
}
|
|
400
|
+
get postmanResponseBody() {
|
|
401
|
+
const { response } = this.postManFolderItems.find((item) => item.id === this.mapToData) || {};
|
|
402
|
+
let responseBody = JSON.parse(response?.[0]?.body || '{}');
|
|
403
|
+
return responseBody;
|
|
404
|
+
}
|
|
405
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ApiValueAccessRulesComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
406
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: ApiValueAccessRulesComponent, isStandalone: true, selector: "app-api-value-access-rules", inputs: { multipleBind: "multipleBind", errors: "errors", value: "value", mapToData: "mapToData", formInputs: "formInputs", postmanCollectionConfig: "postmanCollectionConfig" }, outputs: { valueChanged: "valueChanged", reload: "reload" }, host: { properties: { "id": "this.id" } }, providers: [{ provide: MatFormFieldControl, useExisting: ApiValueAccessRulesComponent }], ngImport: i0, 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"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: DataTreeComponent, selector: "app-data-tree", inputs: ["data", "value", "formInputs"], outputs: ["pathChanged"] }] }); }
|
|
407
|
+
}
|
|
408
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ApiValueAccessRulesComponent, decorators: [{
|
|
409
|
+
type: Component,
|
|
410
|
+
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"] }]
|
|
411
|
+
}], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
|
|
412
|
+
type: Optional
|
|
413
|
+
}, {
|
|
414
|
+
type: Self
|
|
415
|
+
}] }, { type: i0.ElementRef }, { type: i1$1.HttpClient }], propDecorators: { id: [{
|
|
416
|
+
type: HostBinding
|
|
417
|
+
}], multipleBind: [{
|
|
418
|
+
type: Input
|
|
419
|
+
}], errors: [{
|
|
420
|
+
type: Input
|
|
421
|
+
}], value: [{
|
|
422
|
+
type: Input
|
|
423
|
+
}], mapToData: [{
|
|
424
|
+
type: Input
|
|
425
|
+
}], formInputs: [{
|
|
426
|
+
type: Input
|
|
427
|
+
}], valueChanged: [{
|
|
428
|
+
type: Output
|
|
429
|
+
}], reload: [{
|
|
430
|
+
type: Output
|
|
431
|
+
}], postmanCollectionConfig: [{
|
|
432
|
+
type: Input
|
|
433
|
+
}] } });
|
|
434
|
+
|
|
435
|
+
export { ApiValueAccessRulesComponent };
|
|
436
|
+
//# sourceMappingURL=ngx-t-forms-api-value-access-rules.component-4ZPgovTx.mjs.map
|