@igo2/common 21.0.0-next.32 → 21.0.0-next.34

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.
@@ -1,35 +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, FormGroup, FormControl, 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 * as i4 from '@angular/material/checkbox';
8
+ import { MatCheckboxModule } from '@angular/material/checkbox';
9
+ import { ErrorStateMatcher, provideNativeDateAdapter, MatOptionModule } from '@angular/material/core';
10
+ import * as i1 from '@angular/material/form-field';
11
+ import { MatFormFieldModule } from '@angular/material/form-field';
12
+ import { IgoLanguageModule, labelAttribute, LanguageService } from '@igo2/core/language';
13
+ import { Subject, BehaviorSubject } from 'rxjs';
14
+ import { takeUntil } from 'rxjs/operators';
15
+ import * as i5 from '@ngx-translate/core';
7
16
  import * as i8 from '@angular/material/button';
8
17
  import { MatButtonModule } from '@angular/material/button';
9
- import * as i4$1 from '@angular/material/checkbox';
10
- import { MatCheckboxModule } from '@angular/material/checkbox';
11
- import { provideNativeDateAdapter, MatOptionModule } from '@angular/material/core';
12
18
  import * as i3$1 from '@angular/material/datepicker';
13
19
  import { MatDatepickerModule } from '@angular/material/datepicker';
14
- import * as i1 from '@angular/material/form-field';
15
- import { MatFormFieldModule } from '@angular/material/form-field';
16
20
  import * as i7 from '@angular/material/icon';
17
21
  import { MatIconModule } from '@angular/material/icon';
18
22
  import * as i2 from '@angular/material/input';
19
23
  import { MatInputModule } from '@angular/material/input';
20
- import * as i4 from '@angular/material/timepicker';
24
+ import * as i4$1 from '@angular/material/timepicker';
21
25
  import { MatTimepickerModule } from '@angular/material/timepicker';
22
- import { IgoLanguageModule, LanguageService } from '@igo2/core/language';
23
- import { Subject, BehaviorSubject } from 'rxjs';
24
- import { takeUntil } from 'rxjs/operators';
25
- import * as i5 from '@ngx-translate/core';
26
+ import * as i4$2 from '@angular/material/radio';
27
+ import { MatRadioModule } from '@angular/material/radio';
26
28
  import * as i2$1 from '@angular/material/select';
27
29
  import { MatSelectModule } from '@angular/material/select';
28
30
  import { DynamicOutletComponent } from '@igo2/common/dynamic-component';
29
31
  import { NgClass, AsyncPipe } from '@angular/common';
30
- import { MatDialogRef, MAT_DIALOG_DATA, MatDialogTitle, MatDialogActions, MatDialog, MatDialogModule } from '@angular/material/dialog';
31
- import { CustomHtmlComponent } from '@igo2/common/custom-html';
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';
32
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
+ }
33
66
  function formControlIsRequired(control) {
34
67
  if (control.validator) {
35
68
  const validator = control.validator({});
@@ -205,6 +238,126 @@ function IgoFormFieldComponent(type) {
205
238
  };
206
239
  }
207
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.23", ngImport: i0, type: FormFieldCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
346
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", 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.23", 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
+
208
361
  let FormFieldDatetimeComponent = class FormFieldDatetimeComponent {
209
362
  disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
210
363
  dateTimeGroup = new FormGroup({
@@ -389,7 +542,7 @@ let FormFieldDatetimeComponent = class FormFieldDatetimeComponent {
389
542
  return null;
390
543
  }
391
544
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: FormFieldDatetimeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
392
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", 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.MatTimepicker, selector: "mat-timepicker", inputs: ["interval", "options", "disableRipple", "aria-label", "aria-labelledby", "panelClass"], outputs: ["selected", "opened", "closed"], exportAs: ["matTimepicker"] }, { kind: "directive", type: i4.MatTimepickerInput, selector: "input[matTimepicker]", inputs: ["value", "matTimepicker", "matTimepickerMin", "matTimepickerMax", "matTimepickerOpenOnClick", "disabled"], outputs: ["valueChange"], exportAs: ["matTimepickerInput"] }, { kind: "component", type: i4.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$1.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 });
545
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", 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 });
393
546
  };
394
547
  FormFieldDatetimeComponent = __decorate([
395
548
  IgoFormFieldComponent('datetime')
@@ -465,7 +618,7 @@ let FormFieldNumberComponent = class FormFieldNumberComponent {
465
618
  this.disabled.set(disabled);
466
619
  }
467
620
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: FormFieldNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
468
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", 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$1.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 });
621
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", 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 });
469
622
  };
470
623
  FormFieldNumberComponent = __decorate([
471
624
  IgoFormFieldComponent('number')
@@ -483,6 +636,74 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
483
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" }]
484
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 }] }] } });
485
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.23", ngImport: i0, type: FormFieldRadiobuttonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
690
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", 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.23", 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
+
486
707
  /**
487
708
  * This component renders a select field
488
709
  */
@@ -545,7 +766,7 @@ let FormFieldSelectComponent = class FormFieldSelectComponent {
545
766
  this.disabled.set(disabled);
546
767
  }
547
768
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: FormFieldSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
548
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", 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$1.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 });
769
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", 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 });
549
770
  };
550
771
  FormFieldSelectComponent = __decorate([
551
772
  IgoFormFieldComponent('select')
@@ -639,7 +860,7 @@ let FormFieldTextComponent = class FormFieldTextComponent {
639
860
  }
640
861
  }
641
862
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: FormFieldTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
642
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", 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$1.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 });
863
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", 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 });
643
864
  };
644
865
  FormFieldTextComponent = __decorate([
645
866
  IgoFormFieldComponent('text')
@@ -712,7 +933,7 @@ let FormFieldTextareaComponent = class FormFieldTextareaComponent {
712
933
  this.disabled.set(disabled);
713
934
  }
714
935
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: FormFieldTextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
715
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", 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$1.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 });
936
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", 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 });
716
937
  };
717
938
  FormFieldTextareaComponent = __decorate([
718
939
  IgoFormFieldComponent('textarea')
@@ -859,8 +1080,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
859
1080
 
860
1081
  const FORM_FIELD_DIRECTIVES = [
861
1082
  FormFieldComponent,
1083
+ FormFieldCheckboxComponent,
862
1084
  FormFieldDatetimeComponent,
863
1085
  FormFieldNumberComponent,
1086
+ FormFieldRadiobuttonComponent,
864
1087
  FormFieldSelectComponent,
865
1088
  FormFieldTextComponent,
866
1089
  FormFieldTextareaComponent
@@ -871,7 +1094,7 @@ const FORM_FIELD_DIRECTIVES = [
871
1094
  */
872
1095
  class IgoFormFieldModule {
873
1096
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: IgoFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
874
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.23", ngImport: i0, type: IgoFormFieldModule, imports: [FormFieldComponent, FormFieldDatetimeComponent, FormFieldNumberComponent, FormFieldSelectComponent, FormFieldTextComponent, FormFieldTextareaComponent], exports: [FormFieldComponent, FormFieldDatetimeComponent, FormFieldNumberComponent, FormFieldSelectComponent, FormFieldTextComponent, FormFieldTextareaComponent] });
1097
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.23", ngImport: i0, type: IgoFormFieldModule, imports: [FormFieldComponent, FormFieldCheckboxComponent, FormFieldDatetimeComponent, FormFieldNumberComponent, FormFieldRadiobuttonComponent, FormFieldSelectComponent, FormFieldTextComponent, FormFieldTextareaComponent], exports: [FormFieldComponent, FormFieldCheckboxComponent, FormFieldDatetimeComponent, FormFieldNumberComponent, FormFieldRadiobuttonComponent, FormFieldSelectComponent, FormFieldTextComponent, FormFieldTextareaComponent] });
875
1098
  static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: IgoFormFieldModule, imports: [FORM_FIELD_DIRECTIVES] });
876
1099
  }
877
1100
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: IgoFormFieldModule, decorators: [{
@@ -936,11 +1159,11 @@ class FormGroupComponent {
936
1159
  return getControlErrorMessage(this.formControl, options.errors || {});
937
1160
  }
938
1161
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: FormGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
939
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", 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 });
1162
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", 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 });
940
1163
  }
941
1164
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: FormGroupComponent, decorators: [{
942
1165
  type: Component,
943
- 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"] }]
944
1167
  }], propDecorators: { group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required: true }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }] } });
945
1168
 
946
1169
  /**
@@ -969,8 +1192,8 @@ const FORM_DIRECTIVES = [
969
1192
  */
970
1193
  class IgoFormModule {
971
1194
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: IgoFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
972
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.23", ngImport: i0, type: IgoFormModule, imports: [FormFieldComponent, FormFieldDatetimeComponent, FormFieldNumberComponent, FormFieldSelectComponent, FormFieldTextComponent, FormFieldTextareaComponent, FormGroupComponent,
973
- FormComponent], exports: [FormFieldComponent, FormFieldDatetimeComponent, FormFieldNumberComponent, FormFieldSelectComponent, FormFieldTextComponent, FormFieldTextareaComponent, FormGroupComponent,
1195
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.23", 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,
974
1197
  FormComponent] });
975
1198
  static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: IgoFormModule, imports: [FORM_DIRECTIVES] });
976
1199
  }
@@ -982,6 +1205,144 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
982
1205
  }]
983
1206
  }] });
984
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.23", ngImport: i0, type: FormStepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1333
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", 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.23", 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
+
985
1346
  class FormDialogComponent {
986
1347
  languageService = inject(LanguageService);
987
1348
  dialogRef = inject(MatDialogRef);
@@ -996,14 +1357,7 @@ class FormDialogComponent {
996
1357
  this.data.cancelButtonText ?? 'igo.common.formDialog.cancelButtonText';
997
1358
  this.data.title = this.data.title ?? 'igo.common.formDialog.title';
998
1359
  this.data$ = this.data.data$ ?? new BehaviorSubject({});
999
- const fields = [];
1000
- const groups = [];
1001
- this.data.formFieldConfigs?.map((config) => fields.push(this.formService.field(config)));
1002
- this.data.formGroupsConfigs?.map((formGroupsConfig) => {
1003
- const fields = formGroupsConfig.formFieldConfigs?.map((config) => this.formService.field(config));
1004
- groups.push(this.formService.group({ name: formGroupsConfig.name }, fields));
1005
- });
1006
- const form = this.formService.form(fields, groups);
1360
+ const form = buildFormFromConfig(this.formService, this.data);
1007
1361
  this.form$.next(form);
1008
1362
  }
1009
1363
  onSubmit(data) {
@@ -1014,27 +1368,14 @@ class FormDialogComponent {
1014
1368
  this.dialogRef.close(data);
1015
1369
  }
1016
1370
  else {
1017
- if (form.groups?.length) {
1018
- form.groups.map((group) => {
1019
- Object.keys(group.control.controls).map((k) => {
1020
- group.control.controls[k].markAsTouched();
1021
- group.control.controls[k].updateValueAndValidity();
1022
- });
1023
- });
1024
- }
1025
- else {
1026
- form.fields.map((f) => {
1027
- f.control.markAsTouched();
1028
- f.control.updateValueAndValidity();
1029
- });
1030
- }
1371
+ markFormAsTouched(form);
1031
1372
  }
1032
1373
  }
1033
1374
  cancel() {
1034
1375
  this.dialogRef.close();
1035
1376
  }
1036
1377
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: FormDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1037
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", 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: 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" }] });
1378
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", 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" }] });
1038
1379
  }
1039
1380
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: FormDialogComponent, decorators: [{
1040
1381
  type: Component,
@@ -1048,9 +1389,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
1048
1389
  CustomHtmlComponent,
1049
1390
  AsyncPipe,
1050
1391
  IgoLanguageModule
1051
- ], 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"] }]
1052
1393
  }], ctorParameters: () => [] });
1053
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.23", ngImport: i0, type: FormStepperDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1419
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.23", 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.23", 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
+
1054
1426
  class FormDialogService {
1055
1427
  dialog = inject(MatDialog);
1056
1428
  open(formDialogConfig, options) {
@@ -1066,6 +1438,20 @@ class FormDialogService {
1066
1438
  });
1067
1439
  return dialogRef.afterClosed();
1068
1440
  }
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
+ }
1069
1455
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: FormDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1070
1456
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: FormDialogService });
1071
1457
  }
@@ -1087,14 +1473,31 @@ class IgoFormDialogModule {
1087
1473
  };
1088
1474
  }
1089
1475
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: IgoFormDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1090
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.23", ngImport: i0, type: IgoFormDialogModule, imports: [MatDialogModule, FormDialogComponent], exports: [FormDialogComponent] });
1091
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: IgoFormDialogModule, providers: [FormDialogService], imports: [MatDialogModule, FormDialogComponent] });
1476
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.23", 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.23", ngImport: i0, type: IgoFormDialogModule, providers: [FormDialogService], imports: [MatDialogModule,
1483
+ FormDialogComponent,
1484
+ FormStepperComponent,
1485
+ FormStepperDialogComponent] });
1092
1486
  }
1093
1487
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: IgoFormDialogModule, decorators: [{
1094
1488
  type: NgModule,
1095
1489
  args: [{
1096
- imports: [MatDialogModule, FormDialogComponent],
1097
- exports: [FormDialogComponent],
1490
+ imports: [
1491
+ MatDialogModule,
1492
+ FormDialogComponent,
1493
+ FormStepperComponent,
1494
+ FormStepperDialogComponent
1495
+ ],
1496
+ exports: [
1497
+ FormDialogComponent,
1498
+ FormStepperComponent,
1499
+ FormStepperDialogComponent
1500
+ ],
1098
1501
  providers: [FormDialogService]
1099
1502
  }]
1100
1503
  }] });
@@ -1103,5 +1506,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
1103
1506
  * Generated bundle index. Do not edit.
1104
1507
  */
1105
1508
 
1106
- export { FORM_DIRECTIVES, FORM_FIELD_DIRECTIVES, FormComponent, FormDialogComponent, FormDialogService, FormFieldComponent, FormFieldDatetimeComponent, FormFieldNumberComponent, 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 };
1107
1510
  //# sourceMappingURL=igo2-common-form.mjs.map