ngx-t-forms 2.0.15 → 2.0.17

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.
Files changed (93) hide show
  1. package/fesm2022/{ngx-t-forms-api-value-access-rules.component-fKCk6tHv.mjs → ngx-t-forms-api-value-access-rules.component-DscZEY73.mjs} +10 -6
  2. package/fesm2022/ngx-t-forms-api-value-access-rules.component-DscZEY73.mjs.map +1 -0
  3. package/fesm2022/{ngx-t-forms-calculated-field-rules.component-B_8NQhQQ.mjs → ngx-t-forms-calculated-field-rules.component-BP6qdagA.mjs} +11 -6
  4. package/fesm2022/ngx-t-forms-calculated-field-rules.component-BP6qdagA.mjs.map +1 -0
  5. package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-Wv7jtClz.mjs → ngx-t-forms-chip-options-creator-editor.component-U-F-Mw4k.mjs} +7 -5
  6. package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-U-F-Mw4k.mjs.map +1 -0
  7. package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-DuC1LDjl.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-0Svupljo.mjs} +6 -4
  8. package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-0Svupljo.mjs.map +1 -0
  9. package/fesm2022/ngx-t-forms-data-source-picker.component-DFaFLo9z.mjs +206 -0
  10. package/fesm2022/ngx-t-forms-data-source-picker.component-DFaFLo9z.mjs.map +1 -0
  11. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-CVF-JI3j.mjs +239 -0
  12. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-CVF-JI3j.mjs.map +1 -0
  13. package/fesm2022/{ngx-t-forms-form-input-selector.component-DZXH_UBK.mjs → ngx-t-forms-form-input-selector.component-BqJ7H_C5.mjs} +2 -2
  14. package/fesm2022/{ngx-t-forms-form-input-selector.component-DZXH_UBK.mjs.map → ngx-t-forms-form-input-selector.component-BqJ7H_C5.mjs.map} +1 -1
  15. package/fesm2022/{ngx-t-forms-form-json-view.component-U4HGVNQk.mjs → ngx-t-forms-form-json-view.component-CHE8wxNI.mjs} +2 -2
  16. package/fesm2022/{ngx-t-forms-form-json-view.component-U4HGVNQk.mjs.map → ngx-t-forms-form-json-view.component-CHE8wxNI.mjs.map} +1 -1
  17. package/fesm2022/ngx-t-forms-form-section-stepper.component-CvVu8xJI.mjs +253 -0
  18. package/fesm2022/ngx-t-forms-form-section-stepper.component-CvVu8xJI.mjs.map +1 -0
  19. package/fesm2022/{ngx-t-forms-forms-builder-menu.component-CAE1-JXD.mjs → ngx-t-forms-forms-builder-menu.component-BSvhnXCy.mjs} +6 -6
  20. package/fesm2022/{ngx-t-forms-forms-builder-menu.component-CAE1-JXD.mjs.map → ngx-t-forms-forms-builder-menu.component-BSvhnXCy.mjs.map} +1 -1
  21. package/fesm2022/ngx-t-forms-input-editor.component-C1UIixRM.mjs +147 -0
  22. package/fesm2022/ngx-t-forms-input-editor.component-C1UIixRM.mjs.map +1 -0
  23. package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-qzR-rM4E.mjs → ngx-t-forms-mat-chip-list-editor.component-CZbupm3H.mjs} +7 -5
  24. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-CZbupm3H.mjs.map +1 -0
  25. package/fesm2022/{ngx-t-forms-mat-slider-editor.component-pVWgzc5_.mjs → ngx-t-forms-mat-slider-editor.component-DKIiWPq3.mjs} +6 -4
  26. package/fesm2022/ngx-t-forms-mat-slider-editor.component-DKIiWPq3.mjs.map +1 -0
  27. package/fesm2022/{ngx-t-forms-mat-slider-toggle-editor.component-Ddy1-Jgp.mjs → ngx-t-forms-mat-slider-toggle-editor.component-MFT33hkt.mjs} +6 -4
  28. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-MFT33hkt.mjs.map +1 -0
  29. package/fesm2022/{ngx-t-forms-missing-form-configs.component-BQbT17M7.mjs → ngx-t-forms-missing-form-configs.component-DO3QfrLp.mjs} +4 -4
  30. package/fesm2022/{ngx-t-forms-missing-form-configs.component-BQbT17M7.mjs.map → ngx-t-forms-missing-form-configs.component-DO3QfrLp.mjs.map} +1 -1
  31. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-Bo-aEuAQ.mjs +282 -0
  32. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-Bo-aEuAQ.mjs.map +1 -0
  33. package/fesm2022/{ngx-t-forms-ngx-t-forms-Biy_6-DN.mjs → ngx-t-forms-ngx-t-forms-fgu62eR1.mjs} +235 -201
  34. package/fesm2022/ngx-t-forms-ngx-t-forms-fgu62eR1.mjs.map +1 -0
  35. package/fesm2022/{ngx-t-forms-pipeline-generator.component-DfjnUdcM.mjs → ngx-t-forms-pipeline-generator.component-BtkYF9xE.mjs} +12 -7
  36. package/fesm2022/ngx-t-forms-pipeline-generator.component-BtkYF9xE.mjs.map +1 -0
  37. package/fesm2022/ngx-t-forms-required-inputs.component-BfrR28ge.mjs +189 -0
  38. package/fesm2022/ngx-t-forms-required-inputs.component-BfrR28ge.mjs.map +1 -0
  39. package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-DmII4rB1.mjs → ngx-t-forms-rest-api-call-setup.component-Dx-EamZ8.mjs} +8 -4
  40. package/fesm2022/ngx-t-forms-rest-api-call-setup.component-Dx-EamZ8.mjs.map +1 -0
  41. package/fesm2022/{ngx-t-forms-section-report.component-D04ybG_k.mjs → ngx-t-forms-section-report.component-Z9rqOa1d.mjs} +4 -4
  42. package/fesm2022/{ngx-t-forms-section-report.component-D04ybG_k.mjs.map → ngx-t-forms-section-report.component-Z9rqOa1d.mjs.map} +1 -1
  43. package/fesm2022/ngx-t-forms-selection-options-editor.component-CSTV4Hqm.mjs +145 -0
  44. package/fesm2022/ngx-t-forms-selection-options-editor.component-CSTV4Hqm.mjs.map +1 -0
  45. package/fesm2022/ngx-t-forms-validators-config.component-I346eCwr.mjs +218 -0
  46. package/fesm2022/ngx-t-forms-validators-config.component-I346eCwr.mjs.map +1 -0
  47. package/fesm2022/ngx-t-forms.mjs +1 -1
  48. package/lib/components/form-builder/elements/form-section-stepper/form-section-stepper.component.d.ts +4 -1
  49. package/lib/components/t-dynamic-data-edit/elements/api-value-access-rules/api-value-access-rules.component.d.ts +1 -1
  50. package/lib/components/t-dynamic-data-edit/elements/calculated-field-rules/calculated-field-rules.component.d.ts +1 -1
  51. package/lib/components/t-dynamic-data-edit/elements/chip-options-creator-editor/chip-options-creator-editor.component.d.ts +1 -1
  52. package/lib/components/t-dynamic-data-edit/elements/config-mscoa-additional-inputs/config-mscoa-additional-inputs.component.d.ts +1 -1
  53. package/lib/components/t-dynamic-data-edit/elements/data-source-picker/data-source-picker.component.d.ts +57 -0
  54. package/lib/components/t-dynamic-data-edit/elements/document-list-label-config-editor/document-list-label-config-editor.component.d.ts +62 -0
  55. package/lib/components/t-dynamic-data-edit/elements/mat-chip-list-editor/mat-chip-list-editor.component.d.ts +1 -1
  56. package/lib/components/t-dynamic-data-edit/elements/mat-slider-editor/mat-slider-editor.component.d.ts +1 -1
  57. package/lib/components/t-dynamic-data-edit/elements/mat-slider-toggle-editor/mat-slider-toggle-editor.component.d.ts +2 -2
  58. package/lib/components/t-dynamic-data-edit/elements/mscoa-segment-config/mscoa-segment-config.component.d.ts +1 -1
  59. package/lib/components/t-dynamic-data-edit/elements/pipeline-generator/pipeline-generator.component.d.ts +1 -1
  60. package/lib/components/t-dynamic-data-edit/elements/required-inputs/required-inputs.component.d.ts +1 -1
  61. package/lib/components/t-dynamic-data-edit/elements/rest-api-call-setup/rest-api-call-setup.component.d.ts +1 -1
  62. package/lib/components/t-dynamic-data-edit/elements/selection-options-editor/selection-options-editor.component.d.ts +1 -1
  63. package/lib/components/t-dynamic-data-edit/elements/validators-config/validators-config.component.d.ts +1 -1
  64. package/lib/components/t-dynamic-data-edit/t-dynamic-data-edit.component.d.ts +5 -2
  65. package/lib/components/t-form-input/elements/mscoa-form-input/elements/account-value/account-value.component.d.ts +1 -1
  66. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/mscoa-chart.component.d.ts +1 -0
  67. package/lib/components/t-form-input/elements/mscoa-form-input/elements/scoa-account-table/scoa-account-table.component.d.ts +2 -2
  68. package/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-table/multiple-input-table.component.d.ts +1 -1
  69. package/lib/services/core/t-form-builder/functions/inputElementEditorConfigs.d.ts +2 -2
  70. package/lib/services/index.d.ts +2 -1
  71. package/package.json +2 -2
  72. package/fesm2022/ngx-t-forms-api-value-access-rules.component-fKCk6tHv.mjs.map +0 -1
  73. package/fesm2022/ngx-t-forms-calculated-field-rules.component-B_8NQhQQ.mjs.map +0 -1
  74. package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-Wv7jtClz.mjs.map +0 -1
  75. package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-DuC1LDjl.mjs.map +0 -1
  76. package/fesm2022/ngx-t-forms-form-section-stepper.component-DGqSwAYD.mjs +0 -243
  77. package/fesm2022/ngx-t-forms-form-section-stepper.component-DGqSwAYD.mjs.map +0 -1
  78. package/fesm2022/ngx-t-forms-input-editor.component-D18kU0fT.mjs +0 -147
  79. package/fesm2022/ngx-t-forms-input-editor.component-D18kU0fT.mjs.map +0 -1
  80. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-qzR-rM4E.mjs.map +0 -1
  81. package/fesm2022/ngx-t-forms-mat-slider-editor.component-pVWgzc5_.mjs.map +0 -1
  82. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-Ddy1-Jgp.mjs.map +0 -1
  83. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-BxyJB21G.mjs +0 -280
  84. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-BxyJB21G.mjs.map +0 -1
  85. package/fesm2022/ngx-t-forms-ngx-t-forms-Biy_6-DN.mjs.map +0 -1
  86. package/fesm2022/ngx-t-forms-pipeline-generator.component-DfjnUdcM.mjs.map +0 -1
  87. package/fesm2022/ngx-t-forms-required-inputs.component-0l94qfKx.mjs +0 -187
  88. package/fesm2022/ngx-t-forms-required-inputs.component-0l94qfKx.mjs.map +0 -1
  89. package/fesm2022/ngx-t-forms-rest-api-call-setup.component-DmII4rB1.mjs.map +0 -1
  90. package/fesm2022/ngx-t-forms-selection-options-editor.component-C8KaRaIJ.mjs +0 -143
  91. package/fesm2022/ngx-t-forms-selection-options-editor.component-C8KaRaIJ.mjs.map +0 -1
  92. package/fesm2022/ngx-t-forms-validators-config.component-DEZQOMZx.mjs +0 -216
  93. package/fesm2022/ngx-t-forms-validators-config.component-DEZQOMZx.mjs.map +0 -1
@@ -0,0 +1,145 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Output, Input, HostBinding, Optional, Self, Component } from '@angular/core';
3
+ import * as i2$1 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i1 from '@angular/forms';
6
+ import { FormGroup, FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
7
+ import { v4 } from 'uuid';
8
+ import _ from 'lodash';
9
+ import { M as MatModulesModule } from './ngx-t-forms-ngx-t-forms-fgu62eR1.mjs';
10
+ import { MatFormFieldControl } from '@angular/material/form-field';
11
+ import { Subject } from 'rxjs';
12
+ import * as i2 from '@angular/material/button';
13
+ import * as i3 from '@angular/material/card';
14
+ import * as i4 from '@angular/material/chips';
15
+ import * as i6 from '@angular/material/icon';
16
+ import * as i3$1 from '@angular/material/select';
17
+ import * as i9 from '@angular/material/toolbar';
18
+ import * as i12 from '@angular/material/input';
19
+
20
+ class SelectionOptionsEditorComponent {
21
+ static { this.nextId = 0; }
22
+ constructor(ngControl, _elementRef) {
23
+ this.ngControl = ngControl;
24
+ this._elementRef = _elementRef;
25
+ this.stateChanges = new Subject();
26
+ this.errors = [];
27
+ this.id = `app-selection-options-editor-${SelectionOptionsEditorComponent.nextId++}`;
28
+ this.placeholder = '';
29
+ this.focused = false;
30
+ this.required = false;
31
+ this.disabled = false;
32
+ this.touched = false;
33
+ this.onTouched = () => { };
34
+ this._options = [];
35
+ this.valueChanged = new EventEmitter();
36
+ }
37
+ get empty() {
38
+ return !this.value;
39
+ }
40
+ get shouldLabelFloat() {
41
+ return this.focused || !this.empty;
42
+ }
43
+ get errorState() {
44
+ const hasError = !!this.ngControl?.control?.errors || (this.errors || []).length > 0 && this.touched;
45
+ return !this.value && !!this.required || hasError;
46
+ }
47
+ setDescribedByIds(ids) {
48
+ // Ensure the component view is initialized
49
+ if (this._elementRef && this._elementRef.nativeElement) {
50
+ const controlElement = this._elementRef.nativeElement.querySelector('.app-selection-options-editor');
51
+ // Check if the controlElement exists before attempting to set its attribute
52
+ if (controlElement) {
53
+ controlElement.setAttribute('aria-describedby', ids.join(' '));
54
+ }
55
+ }
56
+ }
57
+ onContainerClick(event) {
58
+ this.markAsTouched();
59
+ this.stateChanges.next();
60
+ }
61
+ markAsTouched() {
62
+ console.log('markAsTouched');
63
+ if (!this.touched) {
64
+ this.onTouched();
65
+ this.touched = true;
66
+ }
67
+ }
68
+ get options() {
69
+ return this._options || [];
70
+ }
71
+ set options(val) {
72
+ if (!!Array.isArray(val)) {
73
+ this._options = val;
74
+ }
75
+ }
76
+ add() {
77
+ this.inEdit = {};
78
+ this.createForm(this.inEdit);
79
+ }
80
+ remove(option) {
81
+ this.options = this.removeObjectById(this.options, option.id);
82
+ this.valueChanged.emit(this.options);
83
+ }
84
+ createForm(inEdit) {
85
+ this.form = new FormGroup({
86
+ label: new FormControl(inEdit.label || '', Validators.required),
87
+ value: new FormControl(inEdit.value || '', Validators.required),
88
+ });
89
+ }
90
+ closeEdit() {
91
+ this.inEdit = null;
92
+ }
93
+ save() {
94
+ const id = this.inEdit?.id;
95
+ if (!!id) {
96
+ this.options = this.overrideObjectById(this.options, { ...this.inEdit, ...this.form.value });
97
+ this.closeEdit();
98
+ this.valueChanged.emit(this.options);
99
+ return;
100
+ }
101
+ this.options = this.addObjectToArray(this.options, { ...this.inEdit, ...this.form.value, id: v4() });
102
+ this.closeEdit();
103
+ console.log(this.options);
104
+ this.valueChanged.emit(this.options);
105
+ }
106
+ overrideObjectById(array, newObj) {
107
+ const index = _.findIndex(array, { id: newObj.id });
108
+ if (index !== -1) {
109
+ array[index] = newObj;
110
+ }
111
+ return array;
112
+ }
113
+ addObjectToArray(array, newObj) {
114
+ if (!_.some(array, { id: newObj.id })) {
115
+ array.push(newObj);
116
+ }
117
+ return array;
118
+ }
119
+ removeObjectById(array, id) {
120
+ return _.reject(array, { id: id });
121
+ }
122
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: SelectionOptionsEditorComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
123
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: SelectionOptionsEditorComponent, isStandalone: true, selector: "app-selection-options-editor", inputs: { errors: "errors", disabled: "disabled", options: "options" }, outputs: { valueChanged: "valueChanged" }, host: { properties: { "id": "this.id" } }, providers: [{ provide: MatFormFieldControl, useExisting: SelectionOptionsEditorComponent }], ngImport: i0, template: "\r\n <mat-chip-listbox aria-label=\"Fish selection\" [disabled]=\"disabled\">\r\n @for (option of options||[]; track option.id) {\r\n <mat-chip-option \r\n (removed)=\"remove(option)\"\r\n (click)=\"this.inEdit?.id === option?.id? this.inEdit = undefined :this.inEdit = option\"\r\n color=\"accent\" \r\n [value]=\"option?.value\"\r\n [selected]=\"this.inEdit?.id === option?.id\">{{option?.label}}\r\n <button matChipRemove [attr.aria-label]=\"'remove ' \">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n <mat-toolbar *ngIf=\"!inEdit\">\r\n <button style=\"width:100%\" mat-stroked-button (click)=\"add()\">\r\n Add an option <mat-icon>add</mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n <mat-card *ngIf=\"!!inEdit\">\r\n <mat-card-header>\r\n <mat-card-title>Edit Option</mat-card-title>\r\n <mat-card-subtitle>Modify Option Details</mat-card-subtitle>\r\n </mat-card-header>\r\n\r\n <mat-card-content style=\"padding-top:16px ;\" >\r\n \r\n <form *ngIf=\"!!form\" [formGroup]=\"form\">\r\n <mat-form-field >\r\n <mat-label>label</mat-label>\r\n <input type=\"text\" matInput formControlName=\"label\" \r\n placeholder=\"enter option label\">\r\n <mat-hint>Label is required!</mat-hint>\r\n </mat-form-field>\r\n <mat-form-field >\r\n <mat-label>value</mat-label>\r\n <input type=\"text\" matInput formControlName=\"value\" \r\n placeholder=\"enter option value\">\r\n <mat-hint>value is required!</mat-hint>\r\n </mat-form-field>\r\n \r\n </form>\r\n \r\n </mat-card-content>\r\n <mat-card-actions>\r\n <button mat-button (click)=\"closeEdit()\">close</button>\r\n <button mat-button [disabled]=\"form.invalid\" (click)=\"save()\">Save</button>\r\n </mat-card-actions>\r\n </mat-card>\r\n ", styles: ["mat-form-field{width:100%!important;background:azure}\n"], dependencies: [{ kind: "ngmodule", type: MatModulesModule }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i3.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i3.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i3.MatCardSubtitle, selector: "mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]" }, { kind: "directive", type: i3.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i4.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i4.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "directive", type: i4.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: i9.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { 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: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
124
+ }
125
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: SelectionOptionsEditorComponent, decorators: [{
126
+ type: Component,
127
+ args: [{ selector: 'app-selection-options-editor', standalone: true, imports: [MatModulesModule, ReactiveFormsModule, CommonModule], providers: [{ provide: MatFormFieldControl, useExisting: SelectionOptionsEditorComponent }], template: "\r\n <mat-chip-listbox aria-label=\"Fish selection\" [disabled]=\"disabled\">\r\n @for (option of options||[]; track option.id) {\r\n <mat-chip-option \r\n (removed)=\"remove(option)\"\r\n (click)=\"this.inEdit?.id === option?.id? this.inEdit = undefined :this.inEdit = option\"\r\n color=\"accent\" \r\n [value]=\"option?.value\"\r\n [selected]=\"this.inEdit?.id === option?.id\">{{option?.label}}\r\n <button matChipRemove [attr.aria-label]=\"'remove ' \">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n <mat-toolbar *ngIf=\"!inEdit\">\r\n <button style=\"width:100%\" mat-stroked-button (click)=\"add()\">\r\n Add an option <mat-icon>add</mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n <mat-card *ngIf=\"!!inEdit\">\r\n <mat-card-header>\r\n <mat-card-title>Edit Option</mat-card-title>\r\n <mat-card-subtitle>Modify Option Details</mat-card-subtitle>\r\n </mat-card-header>\r\n\r\n <mat-card-content style=\"padding-top:16px ;\" >\r\n \r\n <form *ngIf=\"!!form\" [formGroup]=\"form\">\r\n <mat-form-field >\r\n <mat-label>label</mat-label>\r\n <input type=\"text\" matInput formControlName=\"label\" \r\n placeholder=\"enter option label\">\r\n <mat-hint>Label is required!</mat-hint>\r\n </mat-form-field>\r\n <mat-form-field >\r\n <mat-label>value</mat-label>\r\n <input type=\"text\" matInput formControlName=\"value\" \r\n placeholder=\"enter option value\">\r\n <mat-hint>value is required!</mat-hint>\r\n </mat-form-field>\r\n \r\n </form>\r\n \r\n </mat-card-content>\r\n <mat-card-actions>\r\n <button mat-button (click)=\"closeEdit()\">close</button>\r\n <button mat-button [disabled]=\"form.invalid\" (click)=\"save()\">Save</button>\r\n </mat-card-actions>\r\n </mat-card>\r\n ", styles: ["mat-form-field{width:100%!important;background:azure}\n"] }]
128
+ }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
129
+ type: Optional
130
+ }, {
131
+ type: Self
132
+ }] }, { type: i0.ElementRef }], propDecorators: { errors: [{
133
+ type: Input
134
+ }], id: [{
135
+ type: HostBinding
136
+ }], disabled: [{
137
+ type: Input
138
+ }], options: [{
139
+ type: Input
140
+ }], valueChanged: [{
141
+ type: Output
142
+ }] } });
143
+
144
+ export { SelectionOptionsEditorComponent };
145
+ //# sourceMappingURL=ngx-t-forms-selection-options-editor.component-CSTV4Hqm.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-t-forms-selection-options-editor.component-CSTV4Hqm.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/selection-options-editor/selection-options-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/selection-options-editor/selection-options-editor.component.html"],"sourcesContent":["import { Component, ElementRef, EventEmitter, HostBinding, Input, Optional, Output, Self } from '@angular/core';\r\n\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormControl, FormGroup, NgControl, ReactiveFormsModule, Validators } from '@angular/forms';\r\nimport { v4 as uuidv4 } from 'uuid';\r\nimport _ from 'lodash';\r\nimport { MatModulesModule } from '../../../../shared/modules/mat-modules.module';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { Subject } from 'rxjs';\r\nimport { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\n\r\n@Component({\r\n selector: 'app-selection-options-editor',\r\n standalone: true,\r\n imports: [MatModulesModule, ReactiveFormsModule, CommonModule],\r\n providers: [{ provide: MatFormFieldControl, useExisting:SelectionOptionsEditorComponent }],\r\n templateUrl: './selection-options-editor.component.html',\r\n styleUrl: './selection-options-editor.component.scss'\r\n})\r\nexport class SelectionOptionsEditorComponent implements MatFormFieldControl<any> {\r\n value: any;\r\n static nextId = 0;\r\n stateChanges = new Subject<void>();\r\n @Input() errors:IConfigElementError[] |undefined = [];\r\n @HostBinding() id = `app-selection-options-editor-${SelectionOptionsEditorComponent.nextId++}`;\r\n \r\n placeholder: string = ''\r\n constructor(@Optional() @Self() public ngControl: NgControl, private _elementRef: ElementRef<HTMLElement>,) { }\r\n focused: boolean = false;\r\n get empty() {\r\n return !this.value\r\n }\r\n get shouldLabelFloat() {\r\n return this.focused || !this.empty;\r\n }\r\n required: boolean = false;\r\n @Input() disabled: boolean = false;\r\nget errorState(): boolean {\r\n const hasError = !!this.ngControl?.control?.errors || (this.errors||[]).length > 0 && this.touched\r\n return !this.value && !!this.required || hasError\r\n }\r\n\r\n controlType?: string | undefined;\r\n autofilled?: boolean | undefined;\r\n userAriaDescribedBy?: string | undefined;\r\n disableAutomaticLabeling?: boolean | undefined;\r\n setDescribedByIds(ids: string[]) {\r\n // Ensure the component view is initialized\r\n if (this._elementRef && this._elementRef.nativeElement) {\r\n const controlElement = this._elementRef.nativeElement.querySelector('.app-selection-options-editor');\r\n // Check if the controlElement exists before attempting to set its attribute\r\n if (controlElement) {\r\n controlElement.setAttribute('aria-describedby', ids.join(' '));\r\n }\r\n }\r\n }\r\n onContainerClick(event: MouseEvent): void {\r\n this.markAsTouched();\r\n this.stateChanges.next();\r\n }\r\n\r\n touched: boolean = false;\r\n onTouched = () => {};\r\n markAsTouched() {\r\n console.log('markAsTouched') \r\n if (!this.touched) {\r\n this.onTouched();\r\n this.touched = true;\r\n }\r\n } \r\n\r\n\r\n \r\n private _options: any = []\r\n @Input() get options(){\r\n return this._options || []\r\n }\r\n\r\n set options(val){\r\n if(!!Array.isArray(val)){\r\n this._options = val\r\n }\r\n }\r\n\r\n@Output() valueChanged = new EventEmitter<any>()\r\n\r\n inEdit:any\r\n\r\n form!:FormGroup\r\n add(){\r\n this.inEdit = {}\r\n this.createForm(this.inEdit)\r\n\r\n }\r\n remove(option:any){\r\n this.options = this.removeObjectById(this.options, option.id)\r\n this.valueChanged.emit(this.options)\r\n }\r\n createForm(inEdit:any){\r\n\r\n this.form = new FormGroup({\r\n label: new FormControl( inEdit.label||'', Validators.required),\r\n value: new FormControl(inEdit.value||'', Validators.required),\r\n\r\n });\r\n }\r\n closeEdit(){\r\n this.inEdit = null\r\n }\r\n\r\n save(){\r\n const id = this.inEdit?.id\r\n if(!!id){\r\n this.options = this.overrideObjectById(this.options, {...this.inEdit, ...this.form.value})\r\n this.closeEdit()\r\n this.valueChanged.emit(this.options)\r\n return\r\n }\r\n this.options = this.addObjectToArray(this.options, {...this.inEdit, ...this.form.value, id: uuidv4()})\r\n this.closeEdit()\r\n console.log(this.options)\r\n this.valueChanged.emit(this.options)\r\n\r\n }\r\n\r\n overrideObjectById(array: any[], newObj: any): any[] {\r\n const index = _.findIndex(array, { id: newObj.id });\r\n if (index !== -1) {\r\n array[index] = newObj;\r\n }\r\n return array;\r\n }\r\n \r\n addObjectToArray(array: any[], newObj: any): any[] {\r\n if (!_.some(array, { id: newObj.id })) {\r\n array.push(newObj);\r\n }\r\n return array;\r\n }\r\n \r\n removeObjectById(array: any[], id: number): any[] {\r\n return _.reject(array, { id: id });\r\n }\r\n}","\r\n <mat-chip-listbox aria-label=\"Fish selection\" [disabled]=\"disabled\">\r\n @for (option of options||[]; track option.id) {\r\n <mat-chip-option \r\n (removed)=\"remove(option)\"\r\n (click)=\"this.inEdit?.id === option?.id? this.inEdit = undefined :this.inEdit = option\"\r\n color=\"accent\" \r\n [value]=\"option?.value\"\r\n [selected]=\"this.inEdit?.id === option?.id\">{{option?.label}}\r\n <button matChipRemove [attr.aria-label]=\"'remove ' \">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n <mat-toolbar *ngIf=\"!inEdit\">\r\n <button style=\"width:100%\" mat-stroked-button (click)=\"add()\">\r\n Add an option <mat-icon>add</mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n <mat-card *ngIf=\"!!inEdit\">\r\n <mat-card-header>\r\n <mat-card-title>Edit Option</mat-card-title>\r\n <mat-card-subtitle>Modify Option Details</mat-card-subtitle>\r\n </mat-card-header>\r\n\r\n <mat-card-content style=\"padding-top:16px ;\" >\r\n \r\n <form *ngIf=\"!!form\" [formGroup]=\"form\">\r\n <mat-form-field >\r\n <mat-label>label</mat-label>\r\n <input type=\"text\" matInput formControlName=\"label\" \r\n placeholder=\"enter option label\">\r\n <mat-hint>Label is required!</mat-hint>\r\n </mat-form-field>\r\n <mat-form-field >\r\n <mat-label>value</mat-label>\r\n <input type=\"text\" matInput formControlName=\"value\" \r\n placeholder=\"enter option value\">\r\n <mat-hint>value is required!</mat-hint>\r\n </mat-form-field>\r\n \r\n </form>\r\n \r\n </mat-card-content>\r\n <mat-card-actions>\r\n <button mat-button (click)=\"closeEdit()\">close</button>\r\n <button mat-button [disabled]=\"form.invalid\" (click)=\"save()\">Save</button>\r\n </mat-card-actions>\r\n </mat-card>\r\n "],"names":["uuidv4","i5","i6","i7","i8","i9"],"mappings":";;;;;;;;;;;;;;;;;;;MAmBa,+BAA+B,CAAA;aAEnC,IAAM,CAAA,MAAA,GAAG,CAAH,CAAK;IAMlB,WAAuC,CAAA,SAAoB,EAAU,WAAoC,EAAA;QAAlE,IAAS,CAAA,SAAA,GAAT,SAAS;QAAqB,IAAW,CAAA,WAAA,GAAX,WAAW;AALhF,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,OAAO,EAAQ;QACzB,IAAM,CAAA,MAAA,GAAoC,EAAE;AACtC,QAAA,IAAA,CAAA,EAAE,GAAG,CAAgC,6BAAA,EAAA,+BAA+B,CAAC,MAAM,EAAE,EAAE;QAE9F,IAAW,CAAA,WAAA,GAAW,EAAE;QA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AE,CAAC,EAAA,QAAA,EAAA,shEAAA,EAAA,MAAA,EAAA,CAAA,yDAAA,CAAA,EAAA;;0BAY7E;;0BAAY;kEAJhB,MAAM,EAAA,CAAA;sBAAd;gBACc,EAAE,EAAA,CAAA;sBAAhB;gBAYO,QAAQ,EAAA,CAAA;sBAAhB;gBAsCa,OAAO,EAAA,CAAA;sBAAnB;gBAUO,YAAY,EAAA,CAAA;sBAArB;;;;;"}
@@ -0,0 +1,218 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Output, Input, HostBinding, Optional, Self, Component } from '@angular/core';
3
+ import { v4 } from 'uuid';
4
+ import { ElementTypes } from 'ngx-t-forms-types';
5
+ import { g as getInputIllustration } from './ngx-t-forms-getInputIllustration-GCSKx5e5.mjs';
6
+ import * as i2$1 from '@angular/common';
7
+ import { CommonModule } from '@angular/common';
8
+ import { FormInputSelectorComponent } from './ngx-t-forms-form-input-selector.component-BqJ7H_C5.mjs';
9
+ import * as i1 from '@angular/forms';
10
+ import { FormsModule } from '@angular/forms';
11
+ import { M as MatModulesModule } from './ngx-t-forms-ngx-t-forms-fgu62eR1.mjs';
12
+ import { MatFormFieldControl } from '@angular/material/form-field';
13
+ import { Subject } from 'rxjs';
14
+ import * as i2 from '@angular/material/button';
15
+ import * as i3 from '@angular/material/card';
16
+ import * as i4 from '@angular/material/chips';
17
+ import * as i4$1 from '@angular/material/divider';
18
+ import * as i6 from '@angular/material/icon';
19
+ import * as i6$1 from '@angular/material/list';
20
+ import * as i3$1 from '@angular/material/select';
21
+ import * as i9 from '@angular/material/slide-toggle';
22
+ import * as i9$1 from '@angular/material/toolbar';
23
+ import * as i8 from '@angular/material/tooltip';
24
+ import * as i12 from '@angular/material/input';
25
+
26
+ class ValidatorsConfigComponent {
27
+ static { this.nextId = 0; }
28
+ constructor(ngControl, _elementRef) {
29
+ this.ngControl = ngControl;
30
+ this._elementRef = _elementRef;
31
+ this.stateChanges = new Subject();
32
+ this.id = `app-validators-config-${ValidatorsConfigComponent.nextId++}`;
33
+ this.placeholder = '';
34
+ this.focused = false;
35
+ this.required = false;
36
+ this.disabled = false;
37
+ this.errors = [];
38
+ this.touched = false;
39
+ this.onTouched = () => { };
40
+ this.mapToData = undefined;
41
+ this.formInputs = [];
42
+ this.valueChanged = new EventEmitter();
43
+ this.showVariables = false;
44
+ this.search = '';
45
+ }
46
+ get empty() {
47
+ return !this.value;
48
+ }
49
+ get shouldLabelFloat() {
50
+ return this.focused || !this.empty;
51
+ }
52
+ get errorState() {
53
+ const hasError = !!this.ngControl?.control?.errors || (this.errors || []).length > 0 && this.touched;
54
+ return !this.value && !!this.required || hasError;
55
+ }
56
+ setDescribedByIds(ids) {
57
+ // Ensure the component view is initialized
58
+ if (this._elementRef && this._elementRef.nativeElement) {
59
+ const controlElement = this._elementRef.nativeElement.querySelector('.app-validators-config');
60
+ // Check if the controlElement exists before attempting to set its attribute
61
+ if (controlElement) {
62
+ controlElement.setAttribute('aria-describedby', ids.join(' '));
63
+ }
64
+ }
65
+ }
66
+ onContainerClick(event) {
67
+ this.markAsTouched();
68
+ this.stateChanges.next();
69
+ }
70
+ markAsTouched() {
71
+ console.log('markAsTouched');
72
+ if (!this.touched) {
73
+ this.onTouched();
74
+ this.touched = true;
75
+ }
76
+ }
77
+ ngOnInit() { }
78
+ menuClosed(event) {
79
+ if (this.edit) {
80
+ const editIndex = this.value.findIndex((item) => {
81
+ if (typeof item === 'string') {
82
+ return false;
83
+ }
84
+ return item.id === this.edit?.id;
85
+ });
86
+ if (editIndex !== -1) {
87
+ this.value[editIndex] = this.edit;
88
+ }
89
+ this.valueChanged.emit([...this.value]);
90
+ }
91
+ this.edit = undefined;
92
+ }
93
+ editV(validator) {
94
+ if (this.edit?.id === validator.id) {
95
+ this.edit = undefined;
96
+ return;
97
+ }
98
+ this.edit = validator;
99
+ }
100
+ remove(validator) {
101
+ const indexOfV = this.value.findIndex((item) => {
102
+ if (typeof item === 'string') {
103
+ return item === validator;
104
+ }
105
+ return item.id === validator.id;
106
+ });
107
+ this.value = [...this.value].filter((item, i) => indexOfV !== i);
108
+ this.valueChanged.emit([...this.value]);
109
+ }
110
+ getInputIcon(element) {
111
+ return getInputIllustration(element);
112
+ }
113
+ selectInput(inputId) {
114
+ const input = this.formInputs.find((input) => input.id === inputId);
115
+ if (!input) {
116
+ return;
117
+ }
118
+ if (input?.multipleInputInEditId) {
119
+ throw new Error('multipleInputInEditId is not supported');
120
+ }
121
+ if (!!this.edit) {
122
+ this.edit.expression = (this.edit?.expression || '').concat(input?.formControlName || '');
123
+ if (!this.edit.inputsObservedForChanges.find((i) => i.inputId === (input?.originalId || input?.id))) {
124
+ this.edit.inputsObservedForChanges.push({
125
+ inputId: input?.originalId || input?.id,
126
+ variable: input?.formControlName
127
+ });
128
+ }
129
+ }
130
+ this.showVariables = false;
131
+ }
132
+ addVariable(event) {
133
+ this.showVariables = true;
134
+ event.stopPropagation();
135
+ event.preventDefault();
136
+ }
137
+ getMultipleFormInputs(input) {
138
+ if (input.element === ElementTypes.MultipleInput &&
139
+ this.mapToData?.multipleInputInEditId === input.id) {
140
+ return input.formInputs;
141
+ }
142
+ return [];
143
+ }
144
+ returnExpression() {
145
+ return this.edit?.expression.replace(/(word)/g, '<span style=\'color: blue\'>$1</span>');
146
+ }
147
+ addValidator() {
148
+ this.edit = {
149
+ message: '',
150
+ expression: '',
151
+ canOverride: false,
152
+ inputsObservedForChanges: []
153
+ };
154
+ }
155
+ onTextChange(event, key) {
156
+ if (!this.edit) {
157
+ this.edit = {};
158
+ }
159
+ this.edit[key] = event.target.value;
160
+ }
161
+ saveVariable(event) {
162
+ console.log(this.edit);
163
+ if (!this.edit)
164
+ return;
165
+ const id = v4();
166
+ const val = { ...this.edit, id };
167
+ this.value = [...this.value, val];
168
+ this.valueChanged.emit([...this.value]);
169
+ this.edit = undefined;
170
+ }
171
+ removeObserved(event, item) {
172
+ const i = this.edit?.inputsObservedForChanges.findIndex((i) => i === item);
173
+ if (i !== undefined && i !== -1 && this.edit) {
174
+ this.edit?.inputsObservedForChanges.splice(i, 1);
175
+ this.edit.expression = this.edit?.expression.replace(new RegExp(`\\b${item}\\b`, 'g'), '');
176
+ }
177
+ event.stopPropagation();
178
+ event.preventDefault();
179
+ }
180
+ isFormControlCustomValidator(validator) {
181
+ if (typeof validator == 'string') {
182
+ return validator;
183
+ }
184
+ return validator.message;
185
+ }
186
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: ValidatorsConfigComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
187
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: ValidatorsConfigComponent, isStandalone: true, selector: "app-validators-config", inputs: { disabled: "disabled", errors: "errors", mapToData: "mapToData", value: "value", formInputs: "formInputs" }, outputs: { valueChanged: "valueChanged" }, host: { properties: { "id": "this.id" } }, providers: [{ provide: MatFormFieldControl, useExisting: ValidatorsConfigComponent }], ngImport: i0, template: "<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\">\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\">\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", styles: [".mat-mdc-menu-panel.mat-mdc-menu-panel{min-width:500px!important}mat-form-field{width:100%;background:azure}.tree-instructions{display:flex;align-items:center;gap:8px;padding:12px;background:azure;border-radius:4px;margin-bottom:16px}.info-icon{min-width:38px}mat-chip{cursor:pointer!important}\n"], dependencies: [{ kind: "ngmodule", type: MatModulesModule }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i4.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "component", type: i4.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i4.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "directive", type: i4.MatChipRemove, selector: "[matChipRemove]" }, { kind: "directive", type: i4.MatChipTrailingIcon, selector: "mat-chip-trailing-icon, [matChipTrailingIcon]" }, { kind: "component", type: i4$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6$1.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: i9.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "component", type: i9$1.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: 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: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2$1.TitleCasePipe, name: "titlecase" }, { kind: "component", type: FormInputSelectorComponent, selector: "lib-form-input-selector", inputs: ["errors", "value", "formInputs", "disabled"], outputs: ["change"] }, { 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]" }] }); }
188
+ }
189
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: ValidatorsConfigComponent, decorators: [{
190
+ type: Component,
191
+ args: [{ selector: 'app-validators-config', standalone: true, imports: [
192
+ MatModulesModule,
193
+ CommonModule,
194
+ FormInputSelectorComponent,
195
+ FormsModule
196
+ ], providers: [{ provide: MatFormFieldControl, useExisting: ValidatorsConfigComponent }], template: "<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\">\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\">\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", styles: [".mat-mdc-menu-panel.mat-mdc-menu-panel{min-width:500px!important}mat-form-field{width:100%;background:azure}.tree-instructions{display:flex;align-items:center;gap:8px;padding:12px;background:azure;border-radius:4px;margin-bottom:16px}.info-icon{min-width:38px}mat-chip{cursor:pointer!important}\n"] }]
197
+ }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
198
+ type: Optional
199
+ }, {
200
+ type: Self
201
+ }] }, { type: i0.ElementRef }], propDecorators: { id: [{
202
+ type: HostBinding
203
+ }], disabled: [{
204
+ type: Input
205
+ }], errors: [{
206
+ type: Input
207
+ }], mapToData: [{
208
+ type: Input
209
+ }], value: [{
210
+ type: Input
211
+ }], formInputs: [{
212
+ type: Input
213
+ }], valueChanged: [{
214
+ type: Output
215
+ }] } });
216
+
217
+ export { ValidatorsConfigComponent };
218
+ //# sourceMappingURL=ngx-t-forms-validators-config.component-I346eCwr.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-t-forms-validators-config.component-I346eCwr.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\">\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\">\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,OAAO,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK;;AAIvC,IAAA,IAAI,UAAU,GAAA;QACT,MAAM,QAAQ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_ACTIONS_TOKEN, l as FORM_CONFIG_TOKEN, n as FORM_INPUTS_TOKEN, m as FORM_SLIDES_TOKEN, s as FormBuilderComponent, c as FormTowerControllerService, r as FormsComponent, q as MSCOA_TREE_PROVIDER, o as MULTIPLE_FORM_INPUT_TOKEN, u as MscoaFormInputComponent, N as NGX_T_FORMS_CONFIG_TOKEN, h as NgxTFormsComponent, f as NgxTFormsService, P as PropertyAccessError, S as SignatureInputElementComponent, T as TDynamicDataEditComponent, b as TDynamicDataViewComponent, w as TFormInputComponent, U as UTILS_OBJECT_TOKEN, v as UserFormStepperComponent, a as assignDeepPropertyToObject, j as formGenerator, B as getUrl, i as initFormConfigToV2, p as provideNgxTForms, y as returnDeepProperty, z as safeReturnDeepProperty, C as textIconsForUserHints, A as validateObjectAgainstString } from './ngx-t-forms-ngx-t-forms-Biy_6-DN.mjs';
1
+ export { y as DialogTemplateComponent, l as FORM_ACTIONS_TOKEN, m as FORM_CONFIG_TOKEN, o as FORM_INPUTS_TOKEN, n as FORM_SLIDES_TOKEN, u as FormBuilderComponent, c as FormTowerControllerService, s as FormsComponent, r as MSCOA_TREE_PROVIDER, q as MULTIPLE_FORM_INPUT_TOKEN, v as MscoaFormInputComponent, N as NGX_T_FORMS_CONFIG_TOKEN, h as NgxTFormsComponent, f as NgxTFormsService, P as PropertyAccessError, S as SignatureInputElementComponent, T as TDynamicDataEditComponent, b as TDynamicDataViewComponent, x as TFormInputComponent, U as UTILS_OBJECT_TOKEN, w as UserFormStepperComponent, a as assignDeepPropertyToObject, j as formGenerator, k as getSectionElements, C as getUrl, i as initFormConfigToV2, p as provideNgxTForms, z as returnDeepProperty, A as safeReturnDeepProperty, E as textIconsForUserHints, B as validateObjectAgainstString } from './ngx-t-forms-ngx-t-forms-fgu62eR1.mjs';
2
2
  //# sourceMappingURL=ngx-t-forms.mjs.map
@@ -1,4 +1,4 @@
1
- import { OnInit } from '@angular/core';
1
+ import { ChangeDetectorRef, OnInit } from '@angular/core';
2
2
  import { Observable, Subject } from 'rxjs';
3
3
  import { StepperSelectionEvent, StepState } from '@angular/cdk/stepper';
4
4
  import { MatStepper } from '@angular/material/stepper';
@@ -58,6 +58,9 @@ export declare class FormSectionStepperComponent extends FormTowerControllerServ
58
58
  formDeleteInput: (item: FormColumnInputs) => void;
59
59
  openSectionReports: Record<string, boolean>;
60
60
  toggleSectionReports: (sectionId: string) => boolean;
61
+ ref: ChangeDetectorRef;
62
+ refresh(): void;
63
+ sectionIncludesDefault(columns: FormColumnInputs[]): boolean;
61
64
  static ɵfac: i0.ɵɵFactoryDeclaration<FormSectionStepperComponent, never>;
62
65
  static ɵcmp: i0.ɵɵComponentDeclaration<FormSectionStepperComponent, "app-form-section-stepper", never, {}, {}, never, never, true, never>;
63
66
  }
@@ -55,5 +55,5 @@ export declare class ApiValueAccessRulesComponent implements MatFormFieldControl
55
55
  private initializePostmanService;
56
56
  get postmanResponseBody(): any;
57
57
  static ɵfac: i0.ɵɵFactoryDeclaration<ApiValueAccessRulesComponent, [{ optional: true; self: true; }, null, null]>;
58
- static ɵcmp: i0.ɵɵComponentDeclaration<ApiValueAccessRulesComponent, "app-api-value-access-rules", never, { "multipleBind": { "alias": "multipleBind"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; "value": { "alias": "value"; "required": false; }; "mapToData": { "alias": "mapToData"; "required": false; }; "formInputs": { "alias": "formInputs"; "required": false; }; "postmanCollectionConfig": { "alias": "postmanCollectionConfig"; "required": false; }; }, { "valueChanged": "valueChanged"; "reload": "reload"; }, never, never, true, never>;
58
+ static ɵcmp: i0.ɵɵComponentDeclaration<ApiValueAccessRulesComponent, "app-api-value-access-rules", never, { "disabled": { "alias": "disabled"; "required": false; }; "multipleBind": { "alias": "multipleBind"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; "value": { "alias": "value"; "required": false; }; "mapToData": { "alias": "mapToData"; "required": false; }; "formInputs": { "alias": "formInputs"; "required": false; }; "postmanCollectionConfig": { "alias": "postmanCollectionConfig"; "required": false; }; }, { "valueChanged": "valueChanged"; "reload": "reload"; }, never, never, true, never>;
59
59
  }
@@ -88,5 +88,5 @@ export declare class CalculatedFieldRulesComponent implements OnInit, MatFormFie
88
88
  remove(variable: calculationVariableInterface): void;
89
89
  cancelVariableConfig(event: any): void;
90
90
  static ɵfac: i0.ɵɵFactoryDeclaration<CalculatedFieldRulesComponent, [{ optional: true; self: true; }, null]>;
91
- static ɵcmp: i0.ɵɵComponentDeclaration<CalculatedFieldRulesComponent, "app-calculated-field-rules", never, { "mapToData": { "alias": "mapToData"; "required": false; }; "value": { "alias": "value"; "required": false; }; "formInputs": { "alias": "formInputs"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; }, { "valueChange2dWithPath": "valueChange2dWithPath"; "valueChanged": "valueChanged"; }, never, never, true, never>;
91
+ static ɵcmp: i0.ɵɵComponentDeclaration<CalculatedFieldRulesComponent, "app-calculated-field-rules", never, { "disabled": { "alias": "disabled"; "required": false; }; "mapToData": { "alias": "mapToData"; "required": false; }; "value": { "alias": "value"; "required": false; }; "formInputs": { "alias": "formInputs"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; }, { "valueChange2dWithPath": "valueChange2dWithPath"; "valueChanged": "valueChanged"; }, never, never, true, never>;
92
92
  }
@@ -49,5 +49,5 @@ export declare class ChipOptionsCreatorEditorComponent implements MatFormFieldCo
49
49
  remove(segment: string): void;
50
50
  setValue(value: string[] | undefined): void;
51
51
  static ɵfac: i0.ɵɵFactoryDeclaration<ChipOptionsCreatorEditorComponent, [{ optional: true; self: true; }, null]>;
52
- static ɵcmp: i0.ɵɵComponentDeclaration<ChipOptionsCreatorEditorComponent, "lib-chip-options-creator-editor", never, { "errors": { "alias": "errors"; "required": false; }; "required": { "alias": "required"; "required": false; }; "value": { "alias": "value"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
52
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChipOptionsCreatorEditorComponent, "lib-chip-options-creator-editor", never, { "disabled": { "alias": "disabled"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; "required": { "alias": "required"; "required": false; }; "value": { "alias": "value"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
53
53
  }
@@ -68,6 +68,6 @@ export declare class ConfigMscoaAdditionalInputsComponent implements OnInit, Mat
68
68
  label: string;
69
69
  })[];
70
70
  static ɵfac: i0.ɵɵFactoryDeclaration<ConfigMscoaAdditionalInputsComponent, [{ optional: true; self: true; }, null]>;
71
- static ɵcmp: i0.ɵɵComponentDeclaration<ConfigMscoaAdditionalInputsComponent, "app-config-mscoa-additional-inputs", never, { "errors": { "alias": "errors"; "required": false; }; "getMscoaTree": { "alias": "getMscoaTree"; "required": false; }; "mapToData": { "alias": "mapToData"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "valueChanged": "valueChanged"; }, never, never, true, never>;
71
+ static ɵcmp: i0.ɵɵComponentDeclaration<ConfigMscoaAdditionalInputsComponent, "app-config-mscoa-additional-inputs", never, { "disabled": { "alias": "disabled"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; "getMscoaTree": { "alias": "getMscoaTree"; "required": false; }; "mapToData": { "alias": "mapToData"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "valueChanged": "valueChanged"; }, never, never, true, never>;
72
72
  }
73
73
  export {};