ngx-t-forms 3.0.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ngx-t-forms-api-endpoint-config.component-CZm3Z_7B.mjs +411 -0
- package/fesm2022/ngx-t-forms-api-endpoint-config.component-CZm3Z_7B.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-DFApar1W.mjs → ngx-t-forms-auto-complete-input-element.component-IciY6hb3.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-DFApar1W.mjs.map → ngx-t-forms-auto-complete-input-element.component-IciY6hb3.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-ChCeve-w.mjs → ngx-t-forms-basic-input-input-element.component-CykKxWu0.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-ChCeve-w.mjs.map → ngx-t-forms-basic-input-input-element.component-CykKxWu0.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-CwI-WEX7.mjs +643 -0
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-CwI-WEX7.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-B54kOArR.mjs → ngx-t-forms-chip-options-creator-editor.component-CO_3EQ_v.mjs} +4 -4
- package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-CO_3EQ_v.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-conditional-display-config.component-Cmf7gDfO.mjs +513 -0
- package/fesm2022/ngx-t-forms-conditional-display-config.component-Cmf7gDfO.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CAZv0_uR.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-BHiOEQe4.mjs} +4 -4
- package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-BHiOEQe4.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-data-source-picker.component-CN51SdCK.mjs +261 -0
- package/fesm2022/ngx-t-forms-data-source-picker.component-CN51SdCK.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-NM2cFs3P.mjs → ngx-t-forms-date-picker-input-element.component-c3OSDXWw.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-NM2cFs3P.mjs.map → ngx-t-forms-date-picker-input-element.component-c3OSDXWw.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-C-4fqOF0.mjs +166 -0
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-C-4fqOF0.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-DLzba2AQ.mjs +373 -0
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-DLzba2AQ.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-document-picker.component-9clYsOcl.mjs +1259 -0
- package/fesm2022/ngx-t-forms-document-picker.component-9clYsOcl.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-editor-input-element.component-BGdZ4evj.mjs +417 -0
- package/fesm2022/ngx-t-forms-editor-input-element.component-BGdZ4evj.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-editor-js-input.component-DlsLiHi1.mjs → ngx-t-forms-editor-js-input.component-02HnmInT.mjs} +25 -11
- package/fesm2022/ngx-t-forms-editor-js-input.component-02HnmInT.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-Km-qgANx.mjs → ngx-t-forms-file-upload-input-element.component-BF7KbSPb.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-Km-qgANx.mjs.map → ngx-t-forms-file-upload-input-element.component-BF7KbSPb.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-form-input-selector.component-vCj2SCxs.mjs +86 -0
- package/fesm2022/ngx-t-forms-form-input-selector.component-vCj2SCxs.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-form-json-view.component-r64GKVhI.mjs → ngx-t-forms-form-json-view.component-Cmw1hHGZ.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-json-view.component-r64GKVhI.mjs.map → ngx-t-forms-form-json-view.component-Cmw1hHGZ.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-B3DRJ--U.mjs → ngx-t-forms-form-section-stepper.component-CFdwgxRl.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-B3DRJ--U.mjs.map → ngx-t-forms-form-section-stepper.component-CFdwgxRl.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-BYFynpTn.mjs → ngx-t-forms-forms-builder-menu.component-DisrOv5x.mjs} +5 -5
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-BYFynpTn.mjs.map → ngx-t-forms-forms-builder-menu.component-DisrOv5x.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-geo-location.component-D2fIbagr.mjs → ngx-t-forms-geo-location.component-D-BhLdx6.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-geo-location.component-D2fIbagr.mjs.map → ngx-t-forms-geo-location.component-D-BhLdx6.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-header-template-editor.component-Z5frEhho.mjs +159 -0
- package/fesm2022/ngx-t-forms-header-template-editor.component-Z5frEhho.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-BgnzErQt.mjs → ngx-t-forms-image-capture-input-element.component-CoJTXMbL.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-BgnzErQt.mjs.map → ngx-t-forms-image-capture-input-element.component-CoJTXMbL.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-index-D8xr_Sxp.mjs +2 -0
- package/fesm2022/ngx-t-forms-index-D8xr_Sxp.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-input-custom.component-Dcoze7U3.mjs → ngx-t-forms-input-custom.component-s1ryJQy4.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-input-custom.component-Dcoze7U3.mjs.map → ngx-t-forms-input-custom.component-s1ryJQy4.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-input-editor.component-oIzCTmbx.mjs +190 -0
- package/fesm2022/ngx-t-forms-input-editor.component-oIzCTmbx.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-BsfvYiEU.mjs → ngx-t-forms-map-mat-options-keys-C1kxlZS_.mjs} +2 -3
- package/fesm2022/ngx-t-forms-map-mat-options-keys-C1kxlZS_.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-CYtTBtyf.mjs → ngx-t-forms-mat-chip-list-editor.component-wskkKr4y.mjs} +5 -5
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-wskkKr4y.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-CEa8ZNKA.mjs → ngx-t-forms-missing-form-configs.component-C1XuXRdn.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-CEa8ZNKA.mjs.map → ngx-t-forms-missing-form-configs.component-C1XuXRdn.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-DklkxNgg.mjs → ngx-t-forms-mscoa-chart-toolbar.component-BJrOTRuQ.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-DklkxNgg.mjs.map → ngx-t-forms-mscoa-chart-toolbar.component-BJrOTRuQ.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-GyKF31Ve.mjs +447 -0
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-GyKF31Ve.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-BrPJPR2R.mjs +905 -0
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-BrPJPR2R.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-ngx-t-forms-0gzvHzEK.mjs → ngx-t-forms-ngx-t-forms-DqAcUfN4.mjs} +2738 -415
- package/fesm2022/ngx-t-forms-ngx-t-forms-DqAcUfN4.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-paginated-selection-table-DrXB22iY.mjs → ngx-t-forms-paginated-selection-table-Bk77dBo9.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-paginated-selection-table-DrXB22iY.mjs.map → ngx-t-forms-paginated-selection-table-Bk77dBo9.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-payload-template-editor.component-CVzOTLYE.mjs +85 -0
- package/fesm2022/ngx-t-forms-payload-template-editor.component-CVzOTLYE.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-pipeline-generator.component-7Vfwaqnx.mjs +748 -0
- package/fesm2022/ngx-t-forms-pipeline-generator.component-7Vfwaqnx.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-record-list-manager.component-l-2uDVmi.mjs → ngx-t-forms-record-list-manager.component-CfZdqKhY.mjs} +4 -4
- package/fesm2022/ngx-t-forms-record-list-manager.component-CfZdqKhY.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-required-inputs.component-CK7NIhbq.mjs +272 -0
- package/fesm2022/ngx-t-forms-required-inputs.component-CK7NIhbq.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-YChv7Arm.mjs +699 -0
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-YChv7Arm.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-BYMcaRE5.mjs → ngx-t-forms-section-report.component-DhSaf85h.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-section-report.component-BYMcaRE5.mjs.map → ngx-t-forms-section-report.component-DhSaf85h.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-select-input-element.component-Nsa3dpvV.mjs → ngx-t-forms-select-input-element.component-D5HFzh35.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-select-input-element.component-Nsa3dpvV.mjs.map → ngx-t-forms-select-input-element.component-D5HFzh35.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-selection-options-editor.component-BhmmJOco.mjs +169 -0
- package/fesm2022/ngx-t-forms-selection-options-editor.component-BhmmJOco.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-t-workflow-picker.component-DAwP-cWK.mjs → ngx-t-forms-t-workflow-picker.component-D0ttyEex.mjs} +3 -3
- package/fesm2022/ngx-t-forms-t-workflow-picker.component-D0ttyEex.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-DPxUzkAu.mjs → ngx-t-forms-textarea-input-element.component-DWEADTsz.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-DPxUzkAu.mjs.map → ngx-t-forms-textarea-input-element.component-DWEADTsz.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-OZre5TJ7.mjs → ngx-t-forms-toggle-input-element.component-XZi6kPnL.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-OZre5TJ7.mjs.map → ngx-t-forms-toggle-input-element.component-XZi6kPnL.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-0_Y6bvtE.mjs +574 -0
- package/fesm2022/ngx-t-forms-validators-config.component-0_Y6bvtE.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-workflow-adjudication.component-CrDZg3Nl.mjs → ngx-t-forms-workflow-adjudication.component-Gkimmw-X.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-workflow-adjudication.component-CrDZg3Nl.mjs.map → ngx-t-forms-workflow-adjudication.component-Gkimmw-X.mjs.map} +1 -1
- 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 +110 -6
- package/fesm2022/ngx-t-forms-auto-complete-input-element.component-7g5cpVfB.mjs +0 -261
- package/fesm2022/ngx-t-forms-auto-complete-input-element.component-7g5cpVfB.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-basic-input-input-element.component-BhMw2vpl.mjs +0 -225
- package/fesm2022/ngx-t-forms-basic-input-input-element.component-BhMw2vpl.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-BmWnrfWN.mjs +0 -1011
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-BmWnrfWN.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-CJMwqoHL.mjs +0 -643
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-CJMwqoHL.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-ALkkDotT.mjs +0 -136
- package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-ALkkDotT.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-B54kOArR.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-CAZv0_uR.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-Dap7QkKD.mjs +0 -253
- package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-Dap7QkKD.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-data-source-picker.component-8G28L1Cg.mjs +0 -261
- package/fesm2022/ngx-t-forms-data-source-picker.component-8G28L1Cg.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-data-source-picker.component-CJ1C1Znp.mjs +0 -419
- package/fesm2022/ngx-t-forms-data-source-picker.component-CJ1C1Znp.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-date-picker-input-element.component-DjYq63Iv.mjs +0 -231
- package/fesm2022/ngx-t-forms-date-picker-input-element.component-DjYq63Iv.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-DhU_bhy3.mjs +0 -156
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-DhU_bhy3.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-g0wIRj9b.mjs +0 -333
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-g0wIRj9b.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-K-KFdCcS.mjs +0 -373
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-K-KFdCcS.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-NuPXy_Ms.mjs +0 -543
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-NuPXy_Ms.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-document-picker.component-BSG7k3IN.mjs +0 -1259
- package/fesm2022/ngx-t-forms-document-picker.component-BSG7k3IN.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-document-picker.component-ChGqXHcQ.mjs +0 -1996
- package/fesm2022/ngx-t-forms-document-picker.component-ChGqXHcQ.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-editor-input-element.component-B8Pk-EVY.mjs +0 -581
- package/fesm2022/ngx-t-forms-editor-input-element.component-B8Pk-EVY.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-editor-input-element.component-Bb7w-vNw.mjs +0 -417
- package/fesm2022/ngx-t-forms-editor-input-element.component-Bb7w-vNw.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-editor-js-input.component-DlsLiHi1.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-editor-js-input.component-XX6kU8DW.mjs +0 -585
- package/fesm2022/ngx-t-forms-editor-js-input.component-XX6kU8DW.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-file-upload-input-element.component-RCmUClXv.mjs +0 -447
- package/fesm2022/ngx-t-forms-file-upload-input-element.component-RCmUClXv.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-form-input-selector.component-0jfD5C0G.mjs +0 -163
- package/fesm2022/ngx-t-forms-form-input-selector.component-0jfD5C0G.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-form-input-selector.component-D5KYWQ2R.mjs +0 -86
- package/fesm2022/ngx-t-forms-form-input-selector.component-D5KYWQ2R.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-form-json-view.component-z0nQxpqB.mjs +0 -28
- package/fesm2022/ngx-t-forms-form-json-view.component-z0nQxpqB.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-form-payload-projection.component-CkH7zmdJ.mjs +0 -291
- package/fesm2022/ngx-t-forms-form-payload-projection.component-CkH7zmdJ.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-form-section-stepper.component-UUTHYU-A.mjs +0 -936
- package/fesm2022/ngx-t-forms-form-section-stepper.component-UUTHYU-A.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-DTIAOxGV.mjs +0 -816
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-DTIAOxGV.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-geo-location.component-DW2b5Zli.mjs +0 -329
- package/fesm2022/ngx-t-forms-geo-location.component-DW2b5Zli.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-image-capture-input-element.component-Us_NAQSl.mjs +0 -360
- package/fesm2022/ngx-t-forms-image-capture-input-element.component-Us_NAQSl.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-index-6YIhS6cm.mjs +0 -2
- package/fesm2022/ngx-t-forms-index-6YIhS6cm.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-index-BPNBX_ve.mjs +0 -2
- package/fesm2022/ngx-t-forms-index-BPNBX_ve.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-input-custom.component-DQOqy047.mjs +0 -128
- package/fesm2022/ngx-t-forms-input-custom.component-DQOqy047.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-input-editor.component-3fRj5swF.mjs +0 -512
- package/fesm2022/ngx-t-forms-input-editor.component-3fRj5swF.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-input-editor.component-B6UKwV4i.mjs +0 -190
- package/fesm2022/ngx-t-forms-input-editor.component-B6UKwV4i.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-map-mat-options-keys-BsfvYiEU.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-map-mat-options-keys-eSc99wdA.mjs +0 -132
- package/fesm2022/ngx-t-forms-map-mat-options-keys-eSc99wdA.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-CN17K5q6.mjs +0 -268
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-CN17K5q6.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-CYtTBtyf.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mat-slider-editor.component-B-_yUJ5N.mjs +0 -241
- package/fesm2022/ngx-t-forms-mat-slider-editor.component-B-_yUJ5N.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-mat-slider-toggle-editor.component-D0F1d1mO.mjs +0 -180
- package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-D0F1d1mO.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-missing-form-configs.component-AaDfeALs.mjs +0 -114
- package/fesm2022/ngx-t-forms-missing-form-configs.component-AaDfeALs.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-D0igUV3W.mjs +0 -69
- package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-D0igUV3W.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-error-display.component-rzl-fMmd.mjs +0 -200
- package/fesm2022/ngx-t-forms-mscoa-error-display.component-rzl-fMmd.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-2SspNWtF.mjs +0 -447
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-2SspNWtF.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-CSGf4XeN.mjs +0 -850
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-CSGf4XeN.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-temporary-hint.component-CBuGHwnU.mjs +0 -107
- package/fesm2022/ngx-t-forms-mscoa-temporary-hint.component-CBuGHwnU.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-CbQdnVgw.mjs +0 -1665
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-CbQdnVgw.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-dmRIi9ph.mjs +0 -905
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-dmRIi9ph.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-0gzvHzEK.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-BefvSS-p.mjs +0 -28237
- package/fesm2022/ngx-t-forms-ngx-t-forms-BefvSS-p.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-paginated-selection-table-BGNxI2yq.mjs +0 -1024
- package/fesm2022/ngx-t-forms-paginated-selection-table-BGNxI2yq.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-payload-template-editor.component-DL4ZTTsH.mjs +0 -203
- package/fesm2022/ngx-t-forms-payload-template-editor.component-DL4ZTTsH.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-payload-template-editor.component-o3qwpvYu.mjs +0 -234
- package/fesm2022/ngx-t-forms-payload-template-editor.component-o3qwpvYu.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-pipeline-generator.component-BqtdKcN2.mjs +0 -1126
- package/fesm2022/ngx-t-forms-pipeline-generator.component-BqtdKcN2.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-pipeline-generator.component-DcZPv8-N.mjs +0 -748
- package/fesm2022/ngx-t-forms-pipeline-generator.component-DcZPv8-N.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-record-list-manager.component-BcANl5Bq.mjs +0 -639
- package/fesm2022/ngx-t-forms-record-list-manager.component-BcANl5Bq.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-record-list-manager.component-l-2uDVmi.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-required-inputs.component-BMmNxeE-.mjs +0 -272
- package/fesm2022/ngx-t-forms-required-inputs.component-BMmNxeE-.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-required-inputs.component-Dr0P1gin.mjs +0 -451
- package/fesm2022/ngx-t-forms-required-inputs.component-Dr0P1gin.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-BSv_KQIU.mjs +0 -625
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-BSv_KQIU.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-C3sNmq_H.mjs +0 -444
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-C3sNmq_H.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-search-field.component-BGdAmzJV.mjs +0 -72
- package/fesm2022/ngx-t-forms-search-field.component-BGdAmzJV.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-section-report.component-yGAjX7Gb.mjs +0 -248
- package/fesm2022/ngx-t-forms-section-report.component-yGAjX7Gb.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-select-input-element.component-BqtJi4ek.mjs +0 -408
- package/fesm2022/ngx-t-forms-select-input-element.component-BqtJi4ek.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-selection-options-editor.component-BuXVzo7Z.mjs +0 -169
- package/fesm2022/ngx-t-forms-selection-options-editor.component-BuXVzo7Z.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-selection-options-editor.component-_glw1cqH.mjs +0 -275
- package/fesm2022/ngx-t-forms-selection-options-editor.component-_glw1cqH.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-t-workflow-picker.component-CLgN3YM4.mjs +0 -366
- package/fesm2022/ngx-t-forms-t-workflow-picker.component-CLgN3YM4.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-t-workflow-picker.component-DAwP-cWK.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-textarea-input-element.component-SCEBLqJd.mjs +0 -233
- package/fesm2022/ngx-t-forms-textarea-input-element.component-SCEBLqJd.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-toggle-input-element.component-CoyTMRMa.mjs +0 -305
- package/fesm2022/ngx-t-forms-toggle-input-element.component-CoyTMRMa.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-validators-config.component-B1Lzs7o2.mjs +0 -1105
- package/fesm2022/ngx-t-forms-validators-config.component-B1Lzs7o2.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-validators-config.component-CoGSFor3.mjs +0 -574
- package/fesm2022/ngx-t-forms-validators-config.component-CoGSFor3.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-Bz07jv-N.mjs +0 -2923
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-Bz07jv-N.mjs.map +0 -1
|
@@ -1,905 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, inject, DestroyRef, ElementRef } from '@angular/core';
|
|
3
|
-
import * as i1$2 from '@angular/forms';
|
|
4
|
-
import { NgControl, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
-
import * as i2$2 from '@angular/material/form-field';
|
|
6
|
-
import { MatFormFieldControl, 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 from '@angular/material/button';
|
|
10
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
11
|
-
import * as i5$1 from '@angular/material/tooltip';
|
|
12
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
13
|
-
import { b as TDynamicDataViewComponent, y as TFormInputComponent, A as calculateListOveralFunctions, B as BaseCustomInput, _ as _isEqual, q as getInputErrorMessage, u as TFormInputStatusComponent } from './ngx-t-forms-ngx-t-forms-0gzvHzEK.mjs';
|
|
14
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
15
|
-
import * as i5 from '@angular/material/table';
|
|
16
|
-
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
17
|
-
import { DocumentLitsLabelConfigInterfaceValueType, InputDataTypes, MultipleInputAvailableOperations, CalculationFunctions } from 'ngx-t-forms-types';
|
|
18
|
-
import * as i4 from '@angular/material/chips';
|
|
19
|
-
import { MatChipsModule } from '@angular/material/chips';
|
|
20
|
-
import * as i6 from '@angular/material/menu';
|
|
21
|
-
import { MatMenuModule } from '@angular/material/menu';
|
|
22
|
-
import * as i1 from '@angular/material/progress-bar';
|
|
23
|
-
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
24
|
-
import * as i4$1 from '@angular/material/progress-spinner';
|
|
25
|
-
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
26
|
-
import * as i2$1 from '@angular/material/sort';
|
|
27
|
-
import { MatSortModule } from '@angular/material/sort';
|
|
28
|
-
import * as i3$1 from '@angular/common';
|
|
29
|
-
import { CommonModule } from '@angular/common';
|
|
30
|
-
import * as i3$2 from '@angular/material/card';
|
|
31
|
-
import { MatCardModule } from '@angular/material/card';
|
|
32
|
-
import { MatDividerModule } from '@angular/material/divider';
|
|
33
|
-
import * as i1$1 from '@angular/cdk/drag-drop';
|
|
34
|
-
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
35
|
-
import { Subject, timer, tap, takeUntil } from 'rxjs';
|
|
36
|
-
import { v4 } from 'uuid';
|
|
37
|
-
import * as i6$1 from '@angular/material/list';
|
|
38
|
-
|
|
39
|
-
class ColorScale {
|
|
40
|
-
constructor(min, max, colorStops, alpha = 1) {
|
|
41
|
-
validateMinMaxValues(min, max);
|
|
42
|
-
validateColorStops(colorStops);
|
|
43
|
-
validateAlphaValue(alpha);
|
|
44
|
-
this.min = min;
|
|
45
|
-
this.max = max;
|
|
46
|
-
this.alpha = alpha;
|
|
47
|
-
this.colorStops = colorStops.map((colorStop) => hexToColor(colorStop, alpha));
|
|
48
|
-
}
|
|
49
|
-
getColor(value) {
|
|
50
|
-
const numOfColorStops = this.colorStops.length;
|
|
51
|
-
if (value < this.min)
|
|
52
|
-
return this.colorStops[0];
|
|
53
|
-
if (value > this.max)
|
|
54
|
-
return this.colorStops[numOfColorStops - 1];
|
|
55
|
-
const range = this.max - this.min;
|
|
56
|
-
let weight = (value - this.min) / range;
|
|
57
|
-
const colorStopIndex = Math.max(Math.ceil(weight * (numOfColorStops - 1)), 1);
|
|
58
|
-
const minColor = this.colorStops[colorStopIndex - 1];
|
|
59
|
-
const maxColor = this.colorStops[colorStopIndex];
|
|
60
|
-
if (maxColor === undefined)
|
|
61
|
-
return minColor;
|
|
62
|
-
if (minColor === undefined)
|
|
63
|
-
return maxColor;
|
|
64
|
-
weight = weight * (numOfColorStops - 1) - (colorStopIndex - 1);
|
|
65
|
-
const r = Math.floor(weight * maxColor.r + (1 - weight) * minColor.r);
|
|
66
|
-
const g = Math.floor(weight * maxColor.g + (1 - weight) * minColor.g);
|
|
67
|
-
const b = Math.floor(weight * maxColor.b + (1 - weight) * minColor.b);
|
|
68
|
-
return new Color(r, g, b, this.alpha);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
function validateMinMaxValues(min, max) {
|
|
72
|
-
if (min > max) {
|
|
73
|
-
throw new Error('The minimum value must be less than the maximum value.');
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function validateColorStops(colorStops) {
|
|
77
|
-
if (colorStops.length < 2) {
|
|
78
|
-
throw new Error('At least two colors must be provided.');
|
|
79
|
-
}
|
|
80
|
-
colorStops.forEach((str) => {
|
|
81
|
-
if (!isValidHexColor(str)) {
|
|
82
|
-
throw new Error(`${str} is not a valid hex color.`);
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
function validateAlphaValue(alpha) {
|
|
87
|
-
if (alpha < 0 || alpha > 1) {
|
|
88
|
-
throw new Error('The alpha value must be between 0 and 1.');
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
function hexToColor(hex, alpha) {
|
|
92
|
-
if (isValid3DigitHexColor(hex)) {
|
|
93
|
-
hex = convertTo6DigitHexColor(hex);
|
|
94
|
-
}
|
|
95
|
-
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
96
|
-
if (!!result?.[1] && !!result?.[2] && !!result?.[3]) {
|
|
97
|
-
return new Color(parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16), alpha);
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
throw new Error(`${hex} is not a valid hex color.`);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
function isValidHexColor(colorString) {
|
|
104
|
-
return (isValid3DigitHexColor(colorString) || isValid6DigitHexColor(colorString));
|
|
105
|
-
}
|
|
106
|
-
function isValid3DigitHexColor(colorString) {
|
|
107
|
-
const hexColorRegex = /^#(?:[0-9a-fA-F]{3})$/;
|
|
108
|
-
return colorString.match(hexColorRegex);
|
|
109
|
-
}
|
|
110
|
-
function isValid6DigitHexColor(colorString) {
|
|
111
|
-
const hexColorRegex = /^#(?:[0-9a-fA-F]{6})$/;
|
|
112
|
-
return colorString.match(hexColorRegex);
|
|
113
|
-
}
|
|
114
|
-
function convertTo6DigitHexColor(threeDigitHex) {
|
|
115
|
-
return threeDigitHex
|
|
116
|
-
.substring(1)
|
|
117
|
-
.split('')
|
|
118
|
-
.map((char) => {
|
|
119
|
-
return char + char;
|
|
120
|
-
})
|
|
121
|
-
.join('');
|
|
122
|
-
}
|
|
123
|
-
function componentToHex(c) {
|
|
124
|
-
const hex = c.toString(16);
|
|
125
|
-
return hex.length === 1 ? '0' + hex : hex;
|
|
126
|
-
}
|
|
127
|
-
function rgbaToHex(color) {
|
|
128
|
-
const r = Math.floor(color.r * color.a);
|
|
129
|
-
const g = Math.floor(color.g * color.a);
|
|
130
|
-
const b = Math.floor(color.b * color.a);
|
|
131
|
-
return `#${componentToHex(r)}${componentToHex(g)}${componentToHex(b)}`;
|
|
132
|
-
}
|
|
133
|
-
class Color {
|
|
134
|
-
constructor(r, g, b, a = 1) {
|
|
135
|
-
validateAlphaValue(a);
|
|
136
|
-
this.r = r;
|
|
137
|
-
this.g = g;
|
|
138
|
-
this.b = b;
|
|
139
|
-
this.a = a;
|
|
140
|
-
}
|
|
141
|
-
toRGBString() {
|
|
142
|
-
return `rgb(${Math.floor(this.r * this.a)},${Math.floor(this.g * this.a)},${Math.floor(this.b * this.a)})`;
|
|
143
|
-
}
|
|
144
|
-
toRGBAString() {
|
|
145
|
-
return `rgba(${this.r},${this.g},${this.b},${this.a})`;
|
|
146
|
-
}
|
|
147
|
-
toHexString() {
|
|
148
|
-
return rgbaToHex(this);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
153
|
-
function configureCols(inputConfig, tempLabels) {
|
|
154
|
-
try {
|
|
155
|
-
const labelInputs = (inputConfig?.formInputs || []).filter(input => input.showAsLabel || tempLabels.includes(input.formControlName));
|
|
156
|
-
const cols = [];
|
|
157
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
158
|
-
const colConfigs = {};
|
|
159
|
-
for (let index = 0; index < (labelInputs).length; index++) {
|
|
160
|
-
const c = labelInputs[index];
|
|
161
|
-
const col = { ...c };
|
|
162
|
-
cols.push(`${inputConfig.id}.${col.id}`);
|
|
163
|
-
if (!col.id) {
|
|
164
|
-
continue;
|
|
165
|
-
}
|
|
166
|
-
colConfigs[`${inputConfig.id}.${col.id}`] = {
|
|
167
|
-
property: `${inputConfig.id}.${col.id}`,
|
|
168
|
-
formControlName: col.formControlName,
|
|
169
|
-
label: col.label,
|
|
170
|
-
dataType: getDataType(col)
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
//add remove section config
|
|
174
|
-
cols.push('itemRemovalButton');
|
|
175
|
-
colConfigs['itemRemovalButton'] = {
|
|
176
|
-
property: 'itemRemovalButton',
|
|
177
|
-
label: '',
|
|
178
|
-
type: 'removal',
|
|
179
|
-
};
|
|
180
|
-
// end
|
|
181
|
-
return {
|
|
182
|
-
displayedColumnsInOrder: cols.filter((c) => !!c),
|
|
183
|
-
columnsConfig: colConfigs
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
catch (error) {
|
|
187
|
-
const message = error instanceof Error ? error.message : 'Failed to configure columns';
|
|
188
|
-
throw new Error(message);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
function getDataType(input) {
|
|
192
|
-
try {
|
|
193
|
-
if (input.pipe?.pipeType) {
|
|
194
|
-
return input.pipe.pipeType;
|
|
195
|
-
}
|
|
196
|
-
const inputDataType = input.dataType;
|
|
197
|
-
switch (inputDataType) {
|
|
198
|
-
case InputDataTypes.Number:
|
|
199
|
-
return DocumentLitsLabelConfigInterfaceValueType.number;
|
|
200
|
-
case InputDataTypes.Date:
|
|
201
|
-
return DocumentLitsLabelConfigInterfaceValueType.date;
|
|
202
|
-
case InputDataTypes.Array:
|
|
203
|
-
return InputDataTypes.Array;
|
|
204
|
-
case InputDataTypes.Boolean:
|
|
205
|
-
return InputDataTypes.Boolean;
|
|
206
|
-
case InputDataTypes.Object:
|
|
207
|
-
return InputDataTypes.Object;
|
|
208
|
-
default:
|
|
209
|
-
return DocumentLitsLabelConfigInterfaceValueType.string;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
catch (error) {
|
|
213
|
-
const msg = error instanceof Error ? error.message : 'Failed to get data type';
|
|
214
|
-
throw new Error(msg);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
class MultipleInputTableViewComponent {
|
|
219
|
-
constructor() {
|
|
220
|
-
this.inputConfig = input(undefined, ...(ngDevMode ? [{ debugName: "inputConfig" }] : /* istanbul ignore next */ []));
|
|
221
|
-
this.dataSource = input(new MatTableDataSource(), ...(ngDevMode ? [{ debugName: "dataSource" }] : /* istanbul ignore next */ []));
|
|
222
|
-
this.applyOptionsTo = input(undefined, ...(ngDevMode ? [{ debugName: "applyOptionsTo" }] : /* istanbul ignore next */ []));
|
|
223
|
-
this.formGroup = input(null, ...(ngDevMode ? [{ debugName: "formGroup" }] : /* istanbul ignore next */ []));
|
|
224
|
-
this.onEditItem = output();
|
|
225
|
-
this.onDeleteItem = output();
|
|
226
|
-
this.onCopy = output();
|
|
227
|
-
this.onApplyOptionsTo = output();
|
|
228
|
-
this.showItemAsLabel = output();
|
|
229
|
-
this.colConfig = computed(() => {
|
|
230
|
-
const cfg = this.inputConfig();
|
|
231
|
-
if (!cfg) {
|
|
232
|
-
return {
|
|
233
|
-
columnsConfig: {},
|
|
234
|
-
displayedColumnsInOrder: [],
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
return configureCols(cfg, this.tempLabels);
|
|
238
|
-
}, ...(ngDevMode ? [{ debugName: "colConfig" }] : /* istanbul ignore next */ []));
|
|
239
|
-
this.displayedColumnsInOrderSig = computed(() => this.colConfig().displayedColumnsInOrder, ...(ngDevMode ? [{ debugName: "displayedColumnsInOrderSig" }] : /* istanbul ignore next */ []));
|
|
240
|
-
this.allPossibleLabels = computed(() => {
|
|
241
|
-
const cfg = this.inputConfig();
|
|
242
|
-
const displayed = this.displayedColumnsInOrderSig();
|
|
243
|
-
return (cfg?.formInputs?.map((inp) => ({
|
|
244
|
-
label: inp.label,
|
|
245
|
-
selected: displayed.includes(`${cfg?.id}.${inp.id}`),
|
|
246
|
-
formControlName: inp.formControlName,
|
|
247
|
-
})) || []);
|
|
248
|
-
}, ...(ngDevMode ? [{ debugName: "allPossibleLabels" }] : /* istanbul ignore next */ []));
|
|
249
|
-
this.userCanEdit = computed(() => {
|
|
250
|
-
const cfg = this.inputConfig();
|
|
251
|
-
if (!cfg)
|
|
252
|
-
return false;
|
|
253
|
-
if (!cfg.multipleInputAvailableOperations)
|
|
254
|
-
return true;
|
|
255
|
-
return cfg.multipleInputAvailableOperations.includes(MultipleInputAvailableOperations.Update);
|
|
256
|
-
}, ...(ngDevMode ? [{ debugName: "userCanEdit" }] : /* istanbul ignore next */ []));
|
|
257
|
-
this.userCanRemove = computed(() => {
|
|
258
|
-
const cfg = this.inputConfig();
|
|
259
|
-
if (!cfg)
|
|
260
|
-
return false;
|
|
261
|
-
if (!cfg.multipleInputAvailableOperations)
|
|
262
|
-
return true;
|
|
263
|
-
return cfg.multipleInputAvailableOperations.includes(MultipleInputAvailableOperations.Remove);
|
|
264
|
-
}, ...(ngDevMode ? [{ debugName: "userCanRemove" }] : /* istanbul ignore next */ []));
|
|
265
|
-
this.userCanAdd = computed(() => {
|
|
266
|
-
const cfg = this.inputConfig();
|
|
267
|
-
if (!cfg)
|
|
268
|
-
return false;
|
|
269
|
-
if (!cfg.multipleInputAvailableOperations)
|
|
270
|
-
return true;
|
|
271
|
-
return cfg.multipleInputAvailableOperations.includes(MultipleInputAvailableOperations.Add);
|
|
272
|
-
}, ...(ngDevMode ? [{ debugName: "userCanAdd" }] : /* istanbul ignore next */ []));
|
|
273
|
-
this.userCanApplyOptionsTo = computed(() => {
|
|
274
|
-
return this.userCanEdit() || this.userCanRemove() || this.userCanAdd();
|
|
275
|
-
}, ...(ngDevMode ? [{ debugName: "userCanApplyOptionsTo" }] : /* istanbul ignore next */ []));
|
|
276
|
-
this.areYouSureYouWantToDeleteRow = {};
|
|
277
|
-
this.countDownDate = new Date();
|
|
278
|
-
this.deletionTimers = {};
|
|
279
|
-
this.tempLabels = [];
|
|
280
|
-
this.SYSTEM_KEY_IN_EDIT = null;
|
|
281
|
-
this.overlayOpen = false;
|
|
282
|
-
this.overlayData = null;
|
|
283
|
-
this.overlayPosition = { top: 0, left: 0 };
|
|
284
|
-
this.fullView = false;
|
|
285
|
-
}
|
|
286
|
-
applyOptionsToFn(item) {
|
|
287
|
-
this.onApplyOptionsTo.emit(item);
|
|
288
|
-
}
|
|
289
|
-
editItem(row) {
|
|
290
|
-
const rowId = row[`${this.inputConfig()?.id}.id`];
|
|
291
|
-
this.onEditItem.emit(rowId);
|
|
292
|
-
}
|
|
293
|
-
copy(row) {
|
|
294
|
-
const rowId = row[`${this.inputConfig()?.id}.id`];
|
|
295
|
-
this.onCopy.emit(rowId);
|
|
296
|
-
}
|
|
297
|
-
isAboutToDeleteRow(row) {
|
|
298
|
-
return !!this.areYouSureYouWantToDeleteRow[row[`${this.inputConfig()?.id}.id`]];
|
|
299
|
-
}
|
|
300
|
-
getCountdownSeconds() {
|
|
301
|
-
const now = new Date();
|
|
302
|
-
const timeElapsed = (now.getTime() - this.countDownDate.getTime()) / 1000;
|
|
303
|
-
const percentage = Math.min(Math.round((timeElapsed / 3) * 100), 100);
|
|
304
|
-
return percentage;
|
|
305
|
-
}
|
|
306
|
-
secondsCountDown() {
|
|
307
|
-
return (3 - ((this.getCountdownSeconds() / 100) * 3)).toFixed(1);
|
|
308
|
-
}
|
|
309
|
-
multipleInputRemoveItem(event, row) {
|
|
310
|
-
const rowId = row[`${this.inputConfig()?.id}.id`];
|
|
311
|
-
if (this.areYouSureYouWantToDeleteRow[rowId]) {
|
|
312
|
-
if (this.deletionTimers[rowId]) {
|
|
313
|
-
clearTimeout(this.deletionTimers[rowId]);
|
|
314
|
-
delete this.deletionTimers[rowId];
|
|
315
|
-
}
|
|
316
|
-
delete this.areYouSureYouWantToDeleteRow[rowId];
|
|
317
|
-
}
|
|
318
|
-
else {
|
|
319
|
-
this.areYouSureYouWantToDeleteRow[rowId] = true;
|
|
320
|
-
this.countDownDate = new Date();
|
|
321
|
-
this.deletionTimers[rowId] = setTimeout(() => {
|
|
322
|
-
if (this.areYouSureYouWantToDeleteRow[rowId]) {
|
|
323
|
-
this.onDeleteItem.emit(row);
|
|
324
|
-
delete this.areYouSureYouWantToDeleteRow[rowId];
|
|
325
|
-
delete this.deletionTimers[rowId];
|
|
326
|
-
}
|
|
327
|
-
}, 3000);
|
|
328
|
-
}
|
|
329
|
-
event.preventDefault();
|
|
330
|
-
event.stopPropagation();
|
|
331
|
-
}
|
|
332
|
-
returnBackground(row, columnsConfig) {
|
|
333
|
-
let background = '';
|
|
334
|
-
const ds = this.dataSource();
|
|
335
|
-
if (ds
|
|
336
|
-
? ds.data.length > 1
|
|
337
|
-
? columnsConfig?.['colorScale']
|
|
338
|
-
: false
|
|
339
|
-
: false) {
|
|
340
|
-
const inputCfg = this.inputConfig();
|
|
341
|
-
const colKey = columnsConfig?.['key'] ?? '';
|
|
342
|
-
const point = Number(row[colKey]);
|
|
343
|
-
const inputIsGrouped = inputCfg.groupBy;
|
|
344
|
-
const groupKey = inputCfg.groupBy?.[0] || '';
|
|
345
|
-
const dataSet = inputIsGrouped
|
|
346
|
-
? ds?.data.filter((s) => s[groupKey] === row[groupKey])
|
|
347
|
-
: new Array(ds?.data || []);
|
|
348
|
-
const arrayValues = dataSet?.map((vr) => Number(vr[colKey])) || [];
|
|
349
|
-
const max = Math.max(...arrayValues);
|
|
350
|
-
const min = Math.min(...arrayValues);
|
|
351
|
-
const hasNun = isNaN(max) || isNaN(min);
|
|
352
|
-
if (!hasNun && Number(max) !== Number(min)) {
|
|
353
|
-
const colorScale = new ColorScale(min, max, ['#2fdf75', '#FFA500', '#ff4961'], 0.8);
|
|
354
|
-
const color = colorScale.getColor(point)?.toRGBAString();
|
|
355
|
-
background = color ?? '';
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
return background;
|
|
359
|
-
}
|
|
360
|
-
hasTopBorder(row) {
|
|
361
|
-
const inputCfg = this.inputConfig();
|
|
362
|
-
const inputIsGrouped = inputCfg?.groupBy;
|
|
363
|
-
const ds = this.dataSource();
|
|
364
|
-
if (inputIsGrouped && ds) {
|
|
365
|
-
const indexOfRow = ds.data.indexOf(row);
|
|
366
|
-
const rowIsFirstInTable = indexOfRow === 0;
|
|
367
|
-
if (!inputCfg.groupBy) {
|
|
368
|
-
return false;
|
|
369
|
-
}
|
|
370
|
-
const groupKey = inputCfg.groupBy?.[0] ?? '';
|
|
371
|
-
const isFirstInGroup = rowIsFirstInTable
|
|
372
|
-
? true
|
|
373
|
-
: ds.data[indexOfRow - 1][groupKey] !==
|
|
374
|
-
row[groupKey];
|
|
375
|
-
return isFirstInGroup;
|
|
376
|
-
}
|
|
377
|
-
else {
|
|
378
|
-
return false;
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
getCalculationFunction(row) {
|
|
382
|
-
const func = row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION'];
|
|
383
|
-
switch (func) {
|
|
384
|
-
case CalculationFunctions.Sum:
|
|
385
|
-
return 'TOTAL';
|
|
386
|
-
case CalculationFunctions.Avg:
|
|
387
|
-
return 'AVERAGE';
|
|
388
|
-
case CalculationFunctions.Max:
|
|
389
|
-
return 'MAX';
|
|
390
|
-
case CalculationFunctions.Min:
|
|
391
|
-
return 'MIN';
|
|
392
|
-
default:
|
|
393
|
-
return func;
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
toggleTepLabel(event, label) {
|
|
397
|
-
if (this.tempLabels.includes(label)) {
|
|
398
|
-
this.tempLabels = this.tempLabels.filter((l) => l !== label);
|
|
399
|
-
}
|
|
400
|
-
else {
|
|
401
|
-
this.tempLabels.push(label);
|
|
402
|
-
}
|
|
403
|
-
event.stopPropagation();
|
|
404
|
-
event.preventDefault();
|
|
405
|
-
}
|
|
406
|
-
get getColConfig() {
|
|
407
|
-
return this.colConfig();
|
|
408
|
-
}
|
|
409
|
-
get displayedColumnsInOrder() {
|
|
410
|
-
return this.displayedColumnsInOrderSig();
|
|
411
|
-
}
|
|
412
|
-
rowIsInEdit(row) {
|
|
413
|
-
const cfg = this.inputConfig();
|
|
414
|
-
const fg = this.formGroup();
|
|
415
|
-
return (!!cfg?.formIsOpen &&
|
|
416
|
-
fg?.controls[`${cfg?.id}.id`]?.value === row[`${cfg?.id}.id`]);
|
|
417
|
-
}
|
|
418
|
-
openDataOverlay(event, data) {
|
|
419
|
-
event.stopPropagation();
|
|
420
|
-
const rect = event.currentTarget.getBoundingClientRect();
|
|
421
|
-
this.overlayData = data;
|
|
422
|
-
this.overlayPosition = { top: rect.bottom + 4, left: rect.left };
|
|
423
|
-
this.overlayOpen = true;
|
|
424
|
-
}
|
|
425
|
-
closeDataOverlay() {
|
|
426
|
-
this.overlayOpen = false;
|
|
427
|
-
this.overlayData = null;
|
|
428
|
-
}
|
|
429
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MultipleInputTableViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
430
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: MultipleInputTableViewComponent, isStandalone: true, selector: "lib-multiple-input-table-view", inputs: { inputConfig: { classPropertyName: "inputConfig", publicName: "inputConfig", isSignal: true, isRequired: false, transformFunction: null }, dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: false, transformFunction: null }, applyOptionsTo: { classPropertyName: "applyOptionsTo", publicName: "applyOptionsTo", isSignal: true, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onEditItem: "onEditItem", onDeleteItem: "onDeleteItem", onCopy: "onCopy", onApplyOptionsTo: "onApplyOptionsTo", showItemAsLabel: "showItemAsLabel" }, ngImport: i0, template: "@defer (on viewport) {\n\n @if (getColConfig.displayedColumnsInOrder.length === 0) {\n <div class=\"mit-state mit-state--inline\">No columns</div>\n }\n\n <div class=\"table-container\">\n\n <table mat-table [dataSource]=\"(dataSource() || [])\" class=\"mit-table\" matSort matSortActive=\"created\"\n matSortDisableClear matSortDirection=\"desc\">\n @for (col of (displayedColumnsInOrder || []); track col) {\n <ng-container [matColumnDef]=\"col\">\n <th mat-header-cell *matHeaderCellDef>\n <span class=\"mit-th-label\">\n {{ getColConfig.columnsConfig?.[col]?.[\"label\"] }}\n </span>\n @if ($last) {\n <button matTooltip=\"Show other values\" [matMenuTriggerFor]=\"colOptions\" [matMenuTriggerData]=\"{}\"\n class=\"mit-th-action\" mat-icon-button>\n <mat-icon>label</mat-icon>\n </button>\n }\n </th>\n <td [class.functionClass]=\"row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION']\"\n [style.background]=\"returnBackground(row, getColConfig.columnsConfig?.[col])\"\n mat-cell *matCellDef=\"let row\">\n @if (getColConfig.columnsConfig?.[col]?.['type'] === 'removal') {\n <div class=\"cellClass\">\n\n @if (!!row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION'] && !row['id'] && !inputConfig()?.multipleInputInEditId ||\n !!row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION'] && inputConfig()?.multipleInputInEditId &&\n inputConfig()?.multipleInputInEditId !== row['id']) {\n <div class=\"mit-fn-label\">\n <strong>{{ getCalculationFunction(row) }}</strong>\n </div>\n }\n @if (\n userCanApplyOptionsTo() &&\n !row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION'] &&\n row[''] !== 'true' && !inputConfig()?.readonly && !inputConfig()?.disabled\n ) {\n <button mat-icon-button [color]=\"t.menuOpen ? 'primary' : 'basic'\" [matMenuTriggerFor]=\"rowOptions\" [matMenuTriggerData]=\"{row:row}\" #t=\"matMenuTrigger\"\n (click)=\"applyOptionsToFn(row)\"\n class=\"mit-row-trigger\">\n @if (rowIsInEdit(row)) {\n <mat-icon color=\"primary\">edit</mat-icon>\n } @else {\n <mat-icon>{{ t.menuOpen ? 'close' : 'more_horiz' }}</mat-icon>\n }\n </button>\n }\n\n @if (row['SYSTEM_KEY_IN_EDIT']) {\n <mat-chip>In {{ inputConfig()?.readonly ? 'View' : 'Edit' }}</mat-chip>\n }\n\n </div>\n }\n @if (getColConfig.columnsConfig && getColConfig.columnsConfig?.[col]?.type !== 'removal') {\n <div class=\"cellClass\">\n <span>\n @if (getColConfig.columnsConfig?.[col].dataType === 'array' || getColConfig.columnsConfig?.[col].dataType === 'object') {\n <button mat-icon-button class=\"mit-data-button\"\n matTooltip=\"View data\"\n (click)=\"openDataOverlay($event, row[col])\">\n <mat-icon class=\"mit-data-icon\">data_object</mat-icon>\n </button>\n } @else {\n {{ row[col] | formatData: getColConfig.columnsConfig?.[col].dataType }}\n }\n </span>\n </div>\n }\n </td>\n </ng-container>\n }\n\n\n <tr mat-header-row *matHeaderRowDef=\"getColConfig.displayedColumnsInOrder\"></tr>\n <tr [class.mit-group-start]=\"hasTopBorder(row)\" mat-row\n *matRowDef=\"let row; columns: getColConfig.displayedColumnsInOrder\"></tr>\n </table>\n\n @if (!dataSource()?.data?.length) {\n <div class=\"mit-empty\">\n <mat-icon class=\"mit-empty-icon\">list</mat-icon>\n <strong class=\"mit-empty-title\">No items yet</strong>\n <p class=\"mit-empty-text\">\n <strong>Click the add button</strong> to create a new row. You'll fill in details using a form, and each\n saved entry appears as a row here.\n </p>\n </div>\n }\n </div>\n} @placeholder {\n <div class=\"mit-placeholder\">\n <mat-spinner diameter=\"32\" />\n </div>\n}\n\n@if (overlayOpen) {\n <div class=\"data-overlay-backdrop\" (click)=\"closeDataOverlay()\"></div>\n <div class=\"data-overlay-panel\"\n [style.top.px]=\"overlayPosition.top\"\n [style.left.px]=\"overlayPosition.left\"\n (click)=\"$event.stopPropagation()\">\n <div class=\"data-overlay-header\">\n <span class=\"data-overlay-title\">\n <mat-icon class=\"data-overlay-title-icon\">data_object</mat-icon>\n Data\n </span>\n <button mat-icon-button class=\"mit-data-button\" (click)=\"closeDataOverlay()\">\n <mat-icon class=\"mit-data-icon\">close</mat-icon>\n </button>\n </div>\n <div class=\"data-overlay-body\">\n <lib-t-dynamic-data-view [data]=\"overlayData\" />\n </div>\n </div>\n}\n\n<mat-menu #colOptions=\"matMenu\">\n <ng-template matMenuContent>\n @for (label of allPossibleLabels(); track label.formControlName) {\n <button mat-menu-item (click)=\"toggleTepLabel($event, label.formControlName);\">\n <mat-icon>{{ label.selected ? 'check_circle' : 'radio_button_unchecked' }}</mat-icon>\n {{ label.label }}\n </button>\n }\n </ng-template>\n</mat-menu>\n\n<mat-menu #rowOptions=\"matMenu\">\n <ng-template matMenuContent let-row=\"row\">\n @if (!inputConfig()?.readonly && !inputConfig()?.disabled) {\n @if (userCanEdit()) {\n <button mat-menu-item (click)=\"editItem(row)\">\n <mat-icon>edit</mat-icon>\n <div class=\"option-text\">\n <div class=\"option-main-text\">Edit</div>\n <div class=\"option-sub-text\">\n {{ inputConfig()?.readonly ? 'View item properties' : 'Modify item properties' }}\n </div>\n </div>\n </button>\n }\n @if (userCanAdd()) {\n <button mat-menu-item (click)=\"copy(row)\">\n <mat-icon>content_copy</mat-icon>\n <div class=\"option-text\">\n <div class=\"option-main-text\">Duplicate</div>\n <div class=\"option-sub-text\">Create a copy with same values</div>\n </div>\n </button>\n }\n\n @if (userCanRemove()) {\n @if (isAboutToDeleteRow(row)) {\n <button mat-menu-item (click)=\"multipleInputRemoveItem($event,row)\">\n <mat-icon color=\"accent\">cancel</mat-icon>\n <div class=\"option-text\">\n <div class=\"option-main-text option-main-text--cancel\">Cancel Deletion</div>\n <div class=\"option-sub-text\">Auto-deleting in {{ secondsCountDown() }} seconds...</div>\n </div>\n </button>\n <div class=\"deletion-progress-container\">\n <mat-progress-bar color=\"warn\" mode=\"determinate\" [value]=\"getCountdownSeconds()\"></mat-progress-bar>\n @if (getCountdownSeconds() > 75) {\n <div class=\"deletion-message\">Deleting soon...</div>\n }\n </div>\n } @else {\n <button mat-menu-item (click)=\"multipleInputRemoveItem($event,row)\">\n <mat-icon color=\"warn\">delete_outline</mat-icon>\n <div class=\"option-text\">\n <div class=\"option-main-text\">Delete</div>\n <div class=\"option-sub-text\">Will delete after 3 seconds (click to cancel)</div>\n </div>\n </button>\n }\n }\n }\n </ng-template>\n</mat-menu>\n", styles: [".table-container{max-width:100%!important;overflow:auto!important;border-radius:8px}.mit-table{width:100%;background:transparent}.mit-table .mat-mdc-header-cell,.mit-table .mat-mdc-cell{padding:0 .625rem;font-size:.8125rem}.mit-table .mat-mdc-header-row{min-height:2.25rem}.mit-table .mat-mdc-row{min-height:2.5rem;transition:background .2s cubic-bezier(.16,1,.3,1)}.mit-table .mat-mdc-row:hover{background:color-mix(in srgb,var(--mat-sys-primary, #6750a4) 5%,transparent)}.mit-th-label{text-align:start;line-height:normal;font-size:.6875rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--mat-sys-on-surface-variant, #49454f)}.mit-th-action{width:1.75rem;height:1.75rem;line-height:1.75rem;opacity:.55;transition:opacity .2s cubic-bezier(.16,1,.3,1)}.mit-th-action:hover{opacity:1}.cellClass{display:flex;align-items:center;min-height:2.5rem}.mit-group-start .mat-mdc-cell{border-top:2px solid var(--mat-sys-outline-variant, #cac4d0)}.functionClass{background:var(--mat-sys-surface-container, #f3edf7);font-weight:500}.mit-fn-label{width:100%;text-align:right;color:var(--mat-sys-on-surface-variant, #49454f);font-size:.6875rem;letter-spacing:.06em;text-transform:uppercase}.mit-row-trigger{margin-left:auto;margin-right:0;display:block}.mit-data-button{width:1.75rem;height:1.75rem;line-height:1.75rem}.mit-data-icon{font-size:1.125rem;width:1.125rem;height:1.125rem;line-height:1.125rem}.mit-state{display:flex;justify-content:center;padding:1rem;font-size:.8125rem;color:var(--mat-sys-on-surface-variant, #49454f);opacity:.7}.mit-empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.375rem;padding:1.5rem 1.25rem;color:var(--mat-sys-on-surface-variant, #49454f)}.mit-empty-icon{font-size:1.75rem;width:1.75rem;height:1.75rem;line-height:1.75rem;opacity:.5}.mit-empty-title{font-size:.875rem;color:var(--mat-sys-on-surface, #1c1b1f)}.mit-empty-text{margin:0;max-width:22rem;font-size:.75rem;line-height:1.45;opacity:.85}.mit-placeholder{display:flex;justify-content:center;align-items:center;padding:2rem}.option-text{display:flex;flex-direction:column;margin-left:.5rem}.option-main-text{font-size:.875rem;font-weight:500;margin-bottom:2px;line-height:normal}.option-main-text--cancel{color:var(--mat-sys-primary, #6750a4)}.option-sub-text{font-size:.75rem;color:var(--mat-sys-on-surface-variant, #49454f);font-weight:400;line-height:1.2}.deletion-progress-container{position:relative;padding:0 1rem .5rem}.deletion-message{position:absolute;right:1rem;top:2px;font-size:.6875rem;color:var(--mat-sys-error, #b3261e);font-weight:500;line-height:1.6;animation:pulse 1s infinite}button:has(+.deletion-progress-container){border-bottom:none!important;padding-bottom:4px!important}@keyframes pulse{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}@media(max-width:600px){.option-sub-text{max-width:180px;white-space:normal}}.data-overlay-backdrop{position:fixed;inset:0;z-index:999;background:transparent}.data-overlay-panel{position:fixed;z-index:1000;background:var(--mat-sys-surface, #fef7ff);border:1px solid color-mix(in srgb,var(--mat-sys-outline, #79747e) 15%,transparent);border-radius:12px;box-shadow:0 16px 56px color-mix(in srgb,var(--mat-sys-shadow, #000) 14%,transparent);min-width:280px;max-width:min(380px,calc(100vw - 16px));max-height:60vh;display:flex;flex-direction:column;overflow:hidden}.data-overlay-header{display:flex;align-items:center;justify-content:space-between;padding:.25rem .25rem .25rem .75rem;border-bottom:1px solid color-mix(in srgb,var(--mat-sys-outline, #79747e) 12%,transparent);flex-shrink:0}.data-overlay-title{font-size:.8125rem;font-weight:500;display:flex;align-items:center;color:var(--mat-sys-on-surface, #1c1b1f)}.data-overlay-title-icon{font-size:1rem;width:1rem;height:1rem;line-height:1rem;vertical-align:middle;margin-right:.25rem}.data-overlay-body{overflow:auto;padding:.25rem .5rem .5rem;flex:1}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "ngmodule", type: MatTableModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "component", type: TDynamicDataViewComponent, selector: "lib-t-dynamic-data-view", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [i2.MatIconButton, i4.MatChip, i3.MatIcon, i6.MatMenuTrigger, i2$1.MatSort, i5.MatTable, i5.MatHeaderCellDef, i5.MatHeaderRowDef, i5.MatColumnDef, i5.MatCellDef, i5.MatRowDef, i5.MatHeaderCell, i5.MatCell, i5.MatHeaderRow, i5.MatRow, i5$1.MatTooltip, import('./ngx-t-forms-ngx-t-forms-0gzvHzEK.mjs').then(function (n) { return n.aK; }).then(m => m.FormatDataPipe)]] }); }
|
|
431
|
-
}
|
|
432
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.12", ngImport: i0, type: MultipleInputTableViewComponent, resolveDeferredDeps: () => [import('./ngx-t-forms-ngx-t-forms-0gzvHzEK.mjs').then(function (n) { return n.aK; }).then(m => m.FormatDataPipe)], resolveMetadata: FormatDataPipe => ({ decorators: [{
|
|
433
|
-
type: Component,
|
|
434
|
-
args: [{ selector: 'lib-multiple-input-table-view', imports: [
|
|
435
|
-
MatButtonModule,
|
|
436
|
-
MatChipsModule,
|
|
437
|
-
MatIconModule,
|
|
438
|
-
MatMenuModule,
|
|
439
|
-
MatProgressBarModule,
|
|
440
|
-
MatProgressSpinnerModule,
|
|
441
|
-
MatSortModule,
|
|
442
|
-
MatTableModule,
|
|
443
|
-
MatTooltipModule,
|
|
444
|
-
FormatDataPipe,
|
|
445
|
-
TDynamicDataViewComponent,
|
|
446
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: "@defer (on viewport) {\n\n @if (getColConfig.displayedColumnsInOrder.length === 0) {\n <div class=\"mit-state mit-state--inline\">No columns</div>\n }\n\n <div class=\"table-container\">\n\n <table mat-table [dataSource]=\"(dataSource() || [])\" class=\"mit-table\" matSort matSortActive=\"created\"\n matSortDisableClear matSortDirection=\"desc\">\n @for (col of (displayedColumnsInOrder || []); track col) {\n <ng-container [matColumnDef]=\"col\">\n <th mat-header-cell *matHeaderCellDef>\n <span class=\"mit-th-label\">\n {{ getColConfig.columnsConfig?.[col]?.[\"label\"] }}\n </span>\n @if ($last) {\n <button matTooltip=\"Show other values\" [matMenuTriggerFor]=\"colOptions\" [matMenuTriggerData]=\"{}\"\n class=\"mit-th-action\" mat-icon-button>\n <mat-icon>label</mat-icon>\n </button>\n }\n </th>\n <td [class.functionClass]=\"row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION']\"\n [style.background]=\"returnBackground(row, getColConfig.columnsConfig?.[col])\"\n mat-cell *matCellDef=\"let row\">\n @if (getColConfig.columnsConfig?.[col]?.['type'] === 'removal') {\n <div class=\"cellClass\">\n\n @if (!!row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION'] && !row['id'] && !inputConfig()?.multipleInputInEditId ||\n !!row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION'] && inputConfig()?.multipleInputInEditId &&\n inputConfig()?.multipleInputInEditId !== row['id']) {\n <div class=\"mit-fn-label\">\n <strong>{{ getCalculationFunction(row) }}</strong>\n </div>\n }\n @if (\n userCanApplyOptionsTo() &&\n !row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION'] &&\n row[''] !== 'true' && !inputConfig()?.readonly && !inputConfig()?.disabled\n ) {\n <button mat-icon-button [color]=\"t.menuOpen ? 'primary' : 'basic'\" [matMenuTriggerFor]=\"rowOptions\" [matMenuTriggerData]=\"{row:row}\" #t=\"matMenuTrigger\"\n (click)=\"applyOptionsToFn(row)\"\n class=\"mit-row-trigger\">\n @if (rowIsInEdit(row)) {\n <mat-icon color=\"primary\">edit</mat-icon>\n } @else {\n <mat-icon>{{ t.menuOpen ? 'close' : 'more_horiz' }}</mat-icon>\n }\n </button>\n }\n\n @if (row['SYSTEM_KEY_IN_EDIT']) {\n <mat-chip>In {{ inputConfig()?.readonly ? 'View' : 'Edit' }}</mat-chip>\n }\n\n </div>\n }\n @if (getColConfig.columnsConfig && getColConfig.columnsConfig?.[col]?.type !== 'removal') {\n <div class=\"cellClass\">\n <span>\n @if (getColConfig.columnsConfig?.[col].dataType === 'array' || getColConfig.columnsConfig?.[col].dataType === 'object') {\n <button mat-icon-button class=\"mit-data-button\"\n matTooltip=\"View data\"\n (click)=\"openDataOverlay($event, row[col])\">\n <mat-icon class=\"mit-data-icon\">data_object</mat-icon>\n </button>\n } @else {\n {{ row[col] | formatData: getColConfig.columnsConfig?.[col].dataType }}\n }\n </span>\n </div>\n }\n </td>\n </ng-container>\n }\n\n\n <tr mat-header-row *matHeaderRowDef=\"getColConfig.displayedColumnsInOrder\"></tr>\n <tr [class.mit-group-start]=\"hasTopBorder(row)\" mat-row\n *matRowDef=\"let row; columns: getColConfig.displayedColumnsInOrder\"></tr>\n </table>\n\n @if (!dataSource()?.data?.length) {\n <div class=\"mit-empty\">\n <mat-icon class=\"mit-empty-icon\">list</mat-icon>\n <strong class=\"mit-empty-title\">No items yet</strong>\n <p class=\"mit-empty-text\">\n <strong>Click the add button</strong> to create a new row. You'll fill in details using a form, and each\n saved entry appears as a row here.\n </p>\n </div>\n }\n </div>\n} @placeholder {\n <div class=\"mit-placeholder\">\n <mat-spinner diameter=\"32\" />\n </div>\n}\n\n@if (overlayOpen) {\n <div class=\"data-overlay-backdrop\" (click)=\"closeDataOverlay()\"></div>\n <div class=\"data-overlay-panel\"\n [style.top.px]=\"overlayPosition.top\"\n [style.left.px]=\"overlayPosition.left\"\n (click)=\"$event.stopPropagation()\">\n <div class=\"data-overlay-header\">\n <span class=\"data-overlay-title\">\n <mat-icon class=\"data-overlay-title-icon\">data_object</mat-icon>\n Data\n </span>\n <button mat-icon-button class=\"mit-data-button\" (click)=\"closeDataOverlay()\">\n <mat-icon class=\"mit-data-icon\">close</mat-icon>\n </button>\n </div>\n <div class=\"data-overlay-body\">\n <lib-t-dynamic-data-view [data]=\"overlayData\" />\n </div>\n </div>\n}\n\n<mat-menu #colOptions=\"matMenu\">\n <ng-template matMenuContent>\n @for (label of allPossibleLabels(); track label.formControlName) {\n <button mat-menu-item (click)=\"toggleTepLabel($event, label.formControlName);\">\n <mat-icon>{{ label.selected ? 'check_circle' : 'radio_button_unchecked' }}</mat-icon>\n {{ label.label }}\n </button>\n }\n </ng-template>\n</mat-menu>\n\n<mat-menu #rowOptions=\"matMenu\">\n <ng-template matMenuContent let-row=\"row\">\n @if (!inputConfig()?.readonly && !inputConfig()?.disabled) {\n @if (userCanEdit()) {\n <button mat-menu-item (click)=\"editItem(row)\">\n <mat-icon>edit</mat-icon>\n <div class=\"option-text\">\n <div class=\"option-main-text\">Edit</div>\n <div class=\"option-sub-text\">\n {{ inputConfig()?.readonly ? 'View item properties' : 'Modify item properties' }}\n </div>\n </div>\n </button>\n }\n @if (userCanAdd()) {\n <button mat-menu-item (click)=\"copy(row)\">\n <mat-icon>content_copy</mat-icon>\n <div class=\"option-text\">\n <div class=\"option-main-text\">Duplicate</div>\n <div class=\"option-sub-text\">Create a copy with same values</div>\n </div>\n </button>\n }\n\n @if (userCanRemove()) {\n @if (isAboutToDeleteRow(row)) {\n <button mat-menu-item (click)=\"multipleInputRemoveItem($event,row)\">\n <mat-icon color=\"accent\">cancel</mat-icon>\n <div class=\"option-text\">\n <div class=\"option-main-text option-main-text--cancel\">Cancel Deletion</div>\n <div class=\"option-sub-text\">Auto-deleting in {{ secondsCountDown() }} seconds...</div>\n </div>\n </button>\n <div class=\"deletion-progress-container\">\n <mat-progress-bar color=\"warn\" mode=\"determinate\" [value]=\"getCountdownSeconds()\"></mat-progress-bar>\n @if (getCountdownSeconds() > 75) {\n <div class=\"deletion-message\">Deleting soon...</div>\n }\n </div>\n } @else {\n <button mat-menu-item (click)=\"multipleInputRemoveItem($event,row)\">\n <mat-icon color=\"warn\">delete_outline</mat-icon>\n <div class=\"option-text\">\n <div class=\"option-main-text\">Delete</div>\n <div class=\"option-sub-text\">Will delete after 3 seconds (click to cancel)</div>\n </div>\n </button>\n }\n }\n }\n </ng-template>\n</mat-menu>\n", styles: [".table-container{max-width:100%!important;overflow:auto!important;border-radius:8px}.mit-table{width:100%;background:transparent}.mit-table .mat-mdc-header-cell,.mit-table .mat-mdc-cell{padding:0 .625rem;font-size:.8125rem}.mit-table .mat-mdc-header-row{min-height:2.25rem}.mit-table .mat-mdc-row{min-height:2.5rem;transition:background .2s cubic-bezier(.16,1,.3,1)}.mit-table .mat-mdc-row:hover{background:color-mix(in srgb,var(--mat-sys-primary, #6750a4) 5%,transparent)}.mit-th-label{text-align:start;line-height:normal;font-size:.6875rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--mat-sys-on-surface-variant, #49454f)}.mit-th-action{width:1.75rem;height:1.75rem;line-height:1.75rem;opacity:.55;transition:opacity .2s cubic-bezier(.16,1,.3,1)}.mit-th-action:hover{opacity:1}.cellClass{display:flex;align-items:center;min-height:2.5rem}.mit-group-start .mat-mdc-cell{border-top:2px solid var(--mat-sys-outline-variant, #cac4d0)}.functionClass{background:var(--mat-sys-surface-container, #f3edf7);font-weight:500}.mit-fn-label{width:100%;text-align:right;color:var(--mat-sys-on-surface-variant, #49454f);font-size:.6875rem;letter-spacing:.06em;text-transform:uppercase}.mit-row-trigger{margin-left:auto;margin-right:0;display:block}.mit-data-button{width:1.75rem;height:1.75rem;line-height:1.75rem}.mit-data-icon{font-size:1.125rem;width:1.125rem;height:1.125rem;line-height:1.125rem}.mit-state{display:flex;justify-content:center;padding:1rem;font-size:.8125rem;color:var(--mat-sys-on-surface-variant, #49454f);opacity:.7}.mit-empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.375rem;padding:1.5rem 1.25rem;color:var(--mat-sys-on-surface-variant, #49454f)}.mit-empty-icon{font-size:1.75rem;width:1.75rem;height:1.75rem;line-height:1.75rem;opacity:.5}.mit-empty-title{font-size:.875rem;color:var(--mat-sys-on-surface, #1c1b1f)}.mit-empty-text{margin:0;max-width:22rem;font-size:.75rem;line-height:1.45;opacity:.85}.mit-placeholder{display:flex;justify-content:center;align-items:center;padding:2rem}.option-text{display:flex;flex-direction:column;margin-left:.5rem}.option-main-text{font-size:.875rem;font-weight:500;margin-bottom:2px;line-height:normal}.option-main-text--cancel{color:var(--mat-sys-primary, #6750a4)}.option-sub-text{font-size:.75rem;color:var(--mat-sys-on-surface-variant, #49454f);font-weight:400;line-height:1.2}.deletion-progress-container{position:relative;padding:0 1rem .5rem}.deletion-message{position:absolute;right:1rem;top:2px;font-size:.6875rem;color:var(--mat-sys-error, #b3261e);font-weight:500;line-height:1.6;animation:pulse 1s infinite}button:has(+.deletion-progress-container){border-bottom:none!important;padding-bottom:4px!important}@keyframes pulse{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}@media(max-width:600px){.option-sub-text{max-width:180px;white-space:normal}}.data-overlay-backdrop{position:fixed;inset:0;z-index:999;background:transparent}.data-overlay-panel{position:fixed;z-index:1000;background:var(--mat-sys-surface, #fef7ff);border:1px solid color-mix(in srgb,var(--mat-sys-outline, #79747e) 15%,transparent);border-radius:12px;box-shadow:0 16px 56px color-mix(in srgb,var(--mat-sys-shadow, #000) 14%,transparent);min-width:280px;max-width:min(380px,calc(100vw - 16px));max-height:60vh;display:flex;flex-direction:column;overflow:hidden}.data-overlay-header{display:flex;align-items:center;justify-content:space-between;padding:.25rem .25rem .25rem .75rem;border-bottom:1px solid color-mix(in srgb,var(--mat-sys-outline, #79747e) 12%,transparent);flex-shrink:0}.data-overlay-title{font-size:.8125rem;font-weight:500;display:flex;align-items:center;color:var(--mat-sys-on-surface, #1c1b1f)}.data-overlay-title-icon{font-size:1rem;width:1rem;height:1rem;line-height:1rem;vertical-align:middle;margin-right:.25rem}.data-overlay-body{overflow:auto;padding:.25rem .5rem .5rem;flex:1}\n"] }]
|
|
447
|
-
}], ctorParameters: null, propDecorators: { inputConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputConfig", required: false }] }], dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: false }] }], applyOptionsTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "applyOptionsTo", required: false }] }], formGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "formGroup", required: false }] }], onEditItem: [{ type: i0.Output, args: ["onEditItem"] }], onDeleteItem: [{ type: i0.Output, args: ["onDeleteItem"] }], onCopy: [{ type: i0.Output, args: ["onCopy"] }], onApplyOptionsTo: [{ type: i0.Output, args: ["onApplyOptionsTo"] }], showItemAsLabel: [{ type: i0.Output, args: ["showItemAsLabel"] }] } }) });
|
|
448
|
-
|
|
449
|
-
class MultipleInputTableEditComponent {
|
|
450
|
-
constructor() {
|
|
451
|
-
this.InputComponent = TFormInputComponent;
|
|
452
|
-
this.inputConfig = input.required(...(ngDevMode ? [{ debugName: "inputConfig" }] : /* istanbul ignore next */ []));
|
|
453
|
-
this.editorMode = input(false, ...(ngDevMode ? [{ debugName: "editorMode" }] : /* istanbul ignore next */ []));
|
|
454
|
-
this.formGroup = input(null, ...(ngDevMode ? [{ debugName: "formGroup" }] : /* istanbul ignore next */ []));
|
|
455
|
-
this.formBuilderFunctions = input(undefined, ...(ngDevMode ? [{ debugName: "formBuilderFunctions" }] : /* istanbul ignore next */ []));
|
|
456
|
-
this.onSaveMultipleInputForm = output();
|
|
457
|
-
this.editMultipleInput = output();
|
|
458
|
-
this.deleteInput = output();
|
|
459
|
-
this.showItemAsLabel = output();
|
|
460
|
-
this.addFunction = output();
|
|
461
|
-
this.reorderItems = output();
|
|
462
|
-
this.calculationFunctions = Object.values(CalculationFunctions);
|
|
463
|
-
this.activeInput = '';
|
|
464
|
-
this.dragging = false;
|
|
465
|
-
this.overId = null;
|
|
466
|
-
this.areYouSure = false;
|
|
467
|
-
this.countdownSeconds = {};
|
|
468
|
-
this.innerInputs = computed(() => {
|
|
469
|
-
const cfg = this.inputConfig();
|
|
470
|
-
return (cfg?.formInputs?.map((input) => ({
|
|
471
|
-
...input,
|
|
472
|
-
originalId: input.id,
|
|
473
|
-
id: `${cfg?.id}.${input.id}`,
|
|
474
|
-
})) || []);
|
|
475
|
-
}, ...(ngDevMode ? [{ debugName: "innerInputs" }] : /* istanbul ignore next */ []));
|
|
476
|
-
this.rowInUpdate = computed(() => {
|
|
477
|
-
const cfg = this.inputConfig();
|
|
478
|
-
const fg = this.formGroup();
|
|
479
|
-
return !!cfg?.formIsOpen && !!fg?.controls[`${cfg?.id}.id`]?.value;
|
|
480
|
-
}, ...(ngDevMode ? [{ debugName: "rowInUpdate" }] : /* istanbul ignore next */ []));
|
|
481
|
-
this.formInvalid = computed(() => {
|
|
482
|
-
const cfg = this.inputConfig();
|
|
483
|
-
const fg = this.formGroup();
|
|
484
|
-
const allControls = [];
|
|
485
|
-
cfg?.formInputs?.forEach((input) => {
|
|
486
|
-
const control = fg?.controls[`${cfg?.id}.${input.id}`];
|
|
487
|
-
if (control) {
|
|
488
|
-
allControls.push(control);
|
|
489
|
-
}
|
|
490
|
-
});
|
|
491
|
-
return allControls.some((control) => control?.invalid || !control);
|
|
492
|
-
}, ...(ngDevMode ? [{ debugName: "formInvalid" }] : /* istanbul ignore next */ []));
|
|
493
|
-
this.#destroyRef = inject(DestroyRef);
|
|
494
|
-
}
|
|
495
|
-
#destroyRef;
|
|
496
|
-
ngOnDestroy() {
|
|
497
|
-
Object.values(this.countdownSeconds).forEach(({ stop$ }) => stop$.complete());
|
|
498
|
-
}
|
|
499
|
-
saveMultipleInputForm() {
|
|
500
|
-
this.onSaveMultipleInputForm.emit();
|
|
501
|
-
}
|
|
502
|
-
inputWillBeRemovedIn(id) {
|
|
503
|
-
return this.countdownSeconds[id]?.count;
|
|
504
|
-
}
|
|
505
|
-
removeInput(item) {
|
|
506
|
-
if (this.countdownSeconds[item.id]) {
|
|
507
|
-
this.stopDeletion(item.id);
|
|
508
|
-
return;
|
|
509
|
-
}
|
|
510
|
-
this.countdownSeconds[item.id] = {
|
|
511
|
-
count: 5,
|
|
512
|
-
stop$: new Subject(),
|
|
513
|
-
};
|
|
514
|
-
const countdown$ = timer(0, 1000).pipe(tap((secondsElapsed) => {
|
|
515
|
-
const data = this.countdownSeconds[item.id];
|
|
516
|
-
if (!data) {
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
const remainingTime = 5 - secondsElapsed;
|
|
520
|
-
if (remainingTime <= 0) {
|
|
521
|
-
this.formDeleteInput(item);
|
|
522
|
-
this.stopDeletion(item.id);
|
|
523
|
-
}
|
|
524
|
-
else {
|
|
525
|
-
data.count = remainingTime;
|
|
526
|
-
}
|
|
527
|
-
}), takeUntil(this.countdownSeconds[item.id].stop$), takeUntilDestroyed(this.#destroyRef));
|
|
528
|
-
countdown$.subscribe({
|
|
529
|
-
complete: () => { },
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
stopDeletion(id) {
|
|
533
|
-
if (this.countdownSeconds[id]) {
|
|
534
|
-
this.countdownSeconds[id]?.stop$.next();
|
|
535
|
-
delete this.countdownSeconds[id];
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
formDeleteInput(item) {
|
|
539
|
-
this.deleteInput.emit(item);
|
|
540
|
-
}
|
|
541
|
-
dropItems(event) {
|
|
542
|
-
this.reorderItems.emit(event);
|
|
543
|
-
}
|
|
544
|
-
editInput(input) {
|
|
545
|
-
this.editMultipleInput.emit(input);
|
|
546
|
-
}
|
|
547
|
-
toggleLabel(item) {
|
|
548
|
-
this.showItemAsLabel.emit(item);
|
|
549
|
-
}
|
|
550
|
-
toggleFunction(func, _inputId) {
|
|
551
|
-
const addFunction = {
|
|
552
|
-
id: v4(),
|
|
553
|
-
inputId: this.activeInput,
|
|
554
|
-
func,
|
|
555
|
-
};
|
|
556
|
-
this.addFunction.emit(addFunction);
|
|
557
|
-
}
|
|
558
|
-
selectedFunction(func) {
|
|
559
|
-
return this.inputConfig()?.calculateListFunctions?.find((f) => f.inputId === this.activeInput && f.func === func);
|
|
560
|
-
}
|
|
561
|
-
closeMultipleInput() {
|
|
562
|
-
if (this.areYouSure) {
|
|
563
|
-
this.formBuilderFunctions()?.multipleInputToggleForm(this.inputConfig().id, false);
|
|
564
|
-
this.areYouSure = false;
|
|
565
|
-
return;
|
|
566
|
-
}
|
|
567
|
-
this.areYouSure = true;
|
|
568
|
-
}
|
|
569
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MultipleInputTableEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
570
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: MultipleInputTableEditComponent, isStandalone: true, selector: "lib-multiple-input-table-edit", inputs: { inputConfig: { classPropertyName: "inputConfig", publicName: "inputConfig", isSignal: true, isRequired: true, transformFunction: null }, editorMode: { classPropertyName: "editorMode", publicName: "editorMode", isSignal: true, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: false, transformFunction: null }, formBuilderFunctions: { classPropertyName: "formBuilderFunctions", publicName: "formBuilderFunctions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSaveMultipleInputForm: "onSaveMultipleInputForm", editMultipleInput: "editMultipleInput", deleteInput: "deleteInput", showItemAsLabel: "showItemAsLabel", addFunction: "addFunction", reorderItems: "reorderItems" }, ngImport: i0, template: "<mat-card appearance=\"outlined\" class=\"edit-card mat-elevation-z4\">\n <mat-card-content>\n <div class=\"list row\" (cdkDropListDropped)=\"dropItems($event)\"\n [cdkDropListData]=\"innerInputs()\" cdkDropList #InputList=\"cdkDropList\">\n @for (innerInput of innerInputs(); track innerInput.id) {\n <ng-container>\n @if (editorMode()) {\n @if (!!formGroup()) {\n <mat-card (mouseover)=\"activeInput = innerInput.id\" cdkDrag\n (cdkDragStarted)=\"dragging = true\" (cdkDragReleased)=\"dragging = false\"\n [class.inputCardElevated]=\"activeInput === innerInput.id\"\n [class.inputCard]=\"activeInput !== innerInput.id\"\n [class]=\"'col-md-' + (dragging ? '12' : innerInput.colSize)\" class=\"box\">\n <ng-container *ngComponentOutlet=\"InputComponent;\n inputs: {\n inputConfig: innerInput,\n formGroup: formGroup(),\n formBuilderFunctions: formBuilderFunctions(),\n }\">\n </ng-container>\n @if (activeInput === innerInput.id) {\n <mat-card-actions class=\"input-actions\">\n <span class=\"spacer\"></span>\n <button [matTooltip]=\"'Edit Input: ' + innerInput.label\"\n (click)=\"editInput(innerInput)\" mat-icon-button>\n <mat-icon>edit</mat-icon>\n </button>\n @if (!!inputWillBeRemovedIn(innerInput.id)) {\n <button (mouseover)=\"overId = innerInput.id\" (mouseout)=\"overId = null\"\n (click)=\"removeInput(innerInput)\" color=\"warn\" mat-stroked-button>\n <div class=\"countdown-button\">\n <mat-progress-spinner class=\"cancelProgress\" color=\"primary\"\n [value]=\"((inputWillBeRemovedIn(innerInput.id) || 0) / 5) * 100\">\n </mat-progress-spinner>\n {{ overId === innerInput.id ? 'Click to cancel' : 'Deleting in' }}\n {{ inputWillBeRemovedIn(innerInput.id) }}\n </div>\n </button>\n } @else if (inputConfig().systemDefault !== true && innerInput.systemDefault !== true) {\n <button [matTooltip]=\"'Delete input ' + innerInput.label\"\n (click)=\"removeInput(innerInput)\" mat-icon-button>\n <mat-icon>delete</mat-icon>\n </button>\n }\n <span class=\"action-divider\"></span>\n @if (!!innerInput.showAsLabel && innerInput.dataType === 'number' || !!innerInput.showAsLabel && innerInput.type === 'number') {\n <button\n [matMenuTriggerFor]=\"calculationMenu\"\n [matMenuTriggerData]=\"{inputId:innerInput.originalId || innerInput.id}\"\n [matTooltip]=\"'calculate sum,avg,min,max'\"\n mat-icon-button>\n <mat-icon>calculate</mat-icon>\n </button>\n }\n <button [color]=\"innerInput.showAsLabel ? 'primary' : ''\"\n (click)=\"toggleLabel(innerInput)\"\n [matTooltip]=\"innerInput.showAsLabel ? 'Hide as label' : 'Show as label'\"\n mat-icon-button>\n <mat-icon>label</mat-icon>\n </button>\n <span class=\"spacer\"></span>\n </mat-card-actions>\n }\n </mat-card>\n }\n } @else {\n <div [class]=\"'col-md-' + (dragging ? '12' : innerInput.colSize)\" class=\"box\">\n <ng-container *ngComponentOutlet=\"InputComponent;\n inputs: {\n inputConfig: innerInput,\n formGroup: formGroup(),\n formBuilderFunctions: formBuilderFunctions(),\n }\">\n </ng-container>\n </div>\n }\n </ng-container>\n }\n @if (!!editorMode() && innerInputs().length === 0) {\n <div class=\"tree-instructions\">\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\n <span>\n <strong>Add Form Input</strong>\n <br>\n Manage your list by adding, editing, or removing items. Each item is customizable through a form.\n </span>\n </div>\n }\n </div>\n </mat-card-content>\n @if (innerInputs().length !== 0) {\n <mat-divider></mat-divider>\n <mat-card-actions align=\"end\" class=\"edit-card-actions\">\n <button [color]=\"areYouSure ? 'warn' : ''\"\n [class.confirm-leave]=\"areYouSure\" mat-button\n (click)=\"closeMultipleInput()\">\n {{ areYouSure ? \"leave without saving\" : \"cancel\" }}\n </button>\n @if (!inputConfig().readonly) {\n <button [disabled]=\"!!formInvalid()\" class=\"save-button\" color=\"primary\"\n (click)=\"saveMultipleInputForm()\" mat-raised-button>\n {{ rowInUpdate() ? \"Update\" : \"Save\" }}\n </button>\n }\n </mat-card-actions>\n }\n</mat-card>\n\n\n<mat-menu #calculationMenu=\"matMenu\">\n <ng-template matMenuContent let-inputId=\"sectionId\">\n @for (func of calculationFunctions; track func) {\n <button (click)=\"toggleFunction(func, inputId)\" mat-menu-item>\n {{ func }}\n @if (selectedFunction(func)) {\n <mat-icon color=\"primary\">check_circle</mat-icon>\n }\n </button>\n }\n </ng-template>\n</mat-menu>\n", styles: [".edit-card{margin-top:.5rem;background:var(--mat-sys-surface-container, #f3edf7);border-radius:12px}.inputCardElevated{background:var(--mat-sys-surface, #fef7ff);box-shadow:var(--mdc-elevated-card-container-elevation);transition:box-shadow .3s cubic-bezier(.16,1,.3,1)}.inputCard{box-shadow:none;transition:box-shadow .3s cubic-bezier(.16,1,.3,1)}.list{min-height:60px}.box{padding:.25rem;cursor:move}.input-actions{display:flex;align-items:center;gap:.125rem}.action-divider{width:1px;align-self:stretch;margin:.25rem;background:color-mix(in srgb,var(--mat-sys-outline, #79747e) 25%,transparent)}.countdown-button{display:flex;align-items:center}.cdk-drag-preview{box-sizing:border-box;border:none;border-radius:8px;box-shadow:0 5px 5px -3px color-mix(in srgb,var(--mat-sys-shadow, #000) 20%,transparent),0 8px 10px 1px color-mix(in srgb,var(--mat-sys-shadow, #000) 14%,transparent),0 3px 14px 2px color-mix(in srgb,var(--mat-sys-shadow, #000) 12%,transparent)}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.box:last-child{border:none}.list.cdk-drop-list-dragging .box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.cancelProgress{height:24px!important;width:24px!important;margin-right:.3125rem}.edit-card-actions{gap:.5rem;padding:.5rem .75rem .75rem}.confirm-leave{text-decoration:underline}.save-button{min-width:10em}.tree-instructions{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:color-mix(in srgb,var(--mat-sys-primary, #6750a4) 6%,transparent);border:1px solid color-mix(in srgb,var(--mat-sys-primary, #6750a4) 14%,transparent);border-radius:8px;margin-bottom:1rem;font-size:.8125rem;color:var(--mat-sys-on-surface-variant, #49454f)}.info-icon{min-width:38px!important;display:block;margin-top:4px;margin-bottom:auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { 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: MatCardModule }, { kind: "component", type: i3$2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3$2.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i3$2.MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i6$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
571
|
-
}
|
|
572
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MultipleInputTableEditComponent, decorators: [{
|
|
573
|
-
type: Component,
|
|
574
|
-
args: [{ selector: 'lib-multiple-input-table-edit', imports: [
|
|
575
|
-
CommonModule,
|
|
576
|
-
DragDropModule,
|
|
577
|
-
MatButtonModule,
|
|
578
|
-
MatCardModule,
|
|
579
|
-
MatDividerModule,
|
|
580
|
-
MatIconModule,
|
|
581
|
-
MatMenuModule,
|
|
582
|
-
MatProgressSpinnerModule,
|
|
583
|
-
MatTooltipModule,
|
|
584
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: "<mat-card appearance=\"outlined\" class=\"edit-card mat-elevation-z4\">\n <mat-card-content>\n <div class=\"list row\" (cdkDropListDropped)=\"dropItems($event)\"\n [cdkDropListData]=\"innerInputs()\" cdkDropList #InputList=\"cdkDropList\">\n @for (innerInput of innerInputs(); track innerInput.id) {\n <ng-container>\n @if (editorMode()) {\n @if (!!formGroup()) {\n <mat-card (mouseover)=\"activeInput = innerInput.id\" cdkDrag\n (cdkDragStarted)=\"dragging = true\" (cdkDragReleased)=\"dragging = false\"\n [class.inputCardElevated]=\"activeInput === innerInput.id\"\n [class.inputCard]=\"activeInput !== innerInput.id\"\n [class]=\"'col-md-' + (dragging ? '12' : innerInput.colSize)\" class=\"box\">\n <ng-container *ngComponentOutlet=\"InputComponent;\n inputs: {\n inputConfig: innerInput,\n formGroup: formGroup(),\n formBuilderFunctions: formBuilderFunctions(),\n }\">\n </ng-container>\n @if (activeInput === innerInput.id) {\n <mat-card-actions class=\"input-actions\">\n <span class=\"spacer\"></span>\n <button [matTooltip]=\"'Edit Input: ' + innerInput.label\"\n (click)=\"editInput(innerInput)\" mat-icon-button>\n <mat-icon>edit</mat-icon>\n </button>\n @if (!!inputWillBeRemovedIn(innerInput.id)) {\n <button (mouseover)=\"overId = innerInput.id\" (mouseout)=\"overId = null\"\n (click)=\"removeInput(innerInput)\" color=\"warn\" mat-stroked-button>\n <div class=\"countdown-button\">\n <mat-progress-spinner class=\"cancelProgress\" color=\"primary\"\n [value]=\"((inputWillBeRemovedIn(innerInput.id) || 0) / 5) * 100\">\n </mat-progress-spinner>\n {{ overId === innerInput.id ? 'Click to cancel' : 'Deleting in' }}\n {{ inputWillBeRemovedIn(innerInput.id) }}\n </div>\n </button>\n } @else if (inputConfig().systemDefault !== true && innerInput.systemDefault !== true) {\n <button [matTooltip]=\"'Delete input ' + innerInput.label\"\n (click)=\"removeInput(innerInput)\" mat-icon-button>\n <mat-icon>delete</mat-icon>\n </button>\n }\n <span class=\"action-divider\"></span>\n @if (!!innerInput.showAsLabel && innerInput.dataType === 'number' || !!innerInput.showAsLabel && innerInput.type === 'number') {\n <button\n [matMenuTriggerFor]=\"calculationMenu\"\n [matMenuTriggerData]=\"{inputId:innerInput.originalId || innerInput.id}\"\n [matTooltip]=\"'calculate sum,avg,min,max'\"\n mat-icon-button>\n <mat-icon>calculate</mat-icon>\n </button>\n }\n <button [color]=\"innerInput.showAsLabel ? 'primary' : ''\"\n (click)=\"toggleLabel(innerInput)\"\n [matTooltip]=\"innerInput.showAsLabel ? 'Hide as label' : 'Show as label'\"\n mat-icon-button>\n <mat-icon>label</mat-icon>\n </button>\n <span class=\"spacer\"></span>\n </mat-card-actions>\n }\n </mat-card>\n }\n } @else {\n <div [class]=\"'col-md-' + (dragging ? '12' : innerInput.colSize)\" class=\"box\">\n <ng-container *ngComponentOutlet=\"InputComponent;\n inputs: {\n inputConfig: innerInput,\n formGroup: formGroup(),\n formBuilderFunctions: formBuilderFunctions(),\n }\">\n </ng-container>\n </div>\n }\n </ng-container>\n }\n @if (!!editorMode() && innerInputs().length === 0) {\n <div class=\"tree-instructions\">\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\n <span>\n <strong>Add Form Input</strong>\n <br>\n Manage your list by adding, editing, or removing items. Each item is customizable through a form.\n </span>\n </div>\n }\n </div>\n </mat-card-content>\n @if (innerInputs().length !== 0) {\n <mat-divider></mat-divider>\n <mat-card-actions align=\"end\" class=\"edit-card-actions\">\n <button [color]=\"areYouSure ? 'warn' : ''\"\n [class.confirm-leave]=\"areYouSure\" mat-button\n (click)=\"closeMultipleInput()\">\n {{ areYouSure ? \"leave without saving\" : \"cancel\" }}\n </button>\n @if (!inputConfig().readonly) {\n <button [disabled]=\"!!formInvalid()\" class=\"save-button\" color=\"primary\"\n (click)=\"saveMultipleInputForm()\" mat-raised-button>\n {{ rowInUpdate() ? \"Update\" : \"Save\" }}\n </button>\n }\n </mat-card-actions>\n }\n</mat-card>\n\n\n<mat-menu #calculationMenu=\"matMenu\">\n <ng-template matMenuContent let-inputId=\"sectionId\">\n @for (func of calculationFunctions; track func) {\n <button (click)=\"toggleFunction(func, inputId)\" mat-menu-item>\n {{ func }}\n @if (selectedFunction(func)) {\n <mat-icon color=\"primary\">check_circle</mat-icon>\n }\n </button>\n }\n </ng-template>\n</mat-menu>\n", styles: [".edit-card{margin-top:.5rem;background:var(--mat-sys-surface-container, #f3edf7);border-radius:12px}.inputCardElevated{background:var(--mat-sys-surface, #fef7ff);box-shadow:var(--mdc-elevated-card-container-elevation);transition:box-shadow .3s cubic-bezier(.16,1,.3,1)}.inputCard{box-shadow:none;transition:box-shadow .3s cubic-bezier(.16,1,.3,1)}.list{min-height:60px}.box{padding:.25rem;cursor:move}.input-actions{display:flex;align-items:center;gap:.125rem}.action-divider{width:1px;align-self:stretch;margin:.25rem;background:color-mix(in srgb,var(--mat-sys-outline, #79747e) 25%,transparent)}.countdown-button{display:flex;align-items:center}.cdk-drag-preview{box-sizing:border-box;border:none;border-radius:8px;box-shadow:0 5px 5px -3px color-mix(in srgb,var(--mat-sys-shadow, #000) 20%,transparent),0 8px 10px 1px color-mix(in srgb,var(--mat-sys-shadow, #000) 14%,transparent),0 3px 14px 2px color-mix(in srgb,var(--mat-sys-shadow, #000) 12%,transparent)}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.box:last-child{border:none}.list.cdk-drop-list-dragging .box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.cancelProgress{height:24px!important;width:24px!important;margin-right:.3125rem}.edit-card-actions{gap:.5rem;padding:.5rem .75rem .75rem}.confirm-leave{text-decoration:underline}.save-button{min-width:10em}.tree-instructions{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:color-mix(in srgb,var(--mat-sys-primary, #6750a4) 6%,transparent);border:1px solid color-mix(in srgb,var(--mat-sys-primary, #6750a4) 14%,transparent);border-radius:8px;margin-bottom:1rem;font-size:.8125rem;color:var(--mat-sys-on-surface-variant, #49454f)}.info-icon{min-width:38px!important;display:block;margin-top:4px;margin-bottom:auto}\n"] }]
|
|
585
|
-
}], propDecorators: { inputConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputConfig", required: true }] }], editorMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "editorMode", required: false }] }], formGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "formGroup", required: false }] }], formBuilderFunctions: [{ type: i0.Input, args: [{ isSignal: true, alias: "formBuilderFunctions", required: false }] }], onSaveMultipleInputForm: [{ type: i0.Output, args: ["onSaveMultipleInputForm"] }], editMultipleInput: [{ type: i0.Output, args: ["editMultipleInput"] }], deleteInput: [{ type: i0.Output, args: ["deleteInput"] }], showItemAsLabel: [{ type: i0.Output, args: ["showItemAsLabel"] }], addFunction: [{ type: i0.Output, args: ["addFunction"] }], reorderItems: [{ type: i0.Output, args: ["reorderItems"] }] } });
|
|
586
|
-
|
|
587
|
-
function getCaluculatedTableData(inputConfig, data) {
|
|
588
|
-
try {
|
|
589
|
-
if (!Array.isArray(data) || !inputConfig)
|
|
590
|
-
return data;
|
|
591
|
-
const input = inputConfig;
|
|
592
|
-
const funcs = (input?.calculateListFunctions || []);
|
|
593
|
-
const allUniqueFunctionNames = [
|
|
594
|
-
...new Set(funcs.map((f) => f.func)),
|
|
595
|
-
];
|
|
596
|
-
const calculatedData = allUniqueFunctionNames.map((func) => {
|
|
597
|
-
const newCalculatedData = {
|
|
598
|
-
SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION: func,
|
|
599
|
-
};
|
|
600
|
-
funcs.filter((f) => f.func === func).forEach((f) => {
|
|
601
|
-
const arrayValues = data.map((d) => Number(d[f.inputId]));
|
|
602
|
-
newCalculatedData[f.inputId] = calculateListOveralFunctions(func, arrayValues);
|
|
603
|
-
});
|
|
604
|
-
return newCalculatedData;
|
|
605
|
-
});
|
|
606
|
-
return [...data, ...calculatedData];
|
|
607
|
-
}
|
|
608
|
-
catch (error) {
|
|
609
|
-
return data;
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
const customInputConfig = {
|
|
614
|
-
controlType: 'app-multiple-input-table',
|
|
615
|
-
nextId: 0,
|
|
616
|
-
};
|
|
617
|
-
class MultipleInputTableComponent extends BaseCustomInput {
|
|
618
|
-
#destroyRef;
|
|
619
|
-
constructor() {
|
|
620
|
-
super(inject(NgControl, { self: true, optional: true }), inject(ElementRef), customInputConfig);
|
|
621
|
-
this.editorMode = input(false, ...(ngDevMode ? [{ debugName: "editorMode" }] : /* istanbul ignore next */ []));
|
|
622
|
-
this.formGroup = input.required(...(ngDevMode ? [{ debugName: "formGroup" }] : /* istanbul ignore next */ []));
|
|
623
|
-
this.inputConfig = input.required(...(ngDevMode ? [{ debugName: "inputConfig" }] : /* istanbul ignore next */ []));
|
|
624
|
-
this.formBuilderFunctions = input(undefined, ...(ngDevMode ? [{ debugName: "formBuilderFunctions" }] : /* istanbul ignore next */ []));
|
|
625
|
-
this.#destroyRef = inject(DestroyRef);
|
|
626
|
-
this.rowInViewOnly = undefined;
|
|
627
|
-
this.listenToValueChanges();
|
|
628
|
-
}
|
|
629
|
-
/**
|
|
630
|
-
* Manages custom validation errors on the form control.
|
|
631
|
-
* Intended to be called from the ngDoCheck lifecycle hook.
|
|
632
|
-
* This function handles both the 'required' error and the new
|
|
633
|
-
* 'multipleInputListMissingSomeFields' custom error.
|
|
634
|
-
*/
|
|
635
|
-
checkValidationsAnErrors() {
|
|
636
|
-
const control = this.ngControl?.control;
|
|
637
|
-
// 1. Early exit if there's no form control to work with.
|
|
638
|
-
if (!control) {
|
|
639
|
-
return;
|
|
640
|
-
}
|
|
641
|
-
// --- DEFINE THE DESIRED ERROR STATE ---
|
|
642
|
-
// 2. Determine if the custom "multiple fields" error should exist.
|
|
643
|
-
let shouldHaveCustomError = false;
|
|
644
|
-
const formInputs = this.inputConfig()?.formInputs;
|
|
645
|
-
if (Array.isArray(formInputs) && Array.isArray(this.value)) {
|
|
646
|
-
const requiredFieldIds = formInputs
|
|
647
|
-
.filter(i => i.required)
|
|
648
|
-
.map(i => i.id);
|
|
649
|
-
if (requiredFieldIds.length > 0) {
|
|
650
|
-
const configId = this.inputConfig().id;
|
|
651
|
-
shouldHaveCustomError = this.value.some(item => requiredFieldIds.some(id => this._isNilOrEmpty(item?.[`${configId}.${id}`])));
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
// 3. Determine if the standard 'required' error should exist.
|
|
655
|
-
const shouldHaveRequiredError = this.required && this._isNilOrEmpty(this.value);
|
|
656
|
-
// --- APPLY THE ERROR STATE TO THE CONTROL ---
|
|
657
|
-
// 4. Preserve other errors that might be on the control (e.g., minlength, pattern).
|
|
658
|
-
const newErrors = { ...control.errors };
|
|
659
|
-
delete newErrors['required'];
|
|
660
|
-
delete newErrors['multipleInputListMissingSomeFields'];
|
|
661
|
-
// 5. Add our managed errors back if their conditions are met.
|
|
662
|
-
if (shouldHaveRequiredError) {
|
|
663
|
-
newErrors['required'] = true;
|
|
664
|
-
}
|
|
665
|
-
if (shouldHaveCustomError) {
|
|
666
|
-
newErrors['multipleInputListMissingSomeFields'] = { value: true }; // Or simply 'true'
|
|
667
|
-
}
|
|
668
|
-
// 6. Finalize the error object. If no errors, it must be null.
|
|
669
|
-
const finalErrors = Object.keys(newErrors).length > 0 ? newErrors : null;
|
|
670
|
-
// 7. IMPORTANT: Only update the control if the errors have actually changed.
|
|
671
|
-
// This prevents infinite loops within ngDoCheck. A simple stringify is a
|
|
672
|
-
// dependency-free way to compare the error objects.
|
|
673
|
-
if (JSON.stringify(control.errors) !== JSON.stringify(finalErrors)) {
|
|
674
|
-
control.setErrors(finalErrors);
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
get empty() {
|
|
678
|
-
return !this.value;
|
|
679
|
-
}
|
|
680
|
-
get shouldLabelFloat() {
|
|
681
|
-
return this.focused || !this.empty;
|
|
682
|
-
}
|
|
683
|
-
get errorState() {
|
|
684
|
-
// 1. Check for standard validation errors from Angular's Forms API.
|
|
685
|
-
const hasStandardError = !!this.ngControl?.errors;
|
|
686
|
-
// 2. Check for custom validation errors specific to 'IMultiple' type.
|
|
687
|
-
let hasCustomError = false;
|
|
688
|
-
const formInputs = this.inputConfig()?.formInputs;
|
|
689
|
-
// This custom logic only runs if the config and value are the expected array types.
|
|
690
|
-
if (Array.isArray(formInputs) && Array.isArray(this.value)) {
|
|
691
|
-
const requiredFieldIds = formInputs
|
|
692
|
-
.filter(input => input.required)
|
|
693
|
-
.map(input => input.id);
|
|
694
|
-
// The custom error is true if any item in our value array is missing
|
|
695
|
-
// a value for any of its required sub-fields.
|
|
696
|
-
if (requiredFieldIds.length > 0) {
|
|
697
|
-
hasCustomError = this.value.some(item => requiredFieldIds.some(id => this._isNilOrEmpty(item?.[`${this.inputConfig().id}.${id}`])));
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
// 3. The final error state is true if *any* validation fails,
|
|
701
|
-
// AND the control has been "touched" by the user.
|
|
702
|
-
return (hasStandardError || hasCustomError) && this.touched;
|
|
703
|
-
}
|
|
704
|
-
_isNilOrEmpty(value) {
|
|
705
|
-
return value === null || value === undefined || value === '';
|
|
706
|
-
}
|
|
707
|
-
listenToValueChanges() {
|
|
708
|
-
this.stateChanges
|
|
709
|
-
.pipe(takeUntilDestroyed(this.#destroyRef))
|
|
710
|
-
.subscribe(() => {
|
|
711
|
-
this.checkItemList();
|
|
712
|
-
});
|
|
713
|
-
}
|
|
714
|
-
checkItemList() {
|
|
715
|
-
try {
|
|
716
|
-
if (this.value) {
|
|
717
|
-
const config = this.inputConfig();
|
|
718
|
-
const TableData = (config.groupBy?.length ?? 0) > 0
|
|
719
|
-
? addGroups(this.value, config.groupBy)
|
|
720
|
-
: this.value;
|
|
721
|
-
const data = getCaluculatedTableData(config, TableData);
|
|
722
|
-
if (!this.dataSource) {
|
|
723
|
-
this.dataSource = new MatTableDataSource(data);
|
|
724
|
-
this.dataSource;
|
|
725
|
-
}
|
|
726
|
-
else {
|
|
727
|
-
this.dataSource.data = data;
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
return true;
|
|
731
|
-
}
|
|
732
|
-
catch {
|
|
733
|
-
return false;
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
multipleInputRemoveItem(item) {
|
|
737
|
-
if (!item)
|
|
738
|
-
return;
|
|
739
|
-
if (!this.value)
|
|
740
|
-
return;
|
|
741
|
-
this.value = this.value.filter((i) => !_isEqual(i, item));
|
|
742
|
-
this.applyOptionsTo = undefined;
|
|
743
|
-
this.onChange(this.value);
|
|
744
|
-
this.stateChanges.next();
|
|
745
|
-
}
|
|
746
|
-
generateMultipleInputForm() {
|
|
747
|
-
const id = this.inputConfig()?.id;
|
|
748
|
-
if (!id)
|
|
749
|
-
return;
|
|
750
|
-
this.formBuilderFunctions()?.multipleInputToggleForm(id, true);
|
|
751
|
-
}
|
|
752
|
-
editRow(rowId) {
|
|
753
|
-
if (!rowId) {
|
|
754
|
-
throw new Error('Row id not provided');
|
|
755
|
-
}
|
|
756
|
-
const config = this.inputConfig();
|
|
757
|
-
const fbf = this.formBuilderFunctions();
|
|
758
|
-
if (!fbf || !config)
|
|
759
|
-
return;
|
|
760
|
-
fbf.multipleInputEditRow(config.id, rowId);
|
|
761
|
-
// if( !this.inputConfig?.multipleInputController){
|
|
762
|
-
// return
|
|
763
|
-
// }
|
|
764
|
-
// this.inputConfig.multipleInputInEditId = this.applyOptionsTo.id;
|
|
765
|
-
// this.inputConfig.applyMultipleInputValuesToForm(
|
|
766
|
-
// this.applyOptionsTo
|
|
767
|
-
// );
|
|
768
|
-
}
|
|
769
|
-
copy(rowId) {
|
|
770
|
-
const config = this.inputConfig();
|
|
771
|
-
const fbf = this.formBuilderFunctions();
|
|
772
|
-
if (!fbf || !config)
|
|
773
|
-
return;
|
|
774
|
-
fbf.multipleInputDuplicateRow(config.id, rowId);
|
|
775
|
-
// this.generateMultipleInputForm();
|
|
776
|
-
// this.inputConfig?.applyMultipleInputValuesToForm(
|
|
777
|
-
// this.applyOptionsTo
|
|
778
|
-
// );
|
|
779
|
-
// this.applyOptionsTo = undefined;
|
|
780
|
-
}
|
|
781
|
-
get handleLabel() {
|
|
782
|
-
return this.inputConfig()?.handleLabel;
|
|
783
|
-
}
|
|
784
|
-
handleIcon() {
|
|
785
|
-
// NOTE(phase-4): `handleIcon` is declared on `IBasicFormInput` but not on `IMultiple` directly;
|
|
786
|
-
// narrow through `ITowerStepColumn` (which extends FormColumnInputs) and provide a string fallback.
|
|
787
|
-
const cfg = this.inputConfig();
|
|
788
|
-
return cfg?.handleIcon || 'add';
|
|
789
|
-
}
|
|
790
|
-
saveMultipleInputForm() {
|
|
791
|
-
this.formBuilderFunctions()?.multipleInputSaveForm(this.inputConfig().id);
|
|
792
|
-
// const value: any = this.inputConfig?.multipleInputFormValue();
|
|
793
|
-
// value['id'] = uuidv4();
|
|
794
|
-
// if (!this.inputConfig) {
|
|
795
|
-
// return
|
|
796
|
-
// }
|
|
797
|
-
// const previousValue = this.value
|
|
798
|
-
// if (!previousValue) {
|
|
799
|
-
// this.value = [value];
|
|
800
|
-
// this.inputConfig.multipleInputController = undefined;
|
|
801
|
-
// } else {
|
|
802
|
-
// if (this.inputConfig?.multipleInputInEditId) {
|
|
803
|
-
// let inEdit = previousValue.find(
|
|
804
|
-
// (i: { id: any }) =>
|
|
805
|
-
// i.id === this.inputConfig?.multipleInputInEditId
|
|
806
|
-
// );
|
|
807
|
-
// Object.keys(inEdit).every((s) => {
|
|
808
|
-
// s;
|
|
809
|
-
// inEdit[s] = value[s];
|
|
810
|
-
// return !!inEdit[s];
|
|
811
|
-
// });
|
|
812
|
-
// this.value = [...previousValue],
|
|
813
|
-
// this.inputConfig.multipleInputController = undefined;
|
|
814
|
-
// } else {
|
|
815
|
-
// this.value = [...previousValue, value];
|
|
816
|
-
// this.inputConfig.multipleInputController = undefined;
|
|
817
|
-
// }
|
|
818
|
-
// }
|
|
819
|
-
// this.onChange(this.value);
|
|
820
|
-
// this.stateChanges.next();
|
|
821
|
-
// this.checkItemList(this.value || []);
|
|
822
|
-
// return
|
|
823
|
-
}
|
|
824
|
-
editInput(input) {
|
|
825
|
-
const fbf = this.formBuilderFunctions();
|
|
826
|
-
if (typeof fbf?.editInput !== 'function') {
|
|
827
|
-
throw new Error('editInput function not defined in formBuilderFunctions');
|
|
828
|
-
}
|
|
829
|
-
fbf.editInput(input);
|
|
830
|
-
}
|
|
831
|
-
deleteItemInput(input) {
|
|
832
|
-
this.formBuilderFunctions()?.deleteInput(input);
|
|
833
|
-
}
|
|
834
|
-
showItemAsLabel(input) {
|
|
835
|
-
this.formBuilderFunctions()?.multipleInputToggleLabel(input);
|
|
836
|
-
}
|
|
837
|
-
addFunction(func) {
|
|
838
|
-
this.formBuilderFunctions()?.addFunction(func, this.inputConfig()?.id);
|
|
839
|
-
}
|
|
840
|
-
// `FormBuilderFunctions.reorderItems` is now generic over the row shape; the
|
|
841
|
-
// container/data slots stay `unknown` (opaque drag payload).
|
|
842
|
-
reorderItems(event) {
|
|
843
|
-
const config = this.inputConfig();
|
|
844
|
-
const fbf = this.formBuilderFunctions();
|
|
845
|
-
if (!fbf || !config)
|
|
846
|
-
return;
|
|
847
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Phase-4 TODO: deduplicate @angular/cdk peer dep in typings package; CdkDragDrop types are nominally distinct across copies.
|
|
848
|
-
fbf.reorderItems(event, config.id);
|
|
849
|
-
}
|
|
850
|
-
get parentFormGroup() {
|
|
851
|
-
return this.ngControl?.control?.parent;
|
|
852
|
-
}
|
|
853
|
-
get canAddRecords() {
|
|
854
|
-
const config = this.inputConfig();
|
|
855
|
-
if (!config)
|
|
856
|
-
return false;
|
|
857
|
-
//NOTE: Temporary backward compatibility for older versions of the config that might not have the new property
|
|
858
|
-
if (!config.multipleInputAvailableOperations)
|
|
859
|
-
return true;
|
|
860
|
-
return config.multipleInputAvailableOperations?.includes(MultipleInputAvailableOperations.Add);
|
|
861
|
-
}
|
|
862
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MultipleInputTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
863
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: MultipleInputTableComponent, isStandalone: true, selector: "lib-multiple-input-table", inputs: { editorMode: { classPropertyName: "editorMode", publicName: "editorMode", isSignal: true, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null }, inputConfig: { classPropertyName: "inputConfig", publicName: "inputConfig", isSignal: true, isRequired: true, transformFunction: null }, formBuilderFunctions: { classPropertyName: "formBuilderFunctions", publicName: "formBuilderFunctions", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: MultipleInputTableComponent }], usesInheritance: true, ngImport: i0, template: "<lib-multiple-input-table-view\n [inputConfig]=\"inputConfig()\"\n [dataSource]=\"dataSource\"\n [applyOptionsTo]=\"applyOptionsTo\"\n [formGroup]=\"parentFormGroup\"\n (onEditItem)=\"editRow($event)\"\n (showItemAsLabel)=\"showItemAsLabel(inputConfig())\"\n (onDeleteItem)=\"multipleInputRemoveItem(applyOptionsTo)\"\n (onCopy)=\"copy($event)\"\n (onApplyOptionsTo)=\"applyOptionsTo = $event\"\n></lib-multiple-input-table-view>\n\n@if (!!inputConfig().formIsOpen || !!rowInViewOnly) {\n <lib-multiple-input-table-edit\n [editorMode]=\"editorMode()\"\n (editMultipleInput)=\"editInput($event)\"\n (deleteInput)=\"deleteItemInput($event)\"\n (addFunction)=\"addFunction($event)\"\n (showItemAsLabel)=\"showItemAsLabel($event)\"\n (onSaveMultipleInputForm)=\"saveMultipleInputForm()\"\n (reorderItems)=\"reorderItems($event)\"\n [formBuilderFunctions]=\"formBuilderFunctions()\"\n [formGroup]=\"parentFormGroup\"\n [inputConfig]=\"inputConfig()\"\n ></lib-multiple-input-table-edit>\n}\n\n@if (!inputConfig().readonly && !inputConfig().disabled && !inputConfig().formIsOpen && canAddRecords) {\n <section class=\"add-row-bar\">\n <button class=\"add-row-button\" (click)=\"generateMultipleInputForm()\" mat-stroked-button>\n <mat-icon class=\"add-row-icon\">{{ handleIcon() }}</mat-icon>\n <span class=\"add-row-label\">{{ handleLabel }}</span>\n </button>\n </section>\n}\n", styles: [".table-container{position:relative;max-height:400px;overflow:auto}table{width:100%}.add-row-bar{margin-top:.5rem}.add-row-button{width:100%;min-height:2.25rem;display:inline-flex;align-items:center;justify-content:center;gap:.375rem;border:1px dashed color-mix(in srgb,var(--mat-sys-outline, #79747e) 60%,transparent);border-radius:8px;color:var(--mat-sys-on-surface-variant, #49454f);background:transparent;font-size:.8125rem;font-weight:500;letter-spacing:.01em;transition:border-color .3s cubic-bezier(.16,1,.3,1),color .3s cubic-bezier(.16,1,.3,1),background .3s cubic-bezier(.16,1,.3,1)}.add-row-button:hover{border-color:var(--mat-sys-primary, #6750a4);color:var(--mat-sys-primary, #6750a4);background:color-mix(in srgb,var(--mat-sys-primary, #6750a4) 6%,transparent)}.add-row-button:focus-visible{border-style:solid;border-color:var(--mat-sys-primary, #6750a4);box-shadow:0 0 0 2px color-mix(in srgb,var(--mat-sys-primary, #6750a4) 25%,transparent)}.add-row-icon{font-size:1.125rem;width:1.125rem;height:1.125rem;line-height:1.125rem}.add-row-label{line-height:1}\n"], dependencies: [{ 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: "component", type: MultipleInputTableEditComponent, selector: "lib-multiple-input-table-edit", inputs: ["inputConfig", "editorMode", "formGroup", "formBuilderFunctions"], outputs: ["onSaveMultipleInputForm", "editMultipleInput", "deleteInput", "showItemAsLabel", "addFunction", "reorderItems"] }, { kind: "component", type: MultipleInputTableViewComponent, selector: "lib-multiple-input-table-view", inputs: ["inputConfig", "dataSource", "applyOptionsTo", "formGroup"], outputs: ["onEditItem", "onDeleteItem", "onCopy", "onApplyOptionsTo", "showItemAsLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
864
|
-
}
|
|
865
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MultipleInputTableComponent, decorators: [{
|
|
866
|
-
type: Component,
|
|
867
|
-
args: [{ selector: 'lib-multiple-input-table', imports: [
|
|
868
|
-
MatButtonModule,
|
|
869
|
-
MatIconModule,
|
|
870
|
-
MultipleInputTableEditComponent,
|
|
871
|
-
MultipleInputTableViewComponent,
|
|
872
|
-
], providers: [{ provide: MatFormFieldControl, useExisting: MultipleInputTableComponent }], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: "<lib-multiple-input-table-view\n [inputConfig]=\"inputConfig()\"\n [dataSource]=\"dataSource\"\n [applyOptionsTo]=\"applyOptionsTo\"\n [formGroup]=\"parentFormGroup\"\n (onEditItem)=\"editRow($event)\"\n (showItemAsLabel)=\"showItemAsLabel(inputConfig())\"\n (onDeleteItem)=\"multipleInputRemoveItem(applyOptionsTo)\"\n (onCopy)=\"copy($event)\"\n (onApplyOptionsTo)=\"applyOptionsTo = $event\"\n></lib-multiple-input-table-view>\n\n@if (!!inputConfig().formIsOpen || !!rowInViewOnly) {\n <lib-multiple-input-table-edit\n [editorMode]=\"editorMode()\"\n (editMultipleInput)=\"editInput($event)\"\n (deleteInput)=\"deleteItemInput($event)\"\n (addFunction)=\"addFunction($event)\"\n (showItemAsLabel)=\"showItemAsLabel($event)\"\n (onSaveMultipleInputForm)=\"saveMultipleInputForm()\"\n (reorderItems)=\"reorderItems($event)\"\n [formBuilderFunctions]=\"formBuilderFunctions()\"\n [formGroup]=\"parentFormGroup\"\n [inputConfig]=\"inputConfig()\"\n ></lib-multiple-input-table-edit>\n}\n\n@if (!inputConfig().readonly && !inputConfig().disabled && !inputConfig().formIsOpen && canAddRecords) {\n <section class=\"add-row-bar\">\n <button class=\"add-row-button\" (click)=\"generateMultipleInputForm()\" mat-stroked-button>\n <mat-icon class=\"add-row-icon\">{{ handleIcon() }}</mat-icon>\n <span class=\"add-row-label\">{{ handleLabel }}</span>\n </button>\n </section>\n}\n", styles: [".table-container{position:relative;max-height:400px;overflow:auto}table{width:100%}.add-row-bar{margin-top:.5rem}.add-row-button{width:100%;min-height:2.25rem;display:inline-flex;align-items:center;justify-content:center;gap:.375rem;border:1px dashed color-mix(in srgb,var(--mat-sys-outline, #79747e) 60%,transparent);border-radius:8px;color:var(--mat-sys-on-surface-variant, #49454f);background:transparent;font-size:.8125rem;font-weight:500;letter-spacing:.01em;transition:border-color .3s cubic-bezier(.16,1,.3,1),color .3s cubic-bezier(.16,1,.3,1),background .3s cubic-bezier(.16,1,.3,1)}.add-row-button:hover{border-color:var(--mat-sys-primary, #6750a4);color:var(--mat-sys-primary, #6750a4);background:color-mix(in srgb,var(--mat-sys-primary, #6750a4) 6%,transparent)}.add-row-button:focus-visible{border-style:solid;border-color:var(--mat-sys-primary, #6750a4);box-shadow:0 0 0 2px color-mix(in srgb,var(--mat-sys-primary, #6750a4) 25%,transparent)}.add-row-icon{font-size:1.125rem;width:1.125rem;height:1.125rem;line-height:1.125rem}.add-row-label{line-height:1}\n"] }]
|
|
873
|
-
}], ctorParameters: () => [], propDecorators: { editorMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "editorMode", required: false }] }], formGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "formGroup", required: true }] }], inputConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputConfig", required: true }] }], formBuilderFunctions: [{ type: i0.Input, args: [{ isSignal: true, alias: "formBuilderFunctions", required: false }] }] } });
|
|
874
|
-
function addGroups(tableValue, groupBy) {
|
|
875
|
-
throw new Error('Function not implemented.');
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
/** Wraps a multi-row input table inside a `mat-form-field`. */
|
|
879
|
-
class MultipleInputInputElementComponent {
|
|
880
|
-
constructor() {
|
|
881
|
-
this.inputConfig = input.required(...(ngDevMode ? [{ debugName: "inputConfig" }] : /* istanbul ignore next */ []));
|
|
882
|
-
this.formGroup = input.required(...(ngDevMode ? [{ debugName: "formGroup" }] : /* istanbul ignore next */ []));
|
|
883
|
-
this.editorMode = input(false, ...(ngDevMode ? [{ debugName: "editorMode" }] : /* istanbul ignore next */ []));
|
|
884
|
-
this.formBuilderFunctions = input(undefined, ...(ngDevMode ? [{ debugName: "formBuilderFunctions" }] : /* istanbul ignore next */ []));
|
|
885
|
-
this.reload = output();
|
|
886
|
-
this.errorMessage = computed(() => getInputErrorMessage(this.inputConfig(), this.formGroup()), ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
887
|
-
}
|
|
888
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MultipleInputInputElementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
889
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: MultipleInputInputElementComponent, isStandalone: true, selector: "lib-multiple-input-input-element", inputs: { inputConfig: { classPropertyName: "inputConfig", publicName: "inputConfig", isSignal: true, isRequired: true, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null }, editorMode: { classPropertyName: "editorMode", publicName: "editorMode", isSignal: true, isRequired: false, transformFunction: null }, formBuilderFunctions: { classPropertyName: "formBuilderFunctions", publicName: "formBuilderFunctions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { reload: "reload" }, ngImport: i0, template: "<form [formGroup]=\"formGroup()\">\n @if (inputConfig(); as inputConfig) {\n <mat-form-field\n class=\"multiple-input-field\"\n [appearance]=\"inputConfig.appearance || 'fill'\"\n subscriptSizing=\"dynamic\"\n floatLabel=\"always\"\n >\n <mat-label>\n {{ inputConfig.label }}\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\n </mat-label>\n\n @if (inputConfig.id) {\n <lib-multiple-input-table\n [editorMode]=\"editorMode()\"\n [required]=\"inputConfig.required\"\n [formGroup]=\"formGroup()\"\n [formBuilderFunctions]=\"formBuilderFunctions()\"\n [formControlName]=\"inputConfig.id\"\n [inputConfig]=\"inputConfig\"\n ></lib-multiple-input-table>\n }\n\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\n <mat-hint class=\"inputHint\">\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\n </mat-hint>\n }\n\n @if (!!errorMessage()) {\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\n }\n\n @if (inputConfig.canReload?.canReload) {\n <button\n mat-icon-button\n matTooltip=\"Click to refresh this field.\"\n class=\"input-sync-button\"\n (click)=\"inputConfig.canReload.emit()\"\n matSuffix\n >\n <mat-icon>sync</mat-icon>\n </button>\n }\n\n @if (inputConfig.prefixIcon) {\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\n }\n\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\n }\n\n @if (inputConfig.prefixText) {\n <span class=\"affix-text\" matPrefix>{{ inputConfig.prefixText }}</span>\n }\n @if (inputConfig.suffixText) {\n <span class=\"affix-text affix-text--suffix\" matSuffix>{{ inputConfig.suffixText }}</span>\n }\n\n @if (inputConfig.maxLength && formGroup()) {\n <mat-hint align=\"end\">\n {{ (formGroup().controls[inputConfig.id]?.value?.length || 0) + '/' + inputConfig.maxLength }}\n </mat-hint>\n }\n </mat-form-field>\n }\n</form>\n", styles: [":host{display:block}.multiple-input-field{width:100%}.affix-text{top:0;color:var(--mat-sys-on-surface-variant, #49454f);font-size:.8125rem}.affix-text--suffix{padding-left:.3125rem}.input-sync-button{margin-right:.25rem;opacity:0;transform:scale(.85);pointer-events:none;transition:opacity .3s cubic-bezier(.16,1,.3,1),transform .3s cubic-bezier(.16,1,.3,1)}.input-sync-button mat-icon{color:var(--mat-sys-primary, #6750a4)}.multiple-input-field:hover .input-sync-button,.multiple-input-field:focus-within .input-sync-button{opacity:1;transform:scale(1);pointer-events:auto}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$2.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { 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.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: TFormInputStatusComponent, selector: "lib-t-form-input-status", inputs: ["inputConfig"] }, { kind: "component", type: MultipleInputTableComponent, selector: "lib-multiple-input-table", inputs: ["editorMode", "formGroup", "inputConfig", "formBuilderFunctions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
890
|
-
}
|
|
891
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MultipleInputInputElementComponent, decorators: [{
|
|
892
|
-
type: Component,
|
|
893
|
-
args: [{ selector: 'lib-multiple-input-input-element', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
894
|
-
ReactiveFormsModule,
|
|
895
|
-
MatFormFieldModule,
|
|
896
|
-
MatIconModule,
|
|
897
|
-
MatButtonModule,
|
|
898
|
-
MatTooltipModule,
|
|
899
|
-
TFormInputStatusComponent,
|
|
900
|
-
MultipleInputTableComponent,
|
|
901
|
-
], template: "<form [formGroup]=\"formGroup()\">\n @if (inputConfig(); as inputConfig) {\n <mat-form-field\n class=\"multiple-input-field\"\n [appearance]=\"inputConfig.appearance || 'fill'\"\n subscriptSizing=\"dynamic\"\n floatLabel=\"always\"\n >\n <mat-label>\n {{ inputConfig.label }}\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\n </mat-label>\n\n @if (inputConfig.id) {\n <lib-multiple-input-table\n [editorMode]=\"editorMode()\"\n [required]=\"inputConfig.required\"\n [formGroup]=\"formGroup()\"\n [formBuilderFunctions]=\"formBuilderFunctions()\"\n [formControlName]=\"inputConfig.id\"\n [inputConfig]=\"inputConfig\"\n ></lib-multiple-input-table>\n }\n\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\n <mat-hint class=\"inputHint\">\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\n </mat-hint>\n }\n\n @if (!!errorMessage()) {\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\n }\n\n @if (inputConfig.canReload?.canReload) {\n <button\n mat-icon-button\n matTooltip=\"Click to refresh this field.\"\n class=\"input-sync-button\"\n (click)=\"inputConfig.canReload.emit()\"\n matSuffix\n >\n <mat-icon>sync</mat-icon>\n </button>\n }\n\n @if (inputConfig.prefixIcon) {\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\n }\n\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\n }\n\n @if (inputConfig.prefixText) {\n <span class=\"affix-text\" matPrefix>{{ inputConfig.prefixText }}</span>\n }\n @if (inputConfig.suffixText) {\n <span class=\"affix-text affix-text--suffix\" matSuffix>{{ inputConfig.suffixText }}</span>\n }\n\n @if (inputConfig.maxLength && formGroup()) {\n <mat-hint align=\"end\">\n {{ (formGroup().controls[inputConfig.id]?.value?.length || 0) + '/' + inputConfig.maxLength }}\n </mat-hint>\n }\n </mat-form-field>\n }\n</form>\n", styles: [":host{display:block}.multiple-input-field{width:100%}.affix-text{top:0;color:var(--mat-sys-on-surface-variant, #49454f);font-size:.8125rem}.affix-text--suffix{padding-left:.3125rem}.input-sync-button{margin-right:.25rem;opacity:0;transform:scale(.85);pointer-events:none;transition:opacity .3s cubic-bezier(.16,1,.3,1),transform .3s cubic-bezier(.16,1,.3,1)}.input-sync-button mat-icon{color:var(--mat-sys-primary, #6750a4)}.multiple-input-field:hover .input-sync-button,.multiple-input-field:focus-within .input-sync-button{opacity:1;transform:scale(1);pointer-events:auto}\n"] }]
|
|
902
|
-
}], propDecorators: { inputConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputConfig", required: true }] }], formGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "formGroup", required: true }] }], editorMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "editorMode", required: false }] }], formBuilderFunctions: [{ type: i0.Input, args: [{ isSignal: true, alias: "formBuilderFunctions", required: false }] }], reload: [{ type: i0.Output, args: ["reload"] }] } });
|
|
903
|
-
|
|
904
|
-
export { MultipleInputInputElementComponent };
|
|
905
|
-
//# sourceMappingURL=ngx-t-forms-multiple-input-input-element.component-dmRIi9ph.mjs.map
|