@igo2/common 21.0.0-next.4 → 21.0.0-next.40

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 (82) hide show
  1. package/fesm2022/igo2-common-action.mjs +16 -16
  2. package/fesm2022/igo2-common-action.mjs.map +1 -1
  3. package/fesm2022/igo2-common-backdrop.mjs +7 -7
  4. package/fesm2022/igo2-common-backdrop.mjs.map +1 -1
  5. package/fesm2022/igo2-common-badge.mjs +7 -7
  6. package/fesm2022/igo2-common-badge.mjs.map +1 -1
  7. package/fesm2022/igo2-common-clickout.mjs +7 -7
  8. package/fesm2022/igo2-common-clickout.mjs.map +1 -1
  9. package/fesm2022/igo2-common-clone.mjs +7 -7
  10. package/fesm2022/igo2-common-clone.mjs.map +1 -1
  11. package/fesm2022/igo2-common-collapsible.mjs +10 -10
  12. package/fesm2022/igo2-common-collapsible.mjs.map +1 -1
  13. package/fesm2022/igo2-common-color.mjs +8 -8
  14. package/fesm2022/igo2-common-color.mjs.map +1 -1
  15. package/fesm2022/igo2-common-confirm-dialog.mjs +10 -10
  16. package/fesm2022/igo2-common-confirm-dialog.mjs.map +1 -1
  17. package/fesm2022/igo2-common-context-menu.mjs +10 -10
  18. package/fesm2022/igo2-common-context-menu.mjs.map +1 -1
  19. package/fesm2022/igo2-common-custom-html.mjs +10 -10
  20. package/fesm2022/igo2-common-custom-html.mjs.map +1 -1
  21. package/fesm2022/igo2-common-datepicker.mjs +3 -3
  22. package/fesm2022/igo2-common-datepicker.mjs.map +1 -1
  23. package/fesm2022/igo2-common-dom.mjs +7 -7
  24. package/fesm2022/igo2-common-dom.mjs.map +1 -1
  25. package/fesm2022/igo2-common-drag-drop.mjs +31 -10
  26. package/fesm2022/igo2-common-drag-drop.mjs.map +1 -1
  27. package/fesm2022/igo2-common-dynamic-component.mjs +14 -14
  28. package/fesm2022/igo2-common-dynamic-component.mjs.map +1 -1
  29. package/fesm2022/igo2-common-entity.mjs +31 -31
  30. package/fesm2022/igo2-common-entity.mjs.map +1 -1
  31. package/fesm2022/igo2-common-flexible.mjs +17 -14
  32. package/fesm2022/igo2-common-flexible.mjs.map +1 -1
  33. package/fesm2022/igo2-common-form.mjs +811 -110
  34. package/fesm2022/igo2-common-form.mjs.map +1 -1
  35. package/fesm2022/igo2-common-home-button.mjs +7 -7
  36. package/fesm2022/igo2-common-home-button.mjs.map +1 -1
  37. package/fesm2022/igo2-common-icon.mjs +6 -6
  38. package/fesm2022/igo2-common-icon.mjs.map +1 -1
  39. package/fesm2022/igo2-common-image.mjs +10 -10
  40. package/fesm2022/igo2-common-image.mjs.map +1 -1
  41. package/fesm2022/igo2-common-interactive-tour.mjs +13 -13
  42. package/fesm2022/igo2-common-interactive-tour.mjs.map +1 -1
  43. package/fesm2022/igo2-common-json-dialog.mjs +10 -10
  44. package/fesm2022/igo2-common-json-dialog.mjs.map +1 -1
  45. package/fesm2022/igo2-common-keyvalue.mjs +7 -7
  46. package/fesm2022/igo2-common-keyvalue.mjs.map +1 -1
  47. package/fesm2022/igo2-common-list.mjs +10 -10
  48. package/fesm2022/igo2-common-list.mjs.map +1 -1
  49. package/fesm2022/igo2-common-panel.mjs +7 -7
  50. package/fesm2022/igo2-common-panel.mjs.map +1 -1
  51. package/fesm2022/igo2-common-resizable-bar.mjs +6 -6
  52. package/fesm2022/igo2-common-resizable-bar.mjs.map +1 -1
  53. package/fesm2022/igo2-common-sidenav.mjs +7 -7
  54. package/fesm2022/igo2-common-sidenav.mjs.map +1 -1
  55. package/fesm2022/igo2-common-spinner.mjs +10 -10
  56. package/fesm2022/igo2-common-spinner.mjs.map +1 -1
  57. package/fesm2022/igo2-common-stop-propagation.mjs +10 -10
  58. package/fesm2022/igo2-common-stop-propagation.mjs.map +1 -1
  59. package/fesm2022/igo2-common-table.mjs +7 -7
  60. package/fesm2022/igo2-common-table.mjs.map +1 -1
  61. package/fesm2022/igo2-common-timepicker.mjs +3 -3
  62. package/fesm2022/igo2-common-timepicker.mjs.map +1 -1
  63. package/fesm2022/igo2-common-tool.mjs +14 -14
  64. package/fesm2022/igo2-common-tool.mjs.map +1 -1
  65. package/fesm2022/igo2-common-widget.mjs +14 -14
  66. package/fesm2022/igo2-common-widget.mjs.map +1 -1
  67. package/fesm2022/igo2-common-workspace.mjs +18 -18
  68. package/fesm2022/igo2-common-workspace.mjs.map +1 -1
  69. package/fesm2022/igo2-common.mjs +0 -1
  70. package/fesm2022/igo2-common.mjs.map +1 -1
  71. package/locale/en.common.json +0 -7
  72. package/locale/fr.common.json +0 -7
  73. package/package.json +3 -7
  74. package/style/style.css +1 -1
  75. package/types/igo2-common-drag-drop.d.ts +3 -1
  76. package/types/igo2-common-entity.d.ts +2 -2
  77. package/types/igo2-common-flexible.d.ts +3 -2
  78. package/types/igo2-common-form.d.ts +365 -76
  79. package/types/igo2-common.d.ts +0 -1
  80. package/fesm2022/igo2-common-select-value-dialog.mjs +0 -155
  81. package/fesm2022/igo2-common-select-value-dialog.mjs.map +0 -1
  82. package/types/igo2-common-select-value-dialog.d.ts +0 -65
@@ -1,28 +1,68 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, output, viewChild, ChangeDetectionStrategy, Component, NgModule, Injectable, signal, inject, ChangeDetectorRef } from '@angular/core';
2
+ import { input, output, viewChild, ChangeDetectionStrategy, Component, NgModule, Injectable, inject, signal, ChangeDetectorRef, computed } from '@angular/core';
3
3
  import * as i3 from '@angular/forms';
4
- import { FormsModule, ReactiveFormsModule, UntypedFormBuilder, Validators } from '@angular/forms';
4
+ import { FormsModule, ReactiveFormsModule, NgForm, FormGroupDirective, FormGroup, FormControl, UntypedFormBuilder, Validators } from '@angular/forms';
5
5
  import { t } from 'typy';
6
6
  import { __decorate } from 'tslib';
7
- import { MatOptionModule } from '@angular/material/core';
7
+ import * as i4 from '@angular/material/checkbox';
8
+ import { MatCheckboxModule } from '@angular/material/checkbox';
9
+ import { ErrorStateMatcher, provideNativeDateAdapter, MatOptionModule } from '@angular/material/core';
8
10
  import * as i1 from '@angular/material/form-field';
9
11
  import { MatFormFieldModule } from '@angular/material/form-field';
10
- import * as i4 from '@angular/material/icon';
11
- import { MatIconModule } from '@angular/material/icon';
12
- import * as i2 from '@angular/material/select';
13
- import { MatSelectModule } from '@angular/material/select';
14
- import { IgoLanguageModule, LanguageService } from '@igo2/core/language';
12
+ import { IgoLanguageModule, labelAttribute, LanguageService } from '@igo2/core/language';
13
+ import { Subject, BehaviorSubject } from 'rxjs';
14
+ import { takeUntil } from 'rxjs/operators';
15
15
  import * as i5 from '@ngx-translate/core';
16
- import { AsyncPipe, NgClass } from '@angular/common';
17
- import * as i5$1 from '@angular/material/button';
16
+ import * as i8 from '@angular/material/button';
18
17
  import { MatButtonModule } from '@angular/material/button';
19
- import * as i2$1 from '@angular/material/input';
18
+ import * as i3$1 from '@angular/material/datepicker';
19
+ import { MatDatepickerModule } from '@angular/material/datepicker';
20
+ import * as i7 from '@angular/material/icon';
21
+ import { MatIconModule } from '@angular/material/icon';
22
+ import * as i2 from '@angular/material/input';
20
23
  import { MatInputModule } from '@angular/material/input';
21
- import { BehaviorSubject } from 'rxjs';
24
+ import * as i4$1 from '@angular/material/timepicker';
25
+ import { MatTimepickerModule } from '@angular/material/timepicker';
26
+ import * as i4$2 from '@angular/material/radio';
27
+ import { MatRadioModule } from '@angular/material/radio';
28
+ import * as i2$1 from '@angular/material/select';
29
+ import { MatSelectModule } from '@angular/material/select';
22
30
  import { DynamicOutletComponent } from '@igo2/common/dynamic-component';
23
- import { MatDialogRef, MAT_DIALOG_DATA, MatDialogTitle, MatDialogActions, MatDialog, MatDialogModule } from '@angular/material/dialog';
24
- import { CustomHtmlComponent } from '@igo2/common/custom-html';
31
+ import { NgClass, AsyncPipe } from '@angular/common';
32
+ import * as i1$1 from '@angular/material/stepper';
33
+ import { MatStepperModule } from '@angular/material/stepper';
34
+ import * as i6 from '@igo2/common/custom-html';
35
+ import { IgoCustomHtmlModule, CustomHtmlComponent } from '@igo2/common/custom-html';
36
+ import * as i1$2 from '@angular/material/dialog';
37
+ import { MatDialogRef, MAT_DIALOG_DATA, MatDialogTitle, MatDialogActions, MatDialogModule, MatDialog } from '@angular/material/dialog';
25
38
 
39
+ function buildFormFromConfig(formService, formConfig) {
40
+ const fields = [];
41
+ const groups = [];
42
+ formConfig?.formFieldConfigs?.forEach((config) => {
43
+ fields.push(formService.field(config));
44
+ });
45
+ formConfig?.formGroupsConfigs?.forEach((formGroupsConfig) => {
46
+ const groupFields = formGroupsConfig.formFieldConfigs?.map((config) => formService.field(config));
47
+ groups.push(formService.group({ name: formGroupsConfig.name }, groupFields));
48
+ });
49
+ return formService.form(fields, groups);
50
+ }
51
+ function markFormAsTouched(form) {
52
+ if (form.groups?.length) {
53
+ form.groups.forEach((group) => {
54
+ Object.keys(group.control.controls).forEach((key) => {
55
+ group.control.controls[key].markAsTouched();
56
+ group.control.controls[key].updateValueAndValidity();
57
+ });
58
+ });
59
+ return;
60
+ }
61
+ form.fields.forEach((field) => {
62
+ field.control.markAsTouched();
63
+ field.control.updateValueAndValidity();
64
+ });
65
+ }
26
66
  function formControlIsRequired(control) {
27
67
  if (control.validator) {
28
68
  const validator = control.validator({});
@@ -142,10 +182,10 @@ class FormComponent {
142
182
  clear() {
143
183
  this.form()?.control.reset();
144
184
  }
145
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
146
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.10", type: FormComponent, isStandalone: true, selector: "igo-form", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, formData: { classPropertyName: "formData", publicName: "formData", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitForm: "submitForm" }, viewQueries: [{ propertyName: "buttons", first: true, predicate: ["buttons"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<form\n [autocomplete]=\"autocomplete()\"\n [formGroup]=\"form().control\"\n (ngSubmit)=\"onSubmit()\"\n>\n <div class=\"igo-form-body\" [class.igo-form-body-with-buttons]=\"hasButtons\">\n <div class=\"igo-form-content\">\n <ng-content />\n </div>\n <div #buttons class=\"igo-form-buttons\">\n <ng-content select=\"[formButtons]\" />\n </div>\n </div>\n</form>\n", styles: [":host{display:block}form{width:100%;height:100%}.igo-form-body,.igo-form-content{height:100%}.igo-form-body-with-buttons .igo-form-content{height:calc(100% - 56px)}.igo-form-content{display:flex}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
185
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
186
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.24", type: FormComponent, isStandalone: true, selector: "igo-form", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, formData: { classPropertyName: "formData", publicName: "formData", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitForm: "submitForm" }, viewQueries: [{ propertyName: "buttons", first: true, predicate: ["buttons"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<form\n [autocomplete]=\"autocomplete()\"\n [formGroup]=\"form().control\"\n (ngSubmit)=\"onSubmit()\"\n>\n <div class=\"igo-form-body\" [class.igo-form-body-with-buttons]=\"hasButtons\">\n <div class=\"igo-form-content\">\n <ng-content />\n </div>\n <div #buttons class=\"igo-form-buttons\">\n <ng-content select=\"[formButtons]\" />\n </div>\n </div>\n</form>\n", styles: [":host{display:block}form{width:100%;height:100%}.igo-form-body,.igo-form-content{height:100%}.igo-form-body-with-buttons .igo-form-content{height:calc(100% - 56px)}.igo-form-content{display:flex}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
147
187
  }
148
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormComponent, decorators: [{
188
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormComponent, decorators: [{
149
189
  type: Component,
150
190
  args: [{ selector: 'igo-form', changeDetection: ChangeDetectionStrategy.OnPush, imports: [FormsModule, ReactiveFormsModule], template: "<form\n [autocomplete]=\"autocomplete()\"\n [formGroup]=\"form().control\"\n (ngSubmit)=\"onSubmit()\"\n>\n <div class=\"igo-form-body\" [class.igo-form-body-with-buttons]=\"hasButtons\">\n <div class=\"igo-form-content\">\n <ng-content />\n </div>\n <div #buttons class=\"igo-form-buttons\">\n <ng-content select=\"[formButtons]\" />\n </div>\n </div>\n</form>\n", styles: [":host{display:block}form{width:100%;height:100%}.igo-form-body,.igo-form-content{height:100%}.igo-form-body-with-buttons .igo-form-content{height:calc(100% - 56px)}.igo-form-content{display:flex}\n"] }]
151
191
  }], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: true }] }], formData: [{ type: i0.Input, args: [{ isSignal: true, alias: "formData", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], submitForm: [{ type: i0.Output, args: ["submitForm"] }], buttons: [{ type: i0.ViewChild, args: ['buttons', { isSignal: true }] }] } });
@@ -154,11 +194,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
154
194
  * @deprecated import the FormComponent directly
155
195
  */
156
196
  class IgoFormFormModule {
157
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoFormFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
158
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.10", ngImport: i0, type: IgoFormFormModule, imports: [FormComponent], exports: [FormComponent] });
159
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoFormFormModule, imports: [FormComponent] });
197
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: IgoFormFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
198
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.24", ngImport: i0, type: IgoFormFormModule, imports: [FormComponent], exports: [FormComponent] });
199
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: IgoFormFormModule, imports: [FormComponent] });
160
200
  }
161
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoFormFormModule, decorators: [{
201
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: IgoFormFormModule, decorators: [{
162
202
  type: NgModule,
163
203
  args: [{
164
204
  imports: [FormComponent],
@@ -182,10 +222,10 @@ class FormFieldService {
182
222
  getFieldByType(type) {
183
223
  return FormFieldService.fields[type];
184
224
  }
185
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormFieldService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
186
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormFieldService, providedIn: 'root' });
225
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
226
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldService, providedIn: 'root' });
187
227
  }
188
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormFieldService, decorators: [{
228
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldService, decorators: [{
189
229
  type: Injectable,
190
230
  args: [{
191
231
  providedIn: 'root'
@@ -198,6 +238,472 @@ function IgoFormFieldComponent(type) {
198
238
  };
199
239
  }
200
240
 
241
+ let FormFieldCheckboxComponent = class FormFieldCheckboxComponent {
242
+ errorStateMatcher = inject(ErrorStateMatcher);
243
+ parentForm = inject(NgForm, { optional: true });
244
+ parentFormGroup = inject(FormGroupDirective, { optional: true });
245
+ disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
246
+ showErrorState = signal(false, ...(ngDevMode ? [{ debugName: "showErrorState" }] : /* istanbul ignore next */ []));
247
+ selectedValues = signal([], ...(ngDevMode ? [{ debugName: "selectedValues" }] : /* istanbul ignore next */ []));
248
+ destroy$ = new Subject();
249
+ choices = input.required(...(ngDevMode ? [{ debugName: "choices" }] : /* istanbul ignore next */ []));
250
+ formControl = input.required(...(ngDevMode ? [{ debugName: "formControl" }] : /* istanbul ignore next */ []));
251
+ showLabel = input(false, ...(ngDevMode ? [{ debugName: "showLabel" }] : /* istanbul ignore next */ []));
252
+ placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
253
+ errors = input(...(ngDevMode ? [undefined, { debugName: "errors" }] : /* istanbul ignore next */ []));
254
+ maxSelected = input(...(ngDevMode ? [undefined, { debugName: "maxSelected" }] : /* istanbul ignore next */ []));
255
+ disableSwitch = input(false, ...(ngDevMode ? [{ debugName: "disableSwitch" }] : /* istanbul ignore next */ []));
256
+ get required() {
257
+ return formControlIsRequired(this.formControl());
258
+ }
259
+ ngOnInit() {
260
+ const control = this.formControl();
261
+ const maxSelected = this.maxSelected();
262
+ if (typeof maxSelected === 'number' && Number.isFinite(maxSelected)) {
263
+ control.addValidators(this.maxSelectedValidator(maxSelected));
264
+ }
265
+ const normalizedValue = this.normalizeValue(control.value);
266
+ control.setValue(normalizedValue, {
267
+ emitEvent: false
268
+ });
269
+ control.updateValueAndValidity({ emitEvent: false });
270
+ this.syncState(control);
271
+ control.events.pipe(takeUntil(this.destroy$)).subscribe(() => {
272
+ this.syncState(control);
273
+ });
274
+ }
275
+ ngOnDestroy() {
276
+ this.destroy$.next();
277
+ this.destroy$.complete();
278
+ }
279
+ getErrorMessage() {
280
+ const maxSelectedError = this.formControl().errors?.['maxSelected'];
281
+ if (maxSelectedError) {
282
+ return (this.errors()?.['maxSelected'] ||
283
+ `Select at most ${maxSelectedError.max} options.`);
284
+ }
285
+ return getControlErrorMessage(this.formControl(), this.errors() || {});
286
+ }
287
+ showError() {
288
+ return this.showErrorState();
289
+ }
290
+ isChecked(value) {
291
+ return this.selectedValues().some((selectedValue) => selectedValue === value);
292
+ }
293
+ onChoiceChange(value, event) {
294
+ const selectedValues = this.selectedValues();
295
+ const nextValues = event.checked
296
+ ? selectedValues.some((selectedValue) => selectedValue === value)
297
+ ? selectedValues
298
+ : [...selectedValues, value]
299
+ : selectedValues.filter((selectedValue) => selectedValue !== value);
300
+ this.formControl().setValue(nextValues);
301
+ this.formControl().markAsDirty();
302
+ this.formControl().markAsTouched();
303
+ }
304
+ onDisableSwitchClick() {
305
+ this.toggleDisabled();
306
+ }
307
+ normalizeValue(value) {
308
+ if (Array.isArray(value)) {
309
+ return value;
310
+ }
311
+ if (value === undefined || value === null || value === '') {
312
+ return [];
313
+ }
314
+ return [value];
315
+ }
316
+ syncState(control) {
317
+ this.disabled.set(control.disabled);
318
+ this.selectedValues.set(this.normalizeValue(control.value));
319
+ this.showErrorState.set(this.errorStateMatcher.isErrorState(control, this.parentFormGroup ?? this.parentForm));
320
+ }
321
+ toggleDisabled() {
322
+ const disabled = !this.disabled();
323
+ if (disabled === true) {
324
+ this.formControl().disable();
325
+ }
326
+ else {
327
+ this.formControl().enable();
328
+ }
329
+ this.disabled.set(disabled);
330
+ }
331
+ maxSelectedValidator(maxSelected) {
332
+ return (control) => {
333
+ const selectedValues = this.normalizeValue(control.value);
334
+ if (selectedValues.length <= maxSelected) {
335
+ return null;
336
+ }
337
+ return {
338
+ maxSelected: {
339
+ max: maxSelected,
340
+ actual: selectedValues.length
341
+ }
342
+ };
343
+ };
344
+ }
345
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
346
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: FormFieldCheckboxComponent, isStandalone: true, selector: "igo-form-field-checkbox", inputs: { choices: { classPropertyName: "choices", publicName: "choices", isSignal: true, isRequired: true, transformFunction: null }, formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, maxSelected: { classPropertyName: "maxSelected", publicName: "maxSelected", isSignal: true, isRequired: false, transformFunction: null }, disableSwitch: { classPropertyName: "disableSwitch", publicName: "disableSwitch", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"igo-form-field-choice-list\">\n @if (placeholder()) {\n <div class=\"igo-form-field-choice-label\">\n {{ placeholder() | translate }}\n </div>\n }\n\n <div class=\"igo-form-field-choice-options\">\n @for (choice of choices(); track choice.value) {\n <mat-checkbox\n [checked]=\"isChecked(choice.value)\"\n [disabled]=\"disabled()\"\n [required]=\"required\"\n (change)=\"onChoiceChange(choice.value, $event)\"\n >\n {{ choice.title }}\n </mat-checkbox>\n }\n </div>\n\n @if (disableSwitch() === true) {\n <mat-checkbox\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n [checked]=\"!disabled()\"\n [attr.aria-label]=\"'Toggle field availability'\"\n />\n }\n\n <mat-error [hidden]=\"!showError()\">\n {{ getErrorMessage() | translate }}\n </mat-error>\n</div>\n", styles: [":host{display:block;width:100%}.igo-form-field-choice-list{width:100%}.igo-form-field-choice-label{margin-bottom:8px;color:#000000de;font-size:1rem;line-height:1.25rem}::ng-deep .igo-form-field-choice-list mat-error{display:block;margin-top:6px;font-family:var(--mat-form-field-subscript-text-font, inherit);font-size:var(--mat-form-field-subscript-text-size, 12px);font-weight:var(--mat-form-field-subscript-text-weight, 400);line-height:var(--mat-form-field-subscript-text-line-height, 20px);letter-spacing:var(--mat-form-field-subscript-text-tracking, normal)}::ng-deep .igo-form-field-choice-list mat-error[hidden]{display:none}::ng-deep .igo-form-field-choice-list mat-radio-group,::ng-deep .igo-form-field-choice-list mat-checkbox{display:block}::ng-deep .igo-form-field-choice-list mat-radio-button{margin-right:16px}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }] });
347
+ };
348
+ FormFieldCheckboxComponent = __decorate([
349
+ IgoFormFieldComponent('checkbox')
350
+ ], FormFieldCheckboxComponent);
351
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldCheckboxComponent, decorators: [{
352
+ type: Component,
353
+ args: [{ selector: 'igo-form-field-checkbox', imports: [
354
+ ReactiveFormsModule,
355
+ MatCheckboxModule,
356
+ MatFormFieldModule,
357
+ IgoLanguageModule
358
+ ], template: "<div class=\"igo-form-field-choice-list\">\n @if (placeholder()) {\n <div class=\"igo-form-field-choice-label\">\n {{ placeholder() | translate }}\n </div>\n }\n\n <div class=\"igo-form-field-choice-options\">\n @for (choice of choices(); track choice.value) {\n <mat-checkbox\n [checked]=\"isChecked(choice.value)\"\n [disabled]=\"disabled()\"\n [required]=\"required\"\n (change)=\"onChoiceChange(choice.value, $event)\"\n >\n {{ choice.title }}\n </mat-checkbox>\n }\n </div>\n\n @if (disableSwitch() === true) {\n <mat-checkbox\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n [checked]=\"!disabled()\"\n [attr.aria-label]=\"'Toggle field availability'\"\n />\n }\n\n <mat-error [hidden]=\"!showError()\">\n {{ getErrorMessage() | translate }}\n </mat-error>\n</div>\n", styles: [":host{display:block;width:100%}.igo-form-field-choice-list{width:100%}.igo-form-field-choice-label{margin-bottom:8px;color:#000000de;font-size:1rem;line-height:1.25rem}::ng-deep .igo-form-field-choice-list mat-error{display:block;margin-top:6px;font-family:var(--mat-form-field-subscript-text-font, inherit);font-size:var(--mat-form-field-subscript-text-size, 12px);font-weight:var(--mat-form-field-subscript-text-weight, 400);line-height:var(--mat-form-field-subscript-text-line-height, 20px);letter-spacing:var(--mat-form-field-subscript-text-tracking, normal)}::ng-deep .igo-form-field-choice-list mat-error[hidden]{display:none}::ng-deep .igo-form-field-choice-list mat-radio-group,::ng-deep .igo-form-field-choice-list mat-checkbox{display:block}::ng-deep .igo-form-field-choice-list mat-radio-button{margin-right:16px}\n"] }]
359
+ }], propDecorators: { choices: [{ type: i0.Input, args: [{ isSignal: true, alias: "choices", required: true }] }], formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required: true }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], maxSelected: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSelected", required: false }] }], disableSwitch: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSwitch", required: false }] }] } });
360
+
361
+ let FormFieldDatetimeComponent = class FormFieldDatetimeComponent {
362
+ disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
363
+ dateTimeGroup = new FormGroup({
364
+ date: new FormControl(null),
365
+ time: new FormControl(null)
366
+ });
367
+ get dateControl() {
368
+ return this.dateTimeGroup.controls.date;
369
+ }
370
+ get timeControl() {
371
+ return this.dateTimeGroup.controls.time;
372
+ }
373
+ destroy$ = new Subject();
374
+ syncingExternalToInternal = false;
375
+ syncingInternalToExternal = false;
376
+ /**
377
+ * The field's form control
378
+ */
379
+ formControl = input.required(...(ngDevMode ? [{ debugName: "formControl" }] : /* istanbul ignore next */ []));
380
+ /**
381
+ * Field showLabel
382
+ */
383
+ showLabel = input(false, ...(ngDevMode ? [{ debugName: "showLabel" }] : /* istanbul ignore next */ []));
384
+ /**
385
+ * Field placeholder used for date input
386
+ */
387
+ placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
388
+ /**
389
+ * Placeholder used for time input
390
+ */
391
+ timePlaceholder = input(...(ngDevMode ? [undefined, { debugName: "timePlaceholder" }] : /* istanbul ignore next */ []));
392
+ /**
393
+ * Minimum selectable date
394
+ */
395
+ minDate = input(...(ngDevMode ? [undefined, { debugName: "minDate" }] : /* istanbul ignore next */ []));
396
+ /**
397
+ * Maximum selectable date
398
+ */
399
+ maxDate = input(...(ngDevMode ? [undefined, { debugName: "maxDate" }] : /* istanbul ignore next */ []));
400
+ /**
401
+ * Minimum selectable time
402
+ */
403
+ minTime = input(null, ...(ngDevMode ? [{ debugName: "minTime" }] : /* istanbul ignore next */ []));
404
+ /**
405
+ * Maximum selectable time
406
+ */
407
+ maxTime = input(null, ...(ngDevMode ? [{ debugName: "maxTime" }] : /* istanbul ignore next */ []));
408
+ /**
409
+ * Optional explicit options rendered in the timepicker panel.
410
+ */
411
+ options = input(null, ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
412
+ /**
413
+ * Time option interval for the panel.
414
+ */
415
+ interval = input(null, ...(ngDevMode ? [{ debugName: "interval" }] : /* istanbul ignore next */ []));
416
+ /**
417
+ * Whether clicking the input should open the timepicker.
418
+ */
419
+ openOnClick = input(true, ...(ngDevMode ? [{ debugName: "openOnClick" }] : /* istanbul ignore next */ []));
420
+ /**
421
+ * Whether a disable switch should be available
422
+ */
423
+ disableSwitch = input(false, ...(ngDevMode ? [{ debugName: "disableSwitch" }] : /* istanbul ignore next */ []));
424
+ /**
425
+ * Error messages mapping
426
+ */
427
+ errors = input(...(ngDevMode ? [undefined, { debugName: "errors" }] : /* istanbul ignore next */ []));
428
+ /**
429
+ * Whether the field is required
430
+ */
431
+ get required() {
432
+ return formControlIsRequired(this.formControl());
433
+ }
434
+ ngOnInit() {
435
+ this.disabled.set(this.formControl().disabled);
436
+ this.syncInternalFromExternal(this.formControl().value);
437
+ this.formControl()
438
+ .valueChanges.pipe(takeUntil(this.destroy$))
439
+ .subscribe((value) => {
440
+ if (this.syncingInternalToExternal) {
441
+ return;
442
+ }
443
+ this.syncInternalFromExternal(value);
444
+ });
445
+ this.formControl()
446
+ .statusChanges.pipe(takeUntil(this.destroy$))
447
+ .subscribe(() => {
448
+ const isDisabled = this.formControl().disabled;
449
+ this.disabled.set(isDisabled);
450
+ if (isDisabled) {
451
+ this.dateTimeGroup.disable({ emitEvent: false });
452
+ }
453
+ else {
454
+ this.dateTimeGroup.enable({ emitEvent: false });
455
+ this.updateTimeControlState();
456
+ }
457
+ });
458
+ this.dateTimeGroup.valueChanges
459
+ .pipe(takeUntil(this.destroy$))
460
+ .subscribe(() => {
461
+ this.updateTimeControlState();
462
+ this.pushInternalToExternal();
463
+ });
464
+ if (this.formControl().disabled) {
465
+ this.dateTimeGroup.disable({ emitEvent: false });
466
+ }
467
+ }
468
+ ngOnDestroy() {
469
+ this.destroy$.next();
470
+ this.destroy$.complete();
471
+ }
472
+ getErrorMessage() {
473
+ return getControlErrorMessage(this.formControl(), this.errors() || {});
474
+ }
475
+ clearDate() {
476
+ this.dateControl.setValue(null);
477
+ }
478
+ clearTime() {
479
+ this.timeControl.setValue(null);
480
+ }
481
+ onDisableSwitchClick() {
482
+ const disabled = !this.disabled();
483
+ if (disabled) {
484
+ this.formControl().disable();
485
+ }
486
+ else {
487
+ this.formControl().enable();
488
+ }
489
+ this.disabled.set(disabled);
490
+ }
491
+ syncInternalFromExternal(value) {
492
+ const externalDate = this.toDateValue(value);
493
+ this.syncingExternalToInternal = true;
494
+ this.dateTimeGroup.patchValue({
495
+ date: externalDate ? new Date(externalDate) : null,
496
+ time: externalDate ? new Date(externalDate) : null
497
+ }, { emitEvent: false });
498
+ this.syncingExternalToInternal = false;
499
+ this.updateTimeControlState();
500
+ }
501
+ pushInternalToExternal() {
502
+ if (this.syncingExternalToInternal) {
503
+ return;
504
+ }
505
+ const { date: datePart, time: timeValue } = this.dateTimeGroup.getRawValue();
506
+ if (!datePart) {
507
+ if (this.formControl().value !== null) {
508
+ this.syncingInternalToExternal = true;
509
+ this.formControl().setValue(null);
510
+ this.syncingInternalToExternal = false;
511
+ }
512
+ return;
513
+ }
514
+ const sourceTime = timeValue;
515
+ const next = new Date(datePart);
516
+ next.setHours(sourceTime?.getHours() ?? 0, sourceTime?.getMinutes() ?? 0, sourceTime?.getSeconds() ?? 0, 0);
517
+ this.syncingInternalToExternal = true;
518
+ this.formControl().setValue(next);
519
+ this.syncingInternalToExternal = false;
520
+ }
521
+ updateTimeControlState() {
522
+ const hasDate = !!this.dateControl.value;
523
+ if (!hasDate && this.timeControl.enabled) {
524
+ this.timeControl.disable({ emitEvent: false });
525
+ }
526
+ else if (hasDate && this.timeControl.disabled && !this.disabled()) {
527
+ this.timeControl.enable({ emitEvent: false });
528
+ }
529
+ }
530
+ toDateValue(value) {
531
+ if (value instanceof Date) {
532
+ return Number.isNaN(value.getTime()) ? null : value;
533
+ }
534
+ if (typeof value === 'number' && Number.isFinite(value)) {
535
+ const date = new Date(value);
536
+ return Number.isNaN(date.getTime()) ? null : date;
537
+ }
538
+ if (typeof value === 'string' && value.trim().length > 0) {
539
+ const date = new Date(value);
540
+ return Number.isNaN(date.getTime()) ? null : date;
541
+ }
542
+ return null;
543
+ }
544
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldDatetimeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
545
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: FormFieldDatetimeComponent, isStandalone: true, selector: "igo-form-field-datetime", inputs: { formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, timePlaceholder: { classPropertyName: "timePlaceholder", publicName: "timePlaceholder", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, minTime: { classPropertyName: "minTime", publicName: "minTime", isSignal: true, isRequired: false, transformFunction: null }, maxTime: { classPropertyName: "maxTime", publicName: "maxTime", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, interval: { classPropertyName: "interval", publicName: "interval", isSignal: true, isRequired: false, transformFunction: null }, openOnClick: { classPropertyName: "openOnClick", publicName: "openOnClick", isSignal: true, isRequired: false, transformFunction: null }, disableSwitch: { classPropertyName: "disableSwitch", publicName: "disableSwitch", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideNativeDateAdapter()], ngImport: i0, template: "<div class=\"igo-form-field-datetime-row\">\n <mat-form-field class=\"igo-form-field-datetime-part\">\n @if (showLabel() === true) {\n <mat-label>{{ placeholder() | translate }}</mat-label>\n }\n\n <input\n matInput\n readonly=\"true\"\n [matDatepicker]=\"datePicker\"\n [required]=\"required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"dateControl\"\n [min]=\"minDate() ?? null\"\n [max]=\"maxDate() ?? null\"\n />\n @if (dateControl.value && !disabled()) {\n <button matIconSuffix mat-icon-button type=\"button\" (click)=\"clearDate()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n <mat-datepicker-toggle matIconSuffix [for]=\"datePicker\" />\n <mat-datepicker #datePicker />\n @if (disableSwitch() === true) {\n <mat-checkbox\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n [checked]=\"!disabled()\"\n matPrefix\n />\n }\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n </mat-form-field>\n\n <mat-form-field class=\"igo-form-field-datetime-part\">\n <mat-label>{{ timePlaceholder() | translate }}</mat-label>\n\n <input\n matInput\n readonly=\"true\"\n [matTimepicker]=\"timePicker\"\n [required]=\"required\"\n [placeholder]=\"timePlaceholder() | translate\"\n [formControl]=\"timeControl\"\n [matTimepickerMin]=\"minTime()\"\n [matTimepickerMax]=\"maxTime()\"\n [matTimepickerOpenOnClick]=\"openOnClick()\"\n />\n\n @if (timeControl.value && !disabled() && !timeControl.disabled) {\n <button\n matIconSuffix\n mat-icon-button\n type=\"button\"\n (click)=\"$event.stopPropagation(); clearTime()\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n <mat-timepicker-toggle matIconSuffix [for]=\"timePicker\" />\n <mat-timepicker #timePicker [interval]=\"interval()\" [options]=\"options()\" />\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n </mat-form-field>\n</div>\n", styles: [":host{display:block}.igo-form-field-datetime-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start}.igo-form-field-datetime-part{width:100%;min-width:0}:host ::ng-deep .igo-form-field-datetime-part .mat-mdc-form-field-icon-suffix{display:inline-flex;align-items:center;white-space:nowrap;line-height:1}:host ::ng-deep .igo-form-field-datetime-part .mat-mdc-form-field-icon-suffix .mat-mdc-icon-button,:host ::ng-deep .igo-form-field-datetime-part .mat-mdc-form-field-icon-suffix .mat-mdc-icon-button.mat-mdc-button-base{margin:0}@media(max-width:767px){.igo-form-field-datetime-row{grid-template-columns:1fr}}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.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: MatDatepickerModule }, { kind: "component", type: i3$1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i3$1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i3$1.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: MatTimepickerModule }, { kind: "component", type: i4$1.MatTimepicker, selector: "mat-timepicker", inputs: ["interval", "options", "disableRipple", "aria-label", "aria-labelledby", "panelClass"], outputs: ["selected", "opened", "closed"], exportAs: ["matTimepicker"] }, { kind: "directive", type: i4$1.MatTimepickerInput, selector: "input[matTimepicker]", inputs: ["value", "matTimepicker", "matTimepickerMin", "matTimepickerMax", "matTimepickerOpenOnClick", "disabled"], outputs: ["valueChange"], exportAs: ["matTimepickerInput"] }, { kind: "component", type: i4$1.MatTimepickerToggle, selector: "mat-timepicker-toggle", inputs: ["for", "aria-label", "aria-labelledby", "disabled", "tabIndex", "disableRipple"], exportAs: ["matTimepickerToggle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i8.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
546
+ };
547
+ FormFieldDatetimeComponent = __decorate([
548
+ IgoFormFieldComponent('datetime')
549
+ ], FormFieldDatetimeComponent);
550
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldDatetimeComponent, decorators: [{
551
+ type: Component,
552
+ args: [{ selector: 'igo-form-field-datetime', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
553
+ MatFormFieldModule,
554
+ MatInputModule,
555
+ MatDatepickerModule,
556
+ MatTimepickerModule,
557
+ FormsModule,
558
+ ReactiveFormsModule,
559
+ MatCheckboxModule,
560
+ MatIconModule,
561
+ MatButtonModule,
562
+ IgoLanguageModule
563
+ ], providers: [provideNativeDateAdapter()], template: "<div class=\"igo-form-field-datetime-row\">\n <mat-form-field class=\"igo-form-field-datetime-part\">\n @if (showLabel() === true) {\n <mat-label>{{ placeholder() | translate }}</mat-label>\n }\n\n <input\n matInput\n readonly=\"true\"\n [matDatepicker]=\"datePicker\"\n [required]=\"required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"dateControl\"\n [min]=\"minDate() ?? null\"\n [max]=\"maxDate() ?? null\"\n />\n @if (dateControl.value && !disabled()) {\n <button matIconSuffix mat-icon-button type=\"button\" (click)=\"clearDate()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n <mat-datepicker-toggle matIconSuffix [for]=\"datePicker\" />\n <mat-datepicker #datePicker />\n @if (disableSwitch() === true) {\n <mat-checkbox\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n [checked]=\"!disabled()\"\n matPrefix\n />\n }\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n </mat-form-field>\n\n <mat-form-field class=\"igo-form-field-datetime-part\">\n <mat-label>{{ timePlaceholder() | translate }}</mat-label>\n\n <input\n matInput\n readonly=\"true\"\n [matTimepicker]=\"timePicker\"\n [required]=\"required\"\n [placeholder]=\"timePlaceholder() | translate\"\n [formControl]=\"timeControl\"\n [matTimepickerMin]=\"minTime()\"\n [matTimepickerMax]=\"maxTime()\"\n [matTimepickerOpenOnClick]=\"openOnClick()\"\n />\n\n @if (timeControl.value && !disabled() && !timeControl.disabled) {\n <button\n matIconSuffix\n mat-icon-button\n type=\"button\"\n (click)=\"$event.stopPropagation(); clearTime()\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n <mat-timepicker-toggle matIconSuffix [for]=\"timePicker\" />\n <mat-timepicker #timePicker [interval]=\"interval()\" [options]=\"options()\" />\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n </mat-form-field>\n</div>\n", styles: [":host{display:block}.igo-form-field-datetime-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start}.igo-form-field-datetime-part{width:100%;min-width:0}:host ::ng-deep .igo-form-field-datetime-part .mat-mdc-form-field-icon-suffix{display:inline-flex;align-items:center;white-space:nowrap;line-height:1}:host ::ng-deep .igo-form-field-datetime-part .mat-mdc-form-field-icon-suffix .mat-mdc-icon-button,:host ::ng-deep .igo-form-field-datetime-part .mat-mdc-form-field-icon-suffix .mat-mdc-icon-button.mat-mdc-button-base{margin:0}@media(max-width:767px){.igo-form-field-datetime-row{grid-template-columns:1fr}}\n"] }]
564
+ }], propDecorators: { formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required: true }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], timePlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "timePlaceholder", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], minTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "minTime", required: false }] }], maxTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxTime", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], interval: [{ type: i0.Input, args: [{ isSignal: true, alias: "interval", required: false }] }], openOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "openOnClick", required: false }] }], disableSwitch: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSwitch", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }] } });
565
+
566
+ /**
567
+ * This component renders a number field
568
+ */
569
+ let FormFieldNumberComponent = class FormFieldNumberComponent {
570
+ disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
571
+ hide = true;
572
+ /**
573
+ * The field's form control
574
+ */
575
+ formControl = input.required(...(ngDevMode ? [{ debugName: "formControl" }] : /* istanbul ignore next */ []));
576
+ /**
577
+ * Field showLabel
578
+ */
579
+ showLabel = input(false, ...(ngDevMode ? [{ debugName: "showLabel" }] : /* istanbul ignore next */ []));
580
+ /**
581
+ * Field placeholder
582
+ */
583
+ placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
584
+ /**
585
+ * Field placeholder
586
+ */
587
+ errors = input(...(ngDevMode ? [undefined, { debugName: "errors" }] : /* istanbul ignore next */ []));
588
+ /**
589
+ * Wheter a disable switch should be available
590
+ */
591
+ disableSwitch = input(false, ...(ngDevMode ? [{ debugName: "disableSwitch" }] : /* istanbul ignore next */ []));
592
+ /**
593
+ * Whether the field is required
594
+ */
595
+ get required() {
596
+ return formControlIsRequired(this.formControl());
597
+ }
598
+ ngOnInit() {
599
+ this.disabled.set(this.formControl().disabled);
600
+ }
601
+ /**
602
+ * Get error message
603
+ */
604
+ getErrorMessage() {
605
+ return getControlErrorMessage(this.formControl(), this.errors() || {});
606
+ }
607
+ onDisableSwitchClick() {
608
+ this.toggleDisabled();
609
+ }
610
+ toggleDisabled() {
611
+ const disabled = !this.disabled();
612
+ if (disabled === true) {
613
+ this.formControl().disable();
614
+ }
615
+ else {
616
+ this.formControl().enable();
617
+ }
618
+ this.disabled.set(disabled);
619
+ }
620
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
621
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: FormFieldNumberComponent, isStandalone: true, selector: "igo-form-field-number", inputs: { formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, disableSwitch: { classPropertyName: "disableSwitch", publicName: "disableSwitch", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-form-field>\n @if (showLabel() === true) {\n <mat-label>{{ placeholder() | translate }}</mat-label>\n }\n <input\n matInput\n type=\"number\"\n [required]=\"required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n />\n @if (disableSwitch() === true) {\n <mat-checkbox\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n [checked]=\"!disabled()\"\n matPrefix\n />\n }\n\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n", dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.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: FormsModule }, { kind: "directive", type: i3.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: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
622
+ };
623
+ FormFieldNumberComponent = __decorate([
624
+ IgoFormFieldComponent('number')
625
+ ], FormFieldNumberComponent);
626
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldNumberComponent, decorators: [{
627
+ type: Component,
628
+ args: [{ selector: 'igo-form-field-number', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
629
+ MatFormFieldModule,
630
+ MatInputModule,
631
+ FormsModule,
632
+ ReactiveFormsModule,
633
+ MatCheckboxModule,
634
+ MatButtonModule,
635
+ IgoLanguageModule
636
+ ], template: "<mat-form-field>\n @if (showLabel() === true) {\n <mat-label>{{ placeholder() | translate }}</mat-label>\n }\n <input\n matInput\n type=\"number\"\n [required]=\"required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n />\n @if (disableSwitch() === true) {\n <mat-checkbox\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n [checked]=\"!disabled()\"\n matPrefix\n />\n }\n\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n" }]
637
+ }], propDecorators: { formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required: true }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], disableSwitch: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSwitch", required: false }] }] } });
638
+
639
+ let FormFieldRadiobuttonComponent = class FormFieldRadiobuttonComponent {
640
+ errorStateMatcher = inject(ErrorStateMatcher);
641
+ parentForm = inject(NgForm, { optional: true });
642
+ parentFormGroup = inject(FormGroupDirective, { optional: true });
643
+ disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
644
+ showErrorState = signal(false, ...(ngDevMode ? [{ debugName: "showErrorState" }] : /* istanbul ignore next */ []));
645
+ destroy$ = new Subject();
646
+ choices = input.required(...(ngDevMode ? [{ debugName: "choices" }] : /* istanbul ignore next */ []));
647
+ formControl = input.required(...(ngDevMode ? [{ debugName: "formControl" }] : /* istanbul ignore next */ []));
648
+ showLabel = input(false, ...(ngDevMode ? [{ debugName: "showLabel" }] : /* istanbul ignore next */ []));
649
+ placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
650
+ errors = input(...(ngDevMode ? [undefined, { debugName: "errors" }] : /* istanbul ignore next */ []));
651
+ disableSwitch = input(false, ...(ngDevMode ? [{ debugName: "disableSwitch" }] : /* istanbul ignore next */ []));
652
+ get required() {
653
+ return formControlIsRequired(this.formControl());
654
+ }
655
+ ngOnInit() {
656
+ const control = this.formControl();
657
+ this.syncState(control);
658
+ control.events.pipe(takeUntil(this.destroy$)).subscribe(() => {
659
+ this.syncState(control);
660
+ });
661
+ }
662
+ ngOnDestroy() {
663
+ this.destroy$.next();
664
+ this.destroy$.complete();
665
+ }
666
+ getErrorMessage() {
667
+ return getControlErrorMessage(this.formControl(), this.errors() || {});
668
+ }
669
+ showError() {
670
+ return this.showErrorState();
671
+ }
672
+ onDisableSwitchClick() {
673
+ this.toggleDisabled();
674
+ }
675
+ syncState(control) {
676
+ this.disabled.set(control.disabled);
677
+ this.showErrorState.set(this.errorStateMatcher.isErrorState(control, this.parentFormGroup ?? this.parentForm));
678
+ }
679
+ toggleDisabled() {
680
+ const disabled = !this.disabled();
681
+ if (disabled === true) {
682
+ this.formControl().disable();
683
+ }
684
+ else {
685
+ this.formControl().enable();
686
+ }
687
+ this.disabled.set(disabled);
688
+ }
689
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldRadiobuttonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
690
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: FormFieldRadiobuttonComponent, isStandalone: true, selector: "igo-form-field-radiobutton", inputs: { choices: { classPropertyName: "choices", publicName: "choices", isSignal: true, isRequired: true, transformFunction: null }, formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, disableSwitch: { classPropertyName: "disableSwitch", publicName: "disableSwitch", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"igo-form-field-choice-list\">\n @if (placeholder()) {\n <div class=\"igo-form-field-choice-label\">\n {{ placeholder() | translate }}\n </div>\n }\n\n <mat-radio-group\n class=\"igo-form-field-choice-options\"\n [formControl]=\"formControl()\"\n [required]=\"required\"\n >\n @for (choice of choices(); track choice.value) {\n <mat-radio-button [value]=\"choice.value\" [disabled]=\"disabled()\">\n {{ choice.title }}\n </mat-radio-button>\n }\n </mat-radio-group>\n\n @if (disableSwitch() === true) {\n <mat-checkbox\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n [checked]=\"!disabled()\"\n [attr.aria-label]=\"'Toggle field availability'\"\n />\n }\n\n <mat-error [hidden]=\"!showError()\">\n {{ getErrorMessage() | translate }}\n </mat-error>\n</div>\n", styles: [":host{display:block;width:100%}.igo-form-field-choice-list{width:100%}.igo-form-field-choice-label{margin-bottom:8px;color:#000000de;font-size:1rem;line-height:1.25rem}::ng-deep .igo-form-field-choice-list mat-error{display:block;margin-top:6px;font-family:var(--mat-form-field-subscript-text-font, inherit);font-size:var(--mat-form-field-subscript-text-size, 12px);font-weight:var(--mat-form-field-subscript-text-weight, 400);line-height:var(--mat-form-field-subscript-text-line-height, 20px);letter-spacing:var(--mat-form-field-subscript-text-tracking, normal)}::ng-deep .igo-form-field-choice-list mat-error[hidden]{display:none}::ng-deep .igo-form-field-choice-list mat-radio-group,::ng-deep .igo-form-field-choice-list mat-checkbox{display:block}::ng-deep .igo-form-field-choice-list mat-radio-button{margin-right:16px}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "directive", type: i4$2.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i4$2.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }] });
691
+ };
692
+ FormFieldRadiobuttonComponent = __decorate([
693
+ IgoFormFieldComponent('radiobuttons'),
694
+ IgoFormFieldComponent('radiobutton')
695
+ ], FormFieldRadiobuttonComponent);
696
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldRadiobuttonComponent, decorators: [{
697
+ type: Component,
698
+ args: [{ selector: 'igo-form-field-radiobutton', imports: [
699
+ ReactiveFormsModule,
700
+ MatCheckboxModule,
701
+ MatFormFieldModule,
702
+ MatRadioModule,
703
+ IgoLanguageModule
704
+ ], template: "<div class=\"igo-form-field-choice-list\">\n @if (placeholder()) {\n <div class=\"igo-form-field-choice-label\">\n {{ placeholder() | translate }}\n </div>\n }\n\n <mat-radio-group\n class=\"igo-form-field-choice-options\"\n [formControl]=\"formControl()\"\n [required]=\"required\"\n >\n @for (choice of choices(); track choice.value) {\n <mat-radio-button [value]=\"choice.value\" [disabled]=\"disabled()\">\n {{ choice.title }}\n </mat-radio-button>\n }\n </mat-radio-group>\n\n @if (disableSwitch() === true) {\n <mat-checkbox\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n [checked]=\"!disabled()\"\n [attr.aria-label]=\"'Toggle field availability'\"\n />\n }\n\n <mat-error [hidden]=\"!showError()\">\n {{ getErrorMessage() | translate }}\n </mat-error>\n</div>\n", styles: [":host{display:block;width:100%}.igo-form-field-choice-list{width:100%}.igo-form-field-choice-label{margin-bottom:8px;color:#000000de;font-size:1rem;line-height:1.25rem}::ng-deep .igo-form-field-choice-list mat-error{display:block;margin-top:6px;font-family:var(--mat-form-field-subscript-text-font, inherit);font-size:var(--mat-form-field-subscript-text-size, 12px);font-weight:var(--mat-form-field-subscript-text-weight, 400);line-height:var(--mat-form-field-subscript-text-line-height, 20px);letter-spacing:var(--mat-form-field-subscript-text-tracking, normal)}::ng-deep .igo-form-field-choice-list mat-error[hidden]{display:none}::ng-deep .igo-form-field-choice-list mat-radio-group,::ng-deep .igo-form-field-choice-list mat-checkbox{display:block}::ng-deep .igo-form-field-choice-list mat-radio-button{margin-right:16px}\n"] }]
705
+ }], propDecorators: { choices: [{ type: i0.Input, args: [{ isSignal: true, alias: "choices", required: true }] }], formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required: true }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], disableSwitch: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSwitch", required: false }] }] } });
706
+
201
707
  /**
202
708
  * This component renders a select field
203
709
  */
@@ -215,6 +721,10 @@ let FormFieldSelectComponent = class FormFieldSelectComponent {
215
721
  * The field's form control
216
722
  */
217
723
  formControl = input.required(...(ngDevMode ? [{ debugName: "formControl" }] : /* istanbul ignore next */ []));
724
+ /**
725
+ * Field showLabel
726
+ */
727
+ showLabel = input(false, ...(ngDevMode ? [{ debugName: "showLabel" }] : /* istanbul ignore next */ []));
218
728
  /**
219
729
  * Field placeholder
220
730
  */
@@ -255,13 +765,13 @@ let FormFieldSelectComponent = class FormFieldSelectComponent {
255
765
  }
256
766
  this.disabled.set(disabled);
257
767
  }
258
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormFieldSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
259
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormFieldSelectComponent, isStandalone: true, selector: "igo-form-field-select", inputs: { choices: { classPropertyName: "choices", publicName: "choices", isSignal: true, isRequired: true, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, disableSwitch: { classPropertyName: "disableSwitch", publicName: "disableSwitch", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-form-field>\n <mat-select\n [multiple]=\"multiple()\"\n [required]=\"required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n >\n @for (choice of choices(); track choice) {\n <mat-option [value]=\"choice.value\">\n {{ choice.title }}\n </mat-option>\n }\n </mat-select>\n @if (disableSwitch() === true) {\n <mat-icon\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n matPrefix\n >{{ disabled() === true ? 'check_box_outline_blank' : 'check_box' }}\n </mat-icon>\n }\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n", dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
768
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
769
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: FormFieldSelectComponent, isStandalone: true, selector: "igo-form-field-select", inputs: { choices: { classPropertyName: "choices", publicName: "choices", isSignal: true, isRequired: true, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, disableSwitch: { classPropertyName: "disableSwitch", publicName: "disableSwitch", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-form-field>\n @if (showLabel() === true) {\n <mat-label>{{ placeholder() | translate }}</mat-label>\n }\n <mat-select\n [multiple]=\"multiple()\"\n [required]=\"required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n >\n @for (choice of choices(); track choice) {\n <mat-option [value]=\"choice.value\">\n {{ choice.title }}\n </mat-option>\n }\n </mat-select>\n @if (disableSwitch() === true) {\n <mat-checkbox\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n [checked]=\"!disabled()\"\n matPrefix\n />\n }\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n", dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i2$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
260
770
  };
261
771
  FormFieldSelectComponent = __decorate([
262
772
  IgoFormFieldComponent('select')
263
773
  ], FormFieldSelectComponent);
264
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormFieldSelectComponent, decorators: [{
774
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldSelectComponent, decorators: [{
265
775
  type: Component,
266
776
  args: [{ selector: 'igo-form-field-select', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
267
777
  MatFormFieldModule,
@@ -269,23 +779,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
269
779
  FormsModule,
270
780
  ReactiveFormsModule,
271
781
  MatOptionModule,
272
- MatIconModule,
782
+ MatCheckboxModule,
273
783
  IgoLanguageModule
274
- ], template: "<mat-form-field>\n <mat-select\n [multiple]=\"multiple()\"\n [required]=\"required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n >\n @for (choice of choices(); track choice) {\n <mat-option [value]=\"choice.value\">\n {{ choice.title }}\n </mat-option>\n }\n </mat-select>\n @if (disableSwitch() === true) {\n <mat-icon\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n matPrefix\n >{{ disabled() === true ? 'check_box_outline_blank' : 'check_box' }}\n </mat-icon>\n }\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n" }]
275
- }], propDecorators: { choices: [{ type: i0.Input, args: [{ isSignal: true, alias: "choices", required: true }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], disableSwitch: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSwitch", required: false }] }] } });
784
+ ], template: "<mat-form-field>\n @if (showLabel() === true) {\n <mat-label>{{ placeholder() | translate }}</mat-label>\n }\n <mat-select\n [multiple]=\"multiple()\"\n [required]=\"required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n >\n @for (choice of choices(); track choice) {\n <mat-option [value]=\"choice.value\">\n {{ choice.title }}\n </mat-option>\n }\n </mat-select>\n @if (disableSwitch() === true) {\n <mat-checkbox\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n [checked]=\"!disabled()\"\n matPrefix\n />\n }\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n" }]
785
+ }], propDecorators: { choices: [{ type: i0.Input, args: [{ isSignal: true, alias: "choices", required: true }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required: true }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], disableSwitch: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSwitch", required: false }] }] } });
276
786
 
277
787
  /**
278
788
  * This component renders a text field
279
789
  */
280
790
  let FormFieldTextComponent = class FormFieldTextComponent {
281
791
  cdRef = inject(ChangeDetectorRef);
282
- disabled$ = new BehaviorSubject(false);
792
+ disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
283
793
  hide = true;
284
794
  lastTimeoutRequest;
285
795
  /**
286
796
  * The field's form control
287
797
  */
288
798
  formControl = input.required(...(ngDevMode ? [{ debugName: "formControl" }] : /* istanbul ignore next */ []));
799
+ /**
800
+ * Field showLabel
801
+ */
802
+ showLabel = input(false, ...(ngDevMode ? [{ debugName: "showLabel" }] : /* istanbul ignore next */ []));
289
803
  /**
290
804
  * Field placeholder
291
805
  */
@@ -309,7 +823,7 @@ let FormFieldTextComponent = class FormFieldTextComponent {
309
823
  return formControlIsRequired(this.formControl());
310
824
  }
311
825
  ngOnInit() {
312
- this.disabled$.next(this.formControl().disabled);
826
+ this.disabled.set(this.formControl().disabled);
313
827
  }
314
828
  /**
315
829
  * Get error message
@@ -321,14 +835,14 @@ let FormFieldTextComponent = class FormFieldTextComponent {
321
835
  this.toggleDisabled();
322
836
  }
323
837
  toggleDisabled() {
324
- const disabled = !this.disabled$.value;
838
+ const disabled = !this.disabled();
325
839
  if (disabled === true) {
326
840
  this.formControl().disable();
327
841
  }
328
842
  else {
329
843
  this.formControl().enable();
330
844
  }
331
- this.disabled$.next(disabled);
845
+ this.disabled.set(disabled);
332
846
  }
333
847
  togglePassword() {
334
848
  this.hide = !this.hide;
@@ -345,13 +859,13 @@ let FormFieldTextComponent = class FormFieldTextComponent {
345
859
  }, delayMS);
346
860
  }
347
861
  }
348
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormFieldTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
349
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormFieldTextComponent, isStandalone: true, selector: "igo-form-field-text", inputs: { formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, isPassword: { classPropertyName: "isPassword", publicName: "isPassword", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, disableSwitch: { classPropertyName: "disableSwitch", publicName: "disableSwitch", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-form-field>\n <input\n matInput\n (blur)=\"delayedHide(0)\"\n [type]=\"isPassword() ? (hide ? 'password' : 'text') : 'text'\"\n [required]=\"isPassword() ? 'true' : required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n (change)=\"delayedHide()\"\n />\n @if (disableSwitch() === true) {\n <mat-icon\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n matPrefix\n >{{\n (disabled$ | async) === true ? 'check_box_outline_blank' : 'check_box'\n }}\n </mat-icon>\n }\n\n @if (isPassword()) {\n <button type=\"button\" matSuffix mat-icon-button (click)=\"togglePassword()\">\n <mat-icon color=\"primary\">{{\n hide ? 'visibility_off' : 'visibility'\n }}</mat-icon>\n </button>\n }\n\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n", dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$1.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: FormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
862
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
863
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: FormFieldTextComponent, isStandalone: true, selector: "igo-form-field-text", inputs: { formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, isPassword: { classPropertyName: "isPassword", publicName: "isPassword", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, disableSwitch: { classPropertyName: "disableSwitch", publicName: "disableSwitch", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-form-field>\n @if (showLabel() === true) {\n <mat-label>{{ placeholder() | translate }}</mat-label>\n }\n <input\n matInput\n (blur)=\"delayedHide(0)\"\n [type]=\"isPassword() ? (hide ? 'password' : 'text') : 'text'\"\n [required]=\"isPassword() ? 'true' : required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n (change)=\"delayedHide()\"\n />\n @if (disableSwitch() === true) {\n <mat-checkbox\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n [checked]=\"!disabled()\"\n matPrefix\n />\n }\n\n @if (isPassword()) {\n <button type=\"button\" matSuffix mat-icon-button (click)=\"togglePassword()\">\n <mat-icon color=\"primary\">{{\n hide ? 'visibility_off' : 'visibility'\n }}</mat-icon>\n </button>\n }\n\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n", dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.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: FormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i8.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
350
864
  };
351
865
  FormFieldTextComponent = __decorate([
352
866
  IgoFormFieldComponent('text')
353
867
  ], FormFieldTextComponent);
354
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormFieldTextComponent, decorators: [{
868
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldTextComponent, decorators: [{
355
869
  type: Component,
356
870
  args: [{ selector: 'igo-form-field-text', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
357
871
  MatFormFieldModule,
@@ -359,21 +873,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
359
873
  FormsModule,
360
874
  ReactiveFormsModule,
361
875
  MatIconModule,
876
+ MatCheckboxModule,
362
877
  MatButtonModule,
363
- AsyncPipe,
364
878
  IgoLanguageModule
365
- ], template: "<mat-form-field>\n <input\n matInput\n (blur)=\"delayedHide(0)\"\n [type]=\"isPassword() ? (hide ? 'password' : 'text') : 'text'\"\n [required]=\"isPassword() ? 'true' : required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n (change)=\"delayedHide()\"\n />\n @if (disableSwitch() === true) {\n <mat-icon\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n matPrefix\n >{{\n (disabled$ | async) === true ? 'check_box_outline_blank' : 'check_box'\n }}\n </mat-icon>\n }\n\n @if (isPassword()) {\n <button type=\"button\" matSuffix mat-icon-button (click)=\"togglePassword()\">\n <mat-icon color=\"primary\">{{\n hide ? 'visibility_off' : 'visibility'\n }}</mat-icon>\n </button>\n }\n\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n" }]
366
- }], propDecorators: { formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], isPassword: [{ type: i0.Input, args: [{ isSignal: true, alias: "isPassword", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], disableSwitch: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSwitch", required: false }] }] } });
879
+ ], template: "<mat-form-field>\n @if (showLabel() === true) {\n <mat-label>{{ placeholder() | translate }}</mat-label>\n }\n <input\n matInput\n (blur)=\"delayedHide(0)\"\n [type]=\"isPassword() ? (hide ? 'password' : 'text') : 'text'\"\n [required]=\"isPassword() ? 'true' : required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n (change)=\"delayedHide()\"\n />\n @if (disableSwitch() === true) {\n <mat-checkbox\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n [checked]=\"!disabled()\"\n matPrefix\n />\n }\n\n @if (isPassword()) {\n <button type=\"button\" matSuffix mat-icon-button (click)=\"togglePassword()\">\n <mat-icon color=\"primary\">{{\n hide ? 'visibility_off' : 'visibility'\n }}</mat-icon>\n </button>\n }\n\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n" }]
880
+ }], propDecorators: { formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required: true }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], isPassword: [{ type: i0.Input, args: [{ isSignal: true, alias: "isPassword", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], disableSwitch: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSwitch", required: false }] }] } });
367
881
 
368
882
  /**
369
883
  * This component renders a textarea field
370
884
  */
371
885
  let FormFieldTextareaComponent = class FormFieldTextareaComponent {
372
- disabled$ = new BehaviorSubject(false);
886
+ disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
373
887
  /**
374
888
  * The field's form control
375
889
  */
376
890
  formControl = input.required(...(ngDevMode ? [{ debugName: "formControl" }] : /* istanbul ignore next */ []));
891
+ /**
892
+ * Field showLabel
893
+ */
894
+ showLabel = input(false, ...(ngDevMode ? [{ debugName: "showLabel" }] : /* istanbul ignore next */ []));
377
895
  /**
378
896
  * Field placeholder
379
897
  */
@@ -393,7 +911,7 @@ let FormFieldTextareaComponent = class FormFieldTextareaComponent {
393
911
  return formControlIsRequired(this.formControl());
394
912
  }
395
913
  ngOnInit() {
396
- this.disabled$.next(this.formControl().disabled);
914
+ this.disabled.set(this.formControl().disabled);
397
915
  }
398
916
  /**
399
917
  * Get error message
@@ -405,33 +923,32 @@ let FormFieldTextareaComponent = class FormFieldTextareaComponent {
405
923
  this.toggleDisabled();
406
924
  }
407
925
  toggleDisabled() {
408
- const disabled = !this.disabled$.value;
926
+ const disabled = !this.disabled();
409
927
  if (disabled === true) {
410
928
  this.formControl().disable();
411
929
  }
412
930
  else {
413
931
  this.formControl().enable();
414
932
  }
415
- this.disabled$.next(disabled);
933
+ this.disabled.set(disabled);
416
934
  }
417
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormFieldTextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
418
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormFieldTextareaComponent, isStandalone: true, selector: "igo-form-field-textarea", inputs: { formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, disableSwitch: { classPropertyName: "disableSwitch", publicName: "disableSwitch", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-form-field>\n <textarea\n matInput\n [required]=\"required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n >\n </textarea>\n @if (disableSwitch() === true) {\n <mat-icon\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n matPrefix\n >{{\n (disabled$ | async) === true ? 'check_box_outline_blank' : 'check_box'\n }}\n </mat-icon>\n }\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n", dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$1.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: FormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
935
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldTextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
936
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: FormFieldTextareaComponent, isStandalone: true, selector: "igo-form-field-textarea", inputs: { formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, disableSwitch: { classPropertyName: "disableSwitch", publicName: "disableSwitch", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-form-field>\n @if (showLabel() === true) {\n <mat-label>{{ placeholder() | translate }}</mat-label>\n }\n <textarea\n matInput\n [required]=\"required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n >\n </textarea>\n @if (disableSwitch() === true) {\n <mat-checkbox\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n [checked]=\"!disabled()\"\n matPrefix\n />\n }\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n", dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.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: FormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
419
937
  };
420
938
  FormFieldTextareaComponent = __decorate([
421
939
  IgoFormFieldComponent('textarea')
422
940
  ], FormFieldTextareaComponent);
423
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormFieldTextareaComponent, decorators: [{
941
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldTextareaComponent, decorators: [{
424
942
  type: Component,
425
943
  args: [{ selector: 'igo-form-field-textarea', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
426
944
  MatFormFieldModule,
427
945
  MatInputModule,
428
946
  FormsModule,
429
947
  ReactiveFormsModule,
430
- MatIconModule,
431
- AsyncPipe,
948
+ MatCheckboxModule,
432
949
  IgoLanguageModule
433
- ], template: "<mat-form-field>\n <textarea\n matInput\n [required]=\"required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n >\n </textarea>\n @if (disableSwitch() === true) {\n <mat-icon\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n matPrefix\n >{{\n (disabled$ | async) === true ? 'check_box_outline_blank' : 'check_box'\n }}\n </mat-icon>\n }\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n" }]
434
- }], propDecorators: { formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], disableSwitch: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSwitch", required: false }] }] } });
950
+ ], template: "<mat-form-field>\n @if (showLabel() === true) {\n <mat-label>{{ placeholder() | translate }}</mat-label>\n }\n <textarea\n matInput\n [required]=\"required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n >\n </textarea>\n @if (disableSwitch() === true) {\n <mat-checkbox\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n [checked]=\"!disabled()\"\n matPrefix\n />\n }\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n" }]
951
+ }], propDecorators: { formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required: true }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], disableSwitch: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSwitch", required: false }] }] } });
435
952
 
436
953
  class FormService {
437
954
  formBuilder = inject(UntypedFormBuilder);
@@ -498,10 +1015,10 @@ class FormService {
498
1015
  const args = match[2];
499
1016
  return Validators[name](args);
500
1017
  }
501
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
502
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormService, providedIn: 'root' });
1018
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1019
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormService, providedIn: 'root' });
503
1020
  }
504
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormService, decorators: [{
1021
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormService, decorators: [{
505
1022
  type: Injectable,
506
1023
  args: [{
507
1024
  providedIn: 'root'
@@ -553,16 +1070,20 @@ class FormFieldComponent {
553
1070
  this.fieldSubscribers = Object.assign({}, this.field().subscribers || {});
554
1071
  return this.fieldSubscribers;
555
1072
  }
556
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
557
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormFieldComponent, isStandalone: true, selector: "igo-form-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (field() !== undefined) {\n <igo-dynamic-outlet\n [component]=\"getFieldComponent()\"\n [inputs]=\"getFieldInputs()\"\n [subscribers]=\"getFieldSubscribers()\"\n />\n}\n", styles: ["::ng-deep mat-form-field{width:100%}::ng-deep .igo-form-disable-switch{margin-right:8px}\n"], dependencies: [{ kind: "component", type: DynamicOutletComponent, selector: "igo-dynamic-outlet", inputs: ["component", "inputs", "subscribers"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1073
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1074
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: FormFieldComponent, isStandalone: true, selector: "igo-form-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (field() !== undefined) {\n <igo-dynamic-outlet\n [component]=\"getFieldComponent()\"\n [inputs]=\"getFieldInputs()\"\n [subscribers]=\"getFieldSubscribers()\"\n />\n}\n", styles: ["::ng-deep mat-form-field{width:100%}::ng-deep .igo-form-disable-switch{margin-right:8px}\n"], dependencies: [{ kind: "component", type: DynamicOutletComponent, selector: "igo-dynamic-outlet", inputs: ["component", "inputs", "subscribers"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
558
1075
  }
559
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormFieldComponent, decorators: [{
1076
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormFieldComponent, decorators: [{
560
1077
  type: Component,
561
1078
  args: [{ selector: 'igo-form-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [DynamicOutletComponent], template: "@if (field() !== undefined) {\n <igo-dynamic-outlet\n [component]=\"getFieldComponent()\"\n [inputs]=\"getFieldInputs()\"\n [subscribers]=\"getFieldSubscribers()\"\n />\n}\n", styles: ["::ng-deep mat-form-field{width:100%}::ng-deep .igo-form-disable-switch{margin-right:8px}\n"] }]
562
1079
  }], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }] } });
563
1080
 
564
1081
  const FORM_FIELD_DIRECTIVES = [
565
1082
  FormFieldComponent,
1083
+ FormFieldCheckboxComponent,
1084
+ FormFieldDatetimeComponent,
1085
+ FormFieldNumberComponent,
1086
+ FormFieldRadiobuttonComponent,
566
1087
  FormFieldSelectComponent,
567
1088
  FormFieldTextComponent,
568
1089
  FormFieldTextareaComponent
@@ -572,11 +1093,11 @@ const FORM_FIELD_DIRECTIVES = [
572
1093
  * @deprecated import the components directly or FORM_FIELD_DIRECTIVES for every components/directives
573
1094
  */
574
1095
  class IgoFormFieldModule {
575
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
576
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.10", ngImport: i0, type: IgoFormFieldModule, imports: [FormFieldComponent, FormFieldSelectComponent, FormFieldTextComponent, FormFieldTextareaComponent], exports: [FormFieldComponent, FormFieldSelectComponent, FormFieldTextComponent, FormFieldTextareaComponent] });
577
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoFormFieldModule, imports: [FORM_FIELD_DIRECTIVES] });
1096
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: IgoFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1097
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.24", ngImport: i0, type: IgoFormFieldModule, imports: [FormFieldComponent, FormFieldCheckboxComponent, FormFieldDatetimeComponent, FormFieldNumberComponent, FormFieldRadiobuttonComponent, FormFieldSelectComponent, FormFieldTextComponent, FormFieldTextareaComponent], exports: [FormFieldComponent, FormFieldCheckboxComponent, FormFieldDatetimeComponent, FormFieldNumberComponent, FormFieldRadiobuttonComponent, FormFieldSelectComponent, FormFieldTextComponent, FormFieldTextareaComponent] });
1098
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: IgoFormFieldModule, imports: [FORM_FIELD_DIRECTIVES] });
578
1099
  }
579
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoFormFieldModule, decorators: [{
1100
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: IgoFormFieldModule, decorators: [{
580
1101
  type: NgModule,
581
1102
  args: [{
582
1103
  imports: [...FORM_FIELD_DIRECTIVES],
@@ -637,23 +1158,23 @@ class FormGroupComponent {
637
1158
  const options = this.group().options || {};
638
1159
  return getControlErrorMessage(this.formControl, options.errors || {});
639
1160
  }
640
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
641
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormGroupComponent, isStandalone: true, selector: "igo-form-group", inputs: { group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: true, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (group() && group().fields.length > 0) {\n <div class=\"igo-form-group-fields\">\n @for (field of group().fields; track field) {\n <div class=\"igo-form-field-wrapper\" [ngClass]=\"getFieldNgClass(field)\">\n <igo-form-field [field]=\"field\" />\n </div>\n }\n </div>\n}\n\n<div class=\"igo-form-group-extra-content\">\n <ng-content />\n</div>\n\n@if (formControl.errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n}\n", styles: [":host{width:100%;height:100%;display:block;overflow:auto;padding:10px 5px;box-sizing:border-box}:host .igo-form-field-colspan-2{width:100%}:host .igo-form-field-colspan-1{width:50%}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: FormFieldComponent, selector: "igo-form-field", inputs: ["field"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1161
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1162
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: FormGroupComponent, isStandalone: true, selector: "igo-form-group", inputs: { group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: true, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (group() && group().fields.length > 0) {\n <div class=\"igo-form-group-fields\">\n @for (field of group().fields; track field) {\n <div class=\"igo-form-field-wrapper\" [ngClass]=\"getFieldNgClass(field)\">\n <igo-form-field [field]=\"field\" />\n </div>\n }\n </div>\n}\n\n<div class=\"igo-form-group-extra-content\">\n <ng-content />\n</div>\n\n@if (formControl.errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n}\n", styles: [":host{width:100%;height:100%;display:block;overflow:auto;padding:10px 5px;box-sizing:border-box}:host .igo-form-group-fields{display:flex;flex-direction:column;gap:12px}:host .igo-form-field-colspan-2{width:100%}:host .igo-form-field-colspan-1{width:50%}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: FormFieldComponent, selector: "igo-form-field", inputs: ["field"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
642
1163
  }
643
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormGroupComponent, decorators: [{
1164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormGroupComponent, decorators: [{
644
1165
  type: Component,
645
- args: [{ selector: 'igo-form-group', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass, FormFieldComponent, MatFormFieldModule, IgoLanguageModule], template: "@if (group() && group().fields.length > 0) {\n <div class=\"igo-form-group-fields\">\n @for (field of group().fields; track field) {\n <div class=\"igo-form-field-wrapper\" [ngClass]=\"getFieldNgClass(field)\">\n <igo-form-field [field]=\"field\" />\n </div>\n }\n </div>\n}\n\n<div class=\"igo-form-group-extra-content\">\n <ng-content />\n</div>\n\n@if (formControl.errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n}\n", styles: [":host{width:100%;height:100%;display:block;overflow:auto;padding:10px 5px;box-sizing:border-box}:host .igo-form-field-colspan-2{width:100%}:host .igo-form-field-colspan-1{width:50%}\n"] }]
1166
+ args: [{ selector: 'igo-form-group', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass, FormFieldComponent, MatFormFieldModule, IgoLanguageModule], template: "@if (group() && group().fields.length > 0) {\n <div class=\"igo-form-group-fields\">\n @for (field of group().fields; track field) {\n <div class=\"igo-form-field-wrapper\" [ngClass]=\"getFieldNgClass(field)\">\n <igo-form-field [field]=\"field\" />\n </div>\n }\n </div>\n}\n\n<div class=\"igo-form-group-extra-content\">\n <ng-content />\n</div>\n\n@if (formControl.errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n}\n", styles: [":host{width:100%;height:100%;display:block;overflow:auto;padding:10px 5px;box-sizing:border-box}:host .igo-form-group-fields{display:flex;flex-direction:column;gap:12px}:host .igo-form-field-colspan-2{width:100%}:host .igo-form-field-colspan-1{width:50%}\n"] }]
646
1167
  }], propDecorators: { group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required: true }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }] } });
647
1168
 
648
1169
  /**
649
1170
  * @deprecated import the FormGroupComponent directly
650
1171
  */
651
1172
  class IgoFormGroupModule {
652
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoFormGroupModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
653
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.10", ngImport: i0, type: IgoFormGroupModule, imports: [FormGroupComponent], exports: [FormGroupComponent] });
654
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoFormGroupModule, imports: [FormGroupComponent] });
1173
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: IgoFormGroupModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1174
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.24", ngImport: i0, type: IgoFormGroupModule, imports: [FormGroupComponent], exports: [FormGroupComponent] });
1175
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: IgoFormGroupModule, imports: [FormGroupComponent] });
655
1176
  }
656
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoFormGroupModule, decorators: [{
1177
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: IgoFormGroupModule, decorators: [{
657
1178
  type: NgModule,
658
1179
  args: [{
659
1180
  imports: [FormGroupComponent],
@@ -670,13 +1191,13 @@ const FORM_DIRECTIVES = [
670
1191
  * @deprecated import the components directly or FORM_DIRECTIVES for every components/directives
671
1192
  */
672
1193
  class IgoFormModule {
673
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
674
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.10", ngImport: i0, type: IgoFormModule, imports: [FormFieldComponent, FormFieldSelectComponent, FormFieldTextComponent, FormFieldTextareaComponent, FormGroupComponent,
675
- FormComponent], exports: [FormFieldComponent, FormFieldSelectComponent, FormFieldTextComponent, FormFieldTextareaComponent, FormGroupComponent,
1194
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: IgoFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1195
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.24", ngImport: i0, type: IgoFormModule, imports: [FormFieldComponent, FormFieldCheckboxComponent, FormFieldDatetimeComponent, FormFieldNumberComponent, FormFieldRadiobuttonComponent, FormFieldSelectComponent, FormFieldTextComponent, FormFieldTextareaComponent, FormGroupComponent,
1196
+ FormComponent], exports: [FormFieldComponent, FormFieldCheckboxComponent, FormFieldDatetimeComponent, FormFieldNumberComponent, FormFieldRadiobuttonComponent, FormFieldSelectComponent, FormFieldTextComponent, FormFieldTextareaComponent, FormGroupComponent,
676
1197
  FormComponent] });
677
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoFormModule, imports: [FORM_DIRECTIVES] });
1198
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: IgoFormModule, imports: [FORM_DIRECTIVES] });
678
1199
  }
679
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoFormModule, decorators: [{
1200
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: IgoFormModule, decorators: [{
680
1201
  type: NgModule,
681
1202
  args: [{
682
1203
  imports: [...FORM_DIRECTIVES],
@@ -684,6 +1205,144 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
684
1205
  }]
685
1206
  }] });
686
1207
 
1208
+ const DEFAULT_FORM_STEPPER_LABELS = {
1209
+ nextButton: 'Suivant',
1210
+ previousButton: 'Précédent',
1211
+ processButton: 'Confirmer',
1212
+ cancelButton: 'Annuler',
1213
+ stepCounter: 'Étape {{current}} de {{total}}'
1214
+ };
1215
+ function resolveFormStepperStepFormConfig(step, context) {
1216
+ return typeof step.form === 'function' ? step.form(context) : step.form;
1217
+ }
1218
+
1219
+ class FormStepperComponent {
1220
+ formService = inject(FormService);
1221
+ steps = input.required(...(ngDevMode ? [{ debugName: "steps" }] : /* istanbul ignore next */ []));
1222
+ initialData = input({}, ...(ngDevMode ? [{ debugName: "initialData" }] : /* istanbul ignore next */ []));
1223
+ notice = input(...(ngDevMode ? [undefined, { debugName: "notice" }] : /* istanbul ignore next */ []));
1224
+ labels = input(DEFAULT_FORM_STEPPER_LABELS, { ...(ngDevMode ? { debugName: "labels" } : /* istanbul ignore next */ {}), transform: (value) => labelAttribute(value, DEFAULT_FORM_STEPPER_LABELS) });
1225
+ showCancelButton = input(true, ...(ngDevMode ? [{ debugName: "showCancelButton" }] : /* istanbul ignore next */ []));
1226
+ completed = output();
1227
+ cancelled = output();
1228
+ dataChange = output();
1229
+ stepIndex = signal(0, ...(ngDevMode ? [{ debugName: "stepIndex" }] : /* istanbul ignore next */ []));
1230
+ stepResults = signal({}, ...(ngDevMode ? [{ debugName: "stepResults" }] : /* istanbul ignore next */ []));
1231
+ activeStep = computed(() => {
1232
+ const steps = this.steps();
1233
+ if (!steps.length) {
1234
+ throw new Error('Form stepper requires at least one step.');
1235
+ }
1236
+ return steps[this.stepIndex()];
1237
+ }, ...(ngDevMode ? [{ debugName: "activeStep" }] : /* istanbul ignore next */ []));
1238
+ activeContextData = computed(() => this.buildAggregateData(this.stepIndex() - 1), ...(ngDevMode ? [{ debugName: "activeContextData" }] : /* istanbul ignore next */ []));
1239
+ activeFormData = computed(() => this.buildAggregateData(this.stepIndex()), ...(ngDevMode ? [{ debugName: "activeFormData" }] : /* istanbul ignore next */ []));
1240
+ activeForm = computed(() => buildFormFromConfig(this.formService, resolveFormStepperStepFormConfig(this.activeStep(), {
1241
+ data: this.activeContextData(),
1242
+ stepIndex: this.stepIndex(),
1243
+ steps: this.steps()
1244
+ })), ...(ngDevMode ? [{ debugName: "activeForm" }] : /* istanbul ignore next */ []));
1245
+ activeNotice = computed(() => this.activeStep().notice ?? this.notice(), ...(ngDevMode ? [{ debugName: "activeNotice" }] : /* istanbul ignore next */ []));
1246
+ stepCount = computed(() => this.steps().length, ...(ngDevMode ? [{ debugName: "stepCount" }] : /* istanbul ignore next */ []));
1247
+ stepNumber = computed(() => this.stepIndex() + 1, ...(ngDevMode ? [{ debugName: "stepNumber" }] : /* istanbul ignore next */ []));
1248
+ resolvedLabels = computed(() => labelAttribute(this.labels(), DEFAULT_FORM_STEPPER_LABELS), ...(ngDevMode ? [{ debugName: "resolvedLabels" }] : /* istanbul ignore next */ []));
1249
+ stepCounterLabel = computed(() => this.resolvedLabels()
1250
+ .stepCounter.replace('{{current}}', String(this.stepNumber()))
1251
+ .replace('{{total}}', String(this.stepCount())), ...(ngDevMode ? [{ debugName: "stepCounterLabel" }] : /* istanbul ignore next */ []));
1252
+ progressWidth = computed(() => `${(this.stepNumber() / this.stepCount()) * 100}%`, ...(ngDevMode ? [{ debugName: "progressWidth" }] : /* istanbul ignore next */ []));
1253
+ maxNavigableStepIndex = computed(() => {
1254
+ const completedStepIndexes = Object.keys(this.stepResults())
1255
+ .map((index) => Number(index))
1256
+ .filter((index) => !Number.isNaN(index));
1257
+ if (!completedStepIndexes.length) {
1258
+ return 0;
1259
+ }
1260
+ return Math.min(Math.max(...completedStepIndexes) + 1, this.steps().length - 1);
1261
+ }, ...(ngDevMode ? [{ debugName: "maxNavigableStepIndex" }] : /* istanbul ignore next */ []));
1262
+ isLastStep = computed(() => this.stepIndex() === this.steps().length - 1, ...(ngDevMode ? [{ debugName: "isLastStep" }] : /* istanbul ignore next */ []));
1263
+ onSubmitStep(stepData) {
1264
+ const form = this.activeForm();
1265
+ if (!form.control.valid) {
1266
+ markFormAsTouched(form);
1267
+ return;
1268
+ }
1269
+ const currentStepIndex = this.stepIndex();
1270
+ const nextStepResults = {
1271
+ ...this.stepResults(),
1272
+ [currentStepIndex]: stepData
1273
+ };
1274
+ Object.keys(nextStepResults)
1275
+ .map((index) => Number(index))
1276
+ .filter((index) => index > currentStepIndex)
1277
+ .forEach((index) => {
1278
+ delete nextStepResults[index];
1279
+ });
1280
+ this.stepResults.set(nextStepResults);
1281
+ const aggregateData = this.buildAggregateDataFrom(nextStepResults, currentStepIndex);
1282
+ this.dataChange.emit(aggregateData);
1283
+ if (this.isLastStep()) {
1284
+ this.completed.emit(aggregateData);
1285
+ return;
1286
+ }
1287
+ queueMicrotask(() => {
1288
+ this.stepIndex.set(currentStepIndex + 1);
1289
+ });
1290
+ }
1291
+ previous() {
1292
+ if (this.stepIndex() === 0) {
1293
+ return;
1294
+ }
1295
+ this.stepIndex.update((index) => index - 1);
1296
+ this.dataChange.emit(this.activeFormData());
1297
+ }
1298
+ cancel() {
1299
+ this.cancelled.emit();
1300
+ }
1301
+ reset() {
1302
+ this.stepResults.set({});
1303
+ this.stepIndex.set(0);
1304
+ this.dataChange.emit({ ...this.initialData() });
1305
+ }
1306
+ onSelectedIndexChange(index) {
1307
+ if (index <= this.maxNavigableStepIndex()) {
1308
+ this.stepIndex.set(index);
1309
+ this.dataChange.emit(this.activeFormData());
1310
+ return;
1311
+ }
1312
+ queueMicrotask(() => {
1313
+ this.stepIndex.set(this.stepIndex());
1314
+ });
1315
+ }
1316
+ isCompletedStep(index) {
1317
+ return this.stepResults()[index] !== undefined;
1318
+ }
1319
+ isEditableStep(index) {
1320
+ return index <= this.maxNavigableStepIndex();
1321
+ }
1322
+ buildAggregateData(lastStepIndex) {
1323
+ return this.buildAggregateDataFrom(this.stepResults(), lastStepIndex);
1324
+ }
1325
+ buildAggregateDataFrom(stepResults, lastStepIndex) {
1326
+ const aggregateData = { ...this.initialData() };
1327
+ for (let index = 0; index <= lastStepIndex; index += 1) {
1328
+ Object.assign(aggregateData, stepResults[index] ?? {});
1329
+ }
1330
+ return aggregateData;
1331
+ }
1332
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormStepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1333
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: FormStepperComponent, isStandalone: true, selector: "igo-form-stepper", inputs: { steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: true, transformFunction: null }, initialData: { classPropertyName: "initialData", publicName: "initialData", isSignal: true, isRequired: false, transformFunction: null }, notice: { classPropertyName: "notice", publicName: "notice", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, showCancelButton: { classPropertyName: "showCancelButton", publicName: "showCancelButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { completed: "completed", cancelled: "cancelled", dataChange: "dataChange" }, ngImport: i0, template: "<mat-stepper\n class=\"form-stepper\"\n [selectedIndex]=\"stepIndex()\"\n (selectedIndexChange)=\"onSelectedIndexChange($event)\"\n>\n @for (step of steps(); track step.label) {\n <mat-step\n [completed]=\"isCompletedStep($index)\"\n [editable]=\"isEditableStep($index)\"\n >\n <ng-template matStepLabel>{{ step.label | translate }}</ng-template>\n </mat-step>\n }\n</mat-stepper>\n\n<section class=\"form-stepper-content\">\n <header class=\"form-stepper-header\">\n <div class=\"form-stepper-header-main\">\n <div class=\"form-stepper-meta\">\n <p class=\"form-stepper-counter\">\n {{ stepCounterLabel() }}\n </p>\n <span class=\"form-stepper-badge\">{{\n activeStep().label | translate\n }}</span>\n </div>\n\n @if (activeStep().title) {\n <h2 class=\"form-stepper-title\">{{ activeStep().title | translate }}</h2>\n } @else {\n <h2 class=\"form-stepper-title\">{{ activeStep().label | translate }}</h2>\n }\n </div>\n\n <div class=\"form-stepper-progress\" aria-hidden=\"true\">\n <span\n class=\"form-stepper-progress-bar\"\n [style.width]=\"progressWidth()\"\n ></span>\n </div>\n </header>\n\n <igo-form\n [form]=\"activeForm()\"\n [formData]=\"activeFormData()\"\n (submitForm)=\"onSubmitStep($event)\"\n >\n @if (activeForm().fields.length || activeForm().groups.length) {\n <div class=\"form-dialog-container\">\n @for (field of activeForm().fields; track field.name) {\n <igo-form-field [field]=\"field\" />\n }\n @for (group of activeForm().groups; track group.name) {\n <igo-form-group [group]=\"group\" />\n }\n </div>\n }\n\n <div formButtons class=\"form-stepper-actions\">\n @if (showCancelButton()) {\n <button\n mat-stroked-button\n type=\"button\"\n color=\"primary\"\n (click)=\"cancel()\"\n >\n {{ resolvedLabels().cancelButton }}\n </button>\n }\n\n @if (stepIndex() > 0) {\n <button\n mat-stroked-button\n type=\"button\"\n color=\"primary\"\n (click)=\"previous()\"\n >\n {{ resolvedLabels().previousButton }}\n </button>\n }\n\n <button matButton=\"filled\" type=\"submit\" color=\"primary\">\n {{ isLastStep() ? labels().processButton : labels().nextButton }}\n </button>\n </div>\n </igo-form>\n</section>\n\n@if (activeNotice()) {\n <div class=\"form-stepper-notice\" role=\"note\">\n <igo-custom-html [html]=\"activeNotice()!\" />\n </div>\n}\n", styles: [":host{display:block}:host .form-stepper{width:100%;min-width:0}:host .form-stepper-content{padding-top:12px}:host .form-stepper-header{display:grid;gap:12px;margin-bottom:12px;padding:14px;border:1px solid #d6e1ef;border-radius:16px;background:linear-gradient(180deg,#fbfdff,#f4f8fc);box-shadow:0 10px 24px #135d9b14}:host .form-stepper-header-main{display:grid;gap:8px}:host .form-stepper-meta{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}:host .form-stepper-counter{margin:0;color:#5d6a7a;font-size:.8rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase}:host .form-stepper-badge{display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;background:#d9ebf9;color:#135d9b;font-size:.8rem;font-weight:700;letter-spacing:.02em}:host .form-stepper-progress{overflow:hidden;height:6px;border-radius:999px;background:#dbe3ef}:host .form-stepper-progress-bar{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#135d9b,#3f8cc7);transition:width .16s ease}:host .form-stepper-title{margin:0;font-weight:600;font-size:1.25rem;line-height:1.3}:host .form-stepper-notice{margin-top:12px;padding:12px 14px;border-left:4px solid #3f8cc7;border-radius:10px;background:#f4f8fc}:host .form-stepper-actions{margin:10px 0 0;gap:8px;justify-content:flex-end}:host .form-dialog-container{width:100%;padding:8px 0}:host .form-dialog-container igo-form-field,:host .form-dialog-container igo-form-group{display:block;height:auto}@media(max-width:640px){:host .form-stepper-content{padding-top:8px}:host .form-stepper-header{gap:10px;margin-bottom:10px;padding:12px;border-radius:14px}:host .form-stepper-meta{align-items:flex-start;justify-content:flex-start}:host .form-stepper-title{font-size:1.1rem;line-height:1.35}:host .form-stepper-badge{font-size:.75rem}:host .form-stepper-actions{flex-direction:column-reverse;align-items:stretch}:host .form-stepper-actions button{width:100%}}\n"], dependencies: [{ kind: "ngmodule", type: MatStepperModule }, { kind: "component", type: i1$1.MatStep, selector: "mat-step", inputs: ["color"], exportAs: ["matStep"] }, { kind: "directive", type: i1$1.MatStepLabel, selector: "[matStepLabel]" }, { kind: "component", type: i1$1.MatStepper, selector: "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", inputs: ["disableRipple", "color", "labelPosition", "headerPosition", "aria-label", "headerPrefix", "animationDuration"], outputs: ["animationDone"], exportAs: ["matStepper", "matVerticalStepper", "matHorizontalStepper"] }, { kind: "ngmodule", type: IgoFormModule }, { kind: "component", type: FormFieldComponent, selector: "igo-form-field", inputs: ["field"] }, { kind: "component", type: FormGroupComponent, selector: "igo-form-group", inputs: ["group", "errors"] }, { kind: "component", type: FormComponent, selector: "igo-form", inputs: ["form", "formData", "autocomplete"], outputs: ["submitForm"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i8.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: IgoCustomHtmlModule }, { kind: "component", type: i6.CustomHtmlComponent, selector: "igo-custom-html", inputs: ["html"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }] });
1334
+ }
1335
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormStepperComponent, decorators: [{
1336
+ type: Component,
1337
+ args: [{ selector: 'igo-form-stepper', imports: [
1338
+ MatStepperModule,
1339
+ IgoFormModule,
1340
+ MatButtonModule,
1341
+ IgoCustomHtmlModule,
1342
+ IgoLanguageModule
1343
+ ], template: "<mat-stepper\n class=\"form-stepper\"\n [selectedIndex]=\"stepIndex()\"\n (selectedIndexChange)=\"onSelectedIndexChange($event)\"\n>\n @for (step of steps(); track step.label) {\n <mat-step\n [completed]=\"isCompletedStep($index)\"\n [editable]=\"isEditableStep($index)\"\n >\n <ng-template matStepLabel>{{ step.label | translate }}</ng-template>\n </mat-step>\n }\n</mat-stepper>\n\n<section class=\"form-stepper-content\">\n <header class=\"form-stepper-header\">\n <div class=\"form-stepper-header-main\">\n <div class=\"form-stepper-meta\">\n <p class=\"form-stepper-counter\">\n {{ stepCounterLabel() }}\n </p>\n <span class=\"form-stepper-badge\">{{\n activeStep().label | translate\n }}</span>\n </div>\n\n @if (activeStep().title) {\n <h2 class=\"form-stepper-title\">{{ activeStep().title | translate }}</h2>\n } @else {\n <h2 class=\"form-stepper-title\">{{ activeStep().label | translate }}</h2>\n }\n </div>\n\n <div class=\"form-stepper-progress\" aria-hidden=\"true\">\n <span\n class=\"form-stepper-progress-bar\"\n [style.width]=\"progressWidth()\"\n ></span>\n </div>\n </header>\n\n <igo-form\n [form]=\"activeForm()\"\n [formData]=\"activeFormData()\"\n (submitForm)=\"onSubmitStep($event)\"\n >\n @if (activeForm().fields.length || activeForm().groups.length) {\n <div class=\"form-dialog-container\">\n @for (field of activeForm().fields; track field.name) {\n <igo-form-field [field]=\"field\" />\n }\n @for (group of activeForm().groups; track group.name) {\n <igo-form-group [group]=\"group\" />\n }\n </div>\n }\n\n <div formButtons class=\"form-stepper-actions\">\n @if (showCancelButton()) {\n <button\n mat-stroked-button\n type=\"button\"\n color=\"primary\"\n (click)=\"cancel()\"\n >\n {{ resolvedLabels().cancelButton }}\n </button>\n }\n\n @if (stepIndex() > 0) {\n <button\n mat-stroked-button\n type=\"button\"\n color=\"primary\"\n (click)=\"previous()\"\n >\n {{ resolvedLabels().previousButton }}\n </button>\n }\n\n <button matButton=\"filled\" type=\"submit\" color=\"primary\">\n {{ isLastStep() ? labels().processButton : labels().nextButton }}\n </button>\n </div>\n </igo-form>\n</section>\n\n@if (activeNotice()) {\n <div class=\"form-stepper-notice\" role=\"note\">\n <igo-custom-html [html]=\"activeNotice()!\" />\n </div>\n}\n", styles: [":host{display:block}:host .form-stepper{width:100%;min-width:0}:host .form-stepper-content{padding-top:12px}:host .form-stepper-header{display:grid;gap:12px;margin-bottom:12px;padding:14px;border:1px solid #d6e1ef;border-radius:16px;background:linear-gradient(180deg,#fbfdff,#f4f8fc);box-shadow:0 10px 24px #135d9b14}:host .form-stepper-header-main{display:grid;gap:8px}:host .form-stepper-meta{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}:host .form-stepper-counter{margin:0;color:#5d6a7a;font-size:.8rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase}:host .form-stepper-badge{display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;background:#d9ebf9;color:#135d9b;font-size:.8rem;font-weight:700;letter-spacing:.02em}:host .form-stepper-progress{overflow:hidden;height:6px;border-radius:999px;background:#dbe3ef}:host .form-stepper-progress-bar{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#135d9b,#3f8cc7);transition:width .16s ease}:host .form-stepper-title{margin:0;font-weight:600;font-size:1.25rem;line-height:1.3}:host .form-stepper-notice{margin-top:12px;padding:12px 14px;border-left:4px solid #3f8cc7;border-radius:10px;background:#f4f8fc}:host .form-stepper-actions{margin:10px 0 0;gap:8px;justify-content:flex-end}:host .form-dialog-container{width:100%;padding:8px 0}:host .form-dialog-container igo-form-field,:host .form-dialog-container igo-form-group{display:block;height:auto}@media(max-width:640px){:host .form-stepper-content{padding-top:8px}:host .form-stepper-header{gap:10px;margin-bottom:10px;padding:12px;border-radius:14px}:host .form-stepper-meta{align-items:flex-start;justify-content:flex-start}:host .form-stepper-title{font-size:1.1rem;line-height:1.35}:host .form-stepper-badge{font-size:.75rem}:host .form-stepper-actions{flex-direction:column-reverse;align-items:stretch}:host .form-stepper-actions button{width:100%}}\n"] }]
1344
+ }], propDecorators: { steps: [{ type: i0.Input, args: [{ isSignal: true, alias: "steps", required: true }] }], initialData: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialData", required: false }] }], notice: [{ type: i0.Input, args: [{ isSignal: true, alias: "notice", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], showCancelButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCancelButton", required: false }] }], completed: [{ type: i0.Output, args: ["completed"] }], cancelled: [{ type: i0.Output, args: ["cancelled"] }], dataChange: [{ type: i0.Output, args: ["dataChange"] }] } });
1345
+
687
1346
  class FormDialogComponent {
688
1347
  languageService = inject(LanguageService);
689
1348
  dialogRef = inject(MatDialogRef);
@@ -698,14 +1357,7 @@ class FormDialogComponent {
698
1357
  this.data.cancelButtonText ?? 'igo.common.formDialog.cancelButtonText';
699
1358
  this.data.title = this.data.title ?? 'igo.common.formDialog.title';
700
1359
  this.data$ = this.data.data$ ?? new BehaviorSubject({});
701
- const fields = [];
702
- const groups = [];
703
- this.data.formFieldConfigs?.map((config) => fields.push(this.formService.field(config)));
704
- this.data.formGroupsConfigs?.map((formGroupsConfig) => {
705
- const fields = formGroupsConfig.formFieldConfigs?.map((config) => this.formService.field(config));
706
- groups.push(this.formService.group({ name: formGroupsConfig.name }, fields));
707
- });
708
- const form = this.formService.form(fields, groups);
1360
+ const form = buildFormFromConfig(this.formService, this.data);
709
1361
  this.form$.next(form);
710
1362
  }
711
1363
  onSubmit(data) {
@@ -716,29 +1368,16 @@ class FormDialogComponent {
716
1368
  this.dialogRef.close(data);
717
1369
  }
718
1370
  else {
719
- if (form.groups?.length) {
720
- form.groups.map((group) => {
721
- Object.keys(group.control.controls).map((k) => {
722
- group.control.controls[k].markAsTouched();
723
- group.control.controls[k].updateValueAndValidity();
724
- });
725
- });
726
- }
727
- else {
728
- form.fields.map((f) => {
729
- f.control.markAsTouched();
730
- f.control.updateValueAndValidity();
731
- });
732
- }
1371
+ markFormAsTouched(form);
733
1372
  }
734
1373
  }
735
1374
  cancel() {
736
1375
  this.dialogRef.close();
737
1376
  }
738
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
739
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormDialogComponent, isStandalone: true, selector: "igo-form-dialog", ngImport: i0, template: "<h1 mat-dialog-title>{{ data.title | translate }}</h1>\n\n@if (form$ | async; as form) {\n <igo-form\n [form]=\"form\"\n [formData]=\"(data$ | async)!\"\n (submitForm)=\"onSubmit($event)\"\n >\n @if (form.fields.length) {\n <div class=\"form-dialog-container\">\n @for (field of form.fields; track field) {\n <igo-form-field [field]=\"field\" />\n }\n @for (group of form.groups; track group) {\n <igo-form-group [group]=\"group\" />\n }\n </div>\n }\n <div formButtons mat-dialog-actions>\n <button\n mat-stroked-button\n type=\"button\"\n color=\"primary\"\n (click)=\"cancel()\"\n >\n {{ data.cancelButtonText | translate }}\n </button>\n <button matButton=\"filled\" type=\"submit\" color=\"primary\">\n {{ data.processButtonText | translate }}\n </button>\n </div>\n </igo-form>\n}\n<div>\n @if (data.notice && data.notice !== '') {\n <igo-custom-html [html]=\"data.notice\" />\n }\n</div>\n", styles: [":host div[mat-dialog-actions]{margin:10px 0 0}:host .form-dialog-container{width:100%;padding:10px}:host .form-dialog-container igo-form-field,:host .form-dialog-container igo-form-group{display:block;height:auto}\n"], dependencies: [{ kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "component", type: FormComponent, selector: "igo-form", inputs: ["form", "formData", "autocomplete"], outputs: ["submitForm"] }, { kind: "component", type: FormFieldComponent, selector: "igo-form-field", inputs: ["field"] }, { kind: "component", type: FormGroupComponent, selector: "igo-form-group", inputs: ["group", "errors"] }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: CustomHtmlComponent, selector: "igo-custom-html", inputs: ["html"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }] });
1377
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1378
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: FormDialogComponent, isStandalone: true, selector: "igo-form-dialog", ngImport: i0, template: "<h1 mat-dialog-title>{{ data.title | translate }}</h1>\n\n@if (form$ | async; as form) {\n <igo-form\n [form]=\"form\"\n [formData]=\"(data$ | async)!\"\n (submitForm)=\"onSubmit($event)\"\n >\n @if (form.fields.length || form.groups.length) {\n <div class=\"form-dialog-container\">\n @for (field of form.fields; track field.name) {\n <igo-form-field [field]=\"field\" />\n }\n @for (group of form.groups; track group.name) {\n <igo-form-group [group]=\"group\" />\n }\n </div>\n }\n <div formButtons mat-dialog-actions>\n <button\n mat-stroked-button\n type=\"button\"\n color=\"primary\"\n (click)=\"cancel()\"\n >\n {{ data.cancelButtonText | translate }}\n </button>\n <button matButton=\"filled\" type=\"submit\" color=\"primary\">\n {{ data.processButtonText | translate }}\n </button>\n </div>\n </igo-form>\n}\n<div>\n @if (data.notice && data.notice !== '') {\n <igo-custom-html [html]=\"data.notice\" />\n }\n</div>\n", styles: [":host div[mat-dialog-actions]{margin:10px 0 0}:host .form-dialog-container{width:100%;padding:10px}:host .form-dialog-container igo-form-field,:host .form-dialog-container igo-form-group{display:block;height:auto}\n"], dependencies: [{ kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "component", type: FormComponent, selector: "igo-form", inputs: ["form", "formData", "autocomplete"], outputs: ["submitForm"] }, { kind: "component", type: FormFieldComponent, selector: "igo-form-field", inputs: ["field"] }, { kind: "component", type: FormGroupComponent, selector: "igo-form-group", inputs: ["group", "errors"] }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i8.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: CustomHtmlComponent, selector: "igo-custom-html", inputs: ["html"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }] });
740
1379
  }
741
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormDialogComponent, decorators: [{
1380
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormDialogComponent, decorators: [{
742
1381
  type: Component,
743
1382
  args: [{ selector: 'igo-form-dialog', imports: [
744
1383
  MatDialogTitle,
@@ -750,9 +1389,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
750
1389
  CustomHtmlComponent,
751
1390
  AsyncPipe,
752
1391
  IgoLanguageModule
753
- ], template: "<h1 mat-dialog-title>{{ data.title | translate }}</h1>\n\n@if (form$ | async; as form) {\n <igo-form\n [form]=\"form\"\n [formData]=\"(data$ | async)!\"\n (submitForm)=\"onSubmit($event)\"\n >\n @if (form.fields.length) {\n <div class=\"form-dialog-container\">\n @for (field of form.fields; track field) {\n <igo-form-field [field]=\"field\" />\n }\n @for (group of form.groups; track group) {\n <igo-form-group [group]=\"group\" />\n }\n </div>\n }\n <div formButtons mat-dialog-actions>\n <button\n mat-stroked-button\n type=\"button\"\n color=\"primary\"\n (click)=\"cancel()\"\n >\n {{ data.cancelButtonText | translate }}\n </button>\n <button matButton=\"filled\" type=\"submit\" color=\"primary\">\n {{ data.processButtonText | translate }}\n </button>\n </div>\n </igo-form>\n}\n<div>\n @if (data.notice && data.notice !== '') {\n <igo-custom-html [html]=\"data.notice\" />\n }\n</div>\n", styles: [":host div[mat-dialog-actions]{margin:10px 0 0}:host .form-dialog-container{width:100%;padding:10px}:host .form-dialog-container igo-form-field,:host .form-dialog-container igo-form-group{display:block;height:auto}\n"] }]
1392
+ ], template: "<h1 mat-dialog-title>{{ data.title | translate }}</h1>\n\n@if (form$ | async; as form) {\n <igo-form\n [form]=\"form\"\n [formData]=\"(data$ | async)!\"\n (submitForm)=\"onSubmit($event)\"\n >\n @if (form.fields.length || form.groups.length) {\n <div class=\"form-dialog-container\">\n @for (field of form.fields; track field.name) {\n <igo-form-field [field]=\"field\" />\n }\n @for (group of form.groups; track group.name) {\n <igo-form-group [group]=\"group\" />\n }\n </div>\n }\n <div formButtons mat-dialog-actions>\n <button\n mat-stroked-button\n type=\"button\"\n color=\"primary\"\n (click)=\"cancel()\"\n >\n {{ data.cancelButtonText | translate }}\n </button>\n <button matButton=\"filled\" type=\"submit\" color=\"primary\">\n {{ data.processButtonText | translate }}\n </button>\n </div>\n </igo-form>\n}\n<div>\n @if (data.notice && data.notice !== '') {\n <igo-custom-html [html]=\"data.notice\" />\n }\n</div>\n", styles: [":host div[mat-dialog-actions]{margin:10px 0 0}:host .form-dialog-container{width:100%;padding:10px}:host .form-dialog-container igo-form-field,:host .form-dialog-container igo-form-group{display:block;height:auto}\n"] }]
754
1393
  }], ctorParameters: () => [] });
755
1394
 
1395
+ const DEFAULT_FORM_STEPPER_DIALOG_TITLE = 'Veuillez remplir le formulaire';
1396
+ class FormStepperDialogComponent {
1397
+ formStepper = viewChild(FormStepperComponent, ...(ngDevMode ? [{ debugName: "formStepper" }] : /* istanbul ignore next */ []));
1398
+ dialogRef = inject(MatDialogRef);
1399
+ data = inject(MAT_DIALOG_DATA);
1400
+ initialData;
1401
+ constructor() {
1402
+ if (!this.data.steps?.length) {
1403
+ throw new Error('Form stepper dialog requires at least one step.');
1404
+ }
1405
+ this.data.title = this.data.title ?? DEFAULT_FORM_STEPPER_DIALOG_TITLE;
1406
+ this.initialData = { ...(this.data.data$?.value ?? {}) };
1407
+ }
1408
+ onDataChange(data) {
1409
+ this.data.data$?.next(data);
1410
+ }
1411
+ cancel() {
1412
+ this.dialogRef.close();
1413
+ }
1414
+ onCompleted(data) {
1415
+ this.data.data$?.next(data);
1416
+ this.dialogRef.close(data);
1417
+ }
1418
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormStepperDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1419
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.24", type: FormStepperDialogComponent, isStandalone: true, selector: "igo-form-stepper-dialog", viewQueries: [{ propertyName: "formStepper", first: true, predicate: FormStepperComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<h1 mat-dialog-title>{{ data.title }}</h1>\n\n<igo-form-stepper\n [steps]=\"data.steps\"\n [initialData]=\"initialData\"\n [notice]=\"data.notice\"\n [labels]=\"data.labels\"\n (dataChange)=\"onDataChange($event)\"\n (completed)=\"onCompleted($event)\"\n (cancelled)=\"cancel()\"\n/>\n", styles: [":host{display:block}:host ::ng-deep igo-form-stepper{display:block;padding:14px;border:1px solid #d6e1ef;border-radius:18px;background:#fff}:host ::ng-deep igo-form-stepper .form-stepper-content{padding-top:10px}:host ::ng-deep igo-form-stepper .form-stepper-header{margin-bottom:10px;padding:0 0 12px;border:0;border-bottom:1px solid #d6e1ef;border-radius:0;background:transparent;box-shadow:none}:host ::ng-deep igo-form-stepper .form-stepper-notice{margin-top:10px;border-radius:12px}@media(max-width:640px){:host ::ng-deep igo-form-stepper{padding:12px;border-radius:16px}:host ::ng-deep igo-form-stepper .form-stepper-content{padding-top:8px}:host ::ng-deep igo-form-stepper .form-stepper-header{margin-bottom:8px;padding-bottom:10px}}\n"], dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "component", type: FormStepperComponent, selector: "igo-form-stepper", inputs: ["steps", "initialData", "notice", "labels", "showCancelButton"], outputs: ["completed", "cancelled", "dataChange"] }] });
1420
+ }
1421
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormStepperDialogComponent, decorators: [{
1422
+ type: Component,
1423
+ args: [{ selector: 'igo-form-stepper-dialog', imports: [MatDialogModule, FormStepperComponent], template: "<h1 mat-dialog-title>{{ data.title }}</h1>\n\n<igo-form-stepper\n [steps]=\"data.steps\"\n [initialData]=\"initialData\"\n [notice]=\"data.notice\"\n [labels]=\"data.labels\"\n (dataChange)=\"onDataChange($event)\"\n (completed)=\"onCompleted($event)\"\n (cancelled)=\"cancel()\"\n/>\n", styles: [":host{display:block}:host ::ng-deep igo-form-stepper{display:block;padding:14px;border:1px solid #d6e1ef;border-radius:18px;background:#fff}:host ::ng-deep igo-form-stepper .form-stepper-content{padding-top:10px}:host ::ng-deep igo-form-stepper .form-stepper-header{margin-bottom:10px;padding:0 0 12px;border:0;border-bottom:1px solid #d6e1ef;border-radius:0;background:transparent;box-shadow:none}:host ::ng-deep igo-form-stepper .form-stepper-notice{margin-top:10px;border-radius:12px}@media(max-width:640px){:host ::ng-deep igo-form-stepper{padding:12px;border-radius:16px}:host ::ng-deep igo-form-stepper .form-stepper-content{padding-top:8px}:host ::ng-deep igo-form-stepper .form-stepper-header{margin-bottom:8px;padding-bottom:10px}}\n"] }]
1424
+ }], ctorParameters: () => [], propDecorators: { formStepper: [{ type: i0.ViewChild, args: [i0.forwardRef(() => FormStepperComponent), { isSignal: true }] }] } });
1425
+
756
1426
  class FormDialogService {
757
1427
  dialog = inject(MatDialog);
758
1428
  open(formDialogConfig, options) {
@@ -768,10 +1438,24 @@ class FormDialogService {
768
1438
  });
769
1439
  return dialogRef.afterClosed();
770
1440
  }
771
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
772
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormDialogService });
1441
+ openStepper(formDialogStepperConfig, options) {
1442
+ const data = {
1443
+ steps: formDialogStepperConfig.steps,
1444
+ ...options
1445
+ };
1446
+ const dialogRef = this.dialog.open(FormStepperDialogComponent, {
1447
+ disableClose: false,
1448
+ width: 'min(92vw, 44rem)',
1449
+ maxWidth: '95vw',
1450
+ data,
1451
+ ...options
1452
+ });
1453
+ return dialogRef.afterClosed();
1454
+ }
1455
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1456
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormDialogService });
773
1457
  }
774
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormDialogService, decorators: [{
1458
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: FormDialogService, decorators: [{
775
1459
  type: Injectable
776
1460
  }] });
777
1461
 
@@ -788,15 +1472,32 @@ class IgoFormDialogModule {
788
1472
  providers: []
789
1473
  };
790
1474
  }
791
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoFormDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
792
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.10", ngImport: i0, type: IgoFormDialogModule, imports: [MatDialogModule, FormDialogComponent], exports: [FormDialogComponent] });
793
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoFormDialogModule, providers: [FormDialogService], imports: [MatDialogModule, FormDialogComponent] });
1475
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: IgoFormDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1476
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.24", ngImport: i0, type: IgoFormDialogModule, imports: [MatDialogModule,
1477
+ FormDialogComponent,
1478
+ FormStepperComponent,
1479
+ FormStepperDialogComponent], exports: [FormDialogComponent,
1480
+ FormStepperComponent,
1481
+ FormStepperDialogComponent] });
1482
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: IgoFormDialogModule, providers: [FormDialogService], imports: [MatDialogModule,
1483
+ FormDialogComponent,
1484
+ FormStepperComponent,
1485
+ FormStepperDialogComponent] });
794
1486
  }
795
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoFormDialogModule, decorators: [{
1487
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: IgoFormDialogModule, decorators: [{
796
1488
  type: NgModule,
797
1489
  args: [{
798
- imports: [MatDialogModule, FormDialogComponent],
799
- exports: [FormDialogComponent],
1490
+ imports: [
1491
+ MatDialogModule,
1492
+ FormDialogComponent,
1493
+ FormStepperComponent,
1494
+ FormStepperDialogComponent
1495
+ ],
1496
+ exports: [
1497
+ FormDialogComponent,
1498
+ FormStepperComponent,
1499
+ FormStepperDialogComponent
1500
+ ],
800
1501
  providers: [FormDialogService]
801
1502
  }]
802
1503
  }] });
@@ -805,5 +1506,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
805
1506
  * Generated bundle index. Do not edit.
806
1507
  */
807
1508
 
808
- export { FORM_DIRECTIVES, FORM_FIELD_DIRECTIVES, FormComponent, FormDialogComponent, FormDialogService, FormFieldComponent, FormFieldSelectComponent, FormFieldService, FormFieldTextComponent, FormFieldTextareaComponent, FormGroupComponent, FormService, IgoFormDialogModule, IgoFormFieldComponent, IgoFormFieldModule, IgoFormFormModule, IgoFormGroupModule, IgoFormModule, formControlIsRequired, getAllFormFields, getControlErrorMessage, getDefaultErrorMessages, getFormFieldByName };
1509
+ export { DEFAULT_FORM_STEPPER_DIALOG_TITLE, FORM_DIRECTIVES, FORM_FIELD_DIRECTIVES, FormComponent, FormDialogComponent, FormDialogService, FormFieldCheckboxComponent, FormFieldComponent, FormFieldDatetimeComponent, FormFieldNumberComponent, FormFieldRadiobuttonComponent, FormFieldSelectComponent, FormFieldService, FormFieldTextComponent, FormFieldTextareaComponent, FormGroupComponent, FormService, FormStepperComponent, FormStepperDialogComponent, IgoFormDialogModule, IgoFormFieldComponent, IgoFormFieldModule, IgoFormFormModule, IgoFormGroupModule, IgoFormModule, buildFormFromConfig, formControlIsRequired, getAllFormFields, getControlErrorMessage, getDefaultErrorMessages, getFormFieldByName, markFormAsTouched };
809
1510
  //# sourceMappingURL=igo2-common-form.mjs.map