@gravitee/ui-particles-angular 5.8.0 → 5.9.0-slide-toggle-31192ff

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. package/esm2020/lib/gio-form-json-schema/gio-form-json-schema.component.mjs +74 -16
  2. package/esm2020/lib/gio-form-json-schema/gio-form-json-schema.module.mjs +11 -1
  3. package/esm2020/lib/gio-form-json-schema/type-component/array-type.component.mjs +8 -11
  4. package/esm2020/lib/gio-form-json-schema/type-component/multischema-type.component.mjs +20 -23
  5. package/esm2020/lib/gio-form-json-schema/type-component/object-type.component.mjs +8 -11
  6. package/esm2020/lib/gio-form-slide-toogle/gio-form-label.directive.mjs +49 -0
  7. package/esm2020/lib/gio-form-slide-toogle/gio-form-slide-toggle.component.mjs +69 -0
  8. package/esm2020/lib/gio-form-slide-toogle/gio-form-slide-toggle.module.mjs +35 -0
  9. package/esm2020/lib/public-api.mjs +4 -1
  10. package/fesm2015/gravitee-ui-particles-angular.mjs +257 -59
  11. package/fesm2015/gravitee-ui-particles-angular.mjs.map +1 -1
  12. package/fesm2020/gravitee-ui-particles-angular.mjs +252 -59
  13. package/fesm2020/gravitee-ui-particles-angular.mjs.map +1 -1
  14. package/lib/gio-form-json-schema/gio-form-json-schema.component.d.ts +21 -7
  15. package/lib/gio-form-json-schema/gio-form-json-schema.module.d.ts +6 -5
  16. package/lib/gio-form-json-schema/type-component/multischema-type.component.d.ts +3 -1
  17. package/lib/gio-form-slide-toogle/gio-form-label.directive.d.ts +13 -0
  18. package/lib/gio-form-slide-toogle/gio-form-slide-toggle.component.d.ts +15 -0
  19. package/lib/gio-form-slide-toogle/gio-form-slide-toggle.module.d.ts +9 -0
  20. package/lib/public-api.d.ts +3 -0
  21. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { trigger, transition, style, animate } from '@angular/animations';
2
2
  import * as i0 from '@angular/core';
3
- import { EventEmitter, Component, HostBinding, Input, Output, HostListener, NgModule, Optional, Self, ViewChild, Directive, Inject, forwardRef, ChangeDetectionStrategy, Injectable, ViewEncapsulation, ContentChildren } from '@angular/core';
3
+ import { EventEmitter, Component, HostBinding, Input, Output, HostListener, NgModule, Optional, Self, ViewChild, Directive, Inject, forwardRef, ChangeDetectionStrategy, Injectable, ViewEncapsulation, ContentChildren, Host, ContentChild } from '@angular/core';
4
4
  import { timer, Subject, fromEvent, of, BehaviorSubject } from 'rxjs';
5
5
  import * as i1 from '@angular/material/card';
6
6
  import { MatCardModule } from '@angular/material/card';
@@ -12,10 +12,10 @@ import { ComponentHarness, HarnessPredicate, parallel, TestKey } from '@angular/
12
12
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
13
13
  import * as i3$1 from '@angular/material/form-field';
14
14
  import { MatFormFieldControl, MatFormFieldModule, MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
15
- import { isEmpty, toLower, dropRight, isNil, isArray, remove, isObject, cloneDeep } from 'lodash';
15
+ import { isEmpty, toLower, dropRight, isNil, isArray, remove, isObject, cloneDeep, set } from 'lodash';
16
16
  import { startWith, map, distinctUntilChanged, tap, debounce, takeUntil, delay, filter, switchMap } from 'rxjs/operators';
17
17
  import * as i7 from '@angular/forms';
18
- import { FormsModule, FormArray, FormGroup, FormControl, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
18
+ import { FormsModule, FormArray, FormGroup, FormControl, NG_VALUE_ACCESSOR, ReactiveFormsModule, NgControl } from '@angular/forms';
19
19
  import * as i2$2 from '@angular/cdk/a11y';
20
20
  import { A11yModule } from '@angular/cdk/a11y';
21
21
  import * as i3 from '@angular/material/chips';
@@ -47,6 +47,7 @@ import * as i1$3 from '@ngx-formly/core/json-schema';
47
47
  import * as i1$4 from '@ngx-formly/core';
48
48
  import { FieldType, FieldArrayType, FieldWrapper, FormlyModule } from '@ngx-formly/core';
49
49
  import { FormlyMaterialModule } from '@ngx-formly/material';
50
+ import { MatSlideToggle } from '@angular/material/slide-toggle';
50
51
 
51
52
  /*
52
53
  * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
@@ -2779,22 +2780,74 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2779
2780
  * limitations under the License.
2780
2781
  */
2781
2782
  class GioFormJsonSchemaComponent {
2782
- constructor(formlyJsonschema) {
2783
+ constructor(formlyJsonschema, elRef, fm, ngControl) {
2783
2784
  this.formlyJsonschema = formlyJsonschema;
2785
+ this.elRef = elRef;
2786
+ this.fm = fm;
2787
+ this.ngControl = ngControl;
2788
+ this.unsubscribe$ = new Subject();
2784
2789
  this.formGroup = new FormGroup({});
2785
2790
  this.options = {};
2786
2791
  this.model = {};
2787
2792
  this.fields = [];
2793
+ this._onChange = () => ({});
2794
+ this._onTouched = () => ({});
2795
+ this.touched = false;
2796
+ if (ngControl) {
2797
+ // Setting the value accessor directly (instead of using
2798
+ // the providers `NG_VALUE_ACCESSOR`) to avoid running into a circular import.
2799
+ ngControl.valueAccessor = this;
2800
+ }
2801
+ // When the user interact with the form, mark it as touched
2802
+ fm.monitor(elRef.nativeElement, true)
2803
+ .pipe(takeUntil(this.unsubscribe$))
2804
+ .subscribe(() => {
2805
+ this._onTouched();
2806
+ this.touched = true;
2807
+ });
2788
2808
  }
2789
2809
  set jsonSchema(jsonSchema) {
2790
2810
  if (isObject(jsonSchema)) {
2791
2811
  this.fields = [this.toFormlyFieldConfig(jsonSchema)];
2792
2812
  }
2793
2813
  }
2794
- set initialValue(initialValue) {
2795
- if (initialValue) {
2796
- this.model = cloneDeep(initialValue);
2797
- }
2814
+ ngOnInit() {
2815
+ this.formGroup.statusChanges.pipe(takeUntil(this.unsubscribe$)).subscribe(status => {
2816
+ if (status === 'VALID') {
2817
+ this.ngControl?.control?.setErrors(null);
2818
+ }
2819
+ if (status === 'INVALID') {
2820
+ this.ngControl?.control?.setErrors({ invalid: true });
2821
+ }
2822
+ });
2823
+ // To simulate the behavior of classic form controls, emit value only when the form is touched
2824
+ // Allow to keep the formControl pristine until the user interact with it
2825
+ this.formGroup.valueChanges
2826
+ .pipe(takeUntil(this.unsubscribe$), filter(() => this.touched))
2827
+ .subscribe(value => {
2828
+ this._onChange(value);
2829
+ });
2830
+ }
2831
+ ngOnDestroy() {
2832
+ this.unsubscribe$.next();
2833
+ this.unsubscribe$.unsubscribe();
2834
+ this.fm.stopMonitoring(this.elRef.nativeElement);
2835
+ }
2836
+ // From ControlValueAccessor
2837
+ writeValue(value) {
2838
+ this.model = cloneDeep(value) ?? {};
2839
+ }
2840
+ // From ControlValueAccessor
2841
+ registerOnChange(fn) {
2842
+ this._onChange = fn;
2843
+ }
2844
+ // From ControlValueAccessor
2845
+ registerOnTouched(fn) {
2846
+ this._onTouched = fn;
2847
+ }
2848
+ // From ControlValueAccessor
2849
+ setDisabledState(_isDisabled) {
2850
+ throw new Error('Method not implemented.');
2798
2851
  }
2799
2852
  toFormlyFieldConfig(jsonSchema) {
2800
2853
  return this.formlyJsonschema.toFieldConfig(jsonSchema, {
@@ -2816,22 +2869,23 @@ class GioFormJsonSchemaComponent {
2816
2869
  };
2817
2870
  }
2818
2871
  }
2819
- GioFormJsonSchemaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaComponent, deps: [{ token: i1$3.FormlyJsonschema }], target: i0.ɵɵFactoryTarget.Component });
2820
- GioFormJsonSchemaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFormJsonSchemaComponent, selector: "gio-form-json-schema", inputs: { jsonSchema: "jsonSchema", formGroup: "formGroup", options: "options", initialValue: "initialValue" }, ngImport: i0, template: `<formly-form [fields]="fields" [options]="options" [form]="formGroup" [model]="model"></formly-form>`, isInline: true, components: [{ type: i1$4.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }] });
2872
+ GioFormJsonSchemaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaComponent, deps: [{ token: i1$3.FormlyJsonschema }, { token: i0.ElementRef }, { token: i2$2.FocusMonitor }, { token: i7.NgControl, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Component });
2873
+ GioFormJsonSchemaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFormJsonSchemaComponent, selector: "gio-form-json-schema", inputs: { jsonSchema: "jsonSchema", options: "options" }, ngImport: i0, template: `<formly-form *ngIf="formGroup" [fields]="fields" [options]="options" [form]="formGroup" [model]="model"></formly-form>`, isInline: true, components: [{ type: i1$4.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2821
2874
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaComponent, decorators: [{
2822
2875
  type: Component,
2823
2876
  args: [{
2824
2877
  selector: 'gio-form-json-schema',
2825
- template: `<formly-form [fields]="fields" [options]="options" [form]="formGroup" [model]="model"></formly-form>`,
2878
+ template: `<formly-form *ngIf="formGroup" [fields]="fields" [options]="options" [form]="formGroup" [model]="model"></formly-form>`,
2879
+ changeDetection: ChangeDetectionStrategy.OnPush,
2826
2880
  }]
2827
- }], ctorParameters: function () { return [{ type: i1$3.FormlyJsonschema }]; }, propDecorators: { jsonSchema: [{
2828
- type: Input
2829
- }], formGroup: [{
2881
+ }], ctorParameters: function () { return [{ type: i1$3.FormlyJsonschema }, { type: i0.ElementRef }, { type: i2$2.FocusMonitor }, { type: i7.NgControl, decorators: [{
2882
+ type: Host
2883
+ }, {
2884
+ type: Optional
2885
+ }] }]; }, propDecorators: { jsonSchema: [{
2830
2886
  type: Input
2831
2887
  }], options: [{
2832
2888
  type: Input
2833
- }], initialValue: [{
2834
- type: Input
2835
2889
  }] } });
2836
2890
 
2837
2891
  /*
@@ -2886,30 +2940,27 @@ class GioFjsObjectTypeComponent extends FieldType {
2886
2940
  }
2887
2941
  GioFjsObjectTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsObjectTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2888
2942
  GioFjsObjectTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsObjectTypeComponent, selector: "gio-fjs-object-type", usesInheritance: true, ngImport: i0, template: `
2889
- <div>
2890
- <legend *ngIf="to.label">{{ to.label }}</legend>
2943
+ <div class="wrapper">
2944
+ <div class="wrapper__title" *ngIf="to.label">{{ to.label }}</div>
2891
2945
  <p *ngIf="to.description">{{ to.description }}</p>
2892
2946
  <div class="alert alert-danger" role="alert" *ngIf="showError && formControl.errors">
2893
2947
  <formly-validation-message [field]="field"></formly-validation-message>
2894
2948
  </div>
2895
2949
  <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
2896
2950
  </div>
2897
- `, isInline: true, components: [{ type: i1$4.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i1$4.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
2951
+ `, isInline: true, styles: [".wrapper{display:flex;flex-direction:column;padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__title{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:16px}.wrapper:empty{display:none}.wrapper formly-field+formly-field{margin-top:8px}\n"], components: [{ type: i1$4.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i1$4.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
2898
2952
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsObjectTypeComponent, decorators: [{
2899
2953
  type: Component,
2900
- args: [{
2901
- selector: 'gio-fjs-object-type',
2902
- template: `
2903
- <div>
2904
- <legend *ngIf="to.label">{{ to.label }}</legend>
2954
+ args: [{ selector: 'gio-fjs-object-type', template: `
2955
+ <div class="wrapper">
2956
+ <div class="wrapper__title" *ngIf="to.label">{{ to.label }}</div>
2905
2957
  <p *ngIf="to.description">{{ to.description }}</p>
2906
2958
  <div class="alert alert-danger" role="alert" *ngIf="showError && formControl.errors">
2907
2959
  <formly-validation-message [field]="field"></formly-validation-message>
2908
2960
  </div>
2909
2961
  <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
2910
2962
  </div>
2911
- `,
2912
- }]
2963
+ `, styles: [".wrapper{display:flex;flex-direction:column;padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__title{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:16px}.wrapper:empty{display:none}.wrapper formly-field+formly-field{margin-top:8px}\n"] }]
2913
2964
  }] });
2914
2965
 
2915
2966
  /*
@@ -2931,8 +2982,8 @@ class GioFjsArrayTypeComponent extends FieldArrayType {
2931
2982
  }
2932
2983
  GioFjsArrayTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsArrayTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2933
2984
  GioFjsArrayTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsArrayTypeComponent, selector: "gio-fjs-array-type", usesInheritance: true, ngImport: i0, template: `
2934
- <div>
2935
- <legend *ngIf="to.label">{{ to.label }}</legend>
2985
+ <div class="wrapper">
2986
+ <div class="wrapper__title" *ngIf="to.label">{{ to.label }}</div>
2936
2987
  <p *ngIf="to.description">{{ to.description }}</p>
2937
2988
 
2938
2989
  <div class="alert alert-danger" role="alert" *ngIf="showError && formControl.errors">
@@ -2950,14 +3001,12 @@ GioFjsArrayTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0
2950
3001
  <button class="btn btn-primary" type="button" (click)="add()">+</button>
2951
3002
  </div>
2952
3003
  </div>
2953
- `, isInline: true, components: [{ type: i1$4.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i1$4.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
3004
+ `, isInline: true, styles: [".wrapper{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__title{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:16px}.wrapper:empty{display:none}.wrapper formly-field+formly-field{display:block;margin-top:8px}\n"], components: [{ type: i1$4.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i1$4.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
2954
3005
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsArrayTypeComponent, decorators: [{
2955
3006
  type: Component,
2956
- args: [{
2957
- selector: 'gio-fjs-array-type',
2958
- template: `
2959
- <div>
2960
- <legend *ngIf="to.label">{{ to.label }}</legend>
3007
+ args: [{ selector: 'gio-fjs-array-type', template: `
3008
+ <div class="wrapper">
3009
+ <div class="wrapper__title" *ngIf="to.label">{{ to.label }}</div>
2961
3010
  <p *ngIf="to.description">{{ to.description }}</p>
2962
3011
 
2963
3012
  <div class="alert alert-danger" role="alert" *ngIf="showError && formControl.errors">
@@ -2975,8 +3024,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2975
3024
  <button class="btn btn-primary" type="button" (click)="add()">+</button>
2976
3025
  </div>
2977
3026
  </div>
2978
- `,
2979
- }]
3027
+ `, styles: [".wrapper{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__title{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:16px}.wrapper:empty{display:none}.wrapper formly-field+formly-field{display:block;margin-top:8px}\n"] }]
2980
3028
  }] });
2981
3029
 
2982
3030
  function minItemsValidationMessage(error, field) {
@@ -3063,37 +3111,33 @@ function bannerExtension(field) {
3063
3111
  * limitations under the License.
3064
3112
  */
3065
3113
  class GioFjsMultiSchemaTypeComponent extends FieldType {
3114
+ ngOnInit() {
3115
+ set(this.field, 'fieldGroup[0].props.appearance', 'fill');
3116
+ }
3066
3117
  }
3067
3118
  GioFjsMultiSchemaTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsMultiSchemaTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3068
3119
  GioFjsMultiSchemaTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsMultiSchemaTypeComponent, selector: "gio-fjs-multi-schema-type", usesInheritance: true, ngImport: i0, template: `
3069
- <div class="card mb-3">
3070
- <div class="card-body">
3071
- <legend *ngIf="props.label">{{ props.label }}</legend>
3072
- <p *ngIf="props.description">{{ props.description }}</p>
3073
- <div class="alert alert-danger" role="alert" *ngIf="showError && formControl.errors">
3074
- <formly-validation-message [field]="field"></formly-validation-message>
3075
- </div>
3076
- <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
3120
+ <div class="wrapper">
3121
+ <div class="wrapper__title" *ngIf="props.label">{{ props.label }}</div>
3122
+ <p *ngIf="props.description">{{ props.description }}</p>
3123
+ <div role="alert" *ngIf="showError && formControl.errors">
3124
+ <formly-validation-message [field]="field"></formly-validation-message>
3077
3125
  </div>
3126
+ <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
3078
3127
  </div>
3079
- `, isInline: true, components: [{ type: i1$4.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i1$4.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
3128
+ `, isInline: true, styles: ["::ng-deep gio-fjs-multi-schema-type div.wrapper formly-field:first-child mat-form-field{padding-bottom:0}.wrapper{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__title{font-size:16px;font-weight:500;letter-spacing:.4px;line-height:24px;margin-bottom:4px}.wrapper:empty{display:none}\n"], components: [{ type: i1$4.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i1$4.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
3080
3129
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsMultiSchemaTypeComponent, decorators: [{
3081
3130
  type: Component,
3082
- args: [{
3083
- selector: 'gio-fjs-multi-schema-type',
3084
- template: `
3085
- <div class="card mb-3">
3086
- <div class="card-body">
3087
- <legend *ngIf="props.label">{{ props.label }}</legend>
3088
- <p *ngIf="props.description">{{ props.description }}</p>
3089
- <div class="alert alert-danger" role="alert" *ngIf="showError && formControl.errors">
3090
- <formly-validation-message [field]="field"></formly-validation-message>
3091
- </div>
3092
- <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
3131
+ args: [{ selector: 'gio-fjs-multi-schema-type', template: `
3132
+ <div class="wrapper">
3133
+ <div class="wrapper__title" *ngIf="props.label">{{ props.label }}</div>
3134
+ <p *ngIf="props.description">{{ props.description }}</p>
3135
+ <div role="alert" *ngIf="showError && formControl.errors">
3136
+ <formly-validation-message [field]="field"></formly-validation-message>
3093
3137
  </div>
3138
+ <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
3094
3139
  </div>
3095
- `,
3096
- }]
3140
+ `, styles: ["::ng-deep gio-fjs-multi-schema-type div.wrapper formly-field:first-child mat-form-field{padding-bottom:0}.wrapper{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__title{font-size:16px;font-weight:500;letter-spacing:.4px;line-height:24px;margin-bottom:4px}.wrapper:empty{display:none}\n"] }]
3097
3141
  }] });
3098
3142
 
3099
3143
  /*
@@ -3120,10 +3164,12 @@ GioFormJsonSchemaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0",
3120
3164
  GioFjsMultiSchemaTypeComponent,
3121
3165
  GioFjsArrayTypeComponent,
3122
3166
  GioFormFieldWrapperComponent], imports: [CommonModule,
3167
+ A11yModule,
3123
3168
  ReactiveFormsModule, i1$4.FormlyModule, FormlyMaterialModule,
3124
3169
  GioIconsModule], exports: [GioFormJsonSchemaComponent, FormlyModule] });
3125
3170
  GioFormJsonSchemaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaModule, imports: [[
3126
3171
  CommonModule,
3172
+ A11yModule,
3127
3173
  ReactiveFormsModule,
3128
3174
  FormlyModule.forRoot({
3129
3175
  validationMessages: [
@@ -3149,6 +3195,9 @@ GioFormJsonSchemaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
3149
3195
  { name: 'multischema', component: GioFjsMultiSchemaTypeComponent },
3150
3196
  ],
3151
3197
  extensions: [{ name: 'banner', extension: { onPopulate: bannerExtension } }],
3198
+ extras: {
3199
+ checkExpressionOn: 'changeDetectionCheck',
3200
+ },
3152
3201
  }),
3153
3202
  FormlyMaterialModule,
3154
3203
  GioIconsModule,
@@ -3166,6 +3215,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3166
3215
  ],
3167
3216
  imports: [
3168
3217
  CommonModule,
3218
+ A11yModule,
3169
3219
  ReactiveFormsModule,
3170
3220
  FormlyModule.forRoot({
3171
3221
  validationMessages: [
@@ -3191,6 +3241,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3191
3241
  { name: 'multischema', component: GioFjsMultiSchemaTypeComponent },
3192
3242
  ],
3193
3243
  extensions: [{ name: 'banner', extension: { onPopulate: bannerExtension } }],
3244
+ extras: {
3245
+ checkExpressionOn: 'changeDetectionCheck',
3246
+ },
3194
3247
  }),
3195
3248
  FormlyMaterialModule,
3196
3249
  GioIconsModule,
@@ -3199,6 +3252,146 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3199
3252
  }]
3200
3253
  }] });
3201
3254
 
3255
+ /*
3256
+ * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3257
+ *
3258
+ * Licensed under the Apache License, Version 2.0 (the "License");
3259
+ * you may not use this file except in compliance with the License.
3260
+ * You may obtain a copy of the License at
3261
+ *
3262
+ * http://www.apache.org/licenses/LICENSE-2.0
3263
+ *
3264
+ * Unless required by applicable law or agreed to in writing, software
3265
+ * distributed under the License is distributed on an "AS IS" BASIS,
3266
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3267
+ * See the License for the specific language governing permissions and
3268
+ * limitations under the License.
3269
+ */
3270
+ class GioFormSlideToggleComponent {
3271
+ constructor() {
3272
+ this.unsubscribe$ = new Subject();
3273
+ this.appearance = 'outline';
3274
+ this.innerMatSlideToggle = null;
3275
+ this.innerFormControlName = null;
3276
+ this.disabled = false;
3277
+ }
3278
+ ngAfterContentInit() {
3279
+ let observeDisabled = undefined;
3280
+ // Check if disabled is delegated to inner FormControlName
3281
+ if (this.innerFormControlName) {
3282
+ observeDisabled = this.innerFormControlName.statusChanges?.pipe(map(() => !!this.innerFormControlName?.disabled), startWith(!!this.innerFormControlName.disabled));
3283
+ }
3284
+ // If not, check state of inner MatSlideToggle
3285
+ else if (this.innerMatSlideToggle) {
3286
+ observeDisabled = this.innerMatSlideToggle.change.pipe(map(event => event.source.disabled), startWith(this.innerMatSlideToggle.disabled));
3287
+ }
3288
+ if (observeDisabled) {
3289
+ observeDisabled.pipe(takeUntil(this.unsubscribe$)).subscribe(disabled => {
3290
+ this.disabled = disabled;
3291
+ });
3292
+ }
3293
+ }
3294
+ ngOnDestroy() {
3295
+ this.unsubscribe$.next();
3296
+ this.unsubscribe$.complete();
3297
+ }
3298
+ }
3299
+ GioFormSlideToggleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3300
+ GioFormSlideToggleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFormSlideToggleComponent, selector: "gio-form-slide-toggle", inputs: { appearance: "appearance" }, queries: [{ propertyName: "innerMatSlideToggle", first: true, predicate: MatSlideToggle, descendants: true }, { propertyName: "innerFormControlName", first: true, predicate: NgControl, descendants: true }], ngImport: i0, template: "<!--\n\n Copyright (C) 2015 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<div\n class=\"form-slide-toggle\"\n [class.appearance-standard]=\"appearance === 'standard'\"\n [class.appearance-fill]=\"appearance === 'fill'\"\n [class.appearance-outline]=\"appearance === 'outline'\"\n>\n <div class=\"form-slide-toggle__icon\">\n <ng-content select=\"[gioFormPrefix]\"></ng-content>\n </div>\n <div class=\"form-slide-toggle__field\">\n <div class=\"form-slide-toggle__field__mat-slide-toggle\">\n <ng-content select=\"[gioFormSlideToggle]\"></ng-content>\n </div>\n <div class=\"form-slide-toggle__field__text\" [class.disabled]=\"disabled\">\n <span class=\"form-slide-toggle__field__text__label-1\">\n <ng-content select=\"gio-form-label\"></ng-content>\n </span>\n <span class=\"form-slide-toggle__field__text__label-2\">\n <ng-content></ng-content>\n </span>\n </div>\n </div>\n</div>\n", styles: [":host{display:inline-block;padding:4px 0}::ng-deep gio-form-slide-toggle div.form-slide-toggle__icon .mat-icon{font-size:150%;line-height:1.125}.form-slide-toggle{display:flex;min-height:60px;align-items:center}.form-slide-toggle.appearance-fill,.form-slide-toggle.appearance-outline{padding:0 .75em}.form-slide-toggle__icon{padding-right:8px}.form-slide-toggle__icon:empty{display:none}.form-slide-toggle__field{display:flex;min-width:180px;flex:1 1 auto;flex-direction:row;align-items:center;justify-content:flex-start}.form-slide-toggle__field__text{display:flex;flex:1 1 100%;flex-direction:column;padding-left:14px}.form-slide-toggle__field__text__label-1{font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.form-slide-toggle__field__text__label-2{font:400 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.form-slide-toggle__field__text.disabled{color:#00000061}\n"] });
3301
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleComponent, decorators: [{
3302
+ type: Component,
3303
+ args: [{ selector: 'gio-form-slide-toggle', template: "<!--\n\n Copyright (C) 2015 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<div\n class=\"form-slide-toggle\"\n [class.appearance-standard]=\"appearance === 'standard'\"\n [class.appearance-fill]=\"appearance === 'fill'\"\n [class.appearance-outline]=\"appearance === 'outline'\"\n>\n <div class=\"form-slide-toggle__icon\">\n <ng-content select=\"[gioFormPrefix]\"></ng-content>\n </div>\n <div class=\"form-slide-toggle__field\">\n <div class=\"form-slide-toggle__field__mat-slide-toggle\">\n <ng-content select=\"[gioFormSlideToggle]\"></ng-content>\n </div>\n <div class=\"form-slide-toggle__field__text\" [class.disabled]=\"disabled\">\n <span class=\"form-slide-toggle__field__text__label-1\">\n <ng-content select=\"gio-form-label\"></ng-content>\n </span>\n <span class=\"form-slide-toggle__field__text__label-2\">\n <ng-content></ng-content>\n </span>\n </div>\n </div>\n</div>\n", styles: [":host{display:inline-block;padding:4px 0}::ng-deep gio-form-slide-toggle div.form-slide-toggle__icon .mat-icon{font-size:150%;line-height:1.125}.form-slide-toggle{display:flex;min-height:60px;align-items:center}.form-slide-toggle.appearance-fill,.form-slide-toggle.appearance-outline{padding:0 .75em}.form-slide-toggle__icon{padding-right:8px}.form-slide-toggle__icon:empty{display:none}.form-slide-toggle__field{display:flex;min-width:180px;flex:1 1 auto;flex-direction:row;align-items:center;justify-content:flex-start}.form-slide-toggle__field__text{display:flex;flex:1 1 100%;flex-direction:column;padding-left:14px}.form-slide-toggle__field__text__label-1{font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.form-slide-toggle__field__text__label-2{font:400 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.form-slide-toggle__field__text.disabled{color:#00000061}\n"] }]
3304
+ }], propDecorators: { appearance: [{
3305
+ type: Input
3306
+ }], innerMatSlideToggle: [{
3307
+ type: ContentChild,
3308
+ args: [MatSlideToggle, {
3309
+ static: false,
3310
+ }]
3311
+ }], innerFormControlName: [{
3312
+ type: ContentChild,
3313
+ args: [NgControl, {
3314
+ static: false,
3315
+ }]
3316
+ }] } });
3317
+
3318
+ /*
3319
+ * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3320
+ *
3321
+ * Licensed under the Apache License, Version 2.0 (the "License");
3322
+ * you may not use this file except in compliance with the License.
3323
+ * You may obtain a copy of the License at
3324
+ *
3325
+ * http://www.apache.org/licenses/LICENSE-2.0
3326
+ *
3327
+ * Unless required by applicable law or agreed to in writing, software
3328
+ * distributed under the License is distributed on an "AS IS" BASIS,
3329
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3330
+ * See the License for the specific language governing permissions and
3331
+ * limitations under the License.
3332
+ */
3333
+ class GioFormLabelComponent {
3334
+ }
3335
+ GioFormLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3336
+ GioFormLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFormLabelComponent, selector: "gio-form-label", ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
3337
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormLabelComponent, decorators: [{
3338
+ type: Component,
3339
+ args: [{
3340
+ selector: 'gio-form-label',
3341
+ template: `<ng-content></ng-content>`,
3342
+ }]
3343
+ }] });
3344
+ class GioFormPrefixDirective {
3345
+ }
3346
+ GioFormPrefixDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormPrefixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3347
+ GioFormPrefixDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioFormPrefixDirective, selector: "[gioFormPrefix]", ngImport: i0 });
3348
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormPrefixDirective, decorators: [{
3349
+ type: Directive,
3350
+ args: [{
3351
+ selector: '[gioFormPrefix]',
3352
+ }]
3353
+ }] });
3354
+ class GioFormSlideToggleDirective {
3355
+ }
3356
+ GioFormSlideToggleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3357
+ GioFormSlideToggleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioFormSlideToggleDirective, selector: "[gioFormSlideToggle]", ngImport: i0 });
3358
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleDirective, decorators: [{
3359
+ type: Directive,
3360
+ args: [{
3361
+ selector: '[gioFormSlideToggle]',
3362
+ }]
3363
+ }] });
3364
+
3365
+ /*
3366
+ * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3367
+ *
3368
+ * Licensed under the Apache License, Version 2.0 (the "License");
3369
+ * you may not use this file except in compliance with the License.
3370
+ * You may obtain a copy of the License at
3371
+ *
3372
+ * http://www.apache.org/licenses/LICENSE-2.0
3373
+ *
3374
+ * Unless required by applicable law or agreed to in writing, software
3375
+ * distributed under the License is distributed on an "AS IS" BASIS,
3376
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3377
+ * See the License for the specific language governing permissions and
3378
+ * limitations under the License.
3379
+ */
3380
+ class GioFormSlideToggleModule {
3381
+ }
3382
+ GioFormSlideToggleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3383
+ GioFormSlideToggleModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleModule, declarations: [GioFormSlideToggleComponent, GioFormLabelComponent, GioFormPrefixDirective], imports: [CommonModule], exports: [GioFormSlideToggleComponent, GioFormLabelComponent, GioFormPrefixDirective] });
3384
+ GioFormSlideToggleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleModule, imports: [[CommonModule]] });
3385
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleModule, decorators: [{
3386
+ type: NgModule,
3387
+ args: [{
3388
+ imports: [CommonModule],
3389
+ declarations: [GioFormSlideToggleComponent, GioFormLabelComponent, GioFormPrefixDirective],
3390
+ exports: [GioFormSlideToggleComponent, GioFormLabelComponent, GioFormPrefixDirective],
3391
+ entryComponents: [GioFormSlideToggleComponent],
3392
+ }]
3393
+ }] });
3394
+
3202
3395
  /*
3203
3396
  * Copyright (C) 2021 The Gravitee team (http://gravitee.io)
3204
3397
  *
@@ -3235,5 +3428,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3235
3428
  * Generated bundle index. Do not edit.
3236
3429
  */
3237
3430
 
3238
- export { GioAvatarComponent, GioAvatarModule, GioBannerActionDirective, GioBannerBodyDirective, GioBannerComponent, GioBannerErrorComponent, GioBannerInfoComponent, GioBannerModule, GioBannerSuccessComponent, GioBannerWarningComponent, GioBreadcrumbComponent, GioBreadcrumbItemDirective, GioBreadcrumbModule, GioConfirmAndValidateDialogComponent, GioConfirmAndValidateDialogHarness, GioConfirmAndValidateDialogModule, GioConfirmDialogComponent, GioConfirmDialogHarness, GioConfirmDialogModule, GioFormFilePickerAddButtonComponent, GioFormFilePickerComponent, GioFormFilePickerEmptyComponent, GioFormFilePickerInputHarness, GioFormFilePickerLabelComponent, GioFormFilePickerModule, GioFormHeadersComponent, GioFormHeadersHarness, GioFormHeadersModule, GioFormJsonSchemaComponent, GioFormJsonSchemaModule, GioFormTagsInputComponent, GioFormTagsInputHarness, GioFormTagsInputModule, GioIconsModule, GioMatConfigModule, GioMenuComponent, GioMenuFooterComponent, GioMenuHeaderComponent, GioMenuItemComponent, GioMenuListComponent, GioMenuModule, GioMenuSelectorComponent, GioMenuSelectorHarness, GioMenuService, GioSaveBarComponent, GioSaveBarHarness, GioSaveBarModule, GioSubmenuComponent, GioSubmenuGroupComponent, GioSubmenuItemComponent, GioSubmenuModule, GioSubmenuTitleDirective, GioTopBarComponent, GioTopBarContentComponent, GioTopBarLinkComponent, GioTopBarLinkModule, GioTopBarMenuComponent, GioTopBarMenuModule, GioTopBarModule, NewFile };
3431
+ export { GioAvatarComponent, GioAvatarModule, GioBannerActionDirective, GioBannerBodyDirective, GioBannerComponent, GioBannerErrorComponent, GioBannerInfoComponent, GioBannerModule, GioBannerSuccessComponent, GioBannerWarningComponent, GioBreadcrumbComponent, GioBreadcrumbItemDirective, GioBreadcrumbModule, GioConfirmAndValidateDialogComponent, GioConfirmAndValidateDialogHarness, GioConfirmAndValidateDialogModule, GioConfirmDialogComponent, GioConfirmDialogHarness, GioConfirmDialogModule, GioFormFilePickerAddButtonComponent, GioFormFilePickerComponent, GioFormFilePickerEmptyComponent, GioFormFilePickerInputHarness, GioFormFilePickerLabelComponent, GioFormFilePickerModule, GioFormHeadersComponent, GioFormHeadersHarness, GioFormHeadersModule, GioFormJsonSchemaComponent, GioFormJsonSchemaModule, GioFormLabelComponent, GioFormPrefixDirective, GioFormSlideToggleComponent, GioFormSlideToggleDirective, GioFormSlideToggleModule, GioFormTagsInputComponent, GioFormTagsInputHarness, GioFormTagsInputModule, GioIconsModule, GioMatConfigModule, GioMenuComponent, GioMenuFooterComponent, GioMenuHeaderComponent, GioMenuItemComponent, GioMenuListComponent, GioMenuModule, GioMenuSelectorComponent, GioMenuSelectorHarness, GioMenuService, GioSaveBarComponent, GioSaveBarHarness, GioSaveBarModule, GioSubmenuComponent, GioSubmenuGroupComponent, GioSubmenuItemComponent, GioSubmenuModule, GioSubmenuTitleDirective, GioTopBarComponent, GioTopBarContentComponent, GioTopBarLinkComponent, GioTopBarLinkModule, GioTopBarMenuComponent, GioTopBarMenuModule, GioTopBarModule, NewFile };
3239
3432
  //# sourceMappingURL=gravitee-ui-particles-angular.mjs.map