ngx-t-forms 3.1.8 → 3.1.9
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-B4a-L4Eq.mjs → ngx-t-forms-api-endpoint-config.component-BbS1dY0l.mjs} +10 -10
- package/fesm2022/ngx-t-forms-api-endpoint-config.component-BbS1dY0l.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-DqRunUz4.mjs → ngx-t-forms-auto-complete-input-element.component-B8eluIrh.mjs} +8 -8
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-DqRunUz4.mjs.map → ngx-t-forms-auto-complete-input-element.component-B8eluIrh.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-autofillToken-D-BYfzxR.mjs +189 -0
- package/fesm2022/ngx-t-forms-autofillToken-D-BYfzxR.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-t8bTUgZ1.mjs → ngx-t-forms-basic-input-input-element.component-SSLXyCz9.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-t8bTUgZ1.mjs.map → ngx-t-forms-basic-input-input-element.component-SSLXyCz9.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-PcjMdAKu.mjs → ngx-t-forms-calculated-field-rules.component-Cn_rxXMX.mjs} +7 -7
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-PcjMdAKu.mjs.map → ngx-t-forms-calculated-field-rules.component-Cn_rxXMX.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-Ca4rim_J.mjs → ngx-t-forms-chip-options-creator-editor.component-CGm5tgsp.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-Ca4rim_J.mjs.map → ngx-t-forms-chip-options-creator-editor.component-CGm5tgsp.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-clamp-probe.directive-DMUdeVrM.mjs +99 -0
- package/fesm2022/ngx-t-forms-clamp-probe.directive-DMUdeVrM.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-conditional-display-config.component-Di7p76_n.mjs → ngx-t-forms-conditional-display-config.component-DIMIWTKj.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-conditional-display-config.component-Di7p76_n.mjs.map → ngx-t-forms-conditional-display-config.component-DIMIWTKj.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CXMmDwKS.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-DKb3E9gA.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CXMmDwKS.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-DKb3E9gA.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-data-source-picker.component-DioXvLi3.mjs → ngx-t-forms-data-source-picker.component-BG_sr5VH.mjs} +8 -8
- package/fesm2022/{ngx-t-forms-data-source-picker.component-DioXvLi3.mjs.map → ngx-t-forms-data-source-picker.component-BG_sr5VH.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-h0S6qZDT.mjs → ngx-t-forms-date-picker-input-element.component-vUlUuzJ0.mjs} +8 -8
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-h0S6qZDT.mjs.map → ngx-t-forms-date-picker-input-element.component-vUlUuzJ0.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-date-range-picker-input-element.component-8c1ErbgP.mjs → ngx-t-forms-date-range-picker-input-element.component-YVE_s-7Y.mjs} +5 -5
- package/fesm2022/{ngx-t-forms-date-range-picker-input-element.component-8c1ErbgP.mjs.map → ngx-t-forms-date-range-picker-input-element.component-YVE_s-7Y.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-date-time-picker-input-element.component-BgjGlXeq.mjs → ngx-t-forms-date-time-picker-input-element.component-BlOS8NdF.mjs} +8 -8
- package/fesm2022/{ngx-t-forms-date-time-picker-input-element.component-BgjGlXeq.mjs.map → ngx-t-forms-date-time-picker-input-element.component-BlOS8NdF.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-u2UUPdAo.mjs +623 -0
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-u2UUPdAo.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-document-picker.component-DYpsBHxT.mjs → ngx-t-forms-document-picker.component-DOYyRgh4.mjs} +41 -11
- package/fesm2022/{ngx-t-forms-document-picker.component-DYpsBHxT.mjs.map → ngx-t-forms-document-picker.component-DOYyRgh4.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-editor-input-element.component-CzNSb79n.mjs → ngx-t-forms-editor-input-element.component-BvZPNjQX.mjs} +5 -5
- package/fesm2022/{ngx-t-forms-editor-input-element.component-CzNSb79n.mjs.map → ngx-t-forms-editor-input-element.component-BvZPNjQX.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-FPxHxAwF.mjs → ngx-t-forms-file-upload-input-element.component-CONELqoi.mjs} +8 -8
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-FPxHxAwF.mjs.map → ngx-t-forms-file-upload-input-element.component-CONELqoi.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-form-copy-lint.component-TCSe-27-.mjs +248 -0
- package/fesm2022/ngx-t-forms-form-copy-lint.component-TCSe-27-.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-form-input-selector.component-B3ES53R-.mjs → ngx-t-forms-form-input-selector.component-Bdkuzw0R.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-input-selector.component-B3ES53R-.mjs.map → ngx-t-forms-form-input-selector.component-Bdkuzw0R.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-json-view.component-Cu_ZEw1V.mjs → ngx-t-forms-form-json-view.component-CDcbgWgN.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-json-view.component-Cu_ZEw1V.mjs.map → ngx-t-forms-form-json-view.component-CDcbgWgN.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-DmTGnRgi.mjs → ngx-t-forms-form-section-stepper.component-CqLSI8zP.mjs} +7 -7
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-DmTGnRgi.mjs.map → ngx-t-forms-form-section-stepper.component-CqLSI8zP.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-6m2BM9e9.mjs → ngx-t-forms-forms-builder-menu.component-DFCVe_Fq.mjs} +185 -15
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-DFCVe_Fq.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-forms-native-date-adapter-CCJT5ep1.mjs → ngx-t-forms-forms-native-date-adapter-h6fClNMS.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-forms-native-date-adapter-CCJT5ep1.mjs.map → ngx-t-forms-forms-native-date-adapter-h6fClNMS.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-geo-location.component-DgXSaH0t.mjs → ngx-t-forms-geo-location.component-DA3ATrvw.mjs} +7 -7
- package/fesm2022/{ngx-t-forms-geo-location.component-DgXSaH0t.mjs.map → ngx-t-forms-geo-location.component-DA3ATrvw.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-header-template-editor.component-NJLm6jkA.mjs → ngx-t-forms-header-template-editor.component-B9Cj8dOI.mjs} +13 -5
- package/fesm2022/ngx-t-forms-header-template-editor.component-B9Cj8dOI.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-iqPS9cPK.mjs → ngx-t-forms-image-capture-input-element.component-C9oz_ZjA.mjs} +7 -7
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-iqPS9cPK.mjs.map → ngx-t-forms-image-capture-input-element.component-C9oz_ZjA.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-index-CSXX8RTm.mjs +2 -0
- package/fesm2022/ngx-t-forms-index-CSXX8RTm.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-input-custom.component-BOy_3JqU.mjs → ngx-t-forms-input-custom.component-CqIr5wpy.mjs} +91 -25
- package/fesm2022/ngx-t-forms-input-custom.component-CqIr5wpy.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-input-editor.component-IUrZNmA5.mjs → ngx-t-forms-input-editor.component-DU2sgo4i.mjs} +9 -9
- package/fesm2022/{ngx-t-forms-input-editor.component-IUrZNmA5.mjs.map → ngx-t-forms-input-editor.component-DU2sgo4i.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-CtTAw9jk.mjs → ngx-t-forms-map-mat-options-keys-WfFq_0tS.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-CtTAw9jk.mjs.map → ngx-t-forms-map-mat-options-keys-WfFq_0tS.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-C9bxVpQ1.mjs → ngx-t-forms-mat-chip-list-editor.component-CKnvqeix.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-C9bxVpQ1.mjs.map → ngx-t-forms-mat-chip-list-editor.component-CKnvqeix.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-BpiCchqY.mjs → ngx-t-forms-missing-form-configs.component-B5dDbmpj.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-BpiCchqY.mjs.map → ngx-t-forms-missing-form-configs.component-B5dDbmpj.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-97tHCSyK.mjs +37 -0
- package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-97tHCSyK.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-mscoa-config.component-soUwIbVA.mjs → ngx-t-forms-mscoa-config.component-BtLd7F2n.mjs} +10 -10
- package/fesm2022/{ngx-t-forms-mscoa-config.component-soUwIbVA.mjs.map → ngx-t-forms-mscoa-config.component-BtLd7F2n.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-error-display.component-BDPi6w2E.mjs → ngx-t-forms-mscoa-error-display.component-Bmt1vboD.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-mscoa-error-display.component-BDPi6w2E.mjs.map → ngx-t-forms-mscoa-error-display.component-Bmt1vboD.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component--3DvQm1K.mjs → ngx-t-forms-mscoa-segment-config.component-DrzpixbK.mjs} +9 -9
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component--3DvQm1K.mjs.map → ngx-t-forms-mscoa-segment-config.component-DrzpixbK.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-temporary-hint.component-g7DosiVb.mjs → ngx-t-forms-mscoa-temporary-hint.component-B1Z-IXSL.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-mscoa-temporary-hint.component-g7DosiVb.mjs.map → ngx-t-forms-mscoa-temporary-hint.component-B1Z-IXSL.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-ddpips7E.mjs +3592 -0
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-ddpips7E.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-ngx-t-forms-CaVyRedJ.mjs → ngx-t-forms-ngx-t-forms-C1kZpYIM.mjs} +9303 -2202
- package/fesm2022/ngx-t-forms-ngx-t-forms-C1kZpYIM.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-paginated-selection-table-B7TyhJnh.mjs +596 -0
- package/fesm2022/ngx-t-forms-paginated-selection-table-B7TyhJnh.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-payload-template-editor.component-CVj-G4MC.mjs → ngx-t-forms-payload-template-editor.component-DVL4aBuG.mjs} +13 -5
- package/fesm2022/ngx-t-forms-payload-template-editor.component-DVL4aBuG.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-BMyZKOXv.mjs → ngx-t-forms-pipeline-generator.component-DpqipW6G.mjs} +15 -15
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-BMyZKOXv.mjs.map → ngx-t-forms-pipeline-generator.component-DpqipW6G.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-quill-input.component-oUnmMDGi.mjs → ngx-t-forms-quill-input.component-x9CHGOJy.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-quill-input.component-oUnmMDGi.mjs.map → ngx-t-forms-quill-input.component-x9CHGOJy.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-record-list-manager.component-CdQU6loA.mjs → ngx-t-forms-record-list-manager.component-BGg86NER.mjs} +7 -7
- package/fesm2022/{ngx-t-forms-record-list-manager.component-CdQU6loA.mjs.map → ngx-t-forms-record-list-manager.component-BGg86NER.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-required-inputs.component-CI9nLVXe.mjs +281 -0
- package/fesm2022/ngx-t-forms-required-inputs.component-CI9nLVXe.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-B5w1Lvfo.mjs → ngx-t-forms-rest-api-call-setup.component-B4LzPwxg.mjs} +5 -5
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-B5w1Lvfo.mjs.map → ngx-t-forms-rest-api-call-setup.component-B4LzPwxg.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-section-report.component-CocLNrN5.mjs → ngx-t-forms-section-report.component-BS2CV_xl.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-section-report.component-CocLNrN5.mjs.map → ngx-t-forms-section-report.component-BS2CV_xl.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-select-input-element.component-C5qjqCXW.mjs +281 -0
- package/fesm2022/ngx-t-forms-select-input-element.component-C5qjqCXW.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-CBdC0WCz.mjs → ngx-t-forms-selection-options-editor.component-B6sYvtcj.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-CBdC0WCz.mjs.map → ngx-t-forms-selection-options-editor.component-B6sYvtcj.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-t-workflow-picker.component-D0ttyEex.mjs → ngx-t-forms-t-workflow-picker.component-xDbl63v1.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-t-workflow-picker.component-D0ttyEex.mjs.map → ngx-t-forms-t-workflow-picker.component-xDbl63v1.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-GXiLEsTp.mjs → ngx-t-forms-textarea-input-element.component-ri0r0ujE.mjs} +77 -11
- package/fesm2022/ngx-t-forms-textarea-input-element.component-ri0r0ujE.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-toggle-input-element.component-CXUqCipx.mjs +124 -0
- package/fesm2022/ngx-t-forms-toggle-input-element.component-CXUqCipx.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-token-text-input.component-BMzPBtY_.mjs → ngx-t-forms-token-text-input.component-BWmoGQfi.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-token-text-input.component-BMzPBtY_.mjs.map → ngx-t-forms-token-text-input.component-BWmoGQfi.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-validators-config.component-DWDBsV6a.mjs → ngx-t-forms-validators-config.component-DEm9M5s9.mjs} +5 -5
- package/fesm2022/{ngx-t-forms-validators-config.component-DWDBsV6a.mjs.map → ngx-t-forms-validators-config.component-DEm9M5s9.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-workflow-adjudication.component-DxObFakZ.mjs → ngx-t-forms-workflow-adjudication.component-BOC9Z40E.mjs} +28 -26
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-BOC9Z40E.mjs.map +1 -0
- package/fesm2022/ngx-t-forms.mjs +1 -1
- package/package.json +2 -2
- package/types/ngx-t-forms.d.ts +2370 -38
- package/fesm2022/ngx-t-forms-api-endpoint-config.component-B4a-L4Eq.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-BhVM8PFR.mjs +0 -373
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-BhVM8PFR.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-6m2BM9e9.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-header-template-editor.component-NJLm6jkA.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-index-zLon09cE.mjs +0 -2
- package/fesm2022/ngx-t-forms-index-zLon09cE.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-input-custom.component-BOy_3JqU.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-CjUf0zTA.mjs +0 -38
- package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-CjUf0zTA.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-BZxpJRxJ.mjs +0 -2472
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-BZxpJRxJ.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-CaVyRedJ.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-paginated-selection-table-DzZE-Zde.mjs +0 -557
- package/fesm2022/ngx-t-forms-paginated-selection-table-DzZE-Zde.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-payload-template-editor.component-CVj-G4MC.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-required-inputs.component-BtfEsmva.mjs +0 -271
- package/fesm2022/ngx-t-forms-required-inputs.component-BtfEsmva.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-select-input-element.component-B03O4cAK.mjs +0 -160
- package/fesm2022/ngx-t-forms-select-input-element.component-B03O4cAK.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-textarea-input-element.component-GXiLEsTp.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-toggle-input-element.component-WErP0SsA.mjs +0 -93
- package/fesm2022/ngx-t-forms-toggle-input-element.component-WErP0SsA.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-DxObFakZ.mjs.map +0 -1
|
@@ -0,0 +1,623 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, output, signal, computed, DestroyRef, Input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
+
import { NgControl } from '@angular/forms';
|
|
5
|
+
import * as i5$1 from '@angular/material/autocomplete';
|
|
6
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
7
|
+
import * as i1$1 from '@angular/material/button';
|
|
8
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
9
|
+
import * as i3$1 from '@angular/material/card';
|
|
10
|
+
import { MatCardModule } from '@angular/material/card';
|
|
11
|
+
import { MatFormFieldModule, MatFormFieldControl } from '@angular/material/form-field';
|
|
12
|
+
import * as i3 from '@angular/material/icon';
|
|
13
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
14
|
+
import { MatInputModule } from '@angular/material/input';
|
|
15
|
+
import * as i6 from '@angular/material/list';
|
|
16
|
+
import { MatListModule } from '@angular/material/list';
|
|
17
|
+
import * as i5 from '@angular/material/tooltip';
|
|
18
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
19
|
+
import * as i1 from '@angular/cdk/clipboard';
|
|
20
|
+
import { ClipboardModule } from '@angular/cdk/clipboard';
|
|
21
|
+
import { CdkDropList, CdkDrag } from '@angular/cdk/drag-drop';
|
|
22
|
+
import { Subject, debounceTime, map, distinctUntilChanged, switchMap, defer, catchError, of } from 'rxjs';
|
|
23
|
+
import { ReportTypes, DocumentLitsLabelConfigInterfaceValueType, InputDataTypes, InputTypes, InputPipeTypes, ElementTypes } from 'ngx-t-forms-types';
|
|
24
|
+
import { MatChipListEditorComponent } from './ngx-t-forms-mat-chip-list-editor.component-CKnvqeix.mjs';
|
|
25
|
+
import { MatSliderToggleEditorComponent } from './ngx-t-forms-mat-slider-toggle-editor.component-DX8L0O1k.mjs';
|
|
26
|
+
import { R as REPORT_PLAN_PREVIEW, E as EmptyStateComponent } from './ngx-t-forms-ngx-t-forms-C1kZpYIM.mjs';
|
|
27
|
+
import * as i5$2 from '@angular/material/select';
|
|
28
|
+
|
|
29
|
+
/** Quiet period before a configuration change is sent to the host's planner. */
|
|
30
|
+
const PREVIEW_DEBOUNCE_MS = 400;
|
|
31
|
+
const MEASURE_REPORT_TYPES = [
|
|
32
|
+
ReportTypes.Avg,
|
|
33
|
+
ReportTypes.Sum,
|
|
34
|
+
ReportTypes.Median,
|
|
35
|
+
ReportTypes.Lowest,
|
|
36
|
+
ReportTypes.Highest,
|
|
37
|
+
];
|
|
38
|
+
/**
|
|
39
|
+
* Report types offered per value type, in display order. The set decides the
|
|
40
|
+
* field's report role (measure / dimension / entity / time), so a type is only
|
|
41
|
+
* offered where the report engine can honour it.
|
|
42
|
+
*/
|
|
43
|
+
const REPORT_TYPES_BY_VALUE_TYPE = {
|
|
44
|
+
[DocumentLitsLabelConfigInterfaceValueType.currency]: MEASURE_REPORT_TYPES,
|
|
45
|
+
[DocumentLitsLabelConfigInterfaceValueType.number]: MEASURE_REPORT_TYPES,
|
|
46
|
+
[DocumentLitsLabelConfigInterfaceValueType.string]: [ReportTypes.Category, ReportTypes.Distinct],
|
|
47
|
+
[DocumentLitsLabelConfigInterfaceValueType.systemReference]: [ReportTypes.Distinct],
|
|
48
|
+
[DocumentLitsLabelConfigInterfaceValueType.boolean]: [ReportTypes.Category],
|
|
49
|
+
[DocumentLitsLabelConfigInterfaceValueType.date]: [ReportTypes.Trend],
|
|
50
|
+
[DocumentLitsLabelConfigInterfaceValueType.daysAgo]: [ReportTypes.Trend],
|
|
51
|
+
};
|
|
52
|
+
/** Plain-language meaning of each report type, for admins who are not analysts. */
|
|
53
|
+
const REPORT_TYPE_DESCRIPTIONS = {
|
|
54
|
+
[ReportTypes.Avg]: 'Average — the mean value',
|
|
55
|
+
[ReportTypes.Sum]: 'Sum — the total across transactions',
|
|
56
|
+
[ReportTypes.Median]: 'Median — middle value, robust to one huge claim',
|
|
57
|
+
[ReportTypes.Lowest]: 'Lowest — the smallest value',
|
|
58
|
+
[ReportTypes.Highest]: 'Highest — the largest value',
|
|
59
|
+
[ReportTypes.Category]: 'Category — share and breakdown by each value',
|
|
60
|
+
[ReportTypes.Distinct]: 'Distinct — count unique values (suppliers, customers)',
|
|
61
|
+
[ReportTypes.Trend]: 'Trend — use this date as a time axis',
|
|
62
|
+
};
|
|
63
|
+
/** Direction options; the empty value leaves polarity unset (the engine then never judges direction). */
|
|
64
|
+
const POLARITY_OPTIONS = [
|
|
65
|
+
{ value: '', label: 'Not set' },
|
|
66
|
+
{ value: 'higherIsBetter', label: 'Higher is better' },
|
|
67
|
+
{ value: 'lowerIsBetter', label: 'Lower is better' },
|
|
68
|
+
{ value: 'neutral', label: 'Neutral' },
|
|
69
|
+
];
|
|
70
|
+
/** Whether a value type is reported as a measure (summed / averaged). */
|
|
71
|
+
function isMeasureValueType(valueType) {
|
|
72
|
+
return (valueType === DocumentLitsLabelConfigInterfaceValueType.currency ||
|
|
73
|
+
valueType === DocumentLitsLabelConfigInterfaceValueType.number);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Parses the bands text (`100000, 500000`) into ascending, de-duplicated,
|
|
77
|
+
* positive finite numbers. Spaces inside a number are thousands separators.
|
|
78
|
+
* Blank text is `[]` (clear the bands); any unreadable entry makes it `null`.
|
|
79
|
+
*/
|
|
80
|
+
function parseBands(text) {
|
|
81
|
+
const parts = text
|
|
82
|
+
.split(/[,;]/)
|
|
83
|
+
.map((part) => part.replace(/[\s_]/g, ''))
|
|
84
|
+
.filter((part) => part.length > 0);
|
|
85
|
+
const values = [];
|
|
86
|
+
for (const part of parts) {
|
|
87
|
+
const value = Number(part);
|
|
88
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
values.push(value);
|
|
92
|
+
}
|
|
93
|
+
return [...new Set(values)].sort((a, b) => a - b);
|
|
94
|
+
}
|
|
95
|
+
/** Drops unset hints; `undefined` when nothing is left, so no empty object is stored. */
|
|
96
|
+
function compactHints(hints) {
|
|
97
|
+
const compact = {};
|
|
98
|
+
if (hints?.primary) {
|
|
99
|
+
compact.primary = true;
|
|
100
|
+
}
|
|
101
|
+
if (hints?.polarity) {
|
|
102
|
+
compact.polarity = hints.polarity;
|
|
103
|
+
}
|
|
104
|
+
if (hints?.bands?.length) {
|
|
105
|
+
compact.bands = [...hints.bands];
|
|
106
|
+
}
|
|
107
|
+
return Object.keys(compact).length > 0 ? compact : undefined;
|
|
108
|
+
}
|
|
109
|
+
/** Returns the draft with `reportHints` replaced, or the key removed when no hint is set. */
|
|
110
|
+
function withReportHints(draft, hints) {
|
|
111
|
+
const next = { ...draft };
|
|
112
|
+
delete next.reportHints;
|
|
113
|
+
const compact = compactHints(hints);
|
|
114
|
+
if (compact) {
|
|
115
|
+
next.reportHints = compact;
|
|
116
|
+
}
|
|
117
|
+
return next;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Removes hints the draft's value type cannot use (e.g. bands left over after
|
|
121
|
+
* switching a number column to text) and all hints once no report type is set.
|
|
122
|
+
*/
|
|
123
|
+
function pruneReportHints(draft) {
|
|
124
|
+
if (!draft.reportHints) {
|
|
125
|
+
return draft;
|
|
126
|
+
}
|
|
127
|
+
if (!draft.reportType?.length) {
|
|
128
|
+
return withReportHints(draft, undefined);
|
|
129
|
+
}
|
|
130
|
+
const measure = isMeasureValueType(draft.valueType);
|
|
131
|
+
const polarityApplies = measure || draft.valueType === DocumentLitsLabelConfigInterfaceValueType.boolean;
|
|
132
|
+
return withReportHints(draft, {
|
|
133
|
+
primary: draft.reportHints.primary,
|
|
134
|
+
polarity: polarityApplies ? draft.reportHints.polarity : undefined,
|
|
135
|
+
bands: measure ? draft.reportHints.bands : undefined,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/** `1 KPI`, `4 KPIs`. */
|
|
139
|
+
function countOf(count, noun) {
|
|
140
|
+
return `${count} ${noun}${count === 1 ? '' : 's'}`;
|
|
141
|
+
}
|
|
142
|
+
/** Title-cases an enum key: `daysAgo` → `Days Ago`. */
|
|
143
|
+
function humaniseKey(key) {
|
|
144
|
+
return key
|
|
145
|
+
.replace(/([A-Z])/g, ' $1')
|
|
146
|
+
.trim()
|
|
147
|
+
.toLowerCase()
|
|
148
|
+
.replace(/^\w/, (c) => c.toUpperCase());
|
|
149
|
+
}
|
|
150
|
+
/** Derives a readable label from a camelCase control name: `taxRate` → `tax Rate`. */
|
|
151
|
+
function controlNameToLabel(name) {
|
|
152
|
+
return name
|
|
153
|
+
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
154
|
+
.replace(/([A-Z])([A-Z][a-z])/g, '$1 $2');
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Document-list label-configuration editor: builds the ordered list of column
|
|
158
|
+
* label definitions (`DocumentLitsLabelConfigInterface[]`) used to render a
|
|
159
|
+
* document list. Columns can be added, edited inline, removed, and reordered by
|
|
160
|
+
* drag-and-drop.
|
|
161
|
+
*
|
|
162
|
+
* A column marked reportable (at least one report type) also takes optional
|
|
163
|
+
* report hints — primary, direction and value bands. When the host binds
|
|
164
|
+
* {@link REPORT_PLAN_PREVIEW}, a polite live line under the list says what the
|
|
165
|
+
* configuration (including the draft in edit) will produce.
|
|
166
|
+
*
|
|
167
|
+
* Implements `MatFormFieldControl<DocumentLitsLabelConfigInterface[]>`, so it
|
|
168
|
+
* renders inside the parent's `<mat-form-field>` — `t-dynamic-data-edit` owns
|
|
169
|
+
* the field label, hint, and validation errors; this component owns only the
|
|
170
|
+
* column list and the add/edit form.
|
|
171
|
+
*
|
|
172
|
+
* NOTE: `MatFormFieldControl<T>` mandates plain mutable `value` / `disabled` /
|
|
173
|
+
* `required` / `placeholder` / `id` members, `@Input()` decorators, the
|
|
174
|
+
* `focused` / `touched` / `stateChanges` members, and the `useExisting`
|
|
175
|
+
* provider. These are framework wiring, not defects — the CLAUDE.md bans on
|
|
176
|
+
* `@Input()` / `useExisting` do not apply to MatFormFieldControl integration.
|
|
177
|
+
* Genuinely-internal state (the in-edit draft, derived option lists) uses
|
|
178
|
+
* `signal()` / `computed()`.
|
|
179
|
+
*/
|
|
180
|
+
class DocumentListLabelConfigEditorComponent {
|
|
181
|
+
static { this.nextId = 0; }
|
|
182
|
+
#value;
|
|
183
|
+
/** Signal mirror of `#value`, so the plan preview reacts to list changes. */
|
|
184
|
+
#valueState;
|
|
185
|
+
/** Current column configuration list. */
|
|
186
|
+
get value() {
|
|
187
|
+
return this.#value;
|
|
188
|
+
}
|
|
189
|
+
set value(value) {
|
|
190
|
+
// Coerce to an array: the parent pipeline substitutes '' for an unset
|
|
191
|
+
// deep-bound value, and a non-array here would break `.length`, the `@for`,
|
|
192
|
+
// and the commit helpers. Mirrors `record-list-manager`'s value setter.
|
|
193
|
+
this.#value = Array.isArray(value) ? value : [];
|
|
194
|
+
this.#valueState.set(this.#value);
|
|
195
|
+
this.stateChanges.next();
|
|
196
|
+
}
|
|
197
|
+
#disabled;
|
|
198
|
+
/** Whether the editor is inert. */
|
|
199
|
+
get disabled() {
|
|
200
|
+
return this.#disabled;
|
|
201
|
+
}
|
|
202
|
+
set disabled(value) {
|
|
203
|
+
this.#disabled = value;
|
|
204
|
+
this.stateChanges.next();
|
|
205
|
+
}
|
|
206
|
+
#required;
|
|
207
|
+
/** Whether at least one column is required. */
|
|
208
|
+
get required() {
|
|
209
|
+
return this.#required;
|
|
210
|
+
}
|
|
211
|
+
set required(value) {
|
|
212
|
+
this.#required = value;
|
|
213
|
+
this.stateChanges.next();
|
|
214
|
+
}
|
|
215
|
+
// ---- plan preview -------------------------------------------------------
|
|
216
|
+
#destroyRef;
|
|
217
|
+
#planPreview;
|
|
218
|
+
/**
|
|
219
|
+
* The configuration the preview plans: the committed list with the draft in
|
|
220
|
+
* edit merged in (replacing its column, or appended), so hints show their
|
|
221
|
+
* effect before the admin saves.
|
|
222
|
+
*/
|
|
223
|
+
#previewConfiguration;
|
|
224
|
+
constructor() {
|
|
225
|
+
/** Emits whenever a piece of `MatFormFieldControl` state changes. */
|
|
226
|
+
this.stateChanges = new Subject();
|
|
227
|
+
this.controlType = 'lib-document-list-label-config-editor';
|
|
228
|
+
this.id = `lib-document-list-label-config-editor-${DocumentListLabelConfigEditorComponent.nextId++}`;
|
|
229
|
+
this.placeholder = '';
|
|
230
|
+
this.focused = false;
|
|
231
|
+
this.touched = false;
|
|
232
|
+
this.describedBy = '';
|
|
233
|
+
this.autofilled = false;
|
|
234
|
+
this.userAriaDescribedBy = undefined;
|
|
235
|
+
this.disableAutomaticLabeling = undefined;
|
|
236
|
+
this.ngControl = inject(NgControl, { self: true, optional: true });
|
|
237
|
+
/** Validation errors surfaced by the parent for error-state derivation. */
|
|
238
|
+
this.errors = [];
|
|
239
|
+
/** Available form inputs used to auto-derive a column's value type. */
|
|
240
|
+
this.formInputs = [];
|
|
241
|
+
/** Editor configuration supplied by the parent (placeholder/required/etc.). */
|
|
242
|
+
this.editorConfig = undefined;
|
|
243
|
+
/** Candidate control names offered in the form-control autocomplete. */
|
|
244
|
+
this.mapToData = [];
|
|
245
|
+
/** Emits the column list whenever it changes. */
|
|
246
|
+
this.valueChange = output();
|
|
247
|
+
this.#value = [];
|
|
248
|
+
/** Signal mirror of `#value`, so the plan preview reacts to list changes. */
|
|
249
|
+
this.#valueState = signal([], ...(ngDevMode ? [{ debugName: "#valueState" }] : /* istanbul ignore next */ []));
|
|
250
|
+
this.#disabled = false;
|
|
251
|
+
this.#required = false;
|
|
252
|
+
// ---- internal signal state ---------------------------------------------
|
|
253
|
+
/** The label draft currently being added/edited (see {@link LabelDraft}). */
|
|
254
|
+
this.labelInEdit = signal(null, ...(ngDevMode ? [{ debugName: "labelInEdit" }] : /* istanbul ignore next */ []));
|
|
255
|
+
/** Value-type chip options (all enum members, humanised). */
|
|
256
|
+
this.valueTypes = Object.keys(DocumentLitsLabelConfigInterfaceValueType).map((key) => ({ label: humaniseKey(key), value: key }));
|
|
257
|
+
/**
|
|
258
|
+
* Autocomplete options filtered by the draft's `formControlName`. Empty term
|
|
259
|
+
* shows the full list; otherwise matches a substring or a word-prefix.
|
|
260
|
+
*/
|
|
261
|
+
this.filteredControlNames = computed(() => {
|
|
262
|
+
// 1. Create a Set from the data to automatically remove duplicates,
|
|
263
|
+
// then spread it back into an array.
|
|
264
|
+
const source = [...new Set(this.mapToData ?? [])];
|
|
265
|
+
const term = (this.labelInEdit()?.formControlName ?? '').trim().toLowerCase();
|
|
266
|
+
if (!term) {
|
|
267
|
+
return source;
|
|
268
|
+
}
|
|
269
|
+
return source.filter((option) => {
|
|
270
|
+
const text = option.toLowerCase();
|
|
271
|
+
if (text.includes(term)) {
|
|
272
|
+
return true;
|
|
273
|
+
}
|
|
274
|
+
return text.split(/\s+/).some((word) => word.startsWith(term));
|
|
275
|
+
});
|
|
276
|
+
}, ...(ngDevMode ? [{ debugName: "filteredControlNames" }] : /* istanbul ignore next */ []));
|
|
277
|
+
/**
|
|
278
|
+
* Report-type chip options derived from the draft's `valueType`. `undefined`
|
|
279
|
+
* when no value type is chosen, which hides the report-types section.
|
|
280
|
+
*
|
|
281
|
+
* - currency / number → measures (avg, sum, median, lowest, highest)
|
|
282
|
+
* - string → category, distinct
|
|
283
|
+
* - systemReference → distinct
|
|
284
|
+
* - boolean → category
|
|
285
|
+
* - date / daysAgo → trend
|
|
286
|
+
*/
|
|
287
|
+
this.reportTypes = computed(() => {
|
|
288
|
+
const valueType = this.labelInEdit()?.valueType;
|
|
289
|
+
if (!valueType) {
|
|
290
|
+
return undefined;
|
|
291
|
+
}
|
|
292
|
+
return (REPORT_TYPES_BY_VALUE_TYPE[valueType] ?? []).map((key) => ({
|
|
293
|
+
label: humaniseKey(key),
|
|
294
|
+
value: key,
|
|
295
|
+
description: REPORT_TYPE_DESCRIPTIONS[key],
|
|
296
|
+
}));
|
|
297
|
+
}, ...(ngDevMode ? [{ debugName: "reportTypes" }] : /* istanbul ignore next */ []));
|
|
298
|
+
/** Direction select options (see {@link POLARITY_OPTIONS}). */
|
|
299
|
+
this.polarityOptions = POLARITY_OPTIONS;
|
|
300
|
+
/**
|
|
301
|
+
* The report-hint controls that apply to the draft, or `null` — which hides
|
|
302
|
+
* the group — until the draft has at least one report type.
|
|
303
|
+
*/
|
|
304
|
+
this.reportHintControls = computed(() => {
|
|
305
|
+
const draft = this.labelInEdit();
|
|
306
|
+
if (!draft?.valueType || !draft.reportType?.length) {
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
const measure = isMeasureValueType(draft.valueType);
|
|
310
|
+
return {
|
|
311
|
+
primaryLabel: measure ? 'Primary — the headline KPI' : 'Primary — the default grouping',
|
|
312
|
+
polarity: measure || draft.valueType === DocumentLitsLabelConfigInterfaceValueType.boolean,
|
|
313
|
+
bands: measure,
|
|
314
|
+
};
|
|
315
|
+
}, ...(ngDevMode ? [{ debugName: "reportHintControls" }] : /* istanbul ignore next */ []));
|
|
316
|
+
/** The draft's bands as editable text (`100000, 500000`). */
|
|
317
|
+
this.bandsText = computed(() => this.labelInEdit()?.reportHints?.bands?.join(', ') ?? '', ...(ngDevMode ? [{ debugName: "bandsText" }] : /* istanbul ignore next */ []));
|
|
318
|
+
/** Why the last bands entry was refused; `null` when the input is valid. */
|
|
319
|
+
this.bandsError = signal(null, ...(ngDevMode ? [{ debugName: "bandsError" }] : /* istanbul ignore next */ []));
|
|
320
|
+
// ---- plan preview -------------------------------------------------------
|
|
321
|
+
this.#destroyRef = inject(DestroyRef);
|
|
322
|
+
this.#planPreview = inject(REPORT_PLAN_PREVIEW, { optional: true });
|
|
323
|
+
/** Whether the host supplied a plan-preview call; without one nothing is rendered. */
|
|
324
|
+
this.previewEnabled = this.#planPreview !== null;
|
|
325
|
+
/** Latest preview answer (see {@link PlanPreviewState}). */
|
|
326
|
+
this.preview = signal({ status: 'idle' }, ...(ngDevMode ? [{ debugName: "preview" }] : /* istanbul ignore next */ []));
|
|
327
|
+
/** The one-line plan summary, e.g. "This setup produces 4 KPIs, 7 charts and 3 comparisons". */
|
|
328
|
+
this.previewSummary = computed(() => {
|
|
329
|
+
const state = this.preview();
|
|
330
|
+
if (state.status !== 'ready') {
|
|
331
|
+
return null;
|
|
332
|
+
}
|
|
333
|
+
const { kpis, charts, comparisons } = state.plan.summary;
|
|
334
|
+
return `This setup produces ${countOf(kpis, 'KPI')}, ${countOf(charts, 'chart')} and ${countOf(comparisons, 'comparison')}`;
|
|
335
|
+
}, ...(ngDevMode ? [{ debugName: "previewSummary" }] : /* istanbul ignore next */ []));
|
|
336
|
+
/** The planner's warnings for the column in edit only. */
|
|
337
|
+
this.previewWarnings = computed(() => {
|
|
338
|
+
const state = this.preview();
|
|
339
|
+
const controlName = this.labelInEdit()?.formControlName;
|
|
340
|
+
if (state.status !== 'ready' || !controlName) {
|
|
341
|
+
return [];
|
|
342
|
+
}
|
|
343
|
+
return state.plan.warnings
|
|
344
|
+
.filter((warning) => warning.controlName === controlName)
|
|
345
|
+
.map((warning) => warning.message);
|
|
346
|
+
}, ...(ngDevMode ? [{ debugName: "previewWarnings" }] : /* istanbul ignore next */ []));
|
|
347
|
+
/**
|
|
348
|
+
* The configuration the preview plans: the committed list with the draft in
|
|
349
|
+
* edit merged in (replacing its column, or appended), so hints show their
|
|
350
|
+
* effect before the admin saves.
|
|
351
|
+
*/
|
|
352
|
+
this.#previewConfiguration = computed(() => {
|
|
353
|
+
const value = this.#valueState();
|
|
354
|
+
const draft = this.labelInEdit();
|
|
355
|
+
if (!draft?.formControlName || !draft.valueType) {
|
|
356
|
+
return value;
|
|
357
|
+
}
|
|
358
|
+
const column = pruneReportHints(draft);
|
|
359
|
+
const index = value.findIndex((item) => item.formControlName === draft.formControlName);
|
|
360
|
+
return index === -1
|
|
361
|
+
? [...value, column]
|
|
362
|
+
: value.map((item, i) => (i === index ? column : item));
|
|
363
|
+
}, ...(ngDevMode ? [{ debugName: "#previewConfiguration" }] : /* istanbul ignore next */ []));
|
|
364
|
+
/** Whether the save action is blocked (draft missing required fields). */
|
|
365
|
+
this.labelSaveDisabled = computed(() => {
|
|
366
|
+
const draft = this.labelInEdit();
|
|
367
|
+
return !draft || !draft.label || !draft.formControlName || !draft.valueType;
|
|
368
|
+
}, ...(ngDevMode ? [{ debugName: "labelSaveDisabled" }] : /* istanbul ignore next */ []));
|
|
369
|
+
this.onTouched = () => { };
|
|
370
|
+
if (this.#planPreview) {
|
|
371
|
+
this.#watchPlanPreview(this.#planPreview);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
// ---- MatFormFieldControl getters (read by the framework) ----------------
|
|
375
|
+
get empty() {
|
|
376
|
+
return this.#value.length === 0;
|
|
377
|
+
}
|
|
378
|
+
get shouldLabelFloat() {
|
|
379
|
+
return this.focused || !this.empty;
|
|
380
|
+
}
|
|
381
|
+
get errorState() {
|
|
382
|
+
const requiredUnset = this.empty && this.#required;
|
|
383
|
+
const ngControlError = this.ngControl?.errors != null;
|
|
384
|
+
const externalError = (this.errors?.length ?? 0) > 0 && this.touched;
|
|
385
|
+
return requiredUnset || ngControlError || externalError;
|
|
386
|
+
}
|
|
387
|
+
setDescribedByIds(ids) {
|
|
388
|
+
this.describedBy = ids.join(' ');
|
|
389
|
+
this.stateChanges.next();
|
|
390
|
+
}
|
|
391
|
+
onContainerClick() {
|
|
392
|
+
this.markAsTouched();
|
|
393
|
+
if (!this.focused) {
|
|
394
|
+
this.focused = true;
|
|
395
|
+
}
|
|
396
|
+
this.stateChanges.next();
|
|
397
|
+
}
|
|
398
|
+
markAsTouched() {
|
|
399
|
+
if (!this.touched) {
|
|
400
|
+
this.touched = true;
|
|
401
|
+
this.onTouched();
|
|
402
|
+
this.stateChanges.next();
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
// ---- editing ------------------------------------------------------------
|
|
406
|
+
/** Begin a fresh column draft. */
|
|
407
|
+
startNewLabel() {
|
|
408
|
+
this.bandsError.set(null);
|
|
409
|
+
this.labelInEdit.set({});
|
|
410
|
+
}
|
|
411
|
+
/** Discard the current draft. */
|
|
412
|
+
cancelEdit() {
|
|
413
|
+
this.bandsError.set(null);
|
|
414
|
+
this.labelInEdit.set(null);
|
|
415
|
+
}
|
|
416
|
+
/** Update the draft's display label from the name input. */
|
|
417
|
+
nameChange(event) {
|
|
418
|
+
const label = event.target?.value ?? '';
|
|
419
|
+
this.labelInEdit.update((draft) => ({ ...draft, label }));
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Update the draft's form control name (free-text typing). Re-derives the
|
|
423
|
+
* value type from the matching form input, if any.
|
|
424
|
+
*/
|
|
425
|
+
formControlNameChange(event) {
|
|
426
|
+
const formControlName = event.target?.value ?? '';
|
|
427
|
+
const input = this.formInputs.find((i) => i.formControlName === formControlName);
|
|
428
|
+
this.labelInEdit.update((draft) => ({
|
|
429
|
+
...draft,
|
|
430
|
+
formControlName,
|
|
431
|
+
valueType: this.#valueTypeFromInput(input),
|
|
432
|
+
}));
|
|
433
|
+
}
|
|
434
|
+
/** Apply an autocomplete selection, defaulting the label from the name. */
|
|
435
|
+
formControlSelected(event) {
|
|
436
|
+
const formControlName = String(event.option.value);
|
|
437
|
+
this.labelInEdit.update((draft) => ({
|
|
438
|
+
...draft,
|
|
439
|
+
formControlName,
|
|
440
|
+
label: draft?.label || controlNameToLabel(formControlName),
|
|
441
|
+
}));
|
|
442
|
+
}
|
|
443
|
+
/** Set the draft's value type from the chip selection. */
|
|
444
|
+
valueTypeChanged(value) {
|
|
445
|
+
this.labelInEdit.update((draft) => ({
|
|
446
|
+
...draft,
|
|
447
|
+
valueType: value,
|
|
448
|
+
}));
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Set the draft's report types. The chip editor is multi-select, so it emits
|
|
452
|
+
* an array; a single value is normalised into one.
|
|
453
|
+
*/
|
|
454
|
+
reportTypeChanged(value) {
|
|
455
|
+
const reportType = Array.isArray(value)
|
|
456
|
+
? value
|
|
457
|
+
: value == null
|
|
458
|
+
? []
|
|
459
|
+
: [value];
|
|
460
|
+
this.labelInEdit.update((draft) => {
|
|
461
|
+
const next = { ...draft, reportType };
|
|
462
|
+
// A column that is no longer reportable keeps no hints.
|
|
463
|
+
return reportType.length === 0 ? withReportHints(next, undefined) : next;
|
|
464
|
+
});
|
|
465
|
+
if (reportType.length === 0) {
|
|
466
|
+
this.bandsError.set(null);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
/** Mark (or unmark) the draft as the primary measure / default grouping. */
|
|
470
|
+
primaryChanged(primary) {
|
|
471
|
+
this.#updateHints({ primary });
|
|
472
|
+
}
|
|
473
|
+
/** Set the draft's direction from the select; the empty option clears it. */
|
|
474
|
+
polarityChanged(event) {
|
|
475
|
+
const raw = event.target?.value ?? '';
|
|
476
|
+
const polarity = POLARITY_OPTIONS.find((option) => option.value === raw)?.value || undefined;
|
|
477
|
+
this.#updateHints({ polarity });
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Commit the bands text. Unreadable input is reported and never written, so
|
|
481
|
+
* the stored bands stay as they were; blank text clears them.
|
|
482
|
+
*/
|
|
483
|
+
bandsChanged(event) {
|
|
484
|
+
const input = event.target;
|
|
485
|
+
const bands = parseBands(input?.value ?? '');
|
|
486
|
+
if (bands === null) {
|
|
487
|
+
this.bandsError.set('Enter positive numbers separated by commas, e.g. 100000, 500000');
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
this.bandsError.set(null);
|
|
491
|
+
this.#updateHints({ bands });
|
|
492
|
+
if (input) {
|
|
493
|
+
// Show the normalised list even when it equals the previous binding.
|
|
494
|
+
input.value = bands.join(', ');
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
/** Toggle the draft's hidden flag. */
|
|
498
|
+
isHiddenChanged(isHidden) {
|
|
499
|
+
this.labelInEdit.update((draft) => ({ ...draft, isHidden }));
|
|
500
|
+
}
|
|
501
|
+
/** Commit the draft into the list (replacing a matching column, or appending). */
|
|
502
|
+
saveHeader() {
|
|
503
|
+
const draft = this.labelInEdit();
|
|
504
|
+
if (!draft) {
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
const next = [...this.#value];
|
|
508
|
+
const index = next.findIndex((item) => item.formControlName === draft.formControlName);
|
|
509
|
+
const column = pruneReportHints(draft);
|
|
510
|
+
if (index !== -1) {
|
|
511
|
+
next[index] = column;
|
|
512
|
+
}
|
|
513
|
+
else {
|
|
514
|
+
next.push(column);
|
|
515
|
+
}
|
|
516
|
+
this.#commit(next);
|
|
517
|
+
this.bandsError.set(null);
|
|
518
|
+
this.labelInEdit.set(null);
|
|
519
|
+
}
|
|
520
|
+
/** Remove a column by its form control name. */
|
|
521
|
+
removeLabel(label) {
|
|
522
|
+
this.#commit(this.#value.filter((item) => item.formControlName !== label.formControlName));
|
|
523
|
+
}
|
|
524
|
+
/** Reorder the list after a drag-and-drop. */
|
|
525
|
+
drop(event) {
|
|
526
|
+
const { previousIndex, currentIndex } = event;
|
|
527
|
+
const moved = this.#value.at(previousIndex);
|
|
528
|
+
if (moved === undefined || previousIndex === currentIndex) {
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
const next = [...this.#value];
|
|
532
|
+
next.splice(previousIndex, 1);
|
|
533
|
+
next.splice(currentIndex, 0, moved);
|
|
534
|
+
this.#commit(next);
|
|
535
|
+
}
|
|
536
|
+
/** Merge a hint change into the draft, removing `reportHints` once nothing is set. */
|
|
537
|
+
#updateHints(patch) {
|
|
538
|
+
this.labelInEdit.update((draft) => withReportHints(draft, { ...draft?.reportHints, ...patch }));
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Re-plan after each configuration change: debounced, de-duplicated, the
|
|
542
|
+
* newest call wins, and a failure becomes the quiet "Preview unavailable".
|
|
543
|
+
*/
|
|
544
|
+
#watchPlanPreview(planPreview) {
|
|
545
|
+
toObservable(this.#previewConfiguration)
|
|
546
|
+
.pipe(debounceTime(PREVIEW_DEBOUNCE_MS), map((configuration) => ({ configuration, key: JSON.stringify(configuration) })), distinctUntilChanged((a, b) => a.key === b.key), switchMap(({ configuration }) => this.#requestPlan(planPreview, configuration)), takeUntilDestroyed(this.#destroyRef))
|
|
547
|
+
.subscribe((state) => this.preview.set(state));
|
|
548
|
+
}
|
|
549
|
+
/** One host call, with a synchronous throw or an error both swallowed. */
|
|
550
|
+
#requestPlan(planPreview, configuration) {
|
|
551
|
+
return defer(() => planPreview(configuration)).pipe(map((plan) => ({ status: 'ready', plan })), catchError(() => of({ status: 'unavailable' })));
|
|
552
|
+
}
|
|
553
|
+
/** Write a new list value, emit the change, and mark the control touched. */
|
|
554
|
+
#commit(next) {
|
|
555
|
+
this.value = next;
|
|
556
|
+
this.valueChange.emit(next);
|
|
557
|
+
this.markAsTouched();
|
|
558
|
+
}
|
|
559
|
+
/** Derive the value type from a form input's data/element type and pipe. */
|
|
560
|
+
#valueTypeFromInput(input) {
|
|
561
|
+
if (!input) {
|
|
562
|
+
return DocumentLitsLabelConfigInterfaceValueType.string;
|
|
563
|
+
}
|
|
564
|
+
if (input.dataType === InputDataTypes.Number ||
|
|
565
|
+
input.type === InputTypes.Number ||
|
|
566
|
+
input.pipe?.pipeType === InputPipeTypes.Number) {
|
|
567
|
+
return DocumentLitsLabelConfigInterfaceValueType.number;
|
|
568
|
+
}
|
|
569
|
+
if (input.pipe?.pipeType === InputPipeTypes.Currency) {
|
|
570
|
+
return DocumentLitsLabelConfigInterfaceValueType.currency;
|
|
571
|
+
}
|
|
572
|
+
if (input.dataType === InputDataTypes.Boolean || input.element === ElementTypes.Toggle) {
|
|
573
|
+
return DocumentLitsLabelConfigInterfaceValueType.boolean;
|
|
574
|
+
}
|
|
575
|
+
return DocumentLitsLabelConfigInterfaceValueType.string;
|
|
576
|
+
}
|
|
577
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DocumentListLabelConfigEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
578
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: DocumentListLabelConfigEditorComponent, isStandalone: true, selector: "lib-document-list-label-config-editor", inputs: { errors: "errors", formInputs: "formInputs", editorConfig: "editorConfig", mapToData: "mapToData", value: "value", disabled: "disabled", required: "required" }, outputs: { valueChange: "valueChange" }, host: { properties: { "id": "id", "attr.aria-describedby": "describedBy" }, classAttribute: "lib-document-list-label-config-editor" }, providers: [
|
|
579
|
+
{ provide: MatFormFieldControl, useExisting: DocumentListLabelConfigEditorComponent },
|
|
580
|
+
], ngImport: i0, template: "<mat-nav-list\r\n cdkDropList\r\n [cdkDropListData]=\"value\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"lib-document-list-label-config-editor__list\"\r\n>\r\n @if (value.length === 0) {\r\n <lib-empty-state\r\n icon=\"view_column\"\r\n message=\"No columns configured. Add one below.\"\r\n ></lib-empty-state>\r\n } @else {\r\n @for (label of value; track label.formControlName+'-'+$index) {\r\n <mat-list-item\r\n cdkDrag\r\n class=\"lib-document-list-label-config-editor__item\"\r\n [matTooltip]=\"'Click to copy ' + label.formControlName\"\r\n [cdkCopyToClipboard]=\"label.formControlName\"\r\n matTooltipPosition=\"before\"\r\n >\r\n <mat-icon matListItemIcon>view_column</mat-icon>\r\n\r\n <div matListItemTitle class=\"lib-document-list-label-config-editor__title\">\r\n <span class=\"lib-document-list-label-config-editor__label\">{{ label.label }}</span>\r\n <span class=\"lib-document-list-label-config-editor__meta\">\r\n <code>{{ label.formControlName }}</code> \u00B7 {{ label.valueType }}\r\n </span>\r\n </div>\r\n\r\n <button\r\n matListItemMeta\r\n mat-icon-button\r\n type=\"button\"\r\n [disabled]=\"disabled\"\r\n [attr.aria-label]=\"'Remove ' + label.label\"\r\n (click)=\"removeLabel(label)\"\r\n >\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </mat-list-item>\r\n }\r\n }\r\n</mat-nav-list>\r\n\r\n@if (previewEnabled) {\r\n <div class=\"lib-document-list-label-config-editor__preview\" role=\"status\" aria-live=\"polite\">\r\n @switch (preview().status) {\r\n @case ('ready') {\r\n <p class=\"lib-document-list-label-config-editor__preview-summary\">{{ previewSummary() }}</p>\r\n @if (previewWarnings().length > 0) {\r\n <ul class=\"lib-document-list-label-config-editor__preview-warnings\">\r\n @for (warning of previewWarnings(); track $index) {\r\n <li>{{ warning }}</li>\r\n }\r\n </ul>\r\n }\r\n }\r\n @case ('unavailable') {\r\n <p class=\"lib-document-list-label-config-editor__preview-summary\">Preview unavailable</p>\r\n }\r\n }\r\n </div>\r\n}\r\n\r\n@if (labelInEdit(); as draft) {\r\n <mat-card appearance=\"outlined\" class=\"lib-document-list-label-config-editor__form\">\r\n <mat-card-content class=\"lib-document-list-label-config-editor__fields\">\r\n <label class=\"lib-document-list-label-config-editor__field-label\" [attr.for]=\"id + '-fcn'\">\r\n Form control name\r\n </label>\r\n <input\r\n class=\"lib-document-list-label-config-editor__input\"\r\n type=\"text\"\r\n [id]=\"id + '-fcn'\"\r\n placeholder=\"Pick one\"\r\n aria-label=\"Form control name\"\r\n [value]=\"draft.formControlName || ''\"\r\n (input)=\"formControlNameChange($event)\"\r\n [matAutocomplete]=\"auto\"\r\n />\r\n <mat-autocomplete\r\n #auto=\"matAutocomplete\"\r\n autoActiveFirstOption\r\n (optionSelected)=\"formControlSelected($event)\"\r\n >\r\n @for (option of filteredControlNames(); track option) {\r\n <mat-option [value]=\"option\">{{ option }}</mat-option>\r\n }\r\n </mat-autocomplete>\r\n\r\n <label class=\"lib-document-list-label-config-editor__field-label\" [attr.for]=\"id + '-name'\">\r\n Name\r\n </label>\r\n <input\r\n class=\"lib-document-list-label-config-editor__input\"\r\n type=\"text\"\r\n [id]=\"id + '-name'\"\r\n placeholder=\"Enter label name\"\r\n [value]=\"draft.label || ''\"\r\n (input)=\"nameChange($event)\"\r\n />\r\n\r\n <label class=\"lib-document-list-label-config-editor__field-label\" [id]=\"id + '-vt-label'\">\r\n Value type\r\n </label>\r\n <lib-mat-chip-list-editor\r\n [id]=\"id + '-vt'\"\r\n [errors]=\"[]\"\r\n [value]=\"draft.valueType\"\r\n [options]=\"valueTypes\"\r\n (valueChange)=\"valueTypeChanged($event)\"\r\n ></lib-mat-chip-list-editor>\r\n\r\n @if (reportTypes(); as types) {\r\n @if (types.length > 0) {\r\n <label class=\"lib-document-list-label-config-editor__field-label\" [id]=\"id + '-rt-label'\">\r\n Report types\r\n </label>\r\n <lib-mat-chip-list-editor\r\n [id]=\"id + '-rt'\"\r\n [errors]=\"[]\"\r\n [multiple]=\"true\"\r\n [value]=\"draft.reportType\"\r\n [options]=\"types\"\r\n (valueChange)=\"reportTypeChanged($event)\"\r\n ></lib-mat-chip-list-editor>\r\n <ul class=\"lib-document-list-label-config-editor__report-help\" [id]=\"id + '-rt-help'\">\r\n @for (type of types; track type.value) {\r\n <li>{{ type.description }}</li>\r\n }\r\n </ul>\r\n }\r\n }\r\n\r\n @if (reportHintControls(); as hints) {\r\n <fieldset class=\"lib-document-list-label-config-editor__hints\">\r\n <legend class=\"lib-document-list-label-config-editor__field-label\">Report hints</legend>\r\n\r\n <lib-mat-slider-toggle-editor\r\n class=\"lib-document-list-label-config-editor__primary\"\r\n [label]=\"hints.primaryLabel\"\r\n [value]=\"draft.reportHints?.primary || false\"\r\n [errors]=\"[]\"\r\n (valueChange)=\"primaryChanged(!!$event)\"\r\n ></lib-mat-slider-toggle-editor>\r\n\r\n @if (hints.polarity) {\r\n <label class=\"lib-document-list-label-config-editor__field-label\" [attr.for]=\"id + '-polarity'\">\r\n Direction\r\n </label>\r\n <select\r\n class=\"lib-document-list-label-config-editor__input\"\r\n [id]=\"id + '-polarity'\"\r\n (change)=\"polarityChanged($event)\"\r\n >\r\n @for (option of polarityOptions; track option.value) {\r\n <option\r\n [value]=\"option.value\"\r\n [selected]=\"(draft.reportHints?.polarity || '') === option.value\"\r\n >{{ option.label }}</option>\r\n }\r\n </select>\r\n }\r\n\r\n @if (hints.bands) {\r\n <label class=\"lib-document-list-label-config-editor__field-label\" [attr.for]=\"id + '-bands'\">\r\n Bands\r\n </label>\r\n <input\r\n class=\"lib-document-list-label-config-editor__input\"\r\n type=\"text\"\r\n inputmode=\"decimal\"\r\n [id]=\"id + '-bands'\"\r\n placeholder=\"e.g. 100000, 500000\"\r\n [value]=\"bandsText()\"\r\n [attr.aria-invalid]=\"bandsError() ? 'true' : null\"\r\n [attr.aria-describedby]=\"id + '-bands-msg'\"\r\n (change)=\"bandsChanged($event)\"\r\n />\r\n <p\r\n class=\"lib-document-list-label-config-editor__hint\"\r\n [class.lib-document-list-label-config-editor__hint--error]=\"bandsError()\"\r\n [id]=\"id + '-bands-msg'\"\r\n [attr.role]=\"bandsError() ? 'alert' : null\"\r\n >\r\n {{ bandsError() || 'Optional value edges for concentration insights, separated by commas.' }}\r\n </p>\r\n }\r\n </fieldset>\r\n }\r\n\r\n <lib-mat-slider-toggle-editor\r\n [id]=\"id + '-hidden'\"\r\n label=\"Is hidden\"\r\n [value]=\"draft.isHidden || false\"\r\n [errors]=\"[]\"\r\n (valueChange)=\"isHiddenChanged(!!$event)\"\r\n ></lib-mat-slider-toggle-editor>\r\n </mat-card-content>\r\n\r\n <mat-card-actions class=\"lib-document-list-label-config-editor__actions\">\r\n <button\r\n mat-flat-button\r\n color=\"primary\"\r\n type=\"button\"\r\n [disabled]=\"labelSaveDisabled()\"\r\n (click)=\"saveHeader()\"\r\n >\r\n Save header\r\n </button>\r\n <span class=\"lib-document-list-label-config-editor__spacer\"></span>\r\n <button mat-button color=\"warn\" type=\"button\" (click)=\"cancelEdit()\">Cancel</button>\r\n </mat-card-actions>\r\n </mat-card>\r\n} @else {\r\n <button\r\n mat-stroked-button\r\n color=\"primary\"\r\n type=\"button\"\r\n class=\"lib-document-list-label-config-editor__add\"\r\n [disabled]=\"disabled\"\r\n (click)=\"startNewLabel()\"\r\n >\r\n Add new column\r\n </button>\r\n}\r\n", styles: [":host{display:block;color:var(--lib-forms-on-surface)}.lib-document-list-label-config-editor__list{display:block;max-height:25rem;overflow:auto;padding:0}.lib-document-list-label-config-editor__item{cursor:grab}.lib-document-list-label-config-editor__item:active{cursor:grabbing}.lib-document-list-label-config-editor__title{display:flex;flex-direction:column;gap:.25rem;min-width:0}.lib-document-list-label-config-editor__label{font-size:.9375rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.lib-document-list-label-config-editor__meta{font-size:.8125rem;color:var(--lib-forms-on-surface-variant)}.lib-document-list-label-config-editor__meta code{font-family:monospace}.lib-document-list-label-config-editor__form{margin-top:1.5rem;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)}.lib-document-list-label-config-editor__fields{display:flex;flex-direction:column;gap:.75rem;padding-top:.5rem}.lib-document-list-label-config-editor__field-label{display:block;font-size:.625rem;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--lib-forms-on-surface-variant)}.lib-document-list-label-config-editor__input{min-height:2.25rem;padding:.5rem .75rem;border:1px solid var(--lib-forms-outline);border-radius:var(--lib-forms-radius-sm, 8px);background:var(--lib-forms-surface);font-size:.875rem;color:var(--lib-forms-on-surface);transition:border-color var(--lib-forms-duration-hover, .3s) var(--lib-forms-easing),box-shadow var(--lib-forms-duration-hover, .3s) var(--lib-forms-easing)}.lib-document-list-label-config-editor__input:focus{outline:none;border-color:var(--lib-forms-primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--lib-forms-primary) 25%,transparent)}.lib-document-list-label-config-editor__input{width:100%}.lib-document-list-label-config-editor__input::placeholder{color:var(--lib-forms-on-surface-variant);opacity:.7}.lib-document-list-label-config-editor__report-help{margin:0;padding-left:1rem;font-size:.75rem;line-height:1.4;color:var(--lib-forms-on-surface-variant)}.lib-document-list-label-config-editor__hints{display:flex;flex-direction:column;gap:.5rem;min-width:0;margin:0;padding:.75rem;border:1px solid color-mix(in srgb,var(--lib-forms-outline) 25%,transparent);border-radius:var(--lib-forms-radius-sm, 8px)}.lib-document-list-label-config-editor__hints legend{padding:0 .25rem}.lib-document-list-label-config-editor__hint{margin:0;font-size:.75rem;color:var(--lib-forms-on-surface-variant)}.lib-document-list-label-config-editor__hint--error{color:var(--lib-forms-error)}.lib-document-list-label-config-editor__preview{margin-top:.75rem;font-size:.8125rem;color:var(--lib-forms-on-surface-variant)}.lib-document-list-label-config-editor__preview:empty{display:none}.lib-document-list-label-config-editor__preview-summary{margin:0}.lib-document-list-label-config-editor__preview-warnings{margin:.25rem 0 0;padding-left:1rem;color:var(--lib-forms-warning)}.lib-document-list-label-config-editor__actions{display:flex;align-items:center;gap:.5rem}.lib-document-list-label-config-editor__spacer{flex:1 1 auto}.lib-document-list-label-config-editor__add{width:100%;margin-top:1.5rem}.cdk-drag-preview{box-sizing:border-box;border-radius:var(--lib-forms-radius-sm, 8px);box-shadow:var(--lib-forms-shadow-floating)}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform var(--lib-forms-duration) var(--lib-forms-easing)}.lib-document-list-label-config-editor__list.cdk-drop-list-dragging .lib-document-list-label-config-editor__item:not(.cdk-drag-placeholder){transition:transform var(--lib-forms-duration) var(--lib-forms-easing)}\n"], dependencies: [{ kind: "ngmodule", type: MatListModule }, { kind: "component", type: i6.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i6.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i6.MatListItemIcon, selector: "[matListItemIcon]" }, { kind: "directive", type: i6.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "directive", type: i6.MatListItemMeta, selector: "[matListItemMeta]" }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ClipboardModule }, { kind: "directive", type: i1.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "component", type: MatSliderToggleEditorComponent, selector: "lib-mat-slider-toggle-editor", inputs: ["name", "label", "errors", "disabled", "required", "value", "placeholder"], outputs: ["valueChange"] }, { kind: "component", type: MatChipListEditorComponent, selector: "lib-mat-chip-list-editor", inputs: ["disabled", "multiple", "required", "errors", "value", "options"], outputs: ["valueChange"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i5$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i5$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i5$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i3$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3$1.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i3$1.MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: EmptyStateComponent, selector: "lib-empty-state", inputs: ["icon", "message"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
581
|
+
}
|
|
582
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DocumentListLabelConfigEditorComponent, decorators: [{
|
|
583
|
+
type: Component,
|
|
584
|
+
args: [{ selector: 'lib-document-list-label-config-editor', imports: [
|
|
585
|
+
MatListModule,
|
|
586
|
+
MatTooltipModule,
|
|
587
|
+
ClipboardModule,
|
|
588
|
+
MatSliderToggleEditorComponent,
|
|
589
|
+
MatChipListEditorComponent,
|
|
590
|
+
MatFormFieldModule,
|
|
591
|
+
MatButtonModule,
|
|
592
|
+
MatAutocompleteModule,
|
|
593
|
+
MatInputModule,
|
|
594
|
+
MatIconModule,
|
|
595
|
+
MatCardModule,
|
|
596
|
+
CdkDropList,
|
|
597
|
+
CdkDrag,
|
|
598
|
+
EmptyStateComponent,
|
|
599
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: {
|
|
600
|
+
'class': 'lib-document-list-label-config-editor',
|
|
601
|
+
'[id]': 'id',
|
|
602
|
+
'[attr.aria-describedby]': 'describedBy',
|
|
603
|
+
}, providers: [
|
|
604
|
+
{ provide: MatFormFieldControl, useExisting: DocumentListLabelConfigEditorComponent },
|
|
605
|
+
], template: "<mat-nav-list\r\n cdkDropList\r\n [cdkDropListData]=\"value\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"lib-document-list-label-config-editor__list\"\r\n>\r\n @if (value.length === 0) {\r\n <lib-empty-state\r\n icon=\"view_column\"\r\n message=\"No columns configured. Add one below.\"\r\n ></lib-empty-state>\r\n } @else {\r\n @for (label of value; track label.formControlName+'-'+$index) {\r\n <mat-list-item\r\n cdkDrag\r\n class=\"lib-document-list-label-config-editor__item\"\r\n [matTooltip]=\"'Click to copy ' + label.formControlName\"\r\n [cdkCopyToClipboard]=\"label.formControlName\"\r\n matTooltipPosition=\"before\"\r\n >\r\n <mat-icon matListItemIcon>view_column</mat-icon>\r\n\r\n <div matListItemTitle class=\"lib-document-list-label-config-editor__title\">\r\n <span class=\"lib-document-list-label-config-editor__label\">{{ label.label }}</span>\r\n <span class=\"lib-document-list-label-config-editor__meta\">\r\n <code>{{ label.formControlName }}</code> \u00B7 {{ label.valueType }}\r\n </span>\r\n </div>\r\n\r\n <button\r\n matListItemMeta\r\n mat-icon-button\r\n type=\"button\"\r\n [disabled]=\"disabled\"\r\n [attr.aria-label]=\"'Remove ' + label.label\"\r\n (click)=\"removeLabel(label)\"\r\n >\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </mat-list-item>\r\n }\r\n }\r\n</mat-nav-list>\r\n\r\n@if (previewEnabled) {\r\n <div class=\"lib-document-list-label-config-editor__preview\" role=\"status\" aria-live=\"polite\">\r\n @switch (preview().status) {\r\n @case ('ready') {\r\n <p class=\"lib-document-list-label-config-editor__preview-summary\">{{ previewSummary() }}</p>\r\n @if (previewWarnings().length > 0) {\r\n <ul class=\"lib-document-list-label-config-editor__preview-warnings\">\r\n @for (warning of previewWarnings(); track $index) {\r\n <li>{{ warning }}</li>\r\n }\r\n </ul>\r\n }\r\n }\r\n @case ('unavailable') {\r\n <p class=\"lib-document-list-label-config-editor__preview-summary\">Preview unavailable</p>\r\n }\r\n }\r\n </div>\r\n}\r\n\r\n@if (labelInEdit(); as draft) {\r\n <mat-card appearance=\"outlined\" class=\"lib-document-list-label-config-editor__form\">\r\n <mat-card-content class=\"lib-document-list-label-config-editor__fields\">\r\n <label class=\"lib-document-list-label-config-editor__field-label\" [attr.for]=\"id + '-fcn'\">\r\n Form control name\r\n </label>\r\n <input\r\n class=\"lib-document-list-label-config-editor__input\"\r\n type=\"text\"\r\n [id]=\"id + '-fcn'\"\r\n placeholder=\"Pick one\"\r\n aria-label=\"Form control name\"\r\n [value]=\"draft.formControlName || ''\"\r\n (input)=\"formControlNameChange($event)\"\r\n [matAutocomplete]=\"auto\"\r\n />\r\n <mat-autocomplete\r\n #auto=\"matAutocomplete\"\r\n autoActiveFirstOption\r\n (optionSelected)=\"formControlSelected($event)\"\r\n >\r\n @for (option of filteredControlNames(); track option) {\r\n <mat-option [value]=\"option\">{{ option }}</mat-option>\r\n }\r\n </mat-autocomplete>\r\n\r\n <label class=\"lib-document-list-label-config-editor__field-label\" [attr.for]=\"id + '-name'\">\r\n Name\r\n </label>\r\n <input\r\n class=\"lib-document-list-label-config-editor__input\"\r\n type=\"text\"\r\n [id]=\"id + '-name'\"\r\n placeholder=\"Enter label name\"\r\n [value]=\"draft.label || ''\"\r\n (input)=\"nameChange($event)\"\r\n />\r\n\r\n <label class=\"lib-document-list-label-config-editor__field-label\" [id]=\"id + '-vt-label'\">\r\n Value type\r\n </label>\r\n <lib-mat-chip-list-editor\r\n [id]=\"id + '-vt'\"\r\n [errors]=\"[]\"\r\n [value]=\"draft.valueType\"\r\n [options]=\"valueTypes\"\r\n (valueChange)=\"valueTypeChanged($event)\"\r\n ></lib-mat-chip-list-editor>\r\n\r\n @if (reportTypes(); as types) {\r\n @if (types.length > 0) {\r\n <label class=\"lib-document-list-label-config-editor__field-label\" [id]=\"id + '-rt-label'\">\r\n Report types\r\n </label>\r\n <lib-mat-chip-list-editor\r\n [id]=\"id + '-rt'\"\r\n [errors]=\"[]\"\r\n [multiple]=\"true\"\r\n [value]=\"draft.reportType\"\r\n [options]=\"types\"\r\n (valueChange)=\"reportTypeChanged($event)\"\r\n ></lib-mat-chip-list-editor>\r\n <ul class=\"lib-document-list-label-config-editor__report-help\" [id]=\"id + '-rt-help'\">\r\n @for (type of types; track type.value) {\r\n <li>{{ type.description }}</li>\r\n }\r\n </ul>\r\n }\r\n }\r\n\r\n @if (reportHintControls(); as hints) {\r\n <fieldset class=\"lib-document-list-label-config-editor__hints\">\r\n <legend class=\"lib-document-list-label-config-editor__field-label\">Report hints</legend>\r\n\r\n <lib-mat-slider-toggle-editor\r\n class=\"lib-document-list-label-config-editor__primary\"\r\n [label]=\"hints.primaryLabel\"\r\n [value]=\"draft.reportHints?.primary || false\"\r\n [errors]=\"[]\"\r\n (valueChange)=\"primaryChanged(!!$event)\"\r\n ></lib-mat-slider-toggle-editor>\r\n\r\n @if (hints.polarity) {\r\n <label class=\"lib-document-list-label-config-editor__field-label\" [attr.for]=\"id + '-polarity'\">\r\n Direction\r\n </label>\r\n <select\r\n class=\"lib-document-list-label-config-editor__input\"\r\n [id]=\"id + '-polarity'\"\r\n (change)=\"polarityChanged($event)\"\r\n >\r\n @for (option of polarityOptions; track option.value) {\r\n <option\r\n [value]=\"option.value\"\r\n [selected]=\"(draft.reportHints?.polarity || '') === option.value\"\r\n >{{ option.label }}</option>\r\n }\r\n </select>\r\n }\r\n\r\n @if (hints.bands) {\r\n <label class=\"lib-document-list-label-config-editor__field-label\" [attr.for]=\"id + '-bands'\">\r\n Bands\r\n </label>\r\n <input\r\n class=\"lib-document-list-label-config-editor__input\"\r\n type=\"text\"\r\n inputmode=\"decimal\"\r\n [id]=\"id + '-bands'\"\r\n placeholder=\"e.g. 100000, 500000\"\r\n [value]=\"bandsText()\"\r\n [attr.aria-invalid]=\"bandsError() ? 'true' : null\"\r\n [attr.aria-describedby]=\"id + '-bands-msg'\"\r\n (change)=\"bandsChanged($event)\"\r\n />\r\n <p\r\n class=\"lib-document-list-label-config-editor__hint\"\r\n [class.lib-document-list-label-config-editor__hint--error]=\"bandsError()\"\r\n [id]=\"id + '-bands-msg'\"\r\n [attr.role]=\"bandsError() ? 'alert' : null\"\r\n >\r\n {{ bandsError() || 'Optional value edges for concentration insights, separated by commas.' }}\r\n </p>\r\n }\r\n </fieldset>\r\n }\r\n\r\n <lib-mat-slider-toggle-editor\r\n [id]=\"id + '-hidden'\"\r\n label=\"Is hidden\"\r\n [value]=\"draft.isHidden || false\"\r\n [errors]=\"[]\"\r\n (valueChange)=\"isHiddenChanged(!!$event)\"\r\n ></lib-mat-slider-toggle-editor>\r\n </mat-card-content>\r\n\r\n <mat-card-actions class=\"lib-document-list-label-config-editor__actions\">\r\n <button\r\n mat-flat-button\r\n color=\"primary\"\r\n type=\"button\"\r\n [disabled]=\"labelSaveDisabled()\"\r\n (click)=\"saveHeader()\"\r\n >\r\n Save header\r\n </button>\r\n <span class=\"lib-document-list-label-config-editor__spacer\"></span>\r\n <button mat-button color=\"warn\" type=\"button\" (click)=\"cancelEdit()\">Cancel</button>\r\n </mat-card-actions>\r\n </mat-card>\r\n} @else {\r\n <button\r\n mat-stroked-button\r\n color=\"primary\"\r\n type=\"button\"\r\n class=\"lib-document-list-label-config-editor__add\"\r\n [disabled]=\"disabled\"\r\n (click)=\"startNewLabel()\"\r\n >\r\n Add new column\r\n </button>\r\n}\r\n", styles: [":host{display:block;color:var(--lib-forms-on-surface)}.lib-document-list-label-config-editor__list{display:block;max-height:25rem;overflow:auto;padding:0}.lib-document-list-label-config-editor__item{cursor:grab}.lib-document-list-label-config-editor__item:active{cursor:grabbing}.lib-document-list-label-config-editor__title{display:flex;flex-direction:column;gap:.25rem;min-width:0}.lib-document-list-label-config-editor__label{font-size:.9375rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.lib-document-list-label-config-editor__meta{font-size:.8125rem;color:var(--lib-forms-on-surface-variant)}.lib-document-list-label-config-editor__meta code{font-family:monospace}.lib-document-list-label-config-editor__form{margin-top:1.5rem;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)}.lib-document-list-label-config-editor__fields{display:flex;flex-direction:column;gap:.75rem;padding-top:.5rem}.lib-document-list-label-config-editor__field-label{display:block;font-size:.625rem;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--lib-forms-on-surface-variant)}.lib-document-list-label-config-editor__input{min-height:2.25rem;padding:.5rem .75rem;border:1px solid var(--lib-forms-outline);border-radius:var(--lib-forms-radius-sm, 8px);background:var(--lib-forms-surface);font-size:.875rem;color:var(--lib-forms-on-surface);transition:border-color var(--lib-forms-duration-hover, .3s) var(--lib-forms-easing),box-shadow var(--lib-forms-duration-hover, .3s) var(--lib-forms-easing)}.lib-document-list-label-config-editor__input:focus{outline:none;border-color:var(--lib-forms-primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--lib-forms-primary) 25%,transparent)}.lib-document-list-label-config-editor__input{width:100%}.lib-document-list-label-config-editor__input::placeholder{color:var(--lib-forms-on-surface-variant);opacity:.7}.lib-document-list-label-config-editor__report-help{margin:0;padding-left:1rem;font-size:.75rem;line-height:1.4;color:var(--lib-forms-on-surface-variant)}.lib-document-list-label-config-editor__hints{display:flex;flex-direction:column;gap:.5rem;min-width:0;margin:0;padding:.75rem;border:1px solid color-mix(in srgb,var(--lib-forms-outline) 25%,transparent);border-radius:var(--lib-forms-radius-sm, 8px)}.lib-document-list-label-config-editor__hints legend{padding:0 .25rem}.lib-document-list-label-config-editor__hint{margin:0;font-size:.75rem;color:var(--lib-forms-on-surface-variant)}.lib-document-list-label-config-editor__hint--error{color:var(--lib-forms-error)}.lib-document-list-label-config-editor__preview{margin-top:.75rem;font-size:.8125rem;color:var(--lib-forms-on-surface-variant)}.lib-document-list-label-config-editor__preview:empty{display:none}.lib-document-list-label-config-editor__preview-summary{margin:0}.lib-document-list-label-config-editor__preview-warnings{margin:.25rem 0 0;padding-left:1rem;color:var(--lib-forms-warning)}.lib-document-list-label-config-editor__actions{display:flex;align-items:center;gap:.5rem}.lib-document-list-label-config-editor__spacer{flex:1 1 auto}.lib-document-list-label-config-editor__add{width:100%;margin-top:1.5rem}.cdk-drag-preview{box-sizing:border-box;border-radius:var(--lib-forms-radius-sm, 8px);box-shadow:var(--lib-forms-shadow-floating)}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform var(--lib-forms-duration) var(--lib-forms-easing)}.lib-document-list-label-config-editor__list.cdk-drop-list-dragging .lib-document-list-label-config-editor__item:not(.cdk-drag-placeholder){transition:transform var(--lib-forms-duration) var(--lib-forms-easing)}\n"] }]
|
|
606
|
+
}], ctorParameters: () => [], propDecorators: { errors: [{
|
|
607
|
+
type: Input
|
|
608
|
+
}], formInputs: [{
|
|
609
|
+
type: Input
|
|
610
|
+
}], editorConfig: [{
|
|
611
|
+
type: Input
|
|
612
|
+
}], mapToData: [{
|
|
613
|
+
type: Input
|
|
614
|
+
}], valueChange: [{ type: i0.Output, args: ["valueChange"] }], value: [{
|
|
615
|
+
type: Input
|
|
616
|
+
}], disabled: [{
|
|
617
|
+
type: Input
|
|
618
|
+
}], required: [{
|
|
619
|
+
type: Input
|
|
620
|
+
}] } });
|
|
621
|
+
|
|
622
|
+
export { DocumentListLabelConfigEditorComponent };
|
|
623
|
+
//# sourceMappingURL=ngx-t-forms-document-list-label-config-editor.component-u2UUPdAo.mjs.map
|