ngx-t-forms 2.0.23 → 2.0.24
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-BdDN7YwK.mjs → ngx-t-forms-calculated-field-rules.component-BUKzXsXn.mjs} +12 -12
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-BdDN7YwK.mjs.map → ngx-t-forms-calculated-field-rules.component-BUKzXsXn.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-DVhV4izc.mjs → ngx-t-forms-chip-options-creator-editor.component-C00n6tFs.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-DVhV4izc.mjs.map → ngx-t-forms-chip-options-creator-editor.component-C00n6tFs.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-BTUnZ1q1.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-DtfUKZL-.mjs} +8 -8
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-BTUnZ1q1.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-DtfUKZL-.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-data-source-picker.component-DcpGy7kq.mjs → ngx-t-forms-data-source-picker.component-BBEQuzn2.mjs} +7 -7
- package/fesm2022/{ngx-t-forms-data-source-picker.component-DcpGy7kq.mjs.map → ngx-t-forms-data-source-picker.component-BBEQuzn2.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-Bdfd5ik4.mjs → ngx-t-forms-document-list-label-config-editor.component-D6kwe89h.mjs} +7 -7
- package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-Bdfd5ik4.mjs.map → ngx-t-forms-document-list-label-config-editor.component-D6kwe89h.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-input-selector.component-n88ExFxv.mjs → ngx-t-forms-form-input-selector.component-CniLZN1h.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-form-input-selector.component-n88ExFxv.mjs.map → ngx-t-forms-form-input-selector.component-CniLZN1h.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-json-view.component-Bm-k704L.mjs → ngx-t-forms-form-json-view.component-bnjkxqgV.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-json-view.component-Bm-k704L.mjs.map → ngx-t-forms-form-json-view.component-bnjkxqgV.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-BGu2CX3r.mjs → ngx-t-forms-form-section-stepper.component-DFbYNeAi.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-BGu2CX3r.mjs.map → ngx-t-forms-form-section-stepper.component-DFbYNeAi.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-Brj72jZP.mjs → ngx-t-forms-forms-builder-menu.component-DBEgmcSi.mjs} +12 -12
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-Brj72jZP.mjs.map → ngx-t-forms-forms-builder-menu.component-DBEgmcSi.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-input-editor.component-BqRBvrQe.mjs → ngx-t-forms-input-editor.component-BBP90B_e.mjs} +8 -8
- package/fesm2022/{ngx-t-forms-input-editor.component-BqRBvrQe.mjs.map → ngx-t-forms-input-editor.component-BBP90B_e.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-CQ76110I.mjs +103 -0
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-CQ76110I.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-mat-slider-editor.component-CnnC8-nJ.mjs → ngx-t-forms-mat-slider-editor.component-CIiYyxkb.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mat-slider-editor.component-CnnC8-nJ.mjs.map → ngx-t-forms-mat-slider-editor.component-CIiYyxkb.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mat-slider-toggle-editor.component-B8O9Xn4R.mjs → ngx-t-forms-mat-slider-toggle-editor.component-DDR2JurF.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mat-slider-toggle-editor.component-B8O9Xn4R.mjs.map → ngx-t-forms-mat-slider-toggle-editor.component-DDR2JurF.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-CXIOm7OT.mjs → ngx-t-forms-missing-form-configs.component-CYN9mVz9.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-CXIOm7OT.mjs.map → ngx-t-forms-missing-form-configs.component-CYN9mVz9.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-B0I2X92a.mjs → ngx-t-forms-mscoa-segment-config.component-C9zKzzzX.mjs} +9 -9
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-B0I2X92a.mjs.map → ngx-t-forms-mscoa-segment-config.component-C9zKzzzX.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-ngx-t-forms-BYmto56R.mjs → ngx-t-forms-ngx-t-forms-DwsbmVlY.mjs} +622 -154
- package/fesm2022/ngx-t-forms-ngx-t-forms-DwsbmVlY.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-T4_0xqeE.mjs → ngx-t-forms-pipeline-generator.component-CGKxfvvC.mjs} +14 -14
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-T4_0xqeE.mjs.map → ngx-t-forms-pipeline-generator.component-CGKxfvvC.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-required-inputs.component-C5iwMGil.mjs → ngx-t-forms-required-inputs.component-Bktx1QGr.mjs} +9 -9
- package/fesm2022/{ngx-t-forms-required-inputs.component-C5iwMGil.mjs.map → ngx-t-forms-required-inputs.component-Bktx1QGr.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-C4zwQqzh.mjs → ngx-t-forms-rest-api-call-setup.component-BcItch1n.mjs} +8 -8
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-C4zwQqzh.mjs.map → ngx-t-forms-rest-api-call-setup.component-BcItch1n.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-section-report.component-B5TrrkeO.mjs → ngx-t-forms-section-report.component-Cn_oWXBX.mjs} +5 -5
- package/fesm2022/{ngx-t-forms-section-report.component-B5TrrkeO.mjs.map → ngx-t-forms-section-report.component-Cn_oWXBX.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-ClzCcmlC.mjs → ngx-t-forms-selection-options-editor.component-Cc41XG4s.mjs} +8 -8
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-ClzCcmlC.mjs.map → ngx-t-forms-selection-options-editor.component-Cc41XG4s.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-t-workflow-picker.component-CezFgp2z.mjs +171 -0
- package/fesm2022/ngx-t-forms-t-workflow-picker.component-CezFgp2z.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-validators-config.component-B9kfcaSm.mjs → ngx-t-forms-validators-config.component-4Iy5uJj3.mjs} +9 -9
- package/fesm2022/{ngx-t-forms-validators-config.component-B9kfcaSm.mjs.map → ngx-t-forms-validators-config.component-4Iy5uJj3.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms.mjs +1 -1
- package/lib/components/forms/forms.component.d.ts +1 -1
- package/lib/components/t-dynamic-data-edit/elements/mat-chip-list-editor/mat-chip-list-editor.component.d.ts +3 -0
- package/lib/components/t-form-input/elements/workflow-adjudication/elements/point-assignment/elements/point-assignment-dialog/point-assignment-dialog.component.d.ts +41 -0
- package/lib/components/t-form-input/elements/workflow-adjudication/elements/point-assignment/point-assignment.component.d.ts +40 -28
- package/lib/components/t-form-input/elements/workflow-adjudication/elements/submission-review/elements/submission-review-dialog/submission-review-dialog.component.d.ts +27 -0
- package/lib/components/t-form-input/elements/workflow-adjudication/elements/submission-review/submission-review.component.d.ts +6 -11
- package/lib/components/t-form-input/elements/workflow-adjudication/elements/supplier-selection/supplier-selection.component.d.ts +33 -0
- package/package.json +2 -2
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-DRMTdPwU.mjs +0 -95
- package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-DRMTdPwU.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-BYmto56R.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-t-workflow-picker.component-C1t8oH9s.mjs +0 -171
- package/fesm2022/ngx-t-forms-t-workflow-picker.component-C1t8oH9s.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-t-forms-validators-config.component-B9kfcaSm.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,GAAW,EAAE;QAExB,IAAO,CAAA,OAAA,GAAY,KAAK;QAOxB,IAAQ,CAAA,QAAA,GAAY,KAAK;QACjB,IAAQ,CAAA,QAAA,GAAY,KAAK;QAwBtB,IAAM,CAAA,MAAA,GAAoC,EAAE;QACvD,IAAO,CAAA,OAAA,GAAY,KAAK;AACxB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAK,GAAG;QASZ,IAAS,CAAA,SAAA,GAAgC,SAAS;QAElD,IAAU,CAAA,UAAA,GAA4B,EAAE;AACvC,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,YAAY,EAAO;QA0BhD,IAAa,CAAA,aAAA,GAAY,KAAK;QAsB9B,IAAM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Q,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-4Iy5uJj3.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,GAAW,EAAE;QAExB,IAAO,CAAA,OAAA,GAAY,KAAK;QAOxB,IAAQ,CAAA,QAAA,GAAY,KAAK;QACjB,IAAQ,CAAA,QAAA,GAAY,KAAK;QAwBtB,IAAM,CAAA,MAAA,GAAoC,EAAE;QACvD,IAAO,CAAA,OAAA,GAAY,KAAK;AACxB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAK,GAAG;QASZ,IAAS,CAAA,SAAA,GAAgC,SAAS;QAElD,IAAU,CAAA,UAAA,GAA4B,EAAE;AACvC,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,YAAY,EAAO;QA0BhD,IAAa,CAAA,aAAA,GAAY,KAAK;QAsB9B,IAAM,CAAA,MAAA,GAAW,EAAE;;AA7FlB,IAAA,IAAI,KAAK,GAAA;AACP,QAAA,OAAO,CAAC,IAAI,CAAC,KAAK;;AAEpB,IAAA,IAAI,gBAAgB,GAAA;QAClB,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A,CAAA;sBAAlB;gBACS,YAAY,EAAA,CAAA;sBAArB;;;;;"}
|
package/fesm2022/ngx-t-forms.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { E as DialogTemplateComponent, q as FORM_ACTIONS_TOKEN, s as FORM_CONFIG_TOKEN, v as FORM_INPUTS_TOKEN, u as FORM_SLIDES_TOKEN, z as FormBuilderComponent, c as FormTowerControllerService, H as FormatDataPipe, y as FormsComponent, x as MSCOA_TREE_PROVIDER, w as MULTIPLE_FORM_INPUT_TOKEN, A as MscoaFormInputComponent, N as NGX_T_FORMS_CONFIG_TOKEN, k as NgxTFormsComponent, j as NgxTFormsService, P as PropertyAccessError, G as SignatureInputElementComponent, T as TDynamicDataEditComponent, b as TDynamicDataViewComponent, C as TFormInputComponent, U as UTILS_OBJECT_TOKEN, B as UserFormStepperComponent, V as ValidationExpressioCreatorComponent, a as assignDeepPropertyToObject, W as createFileFromBase64, m as formGenerator, R as getSampleValueForInput, n as getSectionElements, O as getUrl, o as getValueFromValueAccessor, l as initFormConfigToV2, p as provideNgxTForms, I as returnDeepProperty, r as returnMappedPathValue, J as safeReturnDeepProperty, t as testAgainstItem, Q as textIconsForUserHints, L as validateExpressionSyntax, K as validateObjectAgainstString } from './ngx-t-forms-ngx-t-forms-
|
|
1
|
+
export { E as DialogTemplateComponent, q as FORM_ACTIONS_TOKEN, s as FORM_CONFIG_TOKEN, v as FORM_INPUTS_TOKEN, u as FORM_SLIDES_TOKEN, z as FormBuilderComponent, c as FormTowerControllerService, H as FormatDataPipe, y as FormsComponent, x as MSCOA_TREE_PROVIDER, w as MULTIPLE_FORM_INPUT_TOKEN, A as MscoaFormInputComponent, N as NGX_T_FORMS_CONFIG_TOKEN, k as NgxTFormsComponent, j as NgxTFormsService, P as PropertyAccessError, G as SignatureInputElementComponent, T as TDynamicDataEditComponent, b as TDynamicDataViewComponent, C as TFormInputComponent, U as UTILS_OBJECT_TOKEN, B as UserFormStepperComponent, V as ValidationExpressioCreatorComponent, a as assignDeepPropertyToObject, W as createFileFromBase64, m as formGenerator, R as getSampleValueForInput, n as getSectionElements, O as getUrl, o as getValueFromValueAccessor, l as initFormConfigToV2, p as provideNgxTForms, I as returnDeepProperty, r as returnMappedPathValue, J as safeReturnDeepProperty, t as testAgainstItem, Q as textIconsForUserHints, L as validateExpressionSyntax, K as validateObjectAgainstString } from './ngx-t-forms-ngx-t-forms-DwsbmVlY.mjs';
|
|
2
2
|
//# sourceMappingURL=ngx-t-forms.mjs.map
|
|
@@ -28,7 +28,7 @@ export declare class FormsComponent implements OnInit, OnDestroy {
|
|
|
28
28
|
formControlName: string;
|
|
29
29
|
}[];
|
|
30
30
|
activeForm: string | null;
|
|
31
|
-
getCols(): 1 |
|
|
31
|
+
getCols(): 1 | 2 | 3 | 4;
|
|
32
32
|
getFormAvatar(formTitle: string): string;
|
|
33
33
|
archive(form: LocalFormStateSelectorInterface, event: Event): Promise<void>;
|
|
34
34
|
unarchive(form: LocalFormStateSelectorInterface, event: Event): Promise<void>;
|
|
@@ -8,6 +8,7 @@ import * as i0 from "@angular/core";
|
|
|
8
8
|
export declare class MatChipListEditorComponent implements MatFormFieldControl<{
|
|
9
9
|
label: string;
|
|
10
10
|
value: any;
|
|
11
|
+
group?: string;
|
|
11
12
|
}[]> {
|
|
12
13
|
ngControl: NgControl;
|
|
13
14
|
private _elementRef;
|
|
@@ -37,9 +38,11 @@ export declare class MatChipListEditorComponent implements MatFormFieldControl<{
|
|
|
37
38
|
options: {
|
|
38
39
|
label: string;
|
|
39
40
|
value: any;
|
|
41
|
+
group?: string;
|
|
40
42
|
}[] | undefined;
|
|
41
43
|
valueChange: EventEmitter<any>;
|
|
42
44
|
valueListChanged($event: MatChipListboxChange): void;
|
|
45
|
+
get optionGroups(): string[];
|
|
43
46
|
static ɵfac: i0.ɵɵFactoryDeclaration<MatChipListEditorComponent, [{ optional: true; self: true; }, null]>;
|
|
44
47
|
static ɵcmp: i0.ɵɵComponentDeclaration<MatChipListEditorComponent, "lib-mat-chip-list-editor", never, { "disabled": { "alias": "disabled"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; "value": { "alias": "value"; "required": false; }; "required": { "alias": "required"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
|
45
48
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { FormBuilder, FormControl, FormGroup, NgForm, FormGroupDirective } from '@angular/forms';
|
|
3
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import { ErrorStateMatcher } from '@angular/material/core';
|
|
6
|
+
import { WorkflowAdjudicationScoreSheetValue } from 'ngx-t-forms-types';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export interface ScoreSheetGroup {
|
|
9
|
+
key: string;
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
12
|
+
export interface PointAssignmentDialogData {
|
|
13
|
+
readonly: boolean;
|
|
14
|
+
row: {
|
|
15
|
+
nameOfBidder: string;
|
|
16
|
+
adj_microFlow_assignedScore: Record<string, number>;
|
|
17
|
+
};
|
|
18
|
+
scoreSheetGroups: ScoreSheetGroup[];
|
|
19
|
+
groupedScoreSheet: Record<string, WorkflowAdjudicationScoreSheetValue[]>;
|
|
20
|
+
existingScores: Record<string, Record<string, number | null>>;
|
|
21
|
+
}
|
|
22
|
+
export declare class ShowErrorOnDirtyMatcher implements ErrorStateMatcher {
|
|
23
|
+
isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare class PointAssignmentDialogComponent implements OnInit {
|
|
26
|
+
dialogRef: MatDialogRef<PointAssignmentDialogComponent>;
|
|
27
|
+
data: PointAssignmentDialogData;
|
|
28
|
+
private fb;
|
|
29
|
+
pointsForm: FormGroup;
|
|
30
|
+
totalPoints$: Observable<number>;
|
|
31
|
+
maxPossiblePoints: number;
|
|
32
|
+
matcher: ShowErrorOnDirtyMatcher;
|
|
33
|
+
constructor(dialogRef: MatDialogRef<PointAssignmentDialogComponent>, data: PointAssignmentDialogData, fb: FormBuilder);
|
|
34
|
+
ngOnInit(): void;
|
|
35
|
+
correctMaxValue(event: Event, groupKey: string, controlId: string, maxPoints: number): void;
|
|
36
|
+
private buildForm;
|
|
37
|
+
private calculateMaxPoints;
|
|
38
|
+
private createTotalPointsObservable;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PointAssignmentDialogComponent, never>;
|
|
40
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PointAssignmentDialogComponent, "lib-point-assignment-dialog", never, {}, {}, never, never, true, never>;
|
|
41
|
+
}
|
|
@@ -1,32 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Observable
|
|
3
|
-
import {
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { AdjResponseReviewColumnMapping, ITowerStepColumn, WorkflowAdjudicationScoreSheetValue } from 'ngx-t-forms-types';
|
|
4
|
+
import { ISubmission, tableCols } from '../submission-review/submission-review.component';
|
|
5
|
+
import { MatDialog } from '@angular/material/dialog';
|
|
4
6
|
import * as i0 from "@angular/core";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
export interface IViewModel {
|
|
8
|
+
submissions: ISubmission[];
|
|
9
|
+
columnMapping: AdjResponseReviewColumnMapping;
|
|
10
|
+
displayColumns?: tableCols[];
|
|
11
|
+
displayCols: string[];
|
|
12
|
+
loading: boolean;
|
|
13
|
+
groupedScoreSheet?: Record<string, WorkflowAdjudicationScoreSheetValue[]>;
|
|
14
|
+
scoreSheetGroups?: {
|
|
15
|
+
name: string;
|
|
16
|
+
key: string;
|
|
17
|
+
}[];
|
|
18
|
+
error?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class PointAssignmentComponent {
|
|
21
|
+
private config;
|
|
22
|
+
private refreshTrigger;
|
|
23
|
+
private valueChanges$;
|
|
24
|
+
private readonly initialState;
|
|
25
|
+
private _value;
|
|
26
|
+
inputConfig: ITowerStepColumn | undefined;
|
|
27
|
+
set value(value: any);
|
|
28
|
+
pointsChange: EventEmitter<any[]>;
|
|
29
|
+
get value(): any[] | null;
|
|
30
|
+
private readonly fetchedData$;
|
|
31
|
+
loadMicroSubmissions(): void;
|
|
32
|
+
readonly vm$: Observable<IViewModel>;
|
|
15
33
|
viewMicroSubmission(res: any): void;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
34
|
+
enrichSubmissionsData(submissions: ISubmission[], reviewValues: any[] | null): ISubmission[];
|
|
35
|
+
private getScoreShade;
|
|
36
|
+
private getColorString;
|
|
37
|
+
dialog: MatDialog;
|
|
38
|
+
openPointAssignmentDialog(row: any, groupedScoreSheet: Record<string, WorkflowAdjudicationScoreSheetValue[]> | undefined, scoreSheetGroups: {
|
|
39
|
+
name: string;
|
|
40
|
+
key: string;
|
|
41
|
+
}[] | undefined): void;
|
|
22
42
|
static ɵfac: i0.ɵɵFactoryDeclaration<PointAssignmentComponent, never>;
|
|
23
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PointAssignmentComponent, "app-point-assignment", never, {}, {}, never, never, true, never>;
|
|
24
|
-
}
|
|
25
|
-
export interface scoreSheetItem {
|
|
26
|
-
id: string;
|
|
27
|
-
formControlName: string;
|
|
28
|
-
totalPoints: number;
|
|
29
|
-
description: string;
|
|
30
|
-
label: string;
|
|
31
|
-
[key: string]: number | string;
|
|
43
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PointAssignmentComponent, "app-point-assignment", never, { "inputConfig": { "alias": "inputConfig"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "pointsChange": "pointsChange"; }, never, never, true, never>;
|
|
32
44
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ITowerStepColumn } from 'ngx-t-forms-types';
|
|
2
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
3
|
+
import { OutputData } from '@editorjs/editorjs';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export interface SubmissionReviewDialogData {
|
|
6
|
+
readonly: boolean;
|
|
7
|
+
respondentNameKey: string;
|
|
8
|
+
respondentCodeKey: string;
|
|
9
|
+
activeRowNotes: OutputData | undefined;
|
|
10
|
+
row: {
|
|
11
|
+
nameOfBidder: string;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
adj_microFlow_review_notes: OutputData | undefined;
|
|
14
|
+
adj_microFlow_assignedScore: Record<string, number>;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare class SubmissionReviewDialogComponent {
|
|
18
|
+
dialogRef: MatDialogRef<SubmissionReviewDialogComponent>;
|
|
19
|
+
data: SubmissionReviewDialogData;
|
|
20
|
+
constructor(dialogRef: MatDialogRef<SubmissionReviewDialogComponent>, data: SubmissionReviewDialogData);
|
|
21
|
+
get notesInputConfig(): ITowerStepColumn;
|
|
22
|
+
get respondentName(): any;
|
|
23
|
+
changedNotes: OutputData | undefined;
|
|
24
|
+
notesChanged(notes: OutputData | undefined): void;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SubmissionReviewDialogComponent, never>;
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SubmissionReviewDialogComponent, "lib-submission-review-dialog", never, {}, {}, never, never, true, never>;
|
|
27
|
+
}
|
|
@@ -3,13 +3,14 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { ITowerStepColumn, IWorkflowDocListCols, AdjResponseReviewColumnMapping, WorkflowAdjudicationMicroFlowReviewValue } from 'ngx-t-forms-types';
|
|
4
4
|
import { MatSelectChange } from '@angular/material/select';
|
|
5
5
|
import { OutputData } from '@editorjs/editorjs';
|
|
6
|
+
import { MatDialog } from '@angular/material/dialog';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
|
-
interface ISubmission extends Record<string, any> {
|
|
8
|
+
export interface ISubmission extends Record<string, any> {
|
|
8
9
|
id: string;
|
|
9
10
|
adjudicationPricePreferenceCalculationColor?: string;
|
|
10
11
|
backgroundShades?: Record<string, string>;
|
|
11
12
|
}
|
|
12
|
-
interface tableCols extends IWorkflowDocListCols {
|
|
13
|
+
export interface tableCols extends IWorkflowDocListCols {
|
|
13
14
|
showColor?: boolean;
|
|
14
15
|
maxWidth?: string;
|
|
15
16
|
}
|
|
@@ -58,24 +59,18 @@ export declare class SubmissionReviewComponent {
|
|
|
58
59
|
get maxLimit(): number | undefined;
|
|
59
60
|
reachedMax(newValue: WorkflowAdjudicationMicroFlowReviewValue[] | null): void;
|
|
60
61
|
notesOpenForRowId: string | null;
|
|
61
|
-
activeRowNotes: OutputData | undefined;
|
|
62
|
-
notesBeingEdited: Map<string, OutputData | undefined>;
|
|
63
|
-
/**
|
|
64
|
-
* REFACTORED: Captures the notes for a specific row ID and stores them in the map.
|
|
65
|
-
*/
|
|
66
|
-
notesChanged(notes: OutputData | undefined, rowId: string): void;
|
|
67
62
|
/**
|
|
68
63
|
* REFACTORED: Saves the notes from the `notesBeingEdited` map.
|
|
69
64
|
*/
|
|
70
|
-
notesBlur(): void;
|
|
71
|
-
get notesInputConfig(): ITowerStepColumn;
|
|
65
|
+
notesBlur(notesToSave: OutputData | undefined): void;
|
|
72
66
|
bulkOperations: {
|
|
73
67
|
label: string;
|
|
74
68
|
value: string;
|
|
75
69
|
color: string;
|
|
76
70
|
}[];
|
|
77
|
-
get bulkStatus(): "
|
|
71
|
+
get bulkStatus(): "mixed" | "compliant" | "non-compliant";
|
|
78
72
|
bulkStatusChanged(event: MatSelectChange): void;
|
|
73
|
+
dialog: MatDialog;
|
|
79
74
|
openNotes(row: any): void;
|
|
80
75
|
canChangeStatus(row: any): boolean;
|
|
81
76
|
static ɵfac: i0.ɵɵFactoryDeclaration<SubmissionReviewComponent, never>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { ITowerStepColumn, WorkflowAdjudicationScoreSheetValue } from 'ngx-t-forms-types';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { IViewModel } from '../point-assignment/point-assignment.component';
|
|
5
|
+
import { MatDialog } from '@angular/material/dialog';
|
|
6
|
+
import { ISubmission } from '../submission-review/submission-review.component';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class SupplierSelectionComponent {
|
|
9
|
+
private config;
|
|
10
|
+
private refreshTrigger;
|
|
11
|
+
private valueChanges$;
|
|
12
|
+
private readonly initialState;
|
|
13
|
+
private _value;
|
|
14
|
+
inputConfig: ITowerStepColumn | undefined;
|
|
15
|
+
set value(value: any);
|
|
16
|
+
supplierSelection: EventEmitter<any[]>;
|
|
17
|
+
get value(): any[] | null;
|
|
18
|
+
private readonly fetchedData$;
|
|
19
|
+
loadMicroSubmissions(): void;
|
|
20
|
+
readonly vm$: Observable<IViewModel>;
|
|
21
|
+
viewMicroSubmission(res: any): void;
|
|
22
|
+
enrichSubmissionsData(submissions: ISubmission[], value: any[] | null, totalPossibleScore: number, maxPointsAwarded: number): ISubmission[];
|
|
23
|
+
private getScoreShade;
|
|
24
|
+
private getColorString;
|
|
25
|
+
dialog: MatDialog;
|
|
26
|
+
openPointAssignmentDialog(row: any, groupedScoreSheet: Record<string, WorkflowAdjudicationScoreSheetValue[]> | undefined, scoreSheetGroups: {
|
|
27
|
+
name: string;
|
|
28
|
+
key: string;
|
|
29
|
+
}[] | undefined): void;
|
|
30
|
+
appointASupplier(row: any): void;
|
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SupplierSelectionComponent, never>;
|
|
32
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SupplierSelectionComponent, "app-supplier-selection", never, { "inputConfig": { "alias": "inputConfig"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "supplierSelection": "supplierSelection"; }, never, never, true, never>;
|
|
33
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-t-forms",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.24",
|
|
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": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"html5-qrcode": "^2.3.8",
|
|
39
39
|
"joi": "^17.13.3",
|
|
40
40
|
"mathjs": "^14.2.0",
|
|
41
|
-
"ngx-t-forms-types": "^0.0.
|
|
41
|
+
"ngx-t-forms-types": "^0.0.14",
|
|
42
42
|
"ngx-ui-tour-md-menu": "^14.0.1",
|
|
43
43
|
"qrcode": "^1.5.3",
|
|
44
44
|
"rxjs": "~7.8.0",
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Output, Input, HostBinding, Optional, Self, Component } from '@angular/core';
|
|
3
|
-
import { M as MatModulesModule, S as SearchListPipe } from './ngx-t-forms-ngx-t-forms-BYmto56R.mjs';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
6
|
-
import { Subject } from 'rxjs';
|
|
7
|
-
import * as i1 from '@angular/forms';
|
|
8
|
-
import { FormsModule } from '@angular/forms';
|
|
9
|
-
import * as i5 from '@angular/material/chips';
|
|
10
|
-
import * as i5$1 from '@angular/material/icon';
|
|
11
|
-
import * as i3 from '@angular/material/select';
|
|
12
|
-
import * as i12 from '@angular/material/input';
|
|
13
|
-
|
|
14
|
-
class MatChipListEditorComponent {
|
|
15
|
-
static { this.nextId = 0; }
|
|
16
|
-
constructor(ngControl, _elementRef) {
|
|
17
|
-
this.ngControl = ngControl;
|
|
18
|
-
this._elementRef = _elementRef;
|
|
19
|
-
this.listSearchKey = '';
|
|
20
|
-
this.stateChanges = new Subject();
|
|
21
|
-
this.id = `lib-mat-chip-list-editor-${MatChipListEditorComponent.nextId++}`;
|
|
22
|
-
this.placeholder = '';
|
|
23
|
-
this.focused = false;
|
|
24
|
-
this.disabled = false;
|
|
25
|
-
this.touched = false;
|
|
26
|
-
this.onTouched = () => { };
|
|
27
|
-
this.errors = [];
|
|
28
|
-
this.required = false;
|
|
29
|
-
this.options = [];
|
|
30
|
-
this.valueChange = new EventEmitter();
|
|
31
|
-
}
|
|
32
|
-
get empty() {
|
|
33
|
-
return !this.value;
|
|
34
|
-
}
|
|
35
|
-
get shouldLabelFloat() {
|
|
36
|
-
return this.focused || !this.empty;
|
|
37
|
-
}
|
|
38
|
-
get errorState() {
|
|
39
|
-
const hasError = !!this.ngControl?.control?.errors || (this.errors || []).length > 0 && this.touched;
|
|
40
|
-
return !this.value && !!this.required || hasError;
|
|
41
|
-
}
|
|
42
|
-
setDescribedByIds(ids) {
|
|
43
|
-
// Ensure the component view is initialized
|
|
44
|
-
if (this._elementRef && this._elementRef.nativeElement) {
|
|
45
|
-
const controlElement = this._elementRef.nativeElement.querySelector('.lib-mat-chip-list-editor');
|
|
46
|
-
// Check if the controlElement exists before attempting to set its attribute
|
|
47
|
-
if (controlElement) {
|
|
48
|
-
controlElement.setAttribute('aria-describedby', ids.join(' '));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
onContainerClick(event) {
|
|
53
|
-
this.markAsTouched();
|
|
54
|
-
this.stateChanges.next();
|
|
55
|
-
}
|
|
56
|
-
markAsTouched() {
|
|
57
|
-
console.log('markAsTouched');
|
|
58
|
-
if (!this.touched) {
|
|
59
|
-
this.onTouched();
|
|
60
|
-
this.touched = true;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
valueListChanged($event) {
|
|
64
|
-
this.valueChange.emit($event.value);
|
|
65
|
-
}
|
|
66
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MatChipListEditorComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
67
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: MatChipListEditorComponent, isStandalone: true, selector: "lib-mat-chip-list-editor", inputs: { disabled: "disabled", errors: "errors", value: "value", required: "required", options: "options" }, outputs: { valueChange: "valueChange" }, host: { properties: { "id": "this.id" } }, providers: [{ provide: MatFormFieldControl,
|
|
68
|
-
useExisting: MatChipListEditorComponent }], ngImport: i0, template: "<!-- add search -->\r\n<div style=\"display: flex; flex-direction: column;\">\r\n<div>\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"search-field\">\r\n <mat-icon matSuffix>search</mat-icon>\r\n <input matInput [(ngModel)]=\"listSearchKey\" placeholder=\"Search options\">\r\n </mat-form-field>\r\n</div>\r\n<div>\r\n <mat-chip-listbox [value]=\"value\" [disabled]=\"disabled\" (change)=\"valueListChanged($event)\" aria-l\r\n abel=\"Chip select options\">\r\n @for(option of (options||[])|searchList:listSearchKey;track option.value){\r\n <mat-chip-option [value]=\"option.value\">{{option.label}}</mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n</div>\r\n</div>\r\n", styles: ["mat-chip-listbox{max-height:500px;overflow-y:auto}.search-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatModulesModule }, { kind: "component", type: i5.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i5.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i12.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: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: SearchListPipe, name: "searchList" }] }); }
|
|
69
|
-
}
|
|
70
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MatChipListEditorComponent, decorators: [{
|
|
71
|
-
type: Component,
|
|
72
|
-
args: [{ selector: 'lib-mat-chip-list-editor', standalone: true, imports: [MatModulesModule, CommonModule, FormsModule, SearchListPipe], providers: [{ provide: MatFormFieldControl,
|
|
73
|
-
useExisting: MatChipListEditorComponent }], template: "<!-- add search -->\r\n<div style=\"display: flex; flex-direction: column;\">\r\n<div>\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"search-field\">\r\n <mat-icon matSuffix>search</mat-icon>\r\n <input matInput [(ngModel)]=\"listSearchKey\" placeholder=\"Search options\">\r\n </mat-form-field>\r\n</div>\r\n<div>\r\n <mat-chip-listbox [value]=\"value\" [disabled]=\"disabled\" (change)=\"valueListChanged($event)\" aria-l\r\n abel=\"Chip select options\">\r\n @for(option of (options||[])|searchList:listSearchKey;track option.value){\r\n <mat-chip-option [value]=\"option.value\">{{option.label}}</mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n</div>\r\n</div>\r\n", styles: ["mat-chip-listbox{max-height:500px;overflow-y:auto}.search-field{width:100%}\n"] }]
|
|
74
|
-
}], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
|
|
75
|
-
type: Optional
|
|
76
|
-
}, {
|
|
77
|
-
type: Self
|
|
78
|
-
}] }, { type: i0.ElementRef }], propDecorators: { id: [{
|
|
79
|
-
type: HostBinding
|
|
80
|
-
}], disabled: [{
|
|
81
|
-
type: Input
|
|
82
|
-
}], errors: [{
|
|
83
|
-
type: Input
|
|
84
|
-
}], value: [{
|
|
85
|
-
type: Input
|
|
86
|
-
}], required: [{
|
|
87
|
-
type: Input
|
|
88
|
-
}], options: [{
|
|
89
|
-
type: Input
|
|
90
|
-
}], valueChange: [{
|
|
91
|
-
type: Output
|
|
92
|
-
}] } });
|
|
93
|
-
|
|
94
|
-
export { MatChipListEditorComponent };
|
|
95
|
-
//# sourceMappingURL=ngx-t-forms-mat-chip-list-editor.component-DRMTdPwU.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-t-forms-mat-chip-list-editor.component-DRMTdPwU.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mat-chip-list-editor/mat-chip-list-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mat-chip-list-editor/mat-chip-list-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';\r\nimport { FormsModule, NgControl } from '@angular/forms';\r\nimport { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\nimport { MatChipListboxChange } from '@angular/material/chips';\r\nimport { SearchListPipe } from '../../../../shared/pipes/list-search.pipe';\r\n\r\n@Component({\r\n selector: 'lib-mat-chip-list-editor',\r\n standalone: true,\r\n imports: [MatModulesModule, CommonModule,FormsModule,SearchListPipe],\r\n templateUrl: './mat-chip-list-editor.component.html',\r\n styleUrl: './mat-chip-list-editor.component.css',\r\n providers: [{ provide: MatFormFieldControl,\r\n useExisting:MatChipListEditorComponent}],\r\n})\r\nexport class MatChipListEditorComponent implements MatFormFieldControl<{\r\n label: string,\r\n value: any\r\n}[]> {\r\n\r\n listSearchKey: string = '';\r\n static nextId = 0;\r\n stateChanges = new Subject<void>();\r\n \r\n @HostBinding() id = `lib-mat-chip-list-editor-${MatChipListEditorComponent.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 \r\n @Input() 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('.lib-mat-chip-list-editor');\r\n // Check if the controlElement exists before attempting to set its attribute\r\n if (controlElement) {\r\n controlElement.setAttribute('aria-describedby', ids.join(' '));\r\n }\r\n }\r\n }\r\n onContainerClick(event: MouseEvent): void {\r\n this.markAsTouched();\r\n this.stateChanges.next();\r\n }\r\n \r\n touched: boolean = false;\r\n onTouched = () => { };\r\n markAsTouched() {\r\n console.log('markAsTouched')\r\n if (!this.touched) {\r\n this.onTouched();\r\n this.touched = true;\r\n }\r\n }\r\n \r\n \r\n\r\n\r\n @Input() errors:IConfigElementError[] |undefined = [];\r\n @Input() value: any;\r\n @Input() required: boolean = false;\r\n @Input() options:{\r\n label: string,\r\n value: any\r\n }[] | undefined =[]\r\n @Output() valueChange = new EventEmitter<any>();\r\n\r\n valueListChanged($event: MatChipListboxChange) {\r\n this.valueChange.emit($event.value);\r\n }\r\n}\r\n","<!-- add search -->\r\n<div style=\"display: flex; flex-direction: column;\">\r\n<div>\r\n <mat-form-field subscriptSizing=\"dynamic\" class=\"search-field\">\r\n <mat-icon matSuffix>search</mat-icon>\r\n <input matInput [(ngModel)]=\"listSearchKey\" placeholder=\"Search options\">\r\n </mat-form-field>\r\n</div>\r\n<div>\r\n <mat-chip-listbox [value]=\"value\" [disabled]=\"disabled\" (change)=\"valueListChanged($event)\" aria-l\r\n abel=\"Chip select options\">\r\n @for(option of (options||[])|searchList:listSearchKey;track option.value){\r\n <mat-chip-option [value]=\"option.value\">{{option.label}}</mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n</div>\r\n</div>\r\n"],"names":["i2","i3","i4","i5"],"mappings":";;;;;;;;;;;;;MAmBa,0BAA0B,CAAA;aAM5B,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;QAPjF,IAAa,CAAA,aAAA,GAAW,EAAE;AAEzB,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI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