ngx-t-forms 2.0.31 → 2.0.33
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-mygIYJsN.mjs} +4 -4
- package/fesm2022/ngx-t-forms-auto-complete-input-element.component-mygIYJsN.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-Ce4ipSUc.mjs → ngx-t-forms-basic-input-input-element.component-B4gScnlc.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-Ce4ipSUc.mjs.map → ngx-t-forms-basic-input-input-element.component-B4gScnlc.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-C5TPddVe.mjs → ngx-t-forms-calculated-field-rules.component-I2dW6hGi.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-C5TPddVe.mjs.map → ngx-t-forms-calculated-field-rules.component-I2dW6hGi.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-CICQaqz6.mjs → ngx-t-forms-chip-options-creator-editor.component-84v7QQ3b.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-CICQaqz6.mjs.map → ngx-t-forms-chip-options-creator-editor.component-84v7QQ3b.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CzisLSIP.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-DZLzjFQy.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CzisLSIP.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-DZLzjFQy.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-data-source-picker.component-Dzz_o6fJ.mjs → ngx-t-forms-data-source-picker.component-C6Xwcq3e.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-data-source-picker.component-Dzz_o6fJ.mjs.map → ngx-t-forms-data-source-picker.component-C6Xwcq3e.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-CYUbVyzP.mjs → ngx-t-forms-date-picker-input-element.component-C0uhrM_l.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-CYUbVyzP.mjs.map → ngx-t-forms-date-picker-input-element.component-C0uhrM_l.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-CZU0JScH.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-CZU0JScH.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-BmD7KWAi.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-BmD7KWAi.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-document-picker.component-qObjcqhE.mjs → ngx-t-forms-document-picker.component-CITHgJjy.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-document-picker.component-qObjcqhE.mjs.map → ngx-t-forms-document-picker.component-CITHgJjy.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-editor-input-element.component-BLXlfb6F.mjs → ngx-t-forms-editor-input-element.component-eJ9rpN3t.mjs} +4 -4
- package/fesm2022/ngx-t-forms-editor-input-element.component-eJ9rpN3t.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-editor-js-input.component-BQL0AH7H.mjs → ngx-t-forms-editor-js-input.component-BOUSCTQ_.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-editor-js-input.component-BQL0AH7H.mjs.map → ngx-t-forms-editor-js-input.component-BOUSCTQ_.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-C7mMeEjF.mjs → ngx-t-forms-file-upload-input-element.component-BWIeO1O2.mjs} +21 -4
- package/fesm2022/ngx-t-forms-file-upload-input-element.component-BWIeO1O2.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-form-input-selector.component-C9u8zq9B.mjs → ngx-t-forms-form-input-selector.component-DqRVx8YZ.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-input-selector.component-C9u8zq9B.mjs.map → ngx-t-forms-form-input-selector.component-DqRVx8YZ.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-json-view.component-856Hx1Bg.mjs → ngx-t-forms-form-json-view.component-DSj-8rga.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-json-view.component-856Hx1Bg.mjs.map → ngx-t-forms-form-json-view.component-DSj-8rga.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-Bz3MpgZQ.mjs +389 -0
- package/fesm2022/ngx-t-forms-form-section-stepper.component-Bz3MpgZQ.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-qrhM0jGL.mjs → ngx-t-forms-forms-builder-menu.component-Dz4Vl_ZN.mjs} +5 -5
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-qrhM0jGL.mjs.map → ngx-t-forms-forms-builder-menu.component-Dz4Vl_ZN.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-geo-location.component-Bosp1UzR.mjs → ngx-t-forms-geo-location.component-BwB_Da_k.mjs} +16 -5
- package/fesm2022/ngx-t-forms-geo-location.component-BwB_Da_k.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-C1g7Z0cK.mjs → ngx-t-forms-image-capture-input-element.component-AAMNhV66.mjs} +18 -5
- package/fesm2022/ngx-t-forms-image-capture-input-element.component-AAMNhV66.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-index-CqDck7nn.mjs +2 -0
- package/fesm2022/ngx-t-forms-index-CqDck7nn.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-input-custom.component-BkbHFAyR.mjs → ngx-t-forms-input-custom.component-af_d6VZy.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-input-custom.component-BkbHFAyR.mjs.map → ngx-t-forms-input-custom.component-af_d6VZy.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-input-editor.component-BPUOM9kQ.mjs → ngx-t-forms-input-editor.component-CQtlHivg.mjs} +17 -5
- package/fesm2022/ngx-t-forms-input-editor.component-CQtlHivg.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-B6hJ7Io5.mjs → ngx-t-forms-map-mat-options-keys-0gqubG8m.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-B6hJ7Io5.mjs.map → ngx-t-forms-map-mat-options-keys-0gqubG8m.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-c7uZT1sr.mjs → ngx-t-forms-mat-chip-list-editor.component-ChD7WE5I.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-c7uZT1sr.mjs.map → ngx-t-forms-mat-chip-list-editor.component-ChD7WE5I.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-DrnH8qdG.mjs → ngx-t-forms-missing-form-configs.component-CTaarZIV.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-DrnH8qdG.mjs.map → ngx-t-forms-missing-form-configs.component-CTaarZIV.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-C_abEBQ5.mjs → ngx-t-forms-mscoa-chart-toolbar.component-CY2LAblM.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-C_abEBQ5.mjs.map → ngx-t-forms-mscoa-chart-toolbar.component-CY2LAblM.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-CzmMXKYH.mjs +447 -0
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-CzmMXKYH.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-multiple-input-input-element.component-C7y1OGPx.mjs → ngx-t-forms-multiple-input-input-element.component-BfpeOWJx.mjs} +18 -18
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-BfpeOWJx.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-ngx-t-forms-u_kigDid.mjs → ngx-t-forms-ngx-t-forms-CIX_hqx4.mjs} +1040 -89
- package/fesm2022/ngx-t-forms-ngx-t-forms-CIX_hqx4.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-paginated-selection-table-AQZSMmhr.mjs → ngx-t-forms-paginated-selection-table-aWTsrLmJ.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-paginated-selection-table-AQZSMmhr.mjs.map → ngx-t-forms-paginated-selection-table-aWTsrLmJ.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-DmNSc5aw.mjs → ngx-t-forms-pipeline-generator.component-BbsZu4Ji.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-DmNSc5aw.mjs.map → ngx-t-forms-pipeline-generator.component-BbsZu4Ji.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-record-list-manager.component-CUMMvMch.mjs → ngx-t-forms-record-list-manager.component-BPaAZoCl.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-record-list-manager.component-CUMMvMch.mjs.map → ngx-t-forms-record-list-manager.component-BPaAZoCl.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-required-inputs.component-Ch2yNcIS.mjs → ngx-t-forms-required-inputs.component-Bc22SdBb.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-required-inputs.component-Ch2yNcIS.mjs.map → ngx-t-forms-required-inputs.component-Bc22SdBb.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-D9QIp83c.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-D9QIp83c.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-section-report.component-BxOhR6C0.mjs → ngx-t-forms-section-report.component-7ORNUfFx.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-section-report.component-BxOhR6C0.mjs.map → ngx-t-forms-section-report.component-7ORNUfFx.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-select-input-element.component-DbgZdNoe.mjs → ngx-t-forms-select-input-element.component-DjxK2Otk.mjs} +19 -9
- package/fesm2022/ngx-t-forms-select-input-element.component-DjxK2Otk.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-Dhln81DL.mjs → ngx-t-forms-selection-options-editor.component-CtUL550G.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-Dhln81DL.mjs.map → ngx-t-forms-selection-options-editor.component-CtUL550G.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-CKTTtBRp.mjs} +4 -4
- package/fesm2022/ngx-t-forms-textarea-input-element.component-CKTTtBRp.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-DDErRUJd.mjs → ngx-t-forms-toggle-input-element.component-DjIrmI5x.mjs} +16 -5
- package/fesm2022/ngx-t-forms-toggle-input-element.component-DjIrmI5x.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-validators-config.component-oGjQVGE2.mjs → ngx-t-forms-validators-config.component-qw17DsC-.mjs} +8 -167
- package/fesm2022/ngx-t-forms-validators-config.component-qw17DsC-.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-workflow-adjudication.component-CtU8dECN.mjs → ngx-t-forms-workflow-adjudication.component-B-lohk8w.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-workflow-adjudication.component-CtU8dECN.mjs.map → ngx-t-forms-workflow-adjudication.component-B-lohk8w.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-auto-complete-input-element.component-DCKuXHAW.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-editor-input-element.component-BLXlfb6F.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-file-upload-input-element.component-C7mMeEjF.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-form-section-stepper.component-Bs50-nEB.mjs +0 -319
- package/fesm2022/ngx-t-forms-form-section-stepper.component-Bs50-nEB.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-geo-location.component-Bosp1UzR.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-image-capture-input-element.component-C1g7Z0cK.mjs.map +0 -1
- 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-multiple-input-input-element.component-C7y1OGPx.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-u_kigDid.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-select-input-element.component-DbgZdNoe.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-textarea-input-element.component-BEbXJjFA.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-toggle-input-element.component-DDErRUJd.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-validators-config.component-oGjQVGE2.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-t-forms-image-capture-input-element.component-C1g7Z0cK.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/file-upload-input-element/core/file-uploader/camera-functions.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/image-capture-input-element/core/camera-capture/camera-capture.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/image-capture-input-element/core/camera-capture/camera-capture.component.html","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/image-capture-input-element/image-capture-input-element.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/image-capture-input-element/image-capture-input-element.component.html"],"sourcesContent":["// Image capture\r\n\r\nimport { AbstractControl, ValidationErrors } from \"@angular/forms\";\r\nimport { FileUploadInputValueInterface } from \"ngx-t-forms-types\";\r\n\r\n\r\nexport async function setupDevices(\r\n cameraCallback: (stream: MediaStream) => void\r\n): Promise<MediaStream | string | unknown | undefined> {\r\n // SSR guard (Trap 14): free helper has no DI context. Returning `undefined`\r\n // matches the existing \"no media device\" branch — caller contract preserved.\r\n if (typeof navigator === 'undefined') return undefined;\r\n\r\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\r\n try {\r\n const stream = await navigator.mediaDevices.getUserMedia({\r\n video: true,\r\n });\r\n if (stream) {\r\n cameraCallback(stream);\r\n return stream;\r\n } else {\r\n return 'You have no output video device';\r\n }\r\n } catch (e) {\r\n return e;\r\n }\r\n }\r\n return undefined;\r\n}\r\n\r\n\r\nexport function fileUploaderValidator(control: AbstractControl): ValidationErrors | null {\r\n // Implement your validation logic here\r\n const file: FileUploadInputValueInterface= control.value;\r\n\r\n // Example validation: Check if file is provided\r\n if (!file || !file.base64) {\r\n return { requiredFile: 'You must upload a file.' };\r\n }\r\n\r\n // Add more validation logic as needed\r\n // ...\r\n\r\n return null; // Return null if no validation errors\r\n}","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n PLATFORM_ID,\r\n inject,\r\n input,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { NgControl } from '@angular/forms';\r\nimport { isPlatformBrowser } from '@angular/common';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatToolbarModule } from '@angular/material/toolbar';\r\nimport { MatButtonModule } from '@angular/material/button';\r\n\r\nimport { FileUploadInputValueInterface, IFileUploadInput, ITowerStepColumn } from 'ngx-t-forms-types';\r\n\r\nimport { setupDevices } from '../../../file-upload-input-element/core/file-uploader/camera-functions';\r\nimport { BaseCustomInput, BaseCustomInputConfig } from '../../../../../../services/core/t-input-controller/functions/baseCustomInput';\r\n\r\nconst customInputConfig: BaseCustomInputConfig = {\r\n controlType: 'app-camera-capture',\r\n nextId: 0,\r\n};\r\n\r\n@Component({\r\n selector: 'lib-camera-capture',\r\n templateUrl: './camera-capture.component.html',\r\n styleUrls: ['./camera-capture.component.scss'],\r\n imports: [MatIconModule, MatToolbarModule, MatButtonModule],\r\n providers: [{ provide: MatFormFieldControl, useExisting: CameraCaptureComponent }],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class CameraCaptureComponent extends BaseCustomInput<FileUploadInputValueInterface | object | null> {\r\n readonly inputConfig = input.required<ITowerStepColumn>();\r\n\r\n protected readonly video = viewChild.required<ElementRef<HTMLVideoElement>>('video');\r\n protected readonly canvas = viewChild.required<ElementRef<HTMLCanvasElement>>('canvas');\r\n\r\n protected readonly WIDTH = 640;\r\n protected readonly HEIGHT = 480;\r\n protected captures: string[] = [];\r\n protected isCaptured = false;\r\n protected videoMode = false;\r\n\r\n readonly #platformId = inject(PLATFORM_ID);\r\n\r\n constructor() {\r\n super(\r\n inject(NgControl, { optional: true, self: true }) as NgControl,\r\n inject<ElementRef<HTMLElement>>(ElementRef),\r\n customInputConfig,\r\n );\r\n }\r\n\r\n override get empty(): boolean {\r\n return !this.value;\r\n }\r\n\r\n override get shouldLabelFloat(): boolean {\r\n return this.focused || !this.empty;\r\n }\r\n\r\n protected recapture(): void {\r\n if (!isPlatformBrowser(this.#platformId)) return;\r\n const videoEl = this.video()?.nativeElement;\r\n if (!videoEl) return;\r\n videoEl.srcObject = null;\r\n this.isCaptured = false;\r\n setupDevices(this.setup);\r\n this.value = null;\r\n this.stateChanges.next();\r\n }\r\n\r\n protected readonly setup = (stream: MediaStream): void => {\r\n if (!isPlatformBrowser(this.#platformId)) return;\r\n const videoEl = this.video()?.nativeElement;\r\n if (!videoEl) return;\r\n try {\r\n videoEl.srcObject = stream;\r\n void videoEl.play();\r\n } catch {\r\n // Ignored: play() may reject if the element is detached or autoplay is blocked.\r\n }\r\n };\r\n\r\n protected touch(): void {\r\n this.markAsTouched();\r\n }\r\n\r\n protected capture(): void {\r\n if (!isPlatformBrowser(this.#platformId)) return;\r\n const videoEl = this.video()?.nativeElement;\r\n const canvasEl = this.canvas()?.nativeElement;\r\n if (!videoEl || !canvasEl) return;\r\n\r\n this.touch();\r\n this.drawImageToCanvas(videoEl);\r\n const fileType = (this.inputConfig() as IFileUploadInput | undefined)?.fileType;\r\n this.value = {\r\n fileName: new Date(),\r\n type: fileType,\r\n base64: canvasEl.toDataURL('image/png'),\r\n };\r\n\r\n this.captures.push(canvasEl.toDataURL('image/png'));\r\n this.isCaptured = true;\r\n this.stopVideo();\r\n this.onChange(this.value);\r\n this.stateChanges.next();\r\n }\r\n\r\n protected stopVideo(): void {\r\n if (!isPlatformBrowser(this.#platformId)) return;\r\n const videoEl = this.video()?.nativeElement;\r\n const src = videoEl?.srcObject;\r\n if (src && src instanceof MediaStream) {\r\n src.getTracks().forEach(track => track.stop());\r\n }\r\n }\r\n\r\n private drawImageToCanvas(image: HTMLVideoElement): void {\r\n if (!isPlatformBrowser(this.#platformId)) return;\r\n const canvasEl = this.canvas()?.nativeElement;\r\n const ctx = canvasEl?.getContext('2d');\r\n if (!ctx) return;\r\n ctx.drawImage(image, 0, 0, this.WIDTH, this.HEIGHT);\r\n }\r\n}\r\n","<br>\r\n<div class=\"video-container\">\r\n <video\r\n style=\"margin: auto;\"\r\n [style.display]=\"!isCaptured ? 'block' : 'none'\"\r\n #video\r\n id=\"video\"\r\n [width]=\"WIDTH\"\r\n [height]=\"HEIGHT\"\r\n autoplay\r\n ></video>\r\n <canvas\r\n [style.display]=\"isCaptured ? 'block' : 'none'\"\r\n #canvas\r\n id=\"canvas\"\r\n [width]=\"WIDTH\"\r\n [height]=\"HEIGHT\"\r\n ></canvas>\r\n</div>\r\n<mat-toolbar style=\"background: none;\">\r\n <span class=\"spacer\"></span>\r\n <button (click)=\"isCaptured ? recapture() : capture()\" [color]=\"isCaptured?'primary':'warn'\" mat-icon-button>\r\n <mat-icon>\r\n photo_camera\r\n </mat-icon>\r\n\r\n </button>\r\n @if (!isCaptured) {\r\n <button (click)=\"stopVideo()\" mat-icon-button>\r\n <mat-icon>\r\n stop\r\n </mat-icon>\r\n\r\n </button>\r\n }\r\n <span class=\"spacer\"></span>\r\n</mat-toolbar>\r\n","import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';\r\nimport { FormGroup, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport type { ITowerStepColumn } from 'ngx-t-forms-types';\r\nimport { TFormInputStatusComponent } from '../../../t-form-input-status/t-form-input-status.component';\r\nimport { CameraCaptureComponent } from './core/camera-capture/camera-capture.component';\r\nimport { getInputErrorMessage } from '../../../../services/core/t-input-controller/functions/inputErrorMessage';\r\n\r\n/** Wraps the camera-capture control inside a `mat-form-field`. */\r\n@Component({\r\n selector: 'lib-image-capture-input-element',\r\n templateUrl: './image-capture-input-element.component.html',\r\n styleUrl: './image-capture-input-element.component.css',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [\r\n ReactiveFormsModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatButtonModule,\r\n MatTooltipModule,\r\n TFormInputStatusComponent,\r\n CameraCaptureComponent,\r\n ],\r\n})\r\nexport class ImageCaptureInputElementComponent {\r\n readonly inputConfig = input.required<ITowerStepColumn>();\r\n readonly formGroup = input.required<FormGroup>();\r\n readonly reload = output<void>();\r\n\r\n protected readonly errorMessage = computed(() =>\r\n getInputErrorMessage(this.inputConfig(), this.formGroup()),\r\n );\r\n}\r\n","<ng-container [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field [appearance]=\"inputConfig.appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig.label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n\r\n <lib-camera-capture\r\n [required]=\"inputConfig.required\"\r\n [inputConfig]=\"inputConfig\"\r\n [formControlName]=\"inputConfig.id\"\r\n ></lib-camera-capture>\r\n\r\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\r\n <mat-hint class=\"inputHint\">\r\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\r\n </mat-hint>\r\n }\r\n\r\n @if (!!errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\r\n }\r\n\r\n @if (inputConfig.canReload?.canReload) {\r\n <button\r\n mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig.canReload.emit()\"\r\n matSuffix\r\n >\r\n <mat-icon style=\"color: var(--mat-sys-primary)\">sync</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (inputConfig.prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\r\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.prefixText) {\r\n <span matPrefix style=\"top: 0\">{{ inputConfig.prefixText }}</span>\r\n }\r\n @if (inputConfig.suffixText) {\r\n <span matSuffix style=\"padding-left: 5px\">{{ inputConfig.suffixText }}</span>\r\n }\r\n\r\n @if (inputConfig.maxLength && formGroup()) {\r\n <mat-hint align=\"end\">\r\n {{ (formGroup().controls[inputConfig.id]?.value?.length || 0) + '/' + inputConfig.maxLength }}\r\n </mat-hint>\r\n }\r\n </mat-form-field>\r\n }\r\n</ng-container>\r\n"],"names":["i1","i3","i4","i5"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAMO,eAAe,YAAY,CAChC,cAA6C,EAAA;;;IAI7C,IAAI,OAAO,SAAS,KAAK,WAAW;AAAE,QAAA,OAAO,SAAS;IAEtD,IAAI,SAAS,CAAC,YAAY,IAAI,SAAS,CAAC,YAAY,CAAC,YAAY,EAAE;AACjE,QAAA,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,YAAY,CAAC;AACvD,gBAAA,KAAK,EAAE,IAAI;AACZ,aAAA,CAAC;YACF,IAAI,MAAM,EAAE;gBACV,cAAc,CAAC,MAAM,CAAC;AACtB,gBAAA,OAAO,MAAM;YACf;iBAAO;AACL,gBAAA,OAAO,iCAAiC;YAC1C;QACF;QAAE,OAAO,CAAC,EAAE;AACV,YAAA,OAAO,CAAC;QACV;IACF;AACA,IAAA,OAAO,SAAS;AAClB;AAGM,SAAU,qB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CAAC,MAAM,EAAA,OAAA,EACtC;wBACP,mBAAmB;wBACnB,kBAAkB;wBAClB,aAAa;wBACb,eAAe;wBACf,gBAAgB;wBAChB,yBAAyB;wBACzB,sBAAsB;AACvB,qBAAA,EAAA,QAAA,EAAA,ksEAAA,EAAA,MAAA,EAAA,CAAA,oJAAA,CAAA,EAAA;;;;;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { o as DialogTemplateComponent, p as FormBuilderComponent, q as FormsComponent, M as MscoaFormInputComponent, S as SignatureInputElementComponent, T as TDynamicDataEditComponent, b as TDynamicDataViewComponent, r as TFormInputComponent, U as UserFormStepperComponent, V as ValidationExpressioCreatorComponent, u as getSignatureImage, t as testAgainstItem } from './ngx-t-forms-ngx-t-forms-u_kigDid.mjs';
|
|
2
|
-
//# sourceMappingURL=ngx-t-forms-index-dDSobs6A.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-t-forms-index-dDSobs6A.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-t-forms-input-editor.component-BPUOM9kQ.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/default-element/default-element.component.ts","../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/default-element/default-element.component.html","../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/input-element-editor/input-element-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/input-element-editor/input-element-editor.component.html","../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/input-editor/input-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/input-editor/input-editor.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, DestroyRef, inject } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { MatListModule } from '@angular/material/list';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatDividerModule } from '@angular/material/divider';\r\n\r\nimport { FormsStoreService } from '../../../forms/store/forms-store.service';\r\nimport { DefaultInputConfig, ElementTypes } from 'ngx-t-forms-types';\r\nimport { take } from 'rxjs';\r\nimport { getInputIcon } from '../../../../shared/functions/getInputIcon';\r\n\r\n@Component({\r\n selector: 'lib-default-element',\r\n imports: [MatListModule, MatIconModule, MatDividerModule],\r\n templateUrl: './default-element.component.html',\r\n styleUrl: './default-element.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class DefaultElementComponent {\r\n protected readonly inputs = DefaultInputConfig;\r\n readonly #store = inject(FormsStoreService);\r\n readonly #destroyRef = inject(DestroyRef);\r\n\r\n protected getDefaultInputs(): ElementTypes[] {\r\n const i = JSON.parse(JSON.stringify(DefaultInputConfig)) as Record<string, unknown>;\r\n return Object.keys(i) as ElementTypes[];\r\n }\r\n\r\n protected getInputIcon(element: ElementTypes): string {\r\n return getInputIcon(element);\r\n }\r\n\r\n protected selectInputTemplate(input: ElementTypes): void {\r\n this.#store.selectors.selectInputInEditId$\r\n .pipe(take(1), takeUntilDestroyed(this.#destroyRef))\r\n .subscribe((id) => {\r\n if (!id) return;\r\n this.#store.actionsFormBuilder.selectInputTemplate(id, input);\r\n });\r\n }\r\n}\r\n","<br>\r\n<mat-nav-list style=\"margin: 5px;\">\r\n\r\n\r\n @defer () {\r\n @for (input of getDefaultInputs(); track input) {\r\n @if (inputs[input]?.disabled === false) {\r\n <mat-list-item style=\"background: var(--mdc-elevated-card-container-color, var(--mat-app-surface-container-low));\"\r\n (click)=\"selectInputTemplate(input)\">\r\n <mat-icon matListItemAvatar>{{ getInputIcon(input) }}</mat-icon>\r\n <span matListItemTitle href=\"...\">{{ inputs[input]?.label}}</span>\r\n </mat-list-item>\r\n <mat-divider></mat-divider>\r\n }\r\n }\r\n \r\n }\r\n\r\n\r\n</mat-nav-list>","import { ChangeDetectionStrategy, Component, DOCUMENT, PLATFORM_ID, computed, inject } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { MatToolbarModule } from '@angular/material/toolbar';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { MatExpansionModule } from '@angular/material/expansion';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatListModule } from '@angular/material/list';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCardModule } from '@angular/material/card';\nimport { MatFormFieldModule } from '@angular/material/form-field';\n\nimport { FormsStoreService } from '../../../forms/store/forms-store.service';\n\nimport { TDynamicDataEditComponent, TDynamicDataViewComponent } from '../../..';\n\nimport type { ElementEditorInnerSectionElementInterface, ElementTypes } from 'ngx-t-forms-types';\nimport { getInputIcon } from '../../../../shared/functions/getInputIcon';\n\n@Component({\n selector: 'lib-input-element-editor',\n imports: [\n MatToolbarModule,\n MatDividerModule,\n MatExpansionModule,\n MatIconModule,\n MatListModule,\n MatTooltipModule,\n MatProgressSpinnerModule,\n MatButtonModule,\n MatCardModule,\n MatFormFieldModule,\n TDynamicDataEditComponent,\n TDynamicDataViewComponent,\n ],\n templateUrl: './input-element-editor.component.html',\n styleUrl: './input-element-editor.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class InputElementEditorComponent {\n readonly #store = inject(FormsStoreService);\n readonly #platformId = inject(PLATFORM_ID);\n readonly #document = inject(DOCUMENT);\n\n readonly #signals = this.#store.formBuilderSignalSelectors;\n\n protected readonly vm = computed(() => ({\n defaultInputInEdit: this.#signals.defaultInputInEdit(),\n inputInEdit: this.#signals.inputInEdit(),\n inputElementEditorConfigs: this.#signals.inputElementEditorConfigs(),\n inputInEditValidationErrors: this.#signals.inputInEditValidationErrors(),\n formInputs: this.#signals.getAllFormInputs(),\n }));\n\n protected readonly elementConfigurationChanged = (\n value: unknown,\n ele: ElementEditorInnerSectionElementInterface,\n ): void => {\n const inputVal = this.#signals.inputInEdit();\n if (!inputVal) return;\n this.#store.actionsFormBuilder.elementConfigurationChanged(inputVal.id, value, ele);\n };\n\n protected readonly clearInputInEdit = (): void => {\n const inputVal = this.#signals.inputInEdit();\n if (!inputVal) return;\n this.#store.actionsFormBuilder.clearInputInEdit(inputVal.id);\n };\n\n protected readonly elementBlur = (\n event: unknown,\n element: ElementEditorInnerSectionElementInterface,\n ): void => {\n const inputVal = this.#signals.inputInEdit();\n if (!inputVal) return;\n this.#store.actionsFormBuilder.elementBlur(inputVal.id, event, element);\n };\n\n protected getInputIcon(element: ElementTypes | undefined | null): string {\n return getInputIcon(element);\n }\n\n protected showDebugData(): void {\n if (!isPlatformBrowser(this.#platformId)) return;\n const win = this.#document.defaultView;\n if (!win) return;\n const jsonData = JSON.stringify(this.vm(), null, 2);\n const blob = new Blob([jsonData], { type: 'application/json' });\n const url = win.URL.createObjectURL(blob);\n const link = this.#document.createElement('a');\n link.href = url;\n link.download = 'debug-data.json';\n link.click();\n win.URL.revokeObjectURL(url);\n }\n}\n","<mat-toolbar class=\"section-header\">\r\n <span class=\"header\">Element configuration</span>\r\n <span class=\"spacer\"></span>\r\n</mat-toolbar>\r\n<mat-divider></mat-divider>\r\n@if (vm(); as vm) {\r\n @defer (on viewport) {\r\n\r\n <mat-accordion togglePosition=\"before\">\r\n @for(section of (vm.inputElementEditorConfigs.editorSections||[]); track section.id; let i = $index) {\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n {{section.label}}\r\n <span class=\"spacer\"></span>\r\n @if (section.hasErrors) {\r\n <mat-icon color=\"warn\">error</mat-icon>\r\n }\r\n @if (section.showItemValue && !!(vm.inputInEdit)) {\r\n <span class=\"showItemValue\">\r\n {{ vm.inputInEdit[section.showItemValue]}}\r\n </span>\r\n }\r\n <mat-divider style=\"position: absolute; left:0px; width:100%; bottom:0px;\"></mat-divider>\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n\r\n <div style=\"margin-top: 16px;\"></div>\r\n\r\n <!-- Element type selector (only in first section) -->\r\n @if(i === 0) {\r\n <mat-nav-list>\r\n <mat-list-item [disabled]=\"vm.inputInEdit?.systemDefault\" matTooltip=\"Change input element\"\r\n (click)=\"vm.inputInEdit?.systemDefault? '':clearInputInEdit()\">\r\n <mat-icon matListItemAvatar [attr.aria-label]=\"(vm.defaultInputInEdit)?.label\">\r\n {{ getInputIcon(vm.inputInEdit?.element) }}\r\n </mat-icon>\r\n <span matListItemTitle>{{ (vm.defaultInputInEdit)?.label}}</span>\r\n <span matListItemMeta>\r\n <mat-icon>arrow_forward_ios</mat-icon>\r\n </span>\r\n </mat-list-item>\r\n <mat-divider></mat-divider>\r\n </mat-nav-list>\r\n }\r\n\r\n <!-- Section elements -->\r\n @for(element of section.elements; track element.id) {\r\n <p style=\"margin-bottom: 16px; margin-top: 8px;\">\r\n @defer (on viewport) {\r\n <lib-t-dynamic-data-edit\r\n [editorConfig]=\"element\"\r\n [data]=\"(vm.inputInEdit)\"\r\n [validationErrors]=\"element.computedErrors||[]\"\r\n (valueChange)=\"elementConfigurationChanged($event, element)\" [formInputs]=\"(vm.formInputs)||[]\"\r\n (blur)=\"elementBlur($event, element)\">\r\n </lib-t-dynamic-data-edit>\r\n } @placeholder {\r\n <div style=\"padding: 50px; display:flex; justify-content:center; align-items:center; text-align: center;\">\r\n <mat-spinner diameter=\"18\"></mat-spinner>\r\n </div>\r\n }\r\n </p>\r\n }\r\n </mat-expansion-panel>\r\n }\r\n </mat-accordion>\r\n } @placeholder {\r\n <div style=\"padding: 50px; display:flex; justify-content:center; align-items:center; text-align: center;\">\r\n <mat-spinner diameter=\"50\" />\r\n </div>\r\n } @error {\r\n <div style=\"padding: 16px;\">\r\n <mat-error>\r\n <h3>Error loading element editor</h3>\r\n <p>An error occurred while loading the element editor. Please try again later.</p>\r\n </mat-error>\r\n </div>\r\n\r\n }\r\n\r\n\r\n\r\n\r\n <!-- Diagnostic section -->\r\n <mat-toolbar class=\"section-header\">\r\n <span class=\"header\">Diagnostic data</span>\r\n <span class=\"spacer\"></span>\r\n </mat-toolbar>\r\n <mat-divider></mat-divider>\r\n\r\n <mat-accordion togglePosition=\"before\">\r\n\r\n @if(((vm.inputInEditValidationErrors)||[]).length > 0) {\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n Validation Errors\r\n <span class=\"spacer\"></span>\r\n <mat-error>\r\n {{(vm.inputInEditValidationErrors).length||''}}\r\n </mat-error>\r\n <mat-divider style=\"position: absolute; left:0px; width:100%; bottom:0px;\"></mat-divider>\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div style=\"margin-top: 16px;\"></div>\r\n <mat-error style=\"border: solid 1px; border-radius: 8px; padding: 16px;\">\r\n <h1>All configuration errors:</h1>\r\n <p>\r\n {{(vm.inputInEditValidationErrors).length||''}} errors found. When an error is found, the input will\r\n not\r\n be saved.\r\n </p>\r\n <ul>\r\n @for(error of (vm.inputInEditValidationErrors); track error.key) {\r\n <li>\r\n <strong>{{error.key}}</strong> {{error.message}}\r\n </li>\r\n }\r\n </ul>\r\n </mat-error>\r\n </mat-expansion-panel>\r\n }\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header style=\" padding-right: 0px;\">\r\n <mat-panel-title>\r\n Complete Virtual Model\r\n <span class=\"spacer\"></span>\r\n <button mat-icon-button (click)=\"showDebugData()\">\r\n <mat-icon>\r\n troubleshoot\r\n </mat-icon>\r\n </button>\r\n <mat-divider style=\"position: absolute; left:0px; width:100%; bottom:0px;\"></mat-divider>\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div style=\"margin-top: 16px;\"></div>\r\n <mat-card style=\"padding: 16px;\">\r\n\r\n <lib-t-dynamic-data-view [data]=\"({\r\n 'Default Input Template InEdit': vm.defaultInputInEdit,\r\n 'Input In Edit': vm.inputInEdit,\r\n 'Input Editor Sections': vm.inputElementEditorConfigs?.editorSections,\r\n })\"></lib-t-dynamic-data-view>\r\n\r\n </mat-card>\r\n </mat-expansion-panel>\r\n\r\n </mat-accordion>\r\n}\r\n","import { AsyncPipe } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, inject } from '@angular/core';\r\nimport { MatCardModule } from '@angular/material/card';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatDividerModule } from '@angular/material/divider';\r\nimport { MatToolbarModule } from '@angular/material/toolbar';\r\nimport { DragDropModule } from '@angular/cdk/drag-drop';\r\n\r\nimport { DefaultElementComponent } from '../default-element/default-element.component';\r\nimport { InputElementEditorComponent } from '../input-element-editor/input-element-editor.component';\r\nimport { FormsStoreService } from '../../../forms/store/forms-store.service';\r\n\r\nimport { Observable, take, tap } from 'rxjs';\r\nimport { DefaultInputConfig } from 'ngx-t-forms-types';\r\n\r\n@Component({\r\n selector: 'lib-input-editor',\r\n imports: [\r\n AsyncPipe,\r\n MatCardModule,\r\n MatButtonModule,\r\n MatIconModule,\r\n MatDividerModule,\r\n MatToolbarModule,\r\n DragDropModule,\r\n DefaultElementComponent,\r\n InputElementEditorComponent,\r\n ],\r\n templateUrl: './input-editor.component.html',\r\n styleUrl: './input-editor.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class InputEditorComponent {\r\n readonly #store = inject(FormsStoreService);\r\n\r\n protected readonly defaultInputs = DefaultInputConfig;\r\n protected readonly inputInEdit$ = this.#store.formBuilderSelectors.inputInEdit$;\r\n protected readonly defaultInputInEdit$ = this.#store.formBuilderSelectors.defaultInputInEdit$;\r\n\r\n protected readonly saveInput = (): void => {\r\n this.inputInEdit$\r\n .pipe(\r\n take(1),\r\n tap((inputVal) => {\r\n if (!inputVal) return;\r\n this.#store.actionsFormBuilder.saveInput(inputVal.id);\r\n }),\r\n )\r\n .subscribe();\r\n };\r\n\r\n protected readonly closeEditor = (): void => {\r\n this.#store.actions.setInputInEditId({ inputInEdit: null });\r\n };\r\n\r\n protected get validationErrors$(): Observable<{ key: string; message: string }[] | null> {\r\n return this.#store.formBuilderSelectors.inputInEditValidationErrors$;\r\n }\r\n}\r\n","<mat-card\r\n\r\nstyle=\"\r\n\r\nbackground: var(--mat-sys-surface-container, var(--mat-app-surface));\r\nmargin:0px;\r\nborder:solid 1px var(--mat-divider-color, var(--mat-app-outline))\">\r\n\r\n <mat-card-header >\r\n <mat-card-title>\r\n {{\r\n !!(inputInEdit$|async)?.element\r\n ? \"Edit \" + (inputInEdit$|async)?.label + \" element\"\r\n : \"Setup Form Element\"\r\n }}\r\n </mat-card-title>\r\n <mat-card-subtitle> {{\r\n !!(inputInEdit$|async)?.element? \"Configure the element below\": \"Form element are components making up a form section. Types of form elements are defined by their behaviour and use case, for example a date range picker is well suited to determine duration.\"\r\n }}</mat-card-subtitle>\r\n <button style=\"position: absolute;right:4px\" mat-icon-button cdkDragHandle >\r\n <mat-icon>drag_indicator</mat-icon>\r\n </button>\r\n </mat-card-header>\r\n\r\n\r\n\r\n @if(!!((inputInEdit$|async))?.element){\r\n <lib-input-element-editor\r\n style=\"background: var(--mat-sys-surface-container, var(--mat-app-surface))\">\r\n </lib-input-element-editor>\r\n }@else{\r\n <lib-default-element style=\"background: var(--mat-sys-surface-container, var(--mat-app-surface))\"></lib-default-element>\r\n }\r\n <br>\r\n\r\n <br>\r\n <mat-divider style=\"position: sticky;bottom: 53px;\"></mat-divider>\r\n <mat-toolbar style=\"position: sticky;bottom: 0;\">\r\n <span class=\"spacer\"></span>\r\n <button (click)=\"closeEditor()\" class=\"\" mat-button>close</button>\r\n\r\n @if (!((inputInEdit$|async))?.id) {\r\n <button mat-flat-button\r\n (click)=\"saveInput()\"\r\n [disabled]=\"((validationErrors$|async)||[]).length>0\"\r\n color=\"primary\">save new input</button>\r\n }\r\n </mat-toolbar>\r\n\r\n\r\n</mat-card>\r\n"],"names":["i1","i2","i3","i4","i5","i6","i7","i8","i9"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAkBa,uBAAuB,CAAA;AAPpC,IAAA,WA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,eAAe;wBACf,aAAa;wBACb,gBAAgB;wBAChB,gBAAgB;wBAChB,cAAc;wBACd,uBAAuB;wBACvB,2BAA2B;qBAC5B,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,wjEAAA,EAAA,MAAA,EAAA,CAAA,mIAAA,CAAA,EAAA;;;;;"}
|
|
@@ -1,336 +0,0 @@
|
|
|
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 i1$2 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$3 from '@angular/material/slide-toggle';
|
|
22
|
-
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
23
|
-
import { v4 } from 'uuid';
|
|
24
|
-
import { _ as _isEqual, E as EmptyStateComponent } from './ngx-t-forms-ngx-t-forms-u_kigDid.mjs';
|
|
25
|
-
|
|
26
|
-
let nextUniqueId = 0;
|
|
27
|
-
const IDLE = { mode: 'idle' };
|
|
28
|
-
/**
|
|
29
|
-
* Internal editor element for configuring an MSCOA input's included account
|
|
30
|
-
* segments. Child of `t-dynamic-data-edit`, which supplies the field label,
|
|
31
|
-
* hint, and validation errors - so this component owns only the segment chip
|
|
32
|
-
* row and the add/edit panel.
|
|
33
|
-
*
|
|
34
|
-
* The segment list is seeded from the MSCOA tree (`getMscoaTree`); each segment
|
|
35
|
-
* carries flags such as single-select, read-only, VAT-selection and
|
|
36
|
-
* inherit-from-accrual. In cash-segment mode (`isCashSegmentConfig`) every
|
|
37
|
-
* non-`item` segment defaults to inherit-from-accrual + read-only.
|
|
38
|
-
*/
|
|
39
|
-
class MscoaSegmentConfigComponent {
|
|
40
|
-
#fb;
|
|
41
|
-
#destroyRef;
|
|
42
|
-
/** Tree-derived segment templates (drives the segment `mat-select`). */
|
|
43
|
-
#treeSegments;
|
|
44
|
-
/** Error raised while fetching the tree (`null` until/unless the fetch fails). */
|
|
45
|
-
#fetchError;
|
|
46
|
-
/** Add/edit panel state. */
|
|
47
|
-
#editState;
|
|
48
|
-
/** Guards single-shot tree load (mirrors the original take(1) one-time fetch). */
|
|
49
|
-
#treeRequested;
|
|
50
|
-
constructor() {
|
|
51
|
-
/**
|
|
52
|
-
* Validation errors passed down by the parent editor. Retained on the contract
|
|
53
|
-
* but not rendered here - `t-dynamic-data-edit` owns error display.
|
|
54
|
-
*/
|
|
55
|
-
this.errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
56
|
-
/** The full MSCOA input config; supplies the extension-account options. */
|
|
57
|
-
this.dataValue = input(undefined, ...(ngDevMode ? [{ debugName: "dataValue" }] : /* istanbul ignore next */ []));
|
|
58
|
-
/** Disable user interaction. */
|
|
59
|
-
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
60
|
-
/** Cash-segment mode: non-`item` segments default to inherit + read-only. */
|
|
61
|
-
this.isCashSegmentConfig = input(false, ...(ngDevMode ? [{ debugName: "isCashSegmentConfig" }] : /* istanbul ignore next */ []));
|
|
62
|
-
/** Currently configured segments. */
|
|
63
|
-
this.value = input(undefined, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
64
|
-
/** When true, render every tree segment read-only (no add/remove). */
|
|
65
|
-
this.showAllSegments = input(false, ...(ngDevMode ? [{ debugName: "showAllSegments" }] : /* istanbul ignore next */ []));
|
|
66
|
-
/**
|
|
67
|
-
* Stream that resolves the MSCOA account tree. Heterogeneous wrapper binding -
|
|
68
|
-
* the parent feeds whatever the editor config holds; narrowing here would force
|
|
69
|
-
* wrapper changes.
|
|
70
|
-
*/
|
|
71
|
-
this.getMscoaTree = input(undefined, ...(ngDevMode ? [{ debugName: "getMscoaTree" }] : /* istanbul ignore next */ []));
|
|
72
|
-
/** Emits the mutated segment list whenever the user adds, edits, or removes one. */
|
|
73
|
-
this.valueChanged = output();
|
|
74
|
-
/** Host id attribute - stable, unique per instance. */
|
|
75
|
-
this.hostId = `app-mscoa-segment-config-${nextUniqueId++}`;
|
|
76
|
-
this.#fb = inject(FormBuilder);
|
|
77
|
-
this.#destroyRef = inject(DestroyRef);
|
|
78
|
-
/** Tree-derived segment templates (drives the segment `mat-select`). */
|
|
79
|
-
this.#treeSegments = signal([], ...(ngDevMode ? [{ debugName: "#treeSegments" }] : /* istanbul ignore next */ []));
|
|
80
|
-
/** Error raised while fetching the tree (`null` until/unless the fetch fails). */
|
|
81
|
-
this.#fetchError = signal(null, ...(ngDevMode ? [{ debugName: "#fetchError" }] : /* istanbul ignore next */ []));
|
|
82
|
-
/** True while the tree stream is in flight. */
|
|
83
|
-
this.loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
84
|
-
/** Add/edit panel state. */
|
|
85
|
-
this.#editState = signal(IDLE, ...(ngDevMode ? [{ debugName: "#editState" }] : /* istanbul ignore next */ []));
|
|
86
|
-
/** Reactive form for the segment currently being added/edited. */
|
|
87
|
-
this.segmentForm = this.#createSegmentForm();
|
|
88
|
-
/** Guards single-shot tree load (mirrors the original take(1) one-time fetch). */
|
|
89
|
-
this.#treeRequested = false;
|
|
90
|
-
/** The configured segments, never null. */
|
|
91
|
-
this.resolvedValue = computed(() => this.value() ?? [], ...(ngDevMode ? [{ debugName: "resolvedValue" }] : /* istanbul ignore next */ []));
|
|
92
|
-
/** Tree-derived segment templates for the picker. */
|
|
93
|
-
this.treeSegments = this.#treeSegments.asReadonly();
|
|
94
|
-
/**
|
|
95
|
-
* Loader/tree error message; `null` when none. A fetch error takes priority,
|
|
96
|
-
* otherwise a missing loader surfaces the "No loader provided" notice.
|
|
97
|
-
*/
|
|
98
|
-
this.treeError = computed(() => {
|
|
99
|
-
const fetchError = this.#fetchError();
|
|
100
|
-
if (fetchError) {
|
|
101
|
-
return fetchError;
|
|
102
|
-
}
|
|
103
|
-
return this.getMscoaTree() ? null : 'No loader provided';
|
|
104
|
-
}, ...(ngDevMode ? [{ debugName: "treeError" }] : /* istanbul ignore next */ []));
|
|
105
|
-
/** Whether the add/edit panel is open. */
|
|
106
|
-
this.isEditing = computed(() => this.#editState().mode !== 'idle', ...(ngDevMode ? [{ debugName: "isEditing" }] : /* istanbul ignore next */ []));
|
|
107
|
-
/** Whether the open panel is adding a brand-new segment. */
|
|
108
|
-
this.isAddingNew = computed(() => this.#editState().mode === 'add', ...(ngDevMode ? [{ debugName: "isAddingNew" }] : /* istanbul ignore next */ []));
|
|
109
|
-
/** Whether the "Add new segment" toolbar button should show. */
|
|
110
|
-
this.canAddNew = computed(() => !this.isEditing() && !this.showAllSegments(), ...(ngDevMode ? [{ debugName: "canAddNew" }] : /* istanbul ignore next */ []));
|
|
111
|
-
// One-time tree load. Mirrors the original `take(1)` fetch. The signal
|
|
112
|
-
// writes happen off the reactive tick (microtask) so the effect itself
|
|
113
|
-
// performs no synchronous signal mutation.
|
|
114
|
-
effect(() => {
|
|
115
|
-
const tree$ = this.getMscoaTree();
|
|
116
|
-
if (!tree$ || this.#treeRequested) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
this.#treeRequested = true;
|
|
120
|
-
queueMicrotask(() => this.#loadMscoa(tree$));
|
|
121
|
-
});
|
|
122
|
-
// Reflect the full tree as read-only segments when `showAllSegments` is on.
|
|
123
|
-
effect(() => {
|
|
124
|
-
if (this.showAllSegments()) {
|
|
125
|
-
this.#syncAllSegments();
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
/** Fetch the tree once, build the segment templates, surface any error. */
|
|
130
|
-
#loadMscoa(tree$) {
|
|
131
|
-
this.#fetchError.set(null);
|
|
132
|
-
this.loading.set(true);
|
|
133
|
-
tree$
|
|
134
|
-
.pipe(take(1), tap((response) => {
|
|
135
|
-
this.#treeSegments.set(this.#buildTreeSegments(response));
|
|
136
|
-
this.loading.set(false);
|
|
137
|
-
}), catchError(() => {
|
|
138
|
-
this.#fetchError.set('Failed to fetch mscoa tree');
|
|
139
|
-
this.loading.set(false);
|
|
140
|
-
return of(undefined);
|
|
141
|
-
}), takeUntilDestroyed(this.#destroyRef))
|
|
142
|
-
.subscribe();
|
|
143
|
-
}
|
|
144
|
-
/** Map the tree account keys into seedable segment templates. */
|
|
145
|
-
#buildTreeSegments(response) {
|
|
146
|
-
const isCash = this.isCashSegmentConfig();
|
|
147
|
-
const current = this.resolvedValue();
|
|
148
|
-
return (response?.accountTreeKeys ?? []).map((treeKey) => {
|
|
149
|
-
const isItem = treeKey.toLocaleLowerCase() === 'item';
|
|
150
|
-
return {
|
|
151
|
-
id: v4(),
|
|
152
|
-
segment: treeKey,
|
|
153
|
-
singleSelect: true,
|
|
154
|
-
additionalAccounts: [],
|
|
155
|
-
inheritValueFromAccrual: isCash ? !isItem : undefined,
|
|
156
|
-
vatSelectonActive: isCash ? false : isItem,
|
|
157
|
-
segmentExtension: false,
|
|
158
|
-
label: this.#toTitleCase(treeKey),
|
|
159
|
-
readOnly: current.find((v) => v.segment === treeKey)?.readOnly ||
|
|
160
|
-
(isCash && !isItem) ||
|
|
161
|
-
false,
|
|
162
|
-
};
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
/** Build the per-segment reactive form. */
|
|
166
|
-
#createSegmentForm(segment = {
|
|
167
|
-
segment: '',
|
|
168
|
-
label: '',
|
|
169
|
-
id: v4(),
|
|
170
|
-
singleSelect: true,
|
|
171
|
-
segmentExtension: false,
|
|
172
|
-
additionalAccounts: [],
|
|
173
|
-
readOnly: false,
|
|
174
|
-
}) {
|
|
175
|
-
const isItem = segment.segment?.toLocaleLowerCase() === 'item';
|
|
176
|
-
return this.#fb.group({
|
|
177
|
-
id: [segment.id],
|
|
178
|
-
segment: [segment.segment, Validators.required],
|
|
179
|
-
segmentExtension: [segment.segmentExtension, Validators.required],
|
|
180
|
-
readOnly: [segment.readOnly, Validators.required],
|
|
181
|
-
inheritValueFromAccrual: this.isCashSegmentConfig()
|
|
182
|
-
? [segment.inheritValueFromAccrual, Validators.required]
|
|
183
|
-
: [segment.inheritValueFromAccrual],
|
|
184
|
-
vatSelectonActive: isItem
|
|
185
|
-
? [Boolean(segment.vatSelectonActive), Validators.required]
|
|
186
|
-
: [Boolean(segment.vatSelectonActive)],
|
|
187
|
-
additionalAccounts: [segment.additionalAccounts ?? []],
|
|
188
|
-
label: [segment.label, Validators.required],
|
|
189
|
-
singleSelect: [segment.singleSelect, Validators.required],
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
startAddNew() {
|
|
193
|
-
this.segmentForm = this.#createSegmentForm();
|
|
194
|
-
this.#editState.set({ mode: 'add' });
|
|
195
|
-
}
|
|
196
|
-
startEdit(index) {
|
|
197
|
-
const segment = this.resolvedValue().at(index);
|
|
198
|
-
if (!segment) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
this.segmentForm = this.#createSegmentForm(segment);
|
|
202
|
-
this.#editState.set({ mode: 'edit', index });
|
|
203
|
-
}
|
|
204
|
-
cancelEdit() {
|
|
205
|
-
this.segmentForm.reset();
|
|
206
|
-
this.#editState.set(IDLE);
|
|
207
|
-
}
|
|
208
|
-
saveSegment() {
|
|
209
|
-
if (!this.segmentForm.valid) {
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
const raw = this.segmentForm.getRawValue();
|
|
213
|
-
const label = this.#toTitleCase(String(raw.label ?? ''));
|
|
214
|
-
const newSegment = {
|
|
215
|
-
id: typeof raw.id === 'string' && raw.id ? raw.id : v4(),
|
|
216
|
-
segment: raw.segment,
|
|
217
|
-
// Multi-level segments derive their key from the (upper-cased) label.
|
|
218
|
-
customSegment: raw.segmentExtension ? label.toLocaleUpperCase() : undefined,
|
|
219
|
-
segmentExtension: Boolean(raw.segmentExtension),
|
|
220
|
-
inheritValueFromAccrual: Boolean(raw.inheritValueFromAccrual),
|
|
221
|
-
vatSelectonActive: Boolean(raw.vatSelectonActive),
|
|
222
|
-
additionalAccounts: Array.isArray(raw.additionalAccounts) ? raw.additionalAccounts : [],
|
|
223
|
-
label,
|
|
224
|
-
singleSelect: Boolean(raw.singleSelect),
|
|
225
|
-
readOnly: Boolean(raw.readOnly),
|
|
226
|
-
};
|
|
227
|
-
const state = this.#editState();
|
|
228
|
-
const updated = [...this.resolvedValue()];
|
|
229
|
-
if (state.mode === 'add') {
|
|
230
|
-
updated.push(newSegment);
|
|
231
|
-
}
|
|
232
|
-
else if (state.mode === 'edit') {
|
|
233
|
-
updated[state.index] = newSegment;
|
|
234
|
-
}
|
|
235
|
-
else {
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
this.valueChanged.emit(updated);
|
|
239
|
-
this.cancelEdit();
|
|
240
|
-
}
|
|
241
|
-
readOnlyChanged(event) {
|
|
242
|
-
this.segmentForm.patchValue({ readOnly: event.checked });
|
|
243
|
-
}
|
|
244
|
-
singleSelectChange(event) {
|
|
245
|
-
this.segmentForm.patchValue({ singleSelect: event.checked });
|
|
246
|
-
}
|
|
247
|
-
setVatSelectionActive(event) {
|
|
248
|
-
this.segmentForm.patchValue({ vatSelectonActive: event.checked });
|
|
249
|
-
}
|
|
250
|
-
/** Inherit-from-accrual implies read-only (quirk: toggling on forces read-only). */
|
|
251
|
-
setInheritFromAccrual(event) {
|
|
252
|
-
this.segmentForm.patchValue({ inheritValueFromAccrual: event.checked });
|
|
253
|
-
if (event.checked) {
|
|
254
|
-
this.segmentForm.patchValue({ readOnly: true });
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
multiLevelSelectChange(event) {
|
|
258
|
-
this.segmentForm.patchValue({ segmentExtension: event.checked });
|
|
259
|
-
}
|
|
260
|
-
/** Pick a segment; auto-fill the label from it unless this is a multi-level extension. */
|
|
261
|
-
selectSegment(event) {
|
|
262
|
-
this.segmentForm.patchValue({ segment: event.value });
|
|
263
|
-
if (!this.segmentForm.value.segmentExtension) {
|
|
264
|
-
this.segmentForm.patchValue({ label: this.#toTitleCase(String(event.value ?? '')) });
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
additionalAccountsChanged(event) {
|
|
268
|
-
this.segmentForm.patchValue({ additionalAccounts: [...event.value] }, { emitEvent: true });
|
|
269
|
-
}
|
|
270
|
-
removeSegment(index) {
|
|
271
|
-
const updated = this.resolvedValue().filter((_, i) => i !== index);
|
|
272
|
-
this.valueChanged.emit(updated);
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* A tree template is "already used" (and so disabled in the picker) when a
|
|
276
|
-
* segment with the same key is already configured - except for multi-level
|
|
277
|
-
* extensions, which may reuse a key.
|
|
278
|
-
*/
|
|
279
|
-
alreadyExists(segment) {
|
|
280
|
-
if (this.segmentForm.value.segmentExtension) {
|
|
281
|
-
return false;
|
|
282
|
-
}
|
|
283
|
-
return this.resolvedValue().some((v) => v.segment === segment.segment);
|
|
284
|
-
}
|
|
285
|
-
/** Extension-account options drawn from the MSCOA config. */
|
|
286
|
-
get extensionAccountsForSegments() {
|
|
287
|
-
return this.dataValue()?.mscoaConfig?.extensionAccountsForSegments ?? [];
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* When `showAllSegments` is on, reconcile the configured value against the full
|
|
291
|
-
* tree. Preserves the deliberate double-emit sync: emit a reset sentinel first,
|
|
292
|
-
* then the merged list on the next microtask so the parent re-renders cleanly.
|
|
293
|
-
*/
|
|
294
|
-
#syncAllSegments() {
|
|
295
|
-
const templates = this.#treeSegments();
|
|
296
|
-
if (!this.#treeRequested || templates.length === 0) {
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
const current = this.resolvedValue();
|
|
300
|
-
const merged = templates.map((segment) => ({
|
|
301
|
-
...segment,
|
|
302
|
-
...(current.find((v) => v.segment === segment.segment) ?? {}),
|
|
303
|
-
}));
|
|
304
|
-
if (!_isEqual(merged, current)) {
|
|
305
|
-
// Reset sentinel, then the real value, to force downstream re-binding.
|
|
306
|
-
this.valueChanged.emit([{}]);
|
|
307
|
-
queueMicrotask(() => this.valueChanged.emit(merged));
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
#toTitleCase(str) {
|
|
311
|
-
return str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.slice(1).toLowerCase());
|
|
312
|
-
}
|
|
313
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MscoaSegmentConfigComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
314
|
-
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 } }, 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 (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}\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: "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: i1$2.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i1$2.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "directive", type: i1$2.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$3.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: "component", type: EmptyStateComponent, selector: "lib-empty-state", inputs: ["icon", "message"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
315
|
-
}
|
|
316
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MscoaSegmentConfigComponent, decorators: [{
|
|
317
|
-
type: Component,
|
|
318
|
-
args: [{ selector: 'lib-mscoa-segment-config', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: {
|
|
319
|
-
'class': 'lib-mscoa-segment-config',
|
|
320
|
-
'[attr.id]': 'hostId',
|
|
321
|
-
}, imports: [
|
|
322
|
-
ReactiveFormsModule,
|
|
323
|
-
MatButtonModule,
|
|
324
|
-
MatCardModule,
|
|
325
|
-
MatChipsModule,
|
|
326
|
-
MatFormFieldModule,
|
|
327
|
-
MatIconModule,
|
|
328
|
-
MatInputModule,
|
|
329
|
-
MatSelectModule,
|
|
330
|
-
MatSlideToggleModule,
|
|
331
|
-
EmptyStateComponent,
|
|
332
|
-
], 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 (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}\n"] }]
|
|
333
|
-
}], 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 }] }], valueChanged: [{ type: i0.Output, args: ["valueChanged"] }] } });
|
|
334
|
-
|
|
335
|
-
export { MscoaSegmentConfigComponent };
|
|
336
|
-
//# sourceMappingURL=ngx-t-forms-mscoa-segment-config.component-C0qsMfsq.mjs.map
|