ngx-t-forms 2.0.25 → 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/fesm2022/{ngx-t-forms-calculated-field-rules.component-DiNSTxsW.mjs → ngx-t-forms-calculated-field-rules.component-Cs_Lhz_D.mjs} +5 -5
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-DiNSTxsW.mjs.map → ngx-t-forms-calculated-field-rules.component-Cs_Lhz_D.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-3FkGwVWB.mjs → ngx-t-forms-chip-options-creator-editor.component-DkTpG5yQ.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-3FkGwVWB.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-tHaWIt1o.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-DJ9d3Oy9.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-tHaWIt1o.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-DJ9d3Oy9.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-data-source-picker.component-CxG1tQfC.mjs → ngx-t-forms-data-source-picker.component-CFQ_GVPG.mjs} +7 -7
- package/fesm2022/{ngx-t-forms-data-source-picker.component-CxG1tQfC.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-CsqYlgS6.mjs → ngx-t-forms-document-list-label-config-editor.component-CPF_BLRA.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-CsqYlgS6.mjs.map → ngx-t-forms-document-list-label-config-editor.component-CPF_BLRA.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-input-selector.component-D-nVF7t7.mjs → ngx-t-forms-form-input-selector.component-C38FXT55.mjs} +5 -5
- package/fesm2022/{ngx-t-forms-form-input-selector.component-D-nVF7t7.mjs.map → ngx-t-forms-form-input-selector.component-C38FXT55.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-json-view.component-B01nOklu.mjs → ngx-t-forms-form-json-view.component-C7i6JZ-l.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-json-view.component-B01nOklu.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-DyQBfgio.mjs → ngx-t-forms-input-editor.component-B12zbXE1.mjs} +5 -5
- package/fesm2022/{ngx-t-forms-input-editor.component-DyQBfgio.mjs.map → ngx-t-forms-input-editor.component-B12zbXE1.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-BCoTHeK3.mjs → ngx-t-forms-mat-chip-list-editor.component-dIY3BX1u.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-BCoTHeK3.mjs.map → ngx-t-forms-mat-chip-list-editor.component-dIY3BX1u.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mat-slider-editor.component-WDd5lc_2.mjs → ngx-t-forms-mat-slider-editor.component-yMRCg8fo.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mat-slider-editor.component-WDd5lc_2.mjs.map → ngx-t-forms-mat-slider-editor.component-yMRCg8fo.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mat-slider-toggle-editor.component-DGac4Eja.mjs → ngx-t-forms-mat-slider-toggle-editor.component-0aUVP9A6.mjs} +4 -4
- package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-0aUVP9A6.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-sJVu5SkY.mjs → ngx-t-forms-missing-form-configs.component-CsPMQZqg.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-sJVu5SkY.mjs.map → ngx-t-forms-missing-form-configs.component-CsPMQZqg.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-CF5DxLZG.mjs → ngx-t-forms-mscoa-chart-toolbar.component-D8a9-6lt.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-CF5DxLZG.mjs.map → ngx-t-forms-mscoa-chart-toolbar.component-D8a9-6lt.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-error-display.component-D9zKeT7Z.mjs → ngx-t-forms-mscoa-error-display.component-DwbyXd_D.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mscoa-error-display.component-D9zKeT7Z.mjs.map → ngx-t-forms-mscoa-error-display.component-DwbyXd_D.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-BIr1g5cG.mjs → ngx-t-forms-mscoa-segment-config.component-BXPghOuH.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-BIr1g5cG.mjs.map → ngx-t-forms-mscoa-segment-config.component-BXPghOuH.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-temporary-hint.component-DgdZwE72.mjs → ngx-t-forms-mscoa-temporary-hint.component-CBRfWvfD.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mscoa-temporary-hint.component-DgdZwE72.mjs.map → ngx-t-forms-mscoa-temporary-hint.component-CBRfWvfD.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-ngx-t-forms-A9_4GxP6.mjs → ngx-t-forms-ngx-t-forms-CD9InaXz.mjs} +99 -73
- package/fesm2022/ngx-t-forms-ngx-t-forms-CD9InaXz.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-CwCwl53b.mjs → ngx-t-forms-pipeline-generator.component-QE-I58e4.mjs} +5 -5
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-CwCwl53b.mjs.map → ngx-t-forms-pipeline-generator.component-QE-I58e4.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-record-list-manager.component-BYyr0yzb.mjs → ngx-t-forms-record-list-manager.component-D4wlLtdc.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-record-list-manager.component-BYyr0yzb.mjs.map → ngx-t-forms-record-list-manager.component-D4wlLtdc.mjs.map} +1 -1
- 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-CQeww1qM.mjs → ngx-t-forms-rest-api-call-setup.component-CtfudSGT.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-CQeww1qM.mjs.map → ngx-t-forms-rest-api-call-setup.component-CtfudSGT.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-section-report.component-DGwgq4QR.mjs → ngx-t-forms-section-report.component-Dntm1m5b.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-section-report.component-DGwgq4QR.mjs.map → ngx-t-forms-section-report.component-Dntm1m5b.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-CqAxZnEp.mjs → ngx-t-forms-selection-options-editor.component-Cc_qCtW2.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-CqAxZnEp.mjs.map → ngx-t-forms-selection-options-editor.component-Cc_qCtW2.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-t-workflow-picker.component-Cz6YZMia.mjs → ngx-t-forms-t-workflow-picker.component-xvX8t0pu.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-t-workflow-picker.component-Cz6YZMia.mjs.map → ngx-t-forms-t-workflow-picker.component-xvX8t0pu.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-validators-config.component-CL73KUxw.mjs → ngx-t-forms-validators-config.component-D6JG1p81.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-validators-config.component-CL73KUxw.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-submissions-config/form-submissions-config.component.d.ts +1 -1
- package/lib/components/forms/forms.component.d.ts +7 -0
- package/lib/components/t-dynamic-data-edit/elements/required-inputs/required-inputs.component.d.ts +1 -0
- package/package.json +1 -1
- package/fesm2022/ngx-t-forms-form-section-stepper.component-Bg9eGmgN.mjs +0 -267
- package/fesm2022/ngx-t-forms-form-section-stepper.component-Bg9eGmgN.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-jn9-yVbI.mjs +0 -348
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-jn9-yVbI.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-DGac4Eja.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-A9_4GxP6.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-required-inputs.component-pv5pqFhh.mjs +0 -188
- package/fesm2022/ngx-t-forms-required-inputs.component-pv5pqFhh.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-t-forms-validators-config.component-CL73KUxw.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/validators-config/validators-config.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/validators-config/validators-config.component.html"],"sourcesContent":["import { Component, ElementRef, EventEmitter, HostBinding, Input, OnInit, Optional, Output, Self } from '@angular/core';\r\nimport { MenuCloseReason } from '@angular/material/menu';\r\n\r\nimport { v4 as uuidv4 } from 'uuid';\r\n\r\nimport { ElementTypes, FormControlCustomValidatorsInterface, IMultiple } from 'ngx-t-forms-types';\r\nimport { FormColumnInputs } from 'ngx-t-forms-types';\r\nimport { getInputIllustration } from '../../../../shared/functions/getInputIllustration';\r\n\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormInputSelectorComponent } from '../form-input-selector/form-input-selector.component';\r\n\r\nimport { FormsModule, NgControl } from '@angular/forms';\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\r\n@Component({\r\n selector: 'app-validators-config',\r\n templateUrl: './validators-config.component.html',\r\n styleUrls: ['./validators-config.component.scss'],\r\n standalone: true,\r\n imports:[\r\n MatModulesModule,\r\n CommonModule,\r\n FormInputSelectorComponent,\r\n FormsModule\r\n ],\r\n providers: [{ provide: MatFormFieldControl, useExisting: ValidatorsConfigComponent}],\r\n})\r\nexport class ValidatorsConfigComponent implements OnInit,MatFormFieldControl<FormControlCustomValidatorsInterface []> {\r\n \r\n\r\n static nextId = 0;\r\n stateChanges = new Subject<void>();\r\n \r\n @HostBinding() id = `app-validators-config-${ValidatorsConfigComponent.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-validators-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 @Input() errors:IConfigElementError[] |undefined = [];\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 @Input() mapToData:FormColumnInputs | undefined = undefined;\r\n @Input() value!: (FormControlCustomValidatorsInterface )[];\r\n @Input() formInputs: Array<FormColumnInputs> = []\r\n @Output() valueChanged = new EventEmitter<any>();\r\n\r\n\r\n ngOnInit() {}\r\n\r\n edit:FormControlCustomValidatorsInterface | undefined\r\n menuClosed(event:MenuCloseReason){\r\n\r\n if (this.edit) {\r\n const editIndex = this.value.findIndex((item) => {\r\n if (typeof item === 'string') {\r\n return false;\r\n }\r\n return item.id === this.edit?.id;\r\n });\r\n\r\n if (editIndex !== -1) {\r\n this.value[editIndex] = this.edit;\r\n } \r\n this.valueChanged.emit([...this.value])\r\n\r\n\r\n }\r\n\r\n this.edit = undefined\r\n }\r\n showVariables :boolean = false\r\n editV(validator:string | FormControlCustomValidatorsInterface){\r\n if(this.edit?.id === (validator as FormControlCustomValidatorsInterface).id){\r\n this.edit = undefined\r\n return\r\n }\r\n this.edit = validator as any\r\n }\r\n remove(validator:FormControlCustomValidatorsInterface|string){\r\n const indexOfV = this.value.findIndex((item) => {\r\n if (typeof item === 'string') {\r\n return item === validator;\r\n }\r\n return item.id === (validator as FormControlCustomValidatorsInterface).id;\r\n }\r\n )\r\n\r\n\r\n this.value = [...this.value].filter((item,i)=>indexOfV !== i)\r\n this.valueChanged.emit([...this.value])\r\n\r\n }\r\n search: string = '';\r\n\r\n getInputIcon(element: ElementTypes) {\r\n\r\n return getInputIllustration(element)\r\n }\r\n \r\n selectInput(inputId: string) {\r\n const input = this.formInputs.find((input) => input.id === inputId)\r\n if(!input){\r\n return\r\n }\r\n if(input?.multipleInputInEditId){\r\n throw new Error('multipleInputInEditId is not supported')\r\n }\r\n if(!!this.edit){\r\n this.edit.expression = (this.edit?.expression || '' ).concat(input?.formControlName || '')\r\n if(!this.edit.inputsObservedForChanges.find((i)=>i.inputId === (input?.originalId || input?.id))){\r\n this.edit.inputsObservedForChanges.push({\r\n inputId: input?.originalId || input?.id,\r\n variable: input?.formControlName\r\n })\r\n }\r\n \r\n }\r\n \r\n\r\n this.showVariables = false\r\n\r\n }\r\n\r\n addVariable(event:any){\r\n this.showVariables = true\r\n event.stopPropagation()\r\n event.preventDefault()\r\n\r\n }\r\n getMultipleFormInputs(input: IMultiple) {\r\n if (\r\n input.element === ElementTypes.MultipleInput&&\r\n this.mapToData?.multipleInputInEditId === input.id\r\n ) {\r\n return input.formInputs;\r\n }\r\n return [];\r\n }\r\n returnExpression(){\r\n return this.edit?.expression.replace(/(word)/g, '<span style=\\'color: blue\\'>$1</span>')\r\n }\r\n addValidator(){\r\n this.edit = {\r\n message: '',\r\n expression: '',\r\n canOverride: false,\r\n inputsObservedForChanges: []\r\n } as any\r\n }\r\n\r\n onTextChange(event:Event,key:string){\r\n if(!this.edit) {\r\n this.edit = {} as any\r\n }\r\n (this.edit as any)[key] = (event.target as HTMLInputElement).value\r\n }\r\n saveVariable(event:any){\r\n console.log(this.edit)\r\n if(!this.edit) return;\r\n const id = uuidv4()\r\n const val = {...this.edit, id}\r\n this.value = [...this.value, val]\r\n this.valueChanged.emit([...this.value])\r\n this.edit = undefined\r\n \r\n \r\n\r\n\r\n \r\n }\r\n removeObserved(event:any,item:{ inputId: string; variable: string; }){\r\n const i = this.edit?.inputsObservedForChanges.findIndex((i:any)=>i === item)\r\n if(i !== undefined && i !== -1 && this.edit){\r\n this.edit?.inputsObservedForChanges.splice(i, 1);\r\n this.edit.expression = this.edit?.expression.replace(new RegExp(`\\\\b${item}\\\\b`, 'g'), '')\r\n\r\n }\r\n\r\n event.stopPropagation()\r\n event.preventDefault()\r\n }\r\n isFormControlCustomValidator(validator: string |FormControlCustomValidatorsInterface ){\r\n if(typeof validator == 'string'){\r\n return validator\r\n }\r\n return validator.message\r\n\r\n }\r\n}\r\n\r\n\r\n\r\n","<div class=\"tree-instructions\">\r\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\r\n <span>\r\n Custom validators are functions that take a form control as an argument and return an object of errors if the\r\n validation fails.\r\n </span>\r\n</div>\r\n\r\n<mat-list>\r\n<h5>\r\n Custom Validators\r\n</h5>\r\n <mat-chip-listbox [disabled]=\"disabled\" aria-label=\"Chip select options\">\r\n @for (validator of value; track $index) {\r\n <mat-chip-option\r\n style=\"height: fit-content;padding: 8px;\"\r\n [selected]=\"edit?.id === validator.id\"\r\n (click)=\"editV(validator)\"> \r\n <span style=\"white-space: normal;\">\r\n {{isFormControlCustomValidator(validator) | titlecase}}\r\n </span>\r\n \r\n <button *ngIf=\"this.edit?.id !== validator.id\" (click)=\"remove(validator)\" matChipRemove \r\n [attr.aria-label]=\"'remove ' \">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n <mat-icon *ngIf=\"this.edit?.id === validator.id\" matChipTrailingIcon>\r\n check_circle\r\n </mat-icon>\r\n \r\n \r\n </mat-chip-option>\r\n }\r\n <mat-chip-option\r\n matTooltip=\"Add a new custom validator\"\r\n selectable=\"false\"\r\n style=\"cursor: pointer !important;\"\r\n highlighted=\"true\" color=\"accent\" (click)=\"addValidator()\" *ngIf=\"!edit\">\r\n <span >\r\n\r\n </span>\r\n Add validator\r\n <mat-icon matChipTrailingIcon >add</mat-icon>\r\n\r\n \r\n </mat-chip-option>\r\n </mat-chip-listbox>\r\n\r\n \r\n \r\n\r\n\r\n</mat-list>\r\n<mat-card style=\"padding: 8px;background:var(--mat-sys-surface-container, var(--mat-app-surface))\"\r\n *ngIf=\"edit\">\r\n <ng-container *ngIf=\"edit && !showVariables; then validatorEditor\"></ng-container>\r\n <mat-toolbar *ngIf=\"!showVariables\" >\r\n <span class=\"spacer\"></span>\r\n <button (click)=\"edit=undefined\" mat-button>\r\n close\r\n </button>\r\n <button mat-raised-button [disabled]=\"!edit.expression ||!edit.message\"\r\n (click)=\"saveVariable($event)\" color=\"accent\">\r\n Save Validation\r\n </button>\r\n </mat-toolbar>\r\n <ng-container *ngIf=\"edit && !!showVariables; then variables\"></ng-container>\r\n</mat-card>\r\n\r\n\r\n\r\n\r\n<ng-template #validatorEditor>\r\n <div class=\"tree-instructions\">\r\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\r\n <span>\r\n The expression is checked on value change. The message shows if it fails.\r\n <br>\r\n You can observe inputs for changes to re-evaluate the expression.\r\n </span>\r\n </div>\r\n <mat-list *ngIf=\"edit\">\r\n\r\n <mat-form-field style=\"margin-bottom: 16px;\" (click)=\"$event.stopPropagation();\" appearance=\"outline\" subscriptSizing=\"dynamic\" >\r\n <mat-label >Validation Message</mat-label>\r\n <textarea matInput #textarea [value]=\"edit.message\"\r\n (input)=\"onTextChange($event,'message')\"\r\n placeholder=\"\r\n Enter message\r\n \"></textarea>\r\n\r\n <mat-hint>\r\n The message to display when the validation fails\r\n </mat-hint>\r\n\r\n </mat-form-field>\r\n\r\n\r\n\r\n\r\n <mat-form-field (click)=\"$event.stopPropagation();\" appearance=\"outline\" subscriptSizing=\"dynamic\" >\r\n <mat-label >Expression</mat-label>\r\n <textarea matInput #textarea \r\n (input)=\"onTextChange($event,'expression')\"\r\n [value]=\"edit.expression\" placeholder=\"\r\n enter expression\r\n \"></textarea>\r\n\r\n <mat-hint>\r\n The expression to evaluate the validation\r\n </mat-hint>\r\n\r\n </mat-form-field>\r\n <mat-toolbar>\r\n <mat-slide-toggle (click)=\"$event.stopPropagation();\" name=\"CanOveride\" ngDefaultControl\r\n (change)=\"edit.canOverride = $event.checked\" [checked]=\"edit.canOverride\">\r\n <span style=\"margin-left: 5px;\"> Users can override this validation</span>\r\n\r\n </mat-slide-toggle>\r\n </mat-toolbar>\r\n <label >\r\n Observe inputs for changes\r\n </label>\r\n <mat-chip-listbox aria-label=\"Chip select options\">\r\n @for(input of edit.inputsObservedForChanges;track input){\r\n <mat-chip>input\r\n <button (click)=\"removeObserved($event,input)\" matChipRemove [attr.aria-label]=\"'remove ' \">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip>\r\n }\r\n <mat-chip (click)=\"addVariable($event)\" color=\"primary\">\r\n Variable\r\n <mat-icon matChipTrailingIcon>\r\n add\r\n </mat-icon>\r\n </mat-chip>\r\n </mat-chip-listbox>\r\n\r\n <br>\r\n <mat-divider></mat-divider>\r\n\r\n\r\n </mat-list>\r\n</ng-template>\r\n\r\n<ng-template #variables>\r\n\r\n <section style=\"max-height: 360px; overflow-y: auto\">\r\n <lib-form-input-selector (change)=\"selectInput($event)\" [formInputs]=\"formInputs\">\r\n\r\n </lib-form-input-selector>\r\n\r\n <div class=\"contentBackground\" *ngIf=\"formInputs.length === 0\">\r\n <span style=\"\r\n display: block;\r\n text-align: center;\r\n font-style: italic;\r\n padding: 16px;\r\n \">No form inputs</span>\r\n </div>\r\n </section>\r\n <mat-toolbar>\r\n <span class=\"spacer\"></span>\r\n <button (click)=\"showVariables = !showVariables\" mat-flat-button>\r\n Close\r\n <mat-icon>\r\n close\r\n </mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n</ng-template>\r\n"],"names":["uuidv4","i13"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;MA+Ba,yBAAyB,CAAA;aAG5B,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,YAA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AA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAC1B,WAAW,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,8MAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAIF,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAbrC,SAAS;+BACE,uBAAuB,EAAA,UAAA,EAGrB,IAAI,EACR,OAAA,EAAA;wBACN,gBAAgB;wBAChB,YAAY;wBACZ,0BAA0B;wBAC1B;qBACD,EACU,SAAA,EAAA,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAA2B,yBAAA,EAAC,CAAC,EAAA,QAAA,EAAA,ghLAAA,EAAA,MAAA,EAAA,CAAA,0SAAA,CAAA,EAAA;;0BAWtE;;0BAAY;kEAHV,EAAE,EAAA,CAAA;sBAAhB;gBAYO,QAAQ,EAAA,CAAA;sBAAjB;gBAwBY,MAAM,EAAA,CAAA;sBAAd;gBAWK,SAAS,EAAA,CAAA;sBAAjB;gBACQ,KAAK,EAAA,CAAA;sBAAb;gBACQ,UAAU,EAAA,CAAA;sBAAlB;gBACS,YAAY,EAAA,CAAA;sBAArB;;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-validators-config.component-D6JG1p81.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/validators-config/validators-config.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/validators-config/validators-config.component.html"],"sourcesContent":["import { Component, ElementRef, EventEmitter, HostBinding, Input, OnInit, Optional, Output, Self } from '@angular/core';\r\nimport { MenuCloseReason } from '@angular/material/menu';\r\n\r\nimport { v4 as uuidv4 } from 'uuid';\r\n\r\nimport { ElementTypes, FormControlCustomValidatorsInterface, IMultiple } from 'ngx-t-forms-types';\r\nimport { FormColumnInputs } from 'ngx-t-forms-types';\r\nimport { getInputIllustration } from '../../../../shared/functions/getInputIllustration';\r\n\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormInputSelectorComponent } from '../form-input-selector/form-input-selector.component';\r\n\r\nimport { FormsModule, NgControl } from '@angular/forms';\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\r\n@Component({\r\n selector: 'app-validators-config',\r\n templateUrl: './validators-config.component.html',\r\n styleUrls: ['./validators-config.component.scss'],\r\n standalone: true,\r\n imports:[\r\n MatModulesModule,\r\n CommonModule,\r\n FormInputSelectorComponent,\r\n FormsModule\r\n ],\r\n providers: [{ provide: MatFormFieldControl, useExisting: ValidatorsConfigComponent}],\r\n})\r\nexport class ValidatorsConfigComponent implements OnInit,MatFormFieldControl<FormControlCustomValidatorsInterface []> {\r\n \r\n\r\n static nextId = 0;\r\n stateChanges = new Subject<void>();\r\n \r\n @HostBinding() id = `app-validators-config-${ValidatorsConfigComponent.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-validators-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 @Input() errors:IConfigElementError[] |undefined = [];\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 @Input() mapToData:FormColumnInputs | undefined = undefined;\r\n @Input() value!: (FormControlCustomValidatorsInterface )[];\r\n @Input() formInputs: Array<FormColumnInputs> = []\r\n @Output() valueChanged = new EventEmitter<any>();\r\n\r\n\r\n ngOnInit() {}\r\n\r\n edit:FormControlCustomValidatorsInterface | undefined\r\n menuClosed(event:MenuCloseReason){\r\n\r\n if (this.edit) {\r\n const editIndex = this.value.findIndex((item) => {\r\n if (typeof item === 'string') {\r\n return false;\r\n }\r\n return item.id === this.edit?.id;\r\n });\r\n\r\n if (editIndex !== -1) {\r\n this.value[editIndex] = this.edit;\r\n } \r\n this.valueChanged.emit([...this.value])\r\n\r\n\r\n }\r\n\r\n this.edit = undefined\r\n }\r\n showVariables :boolean = false\r\n editV(validator:string | FormControlCustomValidatorsInterface){\r\n if(this.edit?.id === (validator as FormControlCustomValidatorsInterface).id){\r\n this.edit = undefined\r\n return\r\n }\r\n this.edit = validator as any\r\n }\r\n remove(validator:FormControlCustomValidatorsInterface|string){\r\n const indexOfV = this.value.findIndex((item) => {\r\n if (typeof item === 'string') {\r\n return item === validator;\r\n }\r\n return item.id === (validator as FormControlCustomValidatorsInterface).id;\r\n }\r\n )\r\n\r\n\r\n this.value = [...this.value].filter((item,i)=>indexOfV !== i)\r\n this.valueChanged.emit([...this.value])\r\n\r\n }\r\n search: string = '';\r\n\r\n getInputIcon(element: ElementTypes) {\r\n\r\n return getInputIllustration(element)\r\n }\r\n \r\n selectInput(inputId: string) {\r\n const input = this.formInputs.find((input) => input.id === inputId)\r\n if(!input){\r\n return\r\n }\r\n if(input?.multipleInputInEditId){\r\n throw new Error('multipleInputInEditId is not supported')\r\n }\r\n if(!!this.edit){\r\n this.edit.expression = (this.edit?.expression || '' ).concat(input?.formControlName || '')\r\n if(!this.edit.inputsObservedForChanges.find((i)=>i.inputId === (input?.originalId || input?.id))){\r\n this.edit.inputsObservedForChanges.push({\r\n inputId: input?.originalId || input?.id,\r\n variable: input?.formControlName\r\n })\r\n }\r\n \r\n }\r\n \r\n\r\n this.showVariables = false\r\n\r\n }\r\n\r\n addVariable(event:any){\r\n this.showVariables = true\r\n event.stopPropagation()\r\n event.preventDefault()\r\n\r\n }\r\n getMultipleFormInputs(input: IMultiple) {\r\n if (\r\n input.element === ElementTypes.MultipleInput&&\r\n this.mapToData?.multipleInputInEditId === input.id\r\n ) {\r\n return input.formInputs;\r\n }\r\n return [];\r\n }\r\n returnExpression(){\r\n return this.edit?.expression.replace(/(word)/g, '<span style=\\'color: blue\\'>$1</span>')\r\n }\r\n addValidator(){\r\n this.edit = {\r\n message: '',\r\n expression: '',\r\n canOverride: false,\r\n inputsObservedForChanges: []\r\n } as any\r\n }\r\n\r\n onTextChange(event:Event,key:string){\r\n if(!this.edit) {\r\n this.edit = {} as any\r\n }\r\n (this.edit as any)[key] = (event.target as HTMLInputElement).value\r\n }\r\n saveVariable(event:any){\r\n console.log(this.edit)\r\n if(!this.edit) return;\r\n const id = uuidv4()\r\n const val = {...this.edit, id}\r\n this.value = [...this.value, val]\r\n this.valueChanged.emit([...this.value])\r\n this.edit = undefined\r\n \r\n \r\n\r\n\r\n \r\n }\r\n removeObserved(event:any,item:{ inputId: string; variable: string; }){\r\n const i = this.edit?.inputsObservedForChanges.findIndex((i:any)=>i === item)\r\n if(i !== undefined && i !== -1 && this.edit){\r\n this.edit?.inputsObservedForChanges.splice(i, 1);\r\n this.edit.expression = this.edit?.expression.replace(new RegExp(`\\\\b${item}\\\\b`, 'g'), '')\r\n\r\n }\r\n\r\n event.stopPropagation()\r\n event.preventDefault()\r\n }\r\n isFormControlCustomValidator(validator: string |FormControlCustomValidatorsInterface ){\r\n if(typeof validator == 'string'){\r\n return validator\r\n }\r\n return validator.message\r\n\r\n }\r\n}\r\n\r\n\r\n\r\n","<div class=\"tree-instructions\">\r\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\r\n <span>\r\n Custom validators are functions that take a form control as an argument and return an object of errors if the\r\n validation fails.\r\n </span>\r\n</div>\r\n\r\n<mat-list>\r\n<h5>\r\n Custom Validators\r\n</h5>\r\n <mat-chip-listbox [disabled]=\"disabled\" aria-label=\"Chip select options\">\r\n @for (validator of value; track $index) {\r\n <mat-chip-option\r\n style=\"height: fit-content;padding: 8px;\"\r\n [selected]=\"edit?.id === validator.id\"\r\n (click)=\"editV(validator)\"> \r\n <span style=\"white-space: normal;\">\r\n {{isFormControlCustomValidator(validator) | titlecase}}\r\n </span>\r\n \r\n <button *ngIf=\"this.edit?.id !== validator.id\" (click)=\"remove(validator)\" matChipRemove \r\n [attr.aria-label]=\"'remove ' \">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n <mat-icon *ngIf=\"this.edit?.id === validator.id\" matChipTrailingIcon>\r\n check_circle\r\n </mat-icon>\r\n \r\n \r\n </mat-chip-option>\r\n }\r\n <mat-chip-option\r\n matTooltip=\"Add a new custom validator\"\r\n selectable=\"false\"\r\n style=\"cursor: pointer !important;\"\r\n highlighted=\"true\" color=\"accent\" (click)=\"addValidator()\" *ngIf=\"!edit\">\r\n <span >\r\n\r\n </span>\r\n Add validator\r\n <mat-icon matChipTrailingIcon >add</mat-icon>\r\n\r\n \r\n </mat-chip-option>\r\n </mat-chip-listbox>\r\n\r\n \r\n \r\n\r\n\r\n</mat-list>\r\n<mat-card style=\"padding: 8px;background:var(--mat-sys-surface-container, var(--mat-app-surface))\"\r\n *ngIf=\"edit\">\r\n <ng-container *ngIf=\"edit && !showVariables; then validatorEditor\"></ng-container>\r\n <mat-toolbar *ngIf=\"!showVariables\" >\r\n <span class=\"spacer\"></span>\r\n <button (click)=\"edit=undefined\" mat-button>\r\n close\r\n </button>\r\n <button mat-raised-button [disabled]=\"!edit.expression ||!edit.message\"\r\n (click)=\"saveVariable($event)\" color=\"accent\">\r\n Save Validation\r\n </button>\r\n </mat-toolbar>\r\n <ng-container *ngIf=\"edit && !!showVariables; then variables\"></ng-container>\r\n</mat-card>\r\n\r\n\r\n\r\n\r\n<ng-template #validatorEditor>\r\n <div class=\"tree-instructions\">\r\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\r\n <span>\r\n The expression is checked on value change. The message shows if it fails.\r\n <br>\r\n You can observe inputs for changes to re-evaluate the expression.\r\n </span>\r\n </div>\r\n <mat-list *ngIf=\"edit\">\r\n\r\n <mat-form-field style=\"margin-bottom: 16px;\" (click)=\"$event.stopPropagation();\" appearance=\"outline\" subscriptSizing=\"dynamic\" >\r\n <mat-label >Validation Message</mat-label>\r\n <textarea matInput #textarea [value]=\"edit.message\"\r\n (input)=\"onTextChange($event,'message')\"\r\n placeholder=\"\r\n Enter message\r\n \"></textarea>\r\n\r\n <mat-hint>\r\n The message to display when the validation fails\r\n </mat-hint>\r\n\r\n </mat-form-field>\r\n\r\n\r\n\r\n\r\n <mat-form-field (click)=\"$event.stopPropagation();\" appearance=\"outline\" subscriptSizing=\"dynamic\" >\r\n <mat-label >Expression</mat-label>\r\n <textarea matInput #textarea \r\n (input)=\"onTextChange($event,'expression')\"\r\n [value]=\"edit.expression\" placeholder=\"\r\n enter expression\r\n \"></textarea>\r\n\r\n <mat-hint>\r\n The expression to evaluate the validation\r\n </mat-hint>\r\n\r\n </mat-form-field>\r\n <mat-toolbar>\r\n <mat-slide-toggle (click)=\"$event.stopPropagation();\" name=\"CanOveride\" ngDefaultControl\r\n (change)=\"edit.canOverride = $event.checked\" [checked]=\"edit.canOverride\">\r\n <span style=\"margin-left: 5px;\"> Users can override this validation</span>\r\n\r\n </mat-slide-toggle>\r\n </mat-toolbar>\r\n <label >\r\n Observe inputs for changes\r\n </label>\r\n <mat-chip-listbox aria-label=\"Chip select options\">\r\n @for(input of edit.inputsObservedForChanges;track input){\r\n <mat-chip>input\r\n <button (click)=\"removeObserved($event,input)\" matChipRemove [attr.aria-label]=\"'remove ' \">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip>\r\n }\r\n <mat-chip (click)=\"addVariable($event)\" color=\"primary\">\r\n Variable\r\n <mat-icon matChipTrailingIcon>\r\n add\r\n </mat-icon>\r\n </mat-chip>\r\n </mat-chip-listbox>\r\n\r\n <br>\r\n <mat-divider></mat-divider>\r\n\r\n\r\n </mat-list>\r\n</ng-template>\r\n\r\n<ng-template #variables>\r\n\r\n <section style=\"max-height: 360px; overflow-y: auto\">\r\n <lib-form-input-selector (change)=\"selectInput($event)\" [formInputs]=\"formInputs\">\r\n\r\n </lib-form-input-selector>\r\n\r\n <div class=\"contentBackground\" *ngIf=\"formInputs.length === 0\">\r\n <span style=\"\r\n display: block;\r\n text-align: center;\r\n font-style: italic;\r\n padding: 16px;\r\n \">No form inputs</span>\r\n </div>\r\n </section>\r\n <mat-toolbar>\r\n <span class=\"spacer\"></span>\r\n <button (click)=\"showVariables = !showVariables\" mat-flat-button>\r\n Close\r\n <mat-icon>\r\n close\r\n </mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n</ng-template>\r\n"],"names":["uuidv4","i13"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;MA+Ba,yBAAyB,CAAA;aAG5B,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;AAEnB,QAAA,IAAA,CAAA,EAAE,GAAG,CAAyB,sBAAA,EAAA,yBAAyB,CAAC,MAAM,EAAE,EAAE;QAEjF,IAAW,CAAA,WAAA,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,8MAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAIF,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAbrC,SAAS;+BACE,uBAAuB,EAAA,UAAA,EAGrB,IAAI,EACR,OAAA,EAAA;wBACN,gBAAgB;wBAChB,YAAY;wBACZ,0BAA0B;wBAC1B;qBACD,EACU,SAAA,EAAA,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAA2B,yBAAA,EAAC,CAAC,EAAA,QAAA,EAAA,ghLAAA,EAAA,MAAA,EAAA,CAAA,0SAAA,CAAA,EAAA;;0BAWtE;;0BAAY;kEAHV,EAAE,EAAA,CAAA;sBAAhB;gBAYO,QAAQ,EAAA,CAAA;sBAAjB;gBAwBY,MAAM,EAAA,CAAA;sBAAd;gBAWK,SAAS,EAAA,CAAA;sBAAjB;gBACQ,KAAK,EAAA,CAAA;sBAAb;gBACQ,UAAU,EAAA,CAAA;sBAAlB;gBACS,YAAY,EAAA,CAAA;sBAArB;;;;;"}
|
package/fesm2022/ngx-t-forms.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { L as DialogTemplateComponent, w as FORM_ACTIONS_TOKEN, x as FORM_CONFIG_TOKEN, z as FORM_INPUTS_TOKEN, y as FORM_SLIDES_TOKEN, G as FormBuilderComponent, c as FormTowerControllerService, Q as FormatDataPipe, E as FormsComponent, C as MSCOA_TREE_PROVIDER, B as MULTIPLE_FORM_INPUT_TOKEN, H as MscoaFormInputComponent, N as NGX_T_FORMS_CONFIG_TOKEN, n as NgxTFormsComponent, m as NgxTFormsService, Y as PropertyAccessError, O as SignatureInputElementComponent, T as TDynamicDataEditComponent, b as TDynamicDataViewComponent, K as TFormInputComponent, U as UTILS_OBJECT_TOKEN, I as UserFormStepperComponent, V as ValidationExpressioCreatorComponent, a as assignDeepPropertyToObject, a2 as createFileFromBase64, q as formGenerator, Z as getPipedValueFromDataType, a1 as getSampleValueForInput, r as getSectionElements, P as getSignatureImage, $ as getUrl, v as getValueFromValueAccessor, o as initFormConfigToV2, p as provideNgxTForms, R as returnDeepProperty, u as returnMappedPathValue, s as safeReturnDeepProperty, t as testAgainstItem, a0 as textIconsForUserHints, X as validateExpressionSyntax, W as validateObjectAgainstString } from './ngx-t-forms-ngx-t-forms-
|
|
1
|
+
export { L as DialogTemplateComponent, w as FORM_ACTIONS_TOKEN, x as FORM_CONFIG_TOKEN, z as FORM_INPUTS_TOKEN, y as FORM_SLIDES_TOKEN, G as FormBuilderComponent, c as FormTowerControllerService, Q as FormatDataPipe, E as FormsComponent, C as MSCOA_TREE_PROVIDER, B as MULTIPLE_FORM_INPUT_TOKEN, H as MscoaFormInputComponent, N as NGX_T_FORMS_CONFIG_TOKEN, n as NgxTFormsComponent, m as NgxTFormsService, Y as PropertyAccessError, O as SignatureInputElementComponent, T as TDynamicDataEditComponent, b as TDynamicDataViewComponent, K as TFormInputComponent, U as UTILS_OBJECT_TOKEN, I as UserFormStepperComponent, V as ValidationExpressioCreatorComponent, a as assignDeepPropertyToObject, a2 as createFileFromBase64, q as formGenerator, Z as getPipedValueFromDataType, a1 as getSampleValueForInput, r as getSectionElements, P as getSignatureImage, $ as getUrl, v as getValueFromValueAccessor, o as initFormConfigToV2, p as provideNgxTForms, R as returnDeepProperty, u as returnMappedPathValue, s as safeReturnDeepProperty, t as testAgainstItem, a0 as textIconsForUserHints, X as validateExpressionSyntax, W as validateObjectAgainstString } from './ngx-t-forms-ngx-t-forms-CD9InaXz.mjs';
|
|
2
2
|
//# sourceMappingURL=ngx-t-forms.mjs.map
|
|
@@ -52,7 +52,7 @@ export declare class FormSubmissionsConfigComponent {
|
|
|
52
52
|
elementConfigurationChanged(value: any, ele: ElementEditorInnerSectionElementInterface): void;
|
|
53
53
|
addNewSubmitApi(submision: string): void;
|
|
54
54
|
saveSubmitApi(): void;
|
|
55
|
-
removeSubmissionApi(api: APIDataFetchingConfigurationInterface): void;
|
|
55
|
+
removeSubmissionApi(api: APIDataFetchingConfigurationInterface, key: string): void;
|
|
56
56
|
cancelSubmitApi(): void;
|
|
57
57
|
matDialog: MatDialog;
|
|
58
58
|
close(): void;
|
|
@@ -11,6 +11,10 @@ export declare class FormsComponent implements OnInit, OnDestroy {
|
|
|
11
11
|
subscription$: Subscription;
|
|
12
12
|
selectFormsList$: Observable<LocalFormStateSelectorInterface[]>;
|
|
13
13
|
selectGroupedForms$: Observable<Record<string, any[]>>;
|
|
14
|
+
private searchQuerySubject;
|
|
15
|
+
searchQuery$: Observable<string>;
|
|
16
|
+
selectHasActiveSearch$: Observable<boolean>;
|
|
17
|
+
selectFilteredGroupedForms$: Observable<Record<string, any[]>>;
|
|
14
18
|
selectLoadingForms$: Observable<boolean>;
|
|
15
19
|
selectErrors$: Observable<any>;
|
|
16
20
|
selectFormListSection$: Observable<FormListSection>;
|
|
@@ -40,6 +44,9 @@ export declare class FormsComponent implements OnInit, OnDestroy {
|
|
|
40
44
|
setSection(value: FormListSection): void;
|
|
41
45
|
editForm(form: LocalFormStateSelectorInterface): void;
|
|
42
46
|
addNewForm(): void;
|
|
47
|
+
clearSearch(): void;
|
|
48
|
+
get searchQuery(): string;
|
|
49
|
+
set searchQuery(v: string);
|
|
43
50
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormsComponent, never>;
|
|
44
51
|
static ɵcmp: i0.ɵɵComponentDeclaration<FormsComponent, "app-forms", never, {}, {}, never, never, true, never>;
|
|
45
52
|
}
|
package/lib/components/t-dynamic-data-edit/elements/required-inputs/required-inputs.component.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export declare class RequiredInputsComponent implements MatFormFieldControl<Mini
|
|
|
47
47
|
save(): void;
|
|
48
48
|
inputIsDisabled(input: FormColumnInputs): boolean;
|
|
49
49
|
mapTo(input: FormColumnInputs): void;
|
|
50
|
+
isLinked(input: MinimumInputRequiredInterface): boolean;
|
|
50
51
|
inputMappedTo(formControlName: string): boolean;
|
|
51
52
|
getInputIllustration(input: FormColumnInputs): string;
|
|
52
53
|
get formInputsToMapTo(): MapToInputs[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-t-forms",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.26",
|
|
4
4
|
"description": "Angular forms module for creating dynamic forms through configuration. Supports form validation, custom controls, and complex form structures.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": {
|
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
import * as i2 from '@angular/common';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, ChangeDetectorRef, ViewChild, Component } from '@angular/core';
|
|
5
|
-
import { c as FormTowerControllerService, F as FormsStoreService, d as TourManagerService, e as getSubmissionStatusFn, M as MatModulesModule } from './ngx-t-forms-ngx-t-forms-A9_4GxP6.mjs';
|
|
6
|
-
import { take, filter, tap, map, Subject, timer, takeUntil } from 'rxjs';
|
|
7
|
-
import * as i1 from '@angular/forms';
|
|
8
|
-
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
9
|
-
import { validateFormColumnInputs } from 'ngx-t-forms-types';
|
|
10
|
-
import * as i8$1 from 'ngx-ui-tour-md-menu';
|
|
11
|
-
import { TourMatMenuModule } from 'ngx-ui-tour-md-menu';
|
|
12
|
-
import * as i2$1 from '@angular/cdk/drag-drop';
|
|
13
|
-
import * as i2$2 from '@angular/material/button';
|
|
14
|
-
import * as i3 from '@angular/material/card';
|
|
15
|
-
import * as i3$1 from '@angular/material/stepper';
|
|
16
|
-
import * as i2$3 from '@angular/material/icon';
|
|
17
|
-
import * as i2$4 from '@angular/material/menu';
|
|
18
|
-
import * as i3$2 from '@angular/material/progress-spinner';
|
|
19
|
-
import * as i8 from '@angular/material/tooltip';
|
|
20
|
-
import * as i3$3 from '@angular/material/input';
|
|
21
|
-
import * as i10 from '@angular/material/toolbar';
|
|
22
|
-
|
|
23
|
-
;
|
|
24
|
-
class FormSectionStepperComponent extends FormTowerControllerService {
|
|
25
|
-
constructor() {
|
|
26
|
-
super(...arguments);
|
|
27
|
-
this.store = inject(FormsStoreService);
|
|
28
|
-
this.loadingForm$ = this.store.selectors.selectLoadingForm$;
|
|
29
|
-
this.selectInputInEditId$ = this.store.selectors.selectInputInEditId$;
|
|
30
|
-
this.isEditable = true;
|
|
31
|
-
this.dragging = false;
|
|
32
|
-
this.drop = (event) => this.store.actionsFormBuilder.handleSectionDragDrop(event);
|
|
33
|
-
this.dropItems = (event, sectionId) => this.store.actionsFormBuilder.handleInputDragDrop(event, sectionId);
|
|
34
|
-
this.formDeleteSection = (sectionId) => this.store.actionsFormBuilder.formDeleteSection(sectionId);
|
|
35
|
-
this.formDeleteSectionInputs = (sectionId) => this.store.actionsFormBuilder.formDeleteSectionInputs(sectionId);
|
|
36
|
-
this.addMultipleFormInput = (sectionId, multipleInputId) => this.store.actionsFormBuilder.addMultipleFormInput(sectionId, multipleInputId);
|
|
37
|
-
this.moveInputToSection = (inputId, targetSectionId) => this.store.actionsFormBuilder.moveInputToSection(inputId, targetSectionId);
|
|
38
|
-
this.reorderMultipleInputItems = (event, multipleInputId) => this.store.actionsFormBuilder.reorderMultipleInputItems(event, multipleInputId);
|
|
39
|
-
this.cloneCopyFormInput = (inputId) => this.store.actionsFormBuilder.cloneCopyFormInput(inputId);
|
|
40
|
-
this.multipleInputToggleLabel = (item) => this.store.actionsFormBuilder.multipleInputToggleLabel(item);
|
|
41
|
-
this.editInput = (item) => this.store.actionsFormBuilder.editInput(item);
|
|
42
|
-
this.addMultipleInputValueCalculationFunction = (item, multipleInputId) => this.store.actionsFormBuilder.addMultipleInputValueCalculationFunction(item, multipleInputId);
|
|
43
|
-
this.setActiveSection = ($event) => this.setMatActiveStepper($event.selectedIndex);
|
|
44
|
-
this.addInputToScoaSelection = (sectionId, scoaInputId) => this.store.actionsFormBuilder.addInputToScoaSelection(sectionId, scoaInputId);
|
|
45
|
-
this.addNewInput = (sectionId) => this.store.actionsFormBuilder.saveInput(sectionId);
|
|
46
|
-
this.addSection = () => this.store.actionsFormBuilder.handleAddSection();
|
|
47
|
-
this.setMatActiveStepper = (index) => setTimeout(() => {
|
|
48
|
-
if (this.stepper === undefined)
|
|
49
|
-
return;
|
|
50
|
-
this.stepper.selectedIndex = index;
|
|
51
|
-
}, 0);
|
|
52
|
-
this.mouseOverSection = null;
|
|
53
|
-
this.handleInput = (event, sectionId) => {
|
|
54
|
-
// Cast the event target to HTMLInputElement to access the value property
|
|
55
|
-
console.error('handleInput', event, sectionId);
|
|
56
|
-
const inputValue = event.target.value;
|
|
57
|
-
// Pass the input value to the store action
|
|
58
|
-
this.store.actionsFormBuilder?.stepTitleChangeStep(sectionId, inputValue);
|
|
59
|
-
event.stopPropagation();
|
|
60
|
-
event.preventDefault();
|
|
61
|
-
};
|
|
62
|
-
this.overId = null;
|
|
63
|
-
this.countdownSeconds = {};
|
|
64
|
-
this.inputWillBeRemovedIn = (id) => this.countdownSeconds[id]?.count;
|
|
65
|
-
this.getPlaceHolerForSection = (sectionId) => this.store.sectionPlaceholder[sectionId];
|
|
66
|
-
this.formDeleteInput = (item) => this.store.actionsFormBuilder.formDeleteInput(item);
|
|
67
|
-
this.openSectionReports = {};
|
|
68
|
-
this.toggleSectionReports = (sectionId) => this.openSectionReports[sectionId] = !this.openSectionReports[sectionId];
|
|
69
|
-
this.ref = inject(ChangeDetectorRef);
|
|
70
|
-
this.tourManagerService = inject(TourManagerService);
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Handles the key down event and opens the application log if the key combination is pressed.
|
|
74
|
-
* @param event The keyboard event object.
|
|
75
|
-
*/
|
|
76
|
-
onKeyDown(event) {
|
|
77
|
-
if (event.ctrlKey && event.key === 'z') {
|
|
78
|
-
// Handle the key press combination here
|
|
79
|
-
this.revertBackHistory();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
ngOnInit() {
|
|
83
|
-
this.store.registerFormChangeFn(this.initialize);
|
|
84
|
-
this.store.selectors.selectFormInEdit$.pipe(take(1), filter(form => form !== null && form !== undefined), tap(form => this.initialize(form.form))).subscribe();
|
|
85
|
-
}
|
|
86
|
-
get formBuilderFunctions() {
|
|
87
|
-
return {
|
|
88
|
-
getLatestAccountTree: () => this.NGX_T_FORMS_CONFIG.formBuilder.getScoaTree(),
|
|
89
|
-
getSCOAAccount: (SCOAAccount) => this.NGX_T_FORMS_CONFIG.formBuilder.getSCOAAccount(SCOAAccount),
|
|
90
|
-
multipleInputToggleForm: this.toggleMultipleInput.bind(this),
|
|
91
|
-
multipleInputSaveForm: this.saveMultipleInputForm.bind(this),
|
|
92
|
-
editInput: this.editInput.bind(this),
|
|
93
|
-
deleteInput: this.formDeleteInput.bind(this),
|
|
94
|
-
addFunction: this.addMultipleInputValueCalculationFunction.bind(this),
|
|
95
|
-
reorderItems: this.reorderMultipleInputItems.bind(this),
|
|
96
|
-
multipleInputToggleLabel: this.multipleInputToggleLabel.bind(this),
|
|
97
|
-
multipleInputEditRow: this.multipleInputEditRow.bind(this),
|
|
98
|
-
multipleInputDuplicateRow: this.multipleInputDuplicateRow.bind(this),
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
getPreviousStepLabel() {
|
|
102
|
-
if (this.stepper === undefined)
|
|
103
|
-
return '';
|
|
104
|
-
const currentIndex = this.stepper?.selectedIndex;
|
|
105
|
-
if (currentIndex > 0) {
|
|
106
|
-
return this.selectFormSteps()?.[currentIndex - 1]?.label;
|
|
107
|
-
}
|
|
108
|
-
return '';
|
|
109
|
-
}
|
|
110
|
-
getNextStepLabel() {
|
|
111
|
-
if (this.stepper === undefined)
|
|
112
|
-
return '';
|
|
113
|
-
const currentIndex = this.stepper?.selectedIndex;
|
|
114
|
-
const steps = this.selectFormSteps();
|
|
115
|
-
if (!steps)
|
|
116
|
-
return '';
|
|
117
|
-
if (currentIndex < steps.length - 1) {
|
|
118
|
-
return steps[currentIndex + 1]?.label;
|
|
119
|
-
}
|
|
120
|
-
return '';
|
|
121
|
-
}
|
|
122
|
-
getStepState(step, index) {
|
|
123
|
-
const activeStep = this.stepper?.selectedIndex === index;
|
|
124
|
-
if (activeStep)
|
|
125
|
-
return 'edit';
|
|
126
|
-
if (step.sectionForm?.touched && !step.sectionForm?.valid)
|
|
127
|
-
return 'error'; // Show error state for invalid touched forms
|
|
128
|
-
if (step.sectionForm?.valid)
|
|
129
|
-
return 'done'; // Show done state for valid forms
|
|
130
|
-
return 'number';
|
|
131
|
-
}
|
|
132
|
-
get getSubmissionStatus$() {
|
|
133
|
-
const progress = this.formProgress() || 0;
|
|
134
|
-
const steps = this.selectFormSteps();
|
|
135
|
-
return this.loadingForm$.pipe(map(loading => getSubmissionStatusFn(this.stepper, this.mainForm, progress, steps, loading)));
|
|
136
|
-
}
|
|
137
|
-
get selectFormStepsComputed() {
|
|
138
|
-
const steps = this.selectFormSteps().map((step) => ({
|
|
139
|
-
...step,
|
|
140
|
-
columns: step.columns.map((col) => {
|
|
141
|
-
return ({
|
|
142
|
-
...col,
|
|
143
|
-
inputConfigErrors: validateFormColumnInputs(col)
|
|
144
|
-
});
|
|
145
|
-
})
|
|
146
|
-
}));
|
|
147
|
-
return steps;
|
|
148
|
-
}
|
|
149
|
-
stopDeletion(id) {
|
|
150
|
-
if (this.countdownSeconds[id]) {
|
|
151
|
-
this.countdownSeconds[id]?.stop$.next();
|
|
152
|
-
delete this.countdownSeconds[id];
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
removeInput(item) {
|
|
156
|
-
if (this.countdownSeconds[item.id]) {
|
|
157
|
-
this.stopDeletion(item.id);
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
this.countdownSeconds[item.id] = {
|
|
161
|
-
count: 5,
|
|
162
|
-
stop$: new Subject(),
|
|
163
|
-
deleteInputs: false
|
|
164
|
-
};
|
|
165
|
-
const countdown$ = timer(0, 1000).pipe(tap((secondsElapsed) => {
|
|
166
|
-
const data = this.countdownSeconds[item.id];
|
|
167
|
-
if (!data) {
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
const remainingTime = 5 - secondsElapsed;
|
|
171
|
-
if (remainingTime <= 0) {
|
|
172
|
-
this.formDeleteInput(item);
|
|
173
|
-
this.stopDeletion(item.id);
|
|
174
|
-
// Stop and remove timer
|
|
175
|
-
// Actual deletion logic here, e.g., remove the element by id
|
|
176
|
-
// document.getElementById(id)?.remove();
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
data.count = remainingTime;
|
|
180
|
-
}
|
|
181
|
-
}), takeUntil(this.countdownSeconds[item.id]?.stop$));
|
|
182
|
-
countdown$?.subscribe({
|
|
183
|
-
complete: () => {
|
|
184
|
-
console.log('Deletion stopped or completed');
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
deleteSection(sectionId, deleteInputs = false) {
|
|
189
|
-
if (!sectionId) {
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
if (this.countdownSeconds[sectionId]) {
|
|
193
|
-
this.stopDeletion(sectionId);
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
this.countdownSeconds[sectionId] = {
|
|
197
|
-
count: 5,
|
|
198
|
-
stop$: new Subject(),
|
|
199
|
-
deleteInputs: deleteInputs
|
|
200
|
-
};
|
|
201
|
-
const countdown$ = timer(0, 1000).pipe(tap((secondsElapsed) => {
|
|
202
|
-
const data = this.countdownSeconds[sectionId];
|
|
203
|
-
if (!data) {
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
const remainingTime = 5 - secondsElapsed;
|
|
207
|
-
if (remainingTime <= 0) {
|
|
208
|
-
if (data.deleteInputs) {
|
|
209
|
-
this.formDeleteSectionInputs(sectionId);
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
this.formDeleteSection(sectionId);
|
|
213
|
-
}
|
|
214
|
-
this.stopDeletion(sectionId);
|
|
215
|
-
// Stop and remove timer
|
|
216
|
-
// Actual deletion logic here, e.g., remove the element by id
|
|
217
|
-
// document.getElementById(id)?.remove();
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
data.count = remainingTime;
|
|
221
|
-
}
|
|
222
|
-
}), takeUntil(this.countdownSeconds[sectionId]?.stop$));
|
|
223
|
-
countdown$?.subscribe({
|
|
224
|
-
complete: () => {
|
|
225
|
-
console.log('Deletion stopped or completed');
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
refresh() {
|
|
230
|
-
// trigger angular a change detection cycle manually
|
|
231
|
-
this.ref.markForCheck();
|
|
232
|
-
this.ref.detectChanges();
|
|
233
|
-
}
|
|
234
|
-
sectionIncludesDefault(columns) {
|
|
235
|
-
return columns.some((col) => col.systemDefault);
|
|
236
|
-
}
|
|
237
|
-
startTour(sectionId) {
|
|
238
|
-
const tourOptions = this.selectAllFormTours().filter((step) => step.sectionId === sectionId);
|
|
239
|
-
this.tourManagerService.startTourByOption(tourOptions);
|
|
240
|
-
}
|
|
241
|
-
onSpaceKey(event, sectionId) {
|
|
242
|
-
const inputValue = event.target.value;
|
|
243
|
-
this.store.actionsFormBuilder?.stepTitleChangeStep(sectionId, inputValue + ' ');
|
|
244
|
-
event.stopPropagation();
|
|
245
|
-
event.preventDefault();
|
|
246
|
-
}
|
|
247
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FormSectionStepperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
248
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: FormSectionStepperComponent, isStandalone: true, selector: "app-form-section-stepper", viewQueries: [{ propertyName: "stepper", first: true, predicate: ["stepper"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<mat-card class=\"mainCard\" appearance=\"raised\">\r\n\r\n @if (loadingForm$|async) {\r\n <div class=\"loading-container\">\r\n <mat-spinner diameter=\"48\" aria-label=\"Loading form\" />\r\n </div>\r\n }\r\n <mat-stepper [style.display]=\"(loadingForm$|async)?'none':'block'\" #stepper class=\"form-stepper\"\r\n orientation=\"vertical\" [linear]=\"!isEditable\" aria-label=\"Form sections stepper\" [animationDuration]=\"'300'\"\r\n cdkDropList #formSections=\"cdkDropList\" [cdkDropListData]=\"selectFormStepsComputed\"\r\n (cdkDropListDropped)=\"drop($event)\" (selectionChange)=\"handleStepChange($event)\">\r\n\r\n @for (step of selectFormStepsComputed; track step.sectionId) {\r\n @if(step.sectionForm || getPlaceHolerForSection(step.sectionId)){\r\n <mat-step [stepControl]=\"step.sectionForm || getPlaceHolerForSection(step.sectionId) \"\r\n [completed]=\"step.sectionIsSeen && !step.sectionIsInvalid\" [editable]=\"isEditable\"\r\n [errorMessage]=\"step.sectionFormErrorMessage||''\" [state]=\"getStepState(step,$index)\"\r\n [hasError]=\"!step.sectionForm?.valid && !!step.sectionForm?.touched\">\r\n <ng-template matStepLabel>\r\n <div cdkDrag class=\"step-label-container \" [attr.aria-label]=\"'Section ' + step.label\">\r\n <span class=\"step-label-text\">\r\n\r\n <input (input)=\"handleInput($event,step.sectionId)\" class=\"section-title-input\" matInput\r\n (keydown.space)=\"onSpaceKey($event,step.sectionId)\" placeholder=\"Enter section title\"\r\n [value]=\"step.label \">\r\n </span>\r\n @if (step.sectionIsSeen) {\r\n <mat-icon [class.error]=\"step.sectionIsInvalid\"\r\n [attr.aria-label]=\"step.sectionIsInvalid ? 'Section has errors' : 'Section completed'\">\r\n {{step.sectionIsSeen}}\r\n </mat-icon>\r\n }\r\n <span class=\"tour-trigger \" *ngIf=\"(step)?.activeSectionHasTour&&!!step.isActive \">\r\n <button tourAnchor=\"Form-Tour-trigger\" (click)=\"startTour(step.sectionId)\" matTooltip=\"Start section tour\"\r\n mat-flat-button>\r\n <mat-icon>tour</mat-icon>\r\n </button>\r\n </span>\r\n <span class=\"spacer\"></span>\r\n\r\n @if(!!inputWillBeRemovedIn(step.sectionId) ){\r\n <button (mouseover)=\"overId = step.sectionId\" (mouseout)=\"overId = null\"\r\n (click)=\"deleteSection(step.sectionId)\" color=\"warn\" mat-stroked-button>\r\n <div style=\"display: flex; align-items: center;gap:4px;padding:8px;\">\r\n <mat-progress-spinner style=\"margin-right: 5px;\" color=\"primary\" class=\"cancelProgress\"\r\n [value]=\"((inputWillBeRemovedIn(step.sectionId)||0)/5)*100\">\r\n </mat-progress-spinner>\r\n {{overId === step.sectionId ? 'Click to cancel':'Deleting in'}}\r\n {{inputWillBeRemovedIn(step.sectionId)}}\r\n </div>\r\n </button>\r\n }\r\n \r\n <button (click)=\"$event.stopPropagation();\"\r\n [matMenuTriggerData]=\"{sectionId:step.sectionId,columns: step.columns}\" [matMenuTriggerFor]=\"sectionMenu\"\r\n color=\"primary\" mat-icon-button>\r\n <mat-icon>\r\n <!-- {{section.sectionId === ( activeSectionId())? 'expand_circle_down':'more_horiz'}} -->\r\n more_horiz\r\n </mat-icon>\r\n </button>\r\n </div>\r\n </ng-template>\r\n\r\n @defer (on viewport; prefetch on idle) {\r\n <div class=\"step-content\">\r\n @if(!openSectionReports[step.sectionId]){\r\n <div (cdkDropListDropped)=\"dropItems($event,step.sectionId)\" [cdkDropListData]=\"step.columns\" cdkDropList\r\n #InputList=\"cdkDropList\" class=\"row form-section\">\r\n @for (col of step.columns; track col.id) {\r\n <mat-card cdkDrag (cdkDragStarted)=\"dragging =true\" (cdkDragReleased)=\"dragging =false\"\r\n [class.inEditCol]=\"(selectInputInEditId$|async) === col.id\"\r\n [class]=\"'box inputCard col-md-'+(dragging?'12':col.colSize)\" (mouseover)=\"activeInput =col.id\">\r\n <div class=\"custom-placeholder\" *cdkDragPlaceholder></div>\r\n @if(step.sectionForm){\r\n <lib-t-form-input [editorMode]=\"true\" [tourAnchor]=\"col.id\" (valueChange)=\"updateValue(col.id,$event)\"\r\n [formBuilderFunctions]=\"formBuilderFunctions\" [inputConfig]=\"col\" [formGroup]=\"step.sectionForm\"\r\n [attr.aria-label]=\"col?.label || ''\">\r\n </lib-t-form-input>\r\n }\r\n\r\n\r\n\r\n @if (col.inputConfigErrors.length > 0) {\r\n <div class=\"error\">\r\n\r\n <ul style=\"\r\n padding-left: 28px;\">\r\n @for(error of col.inputConfigErrors;track error.key+error.message){\r\n <li style=\"color:var(--mat-sys-error)\">{{error.message}}</li>\r\n }\r\n </ul>\r\n\r\n </div>\r\n }\r\n <mat-card-actions *ngIf=\"activeInput === col.id\">\r\n\r\n <button color=\"primary\" [matTooltip]=\"'Edit ' + col.label +' input'\" (click)=\"editInput(col)\"\r\n mat-icon-button>\r\n <mat-icon>\r\n edit\r\n </mat-icon>\r\n\r\n </button>\r\n\r\n <button [matTooltip]=\"'Move this input to another section'\" moveInput [matMenuTriggerFor]=\"moveInput\"\r\n [matMenuTriggerData]=\"col\" mat-icon-button>\r\n\r\n <mat-icon>\r\n drive_file_move\r\n </mat-icon>\r\n </button>\r\n\r\n <button [matTooltip]=\"'Clone/ copy form input'\" (click)=\"cloneCopyFormInput(col.id)\" moveInput\r\n mat-icon-button>\r\n\r\n <mat-icon>\r\n file_copy\r\n </mat-icon>\r\n </button>\r\n\r\n <span class=\"spacer\"></span>\r\n\r\n\r\n\r\n @if(!!inputWillBeRemovedIn(col.id) ){\r\n <button (mouseover)=\"overId = col.id\" (mouseout)=\"overId = null\" (click)=\"removeInput(col)\" color=\"warn\"\r\n mat-stroked-button>\r\n <div style=\"display: flex; align-items: center;\">\r\n <mat-progress-spinner style=\"margin-right: 5px;\" color=\"primary\" class=\"cancelProgress\"\r\n [value]=\"((inputWillBeRemovedIn(col.id)||0)/5)*100\">\r\n </mat-progress-spinner>\r\n\r\n {{overId === col.id ? 'Click to cancel':'Deleting in'}} {{inputWillBeRemovedIn(col.id)}}\r\n </div>\r\n\r\n </button>\r\n\r\n }@else if (col.systemDefault !==true) { <button color=\"warn\"\r\n [matTooltip]=\"'Delete '+ col.label + ' input'\" (click)=\"removeInput(col)\" mat-icon-button>\r\n\r\n <mat-icon>\r\n delete\r\n </mat-icon>\r\n </button>}\r\n\r\n\r\n @if (activeInput === col.id && col.element ==='multipleInput') {\r\n\r\n <button matTooltip=\"Add input to list control form\" (click)=\"addMultipleFormInput(col.sectionId,col.id)\"\r\n color=\"accent\" mat-flat-button>\r\n <mat-icon>add</mat-icon>\r\n Add Form Input\r\n </button>\r\n }\r\n @if (activeInput === col.id && col.element ==='mscoaSelection') {\r\n\r\n <button matTooltip=\"Extend SCOA Segments with additional inputs\"\r\n (click)=\"addInputToScoaSelection(col.sectionId,col.id)\" color=\"accent\" mat-flat-button>\r\n <mat-icon>add</mat-icon>\r\n Add Form Input\r\n </button>\r\n }\r\n\r\n </mat-card-actions>\r\n </mat-card>\r\n }\r\n </div>\r\n <section style=\"text-align: center;\">\r\n <br>\r\n Add form fields to this section to collect information.\r\n <br>\r\n Click the <strong>\"Add Input\"</strong> button below to create a new form field.\r\n <div>\r\n <button matTooltip=\"Add an input to this section\" (click)=\"addNewInput(step.sectionId)\" color=\"accent\"\r\n mat-flat-button>\r\n <mat-icon>add</mat-icon>\r\n Add Input\r\n </button>\r\n </div>\r\n </section>\r\n\r\n\r\n }@else {\r\n <app-section-report [sectionId]=\"step.sectionId \"></app-section-report>\r\n }\r\n <div class=\"step-actions\">\r\n @if(!$first) {\r\n <button mat-button matStepperPrevious type=\"button\" class=\"navigation-button\"\r\n [attr.aria-label]=\"'Go back to ' + getPreviousStepLabel()\">\r\n\r\n Back\r\n </button>\r\n }\r\n @if (!$last) {\r\n <button mat-flat-button matStepperNext color=\"primary\" type=\"button\" class=\"navigation-button\"\r\n matTooltip=\"Continue to next section\" [attr.aria-label]=\"'Continue to ' + getNextStepLabel()\">\r\n Next\r\n </button>\r\n }\r\n @if (!!$last) {\r\n <button mat-button (click)=\"stepper.reset()\">Reset</button>\r\n }\r\n\r\n </div>\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=\"24\" />\r\n </div>\r\n }\r\n\r\n </mat-step>\r\n }\r\n }\r\n </mat-stepper>\r\n <section style=\"text-align: center;\">\r\n <br>\r\n A form section helps organize related input fields together.\r\n <br>\r\n Click the <strong>\"Add Section\"</strong> button below to create a new section.\r\n </section>\r\n <mat-card-actions style=\"position: sticky;bottom: 0;\">\r\n <span class=\"spacer\"></span>\r\n <button (click)=\"addSection()\" color=\"accent\" mat-flat-button>\r\n <mat-icon>add</mat-icon>\r\n Add Section\r\n </button>\r\n <span class=\"spacer\"></span>\r\n </mat-card-actions>\r\n <!-- Defer the footer toolbar until after the main form is loaded -->\r\n @defer (on idle; prefetch on viewport) {\r\n <footer><mat-toolbar class=\"submission-toolbar\" role=\"toolbar\" aria-label=\"Form submission actions\">\r\n <span class=\"submission-status\" role=\"status\">\r\n {{getSubmissionStatus$|async}}\r\n </span>\r\n <button mat-raised-button color=\"primary\" [disabled]=\"true\" aria-label=\"Submit form\">\r\n <span>\r\n {{ formSubmissionMessage()}}\r\n </span>\r\n @if(submittingForm){\r\n <mat-spinner diameter=\"10\"></mat-spinner>\r\n }\r\n\r\n </button>\r\n </mat-toolbar>\r\n </footer>\r\n } @placeholder {\r\n <!-- Simple placeholder for the footer that maintains layout -->\r\n <footer>\r\n <div class=\"submission-toolbar-placeholder\"></div>\r\n </footer>\r\n }\r\n\r\n</mat-card>\r\n<mat-menu #sectionMenu=\"matMenu\">\r\n <ng-template matMenuContent let-sectionId=\"sectionId\" let-columns=\"columns\">\r\n <!-- <button mat-menu-item [matMenuTriggerFor]=\"sectionType\">\r\n <mat-icon> disabled_visible</mat-icon>\r\n Set visibility type</button> -->\r\n @if (sectionIncludesDefault(columns) === false) {\r\n <button (click)=\"deleteSection(sectionId,false)\" matTooltip=\"Deletes this section and all its inputs\"\r\n matTooltipPosition=\"right\" mat-menu-item>\r\n <mat-icon style=\"color: var(--mat-sys-error);\">delete</mat-icon>\r\n <span style=\"color: var(--mat-sys-error);\"> Delete section</span>\r\n\r\n </button>\r\n <button (click)=\"deleteSection(sectionId,true)\" matTooltip=\"Deletes all inputs in this section\"\r\n matTooltipPosition=\"right\" mat-menu-item>\r\n <mat-icon style=\"color: var(--mat-sys-error);\">delete_sweep</mat-icon>\r\n <span style=\"color: var(--mat-sys-error);\">\r\n Delete section inputs\r\n </span>\r\n\r\n </button>\r\n }\r\n\r\n <button (click)=\"toggleSectionReports(sectionId)\" mat-menu-item>\r\n <mat-icon>leaderboard</mat-icon>\r\n {{openSectionReports[sectionId]?'Close report': 'Section report'}}</button>\r\n </ng-template>\r\n</mat-menu>\r\n<mat-menu #sectionType=\"matMenu\">\r\n <button mat-menu-item>\r\n <mat-icon>visibility</mat-icon>\r\n view only</button>\r\n <button mat-menu-item>\r\n <mat-icon>visibility_off</mat-icon>\r\n system</button>\r\n <button mat-menu-item>\r\n <mat-icon>edit</mat-icon>\r\n user edit</button>\r\n</mat-menu>\r\n<mat-menu #moveInput=\"matMenu\">\r\n <ng-template matMenuContent let-id=\"id\" let-sectionId=\"sectionId\">\r\n @for (section of ( selectFormStepsComputed); track section.sectionId) {\r\n <button [disabled]=\"section.sectionId === sectionId\" (click)=\"moveInputToSection(id,section.sectionId)\"\r\n mat-menu-item>\r\n <mat-icon>folder</mat-icon>\r\n {{section.label || 'Untitled section'}}\r\n </button>\r\n }\r\n\r\n </ng-template>\r\n</mat-menu>\r\n\r\n\r\n<pre>\r\n <sub>\r\n {{ this.mainForm?.value | json}}\r\n </sub>\r\n \r\n</pre>", styles: [".mainCard{margin-top:0;min-height:45vh;box-shadow:none;max-width:768px;margin-left:auto;padding:8px;left:0;margin-right:auto;border-radius:12px}.inEditCol{box-shadow:var(--mdc-elevated-card-container-elevation);border:solid 1px #243D91!important}.inputCard{box-shadow:none}.cancelProgress{height:24px!important;width:24px!important}.numbers{position:absolute!important;right:0}mat-vertical-stepper{margin:5px}.list{min-height:60px;display:block}.box{padding:5px;cursor:move}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.box:last-child{border:none}.list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.custom-placeholder{background:#ccc;border:dotted 3px #999;min-width:100%;min-height:60px;transition:transform .25s cubic-bezier(0,0,.2,1)}.section-title-input{border:none;background-color:transparent;font-size:.875em;font-weight:600;color:#333;padding-top:12px;padding-bottom:12px;outline:none;width:calc(100% - 54px);transition:border-bottom-color .3s ease-in-out}.section-title-input:focus{border-bottom:1px solid #007bff}.inputElement:focus{box-shadow:0 0 0 .2rem #007bff40}.headerToolbar{position:sticky;top:0;min-width:100%;background:var(--mdc-elevated-card-container-color)}::ng-deep mat-step-header .mat-step-label{width:100%}.error{color:var(--mat--sys-error);display:flex;align-items:center}.submission-toolbar{z-index:1000;background:#ffffff0d;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-top:var(--mat-divider-width) solid var(--mat-divider-color);padding:8px 16px;display:flex;justify-content:flex-end;gap:16px}.submission-status{font-size:.75em;opacity:.87;display:flex;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.JsonPipe, name: "json" }, { kind: "ngmodule", type: MatModulesModule }, { kind: "directive", type: i2$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: i2$2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i2$2.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: "component", type: i3$1.MatStep, selector: "mat-step", inputs: ["color"], exportAs: ["matStep"] }, { kind: "directive", type: i3$1.MatStepLabel, selector: "[matStepLabel]" }, { kind: "component", type: i3$1.MatStepper, selector: "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", inputs: ["disableRipple", "color", "labelPosition", "headerPosition", "animationDuration"], outputs: ["animationDone"], exportAs: ["matStepper", "matVerticalStepper", "matHorizontalStepper"] }, { kind: "component", type: i2$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i2$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i2$4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i2$4.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "directive", type: i2$4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i3$2.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: i3$3.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: TourMatMenuModule }, { kind: "directive", type: i8$1.TourAnchorMatMenuDirective, selector: "[tourAnchor]", inputs: ["tourAnchor"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormsModule }], deferBlockDependencies: [() => [i2.NgIf, i2.AsyncPipe, i2$1.CdkDropList, i2$1.CdkDrag, i2$1.CdkDragPlaceholder, i2$2.MatButton, i2$2.MatIconButton, i3.MatCard, i3.MatCardActions, i3$1.MatStepperNext, i3$1.MatStepperPrevious, i2$3.MatIcon, i2$4.MatMenuTrigger, i3$2.MatProgressSpinner, i8.MatTooltip, import('./ngx-t-forms-ngx-t-forms-A9_4GxP6.mjs').then(function (n) { return n.a3; }).then(m => m.TFormInputComponent), i8$1.TourAnchorMatMenuDirective, i1.NgControlStatusGroup, i1.FormGroupDirective, import('./ngx-t-forms-section-report.component-DGwgq4QR.mjs').then(m => m.SectionReportComponent)], () => [i2.AsyncPipe, i2$2.MatButton, i3$2.MatProgressSpinner, i10.MatToolbar]] }); }
|
|
249
|
-
}
|
|
250
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "19.2.17", ngImport: i0, type: FormSectionStepperComponent, resolveDeferredDeps: () => [import('./ngx-t-forms-ngx-t-forms-A9_4GxP6.mjs').then(function (n) { return n.a3; }).then(m => m.TFormInputComponent), import('./ngx-t-forms-section-report.component-DGwgq4QR.mjs').then(m => m.SectionReportComponent)], resolveMetadata: (TFormInputComponent, SectionReportComponent) => ({ decorators: [{
|
|
251
|
-
type: Component,
|
|
252
|
-
args: [{ selector: 'app-form-section-stepper', standalone: true, imports: [
|
|
253
|
-
CommonModule,
|
|
254
|
-
MatModulesModule,
|
|
255
|
-
TFormInputComponent,
|
|
256
|
-
TourMatMenuModule,
|
|
257
|
-
ReactiveFormsModule,
|
|
258
|
-
FormsModule,
|
|
259
|
-
SectionReportComponent
|
|
260
|
-
], template: "<mat-card class=\"mainCard\" appearance=\"raised\">\r\n\r\n @if (loadingForm$|async) {\r\n <div class=\"loading-container\">\r\n <mat-spinner diameter=\"48\" aria-label=\"Loading form\" />\r\n </div>\r\n }\r\n <mat-stepper [style.display]=\"(loadingForm$|async)?'none':'block'\" #stepper class=\"form-stepper\"\r\n orientation=\"vertical\" [linear]=\"!isEditable\" aria-label=\"Form sections stepper\" [animationDuration]=\"'300'\"\r\n cdkDropList #formSections=\"cdkDropList\" [cdkDropListData]=\"selectFormStepsComputed\"\r\n (cdkDropListDropped)=\"drop($event)\" (selectionChange)=\"handleStepChange($event)\">\r\n\r\n @for (step of selectFormStepsComputed; track step.sectionId) {\r\n @if(step.sectionForm || getPlaceHolerForSection(step.sectionId)){\r\n <mat-step [stepControl]=\"step.sectionForm || getPlaceHolerForSection(step.sectionId) \"\r\n [completed]=\"step.sectionIsSeen && !step.sectionIsInvalid\" [editable]=\"isEditable\"\r\n [errorMessage]=\"step.sectionFormErrorMessage||''\" [state]=\"getStepState(step,$index)\"\r\n [hasError]=\"!step.sectionForm?.valid && !!step.sectionForm?.touched\">\r\n <ng-template matStepLabel>\r\n <div cdkDrag class=\"step-label-container \" [attr.aria-label]=\"'Section ' + step.label\">\r\n <span class=\"step-label-text\">\r\n\r\n <input (input)=\"handleInput($event,step.sectionId)\" class=\"section-title-input\" matInput\r\n (keydown.space)=\"onSpaceKey($event,step.sectionId)\" placeholder=\"Enter section title\"\r\n [value]=\"step.label \">\r\n </span>\r\n @if (step.sectionIsSeen) {\r\n <mat-icon [class.error]=\"step.sectionIsInvalid\"\r\n [attr.aria-label]=\"step.sectionIsInvalid ? 'Section has errors' : 'Section completed'\">\r\n {{step.sectionIsSeen}}\r\n </mat-icon>\r\n }\r\n <span class=\"tour-trigger \" *ngIf=\"(step)?.activeSectionHasTour&&!!step.isActive \">\r\n <button tourAnchor=\"Form-Tour-trigger\" (click)=\"startTour(step.sectionId)\" matTooltip=\"Start section tour\"\r\n mat-flat-button>\r\n <mat-icon>tour</mat-icon>\r\n </button>\r\n </span>\r\n <span class=\"spacer\"></span>\r\n\r\n @if(!!inputWillBeRemovedIn(step.sectionId) ){\r\n <button (mouseover)=\"overId = step.sectionId\" (mouseout)=\"overId = null\"\r\n (click)=\"deleteSection(step.sectionId)\" color=\"warn\" mat-stroked-button>\r\n <div style=\"display: flex; align-items: center;gap:4px;padding:8px;\">\r\n <mat-progress-spinner style=\"margin-right: 5px;\" color=\"primary\" class=\"cancelProgress\"\r\n [value]=\"((inputWillBeRemovedIn(step.sectionId)||0)/5)*100\">\r\n </mat-progress-spinner>\r\n {{overId === step.sectionId ? 'Click to cancel':'Deleting in'}}\r\n {{inputWillBeRemovedIn(step.sectionId)}}\r\n </div>\r\n </button>\r\n }\r\n \r\n <button (click)=\"$event.stopPropagation();\"\r\n [matMenuTriggerData]=\"{sectionId:step.sectionId,columns: step.columns}\" [matMenuTriggerFor]=\"sectionMenu\"\r\n color=\"primary\" mat-icon-button>\r\n <mat-icon>\r\n <!-- {{section.sectionId === ( activeSectionId())? 'expand_circle_down':'more_horiz'}} -->\r\n more_horiz\r\n </mat-icon>\r\n </button>\r\n </div>\r\n </ng-template>\r\n\r\n @defer (on viewport; prefetch on idle) {\r\n <div class=\"step-content\">\r\n @if(!openSectionReports[step.sectionId]){\r\n <div (cdkDropListDropped)=\"dropItems($event,step.sectionId)\" [cdkDropListData]=\"step.columns\" cdkDropList\r\n #InputList=\"cdkDropList\" class=\"row form-section\">\r\n @for (col of step.columns; track col.id) {\r\n <mat-card cdkDrag (cdkDragStarted)=\"dragging =true\" (cdkDragReleased)=\"dragging =false\"\r\n [class.inEditCol]=\"(selectInputInEditId$|async) === col.id\"\r\n [class]=\"'box inputCard col-md-'+(dragging?'12':col.colSize)\" (mouseover)=\"activeInput =col.id\">\r\n <div class=\"custom-placeholder\" *cdkDragPlaceholder></div>\r\n @if(step.sectionForm){\r\n <lib-t-form-input [editorMode]=\"true\" [tourAnchor]=\"col.id\" (valueChange)=\"updateValue(col.id,$event)\"\r\n [formBuilderFunctions]=\"formBuilderFunctions\" [inputConfig]=\"col\" [formGroup]=\"step.sectionForm\"\r\n [attr.aria-label]=\"col?.label || ''\">\r\n </lib-t-form-input>\r\n }\r\n\r\n\r\n\r\n @if (col.inputConfigErrors.length > 0) {\r\n <div class=\"error\">\r\n\r\n <ul style=\"\r\n padding-left: 28px;\">\r\n @for(error of col.inputConfigErrors;track error.key+error.message){\r\n <li style=\"color:var(--mat-sys-error)\">{{error.message}}</li>\r\n }\r\n </ul>\r\n\r\n </div>\r\n }\r\n <mat-card-actions *ngIf=\"activeInput === col.id\">\r\n\r\n <button color=\"primary\" [matTooltip]=\"'Edit ' + col.label +' input'\" (click)=\"editInput(col)\"\r\n mat-icon-button>\r\n <mat-icon>\r\n edit\r\n </mat-icon>\r\n\r\n </button>\r\n\r\n <button [matTooltip]=\"'Move this input to another section'\" moveInput [matMenuTriggerFor]=\"moveInput\"\r\n [matMenuTriggerData]=\"col\" mat-icon-button>\r\n\r\n <mat-icon>\r\n drive_file_move\r\n </mat-icon>\r\n </button>\r\n\r\n <button [matTooltip]=\"'Clone/ copy form input'\" (click)=\"cloneCopyFormInput(col.id)\" moveInput\r\n mat-icon-button>\r\n\r\n <mat-icon>\r\n file_copy\r\n </mat-icon>\r\n </button>\r\n\r\n <span class=\"spacer\"></span>\r\n\r\n\r\n\r\n @if(!!inputWillBeRemovedIn(col.id) ){\r\n <button (mouseover)=\"overId = col.id\" (mouseout)=\"overId = null\" (click)=\"removeInput(col)\" color=\"warn\"\r\n mat-stroked-button>\r\n <div style=\"display: flex; align-items: center;\">\r\n <mat-progress-spinner style=\"margin-right: 5px;\" color=\"primary\" class=\"cancelProgress\"\r\n [value]=\"((inputWillBeRemovedIn(col.id)||0)/5)*100\">\r\n </mat-progress-spinner>\r\n\r\n {{overId === col.id ? 'Click to cancel':'Deleting in'}} {{inputWillBeRemovedIn(col.id)}}\r\n </div>\r\n\r\n </button>\r\n\r\n }@else if (col.systemDefault !==true) { <button color=\"warn\"\r\n [matTooltip]=\"'Delete '+ col.label + ' input'\" (click)=\"removeInput(col)\" mat-icon-button>\r\n\r\n <mat-icon>\r\n delete\r\n </mat-icon>\r\n </button>}\r\n\r\n\r\n @if (activeInput === col.id && col.element ==='multipleInput') {\r\n\r\n <button matTooltip=\"Add input to list control form\" (click)=\"addMultipleFormInput(col.sectionId,col.id)\"\r\n color=\"accent\" mat-flat-button>\r\n <mat-icon>add</mat-icon>\r\n Add Form Input\r\n </button>\r\n }\r\n @if (activeInput === col.id && col.element ==='mscoaSelection') {\r\n\r\n <button matTooltip=\"Extend SCOA Segments with additional inputs\"\r\n (click)=\"addInputToScoaSelection(col.sectionId,col.id)\" color=\"accent\" mat-flat-button>\r\n <mat-icon>add</mat-icon>\r\n Add Form Input\r\n </button>\r\n }\r\n\r\n </mat-card-actions>\r\n </mat-card>\r\n }\r\n </div>\r\n <section style=\"text-align: center;\">\r\n <br>\r\n Add form fields to this section to collect information.\r\n <br>\r\n Click the <strong>\"Add Input\"</strong> button below to create a new form field.\r\n <div>\r\n <button matTooltip=\"Add an input to this section\" (click)=\"addNewInput(step.sectionId)\" color=\"accent\"\r\n mat-flat-button>\r\n <mat-icon>add</mat-icon>\r\n Add Input\r\n </button>\r\n </div>\r\n </section>\r\n\r\n\r\n }@else {\r\n <app-section-report [sectionId]=\"step.sectionId \"></app-section-report>\r\n }\r\n <div class=\"step-actions\">\r\n @if(!$first) {\r\n <button mat-button matStepperPrevious type=\"button\" class=\"navigation-button\"\r\n [attr.aria-label]=\"'Go back to ' + getPreviousStepLabel()\">\r\n\r\n Back\r\n </button>\r\n }\r\n @if (!$last) {\r\n <button mat-flat-button matStepperNext color=\"primary\" type=\"button\" class=\"navigation-button\"\r\n matTooltip=\"Continue to next section\" [attr.aria-label]=\"'Continue to ' + getNextStepLabel()\">\r\n Next\r\n </button>\r\n }\r\n @if (!!$last) {\r\n <button mat-button (click)=\"stepper.reset()\">Reset</button>\r\n }\r\n\r\n </div>\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=\"24\" />\r\n </div>\r\n }\r\n\r\n </mat-step>\r\n }\r\n }\r\n </mat-stepper>\r\n <section style=\"text-align: center;\">\r\n <br>\r\n A form section helps organize related input fields together.\r\n <br>\r\n Click the <strong>\"Add Section\"</strong> button below to create a new section.\r\n </section>\r\n <mat-card-actions style=\"position: sticky;bottom: 0;\">\r\n <span class=\"spacer\"></span>\r\n <button (click)=\"addSection()\" color=\"accent\" mat-flat-button>\r\n <mat-icon>add</mat-icon>\r\n Add Section\r\n </button>\r\n <span class=\"spacer\"></span>\r\n </mat-card-actions>\r\n <!-- Defer the footer toolbar until after the main form is loaded -->\r\n @defer (on idle; prefetch on viewport) {\r\n <footer><mat-toolbar class=\"submission-toolbar\" role=\"toolbar\" aria-label=\"Form submission actions\">\r\n <span class=\"submission-status\" role=\"status\">\r\n {{getSubmissionStatus$|async}}\r\n </span>\r\n <button mat-raised-button color=\"primary\" [disabled]=\"true\" aria-label=\"Submit form\">\r\n <span>\r\n {{ formSubmissionMessage()}}\r\n </span>\r\n @if(submittingForm){\r\n <mat-spinner diameter=\"10\"></mat-spinner>\r\n }\r\n\r\n </button>\r\n </mat-toolbar>\r\n </footer>\r\n } @placeholder {\r\n <!-- Simple placeholder for the footer that maintains layout -->\r\n <footer>\r\n <div class=\"submission-toolbar-placeholder\"></div>\r\n </footer>\r\n }\r\n\r\n</mat-card>\r\n<mat-menu #sectionMenu=\"matMenu\">\r\n <ng-template matMenuContent let-sectionId=\"sectionId\" let-columns=\"columns\">\r\n <!-- <button mat-menu-item [matMenuTriggerFor]=\"sectionType\">\r\n <mat-icon> disabled_visible</mat-icon>\r\n Set visibility type</button> -->\r\n @if (sectionIncludesDefault(columns) === false) {\r\n <button (click)=\"deleteSection(sectionId,false)\" matTooltip=\"Deletes this section and all its inputs\"\r\n matTooltipPosition=\"right\" mat-menu-item>\r\n <mat-icon style=\"color: var(--mat-sys-error);\">delete</mat-icon>\r\n <span style=\"color: var(--mat-sys-error);\"> Delete section</span>\r\n\r\n </button>\r\n <button (click)=\"deleteSection(sectionId,true)\" matTooltip=\"Deletes all inputs in this section\"\r\n matTooltipPosition=\"right\" mat-menu-item>\r\n <mat-icon style=\"color: var(--mat-sys-error);\">delete_sweep</mat-icon>\r\n <span style=\"color: var(--mat-sys-error);\">\r\n Delete section inputs\r\n </span>\r\n\r\n </button>\r\n }\r\n\r\n <button (click)=\"toggleSectionReports(sectionId)\" mat-menu-item>\r\n <mat-icon>leaderboard</mat-icon>\r\n {{openSectionReports[sectionId]?'Close report': 'Section report'}}</button>\r\n </ng-template>\r\n</mat-menu>\r\n<mat-menu #sectionType=\"matMenu\">\r\n <button mat-menu-item>\r\n <mat-icon>visibility</mat-icon>\r\n view only</button>\r\n <button mat-menu-item>\r\n <mat-icon>visibility_off</mat-icon>\r\n system</button>\r\n <button mat-menu-item>\r\n <mat-icon>edit</mat-icon>\r\n user edit</button>\r\n</mat-menu>\r\n<mat-menu #moveInput=\"matMenu\">\r\n <ng-template matMenuContent let-id=\"id\" let-sectionId=\"sectionId\">\r\n @for (section of ( selectFormStepsComputed); track section.sectionId) {\r\n <button [disabled]=\"section.sectionId === sectionId\" (click)=\"moveInputToSection(id,section.sectionId)\"\r\n mat-menu-item>\r\n <mat-icon>folder</mat-icon>\r\n {{section.label || 'Untitled section'}}\r\n </button>\r\n }\r\n\r\n </ng-template>\r\n</mat-menu>\r\n\r\n\r\n<pre>\r\n <sub>\r\n {{ this.mainForm?.value | json}}\r\n </sub>\r\n \r\n</pre>", styles: [".mainCard{margin-top:0;min-height:45vh;box-shadow:none;max-width:768px;margin-left:auto;padding:8px;left:0;margin-right:auto;border-radius:12px}.inEditCol{box-shadow:var(--mdc-elevated-card-container-elevation);border:solid 1px #243D91!important}.inputCard{box-shadow:none}.cancelProgress{height:24px!important;width:24px!important}.numbers{position:absolute!important;right:0}mat-vertical-stepper{margin:5px}.list{min-height:60px;display:block}.box{padding:5px;cursor:move}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.box:last-child{border:none}.list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.custom-placeholder{background:#ccc;border:dotted 3px #999;min-width:100%;min-height:60px;transition:transform .25s cubic-bezier(0,0,.2,1)}.section-title-input{border:none;background-color:transparent;font-size:.875em;font-weight:600;color:#333;padding-top:12px;padding-bottom:12px;outline:none;width:calc(100% - 54px);transition:border-bottom-color .3s ease-in-out}.section-title-input:focus{border-bottom:1px solid #007bff}.inputElement:focus{box-shadow:0 0 0 .2rem #007bff40}.headerToolbar{position:sticky;top:0;min-width:100%;background:var(--mdc-elevated-card-container-color)}::ng-deep mat-step-header .mat-step-label{width:100%}.error{color:var(--mat--sys-error);display:flex;align-items:center}.submission-toolbar{z-index:1000;background:#ffffff0d;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-top:var(--mat-divider-width) solid var(--mat-divider-color);padding:8px 16px;display:flex;justify-content:flex-end;gap:16px}.submission-status{font-size:.75em;opacity:.87;display:flex;align-items:center}\n"] }]
|
|
261
|
-
}], ctorParameters: null, propDecorators: { stepper: [{
|
|
262
|
-
type: ViewChild,
|
|
263
|
-
args: ['stepper']
|
|
264
|
-
}] } }) });
|
|
265
|
-
|
|
266
|
-
export { FormSectionStepperComponent };
|
|
267
|
-
//# sourceMappingURL=ngx-t-forms-form-section-stepper.component-Bg9eGmgN.mjs.map
|