ngx-t-forms 3.1.3 → 3.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{ngx-t-forms-api-endpoint-config.component-BAWiavFB.mjs → ngx-t-forms-api-endpoint-config.component-Bt7rWYJq.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-api-endpoint-config.component-BAWiavFB.mjs.map → ngx-t-forms-api-endpoint-config.component-Bt7rWYJq.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-Cph2QuN3.mjs → ngx-t-forms-auto-complete-input-element.component-IS266hPn.mjs} +28 -11
- package/fesm2022/ngx-t-forms-auto-complete-input-element.component-IS266hPn.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-o6l7xW3J.mjs → ngx-t-forms-basic-input-input-element.component-BLcDBM6M.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-o6l7xW3J.mjs.map → ngx-t-forms-basic-input-input-element.component-BLcDBM6M.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-CZ5c7fRi.mjs → ngx-t-forms-calculated-field-rules.component-BMheLioT.mjs} +2 -42
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-BMheLioT.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-aNd2SXIA.mjs → ngx-t-forms-chip-options-creator-editor.component-mPoQRw0c.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-aNd2SXIA.mjs.map → ngx-t-forms-chip-options-creator-editor.component-mPoQRw0c.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-conditional-display-config.component-yJ5IORsS.mjs → ngx-t-forms-conditional-display-config.component-Cw7Axzql.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-conditional-display-config.component-yJ5IORsS.mjs.map → ngx-t-forms-conditional-display-config.component-Cw7Axzql.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-B2U7LSRf.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-Cacd0Sl8.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-B2U7LSRf.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-Cacd0Sl8.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-data-source-picker.component-Bd1wm12Q.mjs → ngx-t-forms-data-source-picker.component-CwQgtKfU.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-data-source-picker.component-Bd1wm12Q.mjs.map → ngx-t-forms-data-source-picker.component-CwQgtKfU.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-BduBmu9K.mjs → ngx-t-forms-date-picker-input-element.component-OAnP4aVx.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-BduBmu9K.mjs.map → ngx-t-forms-date-picker-input-element.component-OAnP4aVx.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-date-range-picker-input-element.component-CATduVDL.mjs → ngx-t-forms-date-range-picker-input-element.component-DJVUs5xV.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-date-range-picker-input-element.component-CATduVDL.mjs.map → ngx-t-forms-date-range-picker-input-element.component-DJVUs5xV.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-date-time-picker-input-element.component-2Cq0ZEVD.mjs +232 -0
- package/fesm2022/ngx-t-forms-date-time-picker-input-element.component-2Cq0ZEVD.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-BU0QJYNH.mjs → ngx-t-forms-document-list-label-config-editor.component-CZ-XFrjM.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-BU0QJYNH.mjs.map → ngx-t-forms-document-list-label-config-editor.component-CZ-XFrjM.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-document-picker.component-3mqXc4s6.mjs → ngx-t-forms-document-picker.component-qzqg4O0I.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-document-picker.component-3mqXc4s6.mjs.map → ngx-t-forms-document-picker.component-qzqg4O0I.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-editor-input-element.component-D_SjJtw9.mjs → ngx-t-forms-editor-input-element.component-hf5qe7sH.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-editor-input-element.component-D_SjJtw9.mjs.map → ngx-t-forms-editor-input-element.component-hf5qe7sH.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-DZuAYjpr.mjs → ngx-t-forms-file-upload-input-element.component-s1pe3gKq.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-DZuAYjpr.mjs.map → ngx-t-forms-file-upload-input-element.component-s1pe3gKq.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-input-selector.component-B6FoYGy5.mjs → ngx-t-forms-form-input-selector.component-T3yqbRnV.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-input-selector.component-B6FoYGy5.mjs.map → ngx-t-forms-form-input-selector.component-T3yqbRnV.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-json-view.component-DsEizrc-.mjs → ngx-t-forms-form-json-view.component-D5AXKbXq.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-json-view.component-DsEizrc-.mjs.map → ngx-t-forms-form-json-view.component-D5AXKbXq.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-ZJDWyxa7.mjs → ngx-t-forms-form-section-stepper.component-5p9gBgjj.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-ZJDWyxa7.mjs.map → ngx-t-forms-form-section-stepper.component-5p9gBgjj.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-oVpP2Jgt.mjs → ngx-t-forms-forms-builder-menu.component-DH4-vxBX.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-oVpP2Jgt.mjs.map → ngx-t-forms-forms-builder-menu.component-DH4-vxBX.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-geo-location.component-Cml0Do4m.mjs → ngx-t-forms-geo-location.component-CaW4y8X1.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-geo-location.component-Cml0Do4m.mjs.map → ngx-t-forms-geo-location.component-CaW4y8X1.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-header-template-editor.component-NRiXTnwH.mjs → ngx-t-forms-header-template-editor.component-D9lka3Y5.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-header-template-editor.component-NRiXTnwH.mjs.map → ngx-t-forms-header-template-editor.component-D9lka3Y5.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-IFval472.mjs → ngx-t-forms-image-capture-input-element.component-Dt50q6pH.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-IFval472.mjs.map → ngx-t-forms-image-capture-input-element.component-Dt50q6pH.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-index-CJwmJP3u.mjs +2 -0
- package/fesm2022/ngx-t-forms-index-CJwmJP3u.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-input-custom.component-45DTVv-R.mjs +309 -0
- package/fesm2022/ngx-t-forms-input-custom.component-45DTVv-R.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-input-editor.component-zL4cp2gq.mjs → ngx-t-forms-input-editor.component-DNg-p_Wl.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-input-editor.component-zL4cp2gq.mjs.map → ngx-t-forms-input-editor.component-DNg-p_Wl.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-0tNskyLE.mjs → ngx-t-forms-map-mat-options-keys-DvrLH9wd.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-0tNskyLE.mjs.map → ngx-t-forms-map-mat-options-keys-DvrLH9wd.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-CGMhUIuc.mjs → ngx-t-forms-mat-chip-list-editor.component-1YdhWOqQ.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-CGMhUIuc.mjs.map → ngx-t-forms-mat-chip-list-editor.component-1YdhWOqQ.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-BXiXHKG_.mjs → ngx-t-forms-missing-form-configs.component-P8CDm5nZ.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-BXiXHKG_.mjs.map → ngx-t-forms-missing-form-configs.component-P8CDm5nZ.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-BVtVrTn1.mjs → ngx-t-forms-mscoa-chart-toolbar.component-Cj1zfMAW.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-BVtVrTn1.mjs.map → ngx-t-forms-mscoa-chart-toolbar.component-Cj1zfMAW.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-config.component-CmIR92zj.mjs → ngx-t-forms-mscoa-config.component-CyG4Lafw.mjs} +61 -12
- package/fesm2022/ngx-t-forms-mscoa-config.component-CyG4Lafw.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-CVTRW43v.mjs → ngx-t-forms-mscoa-segment-config.component-BcAgMwcV.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-CVTRW43v.mjs.map → ngx-t-forms-mscoa-segment-config.component-BcAgMwcV.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-multiple-input-input-element.component-CUgTJJRW.mjs → ngx-t-forms-multiple-input-input-element.component-DN25FtGd.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-multiple-input-input-element.component-CUgTJJRW.mjs.map → ngx-t-forms-multiple-input-input-element.component-DN25FtGd.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-ngx-t-forms-BA1CoCl_.mjs → ngx-t-forms-ngx-t-forms-D_PCGH-i.mjs} +9971 -120
- package/fesm2022/ngx-t-forms-ngx-t-forms-D_PCGH-i.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-paginated-selection-table-CdEJa3FZ.mjs → ngx-t-forms-paginated-selection-table-B62XtkB5.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-paginated-selection-table-CdEJa3FZ.mjs.map → ngx-t-forms-paginated-selection-table-B62XtkB5.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-payload-template-editor.component-CZoqYRKK.mjs → ngx-t-forms-payload-template-editor.component-CY7BRHuw.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-payload-template-editor.component-CZoqYRKK.mjs.map → ngx-t-forms-payload-template-editor.component-CY7BRHuw.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-LbAmKWNG.mjs → ngx-t-forms-pipeline-generator.component-I2K-Csz3.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-LbAmKWNG.mjs.map → ngx-t-forms-pipeline-generator.component-I2K-Csz3.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-quill-input.component-CKYNVDDV.mjs → ngx-t-forms-quill-input.component-BrOSKvq1.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-quill-input.component-CKYNVDDV.mjs.map → ngx-t-forms-quill-input.component-BrOSKvq1.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-record-list-manager.component-BNdEvWsZ.mjs → ngx-t-forms-record-list-manager.component-BEeTQy5N.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-record-list-manager.component-BNdEvWsZ.mjs.map → ngx-t-forms-record-list-manager.component-BEeTQy5N.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-required-inputs.component-D_cQIScV.mjs → ngx-t-forms-required-inputs.component-BUUrpNR0.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-required-inputs.component-D_cQIScV.mjs.map → ngx-t-forms-required-inputs.component-BUUrpNR0.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-BhQmOVHN.mjs → ngx-t-forms-rest-api-call-setup.component-CJyrmfYU.mjs} +197 -175
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-CJyrmfYU.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-section-report.component-m2Z6qA3j.mjs → ngx-t-forms-section-report.component-Dxecd1uL.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-section-report.component-m2Z6qA3j.mjs.map → ngx-t-forms-section-report.component-Dxecd1uL.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-select-input-element.component-DH5knOzd.mjs → ngx-t-forms-select-input-element.component-DPMSwCHF.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-select-input-element.component-DH5knOzd.mjs.map → ngx-t-forms-select-input-element.component-DPMSwCHF.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-UBt2kiPk.mjs → ngx-t-forms-selection-options-editor.component-i0c0M02r.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-UBt2kiPk.mjs.map → ngx-t-forms-selection-options-editor.component-i0c0M02r.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-B9JLzhTh.mjs → ngx-t-forms-textarea-input-element.component-CZ5Zlcdy.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-B9JLzhTh.mjs.map → ngx-t-forms-textarea-input-element.component-CZ5Zlcdy.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-B9_03RoG.mjs → ngx-t-forms-toggle-input-element.component-Cbnjjcv4.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-B9_03RoG.mjs.map → ngx-t-forms-toggle-input-element.component-Cbnjjcv4.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-token-text-input.component-BQADsnFn.mjs → ngx-t-forms-token-text-input.component-B0_C_BSx.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-token-text-input.component-BQADsnFn.mjs.map → ngx-t-forms-token-text-input.component-B0_C_BSx.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-validators-config.component-qO6Y4x1v.mjs → ngx-t-forms-validators-config.component-BvCwOCgs.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-validators-config.component-qO6Y4x1v.mjs.map → ngx-t-forms-validators-config.component-BvCwOCgs.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-workflow-adjudication.component-SUbSx79R.mjs → ngx-t-forms-workflow-adjudication.component-DzE8_xCE.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-workflow-adjudication.component-SUbSx79R.mjs.map → ngx-t-forms-workflow-adjudication.component-DzE8_xCE.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms.mjs +1 -1
- package/package.json +3 -3
- package/types/ngx-t-forms.d.ts +1754 -5
- package/fesm2022/ngx-t-forms-auto-complete-input-element.component-Cph2QuN3.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-CZ5c7fRi.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-index-Cl4VG3Vd.mjs +0 -2
- package/fesm2022/ngx-t-forms-index-Cl4VG3Vd.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-input-custom.component-q8jPq7KI.mjs +0 -105
- package/fesm2022/ngx-t-forms-input-custom.component-q8jPq7KI.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-config.component-CmIR92zj.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-BA1CoCl_.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-BhQmOVHN.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-t-forms-required-inputs.component-D_cQIScV.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,uBAA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AAA,EAAA,QAAA,EAAA,mBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACb,eAAe,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,QAAA,EAAA,2BAAA,EAAA,MAAA,EAAA,CAAA,gBAAA,EAAA,oBAAA,EAAA,mBAAA,EAAA,iBAAA,EAAA,oBAAA,EAAA,mBAAA,EAAA,kBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACf,eAAe,gtBACf,mBAAmB,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAWV,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAtBnC,SAAS;AACE,YAAA,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
|
+
{"version":3,"file":"ngx-t-forms-required-inputs.component-BUUrpNR0.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,u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A,eAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACb,eAAe,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,QAAA,EAAA,2BAAA,EAAA,MAAA,EAAA,CAAA,gBAAA,EAAA,oBAAA,EAAA,mBAAA,EAAA,iBAAA,EAAA,oBAAA,EAAA,mBAAA,EAAA,kBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACf,eAAe,gtBACf,mBAAmB,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAWV,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAtBnC,SAAS;AACE,YAAA,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
|
+
import { m as deriveDefaultPayloadTemplate, n as collectHeaderTemplateInputIds, o as collectQueryTemplateInputIds, q as collectTemplateInputIds, u as collectMinInputDepIds, v as resolveHeaderTemplate, w as resolveQueryTemplate, x as resolvePayloadTemplate, y as returnMappedData, z as mergeQueryOptions, C as mergeHeaderOptions, G as PostmanCollectionLoaderService, H as TreeComponent, I as convertPostmanFolderItemsToTree, _ as _isEqual, E as EmptyStateComponent, l as ErrorListComponent } from './ngx-t-forms-ngx-t-forms-D_PCGH-i.mjs';
|
|
3
4
|
import { JsDataTypes, DataSources } from 'ngx-t-forms-types';
|
|
4
|
-
import { l as deriveDefaultPayloadTemplate, m as collectHeaderTemplateInputIds, n as collectQueryTemplateInputIds, o as collectTemplateInputIds, q as collectMinInputDepIds, u as resolveHeaderTemplate, v as resolveQueryTemplate, w as resolvePayloadTemplate, x as returnMappedData, y as mergeQueryOptions, z as mergeHeaderOptions, C as PostmanCollectionLoaderService, G as TreeComponent, H as convertPostmanFolderItemsToTree, _ as _isEqual, E as EmptyStateComponent, k as ErrorListComponent } from './ngx-t-forms-ngx-t-forms-BA1CoCl_.mjs';
|
|
5
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { HttpErrorResponse } from '@angular/common/http';
|
|
7
7
|
import { take, tap, catchError, throwError } from 'rxjs';
|
|
@@ -17,6 +17,199 @@ import * as i5 from '@angular/material/tooltip';
|
|
|
17
17
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
18
18
|
import { S as SearchFieldComponent } from './ngx-t-forms-search-field.component-mR4Kk12C.mjs';
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* @file Maps a Postman collection item to a stored
|
|
22
|
+
* `APIDataFetchingConfigurationInterface`.
|
|
23
|
+
*
|
|
24
|
+
* Extracted from `rest-api-call-setup.component.ts`, where it was the whole of
|
|
25
|
+
* `nodeSelectionChanged` plus six module-local helpers and two private methods.
|
|
26
|
+
* Nothing outside that component could produce the configuration a human
|
|
27
|
+
* produces by picking an endpoint, which made every other caller either
|
|
28
|
+
* duplicate the mapping — guaranteed to drift from the editor — or hand-author
|
|
29
|
+
* configs. The AI form-builder's endpoint catalog is the caller that forced the
|
|
30
|
+
* issue: it needs complete stored configurations, and the library already
|
|
31
|
+
* fetches the collection they would come from.
|
|
32
|
+
*
|
|
33
|
+
* Pure by construction: no Angular, no injection, no I/O, no component state.
|
|
34
|
+
* The component keeps ownership of what to DO with the result (set its local
|
|
35
|
+
* value, emit it); this module only decides what the result is.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* Parses a Postman raw request body into a plain object.
|
|
39
|
+
*
|
|
40
|
+
* Returns `{}` for an absent, blank or non-JSON body (a `graphql` / `formdata`
|
|
41
|
+
* mode, or raw text with comments). Nesting and key names are preserved exactly
|
|
42
|
+
* as authored — this is the document template mode seeds from.
|
|
43
|
+
*
|
|
44
|
+
* @param raw - `request.body.raw` from the Postman collection.
|
|
45
|
+
* @returns The parsed body, or `{}` when there is nothing usable.
|
|
46
|
+
*/
|
|
47
|
+
function parseRawBody(raw) {
|
|
48
|
+
if (typeof raw !== 'string' || raw.trim() === '')
|
|
49
|
+
return {};
|
|
50
|
+
try {
|
|
51
|
+
const parsed = JSON.parse(raw);
|
|
52
|
+
return parsed !== null && typeof parsed === 'object' ? parsed : {};
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return {};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/** True when a parsed body carries at least one key — i.e. it is worth persisting. */
|
|
59
|
+
function isNonEmptyBody(body) {
|
|
60
|
+
return Object.keys(body).length > 0;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Collects the enabled entries of a Postman `[{ key, value, disabled? }]` list.
|
|
64
|
+
*
|
|
65
|
+
* A `disabled` entry is one the author deliberately switched off in the
|
|
66
|
+
* collection, so it is skipped rather than carried into the form config —
|
|
67
|
+
* mirroring what Postman itself would send.
|
|
68
|
+
*
|
|
69
|
+
* Headers and URL query params have the identical shape and the identical rule,
|
|
70
|
+
* so they share one implementation here; they were two copies of the same loop
|
|
71
|
+
* in the component.
|
|
72
|
+
*
|
|
73
|
+
* @param entries - `request.header` or `request.url.query`.
|
|
74
|
+
* @returns The captured `name → value` map (empty when there is nothing usable).
|
|
75
|
+
*/
|
|
76
|
+
function parseKeyValueList(entries) {
|
|
77
|
+
if (!Array.isArray(entries))
|
|
78
|
+
return {};
|
|
79
|
+
const captured = {};
|
|
80
|
+
for (const entry of entries) {
|
|
81
|
+
if (entry?.disabled === true)
|
|
82
|
+
continue;
|
|
83
|
+
const key = typeof entry?.key === 'string' ? entry.key.trim() : '';
|
|
84
|
+
if (key === '')
|
|
85
|
+
continue;
|
|
86
|
+
captured[key] = typeof entry.value === 'string' ? entry.value : String(entry?.value ?? '');
|
|
87
|
+
}
|
|
88
|
+
return captured;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Strips the query string from a captured endpoint URL — but ONLY when the
|
|
92
|
+
* query was captured structurally (so nothing is lost): once the params live in
|
|
93
|
+
* `capturedQuery`/`queryTemplate`, leaving them in the URL as text would send
|
|
94
|
+
* every param twice. A URL whose `?…` had no structured `url.query` entries is
|
|
95
|
+
* left verbatim — the text is then the only record of it.
|
|
96
|
+
*
|
|
97
|
+
* @param raw - `request.url.raw` from the Postman collection.
|
|
98
|
+
* @param capturedQuery - What {@link parseKeyValueList} extracted from the query.
|
|
99
|
+
* @returns The URL to persist as `httpEndPoint`.
|
|
100
|
+
*/
|
|
101
|
+
function stripCapturedQueryString(raw, capturedQuery) {
|
|
102
|
+
if (Object.keys(capturedQuery).length === 0)
|
|
103
|
+
return raw;
|
|
104
|
+
const cut = raw.indexOf('?');
|
|
105
|
+
return cut === -1 ? raw : raw.slice(0, cut);
|
|
106
|
+
}
|
|
107
|
+
/** Maps a JS `typeof` string to the shared {@link JsDataTypes} enum member. */
|
|
108
|
+
function toJsDataType(value) {
|
|
109
|
+
switch (typeof value) {
|
|
110
|
+
case 'string':
|
|
111
|
+
return JsDataTypes.String;
|
|
112
|
+
case 'number':
|
|
113
|
+
return JsDataTypes.Number;
|
|
114
|
+
case 'bigint':
|
|
115
|
+
return JsDataTypes.BigInt;
|
|
116
|
+
case 'boolean':
|
|
117
|
+
return JsDataTypes.Boolean;
|
|
118
|
+
case 'symbol':
|
|
119
|
+
return JsDataTypes.Symbol;
|
|
120
|
+
case 'function':
|
|
121
|
+
return JsDataTypes.Function;
|
|
122
|
+
case 'object':
|
|
123
|
+
return JsDataTypes.Object;
|
|
124
|
+
default:
|
|
125
|
+
return JsDataTypes.Undefined;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/** One `minimumInputRequired` entry. */
|
|
129
|
+
function toRequiredInput(name, value, primaryKey) {
|
|
130
|
+
return { name, type: toJsDataType(value), primaryKey };
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Derives the body-bearing endpoint's required inputs from its request body.
|
|
134
|
+
* Top-level keys are primary; entries under `data` are secondary (non-primary).
|
|
135
|
+
*
|
|
136
|
+
* **Deliberately flat.** `MinimumInputRequiredInterface` has a `name`, not a
|
|
137
|
+
* path, so a nested value can only ever become one `JsDataTypes.Object` entry —
|
|
138
|
+
* mapping `filter.archive` is not expressible here. That is what template mode
|
|
139
|
+
* is for, and why the untouched `requestBody` is captured alongside this: it is
|
|
140
|
+
* the only faithful record of a nested payload.
|
|
141
|
+
*/
|
|
142
|
+
function extractRequiredInputs(requestBody) {
|
|
143
|
+
const { data, ...rest } = requestBody;
|
|
144
|
+
const dataEntries = data && typeof data === 'object' ? { ...data } : {};
|
|
145
|
+
const primaryKeys = Object.entries(rest).map(([key, val]) => toRequiredInput(key, val, true));
|
|
146
|
+
const secondaryKeys = Object.entries(dataEntries).map(([key, val]) => toRequiredInput(key, val, false));
|
|
147
|
+
return [...primaryKeys, ...secondaryKeys];
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* @public
|
|
151
|
+
*
|
|
152
|
+
* Builds the stored fetch configuration for one Postman collection item.
|
|
153
|
+
*
|
|
154
|
+
* @param node - A node from the collection tree. A FOLDER node — the only other
|
|
155
|
+
* thing the picker can emit — has no `request`, so that check alone is the
|
|
156
|
+
* correct guard, and it is why this returns `undefined` rather than a partial
|
|
157
|
+
* configuration: a half-built config persisted as if it were real is the
|
|
158
|
+
* failure this whole mapping exists to avoid.
|
|
159
|
+
* @returns The configuration to persist, or `undefined` when the node carries
|
|
160
|
+
* no request.
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* const config = postmanItemToFetchConfig(node);
|
|
164
|
+
* if (config) this.valueChanged.emit(config);
|
|
165
|
+
*/
|
|
166
|
+
function postmanItemToFetchConfig(node) {
|
|
167
|
+
const { id, name, request } = node;
|
|
168
|
+
if (!request)
|
|
169
|
+
return undefined;
|
|
170
|
+
const requestBody = parseRawBody(request.body?.raw);
|
|
171
|
+
const capturedHeaders = parseKeyValueList(request.header);
|
|
172
|
+
const capturedQuery = parseKeyValueList(request.url.query);
|
|
173
|
+
// PUT is body-bearing exactly like POST (it rides the POST branch family at
|
|
174
|
+
// runtime), so it seeds the same required-input mapping.
|
|
175
|
+
const sendsBody = request.method === 'POST' || request.method === 'PUT';
|
|
176
|
+
const minimumInputRequired = sendsBody
|
|
177
|
+
? extractRequiredInputs(requestBody)
|
|
178
|
+
: [];
|
|
179
|
+
return {
|
|
180
|
+
_id: id,
|
|
181
|
+
name,
|
|
182
|
+
// Structurally-captured query params are stripped from the URL text so a
|
|
183
|
+
// param never rides twice (once as literal text, once via queryTemplate).
|
|
184
|
+
httpEndPoint: stripCapturedQueryString(request.url.raw, capturedQuery),
|
|
185
|
+
httpMethod: request.method,
|
|
186
|
+
source: DataSources.Api,
|
|
187
|
+
postFormData: sendsBody,
|
|
188
|
+
// The endpoint's own headers, kept so the header-template editor opens on
|
|
189
|
+
// what the API declares. Omitted when it declared none, so the editor falls
|
|
190
|
+
// back to its skeleton rather than persisting an empty map.
|
|
191
|
+
...(Object.keys(capturedHeaders).length > 0 ? { capturedHeaders } : {}),
|
|
192
|
+
// Same contract for the URL's own query params → the query-template editor.
|
|
193
|
+
...(Object.keys(capturedQuery).length > 0 ? { capturedQuery } : {}),
|
|
194
|
+
// The endpoint's Postman documentation, verbatim → the Docs tab.
|
|
195
|
+
...(request.description?.trim() ? { capturedDocs: request.description } : {}),
|
|
196
|
+
backEndConfig: {
|
|
197
|
+
minimumInputRequired,
|
|
198
|
+
// The endpoint's untouched body is the ONLY faithful record of a nested
|
|
199
|
+
// payload (`minimumInputRequired` entries carry a `name`, not a path), so
|
|
200
|
+
// it is what seeds template mode. Captured for every method that actually
|
|
201
|
+
// sends one — keyed on the body being present, not on `method === 'POST'`,
|
|
202
|
+
// because PUT/PATCH bodies are equally real. Omitted entirely when there
|
|
203
|
+
// is nothing to store, so `deriveDefaultPayloadTemplate` falls back cleanly.
|
|
204
|
+
...(isNonEmptyBody(requestBody)
|
|
205
|
+
? {
|
|
206
|
+
requestBody: requestBody,
|
|
207
|
+
}
|
|
208
|
+
: {}),
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
20
213
|
/** CSS-variable colour per HTTP method (dark-mode-safe; never a hex literal). */
|
|
21
214
|
const METHOD_COLOR = {
|
|
22
215
|
GET: 'var(--lib-forms-method-get)',
|
|
@@ -545,118 +738,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
545
738
|
}], 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"] }] } });
|
|
546
739
|
|
|
547
740
|
let nextId = 0;
|
|
548
|
-
/**
|
|
549
|
-
* Parses a Postman raw request body into a plain object.
|
|
550
|
-
*
|
|
551
|
-
* Returns `{}` for an absent, blank or non-JSON body (a `graphql` / `formdata`
|
|
552
|
-
* mode, or raw text with comments). Nesting and key names are preserved exactly as
|
|
553
|
-
* authored — this is the document template mode seeds from.
|
|
554
|
-
*
|
|
555
|
-
* @param raw - `request.body.raw` from the Postman collection.
|
|
556
|
-
* @returns The parsed body, or `{}` when there is nothing usable.
|
|
557
|
-
*/
|
|
558
|
-
function parseRawBody(raw) {
|
|
559
|
-
if (typeof raw !== 'string' || raw.trim() === '')
|
|
560
|
-
return {};
|
|
561
|
-
try {
|
|
562
|
-
const parsed = JSON.parse(raw);
|
|
563
|
-
return parsed !== null && typeof parsed === 'object' ? parsed : {};
|
|
564
|
-
}
|
|
565
|
-
catch {
|
|
566
|
-
return {};
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
/** True when a parsed body carries at least one key — i.e. it is worth persisting. */
|
|
570
|
-
function isNonEmptyBody(body) {
|
|
571
|
-
return Object.keys(body).length > 0;
|
|
572
|
-
}
|
|
573
|
-
/**
|
|
574
|
-
* Collects the endpoint's enabled request headers from the Postman item.
|
|
575
|
-
*
|
|
576
|
-
* Postman stores headers as `[{ key, value, disabled? }]`; a `disabled` entry is
|
|
577
|
-
* one the author deliberately switched off in the collection, so it is skipped
|
|
578
|
-
* rather than carried into the form config. The result seeds the header-template
|
|
579
|
-
* editor, so the author starts from what the endpoint actually declares and only
|
|
580
|
-
* has to swap the values they want bound to live fields.
|
|
581
|
-
*
|
|
582
|
-
* @param header - `request.header` from the Postman collection.
|
|
583
|
-
* @returns The captured `name → value` map (empty when there is nothing usable).
|
|
584
|
-
*/
|
|
585
|
-
function parseRequestHeaders(header) {
|
|
586
|
-
if (!Array.isArray(header))
|
|
587
|
-
return {};
|
|
588
|
-
const captured = {};
|
|
589
|
-
for (const entry of header) {
|
|
590
|
-
if (entry?.disabled === true)
|
|
591
|
-
continue;
|
|
592
|
-
const key = typeof entry?.key === 'string' ? entry.key.trim() : '';
|
|
593
|
-
if (key === '')
|
|
594
|
-
continue;
|
|
595
|
-
captured[key] = typeof entry.value === 'string' ? entry.value : String(entry?.value ?? '');
|
|
596
|
-
}
|
|
597
|
-
return captured;
|
|
598
|
-
}
|
|
599
|
-
/**
|
|
600
|
-
* Collects the endpoint's enabled URL query params from the Postman item —
|
|
601
|
-
* the exact twin of {@link parseRequestHeaders} for `request.url.query`.
|
|
602
|
-
* Unticked (`disabled: true`) entries are excluded, mirroring what Postman
|
|
603
|
-
* itself would send. Seeds `capturedQuery`, never sent on its own.
|
|
604
|
-
*
|
|
605
|
-
* @param query - `request.url.query` from the Postman collection.
|
|
606
|
-
* @returns The captured `name → value` map (empty when there is nothing usable).
|
|
607
|
-
*/
|
|
608
|
-
function parseRequestQuery(query) {
|
|
609
|
-
if (!Array.isArray(query))
|
|
610
|
-
return {};
|
|
611
|
-
const captured = {};
|
|
612
|
-
for (const entry of query) {
|
|
613
|
-
if (entry?.disabled === true)
|
|
614
|
-
continue;
|
|
615
|
-
const key = typeof entry?.key === 'string' ? entry.key.trim() : '';
|
|
616
|
-
if (key === '')
|
|
617
|
-
continue;
|
|
618
|
-
captured[key] = typeof entry.value === 'string' ? entry.value : String(entry?.value ?? '');
|
|
619
|
-
}
|
|
620
|
-
return captured;
|
|
621
|
-
}
|
|
622
|
-
/**
|
|
623
|
-
* Strips the query string from a captured endpoint URL — but ONLY when the
|
|
624
|
-
* query was captured structurally (so nothing is lost): once the params live in
|
|
625
|
-
* `capturedQuery`/`queryTemplate`, leaving them in the URL as text would send
|
|
626
|
-
* every param twice. A URL whose `?…` had no structured `url.query` entries is
|
|
627
|
-
* left verbatim — the text is then the only record of it.
|
|
628
|
-
*
|
|
629
|
-
* @param raw - `request.url.raw` from the Postman collection.
|
|
630
|
-
* @param capturedQuery - What {@link parseRequestQuery} extracted.
|
|
631
|
-
* @returns The URL to persist as `httpEndPoint`.
|
|
632
|
-
*/
|
|
633
|
-
function stripCapturedQueryString(raw, capturedQuery) {
|
|
634
|
-
if (Object.keys(capturedQuery).length === 0)
|
|
635
|
-
return raw;
|
|
636
|
-
const cut = raw.indexOf('?');
|
|
637
|
-
return cut === -1 ? raw : raw.slice(0, cut);
|
|
638
|
-
}
|
|
639
|
-
/** Maps a JS `typeof` string to the shared {@link JsDataTypes} enum member. */
|
|
640
|
-
function toJsDataType(value) {
|
|
641
|
-
switch (typeof value) {
|
|
642
|
-
case 'string':
|
|
643
|
-
return JsDataTypes.String;
|
|
644
|
-
case 'number':
|
|
645
|
-
return JsDataTypes.Number;
|
|
646
|
-
case 'bigint':
|
|
647
|
-
return JsDataTypes.BigInt;
|
|
648
|
-
case 'boolean':
|
|
649
|
-
return JsDataTypes.Boolean;
|
|
650
|
-
case 'symbol':
|
|
651
|
-
return JsDataTypes.Symbol;
|
|
652
|
-
case 'function':
|
|
653
|
-
return JsDataTypes.Function;
|
|
654
|
-
case 'object':
|
|
655
|
-
return JsDataTypes.Object;
|
|
656
|
-
default:
|
|
657
|
-
return JsDataTypes.Undefined;
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
741
|
/**
|
|
661
742
|
* Lets the user pick an API endpoint from a Postman collection and exposes the
|
|
662
743
|
* resulting {@link APIDataFetchingConfigurationInterface}. Renders one of three
|
|
@@ -745,48 +826,9 @@ class RestApiCallSetupComponent {
|
|
|
745
826
|
* is the correct guard.
|
|
746
827
|
*/
|
|
747
828
|
nodeSelectionChanged(node) {
|
|
748
|
-
const
|
|
749
|
-
if (!
|
|
829
|
+
const config = postmanItemToFetchConfig(node);
|
|
830
|
+
if (!config)
|
|
750
831
|
return;
|
|
751
|
-
const requestBody = parseRawBody(request.body?.raw);
|
|
752
|
-
const capturedHeaders = parseRequestHeaders(request.header);
|
|
753
|
-
const capturedQuery = parseRequestQuery(request.url.query);
|
|
754
|
-
// PUT is body-bearing exactly like POST (it rides the POST branch family
|
|
755
|
-
// at runtime), so it seeds the same required-input mapping.
|
|
756
|
-
const sendsBody = request.method === 'POST' || request.method === 'PUT';
|
|
757
|
-
const minimumInputRequired = sendsBody
|
|
758
|
-
? this.#extractRequiredInputs(requestBody)
|
|
759
|
-
: [];
|
|
760
|
-
const config = {
|
|
761
|
-
_id: id,
|
|
762
|
-
name,
|
|
763
|
-
// Structurally-captured query params are stripped from the URL text so a
|
|
764
|
-
// param never rides twice (once as literal text, once via queryTemplate).
|
|
765
|
-
httpEndPoint: stripCapturedQueryString(request.url.raw, capturedQuery),
|
|
766
|
-
httpMethod: request.method,
|
|
767
|
-
source: DataSources.Api,
|
|
768
|
-
postFormData: sendsBody,
|
|
769
|
-
// The endpoint's own headers, kept so the header-template editor opens on
|
|
770
|
-
// what the API declares. Omitted when it declared none, so the editor falls
|
|
771
|
-
// back to its skeleton rather than persisting an empty map.
|
|
772
|
-
...(Object.keys(capturedHeaders).length > 0 ? { capturedHeaders } : {}),
|
|
773
|
-
// Same contract for the URL's own query params → the query-template editor.
|
|
774
|
-
...(Object.keys(capturedQuery).length > 0 ? { capturedQuery } : {}),
|
|
775
|
-
// The endpoint's Postman documentation, verbatim → the Docs tab.
|
|
776
|
-
...(request.description?.trim() ? { capturedDocs: request.description } : {}),
|
|
777
|
-
backEndConfig: {
|
|
778
|
-
minimumInputRequired,
|
|
779
|
-
// The endpoint's untouched body is the ONLY faithful record of a nested
|
|
780
|
-
// payload (`minimumInputRequired` entries carry a `name`, not a path), so it
|
|
781
|
-
// is what seeds template mode. Captured for every method that actually sends
|
|
782
|
-
// one — keyed on the body being present, not on `method === 'POST'`, because
|
|
783
|
-
// PUT/PATCH bodies are equally real. Omitted entirely when there is nothing
|
|
784
|
-
// to store, so `deriveDefaultPayloadTemplate` falls back cleanly.
|
|
785
|
-
...(isNonEmptyBody(requestBody)
|
|
786
|
-
? { requestBody: requestBody }
|
|
787
|
-
: {}),
|
|
788
|
-
},
|
|
789
|
-
};
|
|
790
832
|
this.#localValue.set(config);
|
|
791
833
|
this.valueChanged.emit(config);
|
|
792
834
|
}
|
|
@@ -798,26 +840,6 @@ class RestApiCallSetupComponent {
|
|
|
798
840
|
this.#localValue.set(undefined);
|
|
799
841
|
this.valueChanged.emit(undefined);
|
|
800
842
|
}
|
|
801
|
-
/**
|
|
802
|
-
* Derives the POST endpoint's required inputs from the request body. Top-level
|
|
803
|
-
* keys are primary; entries under `data` are secondary (non-primary).
|
|
804
|
-
*
|
|
805
|
-
* **Deliberately flat.** `MinimumInputRequiredInterface` has a `name`, not a path,
|
|
806
|
-
* so a nested value can only ever become one `JsDataTypes.Object` entry — mapping
|
|
807
|
-
* `filter.archive` is not expressible here. That is what template mode is for, and
|
|
808
|
-
* why the untouched `requestBody` is captured alongside this (see the caller): it is
|
|
809
|
-
* the only faithful record of a nested payload.
|
|
810
|
-
*/
|
|
811
|
-
#extractRequiredInputs(requestBody) {
|
|
812
|
-
const { data, ...rest } = requestBody;
|
|
813
|
-
const dataEntries = data && typeof data === 'object' ? { ...data } : {};
|
|
814
|
-
const primaryKeys = Object.entries(rest).map(([key, val]) => this.#toRequiredInput(key, val, true));
|
|
815
|
-
const secondaryKeys = Object.entries(dataEntries).map(([key, val]) => this.#toRequiredInput(key, val, false));
|
|
816
|
-
return [...primaryKeys, ...secondaryKeys];
|
|
817
|
-
}
|
|
818
|
-
#toRequiredInput(name, value, primaryKey) {
|
|
819
|
-
return { name, type: toJsDataType(value), primaryKey };
|
|
820
|
-
}
|
|
821
843
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: RestApiCallSetupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
822
844
|
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 }); }
|
|
823
845
|
}
|
|
@@ -843,4 +865,4 @@ var restApiCallSetup_component = /*#__PURE__*/Object.freeze({
|
|
|
843
865
|
});
|
|
844
866
|
|
|
845
867
|
export { RestApiCallSetupComponent as R, payloadDefaultOf as a, bodyModeOf as b, minInputsOf as c, docsHtmlOf as d, deriveConfiguredRequest as e, dependencyLabels as f, restApiCallSetup_component as g, headerCountOf as h, methodColorOf as m, paramCountOf as p, readinessOf as r, sendsBody as s, waitsForLabels as w };
|
|
846
|
-
//# sourceMappingURL=ngx-t-forms-rest-api-call-setup.component-
|
|
868
|
+
//# sourceMappingURL=ngx-t-forms-rest-api-call-setup.component-CJyrmfYU.mjs.map
|