ngx-t-forms 2.0.24 → 2.0.26
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/README.md +177 -16
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-Cs_Lhz_D.mjs +313 -0
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-Cs_Lhz_D.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-C00n6tFs.mjs → ngx-t-forms-chip-options-creator-editor.component-DkTpG5yQ.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-C00n6tFs.mjs.map → ngx-t-forms-chip-options-creator-editor.component-DkTpG5yQ.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-DtfUKZL-.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-DJ9d3Oy9.mjs} +9 -9
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-DtfUKZL-.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-DJ9d3Oy9.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-data-source-picker.component-BBEQuzn2.mjs → ngx-t-forms-data-source-picker.component-CFQ_GVPG.mjs} +11 -11
- package/fesm2022/{ngx-t-forms-data-source-picker.component-BBEQuzn2.mjs.map → ngx-t-forms-data-source-picker.component-CFQ_GVPG.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-CPF_BLRA.mjs +291 -0
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-CPF_BLRA.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-form-input-selector.component-CniLZN1h.mjs → ngx-t-forms-form-input-selector.component-C38FXT55.mjs} +8 -8
- package/fesm2022/{ngx-t-forms-form-input-selector.component-CniLZN1h.mjs.map → ngx-t-forms-form-input-selector.component-C38FXT55.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-json-view.component-bnjkxqgV.mjs → ngx-t-forms-form-json-view.component-C7i6JZ-l.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-form-json-view.component-bnjkxqgV.mjs.map → ngx-t-forms-form-json-view.component-C7i6JZ-l.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-form-section-stepper.component-CJz0yr78.mjs +264 -0
- package/fesm2022/ngx-t-forms-form-section-stepper.component-CJz0yr78.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-G3Agd-vE.mjs +349 -0
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-G3Agd-vE.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-input-editor.component-BBP90B_e.mjs → ngx-t-forms-input-editor.component-B12zbXE1.mjs} +19 -19
- package/fesm2022/{ngx-t-forms-input-editor.component-BBP90B_e.mjs.map → ngx-t-forms-input-editor.component-B12zbXE1.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-dIY3BX1u.mjs +106 -0
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-dIY3BX1u.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-mat-slider-editor.component-CIiYyxkb.mjs → ngx-t-forms-mat-slider-editor.component-yMRCg8fo.mjs} +5 -5
- package/fesm2022/{ngx-t-forms-mat-slider-editor.component-CIiYyxkb.mjs.map → ngx-t-forms-mat-slider-editor.component-yMRCg8fo.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mat-slider-toggle-editor.component-DDR2JurF.mjs → ngx-t-forms-mat-slider-toggle-editor.component-0aUVP9A6.mjs} +7 -7
- package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-0aUVP9A6.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-CYN9mVz9.mjs → ngx-t-forms-missing-form-configs.component-CsPMQZqg.mjs} +9 -9
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-CYN9mVz9.mjs.map → ngx-t-forms-missing-form-configs.component-CsPMQZqg.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-D8a9-6lt.mjs +43 -0
- package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-D8a9-6lt.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-mscoa-error-display.component-DwbyXd_D.mjs +116 -0
- package/fesm2022/ngx-t-forms-mscoa-error-display.component-DwbyXd_D.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-BXPghOuH.mjs +299 -0
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-BXPghOuH.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-mscoa-temporary-hint.component-CBRfWvfD.mjs +83 -0
- package/fesm2022/ngx-t-forms-mscoa-temporary-hint.component-CBRfWvfD.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-ngx-t-forms-DwsbmVlY.mjs → ngx-t-forms-ngx-t-forms-CD9InaXz.mjs} +3364 -931
- package/fesm2022/ngx-t-forms-ngx-t-forms-CD9InaXz.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-pipeline-generator.component-QE-I58e4.mjs +637 -0
- package/fesm2022/ngx-t-forms-pipeline-generator.component-QE-I58e4.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-record-list-manager.component-D4wlLtdc.mjs +270 -0
- package/fesm2022/ngx-t-forms-record-list-manager.component-D4wlLtdc.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-required-inputs.component-BoqmVDp2.mjs +192 -0
- package/fesm2022/ngx-t-forms-required-inputs.component-BoqmVDp2.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-BcItch1n.mjs → ngx-t-forms-rest-api-call-setup.component-CtfudSGT.mjs} +15 -15
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-BcItch1n.mjs.map → ngx-t-forms-rest-api-call-setup.component-CtfudSGT.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-section-report.component-Cn_oWXBX.mjs → ngx-t-forms-section-report.component-Dntm1m5b.mjs} +10 -10
- package/fesm2022/{ngx-t-forms-section-report.component-Cn_oWXBX.mjs.map → ngx-t-forms-section-report.component-Dntm1m5b.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-Cc41XG4s.mjs → ngx-t-forms-selection-options-editor.component-Cc_qCtW2.mjs} +11 -11
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-Cc41XG4s.mjs.map → ngx-t-forms-selection-options-editor.component-Cc_qCtW2.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-t-workflow-picker.component-xvX8t0pu.mjs +187 -0
- package/fesm2022/ngx-t-forms-t-workflow-picker.component-xvX8t0pu.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-validators-config.component-4Iy5uJj3.mjs → ngx-t-forms-validators-config.component-D6JG1p81.mjs} +13 -13
- package/fesm2022/{ngx-t-forms-validators-config.component-4Iy5uJj3.mjs.map → ngx-t-forms-validators-config.component-D6JG1p81.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms.mjs +1 -1
- package/lib/components/form-builder/elements/form-section-stepper/form-section-stepper.component.d.ts +4 -1
- package/lib/components/form-builder/elements/form-submissions-config/form-submissions-config.component.d.ts +1 -1
- package/lib/components/form-builder/elements/input-element-editor/input-element-editor.component.d.ts +6 -2
- package/lib/components/forms/forms.component.d.ts +8 -0
- package/lib/components/forms/store/Form-actions-formBuilder.d.ts +1 -0
- package/lib/components/forms/store/Form-selectors-FormBuilder.d.ts +3 -1
- package/lib/components/forms/store/Forms-Effects.d.ts +7 -1
- package/lib/components/forms/store/forms-store.service.d.ts +19 -53
- package/lib/components/index.d.ts +2 -1
- package/lib/components/t-dynamic-data-edit/elements/api-value-access-rules/api-value-access-rules.component.d.ts +40 -20
- package/lib/components/t-dynamic-data-edit/elements/calculated-field-rules/calculated-field-rules.component.d.ts +51 -63
- package/lib/components/t-dynamic-data-edit/elements/document-list-label-config-editor/document-list-label-config-editor.component.d.ts +8 -1
- package/lib/components/t-dynamic-data-edit/elements/json-editor/json-editor.component.d.ts +37 -9
- package/lib/components/t-dynamic-data-edit/elements/mat-chip-list-editor/mat-chip-list-editor.component.d.ts +2 -1
- package/lib/components/t-dynamic-data-edit/elements/mscoa-segment-config/mscoa-segment-config.component.d.ts +4 -1
- package/lib/components/t-dynamic-data-edit/elements/pipeline-generator/pipeline-generator.component.d.ts +2 -0
- package/lib/components/t-dynamic-data-edit/elements/record-list-manager/record-list-manager.component.d.ts +75 -0
- package/lib/components/t-dynamic-data-edit/elements/required-inputs/required-inputs.component.d.ts +1 -0
- package/lib/components/t-dynamic-data-edit/elements/t-workflow-picker/t-workflow-picker.component.d.ts +7 -3
- package/lib/components/t-dynamic-data-edit/t-dynamic-data-edit.component.d.ts +1 -0
- package/lib/components/t-form-input/elements/Geo-location-form-input/geo-location.component.d.ts +1 -1
- package/lib/components/t-form-input/elements/auto-complete-input-element/auto-complete-input-element.component.d.ts +1 -1
- package/lib/components/t-form-input/elements/basic-input-input-element/basic-input-input-element.component.d.ts +2 -1
- package/lib/components/t-form-input/elements/basic-input-input-element/core/input-custom/input-custom.component.d.ts +2 -1
- package/lib/components/t-form-input/elements/date-picker-input-element/date-picker-input-element.component.d.ts +1 -1
- package/lib/components/t-form-input/elements/date-range-picker-input-element/date-range-picker-input-element.component.d.ts +1 -1
- package/lib/components/t-form-input/elements/document-picker/document-picker.component.d.ts +1 -1
- package/lib/components/t-form-input/elements/editor-input-element/editor-input-element.component.d.ts +1 -1
- package/lib/components/t-form-input/elements/file-upload-input-element/file-upload-input-element.component.d.ts +1 -1
- package/lib/components/t-form-input/elements/image-capture-input-element/image-capture-input-element.component.d.ts +1 -1
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/account-value/account-value.component.d.ts +8 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/components/mscoa-chart-input-menu/mscoa-chart-input-menu.component.d.ts +23 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/components/mscoa-chart-toolbar/mscoa-chart-toolbar.component.d.ts +22 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/components/mscoa-error-display/mscoa-error-display.component.d.ts +34 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/components/mscoa-temporary-hint/mscoa-temporary-hint.component.d.ts +21 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/extractCols.d.ts +22 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/mscoa-chart.component.d.ts +299 -86
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/utils/mscoa-chart.constants.d.ts +47 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/utils/mscoa-chart.helpers.d.ts +87 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/utils/mscoa-chart.types.d.ts +51 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/utils/mscoa-message-formatter.d.ts +87 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-computation/mscoa-computation.component.d.ts +149 -22
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-reactive-form-field/mscoa-reactive-form-field.component.d.ts +11 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/elements/scoa-account-table/scoa-account-table.component.d.ts +4 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/mscoa-form-input.component.d.ts +1 -1
- package/lib/components/t-form-input/elements/mscoa-form-input/store/accountConstants.d.ts +7 -2
- package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-actions.d.ts +13 -2
- package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-component-store.service.d.ts +45 -8
- package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-effects.d.ts +1 -0
- package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-selectors.d.ts +33 -8
- package/lib/components/t-form-input/elements/multiple-input-input-element/multiple-input-input-element.component.d.ts +1 -1
- package/lib/components/t-form-input/elements/select-input-element/select-input-element.component.d.ts +1 -1
- package/lib/components/t-form-input/elements/signature-input-element/core/signature-pad-input/functions/getSignatureImage.d.ts +3 -0
- package/lib/components/t-form-input/elements/signature-input-element/signature-input-element.component.d.ts +1 -1
- package/lib/components/t-form-input/elements/textarea-input-element/core/text-area-reactive-input/text-area-reactive-input.component.d.ts +1 -2
- package/lib/components/t-form-input/elements/textarea-input-element/textarea-input-element.component.d.ts +1 -1
- package/lib/components/t-form-input/elements/toggle-input-element/toggle-input-element.component.d.ts +1 -1
- package/lib/components/t-form-input/elements/workflow-adjudication/workflow-adjudication.component.d.ts +1 -1
- package/lib/services/core/t-form-builder/functions/deleteSection.d.ts +1 -0
- package/lib/services/core/t-form-builder/functions/inputElementEditorConfigs.d.ts +9 -3
- package/lib/services/core/t-form-builder/functions/removeItem.d.ts +1 -0
- package/lib/services/core/t-form-builder/functions/stepTitleChangeStep.d.ts +1 -0
- package/lib/services/core/t-form-controller/function/calculateInputValue.d.ts +1 -1
- package/lib/services/core/t-form-controller/function/getInputSourcedValue.d.ts +4 -0
- package/lib/services/core/t-form-tower-controller/functions/runMultipleInputPrepopulationFunctions.d.ts +11 -0
- package/lib/services/core/t-form-tower-controller/functions/updateFormInputConfig.d.ts +7 -0
- package/lib/services/core/t-input-controller/functions/baseCustomInput.d.ts +4 -2
- package/lib/services/core/t-input-controller/functions/inputErrorMessage.d.ts +1 -1
- package/lib/shared/functions/convertElementEditorTypesToInputType.d.ts +3 -0
- package/lib/shared/functions/fuzzyTextSearch.d.ts +4 -0
- package/lib/shared/functions/getPipedValueFromDataType.d.ts +2 -0
- package/lib/shared/index.d.ts +2 -1
- package/package.json +2 -2
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-BUKzXsXn.mjs +0 -316
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-BUKzXsXn.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-D6kwe89h.mjs +0 -238
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-D6kwe89h.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-form-section-stepper.component-DFbYNeAi.mjs +0 -261
- package/fesm2022/ngx-t-forms-form-section-stepper.component-DFbYNeAi.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-DBEgmcSi.mjs +0 -348
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-DBEgmcSi.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-CQ76110I.mjs +0 -103
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-CQ76110I.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-DDR2JurF.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-C9zKzzzX.mjs +0 -281
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-C9zKzzzX.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-DwsbmVlY.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-pipeline-generator.component-CGKxfvvC.mjs +0 -727
- package/fesm2022/ngx-t-forms-pipeline-generator.component-CGKxfvvC.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-required-inputs.component-Bktx1QGr.mjs +0 -188
- package/fesm2022/ngx-t-forms-required-inputs.component-Bktx1QGr.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-t-workflow-picker.component-CezFgp2z.mjs +0 -171
- package/fesm2022/ngx-t-forms-t-workflow-picker.component-CezFgp2z.mjs.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, computed, ViewChild, Input, Component } from '@angular/core';
|
|
3
|
-
import { F as FormsStoreService, M as MatModulesModule } from './ngx-t-forms-ngx-t-forms-
|
|
4
|
-
import * as
|
|
3
|
+
import { F as FormsStoreService, M as MatModulesModule } from './ngx-t-forms-ngx-t-forms-CD9InaXz.mjs';
|
|
4
|
+
import * as i8 from '@angular/material/sort';
|
|
5
5
|
import { MatSort } from '@angular/material/sort';
|
|
6
6
|
import { MatPaginator } from '@angular/material/paginator';
|
|
7
|
-
import * as
|
|
7
|
+
import * as i9 from '@angular/material/table';
|
|
8
8
|
import { MatTableDataSource } from '@angular/material/table';
|
|
9
9
|
import * as i2 from '@angular/common';
|
|
10
10
|
import { CommonModule } from '@angular/common';
|
|
11
11
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
12
12
|
import { ElementTypes, validateFormSlide } from 'ngx-t-forms-types';
|
|
13
13
|
import * as i5 from '@angular/material/chips';
|
|
14
|
-
import * as
|
|
15
|
-
import * as
|
|
14
|
+
import * as i2$1 from '@angular/material/icon';
|
|
15
|
+
import * as i10 from '@angular/material/toolbar';
|
|
16
16
|
|
|
17
17
|
class SectionReportComponent {
|
|
18
18
|
constructor() {
|
|
@@ -136,12 +136,12 @@ class SectionReportComponent {
|
|
|
136
136
|
const filterValue = event.target.value;
|
|
137
137
|
this.dataSource.filter = filterValue.trim().toLowerCase();
|
|
138
138
|
}
|
|
139
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
140
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
139
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SectionReportComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
140
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: SectionReportComponent, isStandalone: true, selector: "app-section-report", inputs: { sectionId: "sectionId" }, viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }], ngImport: i0, template: "<div class=\"report-container\" *ngIf=\"(section())\">\r\n\r\n\r\n <mat-toolbar style=\"padding: 0px;\">\r\n <mat-icon class=\"section-icon\">analytics</mat-icon>\r\n <small>\r\n Form Section Diagnostic Report\r\n </small>\r\n\r\n <span class=\"spacer\"></span>\r\n <div class=\"status-chips\">\r\n <div class=\"status-chip\" >\r\n <mat-icon>check_circle</mat-icon>\r\n \r\n </div>\r\n <div class=\"status-chip initialized\" *ngIf=\"(section())?.sectionIsSeen\">\r\n <mat-icon>task_alt</mat-icon>\r\n Initialized\r\n </div>\r\n </div>\r\n </mat-toolbar>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n <table mat-table [dataSource]=\"(sectionData())||[]\" matSort class=\"w-full\">\r\n <!-- Icon Column -->\r\n <ng-container matColumnDef=\"icon\">\r\n <th mat-header-cell *matHeaderCellDef></th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <mat-icon [ngStyle]=\"{'color': row.color}\">{{ row.icon }}</mat-icon>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- description Column -->\r\n <ng-container matColumnDef=\"description\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header>description</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.description }}</td>\r\n </ng-container>\r\n\r\n <!-- Name Column -->\r\n <ng-container matColumnDef=\"name\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Type</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.name }}</td>\r\n </ng-container>\r\n\r\n <!-- Value Column -->\r\n <ng-container matColumnDef=\"value\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Value</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.value }}</td>\r\n </ng-container>\r\n\r\n <!-- Details Column -->\r\n <ng-container matColumnDef=\"details\">\r\n <th mat-header-cell *matHeaderCellDef>Details</th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <mat-chip-set *ngIf=\"row.details?.length\">\r\n <mat-chip *ngFor=\"let detail of row.details\" class=\"detail-chip\">\r\n {{ detail }}\r\n </mat-chip>\r\n </mat-chip-set>\r\n </td>\r\n </ng-container>\r\n\r\n\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\r\n </table>\r\n</div>", styles: [".report-container{padding:20px;display:flex;flex-direction:column;gap:20px;background:var(--mat-sys-surface-container, var(--mat-app-surface))}.header-card{background:#fff}.title-section{display:flex;align-items:center;gap:12px}.section-icon{color:#4f46e5;font-size:1.75em;width:28px;height:28px;margin-right:8px}h1{margin:0;font-size:1.25em;font-weight:500}.subtitle{margin:4px 0 0;color:#666;font-size:.875em}.status-chips{display:flex;gap:8px;margin-left:auto}.status-chip{display:flex;align-items:center;gap:4px;padding:4px 12px;border-radius:16px;background:#22c55e;color:#fff;font-size:.875em}.status-chip.invalid{background:#ef4444}.status-chip.initialized{background:#3b82f6}.status-chip mat-icon{font-size:1.125em;width:18px;height:18px}.filter-field{width:100%;margin-bottom:16px}.detail-chip{font-size:.75em;height:24px}mat-card-content{padding:16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatModulesModule }, { kind: "component", type: i5.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "component", type: i5.MatChipSet, selector: "mat-chip-set", inputs: ["disabled", "role", "tabIndex"] }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i8.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i8.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i9.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i9.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i9.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i9.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i9.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i9.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i9.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i9.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i9.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i9.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i10.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }] }); }
|
|
141
141
|
}
|
|
142
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
142
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SectionReportComponent, decorators: [{
|
|
143
143
|
type: Component,
|
|
144
|
-
args: [{ selector: 'app-section-report', standalone: true, imports: [CommonModule, MatModulesModule], template: "<div class=\"report-container\" *ngIf=\"(section())\">\r\n\r\n\r\n <mat-toolbar style=\"padding: 0px;\">\r\n <mat-icon class=\"section-icon\">analytics</mat-icon>\r\n <small>\r\n Form Section Diagnostic Report\r\n </small>\r\n\r\n <span class=\"spacer\"></span>\r\n <div class=\"status-chips\">\r\n <div class=\"status-chip\" >\r\n <mat-icon>check_circle</mat-icon>\r\n \r\n </div>\r\n <div class=\"status-chip initialized\" *ngIf=\"(section())?.sectionIsSeen\">\r\n <mat-icon>task_alt</mat-icon>\r\n Initialized\r\n </div>\r\n </div>\r\n </mat-toolbar>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n <table mat-table [dataSource]=\"(sectionData())||[]\" matSort class=\"w-full\">\r\n <!-- Icon Column -->\r\n <ng-container matColumnDef=\"icon\">\r\n <th mat-header-cell *matHeaderCellDef></th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <mat-icon [ngStyle]=\"{'color': row.color}\">{{ row.icon }}</mat-icon>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- description Column -->\r\n <ng-container matColumnDef=\"description\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header>description</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.description }}</td>\r\n </ng-container>\r\n\r\n <!-- Name Column -->\r\n <ng-container matColumnDef=\"name\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Type</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.name }}</td>\r\n </ng-container>\r\n\r\n <!-- Value Column -->\r\n <ng-container matColumnDef=\"value\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Value</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.value }}</td>\r\n </ng-container>\r\n\r\n <!-- Details Column -->\r\n <ng-container matColumnDef=\"details\">\r\n <th mat-header-cell *matHeaderCellDef>Details</th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <mat-chip-set *ngIf=\"row.details?.length\">\r\n <mat-chip *ngFor=\"let detail of row.details\" class=\"detail-chip\">\r\n {{ detail }}\r\n </mat-chip>\r\n </mat-chip-set>\r\n </td>\r\n </ng-container>\r\n\r\n\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\r\n </table>\r\n</div>", styles: [".report-container{padding:20px;display:flex;flex-direction:column;gap:20px;background:var(--mat-sys-surface-container, var(--mat-app-surface))}.header-card{background:#fff}.title-section{display:flex;align-items:center;gap:12px}.section-icon{color:#4f46e5;font-size:
|
|
144
|
+
args: [{ selector: 'app-section-report', standalone: true, imports: [CommonModule, MatModulesModule], template: "<div class=\"report-container\" *ngIf=\"(section())\">\r\n\r\n\r\n <mat-toolbar style=\"padding: 0px;\">\r\n <mat-icon class=\"section-icon\">analytics</mat-icon>\r\n <small>\r\n Form Section Diagnostic Report\r\n </small>\r\n\r\n <span class=\"spacer\"></span>\r\n <div class=\"status-chips\">\r\n <div class=\"status-chip\" >\r\n <mat-icon>check_circle</mat-icon>\r\n \r\n </div>\r\n <div class=\"status-chip initialized\" *ngIf=\"(section())?.sectionIsSeen\">\r\n <mat-icon>task_alt</mat-icon>\r\n Initialized\r\n </div>\r\n </div>\r\n </mat-toolbar>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n <table mat-table [dataSource]=\"(sectionData())||[]\" matSort class=\"w-full\">\r\n <!-- Icon Column -->\r\n <ng-container matColumnDef=\"icon\">\r\n <th mat-header-cell *matHeaderCellDef></th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <mat-icon [ngStyle]=\"{'color': row.color}\">{{ row.icon }}</mat-icon>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- description Column -->\r\n <ng-container matColumnDef=\"description\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header>description</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.description }}</td>\r\n </ng-container>\r\n\r\n <!-- Name Column -->\r\n <ng-container matColumnDef=\"name\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Type</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.name }}</td>\r\n </ng-container>\r\n\r\n <!-- Value Column -->\r\n <ng-container matColumnDef=\"value\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Value</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.value }}</td>\r\n </ng-container>\r\n\r\n <!-- Details Column -->\r\n <ng-container matColumnDef=\"details\">\r\n <th mat-header-cell *matHeaderCellDef>Details</th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <mat-chip-set *ngIf=\"row.details?.length\">\r\n <mat-chip *ngFor=\"let detail of row.details\" class=\"detail-chip\">\r\n {{ detail }}\r\n </mat-chip>\r\n </mat-chip-set>\r\n </td>\r\n </ng-container>\r\n\r\n\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\r\n </table>\r\n</div>", styles: [".report-container{padding:20px;display:flex;flex-direction:column;gap:20px;background:var(--mat-sys-surface-container, var(--mat-app-surface))}.header-card{background:#fff}.title-section{display:flex;align-items:center;gap:12px}.section-icon{color:#4f46e5;font-size:1.75em;width:28px;height:28px;margin-right:8px}h1{margin:0;font-size:1.25em;font-weight:500}.subtitle{margin:4px 0 0;color:#666;font-size:.875em}.status-chips{display:flex;gap:8px;margin-left:auto}.status-chip{display:flex;align-items:center;gap:4px;padding:4px 12px;border-radius:16px;background:#22c55e;color:#fff;font-size:.875em}.status-chip.invalid{background:#ef4444}.status-chip.initialized{background:#3b82f6}.status-chip mat-icon{font-size:1.125em;width:18px;height:18px}.filter-field{width:100%;margin-bottom:16px}.detail-chip{font-size:.75em;height:24px}mat-card-content{padding:16px}\n"] }]
|
|
145
145
|
}], ctorParameters: () => [], propDecorators: { sectionId: [{
|
|
146
146
|
type: Input
|
|
147
147
|
}], sort: [{
|
|
@@ -153,4 +153,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
153
153
|
}] } });
|
|
154
154
|
|
|
155
155
|
export { SectionReportComponent };
|
|
156
|
-
//# sourceMappingURL=ngx-t-forms-section-report.component-
|
|
156
|
+
//# sourceMappingURL=ngx-t-forms-section-report.component-Dntm1m5b.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-t-forms-section-report.component-Cn_oWXBX.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/section-report/section-report.component.ts","../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/section-report/section-report.component.html"],"sourcesContent":["import { Component, computed, inject, Input, ViewChild } from '@angular/core';\r\n\r\n\r\nimport { MatModulesModule } from '../../../../shared/modules/mat-modules.module';\r\nimport { MatSort } from '@angular/material/sort';\r\nimport { MatPaginator } from '@angular/material/paginator';\r\nimport { MatTableDataSource } from '@angular/material/table';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsStoreService } from '../../../forms/store/forms-store.service';\r\n\r\n\r\nimport { toSignal } from '@angular/core/rxjs-interop';\r\nimport { ElementTypes, FormSlideInterface, validateFormSlide } from 'ngx-t-forms-types';\r\n@Component({\r\n selector: 'app-section-report',\r\n standalone: true,\r\n imports: [CommonModule,MatModulesModule],\r\n templateUrl: './section-report.component.html',\r\n styleUrl: './section-report.component.scss'\r\n})\r\nexport class SectionReportComponent {\r\n @Input() sectionId: string = '';\r\n @ViewChild(MatSort) sort!: MatSort;\r\n @ViewChild(MatPaginator) paginator!: MatPaginator;\r\n\r\n displayedColumns: string[] = ['icon', 'name','description', 'value'];\r\n dataSource = new MatTableDataSource<any>();\r\n\r\n private store:FormsStoreService = inject(FormsStoreService)\r\n selectFormInEdit$ = this.store.selectors.selectFormInEdit$\r\n selectFormInEdit = toSignal(this.selectFormInEdit$)\r\n constructor() {}\r\n\r\n ngOnInit() {\r\n\r\n }\r\n \r\n\r\n section = computed(()=>\r\n {\r\n const form = this.selectFormInEdit()\r\n return form?.form.slides.find((slide: FormSlideInterface) => slide.sectionId === this.sectionId) || null\r\n })\r\n \r\n sectionData = computed(()=> {\r\n const section = this.section()\r\n return this.updateTableData(section)\r\n })\r\n\r\n updateTableData(data: FormSlideInterface|null) {\r\n if(!data) return [];\r\n const allInputs = data.columns.flatMap(column=>column.element ===ElementTypes.MultipleInput ? [...(column?.formInputs||[]),column]: [column]).filter(\r\n (input) => input.sectionId === this.sectionId\r\n )\r\n const calculatedInputs = allInputs.filter((input) => input.calculatedFieldRules?.formula && input.calculatedFieldRules?.formula !== '');\r\n const inputsWithManualValidations = allInputs.filter((input) => input.validators?.some((validator) => Object.keys(validator).length > 0));\r\n const allSectionInputConfigErrors = validateFormSlide(data);\r\n \r\n const metrics: any[] = [\r\n {\r\n icon: 'input',\r\n name: 'Total Inputs',\r\n value: Object.keys(allInputs|| {}).length,\r\n color: '#2196f3',\r\n description: 'Total number of form inputs in section',\r\n trend: 'stable',\r\n category: 'inputs'\r\n },\r\n {\r\n icon: 'calculate',\r\n name: 'Calculated Fields',\r\n value: calculatedInputs.length,\r\n details:calculatedInputs,\r\n color: '#4caf50',\r\n description: 'Fields with calculation formulas',\r\n trend: 'monitoring',\r\n category: 'calculations'\r\n },\r\n {\r\n icon: 'rule',\r\n name: 'Manual Validations',\r\n value: inputsWithManualValidations.length,\r\n details: inputsWithManualValidations,\r\n color: '#ff9800',\r\n description: 'Fields with custom validation rules',\r\n trend: 'warning',\r\n category: 'validation'\r\n },\r\n \r\n {\r\n icon: 'bug_report',\r\n name: 'Config Errors',\r\n value: allSectionInputConfigErrors.length,\r\n color: '#f44336',\r\n description: 'Configuration errors detected',\r\n trend: 'critical',\r\n category: 'errors'\r\n },\r\n // {\r\n // icon: 'api',\r\n // name: 'GET Methods',\r\n // value: data.getMethodInputs.length,\r\n // details: data.getMethodInputs,\r\n // color: '#2196f3',\r\n // description: 'Fields using GET API calls',\r\n // trend: 'stable',\r\n // category: 'api'\r\n // },\r\n // {\r\n // icon: 'sync',\r\n // name: 'POST Methods',\r\n // value: data.postMethodInputs.length,\r\n // details: data.postMethodInputs,\r\n // color: '#673ab7',\r\n // description: 'Fields using POST API calls',\r\n // trend: 'monitoring',\r\n // category: 'api'\r\n // },\r\n // {\r\n // icon: 'visibility',\r\n // name: 'Hidden Fields',\r\n // value: Object.values(data.sectionInputs || {})\r\n // .filter((input: TInputControllerService) => input.input.readonly).length,\r\n // color: '#9e9e9e',\r\n // description: 'Number of hidden/conditional fields',\r\n // trend: 'neutral',\r\n // category: 'visibility'\r\n // },\r\n // {\r\n // icon: 'multiple_stop',\r\n // name: 'Multiple Inputs',\r\n // value: Object.values(data.sectionInputs || {})\r\n // .filter((input: TInputControllerService) => input.input.element ===ElementTypes.MultipleInput).length,\r\n // color: '#795548',\r\n // description: 'Fields allowing multiple values',\r\n // trend: 'stable',\r\n // category: 'inputs'\r\n // },\r\n // {\r\n // icon: 'error_outline',\r\n // name: 'Required Fields',\r\n // value: Object.values(data.sectionInputs || {})\r\n // .filter((input: TInputControllerService) => input.input.required).length,\r\n // color: '#e91e63',\r\n // description: 'Mandatory input fields',\r\n // trend: 'warning',\r\n // category: 'validation'\r\n // }\r\n ];\r\n \r\n return metrics;\r\n }\r\n\r\n applyFilter(event: Event) {\r\n const filterValue = (event.target as HTMLInputElement).value;\r\n this.dataSource.filter = filterValue.trim().toLowerCase();\r\n }\r\n}","<div class=\"report-container\" *ngIf=\"(section())\">\r\n\r\n\r\n <mat-toolbar style=\"padding: 0px;\">\r\n <mat-icon class=\"section-icon\">analytics</mat-icon>\r\n <small>\r\n Form Section Diagnostic Report\r\n </small>\r\n\r\n <span class=\"spacer\"></span>\r\n <div class=\"status-chips\">\r\n <div class=\"status-chip\" >\r\n <mat-icon>check_circle</mat-icon>\r\n \r\n </div>\r\n <div class=\"status-chip initialized\" *ngIf=\"(section())?.sectionIsSeen\">\r\n <mat-icon>task_alt</mat-icon>\r\n Initialized\r\n </div>\r\n </div>\r\n </mat-toolbar>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n <table mat-table [dataSource]=\"(sectionData())||[]\" matSort class=\"w-full\">\r\n <!-- Icon Column -->\r\n <ng-container matColumnDef=\"icon\">\r\n <th mat-header-cell *matHeaderCellDef></th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <mat-icon [ngStyle]=\"{'color': row.color}\">{{ row.icon }}</mat-icon>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- description Column -->\r\n <ng-container matColumnDef=\"description\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header>description</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.description }}</td>\r\n </ng-container>\r\n\r\n <!-- Name Column -->\r\n <ng-container matColumnDef=\"name\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Type</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.name }}</td>\r\n </ng-container>\r\n\r\n <!-- Value Column -->\r\n <ng-container matColumnDef=\"value\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Value</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.value }}</td>\r\n </ng-container>\r\n\r\n <!-- Details Column -->\r\n <ng-container matColumnDef=\"details\">\r\n <th mat-header-cell *matHeaderCellDef>Details</th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <mat-chip-set *ngIf=\"row.details?.length\">\r\n <mat-chip *ngFor=\"let detail of row.details\" class=\"detail-chip\">\r\n {{ detail }}\r\n </mat-chip>\r\n </mat-chip-set>\r\n </td>\r\n </ng-container>\r\n\r\n\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\r\n </table>\r\n</div>"],"names":["i1","i2","i4","i5","i6"],"mappings":";;;;;;;;;;;;;;;;MAoBa,sBAAsB,CAAA;AAWjC,IAAA,WAAA,GAAA;QAVS,IAAS,CAAA,SAAA,GAAW,EAAE;QAI/B,IAAgB,CAAA,gBAAA,GAAa,CAAC,MAAM,EAAE,MAAM,EAAC,aAAa,EAAE,OA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,IAAA,EAAAA,GAAA,CAAA,OAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,GAAA,CAAA,YAAA,EAAA,QAAA,EAAA,oCAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,GAAA,CAAA,MAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAC,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAI5B,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAPlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,cAClB,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,EAAC,gBAAgB,CAAC,EAAA,QAAA,EAAA,22EAAA,EAAA,MAAA,EAAA,CAAA,q1BAAA,CAAA,EAAA;wDAK/B,SAAS,EAAA,CAAA;sBAAjB;gBACmB,IAAI,EAAA,CAAA;sBAAvB,SAAS;uBAAC,OAAO;gBACO,SAAS,EAAA,CAAA;sBAAjC,SAAS;uBAAC,YAAY;;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-section-report.component-Dntm1m5b.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/section-report/section-report.component.ts","../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/section-report/section-report.component.html"],"sourcesContent":["import { Component, computed, inject, Input, ViewChild } from '@angular/core';\r\n\r\n\r\nimport { MatModulesModule } from '../../../../shared/modules/mat-modules.module';\r\nimport { MatSort } from '@angular/material/sort';\r\nimport { MatPaginator } from '@angular/material/paginator';\r\nimport { MatTableDataSource } from '@angular/material/table';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsStoreService } from '../../../forms/store/forms-store.service';\r\n\r\n\r\nimport { toSignal } from '@angular/core/rxjs-interop';\r\nimport { ElementTypes, FormSlideInterface, validateFormSlide } from 'ngx-t-forms-types';\r\n@Component({\r\n selector: 'app-section-report',\r\n standalone: true,\r\n imports: [CommonModule,MatModulesModule],\r\n templateUrl: './section-report.component.html',\r\n styleUrl: './section-report.component.scss'\r\n})\r\nexport class SectionReportComponent {\r\n @Input() sectionId: string = '';\r\n @ViewChild(MatSort) sort!: MatSort;\r\n @ViewChild(MatPaginator) paginator!: MatPaginator;\r\n\r\n displayedColumns: string[] = ['icon', 'name','description', 'value'];\r\n dataSource = new MatTableDataSource<any>();\r\n\r\n private store:FormsStoreService = inject(FormsStoreService)\r\n selectFormInEdit$ = this.store.selectors.selectFormInEdit$\r\n selectFormInEdit = toSignal(this.selectFormInEdit$)\r\n constructor() {}\r\n\r\n ngOnInit() {\r\n\r\n }\r\n \r\n\r\n section = computed(()=>\r\n {\r\n const form = this.selectFormInEdit()\r\n return form?.form.slides.find((slide: FormSlideInterface) => slide.sectionId === this.sectionId) || null\r\n })\r\n \r\n sectionData = computed(()=> {\r\n const section = this.section()\r\n return this.updateTableData(section)\r\n })\r\n\r\n updateTableData(data: FormSlideInterface|null) {\r\n if(!data) return [];\r\n const allInputs = data.columns.flatMap(column=>column.element ===ElementTypes.MultipleInput ? [...(column?.formInputs||[]),column]: [column]).filter(\r\n (input) => input.sectionId === this.sectionId\r\n )\r\n const calculatedInputs = allInputs.filter((input) => input.calculatedFieldRules?.formula && input.calculatedFieldRules?.formula !== '');\r\n const inputsWithManualValidations = allInputs.filter((input) => input.validators?.some((validator) => Object.keys(validator).length > 0));\r\n const allSectionInputConfigErrors = validateFormSlide(data);\r\n \r\n const metrics: any[] = [\r\n {\r\n icon: 'input',\r\n name: 'Total Inputs',\r\n value: Object.keys(allInputs|| {}).length,\r\n color: '#2196f3',\r\n description: 'Total number of form inputs in section',\r\n trend: 'stable',\r\n category: 'inputs'\r\n },\r\n {\r\n icon: 'calculate',\r\n name: 'Calculated Fields',\r\n value: calculatedInputs.length,\r\n details:calculatedInputs,\r\n color: '#4caf50',\r\n description: 'Fields with calculation formulas',\r\n trend: 'monitoring',\r\n category: 'calculations'\r\n },\r\n {\r\n icon: 'rule',\r\n name: 'Manual Validations',\r\n value: inputsWithManualValidations.length,\r\n details: inputsWithManualValidations,\r\n color: '#ff9800',\r\n description: 'Fields with custom validation rules',\r\n trend: 'warning',\r\n category: 'validation'\r\n },\r\n \r\n {\r\n icon: 'bug_report',\r\n name: 'Config Errors',\r\n value: allSectionInputConfigErrors.length,\r\n color: '#f44336',\r\n description: 'Configuration errors detected',\r\n trend: 'critical',\r\n category: 'errors'\r\n },\r\n // {\r\n // icon: 'api',\r\n // name: 'GET Methods',\r\n // value: data.getMethodInputs.length,\r\n // details: data.getMethodInputs,\r\n // color: '#2196f3',\r\n // description: 'Fields using GET API calls',\r\n // trend: 'stable',\r\n // category: 'api'\r\n // },\r\n // {\r\n // icon: 'sync',\r\n // name: 'POST Methods',\r\n // value: data.postMethodInputs.length,\r\n // details: data.postMethodInputs,\r\n // color: '#673ab7',\r\n // description: 'Fields using POST API calls',\r\n // trend: 'monitoring',\r\n // category: 'api'\r\n // },\r\n // {\r\n // icon: 'visibility',\r\n // name: 'Hidden Fields',\r\n // value: Object.values(data.sectionInputs || {})\r\n // .filter((input: TInputControllerService) => input.input.readonly).length,\r\n // color: '#9e9e9e',\r\n // description: 'Number of hidden/conditional fields',\r\n // trend: 'neutral',\r\n // category: 'visibility'\r\n // },\r\n // {\r\n // icon: 'multiple_stop',\r\n // name: 'Multiple Inputs',\r\n // value: Object.values(data.sectionInputs || {})\r\n // .filter((input: TInputControllerService) => input.input.element ===ElementTypes.MultipleInput).length,\r\n // color: '#795548',\r\n // description: 'Fields allowing multiple values',\r\n // trend: 'stable',\r\n // category: 'inputs'\r\n // },\r\n // {\r\n // icon: 'error_outline',\r\n // name: 'Required Fields',\r\n // value: Object.values(data.sectionInputs || {})\r\n // .filter((input: TInputControllerService) => input.input.required).length,\r\n // color: '#e91e63',\r\n // description: 'Mandatory input fields',\r\n // trend: 'warning',\r\n // category: 'validation'\r\n // }\r\n ];\r\n \r\n return metrics;\r\n }\r\n\r\n applyFilter(event: Event) {\r\n const filterValue = (event.target as HTMLInputElement).value;\r\n this.dataSource.filter = filterValue.trim().toLowerCase();\r\n }\r\n}","<div class=\"report-container\" *ngIf=\"(section())\">\r\n\r\n\r\n <mat-toolbar style=\"padding: 0px;\">\r\n <mat-icon class=\"section-icon\">analytics</mat-icon>\r\n <small>\r\n Form Section Diagnostic Report\r\n </small>\r\n\r\n <span class=\"spacer\"></span>\r\n <div class=\"status-chips\">\r\n <div class=\"status-chip\" >\r\n <mat-icon>check_circle</mat-icon>\r\n \r\n </div>\r\n <div class=\"status-chip initialized\" *ngIf=\"(section())?.sectionIsSeen\">\r\n <mat-icon>task_alt</mat-icon>\r\n Initialized\r\n </div>\r\n </div>\r\n </mat-toolbar>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n <table mat-table [dataSource]=\"(sectionData())||[]\" matSort class=\"w-full\">\r\n <!-- Icon Column -->\r\n <ng-container matColumnDef=\"icon\">\r\n <th mat-header-cell *matHeaderCellDef></th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <mat-icon [ngStyle]=\"{'color': row.color}\">{{ row.icon }}</mat-icon>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- description Column -->\r\n <ng-container matColumnDef=\"description\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header>description</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.description }}</td>\r\n </ng-container>\r\n\r\n <!-- Name Column -->\r\n <ng-container matColumnDef=\"name\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Type</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.name }}</td>\r\n </ng-container>\r\n\r\n <!-- Value Column -->\r\n <ng-container matColumnDef=\"value\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Value</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.value }}</td>\r\n </ng-container>\r\n\r\n <!-- Details Column -->\r\n <ng-container matColumnDef=\"details\">\r\n <th mat-header-cell *matHeaderCellDef>Details</th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <mat-chip-set *ngIf=\"row.details?.length\">\r\n <mat-chip *ngFor=\"let detail of row.details\" class=\"detail-chip\">\r\n {{ detail }}\r\n </mat-chip>\r\n </mat-chip-set>\r\n </td>\r\n </ng-container>\r\n\r\n\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\r\n </table>\r\n</div>"],"names":["i1","i2","i3","i4","i5","i6"],"mappings":";;;;;;;;;;;;;;;;MAoBa,sBAAsB,CAAA;AAWjC,IAAA,WAAA,GAAA;QAVS,IAAS,CAAA,SAAA,GAAW,EAAE;QAI/B,IAAgB,CAAA,gBAAA,GAAa,CAAC,MAAM,EAAE,MAAM,EAAC,aAAa,EAAE,OAAO,CAAC;AACpE,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,kBAAkB,EAAO;AAElC,QAAA,IAAA,CAAA,KAAK,GAAqB,MAAM,CAAC,iBAAiB,CAAC;QAC3D,IAAiB,CAAA,iBAAA,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,iBAAiB;AAC1D,QAAA,IAAA,CAAA,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC;AAQnD,QAAA,IAAA,CAAA,OAAO,GAAG,QAAQ,CAAC,MAAI;AAEnB,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,EAAE;YACpC,OAAO,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAyB,KAAK,K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AA,YAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAI5B,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAPlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,cAClB,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,EAAC,gBAAgB,CAAC,EAAA,QAAA,EAAA,22EAAA,EAAA,MAAA,EAAA,CAAA,i2BAAA,CAAA,EAAA;wDAK/B,SAAS,EAAA,CAAA;sBAAjB;gBACmB,IAAI,EAAA,CAAA;sBAAvB,SAAS;uBAAC,OAAO;gBACO,SAAS,EAAA,CAAA;sBAAjC,SAAS;uBAAC,YAAY;;;;;"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { EventEmitter, Output, Input, HostBinding, Optional, Self, Component } from '@angular/core';
|
|
3
|
-
import * as i2$
|
|
3
|
+
import * as i2$3 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
6
6
|
import { FormGroup, FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
7
7
|
import { v4 } from 'uuid';
|
|
8
8
|
import _ from 'lodash';
|
|
9
|
-
import { M as MatModulesModule } from './ngx-t-forms-ngx-t-forms-
|
|
9
|
+
import { M as MatModulesModule } from './ngx-t-forms-ngx-t-forms-CD9InaXz.mjs';
|
|
10
10
|
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
11
11
|
import { Subject } from 'rxjs';
|
|
12
12
|
import * as i2 from '@angular/material/button';
|
|
13
13
|
import * as i3 from '@angular/material/card';
|
|
14
14
|
import * as i5 from '@angular/material/chips';
|
|
15
|
-
import * as
|
|
16
|
-
import * as
|
|
17
|
-
import * as
|
|
18
|
-
import * as i8
|
|
19
|
-
import * as
|
|
15
|
+
import * as i2$1 from '@angular/material/icon';
|
|
16
|
+
import * as i2$2 from '@angular/material/select';
|
|
17
|
+
import * as i10 from '@angular/material/toolbar';
|
|
18
|
+
import * as i8 from '@angular/material/tooltip';
|
|
19
|
+
import * as i13 from '@angular/material/input';
|
|
20
20
|
|
|
21
21
|
class SelectionOptionsEditorComponent {
|
|
22
22
|
static { this.nextId = 0; }
|
|
@@ -161,10 +161,10 @@ class SelectionOptionsEditorComponent {
|
|
|
161
161
|
value: new FormControl(data.value || '', Validators.required),
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
165
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
164
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SelectionOptionsEditorComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
165
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SelectionOptionsEditorComponent, isStandalone: true, selector: "app-selection-options-editor", inputs: { errors: "errors", disabled: "disabled", options: "options" }, outputs: { valueChanged: "valueChanged" }, host: { properties: { "id": "this.id" } }, providers: [{ provide: MatFormFieldControl, useExisting: SelectionOptionsEditorComponent }], ngImport: i0, template: "<mat-chip-listbox style=\"overflow-x: scroll;\" aria-label=\"Option selection\" [disabled]=\"disabled\">\r\n @for (option of options; track option.id) {\r\n <mat-chip-option \r\n style=\"min-width: fit-content;\"\r\n (click)=\"startEdit(option)\"\r\n color=\"accent\" \r\n [value]=\"option.value\"\r\n [selected]=\"inEdit?.id === option.id\">\r\n \r\n {{ option.label }}\r\n <button matChipRemove (click)=\"$event.stopPropagation(); remove(option)\" [attr.aria-label]=\"'Remove ' + option.label\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-option>\r\n }\r\n</mat-chip-listbox>\r\n\r\n<mat-toolbar *ngIf=\"!inEdit\">\r\n <button style=\"width:100%\" mat-stroked-button (click)=\"add()\">\r\n Add an option <mat-icon>add</mat-icon>\r\n </button>\r\n</mat-toolbar>\r\n\r\n<mat-card *ngIf=\"!!inEdit\">\r\n <mat-card-header>\r\n <mat-card-subtitle>{{ inEdit.id ? 'Edit Option' : 'Add New Option' }}</mat-card-subtitle>\r\n </mat-card-header>\r\n\r\n <mat-card-content style=\"padding-top:16px;\">\r\n <form *ngIf=\"!!form\" [formGroup]=\"form\">\r\n <mat-form-field\r\n style=\"margin-bottom: 16px;\"\r\n subscriptSizing=\"dynamic\"\r\n floatLabel=\"always\"\r\n appearance=\"outline\">\r\n <mat-label>Display Text</mat-label>\r\n <input\r\n type=\"text\"\r\n matInput\r\n formControlName=\"label\"\r\n placeholder=\"Enter option text\"\r\n (blur)=\"autoFillValueFromLabel()\" />\r\n <mat-hint>The text users will see and select from the list.</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field subscriptSizing=\"dynamic\" floatLabel=\"always\" appearance=\"outline\">\r\n <mat-label>Stored Value</mat-label>\r\n <input\r\n type=\"text\"\r\n matInput\r\n formControlName=\"value\"\r\n placeholder=\"Enter data value\"\r\n />\r\n <button matTooltip=\"Toggle auto-creation of value from display text\" \r\n [color]=\"isAutoCamelCase ? 'primary' : ''\" \r\n (click)=\"isAutoCamelCase = !isAutoCamelCase\" \r\n matSuffix\r\n mat-icon-button>\r\n <mat-icon>{{ isAutoCamelCase ? 'drive_file_rename_outline' : 'edit_off' }}</mat-icon>\r\n </button>\r\n <mat-hint>The value saved when this option is chosen. (Often an ID or code)</mat-hint>\r\n </mat-form-field>\r\n </form>\r\n </mat-card-content>\r\n\r\n <mat-card-actions>\r\n <button mat-button (click)=\"closeEdit()\">Cancel</button>\r\n <button mat-flat-button [disabled]=\"form.invalid\" (click)=\"save()\">\r\n {{ inEdit.id ? 'Save Changes' : 'Add Option' }}\r\n </button>\r\n </mat-card-actions>\r\n</mat-card>", styles: ["mat-form-field{width:100%!important;background:azure}\n"], dependencies: [{ kind: "ngmodule", type: MatModulesModule }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i3.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i3.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i3.MatCardSubtitle, selector: "mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]" }, { kind: "component", type: i5.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i5.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "directive", type: i5.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i2$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i10.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: i13.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
166
166
|
}
|
|
167
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
167
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SelectionOptionsEditorComponent, decorators: [{
|
|
168
168
|
type: Component,
|
|
169
169
|
args: [{ selector: 'app-selection-options-editor', standalone: true, imports: [MatModulesModule, ReactiveFormsModule, CommonModule], providers: [{ provide: MatFormFieldControl, useExisting: SelectionOptionsEditorComponent }], template: "<mat-chip-listbox style=\"overflow-x: scroll;\" aria-label=\"Option selection\" [disabled]=\"disabled\">\r\n @for (option of options; track option.id) {\r\n <mat-chip-option \r\n style=\"min-width: fit-content;\"\r\n (click)=\"startEdit(option)\"\r\n color=\"accent\" \r\n [value]=\"option.value\"\r\n [selected]=\"inEdit?.id === option.id\">\r\n \r\n {{ option.label }}\r\n <button matChipRemove (click)=\"$event.stopPropagation(); remove(option)\" [attr.aria-label]=\"'Remove ' + option.label\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-option>\r\n }\r\n</mat-chip-listbox>\r\n\r\n<mat-toolbar *ngIf=\"!inEdit\">\r\n <button style=\"width:100%\" mat-stroked-button (click)=\"add()\">\r\n Add an option <mat-icon>add</mat-icon>\r\n </button>\r\n</mat-toolbar>\r\n\r\n<mat-card *ngIf=\"!!inEdit\">\r\n <mat-card-header>\r\n <mat-card-subtitle>{{ inEdit.id ? 'Edit Option' : 'Add New Option' }}</mat-card-subtitle>\r\n </mat-card-header>\r\n\r\n <mat-card-content style=\"padding-top:16px;\">\r\n <form *ngIf=\"!!form\" [formGroup]=\"form\">\r\n <mat-form-field\r\n style=\"margin-bottom: 16px;\"\r\n subscriptSizing=\"dynamic\"\r\n floatLabel=\"always\"\r\n appearance=\"outline\">\r\n <mat-label>Display Text</mat-label>\r\n <input\r\n type=\"text\"\r\n matInput\r\n formControlName=\"label\"\r\n placeholder=\"Enter option text\"\r\n (blur)=\"autoFillValueFromLabel()\" />\r\n <mat-hint>The text users will see and select from the list.</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field subscriptSizing=\"dynamic\" floatLabel=\"always\" appearance=\"outline\">\r\n <mat-label>Stored Value</mat-label>\r\n <input\r\n type=\"text\"\r\n matInput\r\n formControlName=\"value\"\r\n placeholder=\"Enter data value\"\r\n />\r\n <button matTooltip=\"Toggle auto-creation of value from display text\" \r\n [color]=\"isAutoCamelCase ? 'primary' : ''\" \r\n (click)=\"isAutoCamelCase = !isAutoCamelCase\" \r\n matSuffix\r\n mat-icon-button>\r\n <mat-icon>{{ isAutoCamelCase ? 'drive_file_rename_outline' : 'edit_off' }}</mat-icon>\r\n </button>\r\n <mat-hint>The value saved when this option is chosen. (Often an ID or code)</mat-hint>\r\n </mat-form-field>\r\n </form>\r\n </mat-card-content>\r\n\r\n <mat-card-actions>\r\n <button mat-button (click)=\"closeEdit()\">Cancel</button>\r\n <button mat-flat-button [disabled]=\"form.invalid\" (click)=\"save()\">\r\n {{ inEdit.id ? 'Save Changes' : 'Add Option' }}\r\n </button>\r\n </mat-card-actions>\r\n</mat-card>", styles: ["mat-form-field{width:100%!important;background:azure}\n"] }]
|
|
170
170
|
}], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
|
|
@@ -184,4 +184,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
184
184
|
}] } });
|
|
185
185
|
|
|
186
186
|
export { SelectionOptionsEditorComponent };
|
|
187
|
-
//# sourceMappingURL=ngx-t-forms-selection-options-editor.component-
|
|
187
|
+
//# sourceMappingURL=ngx-t-forms-selection-options-editor.component-Cc_qCtW2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-t-forms-selection-options-editor.component-Cc41XG4s.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/selection-options-editor/selection-options-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/selection-options-editor/selection-options-editor.component.html"],"sourcesContent":["import { Component, ElementRef, EventEmitter, HostBinding, Input, Optional, Output, Self } from '@angular/core';\r\n\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormControl, FormGroup, NgControl, ReactiveFormsModule, Validators } from '@angular/forms';\r\nimport { v4 as uuidv4 } from 'uuid';\r\nimport _ from 'lodash';\r\nimport { MatModulesModule } from '../../../../shared/modules/mat-modules.module';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { Subject } from 'rxjs';\r\nimport { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\n// Defined an interface for type safety and clarity\r\ninterface Option {\r\n id: string;\r\n label: string;\r\n value: string;\r\n}\r\n\r\n@Component({\r\n selector: 'app-selection-options-editor',\r\n standalone: true,\r\n imports: [MatModulesModule, ReactiveFormsModule, CommonModule],\r\n providers: [{ provide: MatFormFieldControl, useExisting:SelectionOptionsEditorComponent }],\r\n templateUrl: './selection-options-editor.component.html',\r\n styleUrl: './selection-options-editor.component.scss'\r\n})\r\nexport class SelectionOptionsEditorComponent implements MatFormFieldControl<any> {\r\n value: any;\r\n static nextId = 0;\r\n stateChanges = new Subject<void>();\r\n @Input() errors:IConfigElementError[] |undefined = [];\r\n @HostBinding() id = `app-selection-options-editor-${SelectionOptionsEditorComponent.nextId++}`;\r\n \r\n placeholder: string = ''\r\n constructor(@Optional() @Self() public ngControl: NgControl, private _elementRef: ElementRef<HTMLElement>,) { }\r\n focused: boolean = false;\r\n get empty() {\r\n return !this.value\r\n }\r\n get shouldLabelFloat() {\r\n return this.focused || !this.empty;\r\n }\r\n required: boolean = false;\r\n @Input() disabled: boolean = false;\r\nget errorState(): boolean {\r\n const hasError = !!this.ngControl?.control?.errors || (this.errors||[]).length > 0 && this.touched\r\n return !this.value && !!this.required || hasError\r\n }\r\n\r\n controlType?: string | undefined;\r\n autofilled?: boolean | undefined;\r\n userAriaDescribedBy?: string | undefined;\r\n disableAutomaticLabeling?: boolean | undefined;\r\n setDescribedByIds(ids: string[]) {\r\n // Ensure the component view is initialized\r\n if (this._elementRef && this._elementRef.nativeElement) {\r\n const controlElement = this._elementRef.nativeElement.querySelector('.app-selection-options-editor');\r\n // Check if the controlElement exists before attempting to set its attribute\r\n if (controlElement) {\r\n controlElement.setAttribute('aria-describedby', ids.join(' '));\r\n }\r\n }\r\n }\r\n onContainerClick(event: MouseEvent): void {\r\n this.markAsTouched();\r\n this.stateChanges.next();\r\n }\r\n\r\n touched: boolean = false;\r\n onTouched = () => {};\r\n markAsTouched() {\r\n console.log('markAsTouched') \r\n if (!this.touched) {\r\n this.onTouched();\r\n this.touched = true;\r\n }\r\n } \r\n\r\n // --- Component Logic ---\r\n private _options: Option[] = [];\r\n @Input()\r\n get options(): Option[] {\r\n return this._options || [];\r\n }\r\n set options(val: Option[]) {\r\n if (Array.isArray(val)) {\r\n this._options = val;\r\n }\r\n }\r\n\r\n @Output() valueChanged = new EventEmitter<Option[]>();\r\n\r\n inEdit: any | null = null; // Can be an existing option or a new object {}\r\n form!: FormGroup;\r\n isAutoCamelCase: boolean = true; // Feature toggle for auto camelCase\r\n\r\n /**\r\n * Prepares the form to add a new option.\r\n */\r\n add(): void {\r\n this.inEdit = {}; // A new option is represented by an empty object\r\n this.createForm(this.inEdit);\r\n }\r\n\r\n /**\r\n * Prepares the form to edit an existing option.\r\n * @param option The option to be edited.\r\n */\r\n startEdit(option: Option): void {\r\n // Consistently set the form for editing without toggling\r\n this.inEdit = { ...option }; // Use a copy to avoid mutating the original object until save\r\n this.createForm(this.inEdit);\r\n }\r\n\r\n /**\r\n * Closes the editor form without saving changes.\r\n */\r\n closeEdit(): void {\r\n this.inEdit = null;\r\n }\r\n\r\n /**\r\n * Removes an option from the list after user confirmation.\r\n * @param option The option to be removed.\r\n */\r\n remove(option: Option): void {\r\n // ✨ IMPROVEMENT: Add confirmation before a destructive action\r\n if (confirm(`Are you sure you want to delete the option \"${option.label}\"?`)) {\r\n this.options = _.reject(this.options, { id: option.id });\r\n this.valueChanged.emit(this.options);\r\n // If the deleted option was being edited, close the form\r\n if (this.inEdit && this.inEdit.id === option.id) {\r\n this.closeEdit();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Saves the new or edited option and updates the list.\r\n */\r\n save(): void {\r\n if (this.form.invalid) return;\r\n\r\n const formValue = this.form.value;\r\n // If inEdit has an ID, we are updating an existing option\r\n if (this.inEdit?.id) {\r\n const updatedOption = { ...this.inEdit, ...formValue };\r\n const index = _.findIndex(this.options, { id: updatedOption.id });\r\n if (index !== -1) {\r\n this.options[index] = updatedOption;\r\n }\r\n } else {\r\n // Otherwise, we are adding a new option with a unique ID\r\n const newOption = { ...formValue, id: uuidv4() };\r\n this.options.push(newOption);\r\n }\r\n \r\n this.valueChanged.emit(this.options);\r\n this.closeEdit();\r\n }\r\n \r\n /**\r\n * ✨ NEW: Automatically populates the 'value' field by converting \r\n * the 'label' to camelCase when the value is empty.\r\n */\r\n autoFillValueFromLabel(): void {\r\n if (this.isAutoCamelCase && this.form) {\r\n const labelValue = this.form.get('label')?.value;\r\n const valueControl = this.form.get('value');\r\n\r\n // Only fill if a label exists and the value is currently empty\r\n if (labelValue && !valueControl?.value) {\r\n valueControl?.setValue(_.camelCase(labelValue));\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Initializes the reactive form for adding or editing.\r\n * @param data The option data to populate the form with.\r\n */\r\n private createForm(data: any): void {\r\n this.form = new FormGroup({\r\n label: new FormControl(data.label || '', Validators.required),\r\n value: new FormControl(data.value || '', Validators.required),\r\n });\r\n }\r\n}","<mat-chip-listbox style=\"overflow-x: scroll;\" aria-label=\"Option selection\" [disabled]=\"disabled\">\r\n @for (option of options; track option.id) {\r\n <mat-chip-option \r\n style=\"min-width: fit-content;\"\r\n (click)=\"startEdit(option)\"\r\n color=\"accent\" \r\n [value]=\"option.value\"\r\n [selected]=\"inEdit?.id === option.id\">\r\n \r\n {{ option.label }}\r\n <button matChipRemove (click)=\"$event.stopPropagation(); remove(option)\" [attr.aria-label]=\"'Remove ' + option.label\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-option>\r\n }\r\n</mat-chip-listbox>\r\n\r\n<mat-toolbar *ngIf=\"!inEdit\">\r\n <button style=\"width:100%\" mat-stroked-button (click)=\"add()\">\r\n Add an option <mat-icon>add</mat-icon>\r\n </button>\r\n</mat-toolbar>\r\n\r\n<mat-card *ngIf=\"!!inEdit\">\r\n <mat-card-header>\r\n <mat-card-subtitle>{{ inEdit.id ? 'Edit Option' : 'Add New Option' }}</mat-card-subtitle>\r\n </mat-card-header>\r\n\r\n <mat-card-content style=\"padding-top:16px;\">\r\n <form *ngIf=\"!!form\" [formGroup]=\"form\">\r\n <mat-form-field\r\n style=\"margin-bottom: 16px;\"\r\n subscriptSizing=\"dynamic\"\r\n floatLabel=\"always\"\r\n appearance=\"outline\">\r\n <mat-label>Display Text</mat-label>\r\n <input\r\n type=\"text\"\r\n matInput\r\n formControlName=\"label\"\r\n placeholder=\"Enter option text\"\r\n (blur)=\"autoFillValueFromLabel()\" />\r\n <mat-hint>The text users will see and select from the list.</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field subscriptSizing=\"dynamic\" floatLabel=\"always\" appearance=\"outline\">\r\n <mat-label>Stored Value</mat-label>\r\n <input\r\n type=\"text\"\r\n matInput\r\n formControlName=\"value\"\r\n placeholder=\"Enter data value\"\r\n />\r\n <button matTooltip=\"Toggle auto-creation of value from display text\" \r\n [color]=\"isAutoCamelCase ? 'primary' : ''\" \r\n (click)=\"isAutoCamelCase = !isAutoCamelCase\" \r\n matSuffix\r\n mat-icon-button>\r\n <mat-icon>{{ isAutoCamelCase ? 'drive_file_rename_outline' : 'edit_off' }}</mat-icon>\r\n </button>\r\n <mat-hint>The value saved when this option is chosen. (Often an ID or code)</mat-hint>\r\n </mat-form-field>\r\n </form>\r\n </mat-card-content>\r\n\r\n <mat-card-actions>\r\n <button mat-button (click)=\"closeEdit()\">Cancel</button>\r\n <button mat-flat-button [disabled]=\"form.invalid\" (click)=\"save()\">\r\n {{ inEdit.id ? 'Save Changes' : 'Add Option' }}\r\n </button>\r\n </mat-card-actions>\r\n</mat-card>"],"names":["uuidv4","i4","i5","i6","i7","i8","i9","i10"],"mappings":";;;;;;;;;;;;;;;;;;;;MAyBa,+BAA+B,CAAA;aAEnC,IAA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;;0BAY7E;;0BAAY;kEAJhB,MAAM,EAAA,CAAA;sBAAd;gBACc,EAAE,EAAA,CAAA;sBAAhB;gBAYO,QAAQ,EAAA,CAAA;sBAAhB;gBAsCI,OAAO,EAAA,CAAA;sBADV;gBAUS,YAAY,EAAA,CAAA;sBAArB;;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-selection-options-editor.component-Cc_qCtW2.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/selection-options-editor/selection-options-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/selection-options-editor/selection-options-editor.component.html"],"sourcesContent":["import { Component, ElementRef, EventEmitter, HostBinding, Input, Optional, Output, Self } from '@angular/core';\r\n\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormControl, FormGroup, NgControl, ReactiveFormsModule, Validators } from '@angular/forms';\r\nimport { v4 as uuidv4 } from 'uuid';\r\nimport _ from 'lodash';\r\nimport { MatModulesModule } from '../../../../shared/modules/mat-modules.module';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { Subject } from 'rxjs';\r\nimport { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\n// Defined an interface for type safety and clarity\r\ninterface Option {\r\n id: string;\r\n label: string;\r\n value: string;\r\n}\r\n\r\n@Component({\r\n selector: 'app-selection-options-editor',\r\n standalone: true,\r\n imports: [MatModulesModule, ReactiveFormsModule, CommonModule],\r\n providers: [{ provide: MatFormFieldControl, useExisting:SelectionOptionsEditorComponent }],\r\n templateUrl: './selection-options-editor.component.html',\r\n styleUrl: './selection-options-editor.component.scss'\r\n})\r\nexport class SelectionOptionsEditorComponent implements MatFormFieldControl<any> {\r\n value: any;\r\n static nextId = 0;\r\n stateChanges = new Subject<void>();\r\n @Input() errors:IConfigElementError[] |undefined = [];\r\n @HostBinding() id = `app-selection-options-editor-${SelectionOptionsEditorComponent.nextId++}`;\r\n \r\n placeholder: string = ''\r\n constructor(@Optional() @Self() public ngControl: NgControl, private _elementRef: ElementRef<HTMLElement>,) { }\r\n focused: boolean = false;\r\n get empty() {\r\n return !this.value\r\n }\r\n get shouldLabelFloat() {\r\n return this.focused || !this.empty;\r\n }\r\n required: boolean = false;\r\n @Input() disabled: boolean = false;\r\nget errorState(): boolean {\r\n const hasError = !!this.ngControl?.control?.errors || (this.errors||[]).length > 0 && this.touched\r\n return !this.value && !!this.required || hasError\r\n }\r\n\r\n controlType?: string | undefined;\r\n autofilled?: boolean | undefined;\r\n userAriaDescribedBy?: string | undefined;\r\n disableAutomaticLabeling?: boolean | undefined;\r\n setDescribedByIds(ids: string[]) {\r\n // Ensure the component view is initialized\r\n if (this._elementRef && this._elementRef.nativeElement) {\r\n const controlElement = this._elementRef.nativeElement.querySelector('.app-selection-options-editor');\r\n // Check if the controlElement exists before attempting to set its attribute\r\n if (controlElement) {\r\n controlElement.setAttribute('aria-describedby', ids.join(' '));\r\n }\r\n }\r\n }\r\n onContainerClick(event: MouseEvent): void {\r\n this.markAsTouched();\r\n this.stateChanges.next();\r\n }\r\n\r\n touched: boolean = false;\r\n onTouched = () => {};\r\n markAsTouched() {\r\n console.log('markAsTouched') \r\n if (!this.touched) {\r\n this.onTouched();\r\n this.touched = true;\r\n }\r\n } \r\n\r\n // --- Component Logic ---\r\n private _options: Option[] = [];\r\n @Input()\r\n get options(): Option[] {\r\n return this._options || [];\r\n }\r\n set options(val: Option[]) {\r\n if (Array.isArray(val)) {\r\n this._options = val;\r\n }\r\n }\r\n\r\n @Output() valueChanged = new EventEmitter<Option[]>();\r\n\r\n inEdit: any | null = null; // Can be an existing option or a new object {}\r\n form!: FormGroup;\r\n isAutoCamelCase: boolean = true; // Feature toggle for auto camelCase\r\n\r\n /**\r\n * Prepares the form to add a new option.\r\n */\r\n add(): void {\r\n this.inEdit = {}; // A new option is represented by an empty object\r\n this.createForm(this.inEdit);\r\n }\r\n\r\n /**\r\n * Prepares the form to edit an existing option.\r\n * @param option The option to be edited.\r\n */\r\n startEdit(option: Option): void {\r\n // Consistently set the form for editing without toggling\r\n this.inEdit = { ...option }; // Use a copy to avoid mutating the original object until save\r\n this.createForm(this.inEdit);\r\n }\r\n\r\n /**\r\n * Closes the editor form without saving changes.\r\n */\r\n closeEdit(): void {\r\n this.inEdit = null;\r\n }\r\n\r\n /**\r\n * Removes an option from the list after user confirmation.\r\n * @param option The option to be removed.\r\n */\r\n remove(option: Option): void {\r\n // ✨ IMPROVEMENT: Add confirmation before a destructive action\r\n if (confirm(`Are you sure you want to delete the option \"${option.label}\"?`)) {\r\n this.options = _.reject(this.options, { id: option.id });\r\n this.valueChanged.emit(this.options);\r\n // If the deleted option was being edited, close the form\r\n if (this.inEdit && this.inEdit.id === option.id) {\r\n this.closeEdit();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Saves the new or edited option and updates the list.\r\n */\r\n save(): void {\r\n if (this.form.invalid) return;\r\n\r\n const formValue = this.form.value;\r\n // If inEdit has an ID, we are updating an existing option\r\n if (this.inEdit?.id) {\r\n const updatedOption = { ...this.inEdit, ...formValue };\r\n const index = _.findIndex(this.options, { id: updatedOption.id });\r\n if (index !== -1) {\r\n this.options[index] = updatedOption;\r\n }\r\n } else {\r\n // Otherwise, we are adding a new option with a unique ID\r\n const newOption = { ...formValue, id: uuidv4() };\r\n this.options.push(newOption);\r\n }\r\n \r\n this.valueChanged.emit(this.options);\r\n this.closeEdit();\r\n }\r\n \r\n /**\r\n * ✨ NEW: Automatically populates the 'value' field by converting \r\n * the 'label' to camelCase when the value is empty.\r\n */\r\n autoFillValueFromLabel(): void {\r\n if (this.isAutoCamelCase && this.form) {\r\n const labelValue = this.form.get('label')?.value;\r\n const valueControl = this.form.get('value');\r\n\r\n // Only fill if a label exists and the value is currently empty\r\n if (labelValue && !valueControl?.value) {\r\n valueControl?.setValue(_.camelCase(labelValue));\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Initializes the reactive form for adding or editing.\r\n * @param data The option data to populate the form with.\r\n */\r\n private createForm(data: any): void {\r\n this.form = new FormGroup({\r\n label: new FormControl(data.label || '', Validators.required),\r\n value: new FormControl(data.value || '', Validators.required),\r\n });\r\n }\r\n}","<mat-chip-listbox style=\"overflow-x: scroll;\" aria-label=\"Option selection\" [disabled]=\"disabled\">\r\n @for (option of options; track option.id) {\r\n <mat-chip-option \r\n style=\"min-width: fit-content;\"\r\n (click)=\"startEdit(option)\"\r\n color=\"accent\" \r\n [value]=\"option.value\"\r\n [selected]=\"inEdit?.id === option.id\">\r\n \r\n {{ option.label }}\r\n <button matChipRemove (click)=\"$event.stopPropagation(); remove(option)\" [attr.aria-label]=\"'Remove ' + option.label\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-option>\r\n }\r\n</mat-chip-listbox>\r\n\r\n<mat-toolbar *ngIf=\"!inEdit\">\r\n <button style=\"width:100%\" mat-stroked-button (click)=\"add()\">\r\n Add an option <mat-icon>add</mat-icon>\r\n </button>\r\n</mat-toolbar>\r\n\r\n<mat-card *ngIf=\"!!inEdit\">\r\n <mat-card-header>\r\n <mat-card-subtitle>{{ inEdit.id ? 'Edit Option' : 'Add New Option' }}</mat-card-subtitle>\r\n </mat-card-header>\r\n\r\n <mat-card-content style=\"padding-top:16px;\">\r\n <form *ngIf=\"!!form\" [formGroup]=\"form\">\r\n <mat-form-field\r\n style=\"margin-bottom: 16px;\"\r\n subscriptSizing=\"dynamic\"\r\n floatLabel=\"always\"\r\n appearance=\"outline\">\r\n <mat-label>Display Text</mat-label>\r\n <input\r\n type=\"text\"\r\n matInput\r\n formControlName=\"label\"\r\n placeholder=\"Enter option text\"\r\n (blur)=\"autoFillValueFromLabel()\" />\r\n <mat-hint>The text users will see and select from the list.</mat-hint>\r\n </mat-form-field>\r\n\r\n <mat-form-field subscriptSizing=\"dynamic\" floatLabel=\"always\" appearance=\"outline\">\r\n <mat-label>Stored Value</mat-label>\r\n <input\r\n type=\"text\"\r\n matInput\r\n formControlName=\"value\"\r\n placeholder=\"Enter data value\"\r\n />\r\n <button matTooltip=\"Toggle auto-creation of value from display text\" \r\n [color]=\"isAutoCamelCase ? 'primary' : ''\" \r\n (click)=\"isAutoCamelCase = !isAutoCamelCase\" \r\n matSuffix\r\n mat-icon-button>\r\n <mat-icon>{{ isAutoCamelCase ? 'drive_file_rename_outline' : 'edit_off' }}</mat-icon>\r\n </button>\r\n <mat-hint>The value saved when this option is chosen. (Often an ID or code)</mat-hint>\r\n </mat-form-field>\r\n </form>\r\n </mat-card-content>\r\n\r\n <mat-card-actions>\r\n <button mat-button (click)=\"closeEdit()\">Cancel</button>\r\n <button mat-flat-button [disabled]=\"form.invalid\" (click)=\"save()\">\r\n {{ inEdit.id ? 'Save Changes' : 'Add Option' }}\r\n </button>\r\n </mat-card-actions>\r\n</mat-card>"],"names":["uuidv4","i4","i5","i6","i7","i9","i10"],"mappings":";;;;;;;;;;;;;;;;;;;;MAyBa,+BAA+B,CAAA;aAEnC,IAAM,CAAA,MAAA,GAAG,CAAH,CAAK;IAMlB,WAAuC,CAAA,SAAoB,EAAU,WAAoC,EAAA;QAAlE,IAAS,CAAA,SAAA,GAAT,SAAS;QAAqB,IAAW,CAAA,WAAA,GAAX,WAAW;AALhF,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,OAAO,EAAQ;QACzB,IAAM,CAAA,MAAA,GAAoC,EAAE;AACtC,QAAA,IAAA,CAAA,EAAE,GAAG,CAAgC,6BAAA,EAAA,+BAA+B,CAAC,MAAM,EAAE,EAAE;QAE9F,IAAW,CAAA,WAAA,GAAW,EAAE;QAExB,IAAO,CAAA,OAAA,GAAY,KAAK;QAOxB,IAAQ,CAAA,QAAA,GAAY,KAAK;QACjB,IAAQ,CAAA,QAAA,GAAY,KAAK;QAyBjC,IAAO,CAAA,OAAA,GAAY,KAAK;AACxB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAK,GAAG;;QAUZ,IAAQ,CAAA,QAAA,GAAa,EAAE;AAWrB,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,Y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CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,mBAAmB,48BAAE,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAC,IAAA,CAAA,IAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAKlD,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAR3C,SAAS;+BACE,8BAA8B,EAAA,UAAA,EAC5B,IAAI,EACP,OAAA,EAAA,CAAC,gBAAgB,EAAE,mBAAmB,EAAE,YAAY,CAAC,aACnD,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAA,+BAAgC,EAAE,CAAC,EAAA,QAAA,EAAA,6vFAAA,EAAA,MAAA,EAAA,CAAA,yDAAA,CAAA,EAAA;;0BAY7E;;0BAAY;kEAJhB,MAAM,EAAA,CAAA;sBAAd;gBACc,EAAE,EAAA,CAAA;sBAAhB;gBAYO,QAAQ,EAAA,CAAA;sBAAhB;gBAsCI,OAAO,EAAA,CAAA;sBADV;gBAUS,YAAY,EAAA,CAAA;sBAArB;;;;;"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Output, Input, HostBinding, Optional, Self, Component } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { M as MatModulesModule } from './ngx-t-forms-ngx-t-forms-CD9InaXz.mjs';
|
|
6
|
+
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
7
|
+
import { Subject, take, tap, catchError } from 'rxjs';
|
|
8
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
9
|
+
import * as i1 from '@angular/forms';
|
|
10
|
+
import * as i2$1 from '@angular/material/button';
|
|
11
|
+
import * as i3 from '@angular/material/card';
|
|
12
|
+
import * as i5 from '@angular/material/chips';
|
|
13
|
+
import * as i4 from '@angular/material/divider';
|
|
14
|
+
import * as i2$2 from '@angular/material/icon';
|
|
15
|
+
import * as i7 from '@angular/material/list';
|
|
16
|
+
import * as i3$1 from '@angular/material/progress-spinner';
|
|
17
|
+
import * as i10 from '@angular/material/toolbar';
|
|
18
|
+
|
|
19
|
+
class TWorkflowPickerComponent {
|
|
20
|
+
static { this.nextId = 0; }
|
|
21
|
+
get required() {
|
|
22
|
+
return this._required;
|
|
23
|
+
}
|
|
24
|
+
set required(value) {
|
|
25
|
+
this._required = coerceBooleanProperty(value);
|
|
26
|
+
this.stateChanges.next();
|
|
27
|
+
}
|
|
28
|
+
get value() {
|
|
29
|
+
return this._value;
|
|
30
|
+
}
|
|
31
|
+
set value(val) {
|
|
32
|
+
this._value = val;
|
|
33
|
+
this.onChange(val);
|
|
34
|
+
this.stateChanges.next();
|
|
35
|
+
}
|
|
36
|
+
get placeholder() {
|
|
37
|
+
return this._placeholder;
|
|
38
|
+
}
|
|
39
|
+
set placeholder(value) {
|
|
40
|
+
this._placeholder = value;
|
|
41
|
+
this.stateChanges.next();
|
|
42
|
+
}
|
|
43
|
+
get shouldLabelFloat() {
|
|
44
|
+
return this.focused || !this.empty;
|
|
45
|
+
}
|
|
46
|
+
get empty() {
|
|
47
|
+
return !this.value || this.value.length === 0;
|
|
48
|
+
}
|
|
49
|
+
get errorState() {
|
|
50
|
+
return !this.value && this.required && this.touched || !!this.ngControl?.errors || (this.errors || []).length > 0;
|
|
51
|
+
}
|
|
52
|
+
constructor(ngControl, _elementRef) {
|
|
53
|
+
this.ngControl = ngControl;
|
|
54
|
+
this._elementRef = _elementRef;
|
|
55
|
+
this.stateChanges = new Subject();
|
|
56
|
+
this.focused = false;
|
|
57
|
+
this.touched = false;
|
|
58
|
+
this.disabled = false;
|
|
59
|
+
this.controlType = 'lib-t-workflow-picker';
|
|
60
|
+
this.autofilled = false;
|
|
61
|
+
this.errors = [];
|
|
62
|
+
this.valueChange = new EventEmitter();
|
|
63
|
+
this._required = false;
|
|
64
|
+
this._value = undefined;
|
|
65
|
+
this._placeholder = '';
|
|
66
|
+
this.id = `lib-t-workflow-picker-${TWorkflowPickerComponent.nextId++}`;
|
|
67
|
+
this.describedBy = '';
|
|
68
|
+
// ControlValueAccessor methods
|
|
69
|
+
this.onChange = (_) => { };
|
|
70
|
+
this.onTouched = () => { };
|
|
71
|
+
this.valueChanged = new EventEmitter();
|
|
72
|
+
this.workflowNameChanged = new EventEmitter();
|
|
73
|
+
this.error = undefined;
|
|
74
|
+
this.loading = false;
|
|
75
|
+
if (this.ngControl != null) {
|
|
76
|
+
this.ngControl.valueAccessor = this;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
ngOnInit() {
|
|
80
|
+
this.loadWorkflows();
|
|
81
|
+
}
|
|
82
|
+
writeValue(value) {
|
|
83
|
+
this._value = value;
|
|
84
|
+
this.stateChanges.next();
|
|
85
|
+
}
|
|
86
|
+
registerOnChange(fn) {
|
|
87
|
+
this.onChange = fn;
|
|
88
|
+
}
|
|
89
|
+
registerOnTouched(fn) {
|
|
90
|
+
this.onTouched = fn;
|
|
91
|
+
}
|
|
92
|
+
setDisabledState(isDisabled) {
|
|
93
|
+
this.disabled = isDisabled;
|
|
94
|
+
this.stateChanges.next();
|
|
95
|
+
}
|
|
96
|
+
// MatFormFieldControl methods
|
|
97
|
+
setDescribedByIds(ids) {
|
|
98
|
+
const element = this._elementRef?.nativeElement;
|
|
99
|
+
if (element) {
|
|
100
|
+
element.setAttribute('aria-describedby', ids.join(' '));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
onContainerClick(event) {
|
|
104
|
+
if (!this.focused) {
|
|
105
|
+
this.focused = true;
|
|
106
|
+
this.stateChanges.next();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
markAsTouched() {
|
|
110
|
+
if (!this.touched) {
|
|
111
|
+
this.touched = true;
|
|
112
|
+
this.onTouched();
|
|
113
|
+
this.stateChanges.next();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
set getWorkflowOptions(value) {
|
|
117
|
+
this._getWorkflowOptions = value;
|
|
118
|
+
}
|
|
119
|
+
get workflowOptions() {
|
|
120
|
+
return this._workflowOptions || [];
|
|
121
|
+
}
|
|
122
|
+
unbindInput() {
|
|
123
|
+
this.value = undefined;
|
|
124
|
+
this.valueChanged.emit(this.value);
|
|
125
|
+
this.workflowNameChanged.emit(undefined);
|
|
126
|
+
}
|
|
127
|
+
bindInput(workflow) {
|
|
128
|
+
this.valueChanged.emit(workflow.id);
|
|
129
|
+
this.workflowNameChanged.emit(workflow.name);
|
|
130
|
+
}
|
|
131
|
+
get selectedWorkflow() {
|
|
132
|
+
return this._workflowOptions?.find((workflow) => workflow.id === this.value);
|
|
133
|
+
}
|
|
134
|
+
loadWorkflows() {
|
|
135
|
+
if (!this._getWorkflowOptions)
|
|
136
|
+
return;
|
|
137
|
+
this.loading = true;
|
|
138
|
+
this._getWorkflowOptions?.pipe(take(1), tap(workflows => {
|
|
139
|
+
this.error = undefined;
|
|
140
|
+
this._workflowOptions = workflows;
|
|
141
|
+
this.loading = false;
|
|
142
|
+
}, catchError((error) => {
|
|
143
|
+
this.loading = false;
|
|
144
|
+
this.error = error;
|
|
145
|
+
return error;
|
|
146
|
+
}))).subscribe();
|
|
147
|
+
}
|
|
148
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TWorkflowPickerComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
149
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TWorkflowPickerComponent, isStandalone: true, selector: "lib-t-workflow-picker", inputs: { disabled: "disabled", errors: "errors", required: "required", value: "value", placeholder: "placeholder", getWorkflowOptions: "getWorkflowOptions" }, outputs: { valueChange: "valueChange", valueChanged: "valueChanged", workflowNameChanged: "workflowNameChanged" }, host: { properties: { "id": "this.id", "attr.aria-describedby": "this.describedBy", "class.floating": "this.shouldLabelFloat" } }, providers: [{ provide: MatFormFieldControl, useExisting: TWorkflowPickerComponent, }], ngImport: i0, template: "@if (error) {\r\n<mat-toolbar>\r\n <span>\r\n Failed to load workflow list\r\n </span>\r\n <span class=\"spacer\"></span>\r\n <button color=\"primary\" mat-raised-button>\r\n Retry\r\n\r\n </button>\r\n</mat-toolbar>\r\n}@else {\r\n <mat-toolbar>\r\n <span style=\"font-size: x-small;\">\r\n Reload Worlkflows\r\n </span>\r\n <span class=\"spacer\">\r\n\r\n </span>\r\n <button (click)=\"loadWorkflows()\" mat-stroked-button>\r\n Reload \r\n <mat-icon>\r\n refresh\r\n </mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n}\r\n@if(loading){\r\n<div class=\"loadingContainer\">\r\n <mat-spinner></mat-spinner>\r\n</div>\r\n}\r\n@if(!loading&& !error){\r\n<mat-card>\r\n <mat-nav-list style=\"padding: 0px;\">\r\n @if(!value){\r\n @for (option of workflowOptions; track option.id) {\r\n <mat-list-item (click)=\"bindInput(option)\">\r\n\r\n <mat-chip class=\"docType\" \r\n \r\n [style.background]=\"!option.isCheckInCheckOut && option['isDocument'] ? 'lightskyblue' :option.isCheckInCheckOut?'antiquewhite':'' \"\r\n \r\n matListItemIcon>\r\n <span style=\"font-size: 0.625em;\">\r\n @if (option.isCheckInCheckOut) {\r\n IN/OUT\r\n }@else {\r\n {{ option[\"isDocument\"] ? \"DOC\" : \"FLOW\" }}\r\n }\r\n\r\n </span>\r\n </mat-chip>\r\n\r\n\r\n <div matListItemTitle>\r\n <div>\r\n {{ option.name }}\r\n </div>\r\n\r\n <div style=\"font-size: 0.8125em; opacity: 0.6;line-height:normal\">\r\n {{ option[\"createdAt\"] | date: \"medium\" }} \r\n {{ option.numberOfSteps }}\r\n </div>\r\n </div>\r\n <button matListItemMeta mat-icon-button>\r\n <mat-icon>\r\n radio_button_unchecked\r\n </mat-icon>\r\n </button>\r\n\r\n </mat-list-item>\r\n <mat-divider></mat-divider>\r\n }\r\n }\r\n @if(value){\r\n <mat-list-item (click)=\" unbindInput() \">\r\n\r\n <mat-chip class=\"docType\" \r\n \r\n [style.background]=\"!selectedWorkflow?.isCheckInCheckOut && selectedWorkflow?.['isDocument'] ? 'lightskyblue' :selectedWorkflow?.isCheckInCheckOut?'antiquewhite':'' \"\r\n matListItemIcon>\r\n <span style=\"font-size: 0.625em;\">\r\n @if (selectedWorkflow?.isCheckInCheckOut) {\r\n IN/OUT\r\n }@else {\r\n {{ selectedWorkflow?.[\"isDocument\"] ? \"DOC\" : \"FLOW\" }}\r\n }\r\n </span>\r\n </mat-chip>\r\n\r\n\r\n <div matListItemTitle>\r\n <div>\r\n {{ selectedWorkflow?.name }}\r\n </div>\r\n\r\n <div style=\"font-size: 0.8125em; opacity: 0.6;line-height:normal\">\r\n {{selectedWorkflow?.[\"createdAt\"] | date: \"medium\" }} \r\n {{ selectedWorkflow?.numberOfSteps }}\r\n </div>\r\n </div>\r\n <button matListItemMeta mat-icon-button>\r\n <mat-icon color=\"primary\">\r\n check_circle\r\n </mat-icon>\r\n </button>\r\n\r\n </mat-list-item>\r\n }\r\n\r\n\r\n </mat-nav-list>\r\n \r\n</mat-card>\r\n\r\n}", styles: [".suggestion-container{display:flex;width:100%;gap:14px}.docType{width:min-content;margin-top:auto!important;margin-bottom:auto!important}mat-card{margin-bottom:8px;background:var(--mat-sys-surface-container, var(--mat-app-surface))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "ngmodule", type: MatModulesModule }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i5.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "component", type: i4.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i7.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i7.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i7.MatListItemIcon, selector: "[matListItemIcon]" }, { kind: "directive", type: i7.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "directive", type: i7.MatListItemMeta, selector: "[matListItemMeta]" }, { kind: "component", type: i3$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i10.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }] }); }
|
|
150
|
+
}
|
|
151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TWorkflowPickerComponent, decorators: [{
|
|
152
|
+
type: Component,
|
|
153
|
+
args: [{ selector: 'lib-t-workflow-picker', standalone: true, imports: [CommonModule, MatModulesModule], providers: [{ provide: MatFormFieldControl, useExisting: TWorkflowPickerComponent, }], template: "@if (error) {\r\n<mat-toolbar>\r\n <span>\r\n Failed to load workflow list\r\n </span>\r\n <span class=\"spacer\"></span>\r\n <button color=\"primary\" mat-raised-button>\r\n Retry\r\n\r\n </button>\r\n</mat-toolbar>\r\n}@else {\r\n <mat-toolbar>\r\n <span style=\"font-size: x-small;\">\r\n Reload Worlkflows\r\n </span>\r\n <span class=\"spacer\">\r\n\r\n </span>\r\n <button (click)=\"loadWorkflows()\" mat-stroked-button>\r\n Reload \r\n <mat-icon>\r\n refresh\r\n </mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n}\r\n@if(loading){\r\n<div class=\"loadingContainer\">\r\n <mat-spinner></mat-spinner>\r\n</div>\r\n}\r\n@if(!loading&& !error){\r\n<mat-card>\r\n <mat-nav-list style=\"padding: 0px;\">\r\n @if(!value){\r\n @for (option of workflowOptions; track option.id) {\r\n <mat-list-item (click)=\"bindInput(option)\">\r\n\r\n <mat-chip class=\"docType\" \r\n \r\n [style.background]=\"!option.isCheckInCheckOut && option['isDocument'] ? 'lightskyblue' :option.isCheckInCheckOut?'antiquewhite':'' \"\r\n \r\n matListItemIcon>\r\n <span style=\"font-size: 0.625em;\">\r\n @if (option.isCheckInCheckOut) {\r\n IN/OUT\r\n }@else {\r\n {{ option[\"isDocument\"] ? \"DOC\" : \"FLOW\" }}\r\n }\r\n\r\n </span>\r\n </mat-chip>\r\n\r\n\r\n <div matListItemTitle>\r\n <div>\r\n {{ option.name }}\r\n </div>\r\n\r\n <div style=\"font-size: 0.8125em; opacity: 0.6;line-height:normal\">\r\n {{ option[\"createdAt\"] | date: \"medium\" }} \r\n {{ option.numberOfSteps }}\r\n </div>\r\n </div>\r\n <button matListItemMeta mat-icon-button>\r\n <mat-icon>\r\n radio_button_unchecked\r\n </mat-icon>\r\n </button>\r\n\r\n </mat-list-item>\r\n <mat-divider></mat-divider>\r\n }\r\n }\r\n @if(value){\r\n <mat-list-item (click)=\" unbindInput() \">\r\n\r\n <mat-chip class=\"docType\" \r\n \r\n [style.background]=\"!selectedWorkflow?.isCheckInCheckOut && selectedWorkflow?.['isDocument'] ? 'lightskyblue' :selectedWorkflow?.isCheckInCheckOut?'antiquewhite':'' \"\r\n matListItemIcon>\r\n <span style=\"font-size: 0.625em;\">\r\n @if (selectedWorkflow?.isCheckInCheckOut) {\r\n IN/OUT\r\n }@else {\r\n {{ selectedWorkflow?.[\"isDocument\"] ? \"DOC\" : \"FLOW\" }}\r\n }\r\n </span>\r\n </mat-chip>\r\n\r\n\r\n <div matListItemTitle>\r\n <div>\r\n {{ selectedWorkflow?.name }}\r\n </div>\r\n\r\n <div style=\"font-size: 0.8125em; opacity: 0.6;line-height:normal\">\r\n {{selectedWorkflow?.[\"createdAt\"] | date: \"medium\" }} \r\n {{ selectedWorkflow?.numberOfSteps }}\r\n </div>\r\n </div>\r\n <button matListItemMeta mat-icon-button>\r\n <mat-icon color=\"primary\">\r\n check_circle\r\n </mat-icon>\r\n </button>\r\n\r\n </mat-list-item>\r\n }\r\n\r\n\r\n </mat-nav-list>\r\n \r\n</mat-card>\r\n\r\n}", styles: [".suggestion-container{display:flex;width:100%;gap:14px}.docType{width:min-content;margin-top:auto!important;margin-bottom:auto!important}mat-card{margin-bottom:8px;background:var(--mat-sys-surface-container, var(--mat-app-surface))}\n"] }]
|
|
154
|
+
}], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
|
|
155
|
+
type: Optional
|
|
156
|
+
}, {
|
|
157
|
+
type: Self
|
|
158
|
+
}] }, { type: i0.ElementRef }], propDecorators: { disabled: [{
|
|
159
|
+
type: Input
|
|
160
|
+
}], errors: [{
|
|
161
|
+
type: Input
|
|
162
|
+
}], valueChange: [{
|
|
163
|
+
type: Output
|
|
164
|
+
}], required: [{
|
|
165
|
+
type: Input
|
|
166
|
+
}], value: [{
|
|
167
|
+
type: Input
|
|
168
|
+
}], placeholder: [{
|
|
169
|
+
type: Input
|
|
170
|
+
}], id: [{
|
|
171
|
+
type: HostBinding
|
|
172
|
+
}], describedBy: [{
|
|
173
|
+
type: HostBinding,
|
|
174
|
+
args: ['attr.aria-describedby']
|
|
175
|
+
}], shouldLabelFloat: [{
|
|
176
|
+
type: HostBinding,
|
|
177
|
+
args: ['class.floating']
|
|
178
|
+
}], getWorkflowOptions: [{
|
|
179
|
+
type: Input
|
|
180
|
+
}], valueChanged: [{
|
|
181
|
+
type: Output
|
|
182
|
+
}], workflowNameChanged: [{
|
|
183
|
+
type: Output
|
|
184
|
+
}] } });
|
|
185
|
+
|
|
186
|
+
export { TWorkflowPickerComponent };
|
|
187
|
+
//# sourceMappingURL=ngx-t-forms-t-workflow-picker.component-xvX8t0pu.mjs.map
|