ngx-t-forms 2.0.31 → 2.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-DCKuXHAW.mjs → ngx-t-forms-auto-complete-input-element.component-CaXs4561.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-DCKuXHAW.mjs.map → ngx-t-forms-auto-complete-input-element.component-CaXs4561.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-Ce4ipSUc.mjs → ngx-t-forms-basic-input-input-element.component-Dotyd-Qs.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-Ce4ipSUc.mjs.map → ngx-t-forms-basic-input-input-element.component-Dotyd-Qs.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-C5TPddVe.mjs → ngx-t-forms-calculated-field-rules.component-BhxT6tRq.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-C5TPddVe.mjs.map → ngx-t-forms-calculated-field-rules.component-BhxT6tRq.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-CICQaqz6.mjs → ngx-t-forms-chip-options-creator-editor.component-d4QeVhsp.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-CICQaqz6.mjs.map → ngx-t-forms-chip-options-creator-editor.component-d4QeVhsp.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CzisLSIP.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-Gn8exJ9a.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CzisLSIP.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-Gn8exJ9a.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-data-source-picker.component-Dzz_o6fJ.mjs → ngx-t-forms-data-source-picker.component-Ebf_if9j.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-data-source-picker.component-Dzz_o6fJ.mjs.map → ngx-t-forms-data-source-picker.component-Ebf_if9j.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-CYUbVyzP.mjs → ngx-t-forms-date-picker-input-element.component-kdinBGRA.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-CYUbVyzP.mjs.map → ngx-t-forms-date-picker-input-element.component-kdinBGRA.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-date-range-picker-input-element.component-CmoquQGV.mjs → ngx-t-forms-date-range-picker-input-element.component-4W6uvrDU.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-date-range-picker-input-element.component-CmoquQGV.mjs.map → ngx-t-forms-date-range-picker-input-element.component-4W6uvrDU.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-CLUOXreG.mjs → ngx-t-forms-document-list-label-config-editor.component-CR6EvgJO.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-CLUOXreG.mjs.map → ngx-t-forms-document-list-label-config-editor.component-CR6EvgJO.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-document-picker.component-qObjcqhE.mjs → ngx-t-forms-document-picker.component-BThdRFec.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-document-picker.component-qObjcqhE.mjs.map → ngx-t-forms-document-picker.component-BThdRFec.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-editor-input-element.component-BLXlfb6F.mjs → ngx-t-forms-editor-input-element.component-1X6uAPeZ.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-editor-input-element.component-BLXlfb6F.mjs.map → ngx-t-forms-editor-input-element.component-1X6uAPeZ.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-editor-js-input.component-BQL0AH7H.mjs → ngx-t-forms-editor-js-input.component-5MD8wRj0.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-editor-js-input.component-BQL0AH7H.mjs.map → ngx-t-forms-editor-js-input.component-5MD8wRj0.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-C7mMeEjF.mjs → ngx-t-forms-file-upload-input-element.component-BAtuymMY.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-C7mMeEjF.mjs.map → ngx-t-forms-file-upload-input-element.component-BAtuymMY.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-input-selector.component-C9u8zq9B.mjs → ngx-t-forms-form-input-selector.component-B42xP3jh.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-input-selector.component-C9u8zq9B.mjs.map → ngx-t-forms-form-input-selector.component-B42xP3jh.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-json-view.component-856Hx1Bg.mjs → ngx-t-forms-form-json-view.component-DnnLXqR0.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-json-view.component-856Hx1Bg.mjs.map → ngx-t-forms-form-json-view.component-DnnLXqR0.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-payload-projection.component-CDkTuX9S.mjs → ngx-t-forms-form-payload-projection.component-Ip9ewB18.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-form-payload-projection.component-CDkTuX9S.mjs.map → ngx-t-forms-form-payload-projection.component-Ip9ewB18.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-Bs50-nEB.mjs → ngx-t-forms-form-section-stepper.component-BPgPfZSy.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-Bs50-nEB.mjs.map → ngx-t-forms-form-section-stepper.component-BPgPfZSy.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-qrhM0jGL.mjs → ngx-t-forms-forms-builder-menu.component-Dv0Dfw79.mjs} +5 -5
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-qrhM0jGL.mjs.map → ngx-t-forms-forms-builder-menu.component-Dv0Dfw79.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-geo-location.component-Bosp1UzR.mjs → ngx-t-forms-geo-location.component-Bmd84Gcb.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-geo-location.component-Bosp1UzR.mjs.map → ngx-t-forms-geo-location.component-Bmd84Gcb.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-C1g7Z0cK.mjs → ngx-t-forms-image-capture-input-element.component-CUd04Ghl.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-C1g7Z0cK.mjs.map → ngx-t-forms-image-capture-input-element.component-CUd04Ghl.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-index-BcrQ01DQ.mjs +2 -0
- package/fesm2022/ngx-t-forms-index-BcrQ01DQ.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-input-custom.component-BkbHFAyR.mjs → ngx-t-forms-input-custom.component-Cn-KH0Lb.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-input-custom.component-BkbHFAyR.mjs.map → ngx-t-forms-input-custom.component-Cn-KH0Lb.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-input-editor.component-BPUOM9kQ.mjs → ngx-t-forms-input-editor.component-DLru1Ezu.mjs} +17 -5
- package/fesm2022/ngx-t-forms-input-editor.component-DLru1Ezu.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-B6hJ7Io5.mjs → ngx-t-forms-map-mat-options-keys-CVlPdrCO.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-B6hJ7Io5.mjs.map → ngx-t-forms-map-mat-options-keys-CVlPdrCO.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-c7uZT1sr.mjs → ngx-t-forms-mat-chip-list-editor.component-BWisS3Em.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-c7uZT1sr.mjs.map → ngx-t-forms-mat-chip-list-editor.component-BWisS3Em.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-DrnH8qdG.mjs → ngx-t-forms-missing-form-configs.component-DxdynZY6.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-DrnH8qdG.mjs.map → ngx-t-forms-missing-form-configs.component-DxdynZY6.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-C_abEBQ5.mjs → ngx-t-forms-mscoa-chart-toolbar.component-D4Xa_Yi0.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-C_abEBQ5.mjs.map → ngx-t-forms-mscoa-chart-toolbar.component-D4Xa_Yi0.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-Bo0aDEMy.mjs +447 -0
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-Bo0aDEMy.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-multiple-input-input-element.component-C7y1OGPx.mjs → ngx-t-forms-multiple-input-input-element.component-C8JP3D6r.mjs} +16 -16
- package/fesm2022/{ngx-t-forms-multiple-input-input-element.component-C7y1OGPx.mjs.map → ngx-t-forms-multiple-input-input-element.component-C8JP3D6r.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-ngx-t-forms-u_kigDid.mjs → ngx-t-forms-ngx-t-forms-C2G8_WQk.mjs} +931 -82
- package/fesm2022/ngx-t-forms-ngx-t-forms-C2G8_WQk.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-paginated-selection-table-AQZSMmhr.mjs → ngx-t-forms-paginated-selection-table-0OI1ikWW.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-paginated-selection-table-AQZSMmhr.mjs.map → ngx-t-forms-paginated-selection-table-0OI1ikWW.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-DmNSc5aw.mjs → ngx-t-forms-pipeline-generator.component-CZ21sd77.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-DmNSc5aw.mjs.map → ngx-t-forms-pipeline-generator.component-CZ21sd77.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-record-list-manager.component-CUMMvMch.mjs → ngx-t-forms-record-list-manager.component-CykBq_nW.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-record-list-manager.component-CUMMvMch.mjs.map → ngx-t-forms-record-list-manager.component-CykBq_nW.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-required-inputs.component-Ch2yNcIS.mjs → ngx-t-forms-required-inputs.component-ONbhxVSH.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-required-inputs.component-Ch2yNcIS.mjs.map → ngx-t-forms-required-inputs.component-ONbhxVSH.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-C_aFtdvW.mjs → ngx-t-forms-rest-api-call-setup.component-WPUxtY7Q.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-C_aFtdvW.mjs.map → ngx-t-forms-rest-api-call-setup.component-WPUxtY7Q.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-section-report.component-BxOhR6C0.mjs → ngx-t-forms-section-report.component-C1w16LYm.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-section-report.component-BxOhR6C0.mjs.map → ngx-t-forms-section-report.component-C1w16LYm.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-select-input-element.component-DbgZdNoe.mjs → ngx-t-forms-select-input-element.component-CWcywuS6.mjs} +8 -8
- package/fesm2022/{ngx-t-forms-select-input-element.component-DbgZdNoe.mjs.map → ngx-t-forms-select-input-element.component-CWcywuS6.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-Dhln81DL.mjs → ngx-t-forms-selection-options-editor.component-KjbZhc2u.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-Dhln81DL.mjs.map → ngx-t-forms-selection-options-editor.component-KjbZhc2u.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-t-workflow-picker.component-leBokXvM.mjs → ngx-t-forms-t-workflow-picker.component-CtavFAUq.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-t-workflow-picker.component-leBokXvM.mjs.map → ngx-t-forms-t-workflow-picker.component-CtavFAUq.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-BEbXJjFA.mjs → ngx-t-forms-textarea-input-element.component-DkJkBQif.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-BEbXJjFA.mjs.map → ngx-t-forms-textarea-input-element.component-DkJkBQif.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-DDErRUJd.mjs → ngx-t-forms-toggle-input-element.component-Dr7MNli8.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-DDErRUJd.mjs.map → ngx-t-forms-toggle-input-element.component-Dr7MNli8.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-validators-config.component-oGjQVGE2.mjs → ngx-t-forms-validators-config.component-BknyAmV_.mjs} +8 -167
- package/fesm2022/ngx-t-forms-validators-config.component-BknyAmV_.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-workflow-adjudication.component-CtU8dECN.mjs → ngx-t-forms-workflow-adjudication.component-CPvwm7f4.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-workflow-adjudication.component-CtU8dECN.mjs.map → ngx-t-forms-workflow-adjudication.component-CPvwm7f4.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms.mjs +1 -1
- package/package.json +2 -2
- package/types/ngx-t-forms.d.ts +191 -4
- package/fesm2022/ngx-t-forms-index-dDSobs6A.mjs +0 -2
- package/fesm2022/ngx-t-forms-index-dDSobs6A.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-input-editor.component-BPUOM9kQ.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-C0qsMfsq.mjs +0 -336
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-C0qsMfsq.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-u_kigDid.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-validators-config.component-oGjQVGE2.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-t-forms-missing-form-configs.component-
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-missing-form-configs.component-DxdynZY6.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/missing-form-configs/missing-form-configs.component.ts","../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/missing-form-configs/missing-form-configs.component.html"],"sourcesContent":["import { AsyncPipe } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, inject, signal } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatToolbarModule } from '@angular/material/toolbar';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\n\r\nimport { FormsStoreService } from '../../../forms/store/forms-store.service';\r\n\r\n@Component({\r\n selector: 'lib-missing-form-configs',\r\n imports: [\r\n AsyncPipe,\r\n MatButtonModule,\r\n MatIconModule,\r\n MatToolbarModule,\r\n MatTooltipModule,\r\n ],\r\n templateUrl: './missing-form-configs.component.html',\r\n styleUrl: './missing-form-configs.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class MissingFormConfigsComponent {\r\n readonly #store = inject(FormsStoreService);\r\n\r\n protected readonly errors$ = this.#store.formBuilderSelectors.formValidationErrorsMessages$;\r\n protected readonly missingConfigs$ = this.#store.formBuilderSelectors.missingConfig$;\r\n protected readonly hideDetails = signal<boolean>(true);\r\n protected readonly showAllErrors = signal<boolean>(false);\r\n}\r\n","@if (hideDetails()) {\r\n<button\r\nmatTooltip=\"Click to view form configuration issues and validation errors\"\r\nstyle=\"margin: 16px;\" (click)=\"hideDetails.set(false)\" mat-fab color=\"warn\" aria-label=\"Error icon\">\r\n <mat-icon>error</mat-icon>\r\n</button>\r\n}@else {\r\n<div style=\"margin: 8px;position:relative\" class=\"content \">\r\n <mat-toolbar color=\"warn\">\r\n <button (click)=\"hideDetails.set(true)\" mat-icon-button>\r\n <mat-icon>\r\n close\r\n </mat-icon>\r\n </button>\r\n Missing configurations:\r\n <span class=\"spacer\"></span>\r\n <button [matTooltip]=\"showAllErrors() ? 'Hide all errors' : 'Show all errors'\"\r\n (click)=\"showAllErrors.set(!showAllErrors())\" mat-icon-button>\r\n\r\n <mat-icon>\r\n unfold_more\r\n </mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n <section style=\"padding: 16px;\" >\r\n <h5>\r\n <strong>\r\n Overall form issues:\r\n </strong>\r\n </h5>\r\n <ul>\r\n @for (issue of (missingConfigs$|async);track issue) {\r\n <li>\r\n {{issue}}\r\n </li>\r\n }\r\n </ul>\r\n\r\n @if(showAllErrors()){\r\n <h5>\r\n <strong>\r\n\r\n Form validationErrors :\r\n\r\n </strong>\r\n\r\n\r\n </h5>\r\n <ul>\r\n @for (error of errors$|async; track error) {\r\n\r\n <li>\r\n\r\n {{error}}\r\n\r\n </li>\r\n\r\n }\r\n </ul>\r\n }\r\n\r\n\r\n\r\n\r\n </section>\r\n\r\n</div>\r\n}\r\n"],"names":["i2","i3","i4"],"mappings":";;;;;;;;;;;;;MAsBa,2BAA2B,CAAA;AAbxC,IAAA,WAAA,GAAA;AAcW,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC;QAExB,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,6BAA6B;QACxE,IAAA,CAAA,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,cAAc;AACjE,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAU,IAAI,kFAAC;AACnC,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAU,KAAK,oFAAC;AAC1D,IAAA;AANU,IAAA,MAAM;+GADJ,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAA3B,2BAA2B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,0BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECtBxC,ysDAoEA,EAAA,MAAA,EAAA,CAAA,mPAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDvDI,eAAe,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,QAAA,EAAA,sFAAA,EAAA,QAAA,EAAA,CAAA,WAAA,EAAA,WAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,QAAA,EAAA,wDAAA,EAAA,MAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,WAAA,EAAA,WAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACf,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACb,gBAAgB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAC,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAChB,gBAAgB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAC,IAAA,CAAA,UAAA,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,oBAAA,EAAA,4BAAA,EAAA,oBAAA,EAAA,qBAAA,EAAA,qBAAA,EAAA,yBAAA,EAAA,YAAA,EAAA,iBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAJhB,SAAS,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAUA,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAbvC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,0BAA0B,EAAA,OAAA,EAC3B;wBACP,SAAS;wBACT,eAAe;wBACf,aAAa;wBACb,gBAAgB;wBAChB,gBAAgB;qBACjB,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,ysDAAA,EAAA,MAAA,EAAA,CAAA,mPAAA,CAAA,EAAA;;;;;"}
|
|
@@ -6,7 +6,7 @@ import * as i3 from '@angular/material/icon';
|
|
|
6
6
|
import { MatIconModule } from '@angular/material/icon';
|
|
7
7
|
import * as i5 from '@angular/material/toolbar';
|
|
8
8
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
9
|
-
import {
|
|
9
|
+
import { I as ACCOUNTING_BASIS, K as getToolbarColor, L as getToolbarBackground, O as getToolbarIconColor } from './ngx-t-forms-ngx-t-forms-C2G8_WQk.mjs';
|
|
10
10
|
|
|
11
11
|
class MscoaChartToolbarComponent {
|
|
12
12
|
constructor() {
|
|
@@ -35,4 +35,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
35
35
|
}], propDecorators: { accountingBasis: [{ type: i0.Input, args: [{ isSignal: true, alias: "accountingBasis", required: false }] }], canCollapse: [{ type: i0.Input, args: [{ isSignal: true, alias: "canCollapse", required: false }] }], isExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "isExpanded", required: false }] }], toggleExpansion: [{ type: i0.Output, args: ["toggleExpansion"] }] } });
|
|
36
36
|
|
|
37
37
|
export { MscoaChartToolbarComponent };
|
|
38
|
-
//# sourceMappingURL=ngx-t-forms-mscoa-chart-toolbar.component-
|
|
38
|
+
//# sourceMappingURL=ngx-t-forms-mscoa-chart-toolbar.component-D4Xa_Yi0.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-t-forms-mscoa-chart-toolbar.component-
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-mscoa-chart-toolbar.component-D4Xa_Yi0.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/components/mscoa-chart-toolbar/mscoa-chart-toolbar.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/components/mscoa-chart-toolbar/mscoa-chart-toolbar.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatToolbarModule } from '@angular/material/toolbar';\r\nimport { ACCOUNTING_BASIS } from '../../utils/mscoa-chart.constants';\r\nimport { getToolbarBackground, getToolbarColor, getToolbarIconColor } from '../../utils/mscoa-chart.helpers';\r\nimport type { AccountingBasis } from '../../utils/mscoa-chart.constants';\r\n\r\n@Component({\r\n selector: 'lib-mscoa-chart-toolbar',\r\n imports: [MatToolbarModule, MatButtonModule, MatIconModule],\r\n templateUrl: './mscoa-chart-toolbar.component.html',\r\n styleUrls: ['./mscoa-chart-toolbar.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class MscoaChartToolbarComponent {\r\n readonly accountingBasis = input<AccountingBasis | string | undefined>(undefined);\r\n readonly canCollapse = input<boolean>(false);\r\n readonly isExpanded = input<boolean>(true);\r\n\r\n readonly toggleExpansion = output<void>();\r\n\r\n protected readonly ACCOUNTING_BASIS = ACCOUNTING_BASIS;\r\n\r\n protected readonly getToolbarColor = getToolbarColor;\r\n protected readonly getToolbarBackground = getToolbarBackground;\r\n protected readonly getToolbarIconColor = getToolbarIconColor;\r\n\r\n protected readonly displayBasis = computed<string>(() => {\r\n const basis = this.accountingBasis() || ACCOUNTING_BASIS.ACCRUAL;\r\n return basis.charAt(0).toUpperCase() + basis.slice(1);\r\n });\r\n\r\n protected onToggleClick(): void {\r\n this.toggleExpansion.emit();\r\n }\r\n}\r\n","<mat-toolbar\r\n [color]=\"getToolbarColor(accountingBasis())\"\r\n [style.background]=\"getToolbarBackground(accountingBasis())\"\r\n class=\"mscoa-chart-toolbar\"\r\n [attr.aria-label]=\"'Accounting basis: ' + displayBasis()\">\r\n\r\n <span class=\"mscoa-chart-toolbar__label\">\r\n Basis: {{ displayBasis() }}\r\n </span>\r\n\r\n <span class=\"spacer\"></span>\r\n\r\n @if (canCollapse()) {\r\n <button\r\n mat-icon-button\r\n (click)=\"onToggleClick()\"\r\n [attr.aria-label]=\"(isExpanded() ? 'Collapse' : 'Expand') + ' ' + displayBasis() + ' basis table'\"\r\n [attr.aria-expanded]=\"isExpanded()\">\r\n <mat-icon [style.color]=\"getToolbarIconColor(accountingBasis())\">\r\n {{ isExpanded() ? 'expand_less' : 'expand_more' }}\r\n </mat-icon>\r\n </button>\r\n }\r\n</mat-toolbar>\r\n"],"names":["i1"],"mappings":";;;;;;;;;;MAea,0BAA0B,CAAA;AAPvC,IAAA,WAAA,GAAA;AAQW,QAAA,IAAA,CAAA,eAAe,GAAG,KAAK,CAAuC,SAAS,sFAAC;AACxE,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAU,KAAK,kFAAC;AACnC,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAU,IAAI,iFAAC;QAEjC,IAAA,CAAA,eAAe,GAAG,MAAM,EAAQ;QAEtB,IAAA,CAAA,gBAAgB,GAAG,gBAAgB;QAEnC,IAAA,CAAA,eAAe,GAAG,eAAe;QACjC,IAAA,CAAA,oBAAoB,GAAG,oBAAoB;QAC3C,IAAA,CAAA,mBAAmB,GAAG,mBAAmB;AAEzC,QAAA,IAAA,CAAA,YAAY,GAAG,QAAQ,CAAS,MAAK;YACtD,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,EAAE,IAAI,gBAAgB,CAAC,OAAO;AAChE,YAAA,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACvD,QAAA,CAAC,mFAAC;AAKH,IAAA;IAHW,aAAa,GAAA;AACrB,QAAA,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE;IAC7B;+GApBW,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA1B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,0BAA0B,ujBCfvC,g1BAwBA,EAAA,MAAA,EAAA,CAAA,0UAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDdY,gBAAgB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,eAAe,qNAAE,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAK/C,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAPtC,SAAS;+BACE,yBAAyB,EAAA,OAAA,EAC1B,CAAC,gBAAgB,EAAE,eAAe,EAAE,aAAa,CAAC,EAAA,eAAA,EAG1C,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,g1BAAA,EAAA,MAAA,EAAA,CAAA,0UAAA,CAAA,EAAA;;;;;"}
|
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, inject, DestroyRef, signal, computed, effect, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
+
import * as i1 from '@angular/forms';
|
|
5
|
+
import { FormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
6
|
+
import { take, tap, catchError, of } from 'rxjs';
|
|
7
|
+
import * as i1$1 from '@angular/material/button';
|
|
8
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
9
|
+
import * as i3 from '@angular/material/card';
|
|
10
|
+
import { MatCardModule } from '@angular/material/card';
|
|
11
|
+
import * as i4 from '@angular/material/chips';
|
|
12
|
+
import { MatChipsModule } from '@angular/material/chips';
|
|
13
|
+
import * as i2 from '@angular/material/form-field';
|
|
14
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
15
|
+
import * as i3$1 from '@angular/material/icon';
|
|
16
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
17
|
+
import * as i2$1 from '@angular/material/input';
|
|
18
|
+
import { MatInputModule } from '@angular/material/input';
|
|
19
|
+
import * as i8 from '@angular/material/select';
|
|
20
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
21
|
+
import * as i1$2 from '@angular/material/slide-toggle';
|
|
22
|
+
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
23
|
+
import * as i5 from '@angular/material/tooltip';
|
|
24
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
25
|
+
import { ElementTypes } from 'ngx-t-forms-types';
|
|
26
|
+
import { v4 } from 'uuid';
|
|
27
|
+
import { _ as _isEqual, E as EmptyStateComponent } from './ngx-t-forms-ngx-t-forms-C2G8_WQk.mjs';
|
|
28
|
+
|
|
29
|
+
let nextUniqueId = 0;
|
|
30
|
+
const IDLE = { mode: 'idle' };
|
|
31
|
+
/**
|
|
32
|
+
* Internal editor element for configuring an MSCOA input's included account
|
|
33
|
+
* segments. Child of `t-dynamic-data-edit`, which supplies the field label,
|
|
34
|
+
* hint, and validation errors - so this component owns only the segment chip
|
|
35
|
+
* row and the add/edit panel.
|
|
36
|
+
*
|
|
37
|
+
* The segment list is seeded from the MSCOA tree (`getMscoaTree`); each segment
|
|
38
|
+
* carries flags such as single-select, read-only, VAT-selection and
|
|
39
|
+
* inherit-from-accrual. In cash-segment mode (`isCashSegmentConfig`) every
|
|
40
|
+
* non-`item` segment defaults to inherit-from-accrual + read-only.
|
|
41
|
+
*/
|
|
42
|
+
class MscoaSegmentConfigComponent {
|
|
43
|
+
#fb;
|
|
44
|
+
#destroyRef;
|
|
45
|
+
/** Tree-derived segment templates (drives the segment `mat-select`). */
|
|
46
|
+
#treeSegments;
|
|
47
|
+
/** Error raised while fetching the tree (`null` until/unless the fetch fails). */
|
|
48
|
+
#fetchError;
|
|
49
|
+
/** Add/edit panel state. */
|
|
50
|
+
#editState;
|
|
51
|
+
/** Add/edit panel state for account-level custom inputs. */
|
|
52
|
+
#customInputState;
|
|
53
|
+
/** Guards single-shot tree load (mirrors the original take(1) one-time fetch). */
|
|
54
|
+
#treeRequested;
|
|
55
|
+
constructor() {
|
|
56
|
+
/**
|
|
57
|
+
* Validation errors passed down by the parent editor. Retained on the contract
|
|
58
|
+
* but not rendered here - `t-dynamic-data-edit` owns error display.
|
|
59
|
+
*/
|
|
60
|
+
this.errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
61
|
+
/** The full MSCOA input config; supplies the extension-account options. */
|
|
62
|
+
this.dataValue = input(undefined, ...(ngDevMode ? [{ debugName: "dataValue" }] : /* istanbul ignore next */ []));
|
|
63
|
+
/** Disable user interaction. */
|
|
64
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
65
|
+
/** Cash-segment mode: non-`item` segments default to inherit + read-only. */
|
|
66
|
+
this.isCashSegmentConfig = input(false, ...(ngDevMode ? [{ debugName: "isCashSegmentConfig" }] : /* istanbul ignore next */ []));
|
|
67
|
+
/** Currently configured segments. */
|
|
68
|
+
this.value = input(undefined, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
69
|
+
/** When true, render every tree segment read-only (no add/remove). */
|
|
70
|
+
this.showAllSegments = input(false, ...(ngDevMode ? [{ debugName: "showAllSegments" }] : /* istanbul ignore next */ []));
|
|
71
|
+
/**
|
|
72
|
+
* Stream that resolves the MSCOA account tree. Heterogeneous wrapper binding -
|
|
73
|
+
* the parent feeds whatever the editor config holds; narrowing here would force
|
|
74
|
+
* wrapper changes.
|
|
75
|
+
*/
|
|
76
|
+
this.getMscoaTree = input(undefined, ...(ngDevMode ? [{ debugName: "getMscoaTree" }] : /* istanbul ignore next */ []));
|
|
77
|
+
/**
|
|
78
|
+
* Creates or updates an account-level custom input (a peer of the segments) from
|
|
79
|
+
* the quick editor. Threaded through `t-dynamic-data-edit`; absent outside the
|
|
80
|
+
* builder, which hides the affordance.
|
|
81
|
+
*/
|
|
82
|
+
this.saveCustomInput = input(undefined, ...(ngDevMode ? [{ debugName: "saveCustomInput" }] : /* istanbul ignore next */ []));
|
|
83
|
+
/** Opens a custom input in the form-builder's input editor for advanced configuration. */
|
|
84
|
+
this.editSegmentInput = input(undefined, ...(ngDevMode ? [{ debugName: "editSegmentInput" }] : /* istanbul ignore next */ []));
|
|
85
|
+
/** Removes a custom input from the MSCOA config. */
|
|
86
|
+
this.deleteSegmentInput = input(undefined, ...(ngDevMode ? [{ debugName: "deleteSegmentInput" }] : /* istanbul ignore next */ []));
|
|
87
|
+
/** Emits the mutated segment list whenever the user adds, edits, or removes one. */
|
|
88
|
+
this.valueChanged = output();
|
|
89
|
+
/** Host id attribute - stable, unique per instance. */
|
|
90
|
+
this.hostId = `app-mscoa-segment-config-${nextUniqueId++}`;
|
|
91
|
+
this.#fb = inject(FormBuilder);
|
|
92
|
+
this.#destroyRef = inject(DestroyRef);
|
|
93
|
+
/** Tree-derived segment templates (drives the segment `mat-select`). */
|
|
94
|
+
this.#treeSegments = signal([], ...(ngDevMode ? [{ debugName: "#treeSegments" }] : /* istanbul ignore next */ []));
|
|
95
|
+
/** Error raised while fetching the tree (`null` until/unless the fetch fails). */
|
|
96
|
+
this.#fetchError = signal(null, ...(ngDevMode ? [{ debugName: "#fetchError" }] : /* istanbul ignore next */ []));
|
|
97
|
+
/** True while the tree stream is in flight. */
|
|
98
|
+
this.loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
99
|
+
/** Add/edit panel state. */
|
|
100
|
+
this.#editState = signal(IDLE, ...(ngDevMode ? [{ debugName: "#editState" }] : /* istanbul ignore next */ []));
|
|
101
|
+
/** Reactive form for the segment currently being added/edited. */
|
|
102
|
+
this.segmentForm = this.#createSegmentForm();
|
|
103
|
+
/** Add/edit panel state for account-level custom inputs. */
|
|
104
|
+
this.#customInputState = signal({ mode: 'idle' }, ...(ngDevMode ? [{ debugName: "#customInputState" }] : /* istanbul ignore next */ []));
|
|
105
|
+
/** Reactive form for the custom input currently being added/edited. */
|
|
106
|
+
this.customInputForm = this.#createCustomInputForm();
|
|
107
|
+
/** Curated input-type options for the custom-input quick editor. */
|
|
108
|
+
this.customInputTypes = [
|
|
109
|
+
{ value: ElementTypes.Input, label: 'Text / number' },
|
|
110
|
+
{ value: ElementTypes.Select, label: 'Select' },
|
|
111
|
+
{ value: ElementTypes.DatePicker, label: 'Date' },
|
|
112
|
+
{ value: ElementTypes.Toggle, label: 'Toggle' },
|
|
113
|
+
];
|
|
114
|
+
/** Guards single-shot tree load (mirrors the original take(1) one-time fetch). */
|
|
115
|
+
this.#treeRequested = false;
|
|
116
|
+
/**
|
|
117
|
+
* The configured segments, always a real array. The editor descriptor seeds
|
|
118
|
+
* an unconfigured segments value as `false` (its `defaultValue`), so guard
|
|
119
|
+
* against any non-array input — `?? []` alone would let `false`/objects
|
|
120
|
+
* through and break `.some` / `.map` / `@for` downstream.
|
|
121
|
+
*/
|
|
122
|
+
this.resolvedValue = computed(() => {
|
|
123
|
+
const value = this.value();
|
|
124
|
+
return Array.isArray(value) ? value : [];
|
|
125
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedValue" }] : /* istanbul ignore next */ []));
|
|
126
|
+
/** Tree-derived segment templates for the picker. */
|
|
127
|
+
this.treeSegments = this.#treeSegments.asReadonly();
|
|
128
|
+
/**
|
|
129
|
+
* Loader/tree error message; `null` when none. A fetch error takes priority,
|
|
130
|
+
* otherwise a missing loader surfaces the "No loader provided" notice.
|
|
131
|
+
*/
|
|
132
|
+
this.treeError = computed(() => {
|
|
133
|
+
const fetchError = this.#fetchError();
|
|
134
|
+
if (fetchError) {
|
|
135
|
+
return fetchError;
|
|
136
|
+
}
|
|
137
|
+
return this.getMscoaTree() ? null : 'No loader provided';
|
|
138
|
+
}, ...(ngDevMode ? [{ debugName: "treeError" }] : /* istanbul ignore next */ []));
|
|
139
|
+
/** Whether the add/edit panel is open. */
|
|
140
|
+
this.isEditing = computed(() => this.#editState().mode !== 'idle', ...(ngDevMode ? [{ debugName: "isEditing" }] : /* istanbul ignore next */ []));
|
|
141
|
+
/** Whether the open panel is adding a brand-new segment. */
|
|
142
|
+
this.isAddingNew = computed(() => this.#editState().mode === 'add', ...(ngDevMode ? [{ debugName: "isAddingNew" }] : /* istanbul ignore next */ []));
|
|
143
|
+
/** Whether the "Add new segment" toolbar button should show. */
|
|
144
|
+
this.canAddNew = computed(() => !this.isEditing() && !this.showAllSegments(), ...(ngDevMode ? [{ debugName: "canAddNew" }] : /* istanbul ignore next */ []));
|
|
145
|
+
/** Whether the custom-input add/edit panel is open. */
|
|
146
|
+
this.isCustomInputPanelOpen = computed(() => this.#customInputState().mode !== 'idle', ...(ngDevMode ? [{ debugName: "isCustomInputPanelOpen" }] : /* istanbul ignore next */ []));
|
|
147
|
+
// One-time tree load. Mirrors the original `take(1)` fetch. The signal
|
|
148
|
+
// writes happen off the reactive tick (microtask) so the effect itself
|
|
149
|
+
// performs no synchronous signal mutation.
|
|
150
|
+
effect(() => {
|
|
151
|
+
const tree$ = this.getMscoaTree();
|
|
152
|
+
if (!tree$ || this.#treeRequested) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
this.#treeRequested = true;
|
|
156
|
+
queueMicrotask(() => this.#loadMscoa(tree$));
|
|
157
|
+
});
|
|
158
|
+
// Reflect the full tree as read-only segments when `showAllSegments` is on.
|
|
159
|
+
effect(() => {
|
|
160
|
+
if (this.showAllSegments()) {
|
|
161
|
+
this.#syncAllSegments();
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/** Fetch the tree once, build the segment templates, surface any error. */
|
|
166
|
+
#loadMscoa(tree$) {
|
|
167
|
+
this.#fetchError.set(null);
|
|
168
|
+
this.loading.set(true);
|
|
169
|
+
tree$
|
|
170
|
+
.pipe(take(1), tap((response) => {
|
|
171
|
+
this.#treeSegments.set(this.#buildTreeSegments(response));
|
|
172
|
+
this.loading.set(false);
|
|
173
|
+
}), catchError(() => {
|
|
174
|
+
this.#fetchError.set('Failed to fetch mscoa tree');
|
|
175
|
+
this.loading.set(false);
|
|
176
|
+
return of(undefined);
|
|
177
|
+
}), takeUntilDestroyed(this.#destroyRef))
|
|
178
|
+
.subscribe();
|
|
179
|
+
}
|
|
180
|
+
/** Map the tree account keys into seedable segment templates. */
|
|
181
|
+
#buildTreeSegments(response) {
|
|
182
|
+
const isCash = this.isCashSegmentConfig();
|
|
183
|
+
const current = this.resolvedValue();
|
|
184
|
+
return (response?.accountTreeKeys ?? []).map((treeKey) => {
|
|
185
|
+
const isItem = treeKey.toLocaleLowerCase() === 'item';
|
|
186
|
+
return {
|
|
187
|
+
id: v4(),
|
|
188
|
+
segment: treeKey,
|
|
189
|
+
singleSelect: true,
|
|
190
|
+
additionalAccounts: [],
|
|
191
|
+
inheritValueFromAccrual: isCash ? !isItem : undefined,
|
|
192
|
+
vatSelectonActive: isCash ? false : isItem,
|
|
193
|
+
segmentExtension: false,
|
|
194
|
+
label: this.#toTitleCase(treeKey),
|
|
195
|
+
readOnly: current.find((v) => v.segment === treeKey)?.readOnly ||
|
|
196
|
+
(isCash && !isItem) ||
|
|
197
|
+
false,
|
|
198
|
+
};
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
/** Build the per-segment reactive form. */
|
|
202
|
+
#createSegmentForm(segment = {
|
|
203
|
+
segment: '',
|
|
204
|
+
label: '',
|
|
205
|
+
id: v4(),
|
|
206
|
+
singleSelect: true,
|
|
207
|
+
segmentExtension: false,
|
|
208
|
+
additionalAccounts: [],
|
|
209
|
+
readOnly: false,
|
|
210
|
+
}) {
|
|
211
|
+
const isItem = segment.segment?.toLocaleLowerCase() === 'item';
|
|
212
|
+
return this.#fb.group({
|
|
213
|
+
id: [segment.id],
|
|
214
|
+
segment: [segment.segment, Validators.required],
|
|
215
|
+
segmentExtension: [segment.segmentExtension, Validators.required],
|
|
216
|
+
readOnly: [segment.readOnly, Validators.required],
|
|
217
|
+
// Default to a concrete `false` in cash mode: `Validators.required` rejects
|
|
218
|
+
// `undefined` (but accepts `false`), so a brand-new segment whose toggle was
|
|
219
|
+
// never touched would otherwise keep the form invalid and the Save button
|
|
220
|
+
// permanently disabled. Existing values (true/false) pass through unchanged.
|
|
221
|
+
inheritValueFromAccrual: this.isCashSegmentConfig()
|
|
222
|
+
? [segment.inheritValueFromAccrual ?? false, Validators.required]
|
|
223
|
+
: [segment.inheritValueFromAccrual],
|
|
224
|
+
vatSelectonActive: isItem
|
|
225
|
+
? [Boolean(segment.vatSelectonActive), Validators.required]
|
|
226
|
+
: [Boolean(segment.vatSelectonActive)],
|
|
227
|
+
additionalAccounts: [segment.additionalAccounts ?? []],
|
|
228
|
+
label: [segment.label, Validators.required],
|
|
229
|
+
singleSelect: [segment.singleSelect, Validators.required],
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
startAddNew() {
|
|
233
|
+
this.segmentForm = this.#createSegmentForm();
|
|
234
|
+
this.#editState.set({ mode: 'add' });
|
|
235
|
+
}
|
|
236
|
+
startEdit(index) {
|
|
237
|
+
const segment = this.resolvedValue().at(index);
|
|
238
|
+
if (!segment) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
this.segmentForm = this.#createSegmentForm(segment);
|
|
242
|
+
this.#editState.set({ mode: 'edit', index });
|
|
243
|
+
}
|
|
244
|
+
cancelEdit() {
|
|
245
|
+
this.segmentForm.reset();
|
|
246
|
+
this.#editState.set(IDLE);
|
|
247
|
+
}
|
|
248
|
+
saveSegment() {
|
|
249
|
+
if (!this.segmentForm.valid) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const raw = this.segmentForm.getRawValue();
|
|
253
|
+
const label = this.#toTitleCase(String(raw.label ?? ''));
|
|
254
|
+
const newSegment = {
|
|
255
|
+
id: typeof raw.id === 'string' && raw.id ? raw.id : v4(),
|
|
256
|
+
segment: raw.segment,
|
|
257
|
+
// Multi-level segments derive their key from the (upper-cased) label.
|
|
258
|
+
customSegment: raw.segmentExtension ? label.toLocaleUpperCase() : undefined,
|
|
259
|
+
segmentExtension: Boolean(raw.segmentExtension),
|
|
260
|
+
inheritValueFromAccrual: Boolean(raw.inheritValueFromAccrual),
|
|
261
|
+
vatSelectonActive: Boolean(raw.vatSelectonActive),
|
|
262
|
+
additionalAccounts: Array.isArray(raw.additionalAccounts) ? raw.additionalAccounts : [],
|
|
263
|
+
label,
|
|
264
|
+
singleSelect: Boolean(raw.singleSelect),
|
|
265
|
+
readOnly: Boolean(raw.readOnly),
|
|
266
|
+
};
|
|
267
|
+
const state = this.#editState();
|
|
268
|
+
const updated = [...this.resolvedValue()];
|
|
269
|
+
if (state.mode === 'add') {
|
|
270
|
+
updated.push(newSegment);
|
|
271
|
+
}
|
|
272
|
+
else if (state.mode === 'edit') {
|
|
273
|
+
updated[state.index] = newSegment;
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
this.valueChanged.emit(updated);
|
|
279
|
+
this.cancelEdit();
|
|
280
|
+
}
|
|
281
|
+
readOnlyChanged(event) {
|
|
282
|
+
this.segmentForm.patchValue({ readOnly: event.checked });
|
|
283
|
+
}
|
|
284
|
+
singleSelectChange(event) {
|
|
285
|
+
this.segmentForm.patchValue({ singleSelect: event.checked });
|
|
286
|
+
}
|
|
287
|
+
setVatSelectionActive(event) {
|
|
288
|
+
this.segmentForm.patchValue({ vatSelectonActive: event.checked });
|
|
289
|
+
}
|
|
290
|
+
/** Inherit-from-accrual implies read-only (quirk: toggling on forces read-only). */
|
|
291
|
+
setInheritFromAccrual(event) {
|
|
292
|
+
this.segmentForm.patchValue({ inheritValueFromAccrual: event.checked });
|
|
293
|
+
if (event.checked) {
|
|
294
|
+
this.segmentForm.patchValue({ readOnly: true });
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
multiLevelSelectChange(event) {
|
|
298
|
+
this.segmentForm.patchValue({ segmentExtension: event.checked });
|
|
299
|
+
}
|
|
300
|
+
/** Pick a segment; auto-fill the label from it unless this is a multi-level extension. */
|
|
301
|
+
selectSegment(event) {
|
|
302
|
+
this.segmentForm.patchValue({ segment: event.value });
|
|
303
|
+
if (!this.segmentForm.value.segmentExtension) {
|
|
304
|
+
this.segmentForm.patchValue({ label: this.#toTitleCase(String(event.value ?? '')) });
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
additionalAccountsChanged(event) {
|
|
308
|
+
this.segmentForm.patchValue({ additionalAccounts: [...event.value] }, { emitEvent: true });
|
|
309
|
+
}
|
|
310
|
+
removeSegment(index) {
|
|
311
|
+
const updated = this.resolvedValue().filter((_, i) => i !== index);
|
|
312
|
+
this.valueChanged.emit(updated);
|
|
313
|
+
}
|
|
314
|
+
/** All account-level custom inputs (peers of the segments — not segment-linked). */
|
|
315
|
+
customInputs() {
|
|
316
|
+
return (this.dataValue()?.mscoaConfig?.inputs ?? []).filter((input) => !input.linkedSegmentId);
|
|
317
|
+
}
|
|
318
|
+
/** Whether custom inputs can be managed (builder callbacks present). */
|
|
319
|
+
get canManageInputs() {
|
|
320
|
+
return !!this.saveCustomInput() && !!this.dataValue()?.id;
|
|
321
|
+
}
|
|
322
|
+
/** Open the panel to add a new custom input. */
|
|
323
|
+
startAddCustomInput() {
|
|
324
|
+
this.cancelEdit();
|
|
325
|
+
this.customInputForm = this.#createCustomInputForm();
|
|
326
|
+
this.#customInputState.set({ mode: 'add' });
|
|
327
|
+
}
|
|
328
|
+
/** Open the panel to edit an existing custom input's basics. */
|
|
329
|
+
startEditCustomInput(input) {
|
|
330
|
+
this.cancelEdit();
|
|
331
|
+
this.customInputForm = this.#createCustomInputForm(input);
|
|
332
|
+
this.#customInputState.set({ mode: 'edit', id: input.id });
|
|
333
|
+
}
|
|
334
|
+
/** Close the custom-input panel without saving. */
|
|
335
|
+
cancelCustomInput() {
|
|
336
|
+
this.customInputForm.reset();
|
|
337
|
+
this.#customInputState.set({ mode: 'idle' });
|
|
338
|
+
}
|
|
339
|
+
/** Persist the custom-input panel through the builder save callback. */
|
|
340
|
+
saveCustomInputPanel() {
|
|
341
|
+
const data = this.dataValue();
|
|
342
|
+
if (!this.customInputForm.valid || !data?.id) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
const raw = this.customInputForm.getRawValue();
|
|
346
|
+
const label = String(raw.label ?? '').trim();
|
|
347
|
+
this.saveCustomInput()?.(data.sectionId, data.id, {
|
|
348
|
+
id: typeof raw.id === 'string' && raw.id ? raw.id : undefined,
|
|
349
|
+
element: raw.element,
|
|
350
|
+
label,
|
|
351
|
+
formControlName: this.#toControlName(label),
|
|
352
|
+
singleSelect: Boolean(raw.singleSelect),
|
|
353
|
+
readonly: Boolean(raw.readonly),
|
|
354
|
+
});
|
|
355
|
+
this.cancelCustomInput();
|
|
356
|
+
}
|
|
357
|
+
/** Open a custom input in the builder's input editor for advanced configuration. */
|
|
358
|
+
onEditAdvanced(input) {
|
|
359
|
+
this.editSegmentInput()?.(input);
|
|
360
|
+
}
|
|
361
|
+
/** Remove a custom input from the MSCOA config. */
|
|
362
|
+
onDeleteInput(input) {
|
|
363
|
+
this.deleteSegmentInput()?.(input);
|
|
364
|
+
}
|
|
365
|
+
/** Build the per-custom-input reactive form (type, label, single-value-selection, read-only). */
|
|
366
|
+
#createCustomInputForm(input) {
|
|
367
|
+
return this.#fb.group({
|
|
368
|
+
id: [input?.id ?? null],
|
|
369
|
+
element: [input?.element ?? ElementTypes.Input, Validators.required],
|
|
370
|
+
label: [input?.label ?? '', Validators.required],
|
|
371
|
+
singleSelect: [input?.singleSelect ?? true],
|
|
372
|
+
readonly: [input?.readonly ?? false],
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
/** camelCase control name derived from a label (e.g. "Budget Value" -> "budgetValue"). */
|
|
376
|
+
#toControlName(label) {
|
|
377
|
+
const words = label.match(/[a-z0-9]+/gi) ?? [];
|
|
378
|
+
return words
|
|
379
|
+
.map((word, index) => index === 0
|
|
380
|
+
? word.toLowerCase()
|
|
381
|
+
: word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
382
|
+
.join('');
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* A tree template is "already used" (and so disabled in the picker) when a
|
|
386
|
+
* segment with the same key is already configured - except for multi-level
|
|
387
|
+
* extensions, which may reuse a key.
|
|
388
|
+
*/
|
|
389
|
+
alreadyExists(segment) {
|
|
390
|
+
if (this.segmentForm.value.segmentExtension) {
|
|
391
|
+
return false;
|
|
392
|
+
}
|
|
393
|
+
return this.resolvedValue().some((v) => v.segment === segment.segment);
|
|
394
|
+
}
|
|
395
|
+
/** Extension-account options drawn from the MSCOA config. */
|
|
396
|
+
get extensionAccountsForSegments() {
|
|
397
|
+
return this.dataValue()?.mscoaConfig?.extensionAccountsForSegments ?? [];
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* When `showAllSegments` is on, reconcile the configured value against the full
|
|
401
|
+
* tree. Preserves the deliberate double-emit sync: emit a reset sentinel first,
|
|
402
|
+
* then the merged list on the next microtask so the parent re-renders cleanly.
|
|
403
|
+
*/
|
|
404
|
+
#syncAllSegments() {
|
|
405
|
+
const templates = this.#treeSegments();
|
|
406
|
+
if (!this.#treeRequested || templates.length === 0) {
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
const current = this.resolvedValue();
|
|
410
|
+
const merged = templates.map((segment) => ({
|
|
411
|
+
...segment,
|
|
412
|
+
...(current.find((v) => v.segment === segment.segment) ?? {}),
|
|
413
|
+
}));
|
|
414
|
+
if (!_isEqual(merged, current)) {
|
|
415
|
+
// Reset sentinel, then the real value, to force downstream re-binding.
|
|
416
|
+
this.valueChanged.emit([{}]);
|
|
417
|
+
queueMicrotask(() => this.valueChanged.emit(merged));
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
#toTitleCase(str) {
|
|
421
|
+
return str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.slice(1).toLowerCase());
|
|
422
|
+
}
|
|
423
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MscoaSegmentConfigComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
424
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: MscoaSegmentConfigComponent, isStandalone: true, selector: "lib-mscoa-segment-config", inputs: { errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, dataValue: { classPropertyName: "dataValue", publicName: "dataValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, isCashSegmentConfig: { classPropertyName: "isCashSegmentConfig", publicName: "isCashSegmentConfig", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, showAllSegments: { classPropertyName: "showAllSegments", publicName: "showAllSegments", isSignal: true, isRequired: false, transformFunction: null }, getMscoaTree: { classPropertyName: "getMscoaTree", publicName: "getMscoaTree", isSignal: true, isRequired: false, transformFunction: null }, saveCustomInput: { classPropertyName: "saveCustomInput", publicName: "saveCustomInput", isSignal: true, isRequired: false, transformFunction: null }, editSegmentInput: { classPropertyName: "editSegmentInput", publicName: "editSegmentInput", isSignal: true, isRequired: false, transformFunction: null }, deleteSegmentInput: { classPropertyName: "deleteSegmentInput", publicName: "deleteSegmentInput", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChanged: "valueChanged" }, host: { properties: { "attr.id": "hostId" }, classAttribute: "lib-mscoa-segment-config" }, ngImport: i0, template: "@if (loading()) {\n <div class=\"mscoa-segment-config__notice\">\n <mat-icon class=\"mscoa-segment-config__notice-icon\">hourglass_top</mat-icon>\n <span>Loading account segments\u2026</span>\n </div>\n}\n\n@if (treeError(); as error) {\n <div class=\"mscoa-segment-config__notice mscoa-segment-config__notice--error\">\n <mat-icon class=\"mscoa-segment-config__notice-icon\">error_outline</mat-icon>\n <span>{{ error }}</span>\n </div>\n}\n\n@if (resolvedValue().length > 0) {\n <div class=\"mscoa-segment-config__section\">\n <p class=\"mscoa-segment-config__section-label\">Configured segments</p>\n <mat-chip-listbox [disabled]=\"disabled()\" aria-label=\"Configured account segments\">\n @for (segment of resolvedValue(); track segment.id; let i = $index) {\n <mat-chip-option\n (removed)=\"removeSegment(i)\"\n (click)=\"startEdit(i)\"\n [value]=\"segment.segment\"\n [selected]=\"isEditing() && !isAddingNew()\">\n <span class=\"mscoa-segment-config__chip-content\">\n <span class=\"mscoa-segment-config__chip-label\">{{ segment.label }}</span>\n <mat-icon class=\"mscoa-segment-config__chip-icon\">\n {{ segment.singleSelect ? 'done' : 'done_all' }}\n </mat-icon>\n <mat-icon class=\"mscoa-segment-config__chip-icon\">\n {{ segment.readOnly ? 'edit_off' : 'edit' }}\n </mat-icon>\n </span>\n\n @if (showAllSegments() === false) {\n <button matChipRemove aria-label=\"Remove segment\" [disabled]=\"disabled()\">\n <mat-icon>cancel</mat-icon>\n </button>\n }\n </mat-chip-option>\n }\n </mat-chip-listbox>\n </div>\n} @else if (!loading()) {\n <lib-empty-state\n icon=\"account_tree\"\n message=\"No segments configured yet. Add one to begin shaping this MSCOA input.\">\n @if (canAddNew()) {\n <button mat-stroked-button [disabled]=\"disabled()\" (click)=\"startAddNew()\">\n <mat-icon>add</mat-icon>\n Add segment\n </button>\n }\n </lib-empty-state>\n}\n\n@if (canAddNew() && resolvedValue().length > 0) {\n <button\n class=\"mscoa-segment-config__add\"\n mat-stroked-button\n [disabled]=\"disabled()\"\n (click)=\"startAddNew()\">\n <mat-icon>add</mat-icon>\n Add new segment\n </button>\n}\n\n@if (canManageInputs) {\n <!-- Account-level custom inputs (peers of the segments): list + consolidated add/edit panel. -->\n <div class=\"mscoa-segment-config__section\">\n <p class=\"mscoa-segment-config__section-label\">Custom inputs</p>\n <p class=\"mscoa-segment-config__hint\">\n Account-level inputs that sit alongside the segments (e.g. budget value,\n department). Each is a full form input entered per leg; single value\n selection applies one value across debit and credit.\n </p>\n\n @for (input of customInputs(); track input.id) {\n <div class=\"mscoa-segment-config__custom-input-row\">\n <mat-icon class=\"mscoa-segment-config__input-icon\">tune</mat-icon>\n <span class=\"mscoa-segment-config__input-label\">\n {{ input.label || input.formControlName || 'Untitled input' }}\n </span>\n <button\n mat-icon-button\n type=\"button\"\n [disabled]=\"disabled()\"\n matTooltip=\"Edit\"\n aria-label=\"Edit input\"\n (click)=\"startEditCustomInput(input)\">\n <mat-icon>edit</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n [disabled]=\"disabled()\"\n matTooltip=\"Advanced settings (validators, calculations, API)\"\n aria-label=\"Advanced settings\"\n (click)=\"onEditAdvanced(input)\">\n <mat-icon>tune</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n [disabled]=\"disabled()\"\n matTooltip=\"Remove\"\n aria-label=\"Remove input\"\n (click)=\"onDeleteInput(input)\">\n <mat-icon>delete_outline</mat-icon>\n </button>\n </div>\n } @empty {\n <p class=\"mscoa-segment-config__hint mscoa-segment-config__hint--muted\">\n No custom inputs yet.\n </p>\n }\n\n @if (!isCustomInputPanelOpen()) {\n <button\n class=\"mscoa-segment-config__add-input\"\n mat-stroked-button\n type=\"button\"\n [disabled]=\"disabled()\"\n (click)=\"startAddCustomInput()\">\n <mat-icon>add</mat-icon>\n Add custom input\n </button>\n }\n\n @if (isCustomInputPanelOpen()) {\n <mat-card class=\"mscoa-segment-config__panel\" appearance=\"outlined\">\n <mat-card-header>\n <mat-card-subtitle>\n {{ customInputForm.value.id ? 'Update' : 'Add a' }} custom input\n </mat-card-subtitle>\n </mat-card-header>\n\n <mat-card-content>\n <form [formGroup]=\"customInputForm\" (ngSubmit)=\"saveCustomInputPanel()\">\n <div class=\"mscoa-segment-config__group\">\n <mat-form-field subscriptSizing=\"dynamic\" floatLabel=\"always\" appearance=\"outline\">\n <mat-label>Input type</mat-label>\n <mat-select formControlName=\"element\" placeholder=\"Select input type\">\n @for (type of customInputTypes; track type.value) {\n <mat-option [value]=\"type.value\">{{ type.label }}</mat-option>\n }\n </mat-select>\n <mat-hint>Use Advanced settings for validators, calculations and API.</mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"mscoa-segment-config__group\">\n <mat-form-field subscriptSizing=\"dynamic\" floatLabel=\"always\" appearance=\"outline\">\n <mat-label>Label</mat-label>\n <input matInput formControlName=\"label\" placeholder=\"Enter label\" />\n <mat-hint>A descriptive name (e.g. 'Budget value', 'Department').</mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"mscoa-segment-config__group\">\n <div class=\"mscoa-segment-config__toggle\">\n <mat-slide-toggle formControlName=\"singleSelect\">Single value selection</mat-slide-toggle>\n </div>\n <p class=\"mscoa-segment-config__hint\">\n When enabled, one value applies across debit and credit; when disabled, a value is\n entered per leg.\n </p>\n </div>\n\n <div class=\"mscoa-segment-config__group\">\n <div class=\"mscoa-segment-config__toggle\">\n <mat-slide-toggle formControlName=\"readonly\">Read only</mat-slide-toggle>\n </div>\n <p class=\"mscoa-segment-config__hint\">\n Prevents users from changing the value after initial setup.\n </p>\n </div>\n\n <mat-card-actions class=\"mscoa-segment-config__actions\">\n <button mat-button type=\"button\" (click)=\"cancelCustomInput()\">Cancel</button>\n <button mat-flat-button color=\"primary\" type=\"submit\" [disabled]=\"!customInputForm.valid\">\n Save\n </button>\n </mat-card-actions>\n </form>\n </mat-card-content>\n </mat-card>\n }\n </div>\n}\n\n@if (isEditing()) {\n <mat-card class=\"mscoa-segment-config__panel\" appearance=\"outlined\">\n <mat-card-header>\n <mat-card-subtitle>\n {{ isAddingNew() ? 'Add a new' : 'Update' }} segment\n </mat-card-subtitle>\n </mat-card-header>\n\n <mat-card-content>\n <form [formGroup]=\"segmentForm\" (ngSubmit)=\"saveSegment()\">\n <div class=\"mscoa-segment-config__group\">\n <div class=\"mscoa-segment-config__toggle\">\n <mat-slide-toggle\n (change)=\"multiLevelSelectChange($event)\"\n [checked]=\"segmentForm.value.segmentExtension\">\n Enable multi-level segmentation\n </mat-slide-toggle>\n </div>\n <p class=\"mscoa-segment-config__hint\">\n Allows sub-classifications within this segment for more detailed accounting hierarchies.\n </p>\n\n <mat-form-field subscriptSizing=\"dynamic\" floatLabel=\"always\" appearance=\"outline\">\n <mat-label>Segment</mat-label>\n <mat-select\n (selectionChange)=\"selectSegment($event)\"\n formControlName=\"segment\"\n placeholder=\"Select segment\">\n @for (segment of treeSegments(); track segment.id) {\n <mat-option [disabled]=\"alreadyExists(segment)\" [value]=\"segment.segment\">\n {{ segment.label }}\n </mat-option>\n }\n </mat-select>\n <mat-hint>Select an account segment type from your chart of accounts.</mat-hint>\n </mat-form-field>\n </div>\n\n @if (isCashSegmentConfig()) {\n <div class=\"mscoa-segment-config__group\">\n <div class=\"mscoa-segment-config__toggle\">\n <mat-slide-toggle\n (change)=\"setInheritFromAccrual($event)\"\n [checked]=\"segmentForm.value.inheritValueFromAccrual\">\n Inherit from accrual\n </mat-slide-toggle>\n </div>\n <p class=\"mscoa-segment-config__hint\">\n When enabled, changes to the accrual value reflect here automatically.\n </p>\n </div>\n }\n\n <div class=\"mscoa-segment-config__group\">\n <mat-form-field subscriptSizing=\"dynamic\" floatLabel=\"always\" appearance=\"outline\">\n <mat-label>Label</mat-label>\n <input\n matInput\n formControlName=\"label\"\n [readonly]=\"!segmentForm.value.segmentExtension\"\n placeholder=\"Enter label\" />\n <mat-hint>\n A descriptive name for this segment (e.g. 'Department', 'Project', 'Cost Center').\n </mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"mscoa-segment-config__group\">\n <div class=\"mscoa-segment-config__toggle\">\n <mat-slide-toggle\n (change)=\"singleSelectChange($event)\"\n [checked]=\"segmentForm.value.singleSelect\">\n Single value selection\n </mat-slide-toggle>\n </div>\n <p class=\"mscoa-segment-config__hint\">\n When enabled, transactions are assigned to one value within this segment; when disabled,\n they can be split across multiple values.\n </p>\n </div>\n\n @if (segmentForm.value.segment?.toLocaleLowerCase() === 'item') {\n <div class=\"mscoa-segment-config__group\">\n <div class=\"mscoa-segment-config__toggle\">\n <mat-slide-toggle\n (change)=\"setVatSelectionActive($event)\"\n [checked]=\"segmentForm.value.vatSelectonActive\">\n Require VAT account selection\n </mat-slide-toggle>\n </div>\n <p class=\"mscoa-segment-config__hint\">\n When active, users must specify a VAT account for taxable items.\n </p>\n </div>\n }\n\n <div class=\"mscoa-segment-config__group\">\n <div class=\"mscoa-segment-config__toggle\">\n <mat-slide-toggle\n (change)=\"readOnlyChanged($event)\"\n [checked]=\"segmentForm.value.readOnly\">\n Read-only segment\n </mat-slide-toggle>\n </div>\n <p class=\"mscoa-segment-config__hint\">\n Prevents users from modifying segment values after initial setup. Use for regulatory or\n policy-controlled segments.\n </p>\n </div>\n\n <div class=\"mscoa-segment-config__group\">\n <mat-form-field subscriptSizing=\"dynamic\" floatLabel=\"always\" appearance=\"outline\">\n <mat-label>Additional accounts</mat-label>\n <mat-select\n (selectionChange)=\"additionalAccountsChanged($event)\"\n formControlName=\"additionalAccounts\"\n multiple\n placeholder=\"Select counter accounts\">\n @for (ext of extensionAccountsForSegments; track ext) {\n <mat-option [value]=\"ext\">{{ ext }}</mat-option>\n }\n </mat-select>\n <mat-hint>\n Add supporting accounts for this segment (e.g. VAT or tax accounts).\n </mat-hint>\n </mat-form-field>\n </div>\n\n <mat-card-actions class=\"mscoa-segment-config__actions\">\n <button mat-button type=\"button\" (click)=\"cancelEdit()\">Cancel</button>\n <button mat-flat-button color=\"primary\" type=\"submit\" [disabled]=\"!segmentForm.valid\">\n Save\n </button>\n </mat-card-actions>\n </form>\n </mat-card-content>\n </mat-card>\n}\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;gap:1.5rem;color:var(--lib-forms-on-surface)}.mscoa-segment-config__notice{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:var(--lib-forms-radius-md, 10px);background:var(--sem-info-surface);color:var(--lib-forms-on-surface);font-size:.875rem}.mscoa-segment-config__notice--error{background:var(--sem-error-surface)}.mscoa-segment-config__notice-icon{flex:0 0 auto;color:var(--lib-forms-on-surface-variant)}.mscoa-segment-config__notice--error .mscoa-segment-config__notice-icon{color:var(--sem-error)}.mscoa-segment-config__section{display:flex;flex-direction:column;gap:.75rem}.mscoa-segment-config__section-label{margin:0;font-size:.625rem;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--lib-forms-on-surface-variant)}.mscoa-segment-config__chip-content{display:inline-flex;align-items:center;gap:.375rem}.mscoa-segment-config__chip-label{margin-right:.125rem}.mscoa-segment-config__chip-icon{width:1rem;height:1rem;font-size:1rem;line-height:1;color:var(--lib-forms-on-surface-variant)}.mscoa-segment-config__add{width:100%}.mscoa-segment-config__panel{background:var(--lib-forms-surface);border:1px solid color-mix(in srgb,var(--lib-forms-outline) 15%,transparent);border-radius:var(--lib-forms-radius-lg, 12px);box-shadow:var(--lib-forms-shadow-resting);display:block}.mscoa-segment-config__group{display:flex;flex-direction:column;gap:.5rem;margin-bottom:1.5rem}.mscoa-segment-config__group:last-of-type{margin-bottom:0}.mscoa-segment-config__group mat-form-field{width:100%}.mscoa-segment-config__toggle{display:flex;align-items:center;padding:.5rem 0}.mscoa-segment-config__hint{margin:0;font-size:.75rem;line-height:1.4;color:var(--lib-forms-on-surface-variant)}.mscoa-segment-config__actions{display:flex;justify-content:flex-end;gap:.75rem;margin-top:.5rem}.mscoa-segment-config__custom-input-row{display:flex;align-items:center;gap:.5rem;padding:.375rem 0}.mscoa-segment-config__input-icon{flex:0 0 auto;width:1.125rem;height:1.125rem;font-size:1.125rem;line-height:1;color:var(--lib-forms-on-surface-variant)}.mscoa-segment-config__input-label{flex:1 1 auto;min-width:0;font-size:.875rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mscoa-segment-config__hint--muted{font-style:italic}.mscoa-segment-config__add-input{align-self:flex-start;margin-top:.25rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.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: i1$1.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.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i3.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i3.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i3.MatCardSubtitle, selector: "mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]" }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i4.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i4.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "directive", type: i4.MatChipRemove, selector: "[matChipRemove]" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i8.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i8.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i1$2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: EmptyStateComponent, selector: "lib-empty-state", inputs: ["icon", "message"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
425
|
+
}
|
|
426
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MscoaSegmentConfigComponent, decorators: [{
|
|
427
|
+
type: Component,
|
|
428
|
+
args: [{ selector: 'lib-mscoa-segment-config', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: {
|
|
429
|
+
'class': 'lib-mscoa-segment-config',
|
|
430
|
+
'[attr.id]': 'hostId',
|
|
431
|
+
}, imports: [
|
|
432
|
+
ReactiveFormsModule,
|
|
433
|
+
MatButtonModule,
|
|
434
|
+
MatCardModule,
|
|
435
|
+
MatChipsModule,
|
|
436
|
+
MatFormFieldModule,
|
|
437
|
+
MatIconModule,
|
|
438
|
+
MatInputModule,
|
|
439
|
+
MatSelectModule,
|
|
440
|
+
MatSlideToggleModule,
|
|
441
|
+
MatTooltipModule,
|
|
442
|
+
EmptyStateComponent,
|
|
443
|
+
], template: "@if (loading()) {\n <div class=\"mscoa-segment-config__notice\">\n <mat-icon class=\"mscoa-segment-config__notice-icon\">hourglass_top</mat-icon>\n <span>Loading account segments\u2026</span>\n </div>\n}\n\n@if (treeError(); as error) {\n <div class=\"mscoa-segment-config__notice mscoa-segment-config__notice--error\">\n <mat-icon class=\"mscoa-segment-config__notice-icon\">error_outline</mat-icon>\n <span>{{ error }}</span>\n </div>\n}\n\n@if (resolvedValue().length > 0) {\n <div class=\"mscoa-segment-config__section\">\n <p class=\"mscoa-segment-config__section-label\">Configured segments</p>\n <mat-chip-listbox [disabled]=\"disabled()\" aria-label=\"Configured account segments\">\n @for (segment of resolvedValue(); track segment.id; let i = $index) {\n <mat-chip-option\n (removed)=\"removeSegment(i)\"\n (click)=\"startEdit(i)\"\n [value]=\"segment.segment\"\n [selected]=\"isEditing() && !isAddingNew()\">\n <span class=\"mscoa-segment-config__chip-content\">\n <span class=\"mscoa-segment-config__chip-label\">{{ segment.label }}</span>\n <mat-icon class=\"mscoa-segment-config__chip-icon\">\n {{ segment.singleSelect ? 'done' : 'done_all' }}\n </mat-icon>\n <mat-icon class=\"mscoa-segment-config__chip-icon\">\n {{ segment.readOnly ? 'edit_off' : 'edit' }}\n </mat-icon>\n </span>\n\n @if (showAllSegments() === false) {\n <button matChipRemove aria-label=\"Remove segment\" [disabled]=\"disabled()\">\n <mat-icon>cancel</mat-icon>\n </button>\n }\n </mat-chip-option>\n }\n </mat-chip-listbox>\n </div>\n} @else if (!loading()) {\n <lib-empty-state\n icon=\"account_tree\"\n message=\"No segments configured yet. Add one to begin shaping this MSCOA input.\">\n @if (canAddNew()) {\n <button mat-stroked-button [disabled]=\"disabled()\" (click)=\"startAddNew()\">\n <mat-icon>add</mat-icon>\n Add segment\n </button>\n }\n </lib-empty-state>\n}\n\n@if (canAddNew() && resolvedValue().length > 0) {\n <button\n class=\"mscoa-segment-config__add\"\n mat-stroked-button\n [disabled]=\"disabled()\"\n (click)=\"startAddNew()\">\n <mat-icon>add</mat-icon>\n Add new segment\n </button>\n}\n\n@if (canManageInputs) {\n <!-- Account-level custom inputs (peers of the segments): list + consolidated add/edit panel. -->\n <div class=\"mscoa-segment-config__section\">\n <p class=\"mscoa-segment-config__section-label\">Custom inputs</p>\n <p class=\"mscoa-segment-config__hint\">\n Account-level inputs that sit alongside the segments (e.g. budget value,\n department). Each is a full form input entered per leg; single value\n selection applies one value across debit and credit.\n </p>\n\n @for (input of customInputs(); track input.id) {\n <div class=\"mscoa-segment-config__custom-input-row\">\n <mat-icon class=\"mscoa-segment-config__input-icon\">tune</mat-icon>\n <span class=\"mscoa-segment-config__input-label\">\n {{ input.label || input.formControlName || 'Untitled input' }}\n </span>\n <button\n mat-icon-button\n type=\"button\"\n [disabled]=\"disabled()\"\n matTooltip=\"Edit\"\n aria-label=\"Edit input\"\n (click)=\"startEditCustomInput(input)\">\n <mat-icon>edit</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n [disabled]=\"disabled()\"\n matTooltip=\"Advanced settings (validators, calculations, API)\"\n aria-label=\"Advanced settings\"\n (click)=\"onEditAdvanced(input)\">\n <mat-icon>tune</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n [disabled]=\"disabled()\"\n matTooltip=\"Remove\"\n aria-label=\"Remove input\"\n (click)=\"onDeleteInput(input)\">\n <mat-icon>delete_outline</mat-icon>\n </button>\n </div>\n } @empty {\n <p class=\"mscoa-segment-config__hint mscoa-segment-config__hint--muted\">\n No custom inputs yet.\n </p>\n }\n\n @if (!isCustomInputPanelOpen()) {\n <button\n class=\"mscoa-segment-config__add-input\"\n mat-stroked-button\n type=\"button\"\n [disabled]=\"disabled()\"\n (click)=\"startAddCustomInput()\">\n <mat-icon>add</mat-icon>\n Add custom input\n </button>\n }\n\n @if (isCustomInputPanelOpen()) {\n <mat-card class=\"mscoa-segment-config__panel\" appearance=\"outlined\">\n <mat-card-header>\n <mat-card-subtitle>\n {{ customInputForm.value.id ? 'Update' : 'Add a' }} custom input\n </mat-card-subtitle>\n </mat-card-header>\n\n <mat-card-content>\n <form [formGroup]=\"customInputForm\" (ngSubmit)=\"saveCustomInputPanel()\">\n <div class=\"mscoa-segment-config__group\">\n <mat-form-field subscriptSizing=\"dynamic\" floatLabel=\"always\" appearance=\"outline\">\n <mat-label>Input type</mat-label>\n <mat-select formControlName=\"element\" placeholder=\"Select input type\">\n @for (type of customInputTypes; track type.value) {\n <mat-option [value]=\"type.value\">{{ type.label }}</mat-option>\n }\n </mat-select>\n <mat-hint>Use Advanced settings for validators, calculations and API.</mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"mscoa-segment-config__group\">\n <mat-form-field subscriptSizing=\"dynamic\" floatLabel=\"always\" appearance=\"outline\">\n <mat-label>Label</mat-label>\n <input matInput formControlName=\"label\" placeholder=\"Enter label\" />\n <mat-hint>A descriptive name (e.g. 'Budget value', 'Department').</mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"mscoa-segment-config__group\">\n <div class=\"mscoa-segment-config__toggle\">\n <mat-slide-toggle formControlName=\"singleSelect\">Single value selection</mat-slide-toggle>\n </div>\n <p class=\"mscoa-segment-config__hint\">\n When enabled, one value applies across debit and credit; when disabled, a value is\n entered per leg.\n </p>\n </div>\n\n <div class=\"mscoa-segment-config__group\">\n <div class=\"mscoa-segment-config__toggle\">\n <mat-slide-toggle formControlName=\"readonly\">Read only</mat-slide-toggle>\n </div>\n <p class=\"mscoa-segment-config__hint\">\n Prevents users from changing the value after initial setup.\n </p>\n </div>\n\n <mat-card-actions class=\"mscoa-segment-config__actions\">\n <button mat-button type=\"button\" (click)=\"cancelCustomInput()\">Cancel</button>\n <button mat-flat-button color=\"primary\" type=\"submit\" [disabled]=\"!customInputForm.valid\">\n Save\n </button>\n </mat-card-actions>\n </form>\n </mat-card-content>\n </mat-card>\n }\n </div>\n}\n\n@if (isEditing()) {\n <mat-card class=\"mscoa-segment-config__panel\" appearance=\"outlined\">\n <mat-card-header>\n <mat-card-subtitle>\n {{ isAddingNew() ? 'Add a new' : 'Update' }} segment\n </mat-card-subtitle>\n </mat-card-header>\n\n <mat-card-content>\n <form [formGroup]=\"segmentForm\" (ngSubmit)=\"saveSegment()\">\n <div class=\"mscoa-segment-config__group\">\n <div class=\"mscoa-segment-config__toggle\">\n <mat-slide-toggle\n (change)=\"multiLevelSelectChange($event)\"\n [checked]=\"segmentForm.value.segmentExtension\">\n Enable multi-level segmentation\n </mat-slide-toggle>\n </div>\n <p class=\"mscoa-segment-config__hint\">\n Allows sub-classifications within this segment for more detailed accounting hierarchies.\n </p>\n\n <mat-form-field subscriptSizing=\"dynamic\" floatLabel=\"always\" appearance=\"outline\">\n <mat-label>Segment</mat-label>\n <mat-select\n (selectionChange)=\"selectSegment($event)\"\n formControlName=\"segment\"\n placeholder=\"Select segment\">\n @for (segment of treeSegments(); track segment.id) {\n <mat-option [disabled]=\"alreadyExists(segment)\" [value]=\"segment.segment\">\n {{ segment.label }}\n </mat-option>\n }\n </mat-select>\n <mat-hint>Select an account segment type from your chart of accounts.</mat-hint>\n </mat-form-field>\n </div>\n\n @if (isCashSegmentConfig()) {\n <div class=\"mscoa-segment-config__group\">\n <div class=\"mscoa-segment-config__toggle\">\n <mat-slide-toggle\n (change)=\"setInheritFromAccrual($event)\"\n [checked]=\"segmentForm.value.inheritValueFromAccrual\">\n Inherit from accrual\n </mat-slide-toggle>\n </div>\n <p class=\"mscoa-segment-config__hint\">\n When enabled, changes to the accrual value reflect here automatically.\n </p>\n </div>\n }\n\n <div class=\"mscoa-segment-config__group\">\n <mat-form-field subscriptSizing=\"dynamic\" floatLabel=\"always\" appearance=\"outline\">\n <mat-label>Label</mat-label>\n <input\n matInput\n formControlName=\"label\"\n [readonly]=\"!segmentForm.value.segmentExtension\"\n placeholder=\"Enter label\" />\n <mat-hint>\n A descriptive name for this segment (e.g. 'Department', 'Project', 'Cost Center').\n </mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"mscoa-segment-config__group\">\n <div class=\"mscoa-segment-config__toggle\">\n <mat-slide-toggle\n (change)=\"singleSelectChange($event)\"\n [checked]=\"segmentForm.value.singleSelect\">\n Single value selection\n </mat-slide-toggle>\n </div>\n <p class=\"mscoa-segment-config__hint\">\n When enabled, transactions are assigned to one value within this segment; when disabled,\n they can be split across multiple values.\n </p>\n </div>\n\n @if (segmentForm.value.segment?.toLocaleLowerCase() === 'item') {\n <div class=\"mscoa-segment-config__group\">\n <div class=\"mscoa-segment-config__toggle\">\n <mat-slide-toggle\n (change)=\"setVatSelectionActive($event)\"\n [checked]=\"segmentForm.value.vatSelectonActive\">\n Require VAT account selection\n </mat-slide-toggle>\n </div>\n <p class=\"mscoa-segment-config__hint\">\n When active, users must specify a VAT account for taxable items.\n </p>\n </div>\n }\n\n <div class=\"mscoa-segment-config__group\">\n <div class=\"mscoa-segment-config__toggle\">\n <mat-slide-toggle\n (change)=\"readOnlyChanged($event)\"\n [checked]=\"segmentForm.value.readOnly\">\n Read-only segment\n </mat-slide-toggle>\n </div>\n <p class=\"mscoa-segment-config__hint\">\n Prevents users from modifying segment values after initial setup. Use for regulatory or\n policy-controlled segments.\n </p>\n </div>\n\n <div class=\"mscoa-segment-config__group\">\n <mat-form-field subscriptSizing=\"dynamic\" floatLabel=\"always\" appearance=\"outline\">\n <mat-label>Additional accounts</mat-label>\n <mat-select\n (selectionChange)=\"additionalAccountsChanged($event)\"\n formControlName=\"additionalAccounts\"\n multiple\n placeholder=\"Select counter accounts\">\n @for (ext of extensionAccountsForSegments; track ext) {\n <mat-option [value]=\"ext\">{{ ext }}</mat-option>\n }\n </mat-select>\n <mat-hint>\n Add supporting accounts for this segment (e.g. VAT or tax accounts).\n </mat-hint>\n </mat-form-field>\n </div>\n\n <mat-card-actions class=\"mscoa-segment-config__actions\">\n <button mat-button type=\"button\" (click)=\"cancelEdit()\">Cancel</button>\n <button mat-flat-button color=\"primary\" type=\"submit\" [disabled]=\"!segmentForm.valid\">\n Save\n </button>\n </mat-card-actions>\n </form>\n </mat-card-content>\n </mat-card>\n}\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;gap:1.5rem;color:var(--lib-forms-on-surface)}.mscoa-segment-config__notice{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:var(--lib-forms-radius-md, 10px);background:var(--sem-info-surface);color:var(--lib-forms-on-surface);font-size:.875rem}.mscoa-segment-config__notice--error{background:var(--sem-error-surface)}.mscoa-segment-config__notice-icon{flex:0 0 auto;color:var(--lib-forms-on-surface-variant)}.mscoa-segment-config__notice--error .mscoa-segment-config__notice-icon{color:var(--sem-error)}.mscoa-segment-config__section{display:flex;flex-direction:column;gap:.75rem}.mscoa-segment-config__section-label{margin:0;font-size:.625rem;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--lib-forms-on-surface-variant)}.mscoa-segment-config__chip-content{display:inline-flex;align-items:center;gap:.375rem}.mscoa-segment-config__chip-label{margin-right:.125rem}.mscoa-segment-config__chip-icon{width:1rem;height:1rem;font-size:1rem;line-height:1;color:var(--lib-forms-on-surface-variant)}.mscoa-segment-config__add{width:100%}.mscoa-segment-config__panel{background:var(--lib-forms-surface);border:1px solid color-mix(in srgb,var(--lib-forms-outline) 15%,transparent);border-radius:var(--lib-forms-radius-lg, 12px);box-shadow:var(--lib-forms-shadow-resting);display:block}.mscoa-segment-config__group{display:flex;flex-direction:column;gap:.5rem;margin-bottom:1.5rem}.mscoa-segment-config__group:last-of-type{margin-bottom:0}.mscoa-segment-config__group mat-form-field{width:100%}.mscoa-segment-config__toggle{display:flex;align-items:center;padding:.5rem 0}.mscoa-segment-config__hint{margin:0;font-size:.75rem;line-height:1.4;color:var(--lib-forms-on-surface-variant)}.mscoa-segment-config__actions{display:flex;justify-content:flex-end;gap:.75rem;margin-top:.5rem}.mscoa-segment-config__custom-input-row{display:flex;align-items:center;gap:.5rem;padding:.375rem 0}.mscoa-segment-config__input-icon{flex:0 0 auto;width:1.125rem;height:1.125rem;font-size:1.125rem;line-height:1;color:var(--lib-forms-on-surface-variant)}.mscoa-segment-config__input-label{flex:1 1 auto;min-width:0;font-size:.875rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mscoa-segment-config__hint--muted{font-style:italic}.mscoa-segment-config__add-input{align-self:flex-start;margin-top:.25rem}\n"] }]
|
|
444
|
+
}], ctorParameters: () => [], propDecorators: { errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], dataValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataValue", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], isCashSegmentConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "isCashSegmentConfig", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], showAllSegments: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAllSegments", required: false }] }], getMscoaTree: [{ type: i0.Input, args: [{ isSignal: true, alias: "getMscoaTree", required: false }] }], saveCustomInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "saveCustomInput", required: false }] }], editSegmentInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "editSegmentInput", required: false }] }], deleteSegmentInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "deleteSegmentInput", required: false }] }], valueChanged: [{ type: i0.Output, args: ["valueChanged"] }] } });
|
|
445
|
+
|
|
446
|
+
export { MscoaSegmentConfigComponent };
|
|
447
|
+
//# sourceMappingURL=ngx-t-forms-mscoa-segment-config.component-Bo0aDEMy.mjs.map
|