ngx-t-forms 2.0.5 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{ngx-t-forms-api-value-access-rules.component-DVxjY46W.mjs → ngx-t-forms-api-value-access-rules.component--ueeSVqR.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-api-value-access-rules.component-DVxjY46W.mjs.map → ngx-t-forms-api-value-access-rules.component--ueeSVqR.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-CF0b2IAN.mjs → ngx-t-forms-calculated-field-rules.component-BN_-yZi7.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-CF0b2IAN.mjs.map → ngx-t-forms-calculated-field-rules.component-BN_-yZi7.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-DEDrjICX.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-D_IRYDOM.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-DEDrjICX.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-D_IRYDOM.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-input-selector.component-BZLCiTEx.mjs → ngx-t-forms-form-input-selector.component-67wrHiYd.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-input-selector.component-BZLCiTEx.mjs.map → ngx-t-forms-form-input-selector.component-67wrHiYd.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-json-view.component-BbPsAiEG.mjs → ngx-t-forms-form-json-view.component-3SIqgTUg.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-json-view.component-BbPsAiEG.mjs.map → ngx-t-forms-form-json-view.component-3SIqgTUg.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-BYli3qzy.mjs → ngx-t-forms-form-section-stepper.component-CmIrhO2e.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-BYli3qzy.mjs.map → ngx-t-forms-form-section-stepper.component-CmIrhO2e.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-beIiFQyM.mjs → ngx-t-forms-forms-builder-menu.component-aRCX4Hz7.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-beIiFQyM.mjs.map → ngx-t-forms-forms-builder-menu.component-aRCX4Hz7.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-input-editor.component-CItOFrvx.mjs → ngx-t-forms-input-editor.component-mXuY17jv.mjs} +7 -137
- package/fesm2022/ngx-t-forms-input-editor.component-mXuY17jv.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-D1jGY0Wp.mjs → ngx-t-forms-mat-chip-list-editor.component-Cm59yS0V.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-D1jGY0Wp.mjs.map → ngx-t-forms-mat-chip-list-editor.component-Cm59yS0V.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mat-slider-editor.component-bDCnls3E.mjs → ngx-t-forms-mat-slider-editor.component-Cf-bgYEw.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mat-slider-editor.component-bDCnls3E.mjs.map → ngx-t-forms-mat-slider-editor.component-Cf-bgYEw.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mat-slider-toggle-editor.component-C7q7RAhA.mjs → ngx-t-forms-mat-slider-toggle-editor.component-BghPaJ4n.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mat-slider-toggle-editor.component-C7q7RAhA.mjs.map → ngx-t-forms-mat-slider-toggle-editor.component-BghPaJ4n.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-kdu_ar17.mjs → ngx-t-forms-missing-form-configs.component-CB9fHHqd.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-kdu_ar17.mjs.map → ngx-t-forms-missing-form-configs.component-CB9fHHqd.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-B80B7Y2g.mjs → ngx-t-forms-mscoa-segment-config.component-BDVj1NFN.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-B80B7Y2g.mjs.map → ngx-t-forms-mscoa-segment-config.component-BDVj1NFN.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-ngx-t-forms-BIKaG6Gx.mjs → ngx-t-forms-ngx-t-forms-8hOAg-8v.mjs} +160 -28
- package/fesm2022/ngx-t-forms-ngx-t-forms-8hOAg-8v.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-CZRBVUb4.mjs → ngx-t-forms-pipeline-generator.component-IEocJSHF.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-CZRBVUb4.mjs.map → ngx-t-forms-pipeline-generator.component-IEocJSHF.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-required-inputs.component-CnRGUtEj.mjs → ngx-t-forms-required-inputs.component-B6tNZ162.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-required-inputs.component-CnRGUtEj.mjs.map → ngx-t-forms-required-inputs.component-B6tNZ162.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-C_zsy4Pr.mjs → ngx-t-forms-rest-api-call-setup.component-YNPCGXf7.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-C_zsy4Pr.mjs.map → ngx-t-forms-rest-api-call-setup.component-YNPCGXf7.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-section-report.component-y45ZmKLZ.mjs → ngx-t-forms-section-report.component-Ch5q5jLF.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-section-report.component-y45ZmKLZ.mjs.map → ngx-t-forms-section-report.component-Ch5q5jLF.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-CKdTcvyb.mjs → ngx-t-forms-selection-options-editor.component-Cg8VpW0u.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-CKdTcvyb.mjs.map → ngx-t-forms-selection-options-editor.component-Cg8VpW0u.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-validators-config.component-CTUwEJKh.mjs → ngx-t-forms-validators-config.component-CtKO5o6m.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-validators-config.component-CTUwEJKh.mjs.map → ngx-t-forms-validators-config.component-CtKO5o6m.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms.mjs +1 -1
- package/lib/components/form-builder/elements/input-element-editor/input-element-editor.component.d.ts +3 -5
- package/lib/components/forms/store/Form-selectors-FormBuilder.d.ts +12 -0
- package/lib/components/forms/store/forms-store.service.d.ts +12 -0
- package/package.json +1 -1
- package/fesm2022/ngx-t-forms-input-editor.component-CItOFrvx.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-BIKaG6Gx.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-t-forms-mat-slider-toggle-editor.component-
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-mat-slider-toggle-editor.component-BghPaJ4n.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mat-slider-toggle-editor/mat-slider-toggle-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mat-slider-toggle-editor/mat-slider-toggle-editor.component.html"],"sourcesContent":["import { Component, ElementRef, EventEmitter, HostBinding, Input, Optional, Output, Self } from '@angular/core';\r\nimport { MatModulesModule } from '../../../../shared/modules/mat-modules.module';\r\nimport { CommonModule } from '@angular/common';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { Subject } from 'rxjs/internal/Subject';\r\nimport { ControlValueAccessor, NgControl } from '@angular/forms';\r\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\r\nimport { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\n\r\n@Component({\r\n selector: 'lib-mat-slider-toggle-editor',\r\n standalone: true,\r\n imports: [MatModulesModule,CommonModule],\r\n templateUrl: './mat-slider-toggle-editor.component.html',\r\n styleUrl: './mat-slider-toggle-editor.component.css',\r\n providers: [\r\n {\r\n provide: MatFormFieldControl,\r\n useExisting: MatSliderToggleEditorComponent\r\n }\r\n ],\r\n})\r\nexport class MatSliderToggleEditorComponent implements MatFormFieldControl<boolean>, ControlValueAccessor {\r\n static nextId = 0;\r\n stateChanges = new Subject<void>();\r\n focused = false;\r\n touched = false;\r\n disabled = false;\r\n controlType = 'lib-mat-slider-toggle-editor';\r\n autofilled = false;\r\n\r\n @Input() name: string | undefined = undefined;\r\n @Input() label: string = '';\r\n @Input() errors:IConfigElementError[] | undefined = [];\r\n @Output() valueChange = new EventEmitter<boolean>();\r\n\r\n private _required = false;\r\n @Input()\r\n get required(): boolean {\r\n return this._required;\r\n }\r\n set required(value: boolean) {\r\n this._required = coerceBooleanProperty(value);\r\n this.stateChanges.next();\r\n }\r\n\r\n private _value: boolean = false;\r\n @Input()\r\n get value(): boolean {\r\n return this._value;\r\n }\r\n set value(val: boolean) {\r\n this._value = val;\r\n this.onChange(val);\r\n this.stateChanges.next();\r\n }\r\n\r\n @Input()\r\n get placeholder(): string {\r\n return this._placeholder;\r\n }\r\n set placeholder(value: string) {\r\n this._placeholder = value;\r\n this.stateChanges.next();\r\n }\r\n private _placeholder: string = '';\r\n\r\n @HostBinding() id = `lib-mat-slider-toggle-editor-${MatSliderToggleEditorComponent.nextId++}`;\r\n @HostBinding('attr.aria-describedby') describedBy = '';\r\n @HostBinding('class.floating') get shouldLabelFloat() {\r\n return this.focused || !this.empty;\r\n }\r\n\r\n get empty(): boolean {\r\n return this.value === false;\r\n }\r\n\r\n get errorState(): boolean {\r\n return !this.value && this.required && this.touched || !!this.ngControl?.errors || (this.errors||[]).length >0;\r\n }\r\n\r\n constructor(\r\n @Optional() @Self() public ngControl: NgControl,\r\n private _elementRef: ElementRef<HTMLElement>\r\n ) {\r\n if (this.ngControl != null) {\r\n this.ngControl.valueAccessor = this;\r\n }\r\n }\r\n\r\n // ControlValueAccessor methods\r\n onChange = (_: any) => {};\r\n onTouched = () => {};\r\n\r\n writeValue(value: boolean): void {\r\n this._value = value;\r\n this.stateChanges.next();\r\n }\r\n\r\n registerOnChange(fn: any): void {\r\n this.onChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: any): void {\r\n this.onTouched = fn;\r\n }\r\n\r\n setDisabledState(isDisabled: boolean): void {\r\n this.disabled = isDisabled;\r\n this.stateChanges.next();\r\n }\r\n\r\n // MatFormFieldControl methods\r\n setDescribedByIds(ids: string[]): void {\r\n const element = this._elementRef?.nativeElement;\r\n if (element) {\r\n element.setAttribute('aria-describedby', ids.join(' '));\r\n }\r\n }\r\n\r\n onContainerClick(event: MouseEvent): void {\r\n if (!this.focused) {\r\n this.focused = true;\r\n this.stateChanges.next();\r\n }\r\n }\r\n\r\n markAsTouched(): void {\r\n if (!this.touched) {\r\n this.touched = true;\r\n this.onTouched();\r\n this.stateChanges.next();\r\n }\r\n }\r\n\r\n valueToggleChanged(value: boolean): void {\r\n this.value = value;\r\n this.valueChange.emit(value);\r\n this.markAsTouched();\r\n }\r\n}","<mat-slide-toggle\r\n [disabled]=\"disabled\"\r\n [checked]=\"!!value\"\r\n (change)=\"valueToggleChanged($event.checked)\"\r\n (blur)=\"markAsTouched()\"\r\n>\r\n set <strong>on/off</strong> {{ label }}\r\n</mat-slide-toggle>"],"names":[],"mappings":";;;;;;;;;;MAsBa,8BAA8B,CAAA;aAClC,IAAM,CAAA,MAAA,GAAG,CAAH,CAAK;AAclB,IAAA,IACI,QAAQ,GAAA;QACV,OAAO,IAAI,CAAC,SAAS;;IAEvB,IAAI,QAAQ,CAAC,KAAc,EAAA;AACzB,QAAA,IAAI,CAAC,SAAS,GAAG,qBAAqB,CAAC,KAAK,CAAC;AAC7C,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;;AAI1B,IAAA,IACI,K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A;sBAAd;gBACS,WAAW,EAAA,CAAA;sBAApB;gBAIG,QAAQ,EAAA,CAAA;sBADX;gBAWG,KAAK,EAAA,CAAA;sBADR;gBAWG,WAAW,EAAA,CAAA;sBADd;gBAUc,EAAE,EAAA,CAAA;sBAAhB;gBACqC,WAAW,EAAA,CAAA;sBAAhD,WAAW;uBAAC,uBAAuB;gBACD,gBAAgB,EAAA,CAAA;sBAAlD,WAAW;uBAAC,gBAAgB;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Component } from '@angular/core';
|
|
3
|
-
import { F as FormsStoreService, M as MatModulesModule } from './ngx-t-forms-ngx-t-forms-
|
|
3
|
+
import { F as FormsStoreService, M as MatModulesModule } from './ngx-t-forms-ngx-t-forms-8hOAg-8v.mjs';
|
|
4
4
|
import * as i2$1 from '@angular/common';
|
|
5
5
|
import { CommonModule } from '@angular/common';
|
|
6
6
|
import * as i2 from '@angular/material/button';
|
|
@@ -25,4 +25,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
25
25
|
}], ctorParameters: () => [{ type: FormsStoreService }] });
|
|
26
26
|
|
|
27
27
|
export { MissingFormConfigsComponent };
|
|
28
|
-
//# sourceMappingURL=ngx-t-forms-missing-form-configs.component-
|
|
28
|
+
//# sourceMappingURL=ngx-t-forms-missing-form-configs.component-CB9fHHqd.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-t-forms-missing-form-configs.component-
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-missing-form-configs.component-CB9fHHqd.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/missing-form-configs/missing-form-configs.component.ts","../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/missing-form-configs/missing-form-configs.component.html"],"sourcesContent":["import { Component } from '@angular/core';\r\nimport { MatModulesModule } from '../../../../shared/modules/mat-modules.module';\r\n\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsStoreService } from '../../../forms/store/forms-store.service';\r\n\r\n\r\n\r\n@Component({\r\n selector: 'app-missing-form-configs',\r\n standalone: true,\r\n imports: [MatModulesModule, CommonModule],\r\n templateUrl: './missing-form-configs.component.html',\r\n styleUrl: './missing-form-configs.component.scss'\r\n})\r\nexport class MissingFormConfigsComponent {\r\n errors$ = this.store.formBuilderSelectors.formValidationErrorsMessages$\r\n missingConfigs$ = this.store.formBuilderSelectors.missingConfig$\r\n constructor(private store: FormsStoreService) { }\r\n hideDetails: boolean = true;\r\n showAllErrors: boolean = false\r\n\r\n}\r\n","@if (hideDetails) {\r\n<button \r\nmatTooltip=\"Click to view form configuration issues and validation errors\"\r\nstyle=\"margin: 16px;\" (click)=\"hideDetails = false\" mat-fab color=\"warn\" aria-label=\"Error icon\">\r\n <mat-icon>error</mat-icon>\r\n</button>\r\n}@else {\r\n<div style=\"margin: 8px;position:relative\" class=\"content \">\r\n <mat-toolbar color=\"warn\">\r\n <button (click)=\" hideDetails = true\" mat-icon-button>\r\n <mat-icon>\r\n close\r\n </mat-icon>\r\n </button>\r\n Missing configurations:\r\n <span class=\"spacer\"></span>\r\n <button [matTooltip]=\"showAllErrors?'Hide all errors':'Show all errors'\"\r\n (click)=\"showAllErrors = !showAllErrors\" mat-icon-button>\r\n\r\n <mat-icon>\r\n unfold_more\r\n </mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n <section style=\"padding: 16px;\" >\r\n <h5>\r\n <strong>\r\n Overall form issues:\r\n </strong>\r\n </h5>\r\n <ul>\r\n @for (issue of (missingConfigs$|async);track issue) {\r\n <li>\r\n {{issue}}\r\n </li>\r\n }\r\n </ul>\r\n\r\n @if(showAllErrors){\r\n <h5>\r\n <strong>\r\n\r\n Form validationErrors :\r\n\r\n </strong>\r\n\r\n\r\n </h5>\r\n <ul>\r\n @for (error of errors$|async; track error) {\r\n\r\n <li>\r\n\r\n {{error}}\r\n\r\n </li>\r\n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gBAAgB,EAAE,YAAY,CAAC,EAAA,QAAA,EAAA,urDAAA,EAAA,MAAA,EAAA,CAAA,gQAAA,CAAA,EAAA;;;;;"}
|
|
@@ -5,7 +5,7 @@ import { EventEmitter, Output, Input, HostBinding, Optional, Self, Component } f
|
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
6
6
|
import { Validators, ReactiveFormsModule } from '@angular/forms';
|
|
7
7
|
import { Subject, BehaviorSubject, take, tap, catchError, takeUntil } from 'rxjs';
|
|
8
|
-
import { M as MatModulesModule } from './ngx-t-forms-ngx-t-forms-
|
|
8
|
+
import { M as MatModulesModule } from './ngx-t-forms-ngx-t-forms-8hOAg-8v.mjs';
|
|
9
9
|
import * as i4$1 from '@angular/material/form-field';
|
|
10
10
|
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
11
11
|
import * as i2$1 from '@angular/material/core';
|
|
@@ -227,4 +227,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
227
227
|
}] } });
|
|
228
228
|
|
|
229
229
|
export { MscoaSegmentConfigComponent };
|
|
230
|
-
//# sourceMappingURL=ngx-t-forms-mscoa-segment-config.component-
|
|
230
|
+
//# sourceMappingURL=ngx-t-forms-mscoa-segment-config.component-BDVj1NFN.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-t-forms-mscoa-segment-config.component-B80B7Y2g.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mscoa-segment-config/mscoa-segment-config.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mscoa-segment-config/mscoa-segment-config.component.html"],"sourcesContent":["import { CommonModule } from '@angular/common';\r\nimport { Component, ElementRef, EventEmitter, HostBinding, Input, OnDestroy, OnInit, Optional, Output, Self } from '@angular/core';\r\nimport { FormGroup, FormBuilder, Validators, ReactiveFormsModule, NgControl } from '@angular/forms';\r\nimport { BehaviorSubject, catchError, Observable, Subject, take, takeUntil, tap } from 'rxjs';\r\n\r\nimport { MatModulesModule } from '../../../../shared/modules/mat-modules.module';\r\nimport { IGetTreeResponse } from 'ngx-t-forms-types';\r\n\r\nimport { MatSlideToggleChange } from '@angular/material/slide-toggle';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\n\r\ninterface IIncludedSegmentConfig{\r\n segment:string,\r\n label:string,\r\n readOnly:boolean\r\n singleSelect:boolean\r\n\r\n}\r\n@Component({\r\n selector: 'app-mscoa-segment-config',\r\n templateUrl: './mscoa-segment-config.component.html',\r\n styleUrls: ['./mscoa-segment-config.component.scss'],\r\n standalone: true,\r\n imports:[\r\n CommonModule,\r\n MatModulesModule,\r\n ReactiveFormsModule\r\n ],\r\nproviders: [{ provide: MatFormFieldControl, useExisting:MscoaSegmentConfigComponent }],\r\n \r\n})\r\nexport class MscoaSegmentConfigComponent implements OnInit, OnDestroy,MatFormFieldControl<IIncludedSegmentConfig[]|undefined>{\r\n\r\n static nextId = 0;\r\n stateChanges = new Subject<void>();\r\n \r\n @HostBinding() id = `app-mscoa-segment-config'-${MscoaSegmentConfigComponent.nextId++}`;\r\n \r\n placeholder: string = ''\r\n constructor(\r\n private fb: FormBuilder,\r\n @Optional() @Self() public ngControl: NgControl, private _elementRef: ElementRef<HTMLElement>,\r\n ) {\r\n this.segmentForm = this.createSegmentForm();\r\n \r\n }\r\n\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 disabled: boolean = false;\r\n get 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-mscoa-segment-config');\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 \r\n \r\n \r\n \r\n \r\n \r\n \r\n @Input() errors:IConfigElementError[] |undefined = [];\r\n \r\n @Input() set value(val: IIncludedSegmentConfig[]) {\r\n this._value.next(val || []);\r\n }\r\n \r\n get value(): IIncludedSegmentConfig[] {\r\n return this._value.value;\r\n }\r\n _getMscoaTree :Observable<IGetTreeResponse|undefined> | undefined;\r\n _showAllSegments:boolean = false;\r\n @Input() set showAllSegments(val:boolean){\r\n\r\n if(!!val){\r\n this.checkShowAllSegments()\r\n }\r\n this._showAllSegments = !!val\r\n \r\n }\r\n get showAllSegments(){\r\n return this._showAllSegments\r\n }\r\n @Input() set getMscoaTree(options$:Observable<IGetTreeResponse | undefined> ){\r\n if(!!options$ && this._getMscoaTree === undefined){\r\n this._getMscoaTree = options$\r\n this.loadMscoa()\r\n }\r\n }\r\n@Output() valueChanged = new EventEmitter<IIncludedSegmentConfig[]>();\r\n private _value = new BehaviorSubject<IIncludedSegmentConfig[]>([]);\r\n private destroy$ = new Subject<void>();\r\n\r\n mscoaTree!:IGetTreeResponse | undefined;\r\n treeSegments!:IIncludedSegmentConfig[];\r\n error$ = new BehaviorSubject<string | null>(null);\r\n\r\n segmentForm: FormGroup;\r\n editingIndex: number | null = null;\r\n isAddingNew = false;\r\n\r\n\r\n\r\n ngOnInit() {\r\n this.listenToFormChanges();\r\n }\r\n\r\n ngOnDestroy() {\r\n this.destroy$.next();\r\n this.destroy$.complete();\r\n }\r\n getMscoaError:string|undefined = undefined\r\n private loadMscoa(){\r\n \r\n this._getMscoaTree?.pipe(\r\n take(1),\r\n tap((options) => {\r\n this.mscoaTree = options;\r\n this.treeSegments = options?.accountTreeKeys?.map((treeKeys) => ({\r\n segment:treeKeys,\r\n singleSelect:true,\r\n label: this.toTitleCase(treeKeys),\r\n readOnly: this.value.find((v) => v.segment === treeKeys)?.readOnly || false, \r\n })) || [];\r\n }),\r\n catchError((error) => {\r\n this.getMscoaError = 'Failed to fetch mscoa tree';\r\n console.error('Error while fetching SCOA tree:', error);\r\n return [null];\r\n })\r\n ).subscribe();\r\n }\r\n private createSegmentForm(segment: IIncludedSegmentConfig = {\r\n segment: '', label: '',\r\n singleSelect:true,\r\n readOnly:false}): FormGroup {\r\n return this.fb.group({\r\n segment: [segment.segment, Validators.required],\r\n readOnly: [segment.readOnly, Validators.required],\r\n singleSelect:[segment.singleSelect,Validators.required]\r\n });\r\n }\r\n\r\n private listenToFormChanges() {\r\n this.segmentForm.valueChanges\r\n .pipe(takeUntil(this.destroy$))\r\n .subscribe((v) => console.log(v));\r\n }\r\n\r\n startAddNew() {\r\n this.isAddingNew = true;\r\n this.editingIndex = null;\r\n this.segmentForm = this.createSegmentForm();\r\n }\r\n\r\n startEdit(index: number) {\r\n this.editingIndex = index;\r\n this.isAddingNew = false;\r\n this.segmentForm = this.createSegmentForm(this.value[index]);\r\n }\r\n\r\n cancelEdit() {\r\n this.editingIndex = null;\r\n this.isAddingNew = false;\r\n this.segmentForm.reset();\r\n }\r\n\r\n saveSegment() {\r\n if (this.segmentForm.valid) {\r\n const newSegment: IIncludedSegmentConfig = ({\r\n segment:this.segmentForm.value.segment,\r\n label:this.toTitleCase(this.segmentForm.value.segment),\r\n singleSelect:this.segmentForm.value.singleSelect,\r\n readOnly:this.segmentForm.value.readOnly\r\n })\r\n const updatedValue = [...this.value];\r\n\r\n if (this.isAddingNew) {\r\n updatedValue.push(newSegment);\r\n } else if (this.editingIndex !== null) {\r\n updatedValue[this.editingIndex] = newSegment;\r\n }\r\n\r\n \r\n this._value.next(updatedValue);\r\n this.valueChanged.emit(updatedValue);\r\n this.cancelEdit();\r\n }\r\n }\r\n readOnly(event:MatSlideToggleChange){\r\n this.segmentForm.patchValue({readOnly:event.checked}) \r\n }\r\n singleSelectChange(event:MatSlideToggleChange){\r\n this.segmentForm.patchValue({singleSelect:event.checked}) \r\n }\r\n removeSegment(index: number) {\r\n const updatedValue = this.value.filter((_, i) => i !== index);\r\n this._value.next(updatedValue);\r\n this.valueChanged.emit(updatedValue);\r\n }\r\n\r\n private toTitleCase(str: string): string {\r\n return str.replace(/\\w\\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());\r\n }\r\n alreadyExists(segment:string){\r\n return this.value.find((v) => v.segment === segment)\r\n }\r\n checkShowAllSegments() {\r\n if (!this._getMscoaTree || !this.treeSegments) return;\r\n \r\n const updatedValue = this.treeSegments.map(segment => ({\r\n ...segment,\r\n ...(this.value.find(v => v.segment === segment.segment) || {})\r\n }));\r\n\r\n if (JSON.stringify(updatedValue) !== JSON.stringify(this.value)) {\r\n this.valueChanged.emit([{} as any]);\r\n setTimeout(() => {\r\n this.valueChanged.emit(updatedValue);\r\n }, 0);\r\n }\r\n }\r\n}","<div *ngIf=\"(value||[]).length>0\" class=\"tree-instructions\">\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\n <span> Allowed segment configuration</span>\n</div>\n\n<mat-chip-listbox *ngIf=\"(value?.length || 0) > 0; else noSegments\" aria-label=\"Fish selection\">\n @for (segment of value||[]; track segment.segment) {\n <mat-chip-option (removed)=\"removeSegment($index)\" (click)=\"startEdit($index)\" color=\"accent\"\n [value]=\"segment?.segment\" [selected]=\"this.editingIndex === $index\">\n <div style=\" \n display: flex;\n align-items: center;\n gap: 1px;\">\n <span style=\"margin-right: 2px;\">\n {{ segment.label }}\n </span>\n <mat-icon class=\"icons\">\n {{ segment.singleSelect ? 'done' : ' done_all' }}\n </mat-icon>\n <mat-icon class=\"icons\">\n\n {{ segment.readOnly ? 'edit_off' : 'edit' }}\n </mat-icon>\n </div>\n\n @if ( showAllSegments === false) {\n <button matChipRemove [attr.aria-label]=\"'remove' \">\n <mat-icon>cancel</mat-icon>\n </button>\n }\n\n </mat-chip-option>\n }\n</mat-chip-listbox>\n\n\n\n\n\n<ng-template #noSegments>\n <div class=\"tree-instructions\">\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\n <span>No segment configuration available. Start by adding a segment below.</span>\n </div>\n</ng-template>\n\n<mat-toolbar *ngIf=\"!isAddingNew && editingIndex === null && showAllSegments === false\">\n <button style=\"width:100%\" mat-stroked-button (click)=\"startAddNew()\">\n Add New Segment <mat-icon>add</mat-icon>\n </button>\n</mat-toolbar>\n\n@if (!!getMscoaError) {\n<div class=\"tree-instructions\">\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\n <span>\n {{ getMscoaError }}\n </span>\n</div>\n}\n<mat-card *ngIf=\"isAddingNew || editingIndex !== null\">\n <mat-card-header>\n <mat-card-subtitle>\n {{ isAddingNew ? 'Add a new' : 'Update' }} Segment\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n <form [formGroup]=\"segmentForm\" (ngSubmit)=\"saveSegment()\">\n <mat-form-field appearance=\"outline\">\n <mat-label>Segment</mat-label>\n <mat-select matNativeControl formControlName=\"segment\" [value]=\"value\" placeholder=\"Select segment\">\n @for ( segment of treeSegments; track segment.segment) {\n <mat-option [disabled]=\"alreadyExists(segment.segment)\" [value]=\"segment.segment\"> {{ segment.label\n }}</mat-option>\n }\n </mat-select>\n <mat-hint>\n Choose a function to run on the array\n </mat-hint>\n </mat-form-field>\n <mat-toolbar>\n <mat-slide-toggle (change)=\"singleSelectChange($event)\" [checked]=\"segmentForm.value.singleSelect\">\n Single select segment\n </mat-slide-toggle>\n </mat-toolbar>\n <mat-toolbar>\n <mat-slide-toggle (change)=\"readOnly($event)\" [checked]=\"segmentForm.value.readOnly\">Read only\n segment</mat-slide-toggle>\n </mat-toolbar>\n\n <br>\n <mat-card-actions>\n <button mat-button type=\"submit\" [disabled]=\"!segmentForm.valid\">Save</button>\n <button mat-button (click)=\"cancelEdit()\">Cancel</button>\n </mat-card-actions>\n\n\n </form>\n </mat-card-content>\n</mat-card>\n\n<span color=\"danger\" *ngIf=\"error$ | async as error\">\n <p>{{ error }}</p>\n</span>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;MAgCa,2BAA2B,CAAA;aAE7B,IAAM,CAAA,MAAA,GAAG,CAAH,CAAK;AAMlB,IAAA,WAAA,CACU,EAAe,EACI,SAAoB,EAAU,WAAoC,EAAA;QADrF,IAAE,CAAA,EAAA,GAAF,EAAE;QACiB,IAAS,CAAA,SAAA,GAAT,SAAS;QAAqB,IAAW,CAAA,WAAA,GAAX,WAAW;AAPtE,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,OAAO,EAAQ;AAEnB,QAAA,IAAA,CAAA,EAAE,GAAG,CAA6B,0BAAA,EAAA,2BAA2B,CAAC,MAAM,EAAE,EAAE;QAEvF,IAAW,CAAA,WAAA,GAAW,EAAE;QASxB,IAAO,CAAA,OAAA,GAAY,KAAK;QAOxB,IAAQ,CAAA,QAAA,GAAY,KAAK;QACzB,IAAQ,CAAA,QAAA,GAAY,KAAK;QAyBzB,IAAO,CAAA,OAAA,GAAY,KAAK;AACxB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAK,GAAG;QAgBT,IAAM,CAAA,MAAA,GAAoC,EAAE;QAUzD,IAAgB,CAAA,gBAAA,GAAW,KAAK;AAkBxB,QAAA,IAAA,CAAA,YAAY,GAAI,IAAI,YAAY,EAA4B;AAC5D,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,eAAe,CAA2B,EAAE,CAAC;AAC1D,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,OAAO,EAAQ;AAIt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Ad;gBAEQ,KAAK,EAAA,CAAA;sBAAjB;gBASY,eAAe,EAAA,CAAA;sBAA3B;gBAWY,YAAY,EAAA,CAAA;sBAAxB;gBAMO,YAAY,EAAA,CAAA;sBAArB;;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-mscoa-segment-config.component-BDVj1NFN.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mscoa-segment-config/mscoa-segment-config.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mscoa-segment-config/mscoa-segment-config.component.html"],"sourcesContent":["import { CommonModule } from '@angular/common';\r\nimport { Component, ElementRef, EventEmitter, HostBinding, Input, OnDestroy, OnInit, Optional, Output, Self } from '@angular/core';\r\nimport { FormGroup, FormBuilder, Validators, ReactiveFormsModule, NgControl } from '@angular/forms';\r\nimport { BehaviorSubject, catchError, Observable, Subject, take, takeUntil, tap } from 'rxjs';\r\n\r\nimport { MatModulesModule } from '../../../../shared/modules/mat-modules.module';\r\nimport { IGetTreeResponse } from 'ngx-t-forms-types';\r\n\r\nimport { MatSlideToggleChange } from '@angular/material/slide-toggle';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\n\r\ninterface IIncludedSegmentConfig{\r\n segment:string,\r\n label:string,\r\n readOnly:boolean\r\n singleSelect:boolean\r\n\r\n}\r\n@Component({\r\n selector: 'app-mscoa-segment-config',\r\n templateUrl: './mscoa-segment-config.component.html',\r\n styleUrls: ['./mscoa-segment-config.component.scss'],\r\n standalone: true,\r\n imports:[\r\n CommonModule,\r\n MatModulesModule,\r\n ReactiveFormsModule\r\n ],\r\nproviders: [{ provide: MatFormFieldControl, useExisting:MscoaSegmentConfigComponent }],\r\n \r\n})\r\nexport class MscoaSegmentConfigComponent implements OnInit, OnDestroy,MatFormFieldControl<IIncludedSegmentConfig[]|undefined>{\r\n\r\n static nextId = 0;\r\n stateChanges = new Subject<void>();\r\n \r\n @HostBinding() id = `app-mscoa-segment-config'-${MscoaSegmentConfigComponent.nextId++}`;\r\n \r\n placeholder: string = ''\r\n constructor(\r\n private fb: FormBuilder,\r\n @Optional() @Self() public ngControl: NgControl, private _elementRef: ElementRef<HTMLElement>,\r\n ) {\r\n this.segmentForm = this.createSegmentForm();\r\n \r\n }\r\n\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 disabled: boolean = false;\r\n get 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-mscoa-segment-config');\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 \r\n \r\n \r\n \r\n \r\n \r\n \r\n @Input() errors:IConfigElementError[] |undefined = [];\r\n \r\n @Input() set value(val: IIncludedSegmentConfig[]) {\r\n this._value.next(val || []);\r\n }\r\n \r\n get value(): IIncludedSegmentConfig[] {\r\n return this._value.value;\r\n }\r\n _getMscoaTree :Observable<IGetTreeResponse|undefined> | undefined;\r\n _showAllSegments:boolean = false;\r\n @Input() set showAllSegments(val:boolean){\r\n\r\n if(!!val){\r\n this.checkShowAllSegments()\r\n }\r\n this._showAllSegments = !!val\r\n \r\n }\r\n get showAllSegments(){\r\n return this._showAllSegments\r\n }\r\n @Input() set getMscoaTree(options$:Observable<IGetTreeResponse | undefined> ){\r\n if(!!options$ && this._getMscoaTree === undefined){\r\n this._getMscoaTree = options$\r\n this.loadMscoa()\r\n }\r\n }\r\n@Output() valueChanged = new EventEmitter<IIncludedSegmentConfig[]>();\r\n private _value = new BehaviorSubject<IIncludedSegmentConfig[]>([]);\r\n private destroy$ = new Subject<void>();\r\n\r\n mscoaTree!:IGetTreeResponse | undefined;\r\n treeSegments!:IIncludedSegmentConfig[];\r\n error$ = new BehaviorSubject<string | null>(null);\r\n\r\n segmentForm: FormGroup;\r\n editingIndex: number | null = null;\r\n isAddingNew = false;\r\n\r\n\r\n\r\n ngOnInit() {\r\n this.listenToFormChanges();\r\n }\r\n\r\n ngOnDestroy() {\r\n this.destroy$.next();\r\n this.destroy$.complete();\r\n }\r\n getMscoaError:string|undefined = undefined\r\n private loadMscoa(){\r\n \r\n this._getMscoaTree?.pipe(\r\n take(1),\r\n tap((options) => {\r\n this.mscoaTree = options;\r\n this.treeSegments = options?.accountTreeKeys?.map((treeKeys) => ({\r\n segment:treeKeys,\r\n singleSelect:true,\r\n label: this.toTitleCase(treeKeys),\r\n readOnly: this.value.find((v) => v.segment === treeKeys)?.readOnly || false, \r\n })) || [];\r\n }),\r\n catchError((error) => {\r\n this.getMscoaError = 'Failed to fetch mscoa tree';\r\n console.error('Error while fetching SCOA tree:', error);\r\n return [null];\r\n })\r\n ).subscribe();\r\n }\r\n private createSegmentForm(segment: IIncludedSegmentConfig = {\r\n segment: '', label: '',\r\n singleSelect:true,\r\n readOnly:false}): FormGroup {\r\n return this.fb.group({\r\n segment: [segment.segment, Validators.required],\r\n readOnly: [segment.readOnly, Validators.required],\r\n singleSelect:[segment.singleSelect,Validators.required]\r\n });\r\n }\r\n\r\n private listenToFormChanges() {\r\n this.segmentForm.valueChanges\r\n .pipe(takeUntil(this.destroy$))\r\n .subscribe((v) => console.log(v));\r\n }\r\n\r\n startAddNew() {\r\n this.isAddingNew = true;\r\n this.editingIndex = null;\r\n this.segmentForm = this.createSegmentForm();\r\n }\r\n\r\n startEdit(index: number) {\r\n this.editingIndex = index;\r\n this.isAddingNew = false;\r\n this.segmentForm = this.createSegmentForm(this.value[index]);\r\n }\r\n\r\n cancelEdit() {\r\n this.editingIndex = null;\r\n this.isAddingNew = false;\r\n this.segmentForm.reset();\r\n }\r\n\r\n saveSegment() {\r\n if (this.segmentForm.valid) {\r\n const newSegment: IIncludedSegmentConfig = ({\r\n segment:this.segmentForm.value.segment,\r\n label:this.toTitleCase(this.segmentForm.value.segment),\r\n singleSelect:this.segmentForm.value.singleSelect,\r\n readOnly:this.segmentForm.value.readOnly\r\n })\r\n const updatedValue = [...this.value];\r\n\r\n if (this.isAddingNew) {\r\n updatedValue.push(newSegment);\r\n } else if (this.editingIndex !== null) {\r\n updatedValue[this.editingIndex] = newSegment;\r\n }\r\n\r\n \r\n this._value.next(updatedValue);\r\n this.valueChanged.emit(updatedValue);\r\n this.cancelEdit();\r\n }\r\n }\r\n readOnly(event:MatSlideToggleChange){\r\n this.segmentForm.patchValue({readOnly:event.checked}) \r\n }\r\n singleSelectChange(event:MatSlideToggleChange){\r\n this.segmentForm.patchValue({singleSelect:event.checked}) \r\n }\r\n removeSegment(index: number) {\r\n const updatedValue = this.value.filter((_, i) => i !== index);\r\n this._value.next(updatedValue);\r\n this.valueChanged.emit(updatedValue);\r\n }\r\n\r\n private toTitleCase(str: string): string {\r\n return str.replace(/\\w\\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());\r\n }\r\n alreadyExists(segment:string){\r\n return this.value.find((v) => v.segment === segment)\r\n }\r\n checkShowAllSegments() {\r\n if (!this._getMscoaTree || !this.treeSegments) return;\r\n \r\n const updatedValue = this.treeSegments.map(segment => ({\r\n ...segment,\r\n ...(this.value.find(v => v.segment === segment.segment) || {})\r\n }));\r\n\r\n if (JSON.stringify(updatedValue) !== JSON.stringify(this.value)) {\r\n this.valueChanged.emit([{} as any]);\r\n setTimeout(() => {\r\n this.valueChanged.emit(updatedValue);\r\n }, 0);\r\n }\r\n }\r\n}","<div *ngIf=\"(value||[]).length>0\" class=\"tree-instructions\">\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\n <span> Allowed segment configuration</span>\n</div>\n\n<mat-chip-listbox *ngIf=\"(value?.length || 0) > 0; else noSegments\" aria-label=\"Fish selection\">\n @for (segment of value||[]; track segment.segment) {\n <mat-chip-option (removed)=\"removeSegment($index)\" (click)=\"startEdit($index)\" color=\"accent\"\n [value]=\"segment?.segment\" [selected]=\"this.editingIndex === $index\">\n <div style=\" \n display: flex;\n align-items: center;\n gap: 1px;\">\n <span style=\"margin-right: 2px;\">\n {{ segment.label }}\n </span>\n <mat-icon class=\"icons\">\n {{ segment.singleSelect ? 'done' : ' done_all' }}\n </mat-icon>\n <mat-icon class=\"icons\">\n\n {{ segment.readOnly ? 'edit_off' : 'edit' }}\n </mat-icon>\n </div>\n\n @if ( showAllSegments === false) {\n <button matChipRemove [attr.aria-label]=\"'remove' \">\n <mat-icon>cancel</mat-icon>\n </button>\n }\n\n </mat-chip-option>\n }\n</mat-chip-listbox>\n\n\n\n\n\n<ng-template #noSegments>\n <div class=\"tree-instructions\">\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\n <span>No segment configuration available. Start by adding a segment below.</span>\n </div>\n</ng-template>\n\n<mat-toolbar *ngIf=\"!isAddingNew && editingIndex === null && showAllSegments === false\">\n <button style=\"width:100%\" mat-stroked-button (click)=\"startAddNew()\">\n Add New Segment <mat-icon>add</mat-icon>\n </button>\n</mat-toolbar>\n\n@if (!!getMscoaError) {\n<div class=\"tree-instructions\">\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\n <span>\n {{ getMscoaError }}\n </span>\n</div>\n}\n<mat-card *ngIf=\"isAddingNew || editingIndex !== null\">\n <mat-card-header>\n <mat-card-subtitle>\n {{ isAddingNew ? 'Add a new' : 'Update' }} Segment\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n <form [formGroup]=\"segmentForm\" (ngSubmit)=\"saveSegment()\">\n <mat-form-field appearance=\"outline\">\n <mat-label>Segment</mat-label>\n <mat-select matNativeControl formControlName=\"segment\" [value]=\"value\" placeholder=\"Select segment\">\n @for ( segment of treeSegments; track segment.segment) {\n <mat-option [disabled]=\"alreadyExists(segment.segment)\" [value]=\"segment.segment\"> {{ segment.label\n }}</mat-option>\n }\n </mat-select>\n <mat-hint>\n Choose a function to run on the array\n </mat-hint>\n </mat-form-field>\n <mat-toolbar>\n <mat-slide-toggle (change)=\"singleSelectChange($event)\" [checked]=\"segmentForm.value.singleSelect\">\n Single select segment\n </mat-slide-toggle>\n </mat-toolbar>\n <mat-toolbar>\n <mat-slide-toggle (change)=\"readOnly($event)\" [checked]=\"segmentForm.value.readOnly\">Read only\n segment</mat-slide-toggle>\n </mat-toolbar>\n\n <br>\n <mat-card-actions>\n <button mat-button type=\"submit\" [disabled]=\"!segmentForm.valid\">Save</button>\n <button mat-button (click)=\"cancelEdit()\">Cancel</button>\n </mat-card-actions>\n\n\n </form>\n </mat-card-content>\n</mat-card>\n\n<span color=\"danger\" *ngIf=\"error$ | async as error\">\n <p>{{ error }}</p>\n</span>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;MAgCa,2BAA2B,CAAA;aAE7B,IAAM,CAAA,MAAA,GAAG,CAAH,CAAK;AAMlB,IAAA,WAAA,CACU,EAAe,EACI,SAAoB,EAAU,WAAoC,EAAA;QADrF,IAAE,CAAA,EAAA,GAAF,EAAE;QACiB,IAAS,CAAA,SAAA,GAAT,SAAS;QAAqB,IAAW,CAAA,WAAA,GAAX,WAAW;AAPtE,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,OAAO,EAAQ;AAEnB,QAAA,IAAA,CAAA,EAAE,GAAG,CAA6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eAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,CAAA,iBAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAKV,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAbvC,SAAS;+BACE,0BAA0B,EAAA,UAAA,EAGxB,IAAI,EACR,OAAA,EAAA;wBACN,YAAY;wBACZ,gBAAgB;wBAChB;qBACD,EACQ,SAAA,EAAA,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAA4B,2BAAA,EAAE,CAAC,EAAA,QAAA,EAAA,25GAAA,EAAA,MAAA,EAAA,CAAA,mTAAA,CAAA,EAAA;;0BAa/E;;0BAAY;kEALA,EAAE,EAAA,CAAA;sBAAhB;gBA6DU,MAAM,EAAA,CAAA;sBAAd;gBAEQ,KAAK,EAAA,CAAA;sBAAjB;gBASY,eAAe,EAAA,CAAA;sBAA3B;gBAWY,YAAY,EAAA,CAAA;sBAAxB;gBAMO,YAAY,EAAA,CAAA;sBAArB;;;;;"}
|
package/fesm2022/{ngx-t-forms-ngx-t-forms-BIKaG6Gx.mjs → ngx-t-forms-ngx-t-forms-8hOAg-8v.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, Component, InjectionToken, makeEnvironmentProviders, inject, Inject, Directive, NgModule, Input, Pipe, EventEmitter, Output, ViewChild, Optional, Self, ChangeDetectionStrategy, ViewEncapsulation, forwardRef } from '@angular/core';
|
|
3
|
-
import { DataSources, formColumnInputsSchema, ElementTypes, validateCalculatedFieldRules, CalculationFunctions, MinInputTypes, InputDataTypes, FormSubmissionStatus, validateForm, FormListSection, FormStateErrors, DefaultInputConfig,
|
|
3
|
+
import { DataSources, formColumnInputsSchema, ElementTypes, validateCalculatedFieldRules, CalculationFunctions, MinInputTypes, InputDataTypes, FormSubmissionStatus, validateForm, FormListSection, FormStateErrors, getElementEditorConfig, DefaultInputConfig, ElementEditorTypes, SpecialElementKeys, validateFormColumnInputsWithRequired, validateFormSlide, BlurHandleTypes, AllFormInputPrimaryKeys, AllDocumentFileExtensions, AllImageFileExtensions, InputFileType, UploadTypes, InputTypes, AutocapitalizeOptions } from 'ngx-t-forms-types';
|
|
4
4
|
import * as i1$2 from '@angular/forms';
|
|
5
5
|
import { Validators, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
6
6
|
import ExpressionValidator from 'stringtoobjectvalidator';
|
|
@@ -3504,6 +3504,157 @@ function missingConfig(form) {
|
|
|
3504
3504
|
}
|
|
3505
3505
|
}
|
|
3506
3506
|
|
|
3507
|
+
function testAgainstItem(test, item) {
|
|
3508
|
+
try {
|
|
3509
|
+
const testValue = test.deepBind ? safeReturnDeepProperty(item, test.deepBind || [])?.value : item;
|
|
3510
|
+
const key = test.deepBind ? test.deepBind[test.deepBind.length - 1] : '';
|
|
3511
|
+
const objectValue = test.deepBind ? { [key || '']: testValue } : testValue;
|
|
3512
|
+
if (test.expression) {
|
|
3513
|
+
return ExpressionValidator(test.expression, objectValue);
|
|
3514
|
+
}
|
|
3515
|
+
if (test.testType === 'exists') {
|
|
3516
|
+
return test.testType === 'exists' && testValue !== '' && testValue !== undefined;
|
|
3517
|
+
}
|
|
3518
|
+
if (test.testType === 'equalTo') {
|
|
3519
|
+
return testValue === test.valueMatch;
|
|
3520
|
+
}
|
|
3521
|
+
return false;
|
|
3522
|
+
}
|
|
3523
|
+
catch (error) {
|
|
3524
|
+
return false;
|
|
3525
|
+
}
|
|
3526
|
+
}
|
|
3527
|
+
|
|
3528
|
+
;
|
|
3529
|
+
function inputElementEditorConfigs(form, inputInEdit, NGX_T_FORMS_CONFIG, utils) {
|
|
3530
|
+
try {
|
|
3531
|
+
// Get base configuration
|
|
3532
|
+
const config = getElementEditorConfig;
|
|
3533
|
+
// Get validation errors for the input being edited
|
|
3534
|
+
const errors = inputInEditValidationErrors(form, inputInEdit);
|
|
3535
|
+
// Create a completely new configuration object (for change detection)
|
|
3536
|
+
return {
|
|
3537
|
+
...config, // Copy all base properties
|
|
3538
|
+
// Create new array with new section objects
|
|
3539
|
+
editorSections: config.editorSections.map(section => {
|
|
3540
|
+
const elements = getSectionElements(section.elements, inputInEdit, NGX_T_FORMS_CONFIG, utils, errors);
|
|
3541
|
+
// Check if any element in this section has errors
|
|
3542
|
+
const hasErrors = section.elements.some(el => errors.some(err => err.key === el.deepBind?.join('.')));
|
|
3543
|
+
return ({
|
|
3544
|
+
...section,
|
|
3545
|
+
elements: [...[], ...elements],
|
|
3546
|
+
hasErrors
|
|
3547
|
+
});
|
|
3548
|
+
})
|
|
3549
|
+
};
|
|
3550
|
+
}
|
|
3551
|
+
catch (error) {
|
|
3552
|
+
const message = error instanceof Error ? error.message : 'Failed to configure columns';
|
|
3553
|
+
throw new Error(message);
|
|
3554
|
+
}
|
|
3555
|
+
}
|
|
3556
|
+
function getSectionElements(elements, inputInEdit, NGX_T_FORMS_CONFIG, utils, errors = []) {
|
|
3557
|
+
try {
|
|
3558
|
+
const defaultInputs = { ...DefaultInputConfig };
|
|
3559
|
+
if (!inputInEdit)
|
|
3560
|
+
return [];
|
|
3561
|
+
const defaultInput = defaultInputs[inputInEdit?.element];
|
|
3562
|
+
const processedElements = elements
|
|
3563
|
+
.map(el => processElement(el, inputInEdit, NGX_T_FORMS_CONFIG, utils, errors));
|
|
3564
|
+
const filteredElements = processedElements.filter(el => isElementApplicable(inputInEdit, defaultInput?.properties, el));
|
|
3565
|
+
console.error('%c Form Element Editor Debug Info ', 'background: #ff0000; color: white; font-weight: bold; padding: 2px;', '\n\nFiltered Elements:', filteredElements, '\n\nProcessed Elements:', processedElements, '\n\nInput Being Edited:', inputInEdit, '\n\nDefault Input Config:', defaultInputs[inputInEdit?.element], '\n\nElements Removed:', processedElements.filter(el => !filteredElements.includes(el)));
|
|
3566
|
+
return filteredElements;
|
|
3567
|
+
}
|
|
3568
|
+
catch (err) {
|
|
3569
|
+
console.error('Error processing section elements:', err);
|
|
3570
|
+
return [];
|
|
3571
|
+
}
|
|
3572
|
+
}
|
|
3573
|
+
function processElement(element, inputInEdit, NGX_T_FORMS_CONFIG, utils, errors = []) {
|
|
3574
|
+
const defaultInputs = { ...DefaultInputConfig };
|
|
3575
|
+
if (!inputInEdit)
|
|
3576
|
+
return [];
|
|
3577
|
+
const defaultInput = defaultInputs[inputInEdit?.element];
|
|
3578
|
+
return {
|
|
3579
|
+
...element,
|
|
3580
|
+
computedErrors: computedErrors(element, errors),
|
|
3581
|
+
required: defaultInput?.requiredProperties?.includes(element.name),
|
|
3582
|
+
postmanCollectionConfig: getPostmanConfig(element, NGX_T_FORMS_CONFIG),
|
|
3583
|
+
httpGetDataFunction: utils.httpGetDataFunction.bind(utils),
|
|
3584
|
+
getWorkflowOptions: element.editType === ElementEditorTypes.MongoPipelineBuilder ?
|
|
3585
|
+
NGX_T_FORMS_CONFIG.formBuilder.workflows() :
|
|
3586
|
+
undefined,
|
|
3587
|
+
getMscoaTree: element.editType === ElementEditorTypes.ConfigMscoaSegments ?
|
|
3588
|
+
NGX_T_FORMS_CONFIG.formBuilder.getScoaTree() :
|
|
3589
|
+
undefined
|
|
3590
|
+
};
|
|
3591
|
+
}
|
|
3592
|
+
;
|
|
3593
|
+
function getPostmanConfig(element, NGX_T_FORMS_CONFIG) {
|
|
3594
|
+
if (![ElementEditorTypes.ApiCall, ElementEditorTypes.ApiValueAccessRules].includes(element.editType)) {
|
|
3595
|
+
return undefined;
|
|
3596
|
+
}
|
|
3597
|
+
return {
|
|
3598
|
+
collectionUrl: String(NGX_T_FORMS_CONFIG['POSTMAN_COLLECTION_URL'] || ''),
|
|
3599
|
+
collectionKey: String(NGX_T_FORMS_CONFIG['POSTMAN_COLLECTION_KEY'] || '')
|
|
3600
|
+
};
|
|
3601
|
+
}
|
|
3602
|
+
function isElementApplicable(input, inputProperties, element) {
|
|
3603
|
+
const { name, additionalTest } = element;
|
|
3604
|
+
const isDefault = name === SpecialElementKeys.Default;
|
|
3605
|
+
if (!!isDefault && !additionalTest)
|
|
3606
|
+
return true;
|
|
3607
|
+
// Check property inclusion
|
|
3608
|
+
const isInputProperty = inputProperties?.includes(name);
|
|
3609
|
+
if (!isInputProperty && !isDefault)
|
|
3610
|
+
return false;
|
|
3611
|
+
// Execute additional tests
|
|
3612
|
+
return additionalTest ?
|
|
3613
|
+
additionalTest.every(test => testAgainstItem(test, input)) :
|
|
3614
|
+
!!isInputProperty;
|
|
3615
|
+
}
|
|
3616
|
+
;
|
|
3617
|
+
function inputInEditValidationErrors(form, inputInEdit) {
|
|
3618
|
+
try {
|
|
3619
|
+
const defaultInputs = { ...DefaultInputConfig };
|
|
3620
|
+
let allInputs = form?.slides?.flatMap(slide => slide.columns) || [];
|
|
3621
|
+
const parentInput = allInputs.find(input => input.id === inputInEdit?.multipleInputInEditId);
|
|
3622
|
+
if (!inputInEdit || !inputInEdit.element)
|
|
3623
|
+
return [];
|
|
3624
|
+
const editingNewInput = !inputInEdit?.id;
|
|
3625
|
+
if (!editingNewInput) {
|
|
3626
|
+
return validateFormColumnInputsWithRequired({
|
|
3627
|
+
data: inputInEdit,
|
|
3628
|
+
requiredKeys: (defaultInputs[inputInEdit.element]?.requiredProperties || [])
|
|
3629
|
+
});
|
|
3630
|
+
}
|
|
3631
|
+
// Improved duplicate check logic
|
|
3632
|
+
const isDuplicateFormControl = () => {
|
|
3633
|
+
if (!inputInEdit.formControlName)
|
|
3634
|
+
return false;
|
|
3635
|
+
if (parentInput) {
|
|
3636
|
+
return parentInput.formInputs?.some(input => input.formControlName === inputInEdit.formControlName) || false;
|
|
3637
|
+
}
|
|
3638
|
+
return allInputs.some(input => input.formControlName === inputInEdit.formControlName);
|
|
3639
|
+
};
|
|
3640
|
+
const duplicateError = isDuplicateFormControl()
|
|
3641
|
+
? [{ key: 'formControlName', message: 'Form control name must be unique' }]
|
|
3642
|
+
: [];
|
|
3643
|
+
return [...duplicateError, ...validateFormColumnInputsWithRequired({
|
|
3644
|
+
data: inputInEdit,
|
|
3645
|
+
requiredKeys: (defaultInputs[inputInEdit.element]?.requiredProperties || [])
|
|
3646
|
+
})];
|
|
3647
|
+
}
|
|
3648
|
+
catch (error) {
|
|
3649
|
+
const msg = error instanceof Error ? error.message : 'Failed to check form config';
|
|
3650
|
+
throw new Error(msg);
|
|
3651
|
+
}
|
|
3652
|
+
}
|
|
3653
|
+
function computedErrors(element, allErrors) {
|
|
3654
|
+
const errors = allErrors?.filter(error => error.key === element.deepBind?.join('.'));
|
|
3655
|
+
return [...[], ...errors];
|
|
3656
|
+
}
|
|
3657
|
+
|
|
3507
3658
|
;
|
|
3508
3659
|
;
|
|
3509
3660
|
function formsFormBuilderStoreSelectors(store) {
|
|
@@ -3568,6 +3719,7 @@ function formsFormBuilderStoreSelectors(store) {
|
|
|
3568
3719
|
}));
|
|
3569
3720
|
const selectFormTitle$ = selectFormInEdit$.pipe(map((form) => form?.formTitle));
|
|
3570
3721
|
const getAllFormInputs$ = selectFormInEdit$.pipe(map((form) => form?.slides.flatMap(slide => slide.columns) || []));
|
|
3722
|
+
const inputElementEditorConfigs$ = inputInEdit$.pipe(switchMap((inputInEdit) => selectFormInEdit$.pipe(map(form => inputElementEditorConfigs(form, inputInEdit, store.NGX_T_FORMS_CONFIG, store.utils)))));
|
|
3571
3723
|
return {
|
|
3572
3724
|
selectFormSlides$,
|
|
3573
3725
|
missingConfig$,
|
|
@@ -3581,6 +3733,7 @@ function formsFormBuilderStoreSelectors(store) {
|
|
|
3581
3733
|
inputInEditValidationErrors$,
|
|
3582
3734
|
selectFormTitle$,
|
|
3583
3735
|
getAllFormInputs$,
|
|
3736
|
+
inputElementEditorConfigs$,
|
|
3584
3737
|
selectFormSlideSections$
|
|
3585
3738
|
};
|
|
3586
3739
|
}
|
|
@@ -4783,9 +4936,9 @@ class FormBuilderComponent {
|
|
|
4783
4936
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: FormBuilderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4784
4937
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: FormBuilderComponent, isStandalone: true, selector: "app-form-builder", inputs: { formId: "formId" }, providers: [
|
|
4785
4938
|
FormsStoreService
|
|
4786
|
-
], ngImport: i0, template: "<header>\r\n <mat-toolbar color=\"primary\">\r\n @if (closeButton) {\r\n <button mat-icon-button [style.color]=\"closeButton.color\" (click)=\"closeButton.onClick()\">\r\n <mat-icon>{{closeButton.icon}}</mat-icon>\r\n </button>\r\n }\r\n\r\n <!-- Navigation group -->\r\n <div class=\"nav-group\">\r\n <button mat-button routerLink=\"/\">Forms</button>\r\n <mat-icon>navigate_next</mat-icon>\r\n </div>\r\n\r\n <!-- Title input with optimized binding -->\r\n @if (selectHasFormId()) {\r\n <input [(ngModel)]=\"titleValue\" class=\"section-title-input\" placeholder=\"Enter Form Title\">\r\n }\r\n\r\n <span class=\"spacer\"></span>\r\n\r\n @defer (on viewport) {\r\n <app-forms-builder-menu />\r\n } @placeholder {\r\n <div style=\"padding: 50px;display:flex;justify-content:center;align-items:center; text-align: center;\">\r\n <mat-spinner diameter=\"20\" />\r\n </div>\r\n\r\n }\r\n\r\n <span class=\"divider\">|</span>\r\n\r\n <!-- Save/Update button with optimized reactive state -->\r\n <button mat-raised-button color=\"accent\" class=\"save-button\" [disabled]=\"!(canSaveForm())\"\r\n (click)=\"saveForm()\">\r\n\r\n <mat-icon>\r\n {{(isNewForm()) ? 'save' : 'update'}}\r\n </mat-icon>\r\n\r\n @if (selectFormBuilderIsBusy()) {\r\n {{(isNewForm()) ? '..Saving new form' : '..Updating Form'}}\r\n } @else {\r\n {{(isNewForm()) ? 'Save' : 'Update'}}\r\n }\r\n </button>\r\n\r\n <!-- Updated time info -->\r\n @if (!(isNewForm())) {\r\n <div class=\"updated-time\">\r\n <mat-icon>update</mat-icon>\r\n <span>Updated {{ selectFormUpdated() }}</span>\r\n </div>\r\n }\r\n </mat-toolbar>\r\n</header>\r\n\r\n<!-- Main content with optimized loading -->\r\n@defer (on viewport) {\r\n<div class=\"container\">\r\n <div class=\"middle\">\r\n <br>\r\n @if (selectLoadingForm()) {\r\n <div class=\"loading-container\">\r\n <mat-spinner />\r\n </div>\r\n } @else {\r\n <app-form-section-stepper />\r\n }\r\n <br>\r\n @if ((hasMissingConfigs()) && !(selectLoadingForm())) {\r\n <app-missing-form-configs />\r\n }\r\n </div>\r\n\r\n @if (elementEditorOpen()) {\r\n <app-input-editor style=\"max-width:480px;height:calc(100vh - 64px);z-index:1\" cdkDrag cdkDragBoundary=\"container\" class=\"middle editor-container\" />\r\n }\r\n <!-- Missing fields section -->`\r\n\r\n\r\n</div>\r\n}@placeholder {\r\n <div style=\"padding: 50px;display:flex;justify-content:center;align-items:center; text-align: center;\">\r\n <mat-spinner diameter=\"50\" />\r\n </div>\r\n}", styles: [".container{display:flex;width:100%;height:calc(100% - 64px)}.side{width:100px;background-color:#f8d7da}.middle{flex-grow:1;height:100%;overflow:auto;background-color:none}.section-title-input{border:none;background-color:transparent;font-size:16px;font-weight:600;color:#fff;padding-top:12px;padding-bottom:12px;outline:none;min-width:268px;transition:border-bottom-color .3s ease-in-out}.section-title-input:focus{border-bottom:1px solid #ffffff}.missing-fields{position:fixed;bottom:0}.updated-time{display:flex;gap:8px;align-items:center;line-height:normal;font-size:14px;bottom:0;position:absolute;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);padding:8px;border-radius:4px}.nav-group{display:flex;align-items:center;gap:8px}.save-button{margin-left:8px;min-width:168px}.loading-container{display:flex;height:calc(100% - 150px);justify-content:center;align-items:center}.editor-container{max-width:500px}.divider{margin:0 8px;opacity:.5}app-missing-form-configs{position:absolute;bottom:0;right:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i7.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i9.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], deferBlockDependencies: [() => [import('./ngx-t-forms-forms-builder-menu.component-
|
|
4939
|
+
], ngImport: i0, template: "<header>\r\n <mat-toolbar color=\"primary\">\r\n @if (closeButton) {\r\n <button mat-icon-button [style.color]=\"closeButton.color\" (click)=\"closeButton.onClick()\">\r\n <mat-icon>{{closeButton.icon}}</mat-icon>\r\n </button>\r\n }\r\n\r\n <!-- Navigation group -->\r\n <div class=\"nav-group\">\r\n <button mat-button routerLink=\"/\">Forms</button>\r\n <mat-icon>navigate_next</mat-icon>\r\n </div>\r\n\r\n <!-- Title input with optimized binding -->\r\n @if (selectHasFormId()) {\r\n <input [(ngModel)]=\"titleValue\" class=\"section-title-input\" placeholder=\"Enter Form Title\">\r\n }\r\n\r\n <span class=\"spacer\"></span>\r\n\r\n @defer (on viewport) {\r\n <app-forms-builder-menu />\r\n } @placeholder {\r\n <div style=\"padding: 50px;display:flex;justify-content:center;align-items:center; text-align: center;\">\r\n <mat-spinner diameter=\"20\" />\r\n </div>\r\n\r\n }\r\n\r\n <span class=\"divider\">|</span>\r\n\r\n <!-- Save/Update button with optimized reactive state -->\r\n <button mat-raised-button color=\"accent\" class=\"save-button\" [disabled]=\"!(canSaveForm())\"\r\n (click)=\"saveForm()\">\r\n\r\n <mat-icon>\r\n {{(isNewForm()) ? 'save' : 'update'}}\r\n </mat-icon>\r\n\r\n @if (selectFormBuilderIsBusy()) {\r\n {{(isNewForm()) ? '..Saving new form' : '..Updating Form'}}\r\n } @else {\r\n {{(isNewForm()) ? 'Save' : 'Update'}}\r\n }\r\n </button>\r\n\r\n <!-- Updated time info -->\r\n @if (!(isNewForm())) {\r\n <div class=\"updated-time\">\r\n <mat-icon>update</mat-icon>\r\n <span>Updated {{ selectFormUpdated() }}</span>\r\n </div>\r\n }\r\n </mat-toolbar>\r\n</header>\r\n\r\n<!-- Main content with optimized loading -->\r\n@defer (on viewport) {\r\n<div class=\"container\">\r\n <div class=\"middle\">\r\n <br>\r\n @if (selectLoadingForm()) {\r\n <div class=\"loading-container\">\r\n <mat-spinner />\r\n </div>\r\n } @else {\r\n <app-form-section-stepper />\r\n }\r\n <br>\r\n @if ((hasMissingConfigs()) && !(selectLoadingForm())) {\r\n <app-missing-form-configs />\r\n }\r\n </div>\r\n\r\n @if (elementEditorOpen()) {\r\n <app-input-editor style=\"max-width:480px;height:calc(100vh - 64px);z-index:1\" cdkDrag cdkDragBoundary=\"container\" class=\"middle editor-container\" />\r\n }\r\n <!-- Missing fields section -->`\r\n\r\n\r\n</div>\r\n}@placeholder {\r\n <div style=\"padding: 50px;display:flex;justify-content:center;align-items:center; text-align: center;\">\r\n <mat-spinner diameter=\"50\" />\r\n </div>\r\n}", styles: [".container{display:flex;width:100%;height:calc(100% - 64px)}.side{width:100px;background-color:#f8d7da}.middle{flex-grow:1;height:100%;overflow:auto;background-color:none}.section-title-input{border:none;background-color:transparent;font-size:16px;font-weight:600;color:#fff;padding-top:12px;padding-bottom:12px;outline:none;min-width:268px;transition:border-bottom-color .3s ease-in-out}.section-title-input:focus{border-bottom:1px solid #ffffff}.missing-fields{position:fixed;bottom:0}.updated-time{display:flex;gap:8px;align-items:center;line-height:normal;font-size:14px;bottom:0;position:absolute;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);padding:8px;border-radius:4px}.nav-group{display:flex;align-items:center;gap:8px}.save-button{margin-left:8px;min-width:168px}.loading-container{display:flex;height:calc(100% - 150px);justify-content:center;align-items:center}.editor-container{max-width:500px}.divider{margin:0 8px;opacity:.5}app-missing-form-configs{position:absolute;bottom:0;right:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i7.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i9.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], deferBlockDependencies: [() => [import('./ngx-t-forms-forms-builder-menu.component-aRCX4Hz7.mjs').then(m => m.FormsBuilderMenuComponent)], () => [i2$1.CdkDrag, i7.MatProgressSpinner, import('./ngx-t-forms-input-editor.component-mXuY17jv.mjs').then(m => m.InputEditorComponent), import('./ngx-t-forms-form-section-stepper.component-CmIrhO2e.mjs').then(m => m.FormSectionStepperComponent), import('./ngx-t-forms-missing-form-configs.component-CB9fHHqd.mjs').then(m => m.MissingFormConfigsComponent)]] }); }
|
|
4787
4940
|
}
|
|
4788
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "19.2.2", ngImport: i0, type: FormBuilderComponent, resolveDeferredDeps: () => [import('./ngx-t-forms-forms-builder-menu.component-
|
|
4941
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "19.2.2", ngImport: i0, type: FormBuilderComponent, resolveDeferredDeps: () => [import('./ngx-t-forms-forms-builder-menu.component-aRCX4Hz7.mjs').then(m => m.FormsBuilderMenuComponent), import('./ngx-t-forms-input-editor.component-mXuY17jv.mjs').then(m => m.InputEditorComponent), import('./ngx-t-forms-form-section-stepper.component-CmIrhO2e.mjs').then(m => m.FormSectionStepperComponent), import('./ngx-t-forms-missing-form-configs.component-CB9fHHqd.mjs').then(m => m.MissingFormConfigsComponent)], resolveMetadata: (FormsBuilderMenuComponent, InputEditorComponent, FormSectionStepperComponent, MissingFormConfigsComponent) => ({ decorators: [{
|
|
4789
4942
|
type: Component,
|
|
4790
4943
|
args: [{ selector: 'app-form-builder', standalone: true, imports: [CommonModule,
|
|
4791
4944
|
MatModulesModule,
|
|
@@ -4959,27 +5112,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
4959
5112
|
args: [DOCUMENT]
|
|
4960
5113
|
}] }] });
|
|
4961
5114
|
|
|
4962
|
-
function testAgainstItem(test, item) {
|
|
4963
|
-
try {
|
|
4964
|
-
const testValue = test.deepBind ? safeReturnDeepProperty(item, test.deepBind || [])?.value : item;
|
|
4965
|
-
const key = test.deepBind ? test.deepBind[test.deepBind.length - 1] : '';
|
|
4966
|
-
const objectValue = test.deepBind ? { [key || '']: testValue } : testValue;
|
|
4967
|
-
if (test.expression) {
|
|
4968
|
-
return ExpressionValidator(test.expression, objectValue);
|
|
4969
|
-
}
|
|
4970
|
-
if (test.testType === 'exists') {
|
|
4971
|
-
return test.testType === 'exists' && testValue !== '' && testValue !== undefined;
|
|
4972
|
-
}
|
|
4973
|
-
if (test.testType === 'equalTo') {
|
|
4974
|
-
return testValue === test.valueMatch;
|
|
4975
|
-
}
|
|
4976
|
-
return false;
|
|
4977
|
-
}
|
|
4978
|
-
catch (error) {
|
|
4979
|
-
return false;
|
|
4980
|
-
}
|
|
4981
|
-
}
|
|
4982
|
-
|
|
4983
5115
|
class TDynamicDataEditComponent {
|
|
4984
5116
|
constructor(ngZone) {
|
|
4985
5117
|
this.ngZone = ngZone;
|
|
@@ -5147,9 +5279,9 @@ class TDynamicDataEditComponent {
|
|
|
5147
5279
|
}
|
|
5148
5280
|
}
|
|
5149
5281
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: TDynamicDataEditComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5150
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: TDynamicDataEditComponent, isStandalone: true, selector: "lib-t-dynamic-data-edit", inputs: { editorConfig: "editorConfig", formInputs: "formInputs", data: "data", validationErrors: "validationErrors" }, outputs: { valueChange: "valueChange", blur: "blur" }, ngImport: i0, template: "@defer {\r\n <ng-container *ngIf=\"( vm$ |async) as vm\" >\r\n\r\n <mat-form-field appearance=\"outline\"\r\n [color]=\"((validationErrors)||[]||[]).length>0 ? 'warn' : 'primary'\"\r\n [floatLabel]=\"'always'\" [subscriptSizing]=\"'dynamic'\"\r\n [hintLabel]=\"vm.editorConfigValue?.hint||''\">\r\n <mat-label> {{ (vm. editorConfigValue)?.label + ((vm. editorConfigValue)?.required ? '*' : '')}} </mat-label>\r\n \r\n @switch ((vm. editorConfigValue)?.editType) {\r\n @default {\r\n <input \r\n (blur)=\"elementBlur($event)\" \r\n (input)=\"inputChange($event)\" \r\n [disabled]=\"(vm.disabled)\"\r\n [value]=\"(vm.value)\" matInput \r\n \r\n [placeholder]=\"(vm. editorConfigValue)?.placeholder ||'Enter value'\">\r\n \r\n \r\n }\r\n @case ( elementEditorTypes.Toggle) {\r\n <lib-mat-slider-toggle-editor \r\n [name]=\"((vm. editorConfigValue)?.name||'') \" \r\n [label]=\"((vm. editorConfigValue)?.label||'')\"\r\n \r\n (valueChange)=\"valueChanged(!!$event)\" [value]=\"(vm.value)\" \r\n [errors]=\"(validationErrors)||[]\">\r\n </lib-mat-slider-toggle-editor>\r\n \r\n }\r\n \r\n @case (elementEditorTypes.Range) {\r\n \r\n \r\n <lib-mat-slider-editor [format]=\"( vm.editorConfigValue)?.format \" [formatLabel]=\" formatLabel\"\r\n [max]=\"( vm.editorConfigValue)?.max || 100\" [value]=\"(vm.value)\" [errors]=\"(validationErrors)||[]\"\r\n [min]=\"( vm.editorConfigValue)?.min || 0\" (valueChange)=\"inputChange($event)\"\r\n [step]=\"( vm.editorConfigValue)?.step || 1\" tickInterval=\"( vm.editorConfigValue)?.step || 1\">\r\n \r\n \r\n </lib-mat-slider-editor>\r\n \r\n \r\n \r\n }\r\n \r\n @case (elementEditorTypes.ChipSelect) {\r\n <lib-mat-chip-list-editor [options]=\"(vm.editorConfigValue)?.options\" [required]=\"!!( vm.editorConfigValue)?.required\"\r\n [value]=\"(vm.value)\" [errors]=\"(validationErrors)||[]\" (valueChange)=\" valueChanged($event)\"></lib-mat-chip-list-editor>\r\n \r\n }\r\n \r\n @case (elementEditorTypes.OptionSelect) {\r\n \r\n <mat-select [value]=\"(vm.value)\" (selectionChange)=\"valueChanged($event.value)\">\r\n @for(option of ( vm.editorConfigValue)?.options;track option.value){\r\n <mat-option [value]=\"option.value\">{{option.label}}</mat-option>\r\n }\r\n </mat-select>\r\n \r\n }\r\n <!--\r\n @case (elementEditorTypes.RichTextEditor) {\r\n <p>\r\n Not implemented yet\r\n </p>\r\n }\r\n --->\r\n \r\n @case (elementEditorTypes.SelectionOptions) {\r\n \r\n <app-selection-options-editor [errors]=\"(validationErrors)||[]\" [id]=\"((vm.editorConfigValue)?.label||'')+((vm.editorConfigValue)?.editType||'')\"\r\n [options]=\"(vm.value) || []\" (valueChanged)=\"valueChanged($event)\"></app-selection-options-editor>\r\n }\r\n \r\n @case (\r\n elementEditorTypes.ApiCall) {\r\n \r\n <lib-rest-api-call-setup \r\n [postmanCollectionConfig]=\"(vm.editorConfigValue)?.postmanCollectionConfig\"\r\n [httpGetDataFunction]=\"(vm.editorConfigValue)?.httpGetDataFunction\"\r\n [id]=\"((vm.editorConfigValue)?.label||'')+((vm.editorConfigValue)?.editType||'')\" [value]=\"(vm.value)\" [errors]=\"(validationErrors)||[]\"\r\n (valueChanged)=\"valueChanged($event)\">\r\n \r\n </lib-rest-api-call-setup>\r\n }\r\n \r\n @case (elementEditorTypes.MongoPipelineBuilder) {\r\n \r\n <app-pipeline-generator [id]=\"((vm.editorConfigValue)?.label||'')+((vm.editorConfigValue)?.editType||'')\" [value]=\"(vm.value)\"\r\n [errors]=\"(validationErrors)||[]\" [getWorkflowOptions]=\"getWorkflowOptions$\"\r\n (valueChanged)=\"valueChanged($event)\"></app-pipeline-generator>\r\n \r\n }\r\n @case (elementEditorTypes.ApiValueAccessRules) {\r\n \r\n \r\n \r\n <app-api-value-access-rules \r\n [id]=\"((vm.editorConfigValue)?.label||'')+((vm.editorConfigValue)?.editType||'')\" [value]=\"(vm.value)\"\r\n [errors]=\"(validationErrors)||[]\" [formInputs]=\"formInputs ||[]\" \r\n [postmanCollectionConfig]=\"(vm.editorConfigValue)?.postmanCollectionConfig\"\r\n \r\n [mapToData]=\"vm.dataOptions\"\r\n (valueChanged)=\"valueChanged($event)\">\r\n </app-api-value-access-rules>\r\n \r\n }\r\n \r\n @case (elementEditorTypes.FormInputSelector)\r\n {\r\n \r\n <lib-form-input-selector [formInputs]=\"formInputs ||[]\" [errors]=\"(validationErrors)||[]\" [value]=\"(vm.value) || []\"\r\n (change)=\"valueChanged($event)\">\r\n </lib-form-input-selector>\r\n }\r\n \r\n @case (\r\n elementEditorTypes.RequiredInputs\r\n ){\r\n \r\n <app-required-inputs [formInputs]=\"formInputs ||[]\" [id]=\"((vm.editorConfigValue)?.label||'')+((vm.editorConfigValue)?.editType||'')\"\r\n [value]=\"(vm.value)\" [errors]=\"(validationErrors)||[]\" (valueChanged)=\"valueChanged($event)\">\r\n </app-required-inputs>\r\n }\r\n \r\n @case(elementEditorTypes.CalculatedFieldRules){\r\n \r\n <app-calculated-field-rules [formInputs]=\"formInputs ||[]\"\r\n [id]=\"((vm.editorConfigValue)?.label||'')+((vm.editorConfigValue)?.editType||'')\" [value]=\"(vm.value)\" [errors]=\"(validationErrors)||[]\"\r\n (valueChanged)=\"valueChanged($event)\" [mapToData]=\"vm.dataOptions\"></app-calculated-field-rules>\r\n }\r\n \r\n @case(elementEditorTypes.Validators){\r\n \r\n <app-validators-config [id]=\"((vm.editorConfigValue)?.label||'')+((vm.editorConfigValue)?.editType||'')\" [value]=\"(vm.value)\"\r\n [errors]=\"(validationErrors)||[]\" (valueChanged)=\"valueChanged($event)\" [formInputs]=\"formInputs ||[]\"\r\n [mapToData]=\"vm.dataOptions\">\r\n </app-validators-config>\r\n \r\n }\r\n @case(elementEditorTypes.ConfigMscoaSegments){\r\n \r\n <app-mscoa-segment-config [value]=\"(vm.value)\" [errors]=\"(validationErrors)||[]\" [getMscoaTree]=\"getMscoaTree$\"\r\n [showAllSegments]=\"vm.dataOptions\" (valueChanged)=\"valueChanged($event)\"></app-mscoa-segment-config>\r\n }\r\n @case(elementEditorTypes.ConfigMscoaAdditionalInputs){\r\n \r\n <app-config-mscoa-additional-inputs [id]=\"((vm.editorConfigValue)?.label||'')+((vm.editorConfigValue)?.editType||'')\"\r\n [value]=\"(vm.value)\" [errors]=\"(validationErrors)||[]\" [getMscoaTree]=\"getMscoaTree$\"\r\n (valueChanged)=\"valueChanged($event)\">\r\n </app-config-mscoa-additional-inputs>\r\n \r\n }\r\n }\r\n \r\n <button [matTooltip]=\"blurFunctionTooltip((vm.editorConfigValue)?.blurHandle)\" *ngIf=\"(vm.inputHasBlurFunction)\"\r\n [disabled]=\"(vm.disabled)\" [color]=\"blurOff?'':'primary'\" (click)=\"blurOff=!blurOff\" matSuffix\r\n mat-icon-button>\r\n <mat-icon>{{\r\n blurOff?'blur_off':'blur_on'\r\n }}\r\n \r\n \r\n </mat-icon>\r\n </button>\r\n </mat-form-field>\r\n\r\n \r\n <mat-error style=\" font-size: 12px;\r\n margin-left: 14px;\r\n \" *ngFor=\"let error of (validationErrors)||[]\">\r\n \r\n {{error.message}}</mat-error>\r\n \r\n </ng-container>\r\n \r\n}@error {\r\n <mat-card>\r\n <mat-card-content>\r\n \r\n <span> \r\n Failed to load form inputs\r\n </span>\r\n </mat-card-content>\r\n </mat-card>\r\n }\r\n\r\n\r\n\r\n<!-- - \r\n `TableConfigSetup`\r\n- `ConditionalInputConfig`\r\n- `MatrixTable`-->", styles: [".showItemValue{opacity:.6}mat-form-field{width:100%}mat-slider{width:100%}.range{display:flex;align-items:center}label{line-height:normal;margin-top:12px;font-weight:500;font-size:12px;color:var(--mdc-filled-text-field-focus-label-text-color, var(--mat-app-primary));display:flex;justify-content:space-between;align-items:center}.elementInfo{display:flex;align-items:center;justify-content:center;padding:0;height:24px;width:24px}.infoIcon{font-size:16px;height:16px;width:16px}.toggle-label{margin-left:5px;align-items:center;display:flex;font-weight:500;line-height:normal;justify-content:space-between;color:var(--mdc-filled-text-field-focus-label-text-color, var(--mat-app-primary))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatModulesModule }, { kind: "component", type: i3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3.MatCardContent, selector: "mat-card-content" }], deferBlockDependencies: [() => [i2$2.NgForOf, i2$2.NgIf, i2$2.AsyncPipe, import('./ngx-t-forms-selection-options-editor.component-CKdTcvyb.mjs').then(m => m.SelectionOptionsEditorComponent), import('./ngx-t-forms-form-input-selector.component-BZLCiTEx.mjs').then(m => m.FormInputSelectorComponent), import('./ngx-t-forms-rest-api-call-setup.component-C_zsy4Pr.mjs').then(m => m.RestApiCallSetupComponent), import('./ngx-t-forms-api-value-access-rules.component-DVxjY46W.mjs').then(m => m.ApiValueAccessRulesComponent), import('./ngx-t-forms-required-inputs.component-CnRGUtEj.mjs').then(m => m.RequiredInputsComponent), import('./ngx-t-forms-pipeline-generator.component-CZRBVUb4.mjs').then(m => m.PipelineGeneratorComponent), import('./ngx-t-forms-calculated-field-rules.component-CF0b2IAN.mjs').then(m => m.CalculatedFieldRulesComponent), import('./ngx-t-forms-validators-config.component-CTUwEJKh.mjs').then(m => m.ValidatorsConfigComponent), import('./ngx-t-forms-config-mscoa-additional-inputs.component-DEDrjICX.mjs').then(m => m.ConfigMscoaAdditionalInputsComponent), import('./ngx-t-forms-mat-slider-editor.component-bDCnls3E.mjs').then(m => m.MatSliderEditorComponent), import('./ngx-t-forms-mscoa-segment-config.component-B80B7Y2g.mjs').then(m => m.MscoaSegmentConfigComponent), import('./ngx-t-forms-mat-slider-toggle-editor.component-C7q7RAhA.mjs').then(m => m.MatSliderToggleEditorComponent), import('./ngx-t-forms-mat-chip-list-editor.component-D1jGY0Wp.mjs').then(m => m.MatChipListEditorComponent), i2$3.MatOption, i2.MatIconButton, i5.MatIcon, i4.MatFormField, i4.MatLabel, i4.MatError, i4.MatSuffix, i7$1.MatSelect, i8.MatTooltip, i5$1.MatInput]] }); }
|
|
5282
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: TDynamicDataEditComponent, isStandalone: true, selector: "lib-t-dynamic-data-edit", inputs: { editorConfig: "editorConfig", formInputs: "formInputs", data: "data", validationErrors: "validationErrors" }, outputs: { valueChange: "valueChange", blur: "blur" }, ngImport: i0, template: "@defer {\r\n <ng-container *ngIf=\"( vm$ |async) as vm\" >\r\n\r\n <mat-form-field appearance=\"outline\"\r\n [color]=\"((validationErrors)||[]||[]).length>0 ? 'warn' : 'primary'\"\r\n [floatLabel]=\"'always'\" [subscriptSizing]=\"'dynamic'\"\r\n [hintLabel]=\"vm.editorConfigValue?.hint||''\">\r\n <mat-label> {{ (vm. editorConfigValue)?.label + ((vm. editorConfigValue)?.required ? '*' : '')}} </mat-label>\r\n \r\n @switch ((vm. editorConfigValue)?.editType) {\r\n @default {\r\n <input \r\n (blur)=\"elementBlur($event)\" \r\n (input)=\"inputChange($event)\" \r\n [disabled]=\"(vm.disabled)\"\r\n [value]=\"(vm.value)\" matInput \r\n \r\n [placeholder]=\"(vm. editorConfigValue)?.placeholder ||'Enter value'\">\r\n \r\n \r\n }\r\n @case ( elementEditorTypes.Toggle) {\r\n <lib-mat-slider-toggle-editor \r\n [name]=\"((vm. editorConfigValue)?.name||'') \" \r\n [label]=\"((vm. editorConfigValue)?.label||'')\"\r\n \r\n (valueChange)=\"valueChanged(!!$event)\" [value]=\"(vm.value)\" \r\n [errors]=\"(validationErrors)||[]\">\r\n </lib-mat-slider-toggle-editor>\r\n \r\n }\r\n \r\n @case (elementEditorTypes.Range) {\r\n \r\n \r\n <lib-mat-slider-editor [format]=\"( vm.editorConfigValue)?.format \" [formatLabel]=\" formatLabel\"\r\n [max]=\"( vm.editorConfigValue)?.max || 100\" [value]=\"(vm.value)\" [errors]=\"(validationErrors)||[]\"\r\n [min]=\"( vm.editorConfigValue)?.min || 0\" (valueChange)=\"inputChange($event)\"\r\n [step]=\"( vm.editorConfigValue)?.step || 1\" tickInterval=\"( vm.editorConfigValue)?.step || 1\">\r\n \r\n \r\n </lib-mat-slider-editor>\r\n \r\n \r\n \r\n }\r\n \r\n @case (elementEditorTypes.ChipSelect) {\r\n <lib-mat-chip-list-editor [options]=\"(vm.editorConfigValue)?.options\" [required]=\"!!( vm.editorConfigValue)?.required\"\r\n [value]=\"(vm.value)\" [errors]=\"(validationErrors)||[]\" (valueChange)=\" valueChanged($event)\"></lib-mat-chip-list-editor>\r\n \r\n }\r\n \r\n @case (elementEditorTypes.OptionSelect) {\r\n \r\n <mat-select [value]=\"(vm.value)\" (selectionChange)=\"valueChanged($event.value)\">\r\n @for(option of ( vm.editorConfigValue)?.options;track option.value){\r\n <mat-option [value]=\"option.value\">{{option.label}}</mat-option>\r\n }\r\n </mat-select>\r\n \r\n }\r\n <!--\r\n @case (elementEditorTypes.RichTextEditor) {\r\n <p>\r\n Not implemented yet\r\n </p>\r\n }\r\n --->\r\n \r\n @case (elementEditorTypes.SelectionOptions) {\r\n \r\n <app-selection-options-editor [errors]=\"(validationErrors)||[]\" [id]=\"((vm.editorConfigValue)?.label||'')+((vm.editorConfigValue)?.editType||'')\"\r\n [options]=\"(vm.value) || []\" (valueChanged)=\"valueChanged($event)\"></app-selection-options-editor>\r\n }\r\n \r\n @case (\r\n elementEditorTypes.ApiCall) {\r\n \r\n <lib-rest-api-call-setup \r\n [postmanCollectionConfig]=\"(vm.editorConfigValue)?.postmanCollectionConfig\"\r\n [httpGetDataFunction]=\"(vm.editorConfigValue)?.httpGetDataFunction\"\r\n [id]=\"((vm.editorConfigValue)?.label||'')+((vm.editorConfigValue)?.editType||'')\" [value]=\"(vm.value)\" [errors]=\"(validationErrors)||[]\"\r\n (valueChanged)=\"valueChanged($event)\">\r\n \r\n </lib-rest-api-call-setup>\r\n }\r\n \r\n @case (elementEditorTypes.MongoPipelineBuilder) {\r\n \r\n <app-pipeline-generator [id]=\"((vm.editorConfigValue)?.label||'')+((vm.editorConfigValue)?.editType||'')\" [value]=\"(vm.value)\"\r\n [errors]=\"(validationErrors)||[]\" [getWorkflowOptions]=\"getWorkflowOptions$\"\r\n (valueChanged)=\"valueChanged($event)\"></app-pipeline-generator>\r\n \r\n }\r\n @case (elementEditorTypes.ApiValueAccessRules) {\r\n \r\n \r\n \r\n <app-api-value-access-rules \r\n [id]=\"((vm.editorConfigValue)?.label||'')+((vm.editorConfigValue)?.editType||'')\" [value]=\"(vm.value)\"\r\n [errors]=\"(validationErrors)||[]\" [formInputs]=\"formInputs ||[]\" \r\n [postmanCollectionConfig]=\"(vm.editorConfigValue)?.postmanCollectionConfig\"\r\n \r\n [mapToData]=\"vm.dataOptions\"\r\n (valueChanged)=\"valueChanged($event)\">\r\n </app-api-value-access-rules>\r\n \r\n }\r\n \r\n @case (elementEditorTypes.FormInputSelector)\r\n {\r\n \r\n <lib-form-input-selector [formInputs]=\"formInputs ||[]\" [errors]=\"(validationErrors)||[]\" [value]=\"(vm.value) || []\"\r\n (change)=\"valueChanged($event)\">\r\n </lib-form-input-selector>\r\n }\r\n \r\n @case (\r\n elementEditorTypes.RequiredInputs\r\n ){\r\n \r\n <app-required-inputs [formInputs]=\"formInputs ||[]\" [id]=\"((vm.editorConfigValue)?.label||'')+((vm.editorConfigValue)?.editType||'')\"\r\n [value]=\"(vm.value)\" [errors]=\"(validationErrors)||[]\" (valueChanged)=\"valueChanged($event)\">\r\n </app-required-inputs>\r\n }\r\n \r\n @case(elementEditorTypes.CalculatedFieldRules){\r\n \r\n <app-calculated-field-rules [formInputs]=\"formInputs ||[]\"\r\n [id]=\"((vm.editorConfigValue)?.label||'')+((vm.editorConfigValue)?.editType||'')\" [value]=\"(vm.value)\" [errors]=\"(validationErrors)||[]\"\r\n (valueChanged)=\"valueChanged($event)\" [mapToData]=\"vm.dataOptions\"></app-calculated-field-rules>\r\n }\r\n \r\n @case(elementEditorTypes.Validators){\r\n \r\n <app-validators-config [id]=\"((vm.editorConfigValue)?.label||'')+((vm.editorConfigValue)?.editType||'')\" [value]=\"(vm.value)\"\r\n [errors]=\"(validationErrors)||[]\" (valueChanged)=\"valueChanged($event)\" [formInputs]=\"formInputs ||[]\"\r\n [mapToData]=\"vm.dataOptions\">\r\n </app-validators-config>\r\n \r\n }\r\n @case(elementEditorTypes.ConfigMscoaSegments){\r\n \r\n <app-mscoa-segment-config [value]=\"(vm.value)\" [errors]=\"(validationErrors)||[]\" [getMscoaTree]=\"getMscoaTree$\"\r\n [showAllSegments]=\"vm.dataOptions\" (valueChanged)=\"valueChanged($event)\"></app-mscoa-segment-config>\r\n }\r\n @case(elementEditorTypes.ConfigMscoaAdditionalInputs){\r\n \r\n <app-config-mscoa-additional-inputs [id]=\"((vm.editorConfigValue)?.label||'')+((vm.editorConfigValue)?.editType||'')\"\r\n [value]=\"(vm.value)\" [errors]=\"(validationErrors)||[]\" [getMscoaTree]=\"getMscoaTree$\"\r\n (valueChanged)=\"valueChanged($event)\">\r\n </app-config-mscoa-additional-inputs>\r\n \r\n }\r\n }\r\n \r\n <button [matTooltip]=\"blurFunctionTooltip((vm.editorConfigValue)?.blurHandle)\" *ngIf=\"(vm.inputHasBlurFunction)\"\r\n [disabled]=\"(vm.disabled)\" [color]=\"blurOff?'':'primary'\" (click)=\"blurOff=!blurOff\" matSuffix\r\n mat-icon-button>\r\n <mat-icon>{{\r\n blurOff?'blur_off':'blur_on'\r\n }}\r\n \r\n \r\n </mat-icon>\r\n </button>\r\n </mat-form-field>\r\n\r\n \r\n <mat-error style=\" font-size: 12px;\r\n margin-left: 14px;\r\n \" *ngFor=\"let error of (validationErrors)||[]\">\r\n \r\n {{error.message}}</mat-error>\r\n \r\n </ng-container>\r\n \r\n}@error {\r\n <mat-card>\r\n <mat-card-content>\r\n \r\n <span> \r\n Failed to load form inputs\r\n </span>\r\n </mat-card-content>\r\n </mat-card>\r\n }\r\n\r\n\r\n\r\n<!-- - \r\n `TableConfigSetup`\r\n- `ConditionalInputConfig`\r\n- `MatrixTable`-->", styles: [".showItemValue{opacity:.6}mat-form-field{width:100%}mat-slider{width:100%}.range{display:flex;align-items:center}label{line-height:normal;margin-top:12px;font-weight:500;font-size:12px;color:var(--mdc-filled-text-field-focus-label-text-color, var(--mat-app-primary));display:flex;justify-content:space-between;align-items:center}.elementInfo{display:flex;align-items:center;justify-content:center;padding:0;height:24px;width:24px}.infoIcon{font-size:16px;height:16px;width:16px}.toggle-label{margin-left:5px;align-items:center;display:flex;font-weight:500;line-height:normal;justify-content:space-between;color:var(--mdc-filled-text-field-focus-label-text-color, var(--mat-app-primary))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatModulesModule }, { kind: "component", type: i3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3.MatCardContent, selector: "mat-card-content" }], deferBlockDependencies: [() => [i2$2.NgForOf, i2$2.NgIf, i2$2.AsyncPipe, import('./ngx-t-forms-selection-options-editor.component-Cg8VpW0u.mjs').then(m => m.SelectionOptionsEditorComponent), import('./ngx-t-forms-form-input-selector.component-67wrHiYd.mjs').then(m => m.FormInputSelectorComponent), import('./ngx-t-forms-rest-api-call-setup.component-YNPCGXf7.mjs').then(m => m.RestApiCallSetupComponent), import('./ngx-t-forms-api-value-access-rules.component--ueeSVqR.mjs').then(m => m.ApiValueAccessRulesComponent), import('./ngx-t-forms-required-inputs.component-B6tNZ162.mjs').then(m => m.RequiredInputsComponent), import('./ngx-t-forms-pipeline-generator.component-IEocJSHF.mjs').then(m => m.PipelineGeneratorComponent), import('./ngx-t-forms-calculated-field-rules.component-BN_-yZi7.mjs').then(m => m.CalculatedFieldRulesComponent), import('./ngx-t-forms-validators-config.component-CtKO5o6m.mjs').then(m => m.ValidatorsConfigComponent), import('./ngx-t-forms-config-mscoa-additional-inputs.component-D_IRYDOM.mjs').then(m => m.ConfigMscoaAdditionalInputsComponent), import('./ngx-t-forms-mat-slider-editor.component-Cf-bgYEw.mjs').then(m => m.MatSliderEditorComponent), import('./ngx-t-forms-mscoa-segment-config.component-BDVj1NFN.mjs').then(m => m.MscoaSegmentConfigComponent), import('./ngx-t-forms-mat-slider-toggle-editor.component-BghPaJ4n.mjs').then(m => m.MatSliderToggleEditorComponent), import('./ngx-t-forms-mat-chip-list-editor.component-Cm59yS0V.mjs').then(m => m.MatChipListEditorComponent), i2$3.MatOption, i2.MatIconButton, i5.MatIcon, i4.MatFormField, i4.MatLabel, i4.MatError, i4.MatSuffix, i7$1.MatSelect, i8.MatTooltip, i5$1.MatInput]] }); }
|
|
5151
5283
|
}
|
|
5152
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "19.2.2", ngImport: i0, type: TDynamicDataEditComponent, resolveDeferredDeps: () => [import('./ngx-t-forms-selection-options-editor.component-
|
|
5284
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "19.2.2", ngImport: i0, type: TDynamicDataEditComponent, resolveDeferredDeps: () => [import('./ngx-t-forms-selection-options-editor.component-Cg8VpW0u.mjs').then(m => m.SelectionOptionsEditorComponent), import('./ngx-t-forms-form-input-selector.component-67wrHiYd.mjs').then(m => m.FormInputSelectorComponent), import('./ngx-t-forms-rest-api-call-setup.component-YNPCGXf7.mjs').then(m => m.RestApiCallSetupComponent), import('./ngx-t-forms-api-value-access-rules.component--ueeSVqR.mjs').then(m => m.ApiValueAccessRulesComponent), import('./ngx-t-forms-required-inputs.component-B6tNZ162.mjs').then(m => m.RequiredInputsComponent), import('./ngx-t-forms-pipeline-generator.component-IEocJSHF.mjs').then(m => m.PipelineGeneratorComponent), import('./ngx-t-forms-calculated-field-rules.component-BN_-yZi7.mjs').then(m => m.CalculatedFieldRulesComponent), import('./ngx-t-forms-validators-config.component-CtKO5o6m.mjs').then(m => m.ValidatorsConfigComponent), import('./ngx-t-forms-config-mscoa-additional-inputs.component-D_IRYDOM.mjs').then(m => m.ConfigMscoaAdditionalInputsComponent), import('./ngx-t-forms-mat-slider-editor.component-Cf-bgYEw.mjs').then(m => m.MatSliderEditorComponent), import('./ngx-t-forms-mscoa-segment-config.component-BDVj1NFN.mjs').then(m => m.MscoaSegmentConfigComponent), import('./ngx-t-forms-mat-slider-toggle-editor.component-BghPaJ4n.mjs').then(m => m.MatSliderToggleEditorComponent), import('./ngx-t-forms-mat-chip-list-editor.component-Cm59yS0V.mjs').then(m => m.MatChipListEditorComponent)], resolveMetadata: (SelectionOptionsEditorComponent, FormInputSelectorComponent, RestApiCallSetupComponent, ApiValueAccessRulesComponent, RequiredInputsComponent, PipelineGeneratorComponent, CalculatedFieldRulesComponent, ValidatorsConfigComponent, ConfigMscoaAdditionalInputsComponent, MatSliderEditorComponent, MscoaSegmentConfigComponent, MatSliderToggleEditorComponent, MatChipListEditorComponent) => ({ decorators: [{
|
|
5153
5285
|
type: Component,
|
|
5154
5286
|
args: [{ selector: 'lib-t-dynamic-data-edit', standalone: true, imports: [CommonModule,
|
|
5155
5287
|
SelectionOptionsEditorComponent,
|
|
@@ -10265,5 +10397,5 @@ console.debug = () => { };
|
|
|
10265
10397
|
* Generated bundle index. Do not edit.
|
|
10266
10398
|
*/
|
|
10267
10399
|
|
|
10268
|
-
export {
|
|
10269
|
-
//# sourceMappingURL=ngx-t-forms-ngx-t-forms-
|
|
10400
|
+
export { safeReturnDeepProperty as A, getUrl as B, textIconsForUserHints as C, DaysAgoPipe as D, index as E, FormsStoreService as F, MatModulesModule as M, NGX_T_FORMS_CONFIG_TOKEN as N, PropertyAccessError as P, SyncEditorComponent as S, TDynamicDataEditComponent as T, UTILS_OBJECT_TOKEN as U, _isEqual as _, assignDeepPropertyToObject as a, TDynamicDataViewComponent as b, FormTowerControllerService as c, getSubmissionStatusFn as d, TreeComponent as e, NgxTFormsService as f, getAvatar as g, NgxTFormsComponent as h, initFormConfigToV2 as i, formGenerator as j, FORM_ACTIONS_TOKEN as k, FORM_CONFIG_TOKEN as l, FORM_SLIDES_TOKEN as m, FORM_INPUTS_TOKEN as n, MULTIPLE_FORM_INPUT_TOKEN as o, provideNgxTForms as p, MSCOA_TREE_PROVIDER as q, FormsComponent as r, FormBuilderComponent as s, testAgainstItem as t, MscoaFormInputComponent as u, UserFormStepperComponent as v, TFormInputComponent as w, DialogTemplateComponent as x, SignatureInputElementComponent as y, returnDeepProperty as z };
|
|
10401
|
+
//# sourceMappingURL=ngx-t-forms-ngx-t-forms-8hOAg-8v.mjs.map
|