ngx-t-forms 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ngx-t-forms-api-endpoint-config.component-B9tCHtwV.mjs +411 -0
- package/fesm2022/ngx-t-forms-api-endpoint-config.component-B9tCHtwV.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-FhUHTsUF.mjs → ngx-t-forms-auto-complete-input-element.component-D2Vty1Aj.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-FhUHTsUF.mjs.map → ngx-t-forms-auto-complete-input-element.component-D2Vty1Aj.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-BJKe9wIA.mjs → ngx-t-forms-basic-input-input-element.component-Dr2bhCnH.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-BJKe9wIA.mjs.map → ngx-t-forms-basic-input-input-element.component-Dr2bhCnH.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-FQLTI7CX.mjs → ngx-t-forms-calculated-field-rules.component-DLBTjfMj.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-FQLTI7CX.mjs.map → ngx-t-forms-calculated-field-rules.component-DLBTjfMj.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-CJtbprXS.mjs → ngx-t-forms-chip-options-creator-editor.component-Bh6jMmtu.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-CJtbprXS.mjs.map → ngx-t-forms-chip-options-creator-editor.component-Bh6jMmtu.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-conditional-display-config.component-ayrWl-c2.mjs +513 -0
- package/fesm2022/ngx-t-forms-conditional-display-config.component-ayrWl-c2.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CU6R5h-x.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-nOnJfMTo.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CU6R5h-x.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-nOnJfMTo.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-data-source-picker.component-C8MBbnfz.mjs → ngx-t-forms-data-source-picker.component-mmyhOBvA.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-data-source-picker.component-C8MBbnfz.mjs.map → ngx-t-forms-data-source-picker.component-mmyhOBvA.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-Dux6uy66.mjs → ngx-t-forms-date-picker-input-element.component-DmiBra1D.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-Dux6uy66.mjs.map → ngx-t-forms-date-picker-input-element.component-DmiBra1D.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-date-range-picker-input-element.component-SMWrTm5X.mjs → ngx-t-forms-date-range-picker-input-element.component-Cke5qSzR.mjs} +11 -2
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-Cke5qSzR.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-uGM93dvc.mjs → ngx-t-forms-document-list-label-config-editor.component-C0xx4jrN.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-uGM93dvc.mjs.map → ngx-t-forms-document-list-label-config-editor.component-C0xx4jrN.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-document-picker.component-DIqaaBSl.mjs → ngx-t-forms-document-picker.component-DI7wtEv6.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-document-picker.component-DIqaaBSl.mjs.map → ngx-t-forms-document-picker.component-DI7wtEv6.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-editor-js-input.component-C1dI_7rU.mjs → ngx-t-forms-editor-input-element.component-DbogKrdk.mjs} +46 -191
- package/fesm2022/ngx-t-forms-editor-input-element.component-DbogKrdk.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-CQsKz87N.mjs → ngx-t-forms-file-upload-input-element.component-DbwvZghJ.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-CQsKz87N.mjs.map → ngx-t-forms-file-upload-input-element.component-DbwvZghJ.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-input-selector.component-Dj0jvBdm.mjs → ngx-t-forms-form-input-selector.component-CkuzNdjx.mjs} +2 -3
- package/fesm2022/{ngx-t-forms-form-input-selector.component-Dj0jvBdm.mjs.map → ngx-t-forms-form-input-selector.component-CkuzNdjx.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-json-view.component-DzJKFl4c.mjs → ngx-t-forms-form-json-view.component-DBCpa_rZ.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-json-view.component-DzJKFl4c.mjs.map → ngx-t-forms-form-json-view.component-DBCpa_rZ.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-DOvVtJGB.mjs → ngx-t-forms-form-section-stepper.component-jLj6vePZ.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-DOvVtJGB.mjs.map → ngx-t-forms-form-section-stepper.component-jLj6vePZ.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-CcqyQLf5.mjs → ngx-t-forms-forms-builder-menu.component-Iyd0grju.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-CcqyQLf5.mjs.map → ngx-t-forms-forms-builder-menu.component-Iyd0grju.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-geo-location.component-Bj_qIEqi.mjs → ngx-t-forms-geo-location.component-BUXRaPy0.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-geo-location.component-Bj_qIEqi.mjs.map → ngx-t-forms-geo-location.component-BUXRaPy0.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-header-template-editor.component-BLmAqiQA.mjs +158 -0
- package/fesm2022/ngx-t-forms-header-template-editor.component-BLmAqiQA.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-lwp3IcDt.mjs → ngx-t-forms-image-capture-input-element.component-D6Ffuhbv.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-lwp3IcDt.mjs.map → ngx-t-forms-image-capture-input-element.component-D6Ffuhbv.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-index-CKj1Oacc.mjs +2 -0
- package/fesm2022/ngx-t-forms-index-CKj1Oacc.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-input-custom.component-DiciFhSS.mjs → ngx-t-forms-input-custom.component-BMui37o-.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-input-custom.component-DiciFhSS.mjs.map → ngx-t-forms-input-custom.component-BMui37o-.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-input-editor.component-D12hrHOc.mjs → ngx-t-forms-input-editor.component-D60TpWzO.mjs} +3 -4
- package/fesm2022/{ngx-t-forms-input-editor.component-D12hrHOc.mjs.map → ngx-t-forms-input-editor.component-D60TpWzO.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-C2JpMTEc.mjs → ngx-t-forms-map-mat-options-keys-yfxnNDPs.mjs} +2 -3
- package/fesm2022/ngx-t-forms-map-mat-options-keys-yfxnNDPs.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-C1Qrze7K.mjs → ngx-t-forms-mat-chip-list-editor.component-cfBBan80.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-C1Qrze7K.mjs.map → ngx-t-forms-mat-chip-list-editor.component-cfBBan80.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-BaTR_jzc.mjs → ngx-t-forms-missing-form-configs.component-BcYuduah.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-BaTR_jzc.mjs.map → ngx-t-forms-missing-form-configs.component-BcYuduah.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-Dni_bv_G.mjs → ngx-t-forms-mscoa-chart-toolbar.component-nLawxM9j.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-Dni_bv_G.mjs.map → ngx-t-forms-mscoa-chart-toolbar.component-nLawxM9j.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-mscoa-config.component-B9G_WlEc.mjs +594 -0
- package/fesm2022/ngx-t-forms-mscoa-config.component-B9G_WlEc.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-BPQuzR5k.mjs → ngx-t-forms-mscoa-segment-config.component-DKEEZ8MD.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-BPQuzR5k.mjs.map → ngx-t-forms-mscoa-segment-config.component-DKEEZ8MD.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-multiple-input-input-element.component-hXWMRFjl.mjs → ngx-t-forms-multiple-input-input-element.component-B99ANTUL.mjs} +34 -30
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-B99ANTUL.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-ngx-t-forms-tQEbZK_e.mjs → ngx-t-forms-ngx-t-forms-9BfJdjl4.mjs} +2281 -759
- package/fesm2022/ngx-t-forms-ngx-t-forms-9BfJdjl4.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-paginated-selection-table-pYY2sWAb.mjs → ngx-t-forms-paginated-selection-table-Bm5-5VWe.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-paginated-selection-table-pYY2sWAb.mjs.map → ngx-t-forms-paginated-selection-table-Bm5-5VWe.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-payload-template-editor.component-DGCUsTYx.mjs → ngx-t-forms-payload-template-editor.component-2hwGuKAB.mjs} +11 -6
- package/fesm2022/ngx-t-forms-payload-template-editor.component-2hwGuKAB.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-D2stBXXC.mjs → ngx-t-forms-pipeline-generator.component-BvjT2zfL.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-D2stBXXC.mjs.map → ngx-t-forms-pipeline-generator.component-BvjT2zfL.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-quill-input.component-BsuOKfZT.mjs +731 -0
- package/fesm2022/ngx-t-forms-quill-input.component-BsuOKfZT.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-record-list-manager.component-CtCOIpai.mjs → ngx-t-forms-record-list-manager.component-BK5nwwDp.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-record-list-manager.component-CtCOIpai.mjs.map → ngx-t-forms-record-list-manager.component-BK5nwwDp.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-required-inputs.component-D9wIdOhg.mjs → ngx-t-forms-required-inputs.component-DiwMttVf.mjs} +2 -3
- package/fesm2022/{ngx-t-forms-required-inputs.component-D9wIdOhg.mjs.map → ngx-t-forms-required-inputs.component-DiwMttVf.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-Gy7Rtmue.mjs → ngx-t-forms-rest-api-call-setup.component-CBgG_f06.mjs} +249 -25
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-CBgG_f06.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-section-report.component-U9uQ_Ow9.mjs → ngx-t-forms-section-report.component-CyPpFiWS.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-section-report.component-U9uQ_Ow9.mjs.map → ngx-t-forms-section-report.component-CyPpFiWS.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-select-input-element.component-CxYTmuvV.mjs → ngx-t-forms-select-input-element.component-B2wr5_88.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-select-input-element.component-CxYTmuvV.mjs.map → ngx-t-forms-select-input-element.component-B2wr5_88.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-BLLejOLG.mjs → ngx-t-forms-selection-options-editor.component-BEZLG1Z8.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-BLLejOLG.mjs.map → ngx-t-forms-selection-options-editor.component-BEZLG1Z8.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-75VdPc6z.mjs → ngx-t-forms-textarea-input-element.component-Cmbd0krg.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-75VdPc6z.mjs.map → ngx-t-forms-textarea-input-element.component-Cmbd0krg.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-DQGvEJN-.mjs → ngx-t-forms-toggle-input-element.component-Dd_FcAoD.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-DQGvEJN-.mjs.map → ngx-t-forms-toggle-input-element.component-Dd_FcAoD.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-token-binding-menu.component-CLpjkUnf.mjs +109 -0
- package/fesm2022/ngx-t-forms-token-binding-menu.component-CLpjkUnf.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-token-text-input.component-DY04Z0fn.mjs +296 -0
- package/fesm2022/ngx-t-forms-token-text-input.component-DY04Z0fn.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-validators-config.component-EM7RSWIz.mjs → ngx-t-forms-validators-config.component-Btmz2cKH.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-validators-config.component-EM7RSWIz.mjs.map → ngx-t-forms-validators-config.component-Btmz2cKH.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-CT6sN9E4.mjs +2096 -0
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-CT6sN9E4.mjs.map +1 -0
- package/fesm2022/ngx-t-forms.mjs +1 -1
- package/package.json +2 -2
- package/styles/_tokens.scss +6 -0
- package/types/ngx-t-forms.d.ts +155 -4
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-SMWrTm5X.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-editor-input-element.component-CIELjDty.mjs +0 -417
- package/fesm2022/ngx-t-forms-editor-input-element.component-CIELjDty.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-editor-js-input.component-C1dI_7rU.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-getInputIcon-B4ADgevZ.mjs +0 -31
- package/fesm2022/ngx-t-forms-getInputIcon-B4ADgevZ.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-header-template-editor.component-DLldVmcN.mjs +0 -129
- package/fesm2022/ngx-t-forms-header-template-editor.component-DLldVmcN.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-index-C8NtLE16.mjs +0 -2
- package/fesm2022/ngx-t-forms-index-C8NtLE16.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-map-mat-options-keys-C2JpMTEc.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-hXWMRFjl.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-tQEbZK_e.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-payload-template-editor.component-DGCUsTYx.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-rest-api-call-setup.component-Gy7Rtmue.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-token-transform-D_wsFbNc.mjs +0 -173
- package/fesm2022/ngx-t-forms-token-transform-D_wsFbNc.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-C1Em-g9e.mjs +0 -1303
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-C1Em-g9e.mjs.map +0 -1
|
@@ -0,0 +1,594 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, computed, linkedSignal, ViewEncapsulation, ChangeDetectionStrategy, Component, DestroyRef, Injector, input, output } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
+
import * as i2 from '@angular/material/button';
|
|
5
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
6
|
+
import * as i1 from '@angular/material/dialog';
|
|
7
|
+
import { MAT_DIALOG_DATA, MatDialogModule, MatDialog } from '@angular/material/dialog';
|
|
8
|
+
import * as i3 from '@angular/material/icon';
|
|
9
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
10
|
+
import * as i5$1 from '@angular/material/tooltip';
|
|
11
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
12
|
+
import { E as EmptyStateComponent, k as ErrorListComponent } from './ngx-t-forms-ngx-t-forms-9BfJdjl4.mjs';
|
|
13
|
+
import * as i1$1 from '@angular/material/slide-toggle';
|
|
14
|
+
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
15
|
+
import * as i5 from '@angular/material/tabs';
|
|
16
|
+
import { MatTabsModule } from '@angular/material/tabs';
|
|
17
|
+
import { MSCOA_ACCOUNT_VALUE_LABEL_OPTIONS, MSCOA_DUAL_CASH_EXCLUSION_RULE_EDITOR, ElementEditorTypes, SpecialElementKeys } from 'ngx-t-forms-types';
|
|
18
|
+
import { ChipOptionsCreatorEditorComponent } from './ngx-t-forms-chip-options-creator-editor.component-Bh6jMmtu.mjs';
|
|
19
|
+
import { MatChipListEditorComponent } from './ngx-t-forms-mat-chip-list-editor.component-cfBBan80.mjs';
|
|
20
|
+
import { MscoaSegmentConfigComponent } from './ngx-t-forms-mscoa-segment-config.component-DKEEZ8MD.mjs';
|
|
21
|
+
import { RecordListManagerComponent } from './ngx-t-forms-record-list-manager.component-BK5nwwDp.mjs';
|
|
22
|
+
|
|
23
|
+
/** Human copy for each basis, and what it means for the person filling the form. */
|
|
24
|
+
const BASIS_OPTIONS = [
|
|
25
|
+
{
|
|
26
|
+
value: 'accrual',
|
|
27
|
+
label: 'Performance (Accrual)',
|
|
28
|
+
detail: 'Budget moves on commitments and invoices. One set of accounts.',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: 'cash',
|
|
32
|
+
label: 'Liquidity (Cash)',
|
|
33
|
+
detail: 'Budget moves only on actual bank movements. One set of accounts.',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
value: 'dual',
|
|
37
|
+
label: 'Dual (Both)',
|
|
38
|
+
detail: 'Captures both bases for full reporting. Two sets of accounts.',
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
/** Token colour per basis (dark-mode safe; never a hex literal). */
|
|
42
|
+
const BASIS_COLOR = {
|
|
43
|
+
accrual: 'var(--sem-blue)',
|
|
44
|
+
cash: 'var(--sem-emerald)',
|
|
45
|
+
dual: 'var(--sem-premium)',
|
|
46
|
+
};
|
|
47
|
+
/** Short badge copy per basis. */
|
|
48
|
+
const BASIS_BADGE = {
|
|
49
|
+
accrual: 'ACCRUAL',
|
|
50
|
+
cash: 'CASH',
|
|
51
|
+
dual: 'DUAL',
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* The configured basis, normalised. `undefined` when nothing has been chosen —
|
|
55
|
+
* the state the setup dialog treats as "not started".
|
|
56
|
+
*/
|
|
57
|
+
function basisOf(config) {
|
|
58
|
+
const raw = (config?.accountingBasis ?? '').toString().toLowerCase();
|
|
59
|
+
return raw === 'dual' || raw === 'cash' || raw === 'accrual' ? raw : undefined;
|
|
60
|
+
}
|
|
61
|
+
/** Token colour for a config's basis badge; `currentColor` when unset. */
|
|
62
|
+
function basisColorOf(config) {
|
|
63
|
+
const basis = basisOf(config);
|
|
64
|
+
return basis ? BASIS_COLOR[basis] : 'currentColor';
|
|
65
|
+
}
|
|
66
|
+
/** Whether this basis captures cash accounts. */
|
|
67
|
+
function usesCash(basis) {
|
|
68
|
+
return basis === 'cash' || basis === 'dual';
|
|
69
|
+
}
|
|
70
|
+
/** Configured accrual segments, empty when none. */
|
|
71
|
+
function segmentsOf(config) {
|
|
72
|
+
return config?.segments ?? [];
|
|
73
|
+
}
|
|
74
|
+
/** Configured cash segments, empty when none. */
|
|
75
|
+
function cashSegmentsOf(config) {
|
|
76
|
+
return config?.cashSegments ?? [];
|
|
77
|
+
}
|
|
78
|
+
/** Cash-exclusion rules that carry a usable pattern (blank ones never evaluate). */
|
|
79
|
+
function usableRulesOf(config) {
|
|
80
|
+
return (config?.dualCashExclusion?.rules ?? []).filter((rule) => !!rule && typeof rule.pattern === 'string' && rule.pattern.trim().length > 0);
|
|
81
|
+
}
|
|
82
|
+
/** How the cash-exclusion rules combine; "any" unless explicitly set to "all". */
|
|
83
|
+
function matchModeOf(config) {
|
|
84
|
+
return config?.dualCashExclusion?.matchMode === 'all' ? 'all' : 'any';
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The scope key a segment's selected accounts are stored under. Mirrors
|
|
88
|
+
* `setSegmentAccount` and `isDualCashExcluded`, both of which upper-case
|
|
89
|
+
* `customSegment || segment`.
|
|
90
|
+
*/
|
|
91
|
+
function segmentKeyOf(segment) {
|
|
92
|
+
return (segment.customSegment || segment.segment || '').trim().toUpperCase();
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Options for a cash-exclusion rule's "Limit to segment" picker: the no-scope
|
|
96
|
+
* default, then every configured accrual segment, then any scope a saved rule
|
|
97
|
+
* still references that the input no longer declares.
|
|
98
|
+
*
|
|
99
|
+
* The option VALUE is the scope key the runtime evaluator compares against, so
|
|
100
|
+
* a scope that can never match is not selectable in the first place.
|
|
101
|
+
*
|
|
102
|
+
* Stale scopes stay listed on purpose. A chip whose value is absent from the
|
|
103
|
+
* option list renders as nothing selected, so dropping them would hide a saved
|
|
104
|
+
* (and now permanently non-matching) scope behind an apparently empty field.
|
|
105
|
+
*
|
|
106
|
+
* A scope saved in a different case than the configured key does not render as
|
|
107
|
+
* selected; picking the segment again re-stores it in canonical case. The
|
|
108
|
+
* evaluator matches case-insensitively either way, so behaviour is unchanged.
|
|
109
|
+
*
|
|
110
|
+
* @param config - The MSCOA configuration being edited.
|
|
111
|
+
* @returns The option list, always led by the no-scope default.
|
|
112
|
+
*/
|
|
113
|
+
function segmentScopeOptions(config) {
|
|
114
|
+
const configured = new Map();
|
|
115
|
+
for (const segment of config?.segments ?? []) {
|
|
116
|
+
const key = segmentKeyOf(segment ?? {});
|
|
117
|
+
if (!key || configured.has(key))
|
|
118
|
+
continue;
|
|
119
|
+
// Show the administrator's own label. The scope key is appended only when
|
|
120
|
+
// the label does not already read as that key, because the evaluator
|
|
121
|
+
// matches on the key and a label like "Line item" would otherwise give no
|
|
122
|
+
// clue which segment ("ITEM") the rule will actually be tested against.
|
|
123
|
+
const label = (segment?.label ?? '').trim();
|
|
124
|
+
if (!label)
|
|
125
|
+
configured.set(key, key);
|
|
126
|
+
else
|
|
127
|
+
configured.set(key, label.toUpperCase() === key ? label : `${label} (${key})`);
|
|
128
|
+
}
|
|
129
|
+
const options = [
|
|
130
|
+
{ label: 'Every accrual segment', value: '' },
|
|
131
|
+
...[...configured].map(([value, label]) => ({ label, value })),
|
|
132
|
+
];
|
|
133
|
+
for (const rule of config?.dualCashExclusion?.rules ?? []) {
|
|
134
|
+
const key = (rule?.segment ?? '').trim().toUpperCase();
|
|
135
|
+
if (!key || options.some((option) => option.value === key))
|
|
136
|
+
continue;
|
|
137
|
+
options.push({ label: `${key} — no longer configured`, value: key });
|
|
138
|
+
}
|
|
139
|
+
return options;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* The setup checklist: what is configured, what still needs the administrator,
|
|
143
|
+
* and what does not apply to the chosen basis at all.
|
|
144
|
+
*
|
|
145
|
+
* `skip` is deliberately distinct from `pending` — a cash segment set is not
|
|
146
|
+
* "missing" on an accrual-only input, it is irrelevant, and an editor that
|
|
147
|
+
* cannot say the difference nags about work that must never be done.
|
|
148
|
+
*
|
|
149
|
+
* @param config - The MSCOA configuration being edited.
|
|
150
|
+
* @returns One entry per setup area, in setup order.
|
|
151
|
+
*/
|
|
152
|
+
function readinessOf(config) {
|
|
153
|
+
const basis = basisOf(config);
|
|
154
|
+
const accrual = segmentsOf(config).length;
|
|
155
|
+
const cash = cashSegmentsOf(config).length;
|
|
156
|
+
const rules = usableRulesOf(config).length;
|
|
157
|
+
const extensions = config?.extensionAccountsForSegments?.length ?? 0;
|
|
158
|
+
return [
|
|
159
|
+
{ label: basis ? `Basis · ${BASIS_BADGE[basis]}` : 'Basis', state: basis ? 'done' : 'pending' },
|
|
160
|
+
{
|
|
161
|
+
// Required by every basis: the cash side of a dual input is authored
|
|
162
|
+
// against the accrual set, and `MscoaInputConfigSchema` demands at least
|
|
163
|
+
// one segment whatever the basis.
|
|
164
|
+
label: accrual > 0 ? `Accrual segments · ${accrual}` : 'Accrual segments',
|
|
165
|
+
state: accrual > 0 ? 'done' : 'pending',
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
label: cash > 0 ? `Cash segments · ${cash}` : 'Cash segments',
|
|
169
|
+
state: !usesCash(basis) ? 'skip' : cash > 0 ? 'done' : 'pending',
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
// Optional even on a dual basis — none means "always require cash", which
|
|
173
|
+
// is a complete configuration, not an unfinished one.
|
|
174
|
+
label: rules > 0 ? `Cash rules · ${rules}` : 'Cash rules',
|
|
175
|
+
state: basis === 'dual' ? (rules > 0 ? 'done' : 'skip') : 'skip',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
label: extensions > 0 ? `Extensions · ${extensions}` : 'Extensions',
|
|
179
|
+
state: extensions > 0 ? 'done' : 'skip',
|
|
180
|
+
},
|
|
181
|
+
];
|
|
182
|
+
}
|
|
183
|
+
/** True once nothing in the checklist is still waiting on the administrator. */
|
|
184
|
+
function isConfigured(config) {
|
|
185
|
+
return readinessOf(config).every((item) => item.state !== 'pending');
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* One sentence describing what this configuration will ask the person filling
|
|
189
|
+
* the form for — the MSCOA counterpart of the API card's "waits for" line, and
|
|
190
|
+
* the fastest way for an administrator to catch a basis they did not intend.
|
|
191
|
+
*
|
|
192
|
+
* @param config - The MSCOA configuration being edited.
|
|
193
|
+
* @returns Plain-language copy, never empty.
|
|
194
|
+
*/
|
|
195
|
+
function requirementSentence(config) {
|
|
196
|
+
const basis = basisOf(config);
|
|
197
|
+
if (!basis)
|
|
198
|
+
return 'No accounting basis chosen yet — the picker has nothing to ask for.';
|
|
199
|
+
if (basis === 'accrual')
|
|
200
|
+
return 'Asks for accrual accounts only.';
|
|
201
|
+
if (basis === 'cash')
|
|
202
|
+
return 'Asks for cash accounts only.';
|
|
203
|
+
const rules = usableRulesOf(config).length;
|
|
204
|
+
if (rules === 0)
|
|
205
|
+
return 'Asks for both accrual and cash accounts, every time.';
|
|
206
|
+
const every = matchModeOf(config) === 'all' ? 'all' : 'any';
|
|
207
|
+
const plural = rules === 1 ? '' : 's';
|
|
208
|
+
return `Asks for accrual accounts always, and for cash accounts unless ${every} of the ${rules} condition${plural} match the accrual selection.`;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* The configuration that must follow a basis change.
|
|
212
|
+
*
|
|
213
|
+
* The eight rows this editor replaced relied on `clearOnChange` to drop work
|
|
214
|
+
* authored against the previous basis. One row bound to the whole object has no
|
|
215
|
+
* per-key path to clear, so that guarantee lives here instead.
|
|
216
|
+
*
|
|
217
|
+
* Guarded the same way `clearOnChange` was: a FIRST choice clears nothing (there
|
|
218
|
+
* is no earlier work to discard) and re-picking the current basis is a no-op.
|
|
219
|
+
* Accrual segments always survive — every basis is authored against them, and a
|
|
220
|
+
* basis switch must not cost the administrator the whole segment set.
|
|
221
|
+
*
|
|
222
|
+
* @param config - The configuration before the change.
|
|
223
|
+
* @param next - The newly chosen basis.
|
|
224
|
+
* @returns The configuration to emit.
|
|
225
|
+
*/
|
|
226
|
+
function configForBasis(config, next) {
|
|
227
|
+
const current = (config ?? {});
|
|
228
|
+
const basisValue = next;
|
|
229
|
+
const previous = basisOf(config);
|
|
230
|
+
if (!previous || previous === next)
|
|
231
|
+
return { ...current, accountingBasis: basisValue };
|
|
232
|
+
return {
|
|
233
|
+
...current,
|
|
234
|
+
accountingBasis: basisValue,
|
|
235
|
+
// Cash accounts only exist on a basis that captures them.
|
|
236
|
+
cashSegments: usesCash(next) ? current.cashSegments : undefined,
|
|
237
|
+
// Cash-exclusion rules only exist for a dual basis.
|
|
238
|
+
dualCashExclusion: next === 'dual' ? current.dualCashExclusion : undefined,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Guided setup for a whole `mscoaConfig`, arranged in the order the decisions
|
|
244
|
+
* actually depend on each other: the accounting basis first (it decides which
|
|
245
|
+
* later panels apply at all), then the accrual accounts every basis is authored
|
|
246
|
+
* against, then the cash accounts, then — for a dual basis — when the cash side
|
|
247
|
+
* is required, and finally the optional counter-account extensions.
|
|
248
|
+
*
|
|
249
|
+
* Opened by {@link MscoaConfigComponent}, which passes a
|
|
250
|
+
* {@link MscoaDialogContext} and remains the single owner of every mutation —
|
|
251
|
+
* this dialog only renders state and forwards edits. Tabs that do not apply to
|
|
252
|
+
* the chosen basis are disabled rather than hidden, so the shape of the whole
|
|
253
|
+
* setup stays legible from the first screen.
|
|
254
|
+
*
|
|
255
|
+
* Internal editor; not part of the public API.
|
|
256
|
+
*/
|
|
257
|
+
class MscoaConfigDialogComponent {
|
|
258
|
+
constructor() {
|
|
259
|
+
/** The opener-supplied context; see {@link MscoaDialogContext}. */
|
|
260
|
+
this.data = inject(MAT_DIALOG_DATA);
|
|
261
|
+
/** The live configuration, read through the opener's signal. */
|
|
262
|
+
this.config = computed(() => this.data.config(), ...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
|
|
263
|
+
/** The chosen basis, or `undefined` before the first choice. */
|
|
264
|
+
this.basis = computed(() => basisOf(this.config()), ...(ngDevMode ? [{ debugName: "basis" }] : /* istanbul ignore next */ []));
|
|
265
|
+
/** Short badge copy for the chosen basis (avoids an UpperCasePipe import). */
|
|
266
|
+
this.basisBadge = computed(() => {
|
|
267
|
+
const basis = this.basis();
|
|
268
|
+
return basis ? BASIS_BADGE[basis] : '';
|
|
269
|
+
}, ...(ngDevMode ? [{ debugName: "basisBadge" }] : /* istanbul ignore next */ []));
|
|
270
|
+
/** Token colour for the basis badge. */
|
|
271
|
+
this.basisColor = computed(() => basisColorOf(this.config()), ...(ngDevMode ? [{ debugName: "basisColor" }] : /* istanbul ignore next */ []));
|
|
272
|
+
/** Whether the chosen basis captures cash accounts. */
|
|
273
|
+
this.hasCash = computed(() => usesCash(this.basis()), ...(ngDevMode ? [{ debugName: "hasCash" }] : /* istanbul ignore next */ []));
|
|
274
|
+
/** Whether the chosen basis is dual — the only one with cash rules. */
|
|
275
|
+
this.isDual = computed(() => this.basis() === 'dual', ...(ngDevMode ? [{ debugName: "isDual" }] : /* istanbul ignore next */ []));
|
|
276
|
+
/** The setup checklist rendered in the footer. */
|
|
277
|
+
this.readiness = computed(() => readinessOf(this.config()), ...(ngDevMode ? [{ debugName: "readiness" }] : /* istanbul ignore next */ []));
|
|
278
|
+
/** One sentence on what the picker will ask the user for. */
|
|
279
|
+
this.requirement = computed(() => requirementSentence(this.config()), ...(ngDevMode ? [{ debugName: "requirement" }] : /* istanbul ignore next */ []));
|
|
280
|
+
this.segments = computed(() => segmentsOf(this.config()), ...(ngDevMode ? [{ debugName: "segments" }] : /* istanbul ignore next */ []));
|
|
281
|
+
this.cashSegments = computed(() => cashSegmentsOf(this.config()), ...(ngDevMode ? [{ debugName: "cashSegments" }] : /* istanbul ignore next */ []));
|
|
282
|
+
this.rules = computed(() => this.config()?.dualCashExclusion?.rules ?? [], ...(ngDevMode ? [{ debugName: "rules" }] : /* istanbul ignore next */ []));
|
|
283
|
+
this.ruleCount = computed(() => usableRulesOf(this.config()).length, ...(ngDevMode ? [{ debugName: "ruleCount" }] : /* istanbul ignore next */ []));
|
|
284
|
+
this.matchMode = computed(() => matchModeOf(this.config()), ...(ngDevMode ? [{ debugName: "matchMode" }] : /* istanbul ignore next */ []));
|
|
285
|
+
this.showAllSegments = computed(() => !!this.config()?.showAllSegments, ...(ngDevMode ? [{ debugName: "showAllSegments" }] : /* istanbul ignore next */ []));
|
|
286
|
+
this.accountValueLabel = computed(() => this.config()?.accountValueLabel ?? '', ...(ngDevMode ? [{ debugName: "accountValueLabel" }] : /* istanbul ignore next */ []));
|
|
287
|
+
this.extensions = computed(() => this.config()?.extensionAccountsForSegments ?? [], ...(ngDevMode ? [{ debugName: "extensions" }] : /* istanbul ignore next */ []));
|
|
288
|
+
/** No form inputs reach the rules editor; a stable empty list avoids churn. */
|
|
289
|
+
this.noFormInputs = [];
|
|
290
|
+
/** Basis choices, rendered as cards rather than bare chips. */
|
|
291
|
+
this.basisOptions = BASIS_OPTIONS;
|
|
292
|
+
/** The field every account is displayed by. */
|
|
293
|
+
this.labelOptions = MSCOA_ACCOUNT_VALUE_LABEL_OPTIONS;
|
|
294
|
+
/** How the cash-exclusion rules combine. */
|
|
295
|
+
this.matchModeOptions = [
|
|
296
|
+
{ label: 'Any must pass', value: 'any' },
|
|
297
|
+
{ label: 'All must pass', value: 'all' },
|
|
298
|
+
];
|
|
299
|
+
/**
|
|
300
|
+
* The record-list element the rules panel is driven by: the shared per-rule
|
|
301
|
+
* editor from `ngx-t-forms-types`, with the segment-scope row's options filled
|
|
302
|
+
* from THIS input's accrual segments.
|
|
303
|
+
*
|
|
304
|
+
* Built here rather than injected at the form-builder seam because this dialog
|
|
305
|
+
* already holds the whole `mscoaConfig` — the segments and the rules that
|
|
306
|
+
* reference them are one object.
|
|
307
|
+
*/
|
|
308
|
+
this.ruleListElement = computed(() => {
|
|
309
|
+
const options = segmentScopeOptions(this.config());
|
|
310
|
+
const sections = MSCOA_DUAL_CASH_EXCLUSION_RULE_EDITOR().map((section) => ({
|
|
311
|
+
...section,
|
|
312
|
+
elements: section.elements.map((element) => element.deepBind?.length === 1 && element.deepBind[0] === 'segment'
|
|
313
|
+
? { ...element, options }
|
|
314
|
+
: element),
|
|
315
|
+
}));
|
|
316
|
+
return {
|
|
317
|
+
id: 'mscoa-cash-rules',
|
|
318
|
+
name: SpecialElementKeys.Default,
|
|
319
|
+
deepBind: ['rules'],
|
|
320
|
+
editType: ElementEditorTypes.RecordListManager,
|
|
321
|
+
label: 'Conditions that make cash accounting optional',
|
|
322
|
+
secondaryElementEditorConfig: sections,
|
|
323
|
+
options: [
|
|
324
|
+
{ label: 'Expression', value: 'pattern' },
|
|
325
|
+
{ label: 'Segment', value: 'segment' },
|
|
326
|
+
{ label: 'Description', value: 'description' },
|
|
327
|
+
],
|
|
328
|
+
};
|
|
329
|
+
}, ...(ngDevMode ? [{ debugName: "ruleListElement" }] : /* istanbul ignore next */ []));
|
|
330
|
+
/**
|
|
331
|
+
* Active tab. A `linkedSignal` (per the library decision tree — follows a
|
|
332
|
+
* source, the user overrides locally): the choice sticks while a basis exists,
|
|
333
|
+
* and losing the basis snaps back to Basis, where every other tab is disabled
|
|
334
|
+
* and nothing else would be honest to show. No `effect()` writes.
|
|
335
|
+
*/
|
|
336
|
+
this.selectedTab = linkedSignal({ ...(ngDevMode ? { debugName: "selectedTab" } : /* istanbul ignore next */ {}), source: computed(() => !!this.basis()),
|
|
337
|
+
computation: (has, previous) => (has ? (previous?.value ?? 0 /* MscoaTab.Basis */) : 0 /* MscoaTab.Basis */) });
|
|
338
|
+
/** Exposes the tab indices to the template. */
|
|
339
|
+
this.Tab = {
|
|
340
|
+
Basis: 0 /* MscoaTab.Basis */,
|
|
341
|
+
Accrual: 1 /* MscoaTab.Accrual */,
|
|
342
|
+
Cash: 2 /* MscoaTab.Cash */,
|
|
343
|
+
Rules: 3 /* MscoaTab.Rules */,
|
|
344
|
+
Extensions: 4 /* MscoaTab.Extensions */,
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Forwards a basis choice and moves the administrator to the next panel that
|
|
349
|
+
* needs them — the accrual segments, which every basis is authored against.
|
|
350
|
+
* Re-picking the basis already in force only forwards it (the host no-ops the
|
|
351
|
+
* write), so it never yanks the tab away from someone reviewing a setting.
|
|
352
|
+
*/
|
|
353
|
+
onBasisChanged(basis) {
|
|
354
|
+
const changed = this.basis() !== basis;
|
|
355
|
+
this.data.basisChanged(basis);
|
|
356
|
+
if (changed)
|
|
357
|
+
this.selectedTab.set(1 /* MscoaTab.Accrual */);
|
|
358
|
+
}
|
|
359
|
+
onAccountValueLabelChanged(label) {
|
|
360
|
+
if (typeof label === 'string')
|
|
361
|
+
this.data.accountValueLabelChanged(label);
|
|
362
|
+
}
|
|
363
|
+
onMatchModeChanged(mode) {
|
|
364
|
+
if (mode === 'any' || mode === 'all')
|
|
365
|
+
this.data.matchModeChanged(mode);
|
|
366
|
+
}
|
|
367
|
+
onRulesChanged(rows) {
|
|
368
|
+
this.data.rulesChanged(Array.isArray(rows) ? rows : []);
|
|
369
|
+
}
|
|
370
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MscoaConfigDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
371
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: MscoaConfigDialogComponent, isStandalone: true, selector: "lib-mscoa-config-dialog", host: { classAttribute: "lib-mscoa-config-dialog" }, ngImport: i0, template: "<header class=\"mcd__header\">\n <div class=\"mcd__heading\">\n <h2 class=\"mcd__title\">MSCOA account setup</h2>\n <p class=\"mcd__subtitle\">What this account picker asks the user for</p>\n </div>\n <button mat-icon-button mat-dialog-close class=\"mcd__close\" aria-label=\"Close MSCOA setup\">\n <mat-icon aria-hidden=\"true\">close</mat-icon>\n </button>\n</header>\n\n@if (basis(); as chosen) {\n <!-- Basis bar \u2014 the anchor every later decision hangs off. -->\n <div class=\"mcd__basis-bar\">\n <span class=\"mcd__basis\" [style.color]=\"basisColor()\">{{ basisBadge() }}</span>\n <p class=\"mcd__requirement\">{{ requirement() }}</p>\n <button\n mat-stroked-button\n class=\"mcd__change\"\n [disabled]=\"data.disabled()\"\n (click)=\"selectedTab.set(Tab.Basis)\">\n <mat-icon aria-hidden=\"true\">swap_horiz</mat-icon>\n Change basis\n </button>\n </div>\n} @else {\n <!-- First-run guide: the whole flow in one glance. -->\n <ol class=\"mcd__steps\" aria-label=\"Setup steps\">\n <li class=\"mcd__step mcd__step--active\"><span class=\"mcd__step-n\">1</span>Choose the basis</li>\n <li class=\"mcd__step\"><span class=\"mcd__step-n\">2</span>Pick the segments</li>\n <li class=\"mcd__step\"><span class=\"mcd__step-n\">3</span>Refine the rules</li>\n </ol>\n}\n\n<mat-dialog-content class=\"mcd__content\">\n <mat-tab-group\n class=\"mcd__tabs\"\n [mat-stretch-tabs]=\"false\"\n animationDuration=\"150ms\"\n [selectedIndex]=\"selectedTab()\"\n (selectedIndexChange)=\"selectedTab.set($event)\">\n\n <!-- 1 \u00B7 BASIS -->\n <mat-tab label=\"Basis\">\n <section class=\"mcd__pane\">\n <p class=\"mcd__hint\">\n This decides when the budget is affected, and how many sets of accounts the user has to\n capture. Everything else in this setup follows from it.\n </p>\n\n <div class=\"mcd__cards\" role=\"radiogroup\" aria-label=\"Accounting basis\">\n @for (option of basisOptions; track option.value) {\n <button\n type=\"button\"\n role=\"radio\"\n class=\"mcd__card\"\n [class.mcd__card--selected]=\"basis() === option.value\"\n [attr.aria-checked]=\"basis() === option.value\"\n [disabled]=\"data.disabled()\"\n (click)=\"onBasisChanged(option.value)\">\n <span class=\"mcd__card-title\">{{ option.label }}</span>\n <span class=\"mcd__card-detail\">{{ option.detail }}</span>\n @if (basis() === option.value) {\n <mat-icon class=\"mcd__card-tick\" aria-hidden=\"true\">check_circle</mat-icon>\n }\n </button>\n }\n </div>\n\n <div class=\"mcd__field\">\n <h3 class=\"mcd__field-label\">Account value label</h3>\n <p class=\"mcd__field-hint\">\n The field every selected account is displayed by \u2014 in the picker and in everything\n downstream that reads the captured value.\n </p>\n <lib-mat-chip-list-editor\n [options]=\"labelOptions\"\n [value]=\"accountValueLabel()\"\n [disabled]=\"data.disabled()\"\n (valueChange)=\"onAccountValueLabelChanged($event)\" />\n </div>\n </section>\n </mat-tab>\n\n <!-- 2 \u00B7 ACCRUAL SEGMENTS -->\n <mat-tab [disabled]=\"!basis()\">\n <ng-template mat-tab-label>\n Accrual segments\n @if (segments().length) {\n <span class=\"mcd__badge\">{{ segments().length }}</span>\n }\n </ng-template>\n <section class=\"mcd__pane\">\n <p class=\"mcd__hint\">\n The SCOA segments the user picks an account for. Every basis is authored against this\n set \u2014 a cash-only input still captures its accounts here.\n </p>\n\n <div class=\"mcd__toggle-row\">\n <mat-slide-toggle\n [checked]=\"showAllSegments()\"\n [disabled]=\"data.disabled()\"\n (change)=\"data.showAllSegmentsChanged($event.checked)\">\n Allow selection from all SCOA segments\n </mat-slide-toggle>\n <p class=\"mcd__field-hint\">\n On: every segment in the chart of accounts can be added. Off: only the standard set.\n </p>\n </div>\n\n <lib-mscoa-segment-config\n [value]=\"segments()\"\n [dataValue]=\"data.dataValue()\"\n [disabled]=\"data.disabled()\"\n [errors]=\"data.errors() || []\"\n [getMscoaTree]=\"data.getMscoaTree()\"\n [showAllSegments]=\"showAllSegments()\"\n [saveCustomInput]=\"data.saveCustomInput()\"\n [editSegmentInput]=\"data.editSegmentInput()\"\n [deleteSegmentInput]=\"data.deleteSegmentInput()\"\n (valueChanged)=\"data.segmentsChanged($event)\" />\n </section>\n </mat-tab>\n\n <!-- 3 \u00B7 CASH SEGMENTS -->\n <mat-tab [disabled]=\"!hasCash()\">\n <ng-template mat-tab-label>\n Cash segments\n @if (cashSegments().length) {\n <span class=\"mcd__badge\">{{ cashSegments().length }}</span>\n }\n </ng-template>\n <section class=\"mcd__pane\">\n @if (hasCash()) {\n <p class=\"mcd__hint\">\n The segments captured on the cash side. A segment set to inherit takes its accounts\n from the matching accrual segment instead of asking again.\n </p>\n <lib-mscoa-segment-config\n [value]=\"cashSegments()\"\n [dataValue]=\"data.dataValue()\"\n [isCashSegmentConfig]=\"true\"\n [disabled]=\"data.disabled()\"\n [errors]=\"data.errors() || []\"\n [getMscoaTree]=\"data.getMscoaTree()\"\n [showAllSegments]=\"showAllSegments()\"\n [saveCustomInput]=\"data.saveCustomInput()\"\n [editSegmentInput]=\"data.editSegmentInput()\"\n [deleteSegmentInput]=\"data.deleteSegmentInput()\"\n (valueChanged)=\"data.cashSegmentsChanged($event)\" />\n }\n </section>\n </mat-tab>\n\n <!-- 4 \u00B7 CASH RULES (dual only) -->\n <mat-tab [disabled]=\"!isDual()\">\n <ng-template mat-tab-label>\n Cash rules\n @if (ruleCount()) {\n <span class=\"mcd__badge\">{{ ruleCount() }}</span>\n }\n </ng-template>\n <section class=\"mcd__pane\">\n @if (isDual()) {\n <p class=\"mcd__hint\">\n By default a dual input requires BOTH sets of accounts. Add conditions here to make the\n cash side optional: each is a regular expression tested against the accrual accounts the\n user selected. When the conditions pass, the cash table is hidden, any cash accounts\n already captured are cleared, and only the accrual side is required.\n </p>\n\n <lib-record-list-manager\n [editorConfig]=\"ruleListElement()\"\n [formInputs]=\"noFormInputs\"\n [value]=\"rules()\"\n [disabled]=\"data.disabled()\"\n (valueChange)=\"onRulesChanged($event)\" />\n\n @if (ruleCount() > 1) {\n <div class=\"mcd__field\">\n <h3 class=\"mcd__field-label\">How the conditions combine</h3>\n <lib-mat-chip-list-editor\n [options]=\"matchModeOptions\"\n [value]=\"matchMode()\"\n [disabled]=\"data.disabled()\"\n (valueChange)=\"onMatchModeChanged($event)\" />\n </div>\n }\n\n <p class=\"mcd__outcome\">{{ requirement() }}</p>\n }\n </section>\n </mat-tab>\n\n <!-- 5 \u00B7 EXTENSIONS -->\n <mat-tab [disabled]=\"!basis()\">\n <ng-template mat-tab-label>\n Extensions\n @if (extensions().length) {\n <span class=\"mcd__badge\">{{ extensions().length }}</span>\n }\n </ng-template>\n <section class=\"mcd__pane\">\n <p class=\"mcd__hint\">\n Optional extra account columns offered alongside debit and credit \u2014 bank charges or\n retention, for example. Each name becomes a pair of columns a segment can opt into.\n </p>\n <lib-chip-options-creator-editor\n [value]=\"extensions()\"\n [disabled]=\"data.disabled()\"\n [errors]=\"data.errors() || []\"\n placeholder=\"e.g. bankCharges\"\n (valueChange)=\"data.extensionsChanged($event)\" />\n </section>\n </mat-tab>\n </mat-tab-group>\n</mat-dialog-content>\n\n<footer class=\"mcd__footer\">\n <ul class=\"mcd__readiness\" aria-label=\"Setup checklist\">\n @for (item of readiness(); track item.label) {\n <li class=\"mcd__ready\" [attr.data-state]=\"item.state\">\n <!-- Glyph + colour + border style: state is never colour-only. -->\n <span class=\"mcd__ready-mark\" aria-hidden=\"true\">{{\n item.state === 'done' ? '\u2713' : item.state === 'pending' ? '\u2022' : '\u2013'\n }}</span>\n {{ item.label }}\n </li>\n }\n </ul>\n <button mat-flat-button mat-dialog-close class=\"mcd__done\">Done</button>\n</footer>\n", styles: ["@charset \"UTF-8\";:host{display:block}.mcd__header{display:flex;align-items:flex-start;justify-content:space-between;gap:1.5rem;padding:2rem 2rem 1.5rem}.mcd__title{margin:0;font-size:1.25rem;font-weight:500;letter-spacing:-.01em;color:var(--lib-forms-text, currentColor)}.mcd__subtitle{margin:.5rem 0 0;font-size:.8125rem;color:var(--lib-forms-text-muted, currentColor)}.mcd__close{flex:0 0 auto}.mcd__basis-bar{display:flex;align-items:center;gap:1.5rem;margin:0 2rem 1.5rem;padding:1.25rem 1.5rem;border-radius:var(--lib-forms-radius, .75rem);background:var(--lib-forms-surface-raised, transparent)}.mcd__basis{flex:0 0 auto;font-size:.5625rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.mcd__requirement{flex:1 1 auto;margin:0;font-size:.875rem;color:var(--lib-forms-text, currentColor)}.mcd__change{flex:0 0 auto}.mcd__steps{display:flex;flex-wrap:wrap;gap:2rem;margin:0 2rem 1.5rem;padding:0;list-style:none}.mcd__step{display:flex;align-items:center;gap:.5rem;font-size:.8125rem;color:var(--lib-forms-text-muted, currentColor)}.mcd__step--active{color:var(--lib-forms-text, currentColor)}.mcd__step-n{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:50%;border:1px solid currentColor;font-size:.6875rem}.mcd__content{padding:0 2rem;max-height:none}.mcd__pane{padding:2rem 0 1rem;display:flex;flex-direction:column;gap:2rem}.mcd__hint,.mcd__field-hint{margin:0;font-size:.8125rem;line-height:1.6;color:var(--lib-forms-text-muted, currentColor)}.mcd__badge{display:inline-flex;align-items:center;justify-content:center;min-width:1.25rem;height:1.25rem;margin-left:.5rem;padding:0 .375rem;border-radius:.625rem;background:var(--lib-forms-surface-sunken, transparent);font-size:.625rem;font-weight:600}.mcd__cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(15rem,1fr));gap:1.5rem}.mcd__card{position:relative;display:flex;flex-direction:column;gap:.75rem;padding:1.5rem;text-align:left;cursor:pointer;border:1px solid var(--lib-forms-border, transparent);border-radius:var(--lib-forms-radius, .75rem);background:var(--lib-forms-surface, transparent);color:inherit;font:inherit;transition:border-color .3s cubic-bezier(.16,1,.3,1),background-color .3s cubic-bezier(.16,1,.3,1),transform .3s cubic-bezier(.16,1,.3,1)}.mcd__card:hover:not(:disabled){border-color:var(--lib-forms-accent, currentColor);transform:translateY(-2px)}.mcd__card:disabled{cursor:not-allowed;opacity:.55}.mcd__card--selected{border-color:var(--lib-forms-accent, currentColor);background:var(--lib-forms-surface-raised, transparent)}.mcd__card-title{font-size:.9375rem;font-weight:600}.mcd__card-detail{font-size:.8125rem;line-height:1.6;color:var(--lib-forms-text-muted, currentColor)}.mcd__card-tick{position:absolute;top:1rem;right:1rem;color:var(--lib-forms-accent, currentColor)}.mcd__field{display:flex;flex-direction:column;gap:.75rem}.mcd__field-label{margin:0;font-size:.625rem;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--lib-forms-text-muted, currentColor)}.mcd__toggle-row{display:flex;flex-direction:column;gap:.5rem}.mcd__outcome{margin:0;padding:1.25rem 1.5rem;border-radius:var(--lib-forms-radius, .75rem);background:var(--sem-info-surface, transparent);font-size:.875rem;color:var(--lib-forms-text, currentColor)}.mcd__footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1.5rem;padding:1.5rem 2rem 2rem}.mcd__readiness{display:flex;flex-wrap:wrap;gap:.75rem;margin:0;padding:0;list-style:none}.mcd__ready{display:inline-flex;align-items:center;gap:.5rem;padding:.375rem .75rem;border-radius:1rem;border:1px solid var(--lib-forms-border, transparent);font-size:.75rem;color:var(--lib-forms-text-muted, currentColor)}.mcd__ready[data-state=done]{border-color:var(--sem-emerald, currentColor);color:var(--sem-emerald, currentColor)}.mcd__ready[data-state=pending]{border-style:dashed;border-color:var(--sem-amber, currentColor);color:var(--sem-amber, currentColor)}.mcd__ready-mark{font-weight:600}.mcd__done{flex:0 0 auto}\n"], dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i1$1.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: MatTabsModule }, { kind: "directive", type: i5.MatTabLabel, selector: "[mat-tab-label], [matTabLabel]" }, { kind: "component", type: i5.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass", "id"], exportAs: ["matTab"] }, { kind: "component", type: i5.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "mat-align-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "component", type: ChipOptionsCreatorEditorComponent, selector: "lib-chip-options-creator-editor", inputs: ["id", "disabled", "required", "errors", "value", "placeholder"], outputs: ["valueChange"] }, { kind: "component", type: MatChipListEditorComponent, selector: "lib-mat-chip-list-editor", inputs: ["disabled", "multiple", "required", "errors", "value", "options"], outputs: ["valueChange"] }, { kind: "component", type: MscoaSegmentConfigComponent, selector: "lib-mscoa-segment-config", inputs: ["errors", "dataValue", "disabled", "isCashSegmentConfig", "value", "showAllSegments", "getMscoaTree", "saveCustomInput", "editSegmentInput", "deleteSegmentInput"], outputs: ["valueChanged"] }, { kind: "component", type: RecordListManagerComponent, selector: "lib-record-list-manager", inputs: ["mapToData", "errors", "disabled", "required", "placeholder", "value", "formInputs", "editorConfig"], outputs: ["valueChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
372
|
+
}
|
|
373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MscoaConfigDialogComponent, decorators: [{
|
|
374
|
+
type: Component,
|
|
375
|
+
args: [{ selector: 'lib-mscoa-config-dialog', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: { class: 'lib-mscoa-config-dialog' }, imports: [
|
|
376
|
+
MatDialogModule,
|
|
377
|
+
MatButtonModule,
|
|
378
|
+
MatIconModule,
|
|
379
|
+
MatSlideToggleModule,
|
|
380
|
+
MatTabsModule,
|
|
381
|
+
MatTooltipModule,
|
|
382
|
+
ChipOptionsCreatorEditorComponent,
|
|
383
|
+
MatChipListEditorComponent,
|
|
384
|
+
MscoaSegmentConfigComponent,
|
|
385
|
+
RecordListManagerComponent,
|
|
386
|
+
], template: "<header class=\"mcd__header\">\n <div class=\"mcd__heading\">\n <h2 class=\"mcd__title\">MSCOA account setup</h2>\n <p class=\"mcd__subtitle\">What this account picker asks the user for</p>\n </div>\n <button mat-icon-button mat-dialog-close class=\"mcd__close\" aria-label=\"Close MSCOA setup\">\n <mat-icon aria-hidden=\"true\">close</mat-icon>\n </button>\n</header>\n\n@if (basis(); as chosen) {\n <!-- Basis bar \u2014 the anchor every later decision hangs off. -->\n <div class=\"mcd__basis-bar\">\n <span class=\"mcd__basis\" [style.color]=\"basisColor()\">{{ basisBadge() }}</span>\n <p class=\"mcd__requirement\">{{ requirement() }}</p>\n <button\n mat-stroked-button\n class=\"mcd__change\"\n [disabled]=\"data.disabled()\"\n (click)=\"selectedTab.set(Tab.Basis)\">\n <mat-icon aria-hidden=\"true\">swap_horiz</mat-icon>\n Change basis\n </button>\n </div>\n} @else {\n <!-- First-run guide: the whole flow in one glance. -->\n <ol class=\"mcd__steps\" aria-label=\"Setup steps\">\n <li class=\"mcd__step mcd__step--active\"><span class=\"mcd__step-n\">1</span>Choose the basis</li>\n <li class=\"mcd__step\"><span class=\"mcd__step-n\">2</span>Pick the segments</li>\n <li class=\"mcd__step\"><span class=\"mcd__step-n\">3</span>Refine the rules</li>\n </ol>\n}\n\n<mat-dialog-content class=\"mcd__content\">\n <mat-tab-group\n class=\"mcd__tabs\"\n [mat-stretch-tabs]=\"false\"\n animationDuration=\"150ms\"\n [selectedIndex]=\"selectedTab()\"\n (selectedIndexChange)=\"selectedTab.set($event)\">\n\n <!-- 1 \u00B7 BASIS -->\n <mat-tab label=\"Basis\">\n <section class=\"mcd__pane\">\n <p class=\"mcd__hint\">\n This decides when the budget is affected, and how many sets of accounts the user has to\n capture. Everything else in this setup follows from it.\n </p>\n\n <div class=\"mcd__cards\" role=\"radiogroup\" aria-label=\"Accounting basis\">\n @for (option of basisOptions; track option.value) {\n <button\n type=\"button\"\n role=\"radio\"\n class=\"mcd__card\"\n [class.mcd__card--selected]=\"basis() === option.value\"\n [attr.aria-checked]=\"basis() === option.value\"\n [disabled]=\"data.disabled()\"\n (click)=\"onBasisChanged(option.value)\">\n <span class=\"mcd__card-title\">{{ option.label }}</span>\n <span class=\"mcd__card-detail\">{{ option.detail }}</span>\n @if (basis() === option.value) {\n <mat-icon class=\"mcd__card-tick\" aria-hidden=\"true\">check_circle</mat-icon>\n }\n </button>\n }\n </div>\n\n <div class=\"mcd__field\">\n <h3 class=\"mcd__field-label\">Account value label</h3>\n <p class=\"mcd__field-hint\">\n The field every selected account is displayed by \u2014 in the picker and in everything\n downstream that reads the captured value.\n </p>\n <lib-mat-chip-list-editor\n [options]=\"labelOptions\"\n [value]=\"accountValueLabel()\"\n [disabled]=\"data.disabled()\"\n (valueChange)=\"onAccountValueLabelChanged($event)\" />\n </div>\n </section>\n </mat-tab>\n\n <!-- 2 \u00B7 ACCRUAL SEGMENTS -->\n <mat-tab [disabled]=\"!basis()\">\n <ng-template mat-tab-label>\n Accrual segments\n @if (segments().length) {\n <span class=\"mcd__badge\">{{ segments().length }}</span>\n }\n </ng-template>\n <section class=\"mcd__pane\">\n <p class=\"mcd__hint\">\n The SCOA segments the user picks an account for. Every basis is authored against this\n set \u2014 a cash-only input still captures its accounts here.\n </p>\n\n <div class=\"mcd__toggle-row\">\n <mat-slide-toggle\n [checked]=\"showAllSegments()\"\n [disabled]=\"data.disabled()\"\n (change)=\"data.showAllSegmentsChanged($event.checked)\">\n Allow selection from all SCOA segments\n </mat-slide-toggle>\n <p class=\"mcd__field-hint\">\n On: every segment in the chart of accounts can be added. Off: only the standard set.\n </p>\n </div>\n\n <lib-mscoa-segment-config\n [value]=\"segments()\"\n [dataValue]=\"data.dataValue()\"\n [disabled]=\"data.disabled()\"\n [errors]=\"data.errors() || []\"\n [getMscoaTree]=\"data.getMscoaTree()\"\n [showAllSegments]=\"showAllSegments()\"\n [saveCustomInput]=\"data.saveCustomInput()\"\n [editSegmentInput]=\"data.editSegmentInput()\"\n [deleteSegmentInput]=\"data.deleteSegmentInput()\"\n (valueChanged)=\"data.segmentsChanged($event)\" />\n </section>\n </mat-tab>\n\n <!-- 3 \u00B7 CASH SEGMENTS -->\n <mat-tab [disabled]=\"!hasCash()\">\n <ng-template mat-tab-label>\n Cash segments\n @if (cashSegments().length) {\n <span class=\"mcd__badge\">{{ cashSegments().length }}</span>\n }\n </ng-template>\n <section class=\"mcd__pane\">\n @if (hasCash()) {\n <p class=\"mcd__hint\">\n The segments captured on the cash side. A segment set to inherit takes its accounts\n from the matching accrual segment instead of asking again.\n </p>\n <lib-mscoa-segment-config\n [value]=\"cashSegments()\"\n [dataValue]=\"data.dataValue()\"\n [isCashSegmentConfig]=\"true\"\n [disabled]=\"data.disabled()\"\n [errors]=\"data.errors() || []\"\n [getMscoaTree]=\"data.getMscoaTree()\"\n [showAllSegments]=\"showAllSegments()\"\n [saveCustomInput]=\"data.saveCustomInput()\"\n [editSegmentInput]=\"data.editSegmentInput()\"\n [deleteSegmentInput]=\"data.deleteSegmentInput()\"\n (valueChanged)=\"data.cashSegmentsChanged($event)\" />\n }\n </section>\n </mat-tab>\n\n <!-- 4 \u00B7 CASH RULES (dual only) -->\n <mat-tab [disabled]=\"!isDual()\">\n <ng-template mat-tab-label>\n Cash rules\n @if (ruleCount()) {\n <span class=\"mcd__badge\">{{ ruleCount() }}</span>\n }\n </ng-template>\n <section class=\"mcd__pane\">\n @if (isDual()) {\n <p class=\"mcd__hint\">\n By default a dual input requires BOTH sets of accounts. Add conditions here to make the\n cash side optional: each is a regular expression tested against the accrual accounts the\n user selected. When the conditions pass, the cash table is hidden, any cash accounts\n already captured are cleared, and only the accrual side is required.\n </p>\n\n <lib-record-list-manager\n [editorConfig]=\"ruleListElement()\"\n [formInputs]=\"noFormInputs\"\n [value]=\"rules()\"\n [disabled]=\"data.disabled()\"\n (valueChange)=\"onRulesChanged($event)\" />\n\n @if (ruleCount() > 1) {\n <div class=\"mcd__field\">\n <h3 class=\"mcd__field-label\">How the conditions combine</h3>\n <lib-mat-chip-list-editor\n [options]=\"matchModeOptions\"\n [value]=\"matchMode()\"\n [disabled]=\"data.disabled()\"\n (valueChange)=\"onMatchModeChanged($event)\" />\n </div>\n }\n\n <p class=\"mcd__outcome\">{{ requirement() }}</p>\n }\n </section>\n </mat-tab>\n\n <!-- 5 \u00B7 EXTENSIONS -->\n <mat-tab [disabled]=\"!basis()\">\n <ng-template mat-tab-label>\n Extensions\n @if (extensions().length) {\n <span class=\"mcd__badge\">{{ extensions().length }}</span>\n }\n </ng-template>\n <section class=\"mcd__pane\">\n <p class=\"mcd__hint\">\n Optional extra account columns offered alongside debit and credit \u2014 bank charges or\n retention, for example. Each name becomes a pair of columns a segment can opt into.\n </p>\n <lib-chip-options-creator-editor\n [value]=\"extensions()\"\n [disabled]=\"data.disabled()\"\n [errors]=\"data.errors() || []\"\n placeholder=\"e.g. bankCharges\"\n (valueChange)=\"data.extensionsChanged($event)\" />\n </section>\n </mat-tab>\n </mat-tab-group>\n</mat-dialog-content>\n\n<footer class=\"mcd__footer\">\n <ul class=\"mcd__readiness\" aria-label=\"Setup checklist\">\n @for (item of readiness(); track item.label) {\n <li class=\"mcd__ready\" [attr.data-state]=\"item.state\">\n <!-- Glyph + colour + border style: state is never colour-only. -->\n <span class=\"mcd__ready-mark\" aria-hidden=\"true\">{{\n item.state === 'done' ? '\u2713' : item.state === 'pending' ? '\u2022' : '\u2013'\n }}</span>\n {{ item.label }}\n </li>\n }\n </ul>\n <button mat-flat-button mat-dialog-close class=\"mcd__done\">Done</button>\n</footer>\n", styles: ["@charset \"UTF-8\";:host{display:block}.mcd__header{display:flex;align-items:flex-start;justify-content:space-between;gap:1.5rem;padding:2rem 2rem 1.5rem}.mcd__title{margin:0;font-size:1.25rem;font-weight:500;letter-spacing:-.01em;color:var(--lib-forms-text, currentColor)}.mcd__subtitle{margin:.5rem 0 0;font-size:.8125rem;color:var(--lib-forms-text-muted, currentColor)}.mcd__close{flex:0 0 auto}.mcd__basis-bar{display:flex;align-items:center;gap:1.5rem;margin:0 2rem 1.5rem;padding:1.25rem 1.5rem;border-radius:var(--lib-forms-radius, .75rem);background:var(--lib-forms-surface-raised, transparent)}.mcd__basis{flex:0 0 auto;font-size:.5625rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.mcd__requirement{flex:1 1 auto;margin:0;font-size:.875rem;color:var(--lib-forms-text, currentColor)}.mcd__change{flex:0 0 auto}.mcd__steps{display:flex;flex-wrap:wrap;gap:2rem;margin:0 2rem 1.5rem;padding:0;list-style:none}.mcd__step{display:flex;align-items:center;gap:.5rem;font-size:.8125rem;color:var(--lib-forms-text-muted, currentColor)}.mcd__step--active{color:var(--lib-forms-text, currentColor)}.mcd__step-n{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:50%;border:1px solid currentColor;font-size:.6875rem}.mcd__content{padding:0 2rem;max-height:none}.mcd__pane{padding:2rem 0 1rem;display:flex;flex-direction:column;gap:2rem}.mcd__hint,.mcd__field-hint{margin:0;font-size:.8125rem;line-height:1.6;color:var(--lib-forms-text-muted, currentColor)}.mcd__badge{display:inline-flex;align-items:center;justify-content:center;min-width:1.25rem;height:1.25rem;margin-left:.5rem;padding:0 .375rem;border-radius:.625rem;background:var(--lib-forms-surface-sunken, transparent);font-size:.625rem;font-weight:600}.mcd__cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(15rem,1fr));gap:1.5rem}.mcd__card{position:relative;display:flex;flex-direction:column;gap:.75rem;padding:1.5rem;text-align:left;cursor:pointer;border:1px solid var(--lib-forms-border, transparent);border-radius:var(--lib-forms-radius, .75rem);background:var(--lib-forms-surface, transparent);color:inherit;font:inherit;transition:border-color .3s cubic-bezier(.16,1,.3,1),background-color .3s cubic-bezier(.16,1,.3,1),transform .3s cubic-bezier(.16,1,.3,1)}.mcd__card:hover:not(:disabled){border-color:var(--lib-forms-accent, currentColor);transform:translateY(-2px)}.mcd__card:disabled{cursor:not-allowed;opacity:.55}.mcd__card--selected{border-color:var(--lib-forms-accent, currentColor);background:var(--lib-forms-surface-raised, transparent)}.mcd__card-title{font-size:.9375rem;font-weight:600}.mcd__card-detail{font-size:.8125rem;line-height:1.6;color:var(--lib-forms-text-muted, currentColor)}.mcd__card-tick{position:absolute;top:1rem;right:1rem;color:var(--lib-forms-accent, currentColor)}.mcd__field{display:flex;flex-direction:column;gap:.75rem}.mcd__field-label{margin:0;font-size:.625rem;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--lib-forms-text-muted, currentColor)}.mcd__toggle-row{display:flex;flex-direction:column;gap:.5rem}.mcd__outcome{margin:0;padding:1.25rem 1.5rem;border-radius:var(--lib-forms-radius, .75rem);background:var(--sem-info-surface, transparent);font-size:.875rem;color:var(--lib-forms-text, currentColor)}.mcd__footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1.5rem;padding:1.5rem 2rem 2rem}.mcd__readiness{display:flex;flex-wrap:wrap;gap:.75rem;margin:0;padding:0;list-style:none}.mcd__ready{display:inline-flex;align-items:center;gap:.5rem;padding:.375rem .75rem;border-radius:1rem;border:1px solid var(--lib-forms-border, transparent);font-size:.75rem;color:var(--lib-forms-text-muted, currentColor)}.mcd__ready[data-state=done]{border-color:var(--sem-emerald, currentColor);color:var(--sem-emerald, currentColor)}.mcd__ready[data-state=pending]{border-style:dashed;border-color:var(--sem-amber, currentColor);color:var(--sem-amber, currentColor)}.mcd__ready-mark{font-weight:600}.mcd__done{flex:0 0 auto}\n"] }]
|
|
387
|
+
}] });
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Entry point for a whole `mscoaConfig`.
|
|
391
|
+
*
|
|
392
|
+
* Replaces the eight separate sidebar rows an MSCOA input used to be configured
|
|
393
|
+
* through — accounting basis, account value label, "show all segments", the
|
|
394
|
+
* accrual and cash segment sets, the dual-basis cash rules and their match mode,
|
|
395
|
+
* and the counter-account extensions. Those rows were scattered through the
|
|
396
|
+
* element editor in declaration order rather than in the order the decisions
|
|
397
|
+
* depend on each other, and half of them silently did nothing until the basis
|
|
398
|
+
* above them was right.
|
|
399
|
+
*
|
|
400
|
+
* The sidebar is too narrow to make that legible, so this component renders only
|
|
401
|
+
* the CURRENT STATE — an invitation card before a basis is chosen, a summary
|
|
402
|
+
* card (basis badge, what the picker will ask for, per-area chips) after — and
|
|
403
|
+
* opens {@link MscoaConfigDialogComponent} for the actual editing. It remains
|
|
404
|
+
* the single owner of every mutation: the dialog reads live state through
|
|
405
|
+
* signals and forwards edits back into the patch methods here.
|
|
406
|
+
*
|
|
407
|
+
* Emits the COMPLETE `mscoaConfig` on every change. Changing the basis clears
|
|
408
|
+
* the work that basis invalidates — the guarantee the removed rows got from
|
|
409
|
+
* `clearOnChange`, now owned by {@link configForBasis}.
|
|
410
|
+
*
|
|
411
|
+
* Internal editor consumed by `t-dynamic-data-edit`; not part of the public API.
|
|
412
|
+
*
|
|
413
|
+
* @example
|
|
414
|
+
* <lib-mscoa-config [value]="mscoaConfig()" [dataValue]="input()"
|
|
415
|
+
* (valueChanged)="onConfig($event)" />
|
|
416
|
+
*/
|
|
417
|
+
class MscoaConfigComponent {
|
|
418
|
+
#dialog;
|
|
419
|
+
#destroyRef;
|
|
420
|
+
/**
|
|
421
|
+
* The editor's own injector, handed to the dialog so the hosted record-list
|
|
422
|
+
* editor still resolves `NESTED_EDITOR_COMPONENT` — a dialog opened without it
|
|
423
|
+
* would attach under the root injector, where that token is not provided.
|
|
424
|
+
*/
|
|
425
|
+
#injector;
|
|
426
|
+
/** The open editor dialog, if any — guards against double-opening. */
|
|
427
|
+
#dialogRef;
|
|
428
|
+
constructor() {
|
|
429
|
+
this.#dialog = inject(MatDialog);
|
|
430
|
+
this.#destroyRef = inject(DestroyRef);
|
|
431
|
+
/**
|
|
432
|
+
* The editor's own injector, handed to the dialog so the hosted record-list
|
|
433
|
+
* editor still resolves `NESTED_EDITOR_COMPONENT` — a dialog opened without it
|
|
434
|
+
* would attach under the root injector, where that token is not provided.
|
|
435
|
+
*/
|
|
436
|
+
this.#injector = inject(Injector);
|
|
437
|
+
/** Current MSCOA configuration (`undefined` on a freshly added input). */
|
|
438
|
+
this.value = input(undefined, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
439
|
+
/** The whole input being edited — the segment editor reads its extensions. */
|
|
440
|
+
this.dataValue = input(undefined, ...(ngDevMode ? [{ debugName: "dataValue" }] : /* istanbul ignore next */ []));
|
|
441
|
+
/** Account tree behind the segment pickers. */
|
|
442
|
+
this.getMscoaTree = input(undefined, ...(ngDevMode ? [{ debugName: "getMscoaTree" }] : /* istanbul ignore next */ []));
|
|
443
|
+
/** All form inputs, forwarded to the hosted editors. */
|
|
444
|
+
this.formInputs = input([], ...(ngDevMode ? [{ debugName: "formInputs" }] : /* istanbul ignore next */ []));
|
|
445
|
+
/** Disables editing; the dialog stays openable for read-only review. */
|
|
446
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
447
|
+
/** Validation errors surfaced by the parent editor. */
|
|
448
|
+
this.errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
449
|
+
/** Optional id supplied by the parent editor. */
|
|
450
|
+
this.id = input(undefined, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
451
|
+
/** Host hook: persist a custom input authored against a segment. */
|
|
452
|
+
this.saveCustomInput = input(undefined, ...(ngDevMode ? [{ debugName: "saveCustomInput" }] : /* istanbul ignore next */ []));
|
|
453
|
+
/** Host hook: open the advanced editor for a segment-scoped custom input. */
|
|
454
|
+
this.editSegmentInput = input(undefined, ...(ngDevMode ? [{ debugName: "editSegmentInput" }] : /* istanbul ignore next */ []));
|
|
455
|
+
/** Host hook: delete a segment-scoped custom input. */
|
|
456
|
+
this.deleteSegmentInput = input(undefined, ...(ngDevMode ? [{ debugName: "deleteSegmentInput" }] : /* istanbul ignore next */ []));
|
|
457
|
+
/** Emits the complete MSCOA configuration on every change. */
|
|
458
|
+
this.valueChanged = output();
|
|
459
|
+
/**
|
|
460
|
+
* The configuration being edited: follows the parent `value`, and local
|
|
461
|
+
* patches override it until the parent hands a new value down (autoSave
|
|
462
|
+
* merge-back). `linkedSignal` per the library decision tree — a source the
|
|
463
|
+
* user can override locally.
|
|
464
|
+
*/
|
|
465
|
+
this.config = linkedSignal(() => this.value(), ...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
|
|
466
|
+
/** The chosen basis, or `undefined` before the first choice. */
|
|
467
|
+
this.basis = computed(() => basisOf(this.config()), ...(ngDevMode ? [{ debugName: "basis" }] : /* istanbul ignore next */ []));
|
|
468
|
+
/** Token colour for the summary card's basis badge. */
|
|
469
|
+
this.basisColor = computed(() => basisColorOf(this.config()), ...(ngDevMode ? [{ debugName: "basisColor" }] : /* istanbul ignore next */ []));
|
|
470
|
+
/** Short badge copy for the chosen basis. */
|
|
471
|
+
this.basisBadge = computed(() => {
|
|
472
|
+
const basis = this.basis();
|
|
473
|
+
return basis ? basis.toUpperCase() : '';
|
|
474
|
+
}, ...(ngDevMode ? [{ debugName: "basisBadge" }] : /* istanbul ignore next */ []));
|
|
475
|
+
/** One sentence on what the picker will ask the person filling the form for. */
|
|
476
|
+
this.requirement = computed(() => requirementSentence(this.config()), ...(ngDevMode ? [{ debugName: "requirement" }] : /* istanbul ignore next */ []));
|
|
477
|
+
/**
|
|
478
|
+
* Summary chips: every setup area with its state, minus the basis (the badge
|
|
479
|
+
* above already carries it) — one glance answers "what is configured, what
|
|
480
|
+
* still needs me, and what does not apply here at all".
|
|
481
|
+
*/
|
|
482
|
+
this.summaryChips = computed(() => readinessOf(this.config()).filter((item) => !item.label.startsWith('Basis')), ...(ngDevMode ? [{ debugName: "summaryChips" }] : /* istanbul ignore next */ []));
|
|
483
|
+
/** The open editor dialog, if any — guards against double-opening. */
|
|
484
|
+
this.#dialogRef = null;
|
|
485
|
+
/** Exposed for the template's summary counts. */
|
|
486
|
+
this.segmentCount = computed(() => segmentsOf(this.config()).length, ...(ngDevMode ? [{ debugName: "segmentCount" }] : /* istanbul ignore next */ []));
|
|
487
|
+
this.cashSegmentCount = computed(() => cashSegmentsOf(this.config()).length, ...(ngDevMode ? [{ debugName: "cashSegmentCount" }] : /* istanbul ignore next */ []));
|
|
488
|
+
this.hasCash = computed(() => usesCash(this.basis()), ...(ngDevMode ? [{ debugName: "hasCash" }] : /* istanbul ignore next */ []));
|
|
489
|
+
this.matchMode = computed(() => matchModeOf(this.config()), ...(ngDevMode ? [{ debugName: "matchMode" }] : /* istanbul ignore next */ []));
|
|
490
|
+
/** The account-value label in force, for the summary line. */
|
|
491
|
+
this.accountValueLabel = computed(() => this.config()?.accountValueLabel ?? '', ...(ngDevMode ? [{ debugName: "accountValueLabel" }] : /* istanbul ignore next */ []));
|
|
492
|
+
/** Segment definitions, exposed so the template can show the first few names. */
|
|
493
|
+
this.segmentNames = computed(() => segmentsOf(this.config())
|
|
494
|
+
.map((segment) => segment.label || segment.customSegment || segment.segment || '')
|
|
495
|
+
.filter((name) => name.length > 0), ...(ngDevMode ? [{ debugName: "segmentNames" }] : /* istanbul ignore next */ []));
|
|
496
|
+
this.#destroyRef.onDestroy(() => this.#dialogRef?.close());
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Opens the guided setup dialog. The dialog reads live state through the
|
|
500
|
+
* context's signals and forwards every edit back into this component's patch
|
|
501
|
+
* methods, so the emit semantics match the rows it replaced. Opening while
|
|
502
|
+
* `disabled` is allowed — the hosted editors render read-only, which is how a
|
|
503
|
+
* locked configuration is reviewed.
|
|
504
|
+
*/
|
|
505
|
+
openDialog() {
|
|
506
|
+
if (this.#dialogRef)
|
|
507
|
+
return;
|
|
508
|
+
const context = {
|
|
509
|
+
config: this.config.asReadonly(),
|
|
510
|
+
dataValue: this.dataValue,
|
|
511
|
+
getMscoaTree: this.getMscoaTree,
|
|
512
|
+
formInputs: this.formInputs,
|
|
513
|
+
disabled: this.disabled,
|
|
514
|
+
errors: this.errors,
|
|
515
|
+
saveCustomInput: this.saveCustomInput,
|
|
516
|
+
editSegmentInput: this.editSegmentInput,
|
|
517
|
+
deleteSegmentInput: this.deleteSegmentInput,
|
|
518
|
+
basisChanged: (basis) => this.onBasisChanged(basis),
|
|
519
|
+
accountValueLabelChanged: (label) => this.#patch({ accountValueLabel: label }),
|
|
520
|
+
showAllSegmentsChanged: (showAll) => this.onShowAllSegmentsChanged(showAll),
|
|
521
|
+
segmentsChanged: (segments) => this.#patch({ segments }),
|
|
522
|
+
cashSegmentsChanged: (cashSegments) => this.#patch({ cashSegments }),
|
|
523
|
+
rulesChanged: (rules) => this.onRulesChanged(rules),
|
|
524
|
+
matchModeChanged: (mode) => this.onMatchModeChanged(mode),
|
|
525
|
+
extensionsChanged: (accounts) => this.#patch({ extensionAccountsForSegments: accounts }),
|
|
526
|
+
};
|
|
527
|
+
this.#dialogRef = this.#dialog.open(MscoaConfigDialogComponent, {
|
|
528
|
+
data: context,
|
|
529
|
+
injector: this.#injector,
|
|
530
|
+
width: 'min(1080px, 96vw)',
|
|
531
|
+
maxWidth: '96vw',
|
|
532
|
+
maxHeight: '92vh',
|
|
533
|
+
autoFocus: 'first-tabbable',
|
|
534
|
+
panelClass: 'lib-mscoa-config-dialog-panel',
|
|
535
|
+
});
|
|
536
|
+
this.#dialogRef
|
|
537
|
+
.afterClosed()
|
|
538
|
+
.pipe(takeUntilDestroyed(this.#destroyRef))
|
|
539
|
+
.subscribe(() => (this.#dialogRef = null));
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Applies a basis change, dropping the work that basis invalidates — see
|
|
543
|
+
* {@link configForBasis} for exactly what survives and why.
|
|
544
|
+
*/
|
|
545
|
+
onBasisChanged(basis) {
|
|
546
|
+
const next = configForBasis(this.config(), basis);
|
|
547
|
+
this.config.set(next);
|
|
548
|
+
this.valueChanged.emit(next);
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* The segment sets are authored against the pool this flag selects, so a
|
|
552
|
+
* change to it invalidates both — the same clear the removed toggle row
|
|
553
|
+
* declared through `clearOnChange`. Guarded: turning the flag to the value it
|
|
554
|
+
* already holds clears nothing.
|
|
555
|
+
*/
|
|
556
|
+
onShowAllSegmentsChanged(showAllSegments) {
|
|
557
|
+
if (!!this.config()?.showAllSegments === showAllSegments)
|
|
558
|
+
return;
|
|
559
|
+
this.#patch({ showAllSegments, segments: undefined, cashSegments: undefined });
|
|
560
|
+
}
|
|
561
|
+
/** Writes the cash-exclusion rules, preserving the match mode beside them. */
|
|
562
|
+
onRulesChanged(rules) {
|
|
563
|
+
this.#patch({
|
|
564
|
+
dualCashExclusion: { ...this.config()?.dualCashExclusion, rules },
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
/** Writes the match mode, preserving the rules beside it. */
|
|
568
|
+
onMatchModeChanged(matchMode) {
|
|
569
|
+
this.#patch({
|
|
570
|
+
dualCashExclusion: { ...this.config()?.dualCashExclusion, matchMode },
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
/** Merges a partial change into the configuration and emits the whole object. */
|
|
574
|
+
#patch(partial) {
|
|
575
|
+
const next = { ...(this.config() ?? {}), ...partial };
|
|
576
|
+
this.config.set(next);
|
|
577
|
+
this.valueChanged.emit(next);
|
|
578
|
+
}
|
|
579
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MscoaConfigComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
580
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: MscoaConfigComponent, isStandalone: true, selector: "lib-mscoa-config", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, dataValue: { classPropertyName: "dataValue", publicName: "dataValue", isSignal: true, isRequired: false, transformFunction: null }, getMscoaTree: { classPropertyName: "getMscoaTree", publicName: "getMscoaTree", isSignal: true, isRequired: false, transformFunction: null }, formInputs: { classPropertyName: "formInputs", publicName: "formInputs", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, 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: { classAttribute: "lib-mscoa-config" }, ngImport: i0, template: "<div class=\"mcc\">\n @if (!basis()) {\n <!-- INVITE \u2014 nothing configured yet; the dialog is where setup happens. -->\n <div class=\"mcc-invite\">\n <lib-empty-state\n icon=\"account_tree\"\n message=\"This account picker is not set up yet. Choose an accounting basis, pick the SCOA segments the user selects from, and set the rules \u2014 all in one guided setup.\" />\n <button mat-flat-button class=\"mcc-invite__cta\" [disabled]=\"disabled()\" (click)=\"openDialog()\">\n <mat-icon aria-hidden=\"true\">account_tree</mat-icon>\n Set up MSCOA accounts\n </button>\n </div>\n } @else {\n <!-- SUMMARY \u2014 what is configured, at a glance; editing happens in the dialog. -->\n <div class=\"mcc-summary\">\n <div class=\"mcc-summary__head\">\n <span class=\"mcc-summary__basis\" [style.color]=\"basisColor()\">{{ basisBadge() }}</span>\n <div class=\"mcc-summary__id\">\n <p class=\"mcc-summary__segments\">\n {{ segmentCount() }} accrual segment{{ segmentCount() === 1 ? '' : 's' }}@if (hasCash()) {,\n {{ cashSegmentCount() }} cash }\n </p>\n @if (segmentNames().length) {\n <p class=\"mcc-summary__names\" [matTooltip]=\"segmentNames().join(', ')\">\n {{ segmentNames().join(' \u00B7 ') }}\n </p>\n }\n </div>\n </div>\n\n <div class=\"mcc__chips\">\n @for (item of summaryChips(); track item.label) {\n <span class=\"mcc__chip\" [attr.data-state]=\"item.state\">\n <!-- Glyph + colour + border style: state is never colour-only. -->\n {{ item.state === 'done' ? '\u2713 ' : item.state === 'pending' ? '\u2022 ' : '' }}{{ item.label }}\n </span>\n }\n </div>\n\n <p class=\"mcc__requirement\">{{ requirement() }}</p>\n\n @if (accountValueLabel()) {\n <p class=\"mcc__meta\">Accounts shown by <strong>{{ accountValueLabel() }}</strong></p>\n }\n\n <div class=\"mcc-summary__actions\">\n <button mat-flat-button (click)=\"openDialog()\">\n <mat-icon aria-hidden=\"true\">tune</mat-icon>\n {{ disabled() ? 'View setup' : 'Configure' }}\n </button>\n </div>\n </div>\n }\n\n <lib-error-list [errors]=\"errors() || []\" />\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block}.mcc{display:flex;flex-direction:column;gap:1.5rem}.mcc-invite{display:flex;flex-direction:column;align-items:flex-start;gap:1.5rem}.mcc-invite__cta{align-self:stretch}.mcc-summary{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;border-radius:var(--lib-forms-radius, .75rem);background:var(--lib-forms-surface-raised, transparent)}.mcc-summary__head{display:flex;align-items:baseline;gap:.75rem}.mcc-summary__basis{flex:0 0 auto;font-size:.5625rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.mcc-summary__id{min-width:0;flex:1 1 auto}.mcc-summary__segments{margin:0;font-size:.9375rem;color:var(--lib-forms-text, currentColor)}.mcc-summary__names{margin:.5rem 0 0;font-size:.8125rem;color:var(--lib-forms-text-muted, currentColor);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mcc__chips{display:flex;flex-wrap:wrap;gap:.5rem}.mcc__chip{display:inline-flex;align-items:center;padding:.375rem .75rem;border-radius:1rem;border:1px solid var(--lib-forms-border, transparent);font-size:.75rem;color:var(--lib-forms-text-muted, currentColor)}.mcc__chip[data-state=done]{border-color:var(--sem-emerald, currentColor);color:var(--sem-emerald, currentColor)}.mcc__chip[data-state=pending]{border-style:dashed;border-color:var(--sem-amber, currentColor);color:var(--sem-amber, currentColor)}.mcc__requirement{margin:0;font-size:.8125rem;line-height:1.6;color:var(--lib-forms-text, currentColor)}.mcc__meta{margin:0;font-size:.75rem;color:var(--lib-forms-text-muted, currentColor)}.mcc__meta strong{font-weight:600}.mcc-summary__actions{display:flex;gap:.75rem}\n"], dependencies: [{ kind: "component", type: EmptyStateComponent, selector: "lib-empty-state", inputs: ["icon", "message"] }, { kind: "component", type: ErrorListComponent, selector: "lib-error-list", inputs: ["errors"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
581
|
+
}
|
|
582
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MscoaConfigComponent, decorators: [{
|
|
583
|
+
type: Component,
|
|
584
|
+
args: [{ selector: 'lib-mscoa-config', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: { class: 'lib-mscoa-config' }, imports: [
|
|
585
|
+
EmptyStateComponent,
|
|
586
|
+
ErrorListComponent,
|
|
587
|
+
MatButtonModule,
|
|
588
|
+
MatIconModule,
|
|
589
|
+
MatTooltipModule,
|
|
590
|
+
], template: "<div class=\"mcc\">\n @if (!basis()) {\n <!-- INVITE \u2014 nothing configured yet; the dialog is where setup happens. -->\n <div class=\"mcc-invite\">\n <lib-empty-state\n icon=\"account_tree\"\n message=\"This account picker is not set up yet. Choose an accounting basis, pick the SCOA segments the user selects from, and set the rules \u2014 all in one guided setup.\" />\n <button mat-flat-button class=\"mcc-invite__cta\" [disabled]=\"disabled()\" (click)=\"openDialog()\">\n <mat-icon aria-hidden=\"true\">account_tree</mat-icon>\n Set up MSCOA accounts\n </button>\n </div>\n } @else {\n <!-- SUMMARY \u2014 what is configured, at a glance; editing happens in the dialog. -->\n <div class=\"mcc-summary\">\n <div class=\"mcc-summary__head\">\n <span class=\"mcc-summary__basis\" [style.color]=\"basisColor()\">{{ basisBadge() }}</span>\n <div class=\"mcc-summary__id\">\n <p class=\"mcc-summary__segments\">\n {{ segmentCount() }} accrual segment{{ segmentCount() === 1 ? '' : 's' }}@if (hasCash()) {,\n {{ cashSegmentCount() }} cash }\n </p>\n @if (segmentNames().length) {\n <p class=\"mcc-summary__names\" [matTooltip]=\"segmentNames().join(', ')\">\n {{ segmentNames().join(' \u00B7 ') }}\n </p>\n }\n </div>\n </div>\n\n <div class=\"mcc__chips\">\n @for (item of summaryChips(); track item.label) {\n <span class=\"mcc__chip\" [attr.data-state]=\"item.state\">\n <!-- Glyph + colour + border style: state is never colour-only. -->\n {{ item.state === 'done' ? '\u2713 ' : item.state === 'pending' ? '\u2022 ' : '' }}{{ item.label }}\n </span>\n }\n </div>\n\n <p class=\"mcc__requirement\">{{ requirement() }}</p>\n\n @if (accountValueLabel()) {\n <p class=\"mcc__meta\">Accounts shown by <strong>{{ accountValueLabel() }}</strong></p>\n }\n\n <div class=\"mcc-summary__actions\">\n <button mat-flat-button (click)=\"openDialog()\">\n <mat-icon aria-hidden=\"true\">tune</mat-icon>\n {{ disabled() ? 'View setup' : 'Configure' }}\n </button>\n </div>\n </div>\n }\n\n <lib-error-list [errors]=\"errors() || []\" />\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block}.mcc{display:flex;flex-direction:column;gap:1.5rem}.mcc-invite{display:flex;flex-direction:column;align-items:flex-start;gap:1.5rem}.mcc-invite__cta{align-self:stretch}.mcc-summary{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;border-radius:var(--lib-forms-radius, .75rem);background:var(--lib-forms-surface-raised, transparent)}.mcc-summary__head{display:flex;align-items:baseline;gap:.75rem}.mcc-summary__basis{flex:0 0 auto;font-size:.5625rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.mcc-summary__id{min-width:0;flex:1 1 auto}.mcc-summary__segments{margin:0;font-size:.9375rem;color:var(--lib-forms-text, currentColor)}.mcc-summary__names{margin:.5rem 0 0;font-size:.8125rem;color:var(--lib-forms-text-muted, currentColor);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mcc__chips{display:flex;flex-wrap:wrap;gap:.5rem}.mcc__chip{display:inline-flex;align-items:center;padding:.375rem .75rem;border-radius:1rem;border:1px solid var(--lib-forms-border, transparent);font-size:.75rem;color:var(--lib-forms-text-muted, currentColor)}.mcc__chip[data-state=done]{border-color:var(--sem-emerald, currentColor);color:var(--sem-emerald, currentColor)}.mcc__chip[data-state=pending]{border-style:dashed;border-color:var(--sem-amber, currentColor);color:var(--sem-amber, currentColor)}.mcc__requirement{margin:0;font-size:.8125rem;line-height:1.6;color:var(--lib-forms-text, currentColor)}.mcc__meta{margin:0;font-size:.75rem;color:var(--lib-forms-text-muted, currentColor)}.mcc__meta strong{font-weight:600}.mcc-summary__actions{display:flex;gap:.75rem}\n"] }]
|
|
591
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], dataValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataValue", required: false }] }], getMscoaTree: [{ type: i0.Input, args: [{ isSignal: true, alias: "getMscoaTree", required: false }] }], formInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "formInputs", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], 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"] }] } });
|
|
592
|
+
|
|
593
|
+
export { MscoaConfigComponent };
|
|
594
|
+
//# sourceMappingURL=ngx-t-forms-mscoa-config.component-B9G_WlEc.mjs.map
|