@igo2/common 21.0.0-next.31 → 21.0.0-next.33

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.
@@ -6,7 +6,6 @@ export { IgoKeyValueModule } from '@igo2/common/keyvalue';
6
6
  export { IgoFormDialogModule, IgoFormFieldModule, IgoFormFormModule, IgoFormGroupModule, IgoFormModule } from '@igo2/common/form';
7
7
  export { IgoListModule } from '@igo2/common/list';
8
8
  export { IgoPanelModule } from '@igo2/common/panel';
9
- export { IgoSelectValueDialogModule } from '@igo2/common/select-value-dialog';
10
9
  export { IgoSidenavModule } from '@igo2/common/sidenav';
11
10
  export { IgoSpinnerModule } from '@igo2/common/spinner';
12
11
  export { IgoStopPropagationModule } from '@igo2/common/stop-propagation';
@@ -1 +1 @@
1
- {"version":3,"file":"igo2-common.mjs","sources":["../../../packages/common/src/public_api.ts","../../../packages/common/src/igo2-common.ts"],"sourcesContent":["/*\n * Public API Surface of common\n */\n\nexport { IgoHomeButtonModule } from '@igo2/common/home-button';\nexport { IgoImageModule } from '@igo2/common/image';\nexport { IgoInteractiveTourModule } from '@igo2/common/interactive-tour';\nexport { IgoJsonDialogModule } from '@igo2/common/json-dialog';\nexport { IgoKeyValueModule } from '@igo2/common/keyvalue';\nexport {\n IgoFormDialogModule,\n IgoFormFormModule,\n IgoFormFieldModule,\n IgoFormGroupModule,\n IgoFormModule\n} from '@igo2/common/form';\nexport { IgoListModule } from '@igo2/common/list';\nexport { IgoPanelModule } from '@igo2/common/panel';\nexport { IgoSelectValueDialogModule } from '@igo2/common/select-value-dialog';\nexport { IgoSidenavModule } from '@igo2/common/sidenav';\nexport { IgoSpinnerModule } from '@igo2/common/spinner';\nexport { IgoStopPropagationModule } from '@igo2/common/stop-propagation';\nexport { IgoTableModule } from '@igo2/common/table';\nexport { IgoToolModule, IgoToolboxModule } from '@igo2/common/tool';\nexport { IgoWidgetModule, IgoWidgetOutletModule } from '@igo2/common/widget';\nexport {\n IgoWorkspaceModule,\n IgoWorkspaceSelectorModule,\n IgoWorkspaceWidgetOutletModule\n} from '@igo2/common/workspace';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AAEG;;ACFH;;AAEG"}
1
+ {"version":3,"file":"igo2-common.mjs","sources":["../../../packages/common/src/public_api.ts","../../../packages/common/src/igo2-common.ts"],"sourcesContent":["/*\n * Public API Surface of common\n */\n\nexport { IgoHomeButtonModule } from '@igo2/common/home-button';\nexport { IgoImageModule } from '@igo2/common/image';\nexport { IgoInteractiveTourModule } from '@igo2/common/interactive-tour';\nexport { IgoJsonDialogModule } from '@igo2/common/json-dialog';\nexport { IgoKeyValueModule } from '@igo2/common/keyvalue';\nexport {\n IgoFormDialogModule,\n IgoFormFormModule,\n IgoFormFieldModule,\n IgoFormGroupModule,\n IgoFormModule\n} from '@igo2/common/form';\nexport { IgoListModule } from '@igo2/common/list';\nexport { IgoPanelModule } from '@igo2/common/panel';\nexport { IgoSidenavModule } from '@igo2/common/sidenav';\nexport { IgoSpinnerModule } from '@igo2/common/spinner';\nexport { IgoStopPropagationModule } from '@igo2/common/stop-propagation';\nexport { IgoTableModule } from '@igo2/common/table';\nexport { IgoToolModule, IgoToolboxModule } from '@igo2/common/tool';\nexport { IgoWidgetModule, IgoWidgetOutletModule } from '@igo2/common/widget';\nexport {\n IgoWorkspaceModule,\n IgoWorkspaceSelectorModule,\n IgoWorkspaceWidgetOutletModule\n} from '@igo2/common/workspace';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;AAEG;;ACFH;;AAEG"}
@@ -15,18 +15,18 @@
15
15
  "maxLevel": "The maximum hierarchical level is reached ({{value}})"
16
16
  }
17
17
  },
18
- "selectValueDialog": {
19
- "cancelButtonText": "Cancel",
20
- "processButtonText": "Select",
21
- "multipleTitle": "Please, select values",
22
- "title": "Please, select a value",
23
- "selectFieldText": "Options"
24
- },
25
18
  "formDialog": {
26
19
  "cancelButtonText": "Cancel",
27
20
  "processButtonText": "Submit",
28
21
  "title": "Fill the form"
29
22
  },
23
+ "formStepper": {
24
+ "cancelButtonText": "Cancel",
25
+ "processButtonText": "Submit",
26
+ "nextButtonText": "Next",
27
+ "previousButtonText": "Previous",
28
+ "stepCounter": "Step {{current}} of {{total}}"
29
+ },
30
30
  "table": {
31
31
  "filter": "Filter"
32
32
  },
@@ -15,18 +15,18 @@
15
15
  "maxLevel": "Le maximum de niveau hiérarchique est atteint ({{value}})"
16
16
  }
17
17
  },
18
- "selectValueDialog": {
19
- "cancelButtonText": "Annuler",
20
- "processButtonText": "Sélectionner",
21
- "multipleTitle": "Veuiller sélectionner une ou plusieurs valeurs",
22
- "title": "Veuiller sélectionner une valeur",
23
- "selectFieldText": "Options"
24
- },
25
18
  "formDialog": {
26
19
  "cancelButtonText": "Annuler",
27
20
  "processButtonText": "Confirmer",
28
21
  "title": "Veuiller remplir le formulaire"
29
22
  },
23
+ "formStepper": {
24
+ "cancelButtonText": "Annuler",
25
+ "processButtonText": "Confirmer",
26
+ "nextButtonText": "Suivant",
27
+ "previousButtonText": "Précédent",
28
+ "stepCounter": "Étape {{current}} de {{total}}"
29
+ },
30
30
  "table": {
31
31
  "filter": "Filtre"
32
32
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@igo2/common",
3
- "version": "21.0.0-next.31",
3
+ "version": "21.0.0-next.33",
4
4
  "description": "IGO Library",
5
5
  "author": "IGO Community",
6
6
  "keywords": [
@@ -135,10 +135,6 @@
135
135
  "types": "./types/igo2-common-resizable-bar.d.ts",
136
136
  "default": "./fesm2022/igo2-common-resizable-bar.mjs"
137
137
  },
138
- "./select-value-dialog": {
139
- "types": "./types/igo2-common-select-value-dialog.d.ts",
140
- "default": "./fesm2022/igo2-common-select-value-dialog.mjs"
141
- },
142
138
  "./sidenav": {
143
139
  "types": "./types/igo2-common-sidenav.d.ts",
144
140
  "default": "./fesm2022/igo2-common-sidenav.mjs"
@@ -186,8 +182,8 @@
186
182
  "@angular/material": "^21.0.0",
187
183
  "@angular/platform-browser": "^21.0.0",
188
184
  "@floating-ui/utils": "^0.2.0",
189
- "@igo2/core": "^21.0.0-next.31",
190
- "@igo2/utils": "^21.0.0-next.31",
185
+ "@igo2/core": "^21.0.0-next.33",
186
+ "@igo2/utils": "^21.0.0-next.33",
191
187
  "angular-shepherd": "^22.0.0",
192
188
  "ngx-color": "^10.1.0",
193
189
  "scroll-into-view-if-needed": "^3.1.0",
@@ -3,6 +3,7 @@ import * as _angular_core from '@angular/core';
3
3
  import { OnChanges, ElementRef, SimpleChanges, OnInit, OnDestroy, ModuleWithProviders } from '@angular/core';
4
4
  import { ValidatorFn, UntypedFormControl, UntypedFormGroup, FormGroup, FormControl, AbstractControl } from '@angular/forms';
5
5
  import { BehaviorSubject, Observable } from 'rxjs';
6
+ import { MatCheckboxChange } from '@angular/material/checkbox';
6
7
  import * as i1 from '@angular/material/dialog';
7
8
  import { MatDialogConfig, MatDialogRef } from '@angular/material/dialog';
8
9
  import { LanguageService } from '@igo2/core/language';
@@ -60,8 +61,15 @@ interface FormFieldInputs {
60
61
  interface FormFieldSelectInputs extends FormFieldInputs {
61
62
  choices: BehaviorSubject<FormFieldSelectChoice[]> | FormFieldSelectChoice[];
62
63
  }
64
+ interface FormFieldChoiceInputs extends FormFieldInputs {
65
+ choices: FormFieldSelectChoice[];
66
+ }
67
+ interface FormFieldCheckboxInputs extends FormFieldChoiceInputs {
68
+ maxSelected?: number;
69
+ }
70
+ type FormFieldRadiobuttonInputs = FormFieldChoiceInputs;
63
71
  interface FormFieldSelectChoice {
64
- value: any;
72
+ value: unknown;
65
73
  title: string;
66
74
  }
67
75
 
@@ -195,6 +203,37 @@ declare class FormFieldComponent {
195
203
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormFieldComponent, "igo-form-field", never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
196
204
  }
197
205
 
206
+ declare class FormFieldCheckboxComponent implements OnInit, OnDestroy {
207
+ private errorStateMatcher;
208
+ private parentForm;
209
+ private parentFormGroup;
210
+ readonly disabled: _angular_core.WritableSignal<boolean>;
211
+ private readonly showErrorState;
212
+ private selectedValues;
213
+ private destroy$;
214
+ readonly choices: _angular_core.InputSignal<_igo2_common_form.FormFieldSelectChoice[]>;
215
+ readonly formControl: _angular_core.InputSignal<UntypedFormControl>;
216
+ readonly showLabel: _angular_core.InputSignal<boolean>;
217
+ readonly placeholder: _angular_core.InputSignal<string | undefined>;
218
+ readonly errors: _angular_core.InputSignal<Record<string, string> | undefined>;
219
+ readonly maxSelected: _angular_core.InputSignal<number | undefined>;
220
+ readonly disableSwitch: _angular_core.InputSignal<boolean>;
221
+ get required(): boolean;
222
+ ngOnInit(): void;
223
+ ngOnDestroy(): void;
224
+ getErrorMessage(): string;
225
+ showError(): boolean;
226
+ isChecked(value: unknown): boolean;
227
+ onChoiceChange(value: unknown, event: MatCheckboxChange): void;
228
+ onDisableSwitchClick(): void;
229
+ private normalizeValue;
230
+ private syncState;
231
+ private toggleDisabled;
232
+ private maxSelectedValidator;
233
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormFieldCheckboxComponent, never>;
234
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormFieldCheckboxComponent, "igo-form-field-checkbox", never, { "choices": { "alias": "choices"; "required": true; "isSignal": true; }; "formControl": { "alias": "formControl"; "required": true; "isSignal": true; }; "showLabel": { "alias": "showLabel"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "errors": { "alias": "errors"; "required": false; "isSignal": true; }; "maxSelected": { "alias": "maxSelected"; "required": false; "isSignal": true; }; "disableSwitch": { "alias": "disableSwitch"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
235
+ }
236
+
198
237
  declare class FormFieldDatetimeComponent implements OnInit, OnDestroy {
199
238
  readonly disabled: _angular_core.WritableSignal<boolean>;
200
239
  readonly dateTimeGroup: FormGroup<{
@@ -320,6 +359,31 @@ declare class FormFieldNumberComponent implements OnInit {
320
359
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormFieldNumberComponent, "igo-form-field-number", never, { "formControl": { "alias": "formControl"; "required": true; "isSignal": true; }; "showLabel": { "alias": "showLabel"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "errors": { "alias": "errors"; "required": false; "isSignal": true; }; "disableSwitch": { "alias": "disableSwitch"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
321
360
  }
322
361
 
362
+ declare class FormFieldRadiobuttonComponent implements OnInit, OnDestroy {
363
+ private errorStateMatcher;
364
+ private parentForm;
365
+ private parentFormGroup;
366
+ readonly disabled: _angular_core.WritableSignal<boolean>;
367
+ private readonly showErrorState;
368
+ private destroy$;
369
+ readonly choices: _angular_core.InputSignal<_igo2_common_form.FormFieldSelectChoice[]>;
370
+ readonly formControl: _angular_core.InputSignal<UntypedFormControl>;
371
+ readonly showLabel: _angular_core.InputSignal<boolean>;
372
+ readonly placeholder: _angular_core.InputSignal<string | undefined>;
373
+ readonly errors: _angular_core.InputSignal<Record<string, string> | undefined>;
374
+ readonly disableSwitch: _angular_core.InputSignal<boolean>;
375
+ get required(): boolean;
376
+ ngOnInit(): void;
377
+ ngOnDestroy(): void;
378
+ getErrorMessage(): string;
379
+ showError(): boolean;
380
+ onDisableSwitchClick(): void;
381
+ private syncState;
382
+ private toggleDisabled;
383
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormFieldRadiobuttonComponent, never>;
384
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormFieldRadiobuttonComponent, "igo-form-field-radiobutton", never, { "choices": { "alias": "choices"; "required": true; "isSignal": true; }; "formControl": { "alias": "formControl"; "required": true; "isSignal": true; }; "showLabel": { "alias": "showLabel"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "errors": { "alias": "errors"; "required": false; "isSignal": true; }; "disableSwitch": { "alias": "disableSwitch"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
385
+ }
386
+
323
387
  /**
324
388
  * This component renders a select field
325
389
  */
@@ -457,16 +521,38 @@ declare class FormFieldTextareaComponent implements OnInit {
457
521
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormFieldTextareaComponent, "igo-form-field-textarea", never, { "formControl": { "alias": "formControl"; "required": true; "isSignal": true; }; "showLabel": { "alias": "showLabel"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "errors": { "alias": "errors"; "required": false; "isSignal": true; }; "disableSwitch": { "alias": "disableSwitch"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
458
522
  }
459
523
 
460
- declare const FORM_DIRECTIVES: readonly [typeof _igo2_common_form.FormFieldComponent, typeof _igo2_common_form.FormFieldDatetimeComponent, typeof _igo2_common_form.FormFieldNumberComponent, typeof _igo2_common_form.FormFieldSelectComponent, typeof _igo2_common_form.FormFieldTextComponent, typeof _igo2_common_form.FormFieldTextareaComponent, typeof FormGroupComponent, typeof FormComponent];
524
+ declare const FORM_DIRECTIVES: readonly [typeof _igo2_common_form.FormFieldComponent, typeof _igo2_common_form.FormFieldCheckboxComponent, typeof _igo2_common_form.FormFieldDatetimeComponent, typeof _igo2_common_form.FormFieldNumberComponent, typeof _igo2_common_form.FormFieldRadiobuttonComponent, typeof _igo2_common_form.FormFieldSelectComponent, typeof _igo2_common_form.FormFieldTextComponent, typeof _igo2_common_form.FormFieldTextareaComponent, typeof FormGroupComponent, typeof FormComponent];
461
525
  /**
462
526
  * @deprecated import the components directly or FORM_DIRECTIVES for every components/directives
463
527
  */
464
528
  declare class IgoFormModule {
465
529
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<IgoFormModule, never>;
466
- static ɵmod: _angular_core.ɵɵNgModuleDeclaration<IgoFormModule, never, [typeof FormFieldComponent, typeof FormFieldDatetimeComponent, typeof FormFieldNumberComponent, typeof FormFieldSelectComponent, typeof FormFieldTextComponent, typeof FormFieldTextareaComponent, typeof FormGroupComponent, typeof FormComponent], [typeof FormFieldComponent, typeof FormFieldDatetimeComponent, typeof FormFieldNumberComponent, typeof FormFieldSelectComponent, typeof FormFieldTextComponent, typeof FormFieldTextareaComponent, typeof FormGroupComponent, typeof FormComponent]>;
530
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<IgoFormModule, never, [typeof FormFieldComponent, typeof FormFieldCheckboxComponent, typeof FormFieldDatetimeComponent, typeof FormFieldNumberComponent, typeof FormFieldRadiobuttonComponent, typeof FormFieldSelectComponent, typeof FormFieldTextComponent, typeof FormFieldTextareaComponent, typeof FormGroupComponent, typeof FormComponent], [typeof FormFieldComponent, typeof FormFieldCheckboxComponent, typeof FormFieldDatetimeComponent, typeof FormFieldNumberComponent, typeof FormFieldRadiobuttonComponent, typeof FormFieldSelectComponent, typeof FormFieldTextComponent, typeof FormFieldTextareaComponent, typeof FormGroupComponent, typeof FormComponent]>;
467
531
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<IgoFormModule>;
468
532
  }
469
533
 
534
+ interface FormStepperFormConfig {
535
+ formFieldConfigs?: FormFieldConfig[];
536
+ formGroupsConfigs?: FormGroupsConfig[];
537
+ }
538
+ interface FormStepperStepContext {
539
+ data: Readonly<Record<string, unknown>>;
540
+ stepIndex: number;
541
+ steps: readonly FormStepperStepConfig[];
542
+ }
543
+ type FormStepperStepFormConfigResolver = (context: FormStepperStepContext) => FormStepperFormConfig;
544
+ interface FormStepperStepConfig {
545
+ label: string;
546
+ title?: string;
547
+ notice?: string;
548
+ form: FormStepperFormConfig | FormStepperStepFormConfigResolver;
549
+ }
550
+ interface FormStepperConfig {
551
+ steps: FormStepperStepConfig[];
552
+ }
553
+
554
+ declare function buildFormFromConfig(formService: FormService, formConfig?: FormStepperFormConfig): Form;
555
+ declare function markFormAsTouched(form: Form): void;
470
556
  declare function formControlIsRequired(control: AbstractControl): boolean;
471
557
  declare function getDefaultErrorMessages(): Record<string, string>;
472
558
  declare function getControlErrorMessage(control: AbstractControl, messages: Record<string, string>): string;
@@ -508,20 +594,69 @@ declare function IgoFormFieldComponent(type: string): (cls: any) => any;
508
594
  */
509
595
  declare class IgoFormFieldModule {
510
596
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<IgoFormFieldModule, never>;
511
- static ɵmod: _angular_core.ɵɵNgModuleDeclaration<IgoFormFieldModule, never, [typeof FormFieldComponent, typeof FormFieldDatetimeComponent, typeof FormFieldNumberComponent, typeof FormFieldSelectComponent, typeof FormFieldTextComponent, typeof FormFieldTextareaComponent], [typeof FormFieldComponent, typeof FormFieldDatetimeComponent, typeof FormFieldNumberComponent, typeof FormFieldSelectComponent, typeof FormFieldTextComponent, typeof FormFieldTextareaComponent]>;
597
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<IgoFormFieldModule, never, [typeof FormFieldComponent, typeof FormFieldCheckboxComponent, typeof FormFieldDatetimeComponent, typeof FormFieldNumberComponent, typeof FormFieldRadiobuttonComponent, typeof FormFieldSelectComponent, typeof FormFieldTextComponent, typeof FormFieldTextareaComponent], [typeof FormFieldComponent, typeof FormFieldCheckboxComponent, typeof FormFieldDatetimeComponent, typeof FormFieldNumberComponent, typeof FormFieldRadiobuttonComponent, typeof FormFieldSelectComponent, typeof FormFieldTextComponent, typeof FormFieldTextareaComponent]>;
512
598
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<IgoFormFieldModule>;
513
599
  }
514
600
 
515
- declare const FORM_FIELD_DIRECTIVES: readonly [typeof FormFieldComponent, typeof FormFieldDatetimeComponent, typeof FormFieldNumberComponent, typeof FormFieldSelectComponent, typeof FormFieldTextComponent, typeof FormFieldTextareaComponent];
601
+ declare const FORM_FIELD_DIRECTIVES: readonly [typeof FormFieldComponent, typeof FormFieldCheckboxComponent, typeof FormFieldDatetimeComponent, typeof FormFieldNumberComponent, typeof FormFieldRadiobuttonComponent, typeof FormFieldSelectComponent, typeof FormFieldTextComponent, typeof FormFieldTextareaComponent];
516
602
 
517
- interface FormDialogFormConfig {
518
- formFieldConfigs?: FormFieldConfig[];
519
- formGroupsConfigs?: FormGroupsConfig[];
603
+ declare class FormStepperComponent {
604
+ private readonly formService;
605
+ private readonly languageService;
606
+ private readonly activeLanguage;
607
+ readonly steps: _angular_core.InputSignal<FormStepperStepConfig[]>;
608
+ readonly initialData: _angular_core.InputSignal<Record<string, unknown>>;
609
+ readonly notice: _angular_core.InputSignal<string | undefined>;
610
+ readonly nextButtonText: _angular_core.InputSignal<string>;
611
+ readonly previousButtonText: _angular_core.InputSignal<string>;
612
+ readonly processButtonText: _angular_core.InputSignal<string>;
613
+ readonly cancelButtonText: _angular_core.InputSignal<string>;
614
+ readonly showCancelButton: _angular_core.InputSignal<boolean>;
615
+ readonly completed: _angular_core.OutputEmitterRef<Record<string, unknown>>;
616
+ readonly cancelled: _angular_core.OutputEmitterRef<void>;
617
+ readonly dataChange: _angular_core.OutputEmitterRef<Record<string, unknown>>;
618
+ readonly stepIndex: _angular_core.WritableSignal<number>;
619
+ private readonly stepResults;
620
+ readonly activeStep: _angular_core.Signal<FormStepperStepConfig>;
621
+ readonly activeContextData: _angular_core.Signal<Record<string, unknown>>;
622
+ readonly activeFormData: _angular_core.Signal<Record<string, unknown>>;
623
+ readonly activeForm: _angular_core.Signal<Form>;
624
+ readonly activeNotice: _angular_core.Signal<string | undefined>;
625
+ readonly stepCount: _angular_core.Signal<number>;
626
+ readonly stepNumber: _angular_core.Signal<number>;
627
+ readonly stepCounterLabel: _angular_core.Signal<any>;
628
+ readonly progressWidth: _angular_core.Signal<string>;
629
+ readonly maxNavigableStepIndex: _angular_core.Signal<number>;
630
+ readonly isLastStep: _angular_core.Signal<boolean>;
631
+ readonly submitButtonText: _angular_core.Signal<string>;
632
+ onSubmitStep(stepData: Record<string, unknown>): void;
633
+ previous(): void;
634
+ cancel(): void;
635
+ reset(): void;
636
+ onSelectedIndexChange(index: number): void;
637
+ isCompletedStep(index: number): boolean;
638
+ isEditableStep(index: number): boolean;
639
+ private buildAggregateData;
640
+ private buildAggregateDataFrom;
641
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormStepperComponent, never>;
642
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormStepperComponent, "igo-form-stepper", never, { "steps": { "alias": "steps"; "required": true; "isSignal": true; }; "initialData": { "alias": "initialData"; "required": false; "isSignal": true; }; "notice": { "alias": "notice"; "required": false; "isSignal": true; }; "nextButtonText": { "alias": "nextButtonText"; "required": false; "isSignal": true; }; "previousButtonText": { "alias": "previousButtonText"; "required": false; "isSignal": true; }; "processButtonText": { "alias": "processButtonText"; "required": false; "isSignal": true; }; "cancelButtonText": { "alias": "cancelButtonText"; "required": false; "isSignal": true; }; "showCancelButton": { "alias": "showCancelButton"; "required": false; "isSignal": true; }; }, { "completed": "completed"; "cancelled": "cancelled"; "dataChange": "dataChange"; }, never, never, true, never>;
520
643
  }
644
+
645
+ type FormDialogFormConfig = FormStepperFormConfig;
646
+ type FormDialogStepContext = FormStepperStepContext;
647
+ type FormDialogStepFormConfigResolver = FormStepperStepFormConfigResolver;
648
+ type FormDialogStepConfig = FormStepperStepConfig;
649
+ type FormDialogStepperConfig = FormStepperConfig;
521
650
  interface FormDialogData extends FormDialogOptions, FormDialogFormConfig {
522
651
  }
652
+ interface FormDialogStepperOptions extends FormDialogOptions {
653
+ nextButtonText?: string;
654
+ previousButtonText?: string;
655
+ }
656
+ interface FormDialogStepperData extends FormDialogStepperOptions, FormDialogStepperConfig {
657
+ }
523
658
  interface FormDialogOptions extends MatDialogConfig {
524
- data$?: BehaviorSubject<Record<string, any>>;
659
+ data$?: BehaviorSubject<Record<string, unknown>>;
525
660
  title?: string;
526
661
  processButtonText?: string;
527
662
  cancelButtonText?: string;
@@ -533,8 +668,8 @@ declare class FormDialogComponent {
533
668
  dialogRef: MatDialogRef<FormDialogComponent, any>;
534
669
  private formService;
535
670
  data: FormDialogData;
536
- form$: BehaviorSubject<Form | undefined>;
537
- data$: BehaviorSubject<Record<string, any>>;
671
+ form$: BehaviorSubject<_igo2_common_form.Form | undefined>;
672
+ data$: BehaviorSubject<Record<string, unknown>>;
538
673
  constructor();
539
674
  onSubmit(data: Record<string, unknown>): void;
540
675
  cancel(): void;
@@ -542,6 +677,19 @@ declare class FormDialogComponent {
542
677
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormDialogComponent, "igo-form-dialog", never, {}, {}, never, never, true, never>;
543
678
  }
544
679
 
680
+ declare class FormStepperDialogComponent {
681
+ readonly formStepper: _angular_core.Signal<FormStepperComponent | undefined>;
682
+ readonly dialogRef: MatDialogRef<FormStepperDialogComponent, any>;
683
+ readonly data: FormDialogStepperData;
684
+ readonly initialData: Record<string, unknown>;
685
+ constructor();
686
+ onDataChange(data: Record<string, unknown>): void;
687
+ cancel(): void;
688
+ onCompleted(data: Record<string, unknown>): void;
689
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormStepperDialogComponent, never>;
690
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormStepperDialogComponent, "igo-form-stepper-dialog", never, {}, {}, never, never, true, never>;
691
+ }
692
+
545
693
  /**
546
694
  * @deprecated import the FlexibleComponent directly
547
695
  */
@@ -551,16 +699,17 @@ declare class IgoFormDialogModule {
551
699
  */
552
700
  static forRoot(): ModuleWithProviders<IgoFormDialogModule>;
553
701
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<IgoFormDialogModule, never>;
554
- static ɵmod: _angular_core.ɵɵNgModuleDeclaration<IgoFormDialogModule, never, [typeof i1.MatDialogModule, typeof FormDialogComponent], [typeof FormDialogComponent]>;
702
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<IgoFormDialogModule, never, [typeof i1.MatDialogModule, typeof FormDialogComponent, typeof FormStepperComponent, typeof FormStepperDialogComponent], [typeof FormDialogComponent, typeof FormStepperComponent, typeof FormStepperDialogComponent]>;
555
703
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<IgoFormDialogModule>;
556
704
  }
557
705
 
558
706
  declare class FormDialogService {
559
707
  private dialog;
560
- open(formDialogConfig?: FormDialogFormConfig, options?: FormDialogOptions): Observable<Record<string, any>>;
708
+ open<T extends Record<string, unknown> = Record<string, unknown>>(formDialogConfig?: FormDialogFormConfig, options?: FormDialogOptions): Observable<T | undefined>;
709
+ openStepper<T extends Record<string, unknown> = Record<string, unknown>>(formDialogStepperConfig: FormStepperConfig, options?: FormDialogStepperOptions): Observable<T | undefined>;
561
710
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormDialogService, never>;
562
711
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<FormDialogService>;
563
712
  }
564
713
 
565
- 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 };
566
- export type { Form, FormDialogData, FormDialogFormConfig, FormDialogOptions, FormField, FormFieldConfig, FormFieldGroup, FormFieldGroupConfig, FormFieldGroupOptions, FormFieldInputs, FormFieldOptions, FormFieldSelectChoice, FormFieldSelectInputs, FormFieldSubscribers, FormGroupsConfig };
714
+ export { 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 };
715
+ export type { Form, FormDialogData, FormDialogFormConfig, FormDialogOptions, FormDialogStepConfig, FormDialogStepContext, FormDialogStepFormConfigResolver, FormDialogStepperConfig, FormDialogStepperData, FormDialogStepperOptions, FormField, FormFieldCheckboxInputs, FormFieldChoiceInputs, FormFieldConfig, FormFieldGroup, FormFieldGroupConfig, FormFieldGroupOptions, FormFieldInputs, FormFieldOptions, FormFieldRadiobuttonInputs, FormFieldSelectChoice, FormFieldSelectInputs, FormFieldSubscribers, FormGroupsConfig, FormStepperConfig, FormStepperFormConfig, FormStepperStepConfig, FormStepperStepContext, FormStepperStepFormConfigResolver };
@@ -6,7 +6,6 @@ export { IgoKeyValueModule } from '@igo2/common/keyvalue';
6
6
  export { IgoFormDialogModule, IgoFormFieldModule, IgoFormFormModule, IgoFormGroupModule, IgoFormModule } from '@igo2/common/form';
7
7
  export { IgoListModule } from '@igo2/common/list';
8
8
  export { IgoPanelModule } from '@igo2/common/panel';
9
- export { IgoSelectValueDialogModule } from '@igo2/common/select-value-dialog';
10
9
  export { IgoSidenavModule } from '@igo2/common/sidenav';
11
10
  export { IgoSpinnerModule } from '@igo2/common/spinner';
12
11
  export { IgoStopPropagationModule } from '@igo2/common/stop-propagation';
@@ -1,155 +0,0 @@
1
- import { AsyncPipe } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { inject, Component, Injectable, NgModule } from '@angular/core';
4
- import * as i1 from '@angular/forms';
5
- import { UntypedFormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
6
- import * as i4 from '@angular/material/button';
7
- import { MatButtonModule } from '@angular/material/button';
8
- import * as i2 from '@angular/material/checkbox';
9
- import { MatCheckboxModule } from '@angular/material/checkbox';
10
- import { MatDialogRef, MAT_DIALOG_DATA, MatDialogTitle, MatDialogActions, MatDialog } from '@angular/material/dialog';
11
- import * as i3 from '@angular/material/radio';
12
- import { MatRadioModule } from '@angular/material/radio';
13
- import { LanguageService, IgoLanguageModule } from '@igo2/core/language';
14
- import { BehaviorSubject } from 'rxjs';
15
- import * as i5 from '@ngx-translate/core';
16
-
17
- var SelectValueDialogType;
18
- (function (SelectValueDialogType) {
19
- SelectValueDialogType["Radio"] = "radio";
20
- SelectValueDialogType["Checkbox"] = "checkbox";
21
- })(SelectValueDialogType || (SelectValueDialogType = {}));
22
-
23
- class SelectValueCheckRadioDialogComponent {
24
- formBuilder = inject(UntypedFormBuilder);
25
- languageService = inject(LanguageService);
26
- dialogRef = inject(MatDialogRef);
27
- data = inject(MAT_DIALOG_DATA, { optional: true });
28
- formGroup;
29
- isDisabled$ = new BehaviorSubject(true);
30
- constructor() {
31
- this.data = this.data || {};
32
- this.formGroup = this.formBuilder.group(this.getFg());
33
- this.data.selectFieldText =
34
- this.data.selectFieldText ??
35
- 'igo.common.selectValueDialog.selectFieldText';
36
- this.data.processButtonText =
37
- this.data.processButtonText ??
38
- 'igo.common.selectValueDialog.processButtonText';
39
- this.data.cancelButtonText =
40
- this.data.cancelButtonText ??
41
- 'igo.common.selectValueDialog.cancelButtonText';
42
- this.data.title =
43
- this.data.title ?? 'igo.common.selectValueDialog.multipleTitle';
44
- if (this.data.type === SelectValueDialogType.Radio) {
45
- this.data.title = 'igo.common.selectValueDialog.title';
46
- }
47
- }
48
- ngOnInit() {
49
- this.formGroup.valueChanges.subscribe(() => this.canProcess());
50
- }
51
- getFg() {
52
- const a = {};
53
- if (this.data && this.data.choices) {
54
- this.data.choices.map((l) => (a[l.value] = false));
55
- }
56
- return a;
57
- }
58
- canProcess() {
59
- if (!this.data || !this.data.choices) {
60
- return;
61
- }
62
- const choices = this.data.choices.map((l) => l.value);
63
- const selectedIds = [];
64
- choices.map((l) => this.formGroup.value[l] ? selectedIds.push(l) : undefined);
65
- selectedIds.length
66
- ? this.isDisabled$.next(false)
67
- : this.isDisabled$.next(true);
68
- }
69
- save() {
70
- if (!this.data || !this.data.choices) {
71
- this.dialogRef.close();
72
- return;
73
- }
74
- const choices = this.data.choices.map((l) => l.value);
75
- const selectedChoices = [];
76
- choices.map((l) => this.formGroup.value[l] ? selectedChoices.push(l) : undefined);
77
- this.dialogRef.close({ choices: selectedChoices });
78
- }
79
- cancel() {
80
- this.dialogRef.close();
81
- }
82
- onChange(e) {
83
- const choices = {};
84
- this.data?.choices.forEach((l) => (choices[l.value] = false));
85
- choices[e.value] = true;
86
- this.formGroup.setValue(choices);
87
- }
88
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SelectValueCheckRadioDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
89
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: SelectValueCheckRadioDialogComponent, isStandalone: true, selector: "igo-select-value-check-radio-dialog", ngImport: i0, template: "<h1 mat-dialog-title>{{ data?.title | translate }}</h1>\n\n<form class=\"igo-form\" [formGroup]=\"formGroup\">\n <section class=\"choices-section\">\n @for (choice of data?.choices; track choice; let i = $index) {\n @if (data?.type === 'checkbox') {\n <mat-checkbox formControlName=\"{{ choice.value }}\">{{\n choice.title || choice.value\n }}</mat-checkbox>\n }\n }\n\n @if (data?.type === 'radio') {\n <mat-radio-group (change)=\"onChange($event)\">\n @for (choice of data?.choices; track choice) {\n <mat-radio-button [value]=\"choice.value\">\n {{ choice.title || choice.value }}\n </mat-radio-button>\n }\n </mat-radio-group>\n }\n </section>\n <div mat-dialog-actions>\n <div class=\"button-group\">\n <button matButton=\"elevated\" type=\"button\" (click)=\"cancel()\">\n {{ data?.cancelButtonText | translate }}\n </button>\n <button\n [disabled]=\"isDisabled$ | async\"\n id=\"processBtnDialog\"\n matButton=\"elevated\"\n type=\"button\"\n color=\"primary\"\n (click)=\"save()\"\n >\n {{ data?.processButtonText | translate }}\n </button>\n </div>\n </div>\n</form>\n", styles: [":host::ng-deep div[mat-dialog-actions]{margin:10px 0 0}:host::ng-deep section.choices-section{max-width:auto;display:grid;grid-template-columns:auto auto;grid-gap:0px;padding:5px}\n"], dependencies: [{ kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i2.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: MatRadioModule }, { kind: "directive", type: i3.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i3.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: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.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: IgoLanguageModule }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }] });
90
- }
91
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SelectValueCheckRadioDialogComponent, decorators: [{
92
- type: Component,
93
- args: [{ selector: 'igo-select-value-check-radio-dialog', imports: [
94
- MatDialogTitle,
95
- FormsModule,
96
- ReactiveFormsModule,
97
- MatCheckboxModule,
98
- MatRadioModule,
99
- MatDialogActions,
100
- MatButtonModule,
101
- AsyncPipe,
102
- IgoLanguageModule
103
- ], template: "<h1 mat-dialog-title>{{ data?.title | translate }}</h1>\n\n<form class=\"igo-form\" [formGroup]=\"formGroup\">\n <section class=\"choices-section\">\n @for (choice of data?.choices; track choice; let i = $index) {\n @if (data?.type === 'checkbox') {\n <mat-checkbox formControlName=\"{{ choice.value }}\">{{\n choice.title || choice.value\n }}</mat-checkbox>\n }\n }\n\n @if (data?.type === 'radio') {\n <mat-radio-group (change)=\"onChange($event)\">\n @for (choice of data?.choices; track choice) {\n <mat-radio-button [value]=\"choice.value\">\n {{ choice.title || choice.value }}\n </mat-radio-button>\n }\n </mat-radio-group>\n }\n </section>\n <div mat-dialog-actions>\n <div class=\"button-group\">\n <button matButton=\"elevated\" type=\"button\" (click)=\"cancel()\">\n {{ data?.cancelButtonText | translate }}\n </button>\n <button\n [disabled]=\"isDisabled$ | async\"\n id=\"processBtnDialog\"\n matButton=\"elevated\"\n type=\"button\"\n color=\"primary\"\n (click)=\"save()\"\n >\n {{ data?.processButtonText | translate }}\n </button>\n </div>\n </div>\n</form>\n", styles: [":host::ng-deep div[mat-dialog-actions]{margin:10px 0 0}:host::ng-deep section.choices-section{max-width:auto;display:grid;grid-template-columns:auto auto;grid-gap:0px;padding:5px}\n"] }]
104
- }], ctorParameters: () => [] });
105
-
106
- class SelectValueDialogService {
107
- dialog = inject(MatDialog);
108
- open(choices, options) {
109
- const data = {
110
- choices,
111
- ...options
112
- };
113
- const dialogRef = this.dialog.open(SelectValueCheckRadioDialogComponent, {
114
- disableClose: false,
115
- data,
116
- ...options
117
- });
118
- return dialogRef.afterClosed();
119
- }
120
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SelectValueDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
121
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SelectValueDialogService });
122
- }
123
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: SelectValueDialogService, decorators: [{
124
- type: Injectable
125
- }] });
126
-
127
- class IgoSelectValueDialogModule {
128
- /**
129
- * @deprecated it has no effect
130
- */
131
- static forRoot() {
132
- return {
133
- ngModule: IgoSelectValueDialogModule,
134
- providers: []
135
- };
136
- }
137
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: IgoSelectValueDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
138
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.23", ngImport: i0, type: IgoSelectValueDialogModule, imports: [SelectValueCheckRadioDialogComponent], exports: [SelectValueCheckRadioDialogComponent] });
139
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: IgoSelectValueDialogModule, providers: [SelectValueDialogService], imports: [SelectValueCheckRadioDialogComponent] });
140
- }
141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: IgoSelectValueDialogModule, decorators: [{
142
- type: NgModule,
143
- args: [{
144
- imports: [SelectValueCheckRadioDialogComponent],
145
- exports: [SelectValueCheckRadioDialogComponent],
146
- providers: [SelectValueDialogService]
147
- }]
148
- }] });
149
-
150
- /**
151
- * Generated bundle index. Do not edit.
152
- */
153
-
154
- export { IgoSelectValueDialogModule, SelectValueCheckRadioDialogComponent, SelectValueDialogService, SelectValueDialogType };
155
- //# sourceMappingURL=igo2-common-select-value-dialog.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"igo2-common-select-value-dialog.mjs","sources":["../../../packages/common/select-value-dialog/src/select-value-dialog.enums.ts","../../../packages/common/select-value-dialog/src/select-value-check-radio-dialog.component.ts","../../../packages/common/select-value-dialog/src/select-value-check-radio-dialog.component.html","../../../packages/common/select-value-dialog/src/select-value-dialog.service.ts","../../../packages/common/select-value-dialog/src/select-value-dialog.module.ts","../../../packages/common/select-value-dialog/src/igo2-common-select-value-dialog.ts"],"sourcesContent":["export enum SelectValueDialogType {\n Radio = 'radio',\n Checkbox = 'checkbox'\n}\n","import { AsyncPipe } from '@angular/common';\nimport { Component, OnInit, inject } from '@angular/core';\nimport {\n FormsModule,\n ReactiveFormsModule,\n UntypedFormBuilder,\n UntypedFormGroup\n} from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport {\n MAT_DIALOG_DATA,\n MatDialogActions,\n MatDialogRef,\n MatDialogTitle\n} from '@angular/material/dialog';\nimport { MatRadioChange, MatRadioModule } from '@angular/material/radio';\n\nimport { LanguageService } from '@igo2/core/language';\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport { BehaviorSubject } from 'rxjs';\n\nimport { SelectValueDialogType } from './select-value-dialog.enums';\nimport { SelectValueData } from './select-value-dialog.interface';\n\n@Component({\n selector: 'igo-select-value-check-radio-dialog',\n templateUrl: './select-value-check-radio-dialog.component.html',\n styleUrls: ['./select-value-check-radio-dialog.component.scss'],\n imports: [\n MatDialogTitle,\n FormsModule,\n ReactiveFormsModule,\n MatCheckboxModule,\n MatRadioModule,\n MatDialogActions,\n MatButtonModule,\n AsyncPipe,\n IgoLanguageModule\n ]\n})\nexport class SelectValueCheckRadioDialogComponent implements OnInit {\n private formBuilder = inject(UntypedFormBuilder);\n languageService = inject(LanguageService);\n dialogRef =\n inject<MatDialogRef<SelectValueCheckRadioDialogComponent>>(MatDialogRef);\n data = inject<SelectValueData>(MAT_DIALOG_DATA, { optional: true });\n\n public formGroup: UntypedFormGroup;\n public isDisabled$ = new BehaviorSubject<boolean>(true);\n\n constructor() {\n this.data = this.data || ({} as SelectValueData);\n this.formGroup = this.formBuilder.group(this.getFg());\n this.data.selectFieldText =\n this.data.selectFieldText ??\n 'igo.common.selectValueDialog.selectFieldText';\n this.data.processButtonText =\n this.data.processButtonText ??\n 'igo.common.selectValueDialog.processButtonText';\n this.data.cancelButtonText =\n this.data.cancelButtonText ??\n 'igo.common.selectValueDialog.cancelButtonText';\n this.data.title =\n this.data.title ?? 'igo.common.selectValueDialog.multipleTitle';\n if (this.data.type === SelectValueDialogType.Radio) {\n this.data.title = 'igo.common.selectValueDialog.title';\n }\n }\n\n ngOnInit() {\n this.formGroup.valueChanges.subscribe(() => this.canProcess());\n }\n\n getFg() {\n const a: Record<string, boolean> = {};\n if (this.data && this.data.choices) {\n this.data.choices.map((l) => (a[l.value] = false));\n }\n return a;\n }\n\n canProcess() {\n if (!this.data || !this.data.choices) {\n return;\n }\n const choices = this.data.choices.map((l) => l.value);\n const selectedIds = [];\n choices.map((l) =>\n this.formGroup.value[l] ? selectedIds.push(l) : undefined\n );\n selectedIds.length\n ? this.isDisabled$.next(false)\n : this.isDisabled$.next(true);\n }\n\n save() {\n if (!this.data || !this.data.choices) {\n this.dialogRef.close();\n return;\n }\n const choices = this.data.choices.map((l) => l.value);\n\n const selectedChoices: string[] = [];\n choices.map((l) =>\n this.formGroup.value[l] ? selectedChoices.push(l) : undefined\n );\n this.dialogRef.close({ choices: selectedChoices });\n }\n\n cancel() {\n this.dialogRef.close();\n }\n\n onChange(e: MatRadioChange) {\n const choices: Record<string, boolean> = {};\n this.data?.choices.forEach((l) => (choices[l.value] = false));\n choices[e.value] = true;\n this.formGroup.setValue(choices);\n }\n}\n","<h1 mat-dialog-title>{{ data?.title | translate }}</h1>\n\n<form class=\"igo-form\" [formGroup]=\"formGroup\">\n <section class=\"choices-section\">\n @for (choice of data?.choices; track choice; let i = $index) {\n @if (data?.type === 'checkbox') {\n <mat-checkbox formControlName=\"{{ choice.value }}\">{{\n choice.title || choice.value\n }}</mat-checkbox>\n }\n }\n\n @if (data?.type === 'radio') {\n <mat-radio-group (change)=\"onChange($event)\">\n @for (choice of data?.choices; track choice) {\n <mat-radio-button [value]=\"choice.value\">\n {{ choice.title || choice.value }}\n </mat-radio-button>\n }\n </mat-radio-group>\n }\n </section>\n <div mat-dialog-actions>\n <div class=\"button-group\">\n <button matButton=\"elevated\" type=\"button\" (click)=\"cancel()\">\n {{ data?.cancelButtonText | translate }}\n </button>\n <button\n [disabled]=\"isDisabled$ | async\"\n id=\"processBtnDialog\"\n matButton=\"elevated\"\n type=\"button\"\n color=\"primary\"\n (click)=\"save()\"\n >\n {{ data?.processButtonText | translate }}\n </button>\n </div>\n </div>\n</form>\n","import { Injectable, inject } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\n\nimport { Observable } from 'rxjs';\n\nimport { SelectValueCheckRadioDialogComponent } from './select-value-check-radio-dialog.component';\nimport {\n Choice,\n SelectValueData,\n SelectValueDialogOptions\n} from './select-value-dialog.interface';\n\n@Injectable()\nexport class SelectValueDialogService {\n private dialog = inject(MatDialog);\n\n public open(\n choices: Choice[],\n options?: SelectValueDialogOptions\n ): Observable<any> {\n const data: SelectValueData = {\n choices,\n ...options\n };\n\n const dialogRef = this.dialog.open(SelectValueCheckRadioDialogComponent, {\n disableClose: false,\n data,\n ...options\n });\n return dialogRef.afterClosed();\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { SelectValueCheckRadioDialogComponent } from './select-value-check-radio-dialog.component';\nimport { SelectValueDialogService } from './select-value-dialog.service';\n\n@NgModule({\n imports: [SelectValueCheckRadioDialogComponent],\n exports: [SelectValueCheckRadioDialogComponent],\n providers: [SelectValueDialogService]\n})\nexport class IgoSelectValueDialogModule {\n /**\n * @deprecated it has no effect\n */\n static forRoot(): ModuleWithProviders<IgoSelectValueDialogModule> {\n return {\n ngModule: IgoSelectValueDialogModule,\n providers: []\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,qBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACvB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,GAAA,EAAA,CAAA,CAAA;;MC0CpB,oCAAoC,CAAA;AACvC,IAAA,WAAW,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAChD,IAAA,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;AACzC,IAAA,SAAS,GACP,MAAM,CAAqD,YAAY,CAAC;IAC1E,IAAI,GAAG,MAAM,CAAkB,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAE5D,IAAA,SAAS;AACT,IAAA,WAAW,GAAG,IAAI,eAAe,CAAU,IAAI,CAAC;AAEvD,IAAA,WAAA,GAAA;QACE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAK,EAAsB;AAChD,QAAA,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QACrD,IAAI,CAAC,IAAI,CAAC,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