ngx-t-forms 2.0.37 → 3.1.0
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-auto-complete-input-element.component-D_l5sbNh.mjs → ngx-t-forms-auto-complete-input-element.component-FhUHTsUF.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-D_l5sbNh.mjs.map → ngx-t-forms-auto-complete-input-element.component-FhUHTsUF.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-fJIsRm0v.mjs → ngx-t-forms-basic-input-input-element.component-BJKe9wIA.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-fJIsRm0v.mjs.map → ngx-t-forms-basic-input-input-element.component-BJKe9wIA.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-FQLTI7CX.mjs +643 -0
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-FQLTI7CX.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-L1kPy15K.mjs → ngx-t-forms-chip-options-creator-editor.component-CJtbprXS.mjs} +4 -4
- package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-CJtbprXS.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CU6Cp-oK.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-CU6R5h-x.mjs} +4 -4
- package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-CU6R5h-x.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-data-source-picker.component-C8MBbnfz.mjs +261 -0
- package/fesm2022/ngx-t-forms-data-source-picker.component-C8MBbnfz.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-DsjcLQ5A.mjs → ngx-t-forms-date-picker-input-element.component-Dux6uy66.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-DsjcLQ5A.mjs.map → ngx-t-forms-date-picker-input-element.component-Dux6uy66.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-SMWrTm5X.mjs +157 -0
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-SMWrTm5X.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-uGM93dvc.mjs +373 -0
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-uGM93dvc.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-document-picker.component-DIqaaBSl.mjs +1259 -0
- package/fesm2022/ngx-t-forms-document-picker.component-DIqaaBSl.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-editor-input-element.component-CIELjDty.mjs +417 -0
- package/fesm2022/ngx-t-forms-editor-input-element.component-CIELjDty.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-editor-js-input.component-C1dI_7rU.mjs +553 -0
- package/fesm2022/ngx-t-forms-editor-js-input.component-C1dI_7rU.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-_RBYRgn9.mjs → ngx-t-forms-file-upload-input-element.component-CQsKz87N.mjs} +7 -7
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-_RBYRgn9.mjs.map → ngx-t-forms-file-upload-input-element.component-CQsKz87N.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-form-input-selector.component-Dj0jvBdm.mjs +86 -0
- package/fesm2022/ngx-t-forms-form-input-selector.component-Dj0jvBdm.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-form-json-view.component-D9rU9vxT.mjs → ngx-t-forms-form-json-view.component-DzJKFl4c.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-json-view.component-D9rU9vxT.mjs.map → ngx-t-forms-form-json-view.component-DzJKFl4c.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-form-payload-projection.component-y9PSIeP1.mjs +179 -0
- package/fesm2022/ngx-t-forms-form-payload-projection.component-y9PSIeP1.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-CqCL3Bnc.mjs → ngx-t-forms-form-section-stepper.component-DOvVtJGB.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-CqCL3Bnc.mjs.map → ngx-t-forms-form-section-stepper.component-DOvVtJGB.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-wmRDJU4P.mjs → ngx-t-forms-forms-builder-menu.component-CcqyQLf5.mjs} +12 -12
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-wmRDJU4P.mjs.map → ngx-t-forms-forms-builder-menu.component-CcqyQLf5.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-geo-location.component-CMbBSXe0.mjs → ngx-t-forms-geo-location.component-Bj_qIEqi.mjs} +7 -7
- package/fesm2022/{ngx-t-forms-geo-location.component-CMbBSXe0.mjs.map → ngx-t-forms-geo-location.component-Bj_qIEqi.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-header-template-editor.component-DLldVmcN.mjs +129 -0
- package/fesm2022/ngx-t-forms-header-template-editor.component-DLldVmcN.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-Cbq8OYk7.mjs → ngx-t-forms-image-capture-input-element.component-lwp3IcDt.mjs} +7 -7
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-Cbq8OYk7.mjs.map → ngx-t-forms-image-capture-input-element.component-lwp3IcDt.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-index-CPNvE4PP.mjs → ngx-t-forms-index-C8NtLE16.mjs} +2 -2
- package/fesm2022/ngx-t-forms-index-C8NtLE16.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-input-custom.component-uNVdF9aA.mjs → ngx-t-forms-input-custom.component-DiciFhSS.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-input-custom.component-uNVdF9aA.mjs.map → ngx-t-forms-input-custom.component-DiciFhSS.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-input-editor.component-D12hrHOc.mjs +190 -0
- package/fesm2022/ngx-t-forms-input-editor.component-D12hrHOc.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-D0SGS9xQ.mjs → ngx-t-forms-map-mat-options-keys-C2JpMTEc.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-D0SGS9xQ.mjs.map → ngx-t-forms-map-mat-options-keys-C2JpMTEc.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-C1Qrze7K.mjs +167 -0
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-C1Qrze7K.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-mat-slider-editor.component-CTSBrM-j.mjs → ngx-t-forms-mat-slider-editor.component-4buvmLkX.mjs} +3 -3
- package/fesm2022/ngx-t-forms-mat-slider-editor.component-4buvmLkX.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-mat-slider-toggle-editor.component-CcYiwx-8.mjs → ngx-t-forms-mat-slider-toggle-editor.component-DX8L0O1k.mjs} +3 -3
- package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-DX8L0O1k.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-CxF6Ljjf.mjs → ngx-t-forms-missing-form-configs.component-BaTR_jzc.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-CxF6Ljjf.mjs.map → ngx-t-forms-missing-form-configs.component-BaTR_jzc.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-BqT5Z8SM.mjs → ngx-t-forms-mscoa-chart-toolbar.component-Dni_bv_G.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-BqT5Z8SM.mjs.map → ngx-t-forms-mscoa-chart-toolbar.component-Dni_bv_G.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-error-display.component-99DpVSy7.mjs → ngx-t-forms-mscoa-error-display.component-BDPi6w2E.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-mscoa-error-display.component-99DpVSy7.mjs.map → ngx-t-forms-mscoa-error-display.component-BDPi6w2E.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-BPQuzR5k.mjs +447 -0
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-BPQuzR5k.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-mscoa-temporary-hint.component-B1Z-IXSL.mjs → ngx-t-forms-mscoa-temporary-hint.component-g7DosiVb.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-mscoa-temporary-hint.component-B1Z-IXSL.mjs.map → ngx-t-forms-mscoa-temporary-hint.component-g7DosiVb.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-hXWMRFjl.mjs +905 -0
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-hXWMRFjl.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-ngx-t-forms-DQ_h-jPF.mjs → ngx-t-forms-ngx-t-forms-tQEbZK_e.mjs} +2188 -249
- package/fesm2022/ngx-t-forms-ngx-t-forms-tQEbZK_e.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-paginated-selection-table-DHwojPhn.mjs → ngx-t-forms-paginated-selection-table-pYY2sWAb.mjs} +8 -8
- package/fesm2022/{ngx-t-forms-paginated-selection-table-DHwojPhn.mjs.map → ngx-t-forms-paginated-selection-table-pYY2sWAb.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-payload-template-editor.component-DGCUsTYx.mjs +79 -0
- package/fesm2022/ngx-t-forms-payload-template-editor.component-DGCUsTYx.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-pipeline-generator.component-D2stBXXC.mjs +748 -0
- package/fesm2022/ngx-t-forms-pipeline-generator.component-D2stBXXC.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-record-list-manager.component-CtCOIpai.mjs +446 -0
- package/fesm2022/ngx-t-forms-record-list-manager.component-CtCOIpai.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-required-inputs.component-D9wIdOhg.mjs +272 -0
- package/fesm2022/ngx-t-forms-required-inputs.component-D9wIdOhg.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-D3sa7sNg.mjs → ngx-t-forms-rest-api-call-setup.component-Gy7Rtmue.mjs} +39 -8
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-Gy7Rtmue.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-search-field.component-mR4Kk12C.mjs +38 -0
- package/fesm2022/ngx-t-forms-search-field.component-mR4Kk12C.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-section-report.component-D6jakGa5.mjs → ngx-t-forms-section-report.component-U9uQ_Ow9.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-section-report.component-D6jakGa5.mjs.map → ngx-t-forms-section-report.component-U9uQ_Ow9.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-select-input-element.component-CwqIck0h.mjs → ngx-t-forms-select-input-element.component-CxYTmuvV.mjs} +8 -8
- package/fesm2022/{ngx-t-forms-select-input-element.component-CwqIck0h.mjs.map → ngx-t-forms-select-input-element.component-CxYTmuvV.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-selection-options-editor.component-BLLejOLG.mjs +169 -0
- package/fesm2022/ngx-t-forms-selection-options-editor.component-BLLejOLG.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-t-workflow-picker.component-D0ttyEex.mjs +263 -0
- package/fesm2022/ngx-t-forms-t-workflow-picker.component-D0ttyEex.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-D4dEi8Vs.mjs → ngx-t-forms-textarea-input-element.component-75VdPc6z.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-D4dEi8Vs.mjs.map → ngx-t-forms-textarea-input-element.component-75VdPc6z.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-BZiTFB0j.mjs → ngx-t-forms-toggle-input-element.component-DQGvEJN-.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-BZiTFB0j.mjs.map → ngx-t-forms-toggle-input-element.component-DQGvEJN-.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-token-transform-D_wsFbNc.mjs +173 -0
- package/fesm2022/ngx-t-forms-token-transform-D_wsFbNc.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-validators-config.component-EM7RSWIz.mjs +574 -0
- package/fesm2022/ngx-t-forms-validators-config.component-EM7RSWIz.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-workflow-adjudication.component-DD6Fhx06.mjs → ngx-t-forms-workflow-adjudication.component-C1Em-g9e.mjs} +17 -17
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-C1Em-g9e.mjs.map +1 -0
- package/fesm2022/ngx-t-forms.mjs +1 -1
- package/package.json +2 -2
- package/styles/_editor-mixins.scss +117 -117
- package/styles/_signature-pad.scss +26 -26
- package/styles/_tokens.scss +148 -148
- package/types/ngx-t-forms.d.ts +14 -2
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-B8Do3h4B.mjs +0 -643
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-B8Do3h4B.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-L1kPy15K.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-CU6Cp-oK.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-data-source-picker.component-r7OGAsxo.mjs +0 -261
- package/fesm2022/ngx-t-forms-data-source-picker.component-r7OGAsxo.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-B8V7IpoK.mjs +0 -156
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-B8V7IpoK.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-hKJqVYUY.mjs +0 -373
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-hKJqVYUY.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-document-picker.component-f-hz6Vef.mjs +0 -704
- package/fesm2022/ngx-t-forms-document-picker.component-f-hz6Vef.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-editor-input-element.component-D38U94oj.mjs +0 -294
- package/fesm2022/ngx-t-forms-editor-input-element.component-D38U94oj.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-editor-js-input.component-D_Jq7sfY.mjs +0 -240
- package/fesm2022/ngx-t-forms-editor-js-input.component-D_Jq7sfY.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-form-input-selector.component-CUwK3DqG.mjs +0 -86
- package/fesm2022/ngx-t-forms-form-input-selector.component-CUwK3DqG.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-form-payload-projection.component-D46W1-4z.mjs +0 -179
- package/fesm2022/ngx-t-forms-form-payload-projection.component-D46W1-4z.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-index-CPNvE4PP.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-input-editor.component-BWoKhlI3.mjs +0 -190
- package/fesm2022/ngx-t-forms-input-editor.component-BWoKhlI3.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-Cu-KiAeY.mjs +0 -66
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-Cu-KiAeY.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mat-slider-editor.component-CTSBrM-j.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-CcYiwx-8.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-BT-dM_5C.mjs +0 -447
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-BT-dM_5C.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-DXAh2Mbm.mjs +0 -905
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-DXAh2Mbm.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-DQ_h-jPF.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-payload-template-editor.component-CAXdFu4E.mjs +0 -203
- package/fesm2022/ngx-t-forms-payload-template-editor.component-CAXdFu4E.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-pipeline-generator.component-BJQ-KnmU.mjs +0 -748
- package/fesm2022/ngx-t-forms-pipeline-generator.component-BJQ-KnmU.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-record-list-manager.component-BoD3S_7u.mjs +0 -358
- package/fesm2022/ngx-t-forms-record-list-manager.component-BoD3S_7u.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-required-inputs.component-C-E3fQu6.mjs +0 -272
- package/fesm2022/ngx-t-forms-required-inputs.component-C-E3fQu6.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-D3sa7sNg.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-search-field.component-B2ZO7lqO.mjs +0 -38
- package/fesm2022/ngx-t-forms-search-field.component-B2ZO7lqO.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-selection-options-editor.component-Coj9gnrq.mjs +0 -169
- package/fesm2022/ngx-t-forms-selection-options-editor.component-Coj9gnrq.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-t-workflow-picker.component-DqFMP1rZ.mjs +0 -204
- package/fesm2022/ngx-t-forms-t-workflow-picker.component-DqFMP1rZ.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-validators-config.component-B3K9nLxx.mjs +0 -574
- package/fesm2022/ngx-t-forms-validators-config.component-B3K9nLxx.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-DD6Fhx06.mjs.map +0 -1
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, linkedSignal, signal, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/material/button';
|
|
4
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
5
|
+
import * as i2$1 from '@angular/material/form-field';
|
|
6
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
7
|
+
import * as i3 from '@angular/material/icon';
|
|
8
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
9
|
+
import * as i2$2 from '@angular/material/input';
|
|
10
|
+
import { MatInputModule } from '@angular/material/input';
|
|
11
|
+
import * as i6 from '@angular/material/list';
|
|
12
|
+
import { MatListModule } from '@angular/material/list';
|
|
13
|
+
import * as i7 from '@angular/material/core';
|
|
14
|
+
import { MatRippleModule } from '@angular/material/core';
|
|
15
|
+
import * as i8 from '@angular/material/select';
|
|
16
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
17
|
+
import * as i1 from '@angular/forms';
|
|
18
|
+
import { FormsModule } from '@angular/forms';
|
|
19
|
+
import { MinInputTypes, ElementTypes, InputDataTypes } from 'ngx-t-forms-types';
|
|
20
|
+
import { g as getInputIcon } from './ngx-t-forms-getInputIcon-B4ADgevZ.mjs';
|
|
21
|
+
import { E as EmptyStateComponent } from './ngx-t-forms-ngx-t-forms-tQEbZK_e.mjs';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Internal editor element for configuring a form's required (minimum) inputs.
|
|
25
|
+
* Child of `t-dynamic-data-edit`, which supplies the field label, hint, and
|
|
26
|
+
* validation errors — so this component owns only the chip row + edit content.
|
|
27
|
+
*
|
|
28
|
+
* Each required input can be handled three ways: a literal default value, a
|
|
29
|
+
* single-input map (`MapTo`), or a multi-input filter (`MapDocFilter`).
|
|
30
|
+
* Re-selecting the active handling method, chip, or a mapped input toggles it
|
|
31
|
+
* off again.
|
|
32
|
+
*/
|
|
33
|
+
class RequiredInputsComponent {
|
|
34
|
+
constructor() {
|
|
35
|
+
/** Handling-method enum, exposed to the template. */
|
|
36
|
+
this.minInputTypes = MinInputTypes;
|
|
37
|
+
/**
|
|
38
|
+
* Required-input descriptors to render. Heterogeneous wrapper binding — the
|
|
39
|
+
* parent feeds whatever the editor config holds; narrowing here would force
|
|
40
|
+
* wrapper changes.
|
|
41
|
+
*/
|
|
42
|
+
this.value = input([], ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
43
|
+
/** All available form inputs the user can map a required input to. */
|
|
44
|
+
this.formInputs = input([], ...(ngDevMode ? [{ debugName: "formInputs" }] : /* istanbul ignore next */ []));
|
|
45
|
+
/** Disable user interaction. */
|
|
46
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
47
|
+
/**
|
|
48
|
+
* Validation errors passed down by the parent editor. Retained on the contract
|
|
49
|
+
* but not rendered here — `t-dynamic-data-edit` owns error display.
|
|
50
|
+
*/
|
|
51
|
+
this.errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
52
|
+
/** Optional id attribute supplied by the parent editor (used to disambiguate). */
|
|
53
|
+
this.id = input(undefined, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
54
|
+
/** Emits the mutated required-input list whenever the user changes a mapping. */
|
|
55
|
+
this.valueChanged = output();
|
|
56
|
+
/**
|
|
57
|
+
* Local, immutable working copy of `value`. Tracks the bound value (the parent
|
|
58
|
+
* re-feeds it after each emit) but stays locally overridable; mutations always
|
|
59
|
+
* produce a new array, and entries are cloned so the parent's array is never
|
|
60
|
+
* mutated in place.
|
|
61
|
+
*/
|
|
62
|
+
this.#workingValue = linkedSignal(() => this.value().map((item) => ({ ...item })), ...(ngDevMode ? [{ debugName: "#workingValue" }] : /* istanbul ignore next */ []));
|
|
63
|
+
/** Name of the required input currently open in the edit panel; `''` when none. */
|
|
64
|
+
this.activeInput = signal('', ...(ngDevMode ? [{ debugName: "activeInput" }] : /* istanbul ignore next */ []));
|
|
65
|
+
/** The chip row: one entry per required input, with derived link/active state. */
|
|
66
|
+
this.chips = computed(() => {
|
|
67
|
+
const active = this.activeInput();
|
|
68
|
+
return this.#workingValue().map((item) => ({
|
|
69
|
+
name: item.name,
|
|
70
|
+
linked: this.#isLinked(item),
|
|
71
|
+
active: item.name === active,
|
|
72
|
+
}));
|
|
73
|
+
}, ...(ngDevMode ? [{ debugName: "chips" }] : /* istanbul ignore next */ []));
|
|
74
|
+
/** The required input currently being edited, or `undefined` when none is active. */
|
|
75
|
+
this.inEdit = computed(() => {
|
|
76
|
+
const active = this.activeInput();
|
|
77
|
+
if (!active) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
return this.#workingValue().find((item) => item.name === active);
|
|
81
|
+
}, ...(ngDevMode ? [{ debugName: "inEdit" }] : /* istanbul ignore next */ []));
|
|
82
|
+
/** Handling method of the input in edit; `null` keeps the `mat-select` empty. */
|
|
83
|
+
this.activeType = computed(() => {
|
|
84
|
+
const type = this.inEdit()?.type;
|
|
85
|
+
return type === MinInputTypes.Default ||
|
|
86
|
+
type === MinInputTypes.MapTo ||
|
|
87
|
+
type === MinInputTypes.MapDocFilter
|
|
88
|
+
? type
|
|
89
|
+
: null;
|
|
90
|
+
}, ...(ngDevMode ? [{ debugName: "activeType" }] : /* istanbul ignore next */ []));
|
|
91
|
+
/** Whether the edit panel should show the mappable-input list. */
|
|
92
|
+
this.showMapList = computed(() => {
|
|
93
|
+
const type = this.activeType();
|
|
94
|
+
return type === MinInputTypes.MapTo || type === MinInputTypes.MapDocFilter;
|
|
95
|
+
}, ...(ngDevMode ? [{ debugName: "showMapList" }] : /* istanbul ignore next */ []));
|
|
96
|
+
/**
|
|
97
|
+
* The list of mappable form inputs for the input in edit. Single-select
|
|
98
|
+
* (`MapTo`) collapses to the chosen input once one is picked; multi-select
|
|
99
|
+
* (`MapDocFilter`) always shows the full list with each chosen input flagged.
|
|
100
|
+
*/
|
|
101
|
+
this.mapTargets = computed(() => {
|
|
102
|
+
const edit = this.inEdit();
|
|
103
|
+
if (!edit) {
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
106
|
+
const all = this.formInputs().map((item) => this.#toTarget(item, edit));
|
|
107
|
+
if (edit.type === MinInputTypes.MapTo) {
|
|
108
|
+
const selected = all.find((target) => target.selected);
|
|
109
|
+
return selected ? [selected] : all;
|
|
110
|
+
}
|
|
111
|
+
return all;
|
|
112
|
+
}, ...(ngDevMode ? [{ debugName: "mapTargets" }] : /* istanbul ignore next */ []));
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Local, immutable working copy of `value`. Tracks the bound value (the parent
|
|
116
|
+
* re-feeds it after each emit) but stays locally overridable; mutations always
|
|
117
|
+
* produce a new array, and entries are cloned so the parent's array is never
|
|
118
|
+
* mutated in place.
|
|
119
|
+
*/
|
|
120
|
+
#workingValue;
|
|
121
|
+
/** Toggle the edit panel for a required input. Re-selecting the active one closes it. */
|
|
122
|
+
toggleActive(name) {
|
|
123
|
+
if (this.disabled()) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
this.activeInput.update((current) => (current === name ? '' : name));
|
|
127
|
+
}
|
|
128
|
+
/** Close the edit panel without changing anything. */
|
|
129
|
+
close() {
|
|
130
|
+
this.activeInput.set('');
|
|
131
|
+
}
|
|
132
|
+
/** Choose (or, when re-selected, clear) the handling method for the input in edit. */
|
|
133
|
+
selectType(type) {
|
|
134
|
+
this.#patchActive((current) => {
|
|
135
|
+
if (current.type === type) {
|
|
136
|
+
return { ...current, type: undefined, mapTo: undefined, defaultValue: undefined };
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
...current,
|
|
140
|
+
type,
|
|
141
|
+
mapTo: type === MinInputTypes.MapDocFilter ? [] : undefined,
|
|
142
|
+
defaultValue: type === MinInputTypes.Default ? current.defaultValue : undefined,
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/** Update the literal default value of the input in edit. */
|
|
147
|
+
setDefaultValue(value) {
|
|
148
|
+
this.#patchActive((current) => ({ ...current, defaultValue: value }));
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Map (or, when re-selected, unmap) a form input to the input in edit. `MapTo`
|
|
152
|
+
* holds a single mapping; `MapDocFilter` accumulates a list.
|
|
153
|
+
*/
|
|
154
|
+
toggleMap(target) {
|
|
155
|
+
if (this.disabled() || !target.mappable) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const mapping = this.#toMapping(target);
|
|
159
|
+
this.#patchActive((current) => {
|
|
160
|
+
if (current.type === MinInputTypes.MapTo) {
|
|
161
|
+
const existing = this.#asSingle(current.mapTo);
|
|
162
|
+
const sameSelected = existing?.formControlName === mapping.formControlName;
|
|
163
|
+
return { ...current, mapTo: sameSelected ? undefined : mapping };
|
|
164
|
+
}
|
|
165
|
+
if (current.type === MinInputTypes.MapDocFilter) {
|
|
166
|
+
const list = this.#asList(current.mapTo);
|
|
167
|
+
const has = list.some((m) => m.formControlName === mapping.formControlName);
|
|
168
|
+
return {
|
|
169
|
+
...current,
|
|
170
|
+
mapTo: has
|
|
171
|
+
? list.filter((m) => m.formControlName !== mapping.formControlName)
|
|
172
|
+
: [...list, mapping],
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
return current;
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/** Replace the active entry via `patch` and emit the new list. */
|
|
179
|
+
#patchActive(patch) {
|
|
180
|
+
const active = this.activeInput();
|
|
181
|
+
let changed = false;
|
|
182
|
+
const next = this.#workingValue().map((item) => {
|
|
183
|
+
if (item.name !== active) {
|
|
184
|
+
return item;
|
|
185
|
+
}
|
|
186
|
+
changed = true;
|
|
187
|
+
return patch(item);
|
|
188
|
+
});
|
|
189
|
+
if (!changed) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
this.#workingValue.set(next);
|
|
193
|
+
this.valueChanged.emit([...next]);
|
|
194
|
+
}
|
|
195
|
+
#isLinked(item) {
|
|
196
|
+
if (item.type === MinInputTypes.Default) {
|
|
197
|
+
return !!item.defaultValue;
|
|
198
|
+
}
|
|
199
|
+
if (item.type === MinInputTypes.MapTo) {
|
|
200
|
+
return !!this.#asSingle(item.mapTo);
|
|
201
|
+
}
|
|
202
|
+
if (item.type === MinInputTypes.MapDocFilter) {
|
|
203
|
+
return this.#asList(item.mapTo).length > 0;
|
|
204
|
+
}
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
#toTarget(item, edit) {
|
|
208
|
+
const mappable = item.element !== ElementTypes.SectionTitle;
|
|
209
|
+
const selected = this.#isMapped(edit, item.formControlName);
|
|
210
|
+
return {
|
|
211
|
+
id: item.id,
|
|
212
|
+
label: item.label,
|
|
213
|
+
icon: getInputIcon(item.element),
|
|
214
|
+
formControlName: item.formControlName,
|
|
215
|
+
dataType: item.dataType ?? '',
|
|
216
|
+
selected,
|
|
217
|
+
mappable,
|
|
218
|
+
ariaLabel: `${item.label}.${mappable ? '' : ' Not mappable.'}`,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
#isMapped(edit, formControlName) {
|
|
222
|
+
if (edit.type === MinInputTypes.MapTo) {
|
|
223
|
+
return this.#asSingle(edit.mapTo)?.formControlName === formControlName;
|
|
224
|
+
}
|
|
225
|
+
if (edit.type === MinInputTypes.MapDocFilter) {
|
|
226
|
+
return this.#asList(edit.mapTo).some((m) => m.formControlName === formControlName);
|
|
227
|
+
}
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
#toMapping(target) {
|
|
231
|
+
const source = this.formInputs().find((item) => item.id === target.id);
|
|
232
|
+
return {
|
|
233
|
+
formControlName: target.formControlName,
|
|
234
|
+
dataType: source?.dataType ?? InputDataTypes.String,
|
|
235
|
+
element: source?.element ?? ElementTypes.Input,
|
|
236
|
+
inputId: target.id,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
#asSingle(mapTo) {
|
|
240
|
+
if (!mapTo || Array.isArray(mapTo)) {
|
|
241
|
+
return undefined;
|
|
242
|
+
}
|
|
243
|
+
// `Array.isArray` does not narrow a `readonly[]` out of the union, so assert
|
|
244
|
+
// the remaining single-mapping shape after the guard.
|
|
245
|
+
return mapTo;
|
|
246
|
+
}
|
|
247
|
+
#asList(mapTo) {
|
|
248
|
+
return Array.isArray(mapTo) ? mapTo : [];
|
|
249
|
+
}
|
|
250
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: RequiredInputsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
251
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: RequiredInputsComponent, isStandalone: true, selector: "lib-required-inputs", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, formInputs: { classPropertyName: "formInputs", publicName: "formInputs", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChanged: "valueChanged" }, host: { properties: { "attr.id": "id()" }, classAttribute: "lib-required-inputs" }, ngImport: i0, template: "@if (chips().length) {\r\n<div class=\"lib-required-inputs__chips\" role=\"list\" aria-label=\"Required inputs\">\r\n @for (chip of chips(); track chip.name) {\r\n <button\r\n type=\"button\"\r\n role=\"listitem\"\r\n class=\"lib-required-inputs__chip\"\r\n [class.lib-required-inputs__chip--linked]=\"chip.linked\"\r\n [class.lib-required-inputs__chip--active]=\"chip.active\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-pressed]=\"chip.active\"\r\n [attr.aria-label]=\"chip.name + (chip.linked ? ', linked' : ', not linked')\"\r\n (click)=\"toggleActive(chip.name)\">\r\n <span class=\"lib-required-inputs__chip-label\">{{ chip.name }}</span>\r\n <mat-icon class=\"lib-required-inputs__chip-icon\" aria-hidden=\"true\">\r\n {{ chip.linked ? 'link' : 'link_off' }}\r\n </mat-icon>\r\n </button>\r\n }\r\n</div>\r\n} @else {\r\n<lib-empty-state icon=\"link_off\" message=\"No required inputs to configure.\" />\r\n}\r\n\r\n@if (inEdit(); as edit) {\r\n<div class=\"lib-required-inputs__panel\">\r\n <mat-form-field\r\n class=\"lib-required-inputs__field\"\r\n appearance=\"outline\"\r\n subscriptSizing=\"dynamic\">\r\n <mat-label>Input handling method</mat-label>\r\n <mat-select\r\n [value]=\"activeType()\"\r\n [disabled]=\"disabled()\"\r\n (selectionChange)=\"selectType($event.value)\">\r\n <mat-option [value]=\"minInputTypes.Default\">Default value</mat-option>\r\n <mat-option [value]=\"minInputTypes.MapTo\">Map to a form input</mat-option>\r\n <mat-option [value]=\"minInputTypes.MapDocFilter\">Filter by an input value</mat-option>\r\n </mat-select>\r\n <mat-hint>Choose how this required input is resolved</mat-hint>\r\n </mat-form-field>\r\n\r\n @if (activeType() === minInputTypes.Default) {\r\n <mat-form-field\r\n class=\"lib-required-inputs__field\"\r\n appearance=\"outline\"\r\n subscriptSizing=\"dynamic\">\r\n <mat-label>Default value</mat-label>\r\n <input\r\n matInput\r\n [ngModel]=\"edit.defaultValue\"\r\n [disabled]=\"disabled()\"\r\n (ngModelChange)=\"setDefaultValue($event)\"\r\n placeholder=\"Enter a default value\" />\r\n <mat-hint>Used when no value is supplied at runtime</mat-hint>\r\n </mat-form-field>\r\n }\r\n\r\n @if (showMapList()) {\r\n <p class=\"lib-required-inputs__list-label\">\r\n Link <strong>{{ activeInput() }}</strong> to a form input\r\n </p>\r\n\r\n @if (mapTargets().length) {\r\n <mat-nav-list class=\"lib-required-inputs__list\">\r\n {{mapTargets().length}}\r\n @for (target of mapTargets(); track target.id) {\r\n <mat-list-item\r\n class=\"lib-required-inputs__item\"\r\n matRipple\r\n role=\"button\"\r\n [disabled]=\"disabled() || !target.mappable\"\r\n [activated]=\"target.selected\"\r\n [attr.aria-pressed]=\"target.selected\"\r\n [attr.aria-label]=\"target.ariaLabel\"\r\n (click)=\"toggleMap(target); $event.stopPropagation()\">\r\n <mat-icon\r\n matListItemAvatar\r\n class=\"lib-required-inputs__avatar\"\r\n aria-hidden=\"true\">\r\n {{ target.icon }}\r\n </mat-icon>\r\n <span matListItemTitle class=\"lib-required-inputs__item-title\">{{ target.label }}</span>\r\n <span matListItemLine class=\"lib-required-inputs__item-meta\">\r\n <span>{{ target.formControlName }}</span>\r\n @if (target.dataType) {\r\n <span>{{ target.dataType }}</span>\r\n }\r\n </span>\r\n <mat-icon\r\n matListItemMeta\r\n class=\"lib-required-inputs__indicator\"\r\n [class.lib-required-inputs__indicator--on]=\"target.selected\"\r\n aria-hidden=\"true\">\r\n {{ target.selected ? 'check_circle' : 'radio_button_unchecked' }}\r\n </mat-icon>\r\n </mat-list-item>\r\n }\r\n </mat-nav-list>\r\n } @else {\r\n <lib-empty-state icon=\"add_link\" message=\"Add form inputs before mapping this input.\" />\r\n }\r\n }\r\n\r\n <div class=\"lib-required-inputs__actions\">\r\n <button type=\"button\" mat-flat-button color=\"primary\" (click)=\"close()\">Done</button>\r\n </div>\r\n</div>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;gap:1.5rem;color:var(--lib-forms-on-surface)}.lib-required-inputs__chips{display:flex;flex-wrap:wrap;gap:.5rem}.lib-required-inputs__chip{display:inline-flex;align-items:center;gap:.5rem;padding:.25rem .5rem .25rem .625rem;background:color-mix(in srgb,var(--lib-forms-primary) 10%,transparent);border-radius:var(--lib-forms-radius-pill, 6px);font-size:.8125rem;color:var(--lib-forms-on-surface);cursor:pointer;border:1px solid color-mix(in srgb,var(--lib-forms-outline) 30%,transparent);background:var(--lib-forms-surface);transition:background-color var(--lib-forms-duration-hover) var(--lib-forms-easing),border-color var(--lib-forms-duration-hover) var(--lib-forms-easing)}.lib-required-inputs__chip:hover:not(:disabled){border-color:var(--lib-forms-primary)}.lib-required-inputs__chip:focus-visible{outline:none;border-color:var(--lib-forms-primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--lib-forms-primary) 25%,transparent)}.lib-required-inputs__chip:disabled{opacity:.55;pointer-events:none}.lib-required-inputs__chip--linked{background:color-mix(in srgb,var(--lib-forms-primary) 14%,transparent);border-color:color-mix(in srgb,var(--lib-forms-primary) 30%,transparent)}.lib-required-inputs__chip--active{border-color:var(--lib-forms-primary);background:color-mix(in srgb,var(--lib-forms-primary) 22%,transparent)}.lib-required-inputs__chip-icon{width:1rem;height:1rem;font-size:1rem;color:var(--lib-forms-on-surface-variant)}.lib-required-inputs__chip--linked .lib-required-inputs__chip-icon,.lib-required-inputs__chip--active .lib-required-inputs__chip-icon{color:var(--lib-forms-primary)}.lib-required-inputs__panel{display:flex;flex-direction:column;gap:1.5rem}.lib-required-inputs__field{width:100%}.lib-required-inputs__list-label{margin:0;font-size:.625rem;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--lib-forms-on-surface-variant)}.lib-required-inputs__list-label strong{color:var(--lib-forms-primary)}.lib-required-inputs__list{width:100%;box-sizing:border-box;max-height:65vh;overflow:auto;padding:.5rem;background:var(--lib-forms-surface);border:1px solid color-mix(in srgb,var(--lib-forms-outline) 12%,transparent);border-radius:var(--lib-forms-radius-lg, 12px)}.lib-required-inputs__item{min-height:3rem;height:fit-content;margin-bottom:.25rem;border-radius:var(--lib-forms-radius-sm, 8px);cursor:pointer;transition:background-color var(--lib-forms-duration-hover) var(--lib-forms-easing)}.lib-required-inputs__item:last-child{margin-bottom:0}.lib-required-inputs__item:hover{background:color-mix(in srgb,var(--lib-forms-primary) 6%,transparent)}.lib-required-inputs__item:focus-visible{outline:none;border-color:var(--lib-forms-primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--lib-forms-primary) 25%,transparent)}.lib-required-inputs__item.mdc-list-item--activated{background:color-mix(in srgb,var(--lib-forms-primary) 12%,transparent)}mat-icon.lib-required-inputs__avatar{display:inline-flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;border-radius:var(--lib-forms-radius-sm, 8px);font-size:1.5rem;line-height:1;background:var(--lib-forms-surface-container-high);color:var(--lib-forms-on-surface-variant)}.lib-required-inputs__item-title{font-size:.9375rem;font-weight:600}.lib-required-inputs__item-meta{display:flex;flex-wrap:wrap;gap:.5rem;font-size:.75rem;color:var(--lib-forms-on-surface-variant)}.lib-required-inputs__indicator{color:var(--lib-forms-on-surface-variant)}.lib-required-inputs__indicator--on{color:var(--lib-forms-primary)}.lib-required-inputs__actions{display:flex;justify-content:flex-end;gap:.75rem}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$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: MatListModule }, { 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.MatListItemAvatar, selector: "[matListItemAvatar]" }, { kind: "directive", type: i6.MatListItemLine, selector: "[matListItemLine]" }, { kind: "directive", type: i6.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "directive", type: i6.MatListItemMeta, selector: "[matListItemMeta]" }, { kind: "ngmodule", type: MatRippleModule }, { kind: "directive", type: i7.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i8.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: i8.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: EmptyStateComponent, selector: "lib-empty-state", inputs: ["icon", "message"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
252
|
+
}
|
|
253
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: RequiredInputsComponent, decorators: [{
|
|
254
|
+
type: Component,
|
|
255
|
+
args: [{ selector: 'lib-required-inputs', imports: [
|
|
256
|
+
FormsModule,
|
|
257
|
+
MatButtonModule,
|
|
258
|
+
MatFormFieldModule,
|
|
259
|
+
MatIconModule,
|
|
260
|
+
MatInputModule,
|
|
261
|
+
MatListModule,
|
|
262
|
+
MatRippleModule,
|
|
263
|
+
MatSelectModule,
|
|
264
|
+
EmptyStateComponent,
|
|
265
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: {
|
|
266
|
+
'class': 'lib-required-inputs',
|
|
267
|
+
'[attr.id]': 'id()',
|
|
268
|
+
}, template: "@if (chips().length) {\r\n<div class=\"lib-required-inputs__chips\" role=\"list\" aria-label=\"Required inputs\">\r\n @for (chip of chips(); track chip.name) {\r\n <button\r\n type=\"button\"\r\n role=\"listitem\"\r\n class=\"lib-required-inputs__chip\"\r\n [class.lib-required-inputs__chip--linked]=\"chip.linked\"\r\n [class.lib-required-inputs__chip--active]=\"chip.active\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-pressed]=\"chip.active\"\r\n [attr.aria-label]=\"chip.name + (chip.linked ? ', linked' : ', not linked')\"\r\n (click)=\"toggleActive(chip.name)\">\r\n <span class=\"lib-required-inputs__chip-label\">{{ chip.name }}</span>\r\n <mat-icon class=\"lib-required-inputs__chip-icon\" aria-hidden=\"true\">\r\n {{ chip.linked ? 'link' : 'link_off' }}\r\n </mat-icon>\r\n </button>\r\n }\r\n</div>\r\n} @else {\r\n<lib-empty-state icon=\"link_off\" message=\"No required inputs to configure.\" />\r\n}\r\n\r\n@if (inEdit(); as edit) {\r\n<div class=\"lib-required-inputs__panel\">\r\n <mat-form-field\r\n class=\"lib-required-inputs__field\"\r\n appearance=\"outline\"\r\n subscriptSizing=\"dynamic\">\r\n <mat-label>Input handling method</mat-label>\r\n <mat-select\r\n [value]=\"activeType()\"\r\n [disabled]=\"disabled()\"\r\n (selectionChange)=\"selectType($event.value)\">\r\n <mat-option [value]=\"minInputTypes.Default\">Default value</mat-option>\r\n <mat-option [value]=\"minInputTypes.MapTo\">Map to a form input</mat-option>\r\n <mat-option [value]=\"minInputTypes.MapDocFilter\">Filter by an input value</mat-option>\r\n </mat-select>\r\n <mat-hint>Choose how this required input is resolved</mat-hint>\r\n </mat-form-field>\r\n\r\n @if (activeType() === minInputTypes.Default) {\r\n <mat-form-field\r\n class=\"lib-required-inputs__field\"\r\n appearance=\"outline\"\r\n subscriptSizing=\"dynamic\">\r\n <mat-label>Default value</mat-label>\r\n <input\r\n matInput\r\n [ngModel]=\"edit.defaultValue\"\r\n [disabled]=\"disabled()\"\r\n (ngModelChange)=\"setDefaultValue($event)\"\r\n placeholder=\"Enter a default value\" />\r\n <mat-hint>Used when no value is supplied at runtime</mat-hint>\r\n </mat-form-field>\r\n }\r\n\r\n @if (showMapList()) {\r\n <p class=\"lib-required-inputs__list-label\">\r\n Link <strong>{{ activeInput() }}</strong> to a form input\r\n </p>\r\n\r\n @if (mapTargets().length) {\r\n <mat-nav-list class=\"lib-required-inputs__list\">\r\n {{mapTargets().length}}\r\n @for (target of mapTargets(); track target.id) {\r\n <mat-list-item\r\n class=\"lib-required-inputs__item\"\r\n matRipple\r\n role=\"button\"\r\n [disabled]=\"disabled() || !target.mappable\"\r\n [activated]=\"target.selected\"\r\n [attr.aria-pressed]=\"target.selected\"\r\n [attr.aria-label]=\"target.ariaLabel\"\r\n (click)=\"toggleMap(target); $event.stopPropagation()\">\r\n <mat-icon\r\n matListItemAvatar\r\n class=\"lib-required-inputs__avatar\"\r\n aria-hidden=\"true\">\r\n {{ target.icon }}\r\n </mat-icon>\r\n <span matListItemTitle class=\"lib-required-inputs__item-title\">{{ target.label }}</span>\r\n <span matListItemLine class=\"lib-required-inputs__item-meta\">\r\n <span>{{ target.formControlName }}</span>\r\n @if (target.dataType) {\r\n <span>{{ target.dataType }}</span>\r\n }\r\n </span>\r\n <mat-icon\r\n matListItemMeta\r\n class=\"lib-required-inputs__indicator\"\r\n [class.lib-required-inputs__indicator--on]=\"target.selected\"\r\n aria-hidden=\"true\">\r\n {{ target.selected ? 'check_circle' : 'radio_button_unchecked' }}\r\n </mat-icon>\r\n </mat-list-item>\r\n }\r\n </mat-nav-list>\r\n } @else {\r\n <lib-empty-state icon=\"add_link\" message=\"Add form inputs before mapping this input.\" />\r\n }\r\n }\r\n\r\n <div class=\"lib-required-inputs__actions\">\r\n <button type=\"button\" mat-flat-button color=\"primary\" (click)=\"close()\">Done</button>\r\n </div>\r\n</div>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;gap:1.5rem;color:var(--lib-forms-on-surface)}.lib-required-inputs__chips{display:flex;flex-wrap:wrap;gap:.5rem}.lib-required-inputs__chip{display:inline-flex;align-items:center;gap:.5rem;padding:.25rem .5rem .25rem .625rem;background:color-mix(in srgb,var(--lib-forms-primary) 10%,transparent);border-radius:var(--lib-forms-radius-pill, 6px);font-size:.8125rem;color:var(--lib-forms-on-surface);cursor:pointer;border:1px solid color-mix(in srgb,var(--lib-forms-outline) 30%,transparent);background:var(--lib-forms-surface);transition:background-color var(--lib-forms-duration-hover) var(--lib-forms-easing),border-color var(--lib-forms-duration-hover) var(--lib-forms-easing)}.lib-required-inputs__chip:hover:not(:disabled){border-color:var(--lib-forms-primary)}.lib-required-inputs__chip:focus-visible{outline:none;border-color:var(--lib-forms-primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--lib-forms-primary) 25%,transparent)}.lib-required-inputs__chip:disabled{opacity:.55;pointer-events:none}.lib-required-inputs__chip--linked{background:color-mix(in srgb,var(--lib-forms-primary) 14%,transparent);border-color:color-mix(in srgb,var(--lib-forms-primary) 30%,transparent)}.lib-required-inputs__chip--active{border-color:var(--lib-forms-primary);background:color-mix(in srgb,var(--lib-forms-primary) 22%,transparent)}.lib-required-inputs__chip-icon{width:1rem;height:1rem;font-size:1rem;color:var(--lib-forms-on-surface-variant)}.lib-required-inputs__chip--linked .lib-required-inputs__chip-icon,.lib-required-inputs__chip--active .lib-required-inputs__chip-icon{color:var(--lib-forms-primary)}.lib-required-inputs__panel{display:flex;flex-direction:column;gap:1.5rem}.lib-required-inputs__field{width:100%}.lib-required-inputs__list-label{margin:0;font-size:.625rem;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--lib-forms-on-surface-variant)}.lib-required-inputs__list-label strong{color:var(--lib-forms-primary)}.lib-required-inputs__list{width:100%;box-sizing:border-box;max-height:65vh;overflow:auto;padding:.5rem;background:var(--lib-forms-surface);border:1px solid color-mix(in srgb,var(--lib-forms-outline) 12%,transparent);border-radius:var(--lib-forms-radius-lg, 12px)}.lib-required-inputs__item{min-height:3rem;height:fit-content;margin-bottom:.25rem;border-radius:var(--lib-forms-radius-sm, 8px);cursor:pointer;transition:background-color var(--lib-forms-duration-hover) var(--lib-forms-easing)}.lib-required-inputs__item:last-child{margin-bottom:0}.lib-required-inputs__item:hover{background:color-mix(in srgb,var(--lib-forms-primary) 6%,transparent)}.lib-required-inputs__item:focus-visible{outline:none;border-color:var(--lib-forms-primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--lib-forms-primary) 25%,transparent)}.lib-required-inputs__item.mdc-list-item--activated{background:color-mix(in srgb,var(--lib-forms-primary) 12%,transparent)}mat-icon.lib-required-inputs__avatar{display:inline-flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;border-radius:var(--lib-forms-radius-sm, 8px);font-size:1.5rem;line-height:1;background:var(--lib-forms-surface-container-high);color:var(--lib-forms-on-surface-variant)}.lib-required-inputs__item-title{font-size:.9375rem;font-weight:600}.lib-required-inputs__item-meta{display:flex;flex-wrap:wrap;gap:.5rem;font-size:.75rem;color:var(--lib-forms-on-surface-variant)}.lib-required-inputs__indicator{color:var(--lib-forms-on-surface-variant)}.lib-required-inputs__indicator--on{color:var(--lib-forms-primary)}.lib-required-inputs__actions{display:flex;justify-content:flex-end;gap:.75rem}\n"] }]
|
|
269
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], formInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "formInputs", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], valueChanged: [{ type: i0.Output, args: ["valueChanged"] }] } });
|
|
270
|
+
|
|
271
|
+
export { RequiredInputsComponent };
|
|
272
|
+
//# sourceMappingURL=ngx-t-forms-required-inputs.component-D9wIdOhg.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-required-inputs.component-D9wIdOhg.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/required-inputs/required-inputs.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/required-inputs/required-inputs.component.html"],"sourcesContent":["import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ViewEncapsulation,\r\n computed,\r\n input,\r\n linkedSignal,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatListModule } from '@angular/material/list';\r\nimport { MatRippleModule } from '@angular/material/core';\r\nimport { MatSelectModule } from '@angular/material/select';\r\nimport { FormsModule } from '@angular/forms';\r\nimport {\r\n ElementTypes,\r\n FormColumnInputs,\r\n InputDataTypes,\r\n MinInputMapInput,\r\n MinInputTypes,\r\n MinimumInputRequiredInterface,\r\n} from 'ngx-t-forms-types';\r\nimport { getInputIcon } from '../../../../shared/functions/getInputIcon';\r\nimport type { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\nimport { EmptyStateComponent } from '../_shared/empty-state/empty-state.component';\r\n\r\n/** A required input decorated with the derived view-model fields the chip row renders. */\r\ninterface RequiredInputChip {\r\n readonly name: string;\r\n readonly linked: boolean;\r\n readonly active: boolean;\r\n}\r\n\r\n/** A mappable form input decorated with the derived view-model fields the list renders. */\r\ninterface MapTarget {\r\n readonly id: string;\r\n readonly label: string;\r\n readonly icon: string;\r\n readonly formControlName: string;\r\n readonly dataType: string;\r\n readonly selected: boolean;\r\n readonly mappable: boolean;\r\n readonly ariaLabel: string;\r\n}\r\n\r\n/**\r\n * Internal editor element for configuring a form's required (minimum) inputs.\r\n * Child of `t-dynamic-data-edit`, which supplies the field label, hint, and\r\n * validation errors — so this component owns only the chip row + edit content.\r\n *\r\n * Each required input can be handled three ways: a literal default value, a\r\n * single-input map (`MapTo`), or a multi-input filter (`MapDocFilter`).\r\n * Re-selecting the active handling method, chip, or a mapped input toggles it\r\n * off again.\r\n */\r\n@Component({\r\n selector: 'lib-required-inputs',\r\n imports: [\r\n FormsModule,\r\n MatButtonModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatInputModule,\r\n MatListModule,\r\n MatRippleModule,\r\n MatSelectModule,\r\n EmptyStateComponent,\r\n ],\r\n templateUrl: './required-inputs.component.html',\r\n styleUrl: './required-inputs.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n host: {\r\n 'class': 'lib-required-inputs',\r\n '[attr.id]': 'id()',\r\n },\r\n})\r\nexport class RequiredInputsComponent {\r\n /** Handling-method enum, exposed to the template. */\r\n protected readonly minInputTypes = MinInputTypes;\r\n\r\n /**\r\n * Required-input descriptors to render. Heterogeneous wrapper binding — the\r\n * parent feeds whatever the editor config holds; narrowing here would force\r\n * wrapper changes.\r\n */\r\n readonly value = input<readonly MinimumInputRequiredInterface[]>([]);\r\n\r\n /** All available form inputs the user can map a required input to. */\r\n readonly formInputs = input<readonly FormColumnInputs[]>([]);\r\n\r\n /** Disable user interaction. */\r\n readonly disabled = input<boolean>(false);\r\n\r\n /**\r\n * Validation errors passed down by the parent editor. Retained on the contract\r\n * but not rendered here — `t-dynamic-data-edit` owns error display.\r\n */\r\n readonly errors = input<IConfigElementError[] | undefined>([]);\r\n\r\n /** Optional id attribute supplied by the parent editor (used to disambiguate). */\r\n readonly id = input<string | undefined>(undefined);\r\n\r\n /** Emits the mutated required-input list whenever the user changes a mapping. */\r\n readonly valueChanged = output<MinimumInputRequiredInterface[]>();\r\n\r\n /**\r\n * Local, immutable working copy of `value`. Tracks the bound value (the parent\r\n * re-feeds it after each emit) but stays locally overridable; mutations always\r\n * produce a new array, and entries are cloned so the parent's array is never\r\n * mutated in place.\r\n */\r\n readonly #workingValue = linkedSignal<readonly MinimumInputRequiredInterface[]>(() =>\r\n this.value().map((item) => ({ ...item })),\r\n );\r\n\r\n /** Name of the required input currently open in the edit panel; `''` when none. */\r\n protected readonly activeInput = signal<string>('');\r\n\r\n /** The chip row: one entry per required input, with derived link/active state. */\r\n protected readonly chips = computed<readonly RequiredInputChip[]>(() => {\r\n const active = this.activeInput();\r\n return this.#workingValue().map((item) => ({\r\n name: item.name,\r\n linked: this.#isLinked(item),\r\n active: item.name === active,\r\n }));\r\n });\r\n\r\n /** The required input currently being edited, or `undefined` when none is active. */\r\n protected readonly inEdit = computed<MinimumInputRequiredInterface | undefined>(() => {\r\n const active = this.activeInput();\r\n if (!active) {\r\n return undefined;\r\n }\r\n return this.#workingValue().find((item) => item.name === active);\r\n });\r\n\r\n /** Handling method of the input in edit; `null` keeps the `mat-select` empty. */\r\n protected readonly activeType = computed<MinInputTypes | null>(() => {\r\n const type = this.inEdit()?.type;\r\n return type === MinInputTypes.Default ||\r\n type === MinInputTypes.MapTo ||\r\n type === MinInputTypes.MapDocFilter\r\n ? type\r\n : null;\r\n });\r\n\r\n /** Whether the edit panel should show the mappable-input list. */\r\n protected readonly showMapList = computed<boolean>(() => {\r\n const type = this.activeType();\r\n return type === MinInputTypes.MapTo || type === MinInputTypes.MapDocFilter;\r\n });\r\n\r\n /**\r\n * The list of mappable form inputs for the input in edit. Single-select\r\n * (`MapTo`) collapses to the chosen input once one is picked; multi-select\r\n * (`MapDocFilter`) always shows the full list with each chosen input flagged.\r\n */\r\n protected readonly mapTargets = computed<readonly MapTarget[]>(() => {\r\n const edit = this.inEdit();\r\n if (!edit) {\r\n return [];\r\n }\r\n const all = this.formInputs().map((item) => this.#toTarget(item, edit));\r\n if (edit.type === MinInputTypes.MapTo) {\r\n const selected = all.find((target) => target.selected);\r\n return selected ? [selected] : all;\r\n }\r\n return all;\r\n });\r\n\r\n /** Toggle the edit panel for a required input. Re-selecting the active one closes it. */\r\n protected toggleActive(name: string): void {\r\n if (this.disabled()) {\r\n return;\r\n }\r\n this.activeInput.update((current) => (current === name ? '' : name));\r\n }\r\n\r\n /** Close the edit panel without changing anything. */\r\n protected close(): void {\r\n this.activeInput.set('');\r\n }\r\n\r\n /** Choose (or, when re-selected, clear) the handling method for the input in edit. */\r\n protected selectType(type: MinInputTypes): void {\r\n this.#patchActive((current) => {\r\n if (current.type === type) {\r\n return { ...current, type: undefined, mapTo: undefined, defaultValue: undefined };\r\n }\r\n return {\r\n ...current,\r\n type,\r\n mapTo: type === MinInputTypes.MapDocFilter ? [] : undefined,\r\n defaultValue: type === MinInputTypes.Default ? current.defaultValue : undefined,\r\n };\r\n });\r\n }\r\n\r\n /** Update the literal default value of the input in edit. */\r\n protected setDefaultValue(value: string): void {\r\n this.#patchActive((current) => ({ ...current, defaultValue: value }));\r\n }\r\n\r\n /**\r\n * Map (or, when re-selected, unmap) a form input to the input in edit. `MapTo`\r\n * holds a single mapping; `MapDocFilter` accumulates a list.\r\n */\r\n protected toggleMap(target: MapTarget): void {\r\n if (this.disabled() || !target.mappable) {\r\n return;\r\n }\r\n const mapping = this.#toMapping(target);\r\n this.#patchActive((current) => {\r\n if (current.type === MinInputTypes.MapTo) {\r\n const existing = this.#asSingle(current.mapTo);\r\n const sameSelected = existing?.formControlName === mapping.formControlName;\r\n return { ...current, mapTo: sameSelected ? undefined : mapping };\r\n }\r\n if (current.type === MinInputTypes.MapDocFilter) {\r\n const list = this.#asList(current.mapTo);\r\n const has = list.some((m) => m.formControlName === mapping.formControlName);\r\n return {\r\n ...current,\r\n mapTo: has\r\n ? list.filter((m) => m.formControlName !== mapping.formControlName)\r\n : [...list, mapping],\r\n };\r\n }\r\n return current;\r\n });\r\n }\r\n\r\n /** Replace the active entry via `patch` and emit the new list. */\r\n #patchActive(\r\n patch: (current: MinimumInputRequiredInterface) => MinimumInputRequiredInterface,\r\n ): void {\r\n const active = this.activeInput();\r\n let changed = false;\r\n const next = this.#workingValue().map((item) => {\r\n if (item.name !== active) {\r\n return item;\r\n }\r\n changed = true;\r\n return patch(item);\r\n });\r\n if (!changed) {\r\n return;\r\n }\r\n this.#workingValue.set(next);\r\n this.valueChanged.emit([...next]);\r\n }\r\n\r\n #isLinked(item: MinimumInputRequiredInterface): boolean {\r\n if (item.type === MinInputTypes.Default) {\r\n return !!item.defaultValue;\r\n }\r\n if (item.type === MinInputTypes.MapTo) {\r\n return !!this.#asSingle(item.mapTo);\r\n }\r\n if (item.type === MinInputTypes.MapDocFilter) {\r\n return this.#asList(item.mapTo).length > 0;\r\n }\r\n return false;\r\n }\r\n\r\n #toTarget(item: FormColumnInputs, edit: MinimumInputRequiredInterface): MapTarget {\r\n const mappable = item.element !== ElementTypes.SectionTitle;\r\n const selected = this.#isMapped(edit, item.formControlName);\r\n return {\r\n id: item.id,\r\n label: item.label,\r\n icon: getInputIcon(item.element),\r\n formControlName: item.formControlName,\r\n dataType: item.dataType ?? '',\r\n selected,\r\n mappable,\r\n ariaLabel: `${item.label}.${mappable ? '' : ' Not mappable.'}`,\r\n };\r\n }\r\n\r\n #isMapped(edit: MinimumInputRequiredInterface, formControlName: string): boolean {\r\n if (edit.type === MinInputTypes.MapTo) {\r\n return this.#asSingle(edit.mapTo)?.formControlName === formControlName;\r\n }\r\n if (edit.type === MinInputTypes.MapDocFilter) {\r\n return this.#asList(edit.mapTo).some((m) => m.formControlName === formControlName);\r\n }\r\n return false;\r\n }\r\n\r\n #toMapping(target: MapTarget): MinInputMapInput {\r\n const source = this.formInputs().find((item) => item.id === target.id);\r\n return {\r\n formControlName: target.formControlName,\r\n dataType: source?.dataType ?? InputDataTypes.String,\r\n element: source?.element ?? ElementTypes.Input,\r\n inputId: target.id,\r\n };\r\n }\r\n\r\n #asSingle(\r\n mapTo: MinInputMapInput | readonly MinInputMapInput[] | undefined,\r\n ): MinInputMapInput | undefined {\r\n if (!mapTo || Array.isArray(mapTo)) {\r\n return undefined;\r\n }\r\n // `Array.isArray` does not narrow a `readonly[]` out of the union, so assert\r\n // the remaining single-mapping shape after the guard.\r\n return mapTo as MinInputMapInput;\r\n }\r\n\r\n #asList(\r\n mapTo: MinInputMapInput | readonly MinInputMapInput[] | undefined,\r\n ): readonly MinInputMapInput[] {\r\n return Array.isArray(mapTo) ? mapTo : [];\r\n }\r\n}\r\n","@if (chips().length) {\r\n<div class=\"lib-required-inputs__chips\" role=\"list\" aria-label=\"Required inputs\">\r\n @for (chip of chips(); track chip.name) {\r\n <button\r\n type=\"button\"\r\n role=\"listitem\"\r\n class=\"lib-required-inputs__chip\"\r\n [class.lib-required-inputs__chip--linked]=\"chip.linked\"\r\n [class.lib-required-inputs__chip--active]=\"chip.active\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-pressed]=\"chip.active\"\r\n [attr.aria-label]=\"chip.name + (chip.linked ? ', linked' : ', not linked')\"\r\n (click)=\"toggleActive(chip.name)\">\r\n <span class=\"lib-required-inputs__chip-label\">{{ chip.name }}</span>\r\n <mat-icon class=\"lib-required-inputs__chip-icon\" aria-hidden=\"true\">\r\n {{ chip.linked ? 'link' : 'link_off' }}\r\n </mat-icon>\r\n </button>\r\n }\r\n</div>\r\n} @else {\r\n<lib-empty-state icon=\"link_off\" message=\"No required inputs to configure.\" />\r\n}\r\n\r\n@if (inEdit(); as edit) {\r\n<div class=\"lib-required-inputs__panel\">\r\n <mat-form-field\r\n class=\"lib-required-inputs__field\"\r\n appearance=\"outline\"\r\n subscriptSizing=\"dynamic\">\r\n <mat-label>Input handling method</mat-label>\r\n <mat-select\r\n [value]=\"activeType()\"\r\n [disabled]=\"disabled()\"\r\n (selectionChange)=\"selectType($event.value)\">\r\n <mat-option [value]=\"minInputTypes.Default\">Default value</mat-option>\r\n <mat-option [value]=\"minInputTypes.MapTo\">Map to a form input</mat-option>\r\n <mat-option [value]=\"minInputTypes.MapDocFilter\">Filter by an input value</mat-option>\r\n </mat-select>\r\n <mat-hint>Choose how this required input is resolved</mat-hint>\r\n </mat-form-field>\r\n\r\n @if (activeType() === minInputTypes.Default) {\r\n <mat-form-field\r\n class=\"lib-required-inputs__field\"\r\n appearance=\"outline\"\r\n subscriptSizing=\"dynamic\">\r\n <mat-label>Default value</mat-label>\r\n <input\r\n matInput\r\n [ngModel]=\"edit.defaultValue\"\r\n [disabled]=\"disabled()\"\r\n (ngModelChange)=\"setDefaultValue($event)\"\r\n placeholder=\"Enter a default value\" />\r\n <mat-hint>Used when no value is supplied at runtime</mat-hint>\r\n </mat-form-field>\r\n }\r\n\r\n @if (showMapList()) {\r\n <p class=\"lib-required-inputs__list-label\">\r\n Link <strong>{{ activeInput() }}</strong> to a form input\r\n </p>\r\n\r\n @if (mapTargets().length) {\r\n <mat-nav-list class=\"lib-required-inputs__list\">\r\n {{mapTargets().length}}\r\n @for (target of mapTargets(); track target.id) {\r\n <mat-list-item\r\n class=\"lib-required-inputs__item\"\r\n matRipple\r\n role=\"button\"\r\n [disabled]=\"disabled() || !target.mappable\"\r\n [activated]=\"target.selected\"\r\n [attr.aria-pressed]=\"target.selected\"\r\n [attr.aria-label]=\"target.ariaLabel\"\r\n (click)=\"toggleMap(target); $event.stopPropagation()\">\r\n <mat-icon\r\n matListItemAvatar\r\n class=\"lib-required-inputs__avatar\"\r\n aria-hidden=\"true\">\r\n {{ target.icon }}\r\n </mat-icon>\r\n <span matListItemTitle class=\"lib-required-inputs__item-title\">{{ target.label }}</span>\r\n <span matListItemLine class=\"lib-required-inputs__item-meta\">\r\n <span>{{ target.formControlName }}</span>\r\n @if (target.dataType) {\r\n <span>{{ target.dataType }}</span>\r\n }\r\n </span>\r\n <mat-icon\r\n matListItemMeta\r\n class=\"lib-required-inputs__indicator\"\r\n [class.lib-required-inputs__indicator--on]=\"target.selected\"\r\n aria-hidden=\"true\">\r\n {{ target.selected ? 'check_circle' : 'radio_button_unchecked' }}\r\n </mat-icon>\r\n </mat-list-item>\r\n }\r\n </mat-nav-list>\r\n } @else {\r\n <lib-empty-state icon=\"add_link\" message=\"Add form inputs before mapping this input.\" />\r\n }\r\n }\r\n\r\n <div class=\"lib-required-inputs__actions\">\r\n <button type=\"button\" mat-flat-button color=\"primary\" (click)=\"close()\">Done</button>\r\n </div>\r\n</div>\r\n}\r\n"],"names":["i3","i4"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiDA;;;;;;;;;AASG;MAuBU,uBAAuB,CAAA;AAtBpC,IAAA,WAAA,GAAA;;QAwBqB,IAAA,CAAA,aAAa,GAAG,aAAa;AAEhD;;;;AAIG;AACM,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAA2C,EAAE,4EAAC;;AAG3D,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAA8B,EAAE,iFAAC;;AAGnD,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,+EAAC;AAEzC;;;AAGG;AACM,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAoC,EAAE,6EAAC;;AAGrD,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAqB,SAAS,yEAAC;;QAGzC,IAAA,CAAA,YAAY,GAAG,MAAM,EAAmC;AAEjE;;;;;AAKG;QACM,IAAA,CAAA,aAAa,GAAG,YAAY,CAA2C,MAC9E,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,C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AA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,qBAAqB,EAAA,OAAA,EACtB;wBACP,WAAW;wBACX,eAAe;wBACf,kBAAkB;wBAClB,aAAa;wBACb,cAAc;wBACd,aAAa;wBACb,eAAe;wBACf,eAAe;wBACf,mBAAmB;AACpB,qBAAA,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,QAAQ,EAAA,IAAA,EACnC;AACJ,wBAAA,OAAO,EAAE,qBAAqB;AAC9B,wBAAA,WAAW,EAAE,MAAM;AACpB,qBAAA,EAAA,QAAA,EAAA,ylIAAA,EAAA,MAAA,EAAA,CAAA,ylHAAA,CAAA,EAAA;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, output, inject, DestroyRef, signal, computed, effect, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { JsDataTypes, DataSources } from 'ngx-t-forms-types';
|
|
4
|
-
import { j as TreeComponent, k as convertPostmanFolderItemsToTree, _ as _isEqual, E as EmptyStateComponent, l as ErrorListComponent } from './ngx-t-forms-ngx-t-forms-
|
|
4
|
+
import { j as TreeComponent, k as convertPostmanFolderItemsToTree, _ as _isEqual, E as EmptyStateComponent, l as ErrorListComponent } from './ngx-t-forms-ngx-t-forms-tQEbZK_e.mjs';
|
|
5
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
|
|
7
7
|
import { take, tap, catchError, throwError } from 'rxjs';
|
|
@@ -9,13 +9,13 @@ import * as i1 from '@angular/material/tree';
|
|
|
9
9
|
import { MatTreeModule } from '@angular/material/tree';
|
|
10
10
|
import * as i3 from '@angular/material/icon';
|
|
11
11
|
import { MatIconModule } from '@angular/material/icon';
|
|
12
|
-
import * as
|
|
12
|
+
import * as i2 from '@angular/material/button';
|
|
13
13
|
import { MatButtonModule } from '@angular/material/button';
|
|
14
14
|
import * as i4 from '@angular/material/progress-spinner';
|
|
15
15
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
16
16
|
import * as i5 from '@angular/material/tooltip';
|
|
17
17
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
18
|
-
import { S as SearchFieldComponent } from './ngx-t-forms-search-field.component-
|
|
18
|
+
import { S as SearchFieldComponent } from './ngx-t-forms-search-field.component-mR4Kk12C.mjs';
|
|
19
19
|
|
|
20
20
|
/** True when an item's own name or description contains the (already-lowercased) search text. */
|
|
21
21
|
function itemMatches(item, searchText) {
|
|
@@ -205,7 +205,7 @@ class PostmanCollectionsComponent {
|
|
|
205
205
|
return lines;
|
|
206
206
|
}
|
|
207
207
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: PostmanCollectionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
208
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: PostmanCollectionsComponent, isStandalone: true, selector: "lib-postman-collections", inputs: { postmanCollectionConfig: { classPropertyName: "postmanCollectionConfig", publicName: "postmanCollectionConfig", isSignal: true, isRequired: false, transformFunction: null }, loadingEndPoints: { classPropertyName: "loadingEndPoints", publicName: "loadingEndPoints", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nodeSelectionChanged: "nodeSelectionChanged" }, host: { classAttribute: "lib-postman-collections" }, ngImport: i0, template: "@if (loading()) {\n <div class=\"loading-container\">\n <mat-spinner diameter=\"36\"></mat-spinner>\n </div>\n} @else {\n <lib-search-field\n class=\"search\"\n placeholder=\"Search api\"\n [(value)]=\"searchKey\" />\n\n @if (error(); as err) {\n <lib-empty-state icon=\"error_outline\" [message]=\"err.message\" />\n } @else if (isEmpty()) {\n <lib-empty-state\n icon=\"search_off\"\n [message]=\"searchKey() ? 'No endpoints match your search' : 'No endpoints in this collection'\" />\n } @else {\n <mat-tree\n [dataSource]=\"treeComponent.dataSource\"\n [treeControl]=\"treeComponent.treeControl\">\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding>\n @if (isEndpointLoading(node.value.id)) {\n <mat-spinner diameter=\"22\" class=\"loading-spinner\"></mat-spinner>\n }\n @for (line of getNodeLines(node.level); track line) {\n <div class=\"line\" [style.left.px]=\"line * 40 + 8\"></div>\n }\n @if (node.value?.request; as request) {\n <button\n mat-button\n class=\"item\"\n [disabled]=\"(!request.body?.raw && request.method === 'POST') || !request.url?.raw\"\n [matTooltip]=\"request.url?.raw || 'Invalid Postman config, missing Endpoint URL'\"\n (click)=\"selectNode(node.value)\">\n <span class=\"node-key method\" [style.color]=\"methodColor(request.method)\">\n {{ request.method }}\n </span>\n <span>{{ node.key }}</span>\n </button>\n }\n </mat-tree-node>\n\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" matTreeNodePadding>\n <button\n mat-icon-button\n matTreeNodeToggle\n class=\"toggle\"\n [attr.aria-label]=\"'Toggle ' + node.key\">\n <mat-icon>\n {{ treeComponent.treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\n </mat-icon>\n </button>\n <mat-icon class=\"folder-icon\">\n {{ treeComponent.treeControl.isExpanded(node) ? 'folder_open' : 'folder' }}\n </mat-icon>\n <span class=\"folder-label\">{{ node.key }}</span>\n </mat-tree-node>\n </mat-tree>\n }\n}\n", styles: [":host{display:block}.search{margin-bottom:1rem}mat-tree{background:none}:host mat-tree-node{min-height:28px;height:32px}.toggle{padding:0}.folder-icon{color:var(--lib-forms-on-surface-variant)}.folder-label{margin-left:.5rem;font-weight:500}.item{display:flex;width:100%;justify-content:left;text-align:left;font-size:small;font-weight:400;white-space:nowrap;overflow:hidden}.method{display:inline-block;width:38px;text-align:right}.line{position:absolute;height:32px;left:48px;width:1px;background:color-mix(in srgb,var(--lib-forms-outline) 40%,transparent)}.loading-container{display:flex;align-items:center;justify-content:center;height:100%;padding:2rem}\n"], dependencies: [{ kind: "ngmodule", type: MatTreeModule }, { kind: "directive", type: i1.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i1.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { kind: "directive", type: i1.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i1.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i1.MatTreeNode, selector: "mat-tree-node", inputs: ["tabIndex", "disabled"], outputs: ["activation", "expandedChange"], exportAs: ["matTreeNode"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type:
|
|
208
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: PostmanCollectionsComponent, isStandalone: true, selector: "lib-postman-collections", inputs: { postmanCollectionConfig: { classPropertyName: "postmanCollectionConfig", publicName: "postmanCollectionConfig", isSignal: true, isRequired: false, transformFunction: null }, loadingEndPoints: { classPropertyName: "loadingEndPoints", publicName: "loadingEndPoints", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nodeSelectionChanged: "nodeSelectionChanged" }, host: { classAttribute: "lib-postman-collections" }, ngImport: i0, template: "@if (loading()) {\r\n <div class=\"loading-container\">\r\n <mat-spinner diameter=\"36\"></mat-spinner>\r\n </div>\r\n} @else {\r\n <lib-search-field\r\n class=\"search\"\r\n placeholder=\"Search api\"\r\n [(value)]=\"searchKey\" />\r\n\r\n @if (error(); as err) {\r\n <lib-empty-state icon=\"error_outline\" [message]=\"err.message\" />\r\n } @else if (isEmpty()) {\r\n <lib-empty-state\r\n icon=\"search_off\"\r\n [message]=\"searchKey() ? 'No endpoints match your search' : 'No endpoints in this collection'\" />\r\n } @else {\r\n <mat-tree\r\n [dataSource]=\"treeComponent.dataSource\"\r\n [treeControl]=\"treeComponent.treeControl\">\r\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding>\r\n @if (isEndpointLoading(node.value.id)) {\r\n <mat-spinner diameter=\"22\" class=\"loading-spinner\"></mat-spinner>\r\n }\r\n @for (line of getNodeLines(node.level); track line) {\r\n <div class=\"line\" [style.left.px]=\"line * 40 + 8\"></div>\r\n }\r\n @if (node.value?.request; as request) {\r\n <button\r\n mat-button\r\n class=\"item\"\r\n [disabled]=\"(!request.body?.raw && request.method === 'POST') || !request.url?.raw\"\r\n [matTooltip]=\"request.url?.raw || 'Invalid Postman config, missing Endpoint URL'\"\r\n (click)=\"selectNode(node.value)\">\r\n <span class=\"node-key method\" [style.color]=\"methodColor(request.method)\">\r\n {{ request.method }}\r\n </span>\r\n <span>{{ node.key }}</span>\r\n </button>\r\n }\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" matTreeNodePadding>\r\n <button\r\n mat-icon-button\r\n matTreeNodeToggle\r\n class=\"toggle\"\r\n [attr.aria-label]=\"'Toggle ' + node.key\">\r\n <mat-icon>\r\n {{ treeComponent.treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\r\n </mat-icon>\r\n </button>\r\n <mat-icon class=\"folder-icon\">\r\n {{ treeComponent.treeControl.isExpanded(node) ? 'folder_open' : 'folder' }}\r\n </mat-icon>\r\n <span class=\"folder-label\">{{ node.key }}</span>\r\n </mat-tree-node>\r\n </mat-tree>\r\n }\r\n}\r\n", styles: [":host{display:block}.search{margin-bottom:1rem}mat-tree{background:none}:host mat-tree-node{min-height:28px;height:32px}.toggle{padding:0}.folder-icon{color:var(--lib-forms-on-surface-variant)}.folder-label{margin-left:.5rem;font-weight:500}.item{display:flex;width:100%;justify-content:left;text-align:left;font-size:small;font-weight:400;white-space:nowrap;overflow:hidden}.method{display:inline-block;width:38px;text-align:right}.line{position:absolute;height:32px;left:48px;width:1px;background:color-mix(in srgb,var(--lib-forms-outline) 40%,transparent)}.loading-container{display:flex;align-items:center;justify-content:center;height:100%;padding:2rem}\n"], dependencies: [{ kind: "ngmodule", type: MatTreeModule }, { kind: "directive", type: i1.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i1.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { kind: "directive", type: i1.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i1.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i1.MatTreeNode, selector: "mat-tree-node", inputs: ["tabIndex", "disabled"], outputs: ["activation", "expandedChange"], exportAs: ["matTreeNode"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: SearchFieldComponent, selector: "lib-search-field", inputs: ["value", "placeholder", "resultCount"], outputs: ["valueChange"] }, { kind: "component", type: EmptyStateComponent, selector: "lib-empty-state", inputs: ["icon", "message"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
209
209
|
}
|
|
210
210
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: PostmanCollectionsComponent, decorators: [{
|
|
211
211
|
type: Component,
|
|
@@ -217,7 +217,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
217
217
|
MatTooltipModule,
|
|
218
218
|
SearchFieldComponent,
|
|
219
219
|
EmptyStateComponent,
|
|
220
|
-
], template: "@if (loading()) {\n <div class=\"loading-container\">\n <mat-spinner diameter=\"36\"></mat-spinner>\n </div>\n} @else {\n <lib-search-field\n class=\"search\"\n placeholder=\"Search api\"\n [(value)]=\"searchKey\" />\n\n @if (error(); as err) {\n <lib-empty-state icon=\"error_outline\" [message]=\"err.message\" />\n } @else if (isEmpty()) {\n <lib-empty-state\n icon=\"search_off\"\n [message]=\"searchKey() ? 'No endpoints match your search' : 'No endpoints in this collection'\" />\n } @else {\n <mat-tree\n [dataSource]=\"treeComponent.dataSource\"\n [treeControl]=\"treeComponent.treeControl\">\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding>\n @if (isEndpointLoading(node.value.id)) {\n <mat-spinner diameter=\"22\" class=\"loading-spinner\"></mat-spinner>\n }\n @for (line of getNodeLines(node.level); track line) {\n <div class=\"line\" [style.left.px]=\"line * 40 + 8\"></div>\n }\n @if (node.value?.request; as request) {\n <button\n mat-button\n class=\"item\"\n [disabled]=\"(!request.body?.raw && request.method === 'POST') || !request.url?.raw\"\n [matTooltip]=\"request.url?.raw || 'Invalid Postman config, missing Endpoint URL'\"\n (click)=\"selectNode(node.value)\">\n <span class=\"node-key method\" [style.color]=\"methodColor(request.method)\">\n {{ request.method }}\n </span>\n <span>{{ node.key }}</span>\n </button>\n }\n </mat-tree-node>\n\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" matTreeNodePadding>\n <button\n mat-icon-button\n matTreeNodeToggle\n class=\"toggle\"\n [attr.aria-label]=\"'Toggle ' + node.key\">\n <mat-icon>\n {{ treeComponent.treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\n </mat-icon>\n </button>\n <mat-icon class=\"folder-icon\">\n {{ treeComponent.treeControl.isExpanded(node) ? 'folder_open' : 'folder' }}\n </mat-icon>\n <span class=\"folder-label\">{{ node.key }}</span>\n </mat-tree-node>\n </mat-tree>\n }\n}\n", styles: [":host{display:block}.search{margin-bottom:1rem}mat-tree{background:none}:host mat-tree-node{min-height:28px;height:32px}.toggle{padding:0}.folder-icon{color:var(--lib-forms-on-surface-variant)}.folder-label{margin-left:.5rem;font-weight:500}.item{display:flex;width:100%;justify-content:left;text-align:left;font-size:small;font-weight:400;white-space:nowrap;overflow:hidden}.method{display:inline-block;width:38px;text-align:right}.line{position:absolute;height:32px;left:48px;width:1px;background:color-mix(in srgb,var(--lib-forms-outline) 40%,transparent)}.loading-container{display:flex;align-items:center;justify-content:center;height:100%;padding:2rem}\n"] }]
|
|
220
|
+
], template: "@if (loading()) {\r\n <div class=\"loading-container\">\r\n <mat-spinner diameter=\"36\"></mat-spinner>\r\n </div>\r\n} @else {\r\n <lib-search-field\r\n class=\"search\"\r\n placeholder=\"Search api\"\r\n [(value)]=\"searchKey\" />\r\n\r\n @if (error(); as err) {\r\n <lib-empty-state icon=\"error_outline\" [message]=\"err.message\" />\r\n } @else if (isEmpty()) {\r\n <lib-empty-state\r\n icon=\"search_off\"\r\n [message]=\"searchKey() ? 'No endpoints match your search' : 'No endpoints in this collection'\" />\r\n } @else {\r\n <mat-tree\r\n [dataSource]=\"treeComponent.dataSource\"\r\n [treeControl]=\"treeComponent.treeControl\">\r\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding>\r\n @if (isEndpointLoading(node.value.id)) {\r\n <mat-spinner diameter=\"22\" class=\"loading-spinner\"></mat-spinner>\r\n }\r\n @for (line of getNodeLines(node.level); track line) {\r\n <div class=\"line\" [style.left.px]=\"line * 40 + 8\"></div>\r\n }\r\n @if (node.value?.request; as request) {\r\n <button\r\n mat-button\r\n class=\"item\"\r\n [disabled]=\"(!request.body?.raw && request.method === 'POST') || !request.url?.raw\"\r\n [matTooltip]=\"request.url?.raw || 'Invalid Postman config, missing Endpoint URL'\"\r\n (click)=\"selectNode(node.value)\">\r\n <span class=\"node-key method\" [style.color]=\"methodColor(request.method)\">\r\n {{ request.method }}\r\n </span>\r\n <span>{{ node.key }}</span>\r\n </button>\r\n }\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" matTreeNodePadding>\r\n <button\r\n mat-icon-button\r\n matTreeNodeToggle\r\n class=\"toggle\"\r\n [attr.aria-label]=\"'Toggle ' + node.key\">\r\n <mat-icon>\r\n {{ treeComponent.treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\r\n </mat-icon>\r\n </button>\r\n <mat-icon class=\"folder-icon\">\r\n {{ treeComponent.treeControl.isExpanded(node) ? 'folder_open' : 'folder' }}\r\n </mat-icon>\r\n <span class=\"folder-label\">{{ node.key }}</span>\r\n </mat-tree-node>\r\n </mat-tree>\r\n }\r\n}\r\n", styles: [":host{display:block}.search{margin-bottom:1rem}mat-tree{background:none}:host mat-tree-node{min-height:28px;height:32px}.toggle{padding:0}.folder-icon{color:var(--lib-forms-on-surface-variant)}.folder-label{margin-left:.5rem;font-weight:500}.item{display:flex;width:100%;justify-content:left;text-align:left;font-size:small;font-weight:400;white-space:nowrap;overflow:hidden}.method{display:inline-block;width:38px;text-align:right}.line{position:absolute;height:32px;left:48px;width:1px;background:color-mix(in srgb,var(--lib-forms-outline) 40%,transparent)}.loading-container{display:flex;align-items:center;justify-content:center;height:100%;padding:2rem}\n"] }]
|
|
221
221
|
}], propDecorators: { postmanCollectionConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "postmanCollectionConfig", required: false }] }], loadingEndPoints: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingEndPoints", required: false }] }], nodeSelectionChanged: [{ type: i0.Output, args: ["nodeSelectionChanged"] }] } });
|
|
222
222
|
|
|
223
223
|
let nextId = 0;
|
|
@@ -253,6 +253,32 @@ function parseRawBody(raw) {
|
|
|
253
253
|
function isNonEmptyBody(body) {
|
|
254
254
|
return Object.keys(body).length > 0;
|
|
255
255
|
}
|
|
256
|
+
/**
|
|
257
|
+
* Collects the endpoint's enabled request headers from the Postman item.
|
|
258
|
+
*
|
|
259
|
+
* Postman stores headers as `[{ key, value, disabled? }]`; a `disabled` entry is
|
|
260
|
+
* one the author deliberately switched off in the collection, so it is skipped
|
|
261
|
+
* rather than carried into the form config. The result seeds the header-template
|
|
262
|
+
* editor, so the author starts from what the endpoint actually declares and only
|
|
263
|
+
* has to swap the values they want bound to live fields.
|
|
264
|
+
*
|
|
265
|
+
* @param header - `request.header` from the Postman collection.
|
|
266
|
+
* @returns The captured `name → value` map (empty when there is nothing usable).
|
|
267
|
+
*/
|
|
268
|
+
function parseRequestHeaders(header) {
|
|
269
|
+
if (!Array.isArray(header))
|
|
270
|
+
return {};
|
|
271
|
+
const captured = {};
|
|
272
|
+
for (const entry of header) {
|
|
273
|
+
if (entry?.disabled === true)
|
|
274
|
+
continue;
|
|
275
|
+
const key = typeof entry?.key === 'string' ? entry.key.trim() : '';
|
|
276
|
+
if (key === '')
|
|
277
|
+
continue;
|
|
278
|
+
captured[key] = typeof entry.value === 'string' ? entry.value : String(entry?.value ?? '');
|
|
279
|
+
}
|
|
280
|
+
return captured;
|
|
281
|
+
}
|
|
256
282
|
/** Maps a JS `typeof` string to the shared {@link JsDataTypes} enum member. */
|
|
257
283
|
function toJsDataType(value) {
|
|
258
284
|
switch (typeof value) {
|
|
@@ -366,6 +392,7 @@ class RestApiCallSetupComponent {
|
|
|
366
392
|
if (!request)
|
|
367
393
|
return;
|
|
368
394
|
const requestBody = parseRawBody(request.body?.raw);
|
|
395
|
+
const capturedHeaders = parseRequestHeaders(request.header);
|
|
369
396
|
const isPost = request.method === 'POST';
|
|
370
397
|
const minimumInputRequired = isPost
|
|
371
398
|
? this.#extractRequiredInputs(requestBody)
|
|
@@ -377,6 +404,10 @@ class RestApiCallSetupComponent {
|
|
|
377
404
|
httpMethod: request.method,
|
|
378
405
|
source: DataSources.Api,
|
|
379
406
|
postFormData: isPost,
|
|
407
|
+
// The endpoint's own headers, kept so the header-template editor opens on
|
|
408
|
+
// what the API declares. Omitted when it declared none, so the editor falls
|
|
409
|
+
// back to its skeleton rather than persisting an empty map.
|
|
410
|
+
...(Object.keys(capturedHeaders).length > 0 ? { capturedHeaders } : {}),
|
|
380
411
|
backEndConfig: {
|
|
381
412
|
minimumInputRequired,
|
|
382
413
|
// The endpoint's untouched body is the ONLY faithful record of a nested
|
|
@@ -422,7 +453,7 @@ class RestApiCallSetupComponent {
|
|
|
422
453
|
return { name, type: toJsDataType(value), primaryKey };
|
|
423
454
|
}
|
|
424
455
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: RestApiCallSetupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
425
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: RestApiCallSetupComponent, isStandalone: true, selector: "lib-rest-api-call-setup", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, postmanCollectionConfig: { classPropertyName: "postmanCollectionConfig", publicName: "postmanCollectionConfig", isSignal: true, isRequired: false, transformFunction: null }, httpGetDataFunction: { classPropertyName: "httpGetDataFunction", publicName: "httpGetDataFunction", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChanged: "valueChanged" }, host: { properties: { "id": "hostId()", "attr.data-mode": "mode()" }, classAttribute: "lib-rest-api-call-setup" }, ngImport: i0, template: "@switch (mode()) {\n @case ('no-collection') {\n <lib-empty-state\n icon=\"link_off\"\n message=\"No Postman collection configured. Add a collection id and API key to pick an endpoint.\" />\n }\n\n @case ('selected') {\n <div class=\"lib-rest-api-call-setup__card\">\n <button\n type=\"button\"\n class=\"lib-rest-api-call-setup__endpoint\"\n mat-button\n [disabled]=\"disabled()\"\n [matTooltip]=\"currentValue()?.httpEndPoint ?? ''\"\n (click)=\"clearValue()\">\n <span class=\"lib-rest-api-call-setup__method\" [style.color]=\"methodColor()\">\n {{ currentValue()?.httpMethod }}\n </span>\n <span class=\"lib-rest-api-call-setup__name\">\n {{ currentValue()?.name }}\n </span>\n <mat-icon class=\"lib-rest-api-call-setup__clear\" aria-hidden=\"true\">close</mat-icon>\n </button>\n </div>\n }\n\n @case ('picker') {\n <lib-postman-collections\n class=\"lib-rest-api-call-setup__picker\"\n [class.lib-rest-api-call-setup__picker--disabled]=\"disabled()\"\n [postmanCollectionConfig]=\"postmanCollectionConfig()!\"\n [loadingEndPoints]=\"loadingEndPoints()\"\n (nodeSelectionChanged)=\"nodeSelectionChanged($event)\" />\n }\n}\n\n@if (disabled()) {\n <p class=\"lib-rest-api-call-setup__lock\">\n <mat-icon aria-hidden=\"true\">lock</mat-icon>\n <span>This endpoint is locked and cannot be changed.</span>\n </p>\n}\n\n<lib-error-list [errors]=\"errors()\" />\n", styles: [":host{display:flex;flex-direction:column;gap:1.5rem}.lib-rest-api-call-setup__card{background:var(--lib-forms-surface);border:1px solid color-mix(in srgb,var(--lib-forms-outline) 15%,transparent);border-radius:var(--lib-forms-radius-lg, 12px);box-shadow:var(--lib-forms-shadow-resting);padding:.5rem}.lib-rest-api-call-setup__endpoint{display:flex;align-items:center;gap:.75rem;width:100%;justify-content:flex-start;padding:.5rem .75rem;font-weight:400;text-align:left;color:var(--lib-forms-on-surface);overflow:hidden}.lib-rest-api-call-setup__method{flex:0 0 auto;font-size:.625rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase}.lib-rest-api-call-setup__name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--lib-forms-on-surface)}.lib-rest-api-call-setup__clear{flex:0 0 auto;color:var(--lib-forms-on-surface-variant)}.lib-rest-api-call-setup__picker--disabled{opacity:.55;pointer-events:none}.lib-rest-api-call-setup__lock{display:flex;align-items:center;gap:.5rem;margin:0;font-size:.8125rem;line-height:1.4;color:var(--lib-forms-on-surface-variant)}\n"], dependencies: [{ kind: "component", type: PostmanCollectionsComponent, selector: "lib-postman-collections", inputs: ["postmanCollectionConfig", "loadingEndPoints"], outputs: ["nodeSelectionChanged"] }, { kind: "component", type: EmptyStateComponent, selector: "lib-empty-state", inputs: ["icon", "message"] }, { kind: "component", type: ErrorListComponent, selector: "lib-error-list", inputs: ["errors"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type:
|
|
456
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: RestApiCallSetupComponent, isStandalone: true, selector: "lib-rest-api-call-setup", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, postmanCollectionConfig: { classPropertyName: "postmanCollectionConfig", publicName: "postmanCollectionConfig", isSignal: true, isRequired: false, transformFunction: null }, httpGetDataFunction: { classPropertyName: "httpGetDataFunction", publicName: "httpGetDataFunction", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChanged: "valueChanged" }, host: { properties: { "id": "hostId()", "attr.data-mode": "mode()" }, classAttribute: "lib-rest-api-call-setup" }, ngImport: i0, template: "@switch (mode()) {\r\n @case ('no-collection') {\r\n <lib-empty-state\r\n icon=\"link_off\"\r\n message=\"No Postman collection configured. Add a collection id and API key to pick an endpoint.\" />\r\n }\r\n\r\n @case ('selected') {\r\n <div class=\"lib-rest-api-call-setup__card\">\r\n <button\r\n type=\"button\"\r\n class=\"lib-rest-api-call-setup__endpoint\"\r\n mat-button\r\n [disabled]=\"disabled()\"\r\n [matTooltip]=\"currentValue()?.httpEndPoint ?? ''\"\r\n (click)=\"clearValue()\">\r\n <span class=\"lib-rest-api-call-setup__method\" [style.color]=\"methodColor()\">\r\n {{ currentValue()?.httpMethod }}\r\n </span>\r\n <span class=\"lib-rest-api-call-setup__name\">\r\n {{ currentValue()?.name }}\r\n </span>\r\n <mat-icon class=\"lib-rest-api-call-setup__clear\" aria-hidden=\"true\">close</mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n @case ('picker') {\r\n <lib-postman-collections\r\n class=\"lib-rest-api-call-setup__picker\"\r\n [class.lib-rest-api-call-setup__picker--disabled]=\"disabled()\"\r\n [postmanCollectionConfig]=\"postmanCollectionConfig()!\"\r\n [loadingEndPoints]=\"loadingEndPoints()\"\r\n (nodeSelectionChanged)=\"nodeSelectionChanged($event)\" />\r\n }\r\n}\r\n\r\n@if (disabled()) {\r\n <p class=\"lib-rest-api-call-setup__lock\">\r\n <mat-icon aria-hidden=\"true\">lock</mat-icon>\r\n <span>This endpoint is locked and cannot be changed.</span>\r\n </p>\r\n}\r\n\r\n<lib-error-list [errors]=\"errors()\" />\r\n", styles: [":host{display:flex;flex-direction:column;gap:1.5rem}.lib-rest-api-call-setup__card{background:var(--lib-forms-surface);border:1px solid color-mix(in srgb,var(--lib-forms-outline) 15%,transparent);border-radius:var(--lib-forms-radius-lg, 12px);box-shadow:var(--lib-forms-shadow-resting);padding:.5rem}.lib-rest-api-call-setup__endpoint{display:flex;align-items:center;gap:.75rem;width:100%;justify-content:flex-start;padding:.5rem .75rem;font-weight:400;text-align:left;color:var(--lib-forms-on-surface);overflow:hidden}.lib-rest-api-call-setup__method{flex:0 0 auto;font-size:.625rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase}.lib-rest-api-call-setup__name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--lib-forms-on-surface)}.lib-rest-api-call-setup__clear{flex:0 0 auto;color:var(--lib-forms-on-surface-variant)}.lib-rest-api-call-setup__picker--disabled{opacity:.55;pointer-events:none}.lib-rest-api-call-setup__lock{display:flex;align-items:center;gap:.5rem;margin:0;font-size:.8125rem;line-height:1.4;color:var(--lib-forms-on-surface-variant)}\n"], dependencies: [{ kind: "component", type: PostmanCollectionsComponent, selector: "lib-postman-collections", inputs: ["postmanCollectionConfig", "loadingEndPoints"], outputs: ["nodeSelectionChanged"] }, { kind: "component", type: EmptyStateComponent, selector: "lib-empty-state", inputs: ["icon", "message"] }, { kind: "component", type: ErrorListComponent, selector: "lib-error-list", inputs: ["errors"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
426
457
|
}
|
|
427
458
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: RestApiCallSetupComponent, decorators: [{
|
|
428
459
|
type: Component,
|
|
@@ -437,8 +468,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
437
468
|
'class': 'lib-rest-api-call-setup',
|
|
438
469
|
'[id]': 'hostId()',
|
|
439
470
|
'[attr.data-mode]': 'mode()',
|
|
440
|
-
}, template: "@switch (mode()) {\n @case ('no-collection') {\n <lib-empty-state\n icon=\"link_off\"\n message=\"No Postman collection configured. Add a collection id and API key to pick an endpoint.\" />\n }\n\n @case ('selected') {\n <div class=\"lib-rest-api-call-setup__card\">\n <button\n type=\"button\"\n class=\"lib-rest-api-call-setup__endpoint\"\n mat-button\n [disabled]=\"disabled()\"\n [matTooltip]=\"currentValue()?.httpEndPoint ?? ''\"\n (click)=\"clearValue()\">\n <span class=\"lib-rest-api-call-setup__method\" [style.color]=\"methodColor()\">\n {{ currentValue()?.httpMethod }}\n </span>\n <span class=\"lib-rest-api-call-setup__name\">\n {{ currentValue()?.name }}\n </span>\n <mat-icon class=\"lib-rest-api-call-setup__clear\" aria-hidden=\"true\">close</mat-icon>\n </button>\n </div>\n }\n\n @case ('picker') {\n <lib-postman-collections\n class=\"lib-rest-api-call-setup__picker\"\n [class.lib-rest-api-call-setup__picker--disabled]=\"disabled()\"\n [postmanCollectionConfig]=\"postmanCollectionConfig()!\"\n [loadingEndPoints]=\"loadingEndPoints()\"\n (nodeSelectionChanged)=\"nodeSelectionChanged($event)\" />\n }\n}\n\n@if (disabled()) {\n <p class=\"lib-rest-api-call-setup__lock\">\n <mat-icon aria-hidden=\"true\">lock</mat-icon>\n <span>This endpoint is locked and cannot be changed.</span>\n </p>\n}\n\n<lib-error-list [errors]=\"errors()\" />\n", styles: [":host{display:flex;flex-direction:column;gap:1.5rem}.lib-rest-api-call-setup__card{background:var(--lib-forms-surface);border:1px solid color-mix(in srgb,var(--lib-forms-outline) 15%,transparent);border-radius:var(--lib-forms-radius-lg, 12px);box-shadow:var(--lib-forms-shadow-resting);padding:.5rem}.lib-rest-api-call-setup__endpoint{display:flex;align-items:center;gap:.75rem;width:100%;justify-content:flex-start;padding:.5rem .75rem;font-weight:400;text-align:left;color:var(--lib-forms-on-surface);overflow:hidden}.lib-rest-api-call-setup__method{flex:0 0 auto;font-size:.625rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase}.lib-rest-api-call-setup__name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--lib-forms-on-surface)}.lib-rest-api-call-setup__clear{flex:0 0 auto;color:var(--lib-forms-on-surface-variant)}.lib-rest-api-call-setup__picker--disabled{opacity:.55;pointer-events:none}.lib-rest-api-call-setup__lock{display:flex;align-items:center;gap:.5rem;margin:0;font-size:.8125rem;line-height:1.4;color:var(--lib-forms-on-surface-variant)}\n"] }]
|
|
471
|
+
}, template: "@switch (mode()) {\r\n @case ('no-collection') {\r\n <lib-empty-state\r\n icon=\"link_off\"\r\n message=\"No Postman collection configured. Add a collection id and API key to pick an endpoint.\" />\r\n }\r\n\r\n @case ('selected') {\r\n <div class=\"lib-rest-api-call-setup__card\">\r\n <button\r\n type=\"button\"\r\n class=\"lib-rest-api-call-setup__endpoint\"\r\n mat-button\r\n [disabled]=\"disabled()\"\r\n [matTooltip]=\"currentValue()?.httpEndPoint ?? ''\"\r\n (click)=\"clearValue()\">\r\n <span class=\"lib-rest-api-call-setup__method\" [style.color]=\"methodColor()\">\r\n {{ currentValue()?.httpMethod }}\r\n </span>\r\n <span class=\"lib-rest-api-call-setup__name\">\r\n {{ currentValue()?.name }}\r\n </span>\r\n <mat-icon class=\"lib-rest-api-call-setup__clear\" aria-hidden=\"true\">close</mat-icon>\r\n </button>\r\n </div>\r\n }\r\n\r\n @case ('picker') {\r\n <lib-postman-collections\r\n class=\"lib-rest-api-call-setup__picker\"\r\n [class.lib-rest-api-call-setup__picker--disabled]=\"disabled()\"\r\n [postmanCollectionConfig]=\"postmanCollectionConfig()!\"\r\n [loadingEndPoints]=\"loadingEndPoints()\"\r\n (nodeSelectionChanged)=\"nodeSelectionChanged($event)\" />\r\n }\r\n}\r\n\r\n@if (disabled()) {\r\n <p class=\"lib-rest-api-call-setup__lock\">\r\n <mat-icon aria-hidden=\"true\">lock</mat-icon>\r\n <span>This endpoint is locked and cannot be changed.</span>\r\n </p>\r\n}\r\n\r\n<lib-error-list [errors]=\"errors()\" />\r\n", styles: [":host{display:flex;flex-direction:column;gap:1.5rem}.lib-rest-api-call-setup__card{background:var(--lib-forms-surface);border:1px solid color-mix(in srgb,var(--lib-forms-outline) 15%,transparent);border-radius:var(--lib-forms-radius-lg, 12px);box-shadow:var(--lib-forms-shadow-resting);padding:.5rem}.lib-rest-api-call-setup__endpoint{display:flex;align-items:center;gap:.75rem;width:100%;justify-content:flex-start;padding:.5rem .75rem;font-weight:400;text-align:left;color:var(--lib-forms-on-surface);overflow:hidden}.lib-rest-api-call-setup__method{flex:0 0 auto;font-size:.625rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase}.lib-rest-api-call-setup__name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--lib-forms-on-surface)}.lib-rest-api-call-setup__clear{flex:0 0 auto;color:var(--lib-forms-on-surface-variant)}.lib-rest-api-call-setup__picker--disabled{opacity:.55;pointer-events:none}.lib-rest-api-call-setup__lock{display:flex;align-items:center;gap:.5rem;margin:0;font-size:.8125rem;line-height:1.4;color:var(--lib-forms-on-surface-variant)}\n"] }]
|
|
441
472
|
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], postmanCollectionConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "postmanCollectionConfig", required: false }] }], httpGetDataFunction: [{ type: i0.Input, args: [{ isSignal: true, alias: "httpGetDataFunction", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], valueChanged: [{ type: i0.Output, args: ["valueChanged"] }] } });
|
|
442
473
|
|
|
443
474
|
export { RestApiCallSetupComponent };
|
|
444
|
-
//# sourceMappingURL=ngx-t-forms-rest-api-call-setup.component-
|
|
475
|
+
//# sourceMappingURL=ngx-t-forms-rest-api-call-setup.component-Gy7Rtmue.mjs.map
|