@gravitee/ui-particles-angular 5.10.0 → 5.11.0

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 (24) hide show
  1. package/esm2020/lib/gio-form-headers/gio-form-headers.component.mjs +11 -4
  2. package/esm2020/lib/gio-form-json-schema/gio-form-json-schema.component.mjs +10 -33
  3. package/esm2020/lib/gio-form-json-schema/gio-form-json-schema.module.mjs +43 -3
  4. package/esm2020/lib/gio-form-json-schema/gio-formly-json-schema.service.mjs +64 -0
  5. package/esm2020/lib/gio-form-json-schema/model/GioJsonSchema.mjs +16 -1
  6. package/esm2020/lib/gio-form-json-schema/type-component/array-type.component.mjs +57 -25
  7. package/esm2020/lib/gio-form-json-schema/type-component/headers-type.component.mjs +93 -0
  8. package/esm2020/lib/gio-form-json-schema/type-component/multischema-type.component.mjs +6 -5
  9. package/esm2020/lib/gio-form-json-schema/type-component/object-type.component.mjs +11 -7
  10. package/esm2020/lib/gio-form-json-schema/type-component/toggle-type.component.mjs +59 -0
  11. package/fesm2015/gravitee-ui-particles-angular.mjs +455 -206
  12. package/fesm2015/gravitee-ui-particles-angular.mjs.map +1 -1
  13. package/fesm2020/gravitee-ui-particles-angular.mjs +456 -192
  14. package/fesm2020/gravitee-ui-particles-angular.mjs.map +1 -1
  15. package/lib/gio-form-headers/gio-form-headers.component.d.ts +4 -2
  16. package/lib/gio-form-json-schema/gio-form-json-schema.component.d.ts +3 -5
  17. package/lib/gio-form-json-schema/gio-form-json-schema.module.d.ts +14 -8
  18. package/lib/gio-form-json-schema/gio-formly-json-schema.service.d.ts +15 -0
  19. package/lib/gio-form-json-schema/model/GioJsonSchema.d.ts +19 -11
  20. package/lib/gio-form-json-schema/type-component/array-type.component.d.ts +1 -0
  21. package/lib/gio-form-json-schema/type-component/headers-type.component.d.ts +19 -0
  22. package/lib/gio-form-json-schema/type-component/toggle-type.component.d.ts +8 -0
  23. package/package.json +1 -1
  24. package/src/scss/mat-override/mat-table.scss +3 -3
@@ -48,7 +48,8 @@ import * as i1$3 from '@ngx-formly/core/json-schema';
48
48
  import * as i1$4 from '@ngx-formly/core';
49
49
  import { FieldType, FieldArrayType, FieldWrapper, FormlyModule } from '@ngx-formly/core';
50
50
  import { FormlyMaterialModule } from '@ngx-formly/material';
51
- import { MatSlideToggle } from '@angular/material/slide-toggle';
51
+ import * as i3$2 from '@angular/material/slide-toggle';
52
+ import { MatSlideToggle, MatSlideToggleModule } from '@angular/material/slide-toggle';
52
53
 
53
54
  /*
54
55
  * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
@@ -1047,6 +1048,11 @@ class GioFormHeadersComponent {
1047
1048
  }
1048
1049
  // From ControlValueAccessor interface
1049
1050
  registerOnChange(fn) {
1051
+ const adaptOutputFn = this.adaptOutputFn;
1052
+ if (adaptOutputFn) {
1053
+ this._onChange = (headers) => fn(adaptOutputFn(headers));
1054
+ return;
1055
+ }
1050
1056
  this._onChange = fn;
1051
1057
  }
1052
1058
  // From ControlValueAccessor interface
@@ -1133,7 +1139,7 @@ class GioFormHeadersComponent {
1133
1139
  }
1134
1140
  }
1135
1141
  GioFormHeadersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormHeadersComponent, deps: [{ token: i2$2.FocusMonitor }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1136
- GioFormHeadersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFormHeadersComponent, selector: "gio-form-headers", host: { properties: { "class.disabled": "this.disabled" } }, providers: [
1142
+ GioFormHeadersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFormHeadersComponent, selector: "gio-form-headers", inputs: { adaptOutputFn: "adaptOutputFn" }, host: { properties: { "class.disabled": "this.disabled" } }, providers: [
1137
1143
  {
1138
1144
  provide: NG_VALUE_ACCESSOR,
1139
1145
  useExisting: forwardRef(() => GioFormHeadersComponent),
@@ -1149,7 +1155,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1149
1155
  multi: true,
1150
1156
  },
1151
1157
  ], 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<table class=\"gio-form-headers__table gio-table-light\" [formGroup]=\"mainForm\">\n <thead>\n <tr>\n <th>KEY</th>\n <th>VALUE</th>\n </tr>\n </thead>\n <tbody formArrayName=\"headers\">\n <tr\n *ngFor=\"let control of headersFormArray.controls; index as headerIndex\"\n class=\"gio-form-headers__table__header-row\"\n [formGroupName]=\"headerIndex\"\n >\n <td class=\"gio-form-headers__table__header-row__td-key\">\n <mat-form-field class=\"gio-form-headers__table__header-row__td-key__field\" [floatLabel]=\"'never'\" appearance=\"standard\">\n <textarea\n formControlName=\"key\"\n matInput\n placeholder=\"Name...\"\n cdkTextareaAutosize\n cdkAutosizeMinRows=\"1\"\n [matAutocomplete]=\"headerNamesAutocomplete\"\n ></textarea>\n </mat-form-field>\n <mat-autocomplete #headerNamesAutocomplete=\"matAutocomplete\">\n <mat-option *ngFor=\"let headerName of getFilteredHeaderNames(headerIndex, control.value) | async\" [value]=\"headerName\">{{\n headerName\n }}</mat-option>\n </mat-autocomplete>\n </td>\n <td class=\"gio-form-headers__table__header-row__td-value\">\n <mat-form-field class=\"gio-form-headers__table__header-row__td-value__field\" [floatLabel]=\"'never'\" appearance=\"standard\">\n <textarea formControlName=\"value\" matInput placeholder=\"Value...\" cdkTextareaAutosize cdkAutosizeMinRows=\"1\"></textarea>\n </mat-form-field>\n <button\n class=\"gio-form-headers__table__header-row__td-value__button\"\n *ngIf=\"headersFormArray.controls.length - 1 !== headerIndex\"\n mat-icon-button\n aria-label=\"Delete\"\n (click)=\"onDeleteHeader(headerIndex)\"\n >\n <mat-icon svgIcon=\"gio:cancel\"></mat-icon>\n </button>\n </td>\n </tr>\n </tbody>\n</table>\n", styles: [":host{display:block;overflow:hidden}.gio-form-headers__table{width:100%}.gio-form-headers__table__header-row__td-key,.gio-form-headers__table__header-row__td-value{position:relative;width:50%}.gio-form-headers__table__header-row__td-key__field,.gio-form-headers__table__header-row__td-value__field{display:flex;overflow:hidden;width:100%;max-height:32px;flex-direction:column;justify-content:center;padding-bottom:0}.gio-form-headers__table__header-row__td-key__field *,.gio-form-headers__table__header-row__td-value__field *{top:0;overflow:hidden;max-height:32px}.gio-form-headers__table__header-row__td-key__field:focus-within,.gio-form-headers__table__header-row__td-value__field:focus-within{z-index:100;height:auto;background-color:#fff}.gio-form-headers__table__header-row__td-key__field:focus-within *,.gio-form-headers__table__header-row__td-value__field:focus-within *{max-height:none}.gio-form-headers__table__header-row__td-key__button,.gio-form-headers__table__header-row__td-value__button{position:absolute;top:3px;right:3px;display:none}.gio-form-headers__table__header-row__td-remove{width:32px;height:32px;padding:0}.gio-form-headers__table__header-row:hover .gio-form-headers__table__header-row__td-value__button{z-index:110;display:block;background-color:#fff;opacity:.9}::ng-deep gio-form-headers .gio-form-headers__table__header-row .mat-form-field-infix{width:inherit}\n"] }]
1152
- }], ctorParameters: function () { return [{ type: i2$2.FocusMonitor }, { type: i0.ElementRef }]; }, propDecorators: { disabled: [{
1158
+ }], ctorParameters: function () { return [{ type: i2$2.FocusMonitor }, { type: i0.ElementRef }]; }, propDecorators: { adaptOutputFn: [{
1159
+ type: Input
1160
+ }], disabled: [{
1153
1161
  type: HostBinding,
1154
1162
  args: ['class.disabled']
1155
1163
  }] } });
@@ -2744,9 +2752,68 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2744
2752
  * See the License for the specific language governing permissions and
2745
2753
  * limitations under the License.
2746
2754
  */
2747
- class GioFormJsonSchemaComponent {
2748
- constructor(formlyJsonschema, elRef, fm, ngControl) {
2755
+ class GioFormlyJsonSchemaService {
2756
+ constructor(formlyJsonschema, builder) {
2749
2757
  this.formlyJsonschema = formlyJsonschema;
2758
+ this.builder = builder;
2759
+ }
2760
+ toFormlyFieldConfig(jsonSchema) {
2761
+ return this.formlyJsonschema.toFieldConfig(jsonSchema, {
2762
+ map: (mappedField, mapSource) => {
2763
+ mappedField = this.uiTypeMap(mappedField, mapSource);
2764
+ mappedField = this.bannerMap(mappedField, mapSource);
2765
+ mappedField = this.toggleMap(mappedField, mapSource);
2766
+ return mappedField;
2767
+ },
2768
+ });
2769
+ }
2770
+ uiTypeMap(mappedField, mapSource) {
2771
+ var _a, _b;
2772
+ mappedField.type = (_b = (_a = mapSource.gioConfig) === null || _a === void 0 ? void 0 : _a.uiType) !== null && _b !== void 0 ? _b : mappedField.type;
2773
+ return mappedField;
2774
+ }
2775
+ bannerMap(mappedField, mapSource) {
2776
+ var _a;
2777
+ mappedField.props = Object.assign(Object.assign({}, mappedField.props), (((_a = mapSource.gioConfig) === null || _a === void 0 ? void 0 : _a.banner) ? getBannerProperties(mapSource.gioConfig.banner) : {}));
2778
+ return mappedField;
2779
+ }
2780
+ toggleMap(mappedField, mapSource) {
2781
+ if (mapSource.type === 'boolean') {
2782
+ mappedField.type = 'toggle';
2783
+ }
2784
+ return mappedField;
2785
+ }
2786
+ }
2787
+ GioFormlyJsonSchemaService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormlyJsonSchemaService, deps: [{ token: i1$3.FormlyJsonschema }, { token: i1$4.FormlyFormBuilder }], target: i0.ɵɵFactoryTarget.Injectable });
2788
+ GioFormlyJsonSchemaService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormlyJsonSchemaService });
2789
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormlyJsonSchemaService, decorators: [{
2790
+ type: Injectable
2791
+ }], ctorParameters: function () { return [{ type: i1$3.FormlyJsonschema }, { type: i1$4.FormlyFormBuilder }]; } });
2792
+ const getBannerProperties = (banner) => {
2793
+ return {
2794
+ bannerText: banner.text,
2795
+ bannerTitle: 'title' in banner ? banner.title : undefined,
2796
+ };
2797
+ };
2798
+
2799
+ /*
2800
+ * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
2801
+ *
2802
+ * Licensed under the Apache License, Version 2.0 (the "License");
2803
+ * you may not use this file except in compliance with the License.
2804
+ * You may obtain a copy of the License at
2805
+ *
2806
+ * http://www.apache.org/licenses/LICENSE-2.0
2807
+ *
2808
+ * Unless required by applicable law or agreed to in writing, software
2809
+ * distributed under the License is distributed on an "AS IS" BASIS,
2810
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2811
+ * See the License for the specific language governing permissions and
2812
+ * limitations under the License.
2813
+ */
2814
+ class GioFormJsonSchemaComponent {
2815
+ constructor(gioFormlyJsonSchema, elRef, fm, ngControl) {
2816
+ this.gioFormlyJsonSchema = gioFormlyJsonSchema;
2750
2817
  this.elRef = elRef;
2751
2818
  this.fm = fm;
2752
2819
  this.ngControl = ngControl;
@@ -2773,7 +2840,7 @@ class GioFormJsonSchemaComponent {
2773
2840
  }
2774
2841
  set jsonSchema(jsonSchema) {
2775
2842
  if (isObject(jsonSchema)) {
2776
- this.fields = [this.toFormlyFieldConfig(jsonSchema)];
2843
+ this.fields = [this.gioFormlyJsonSchema.toFormlyFieldConfig(jsonSchema)];
2777
2844
  }
2778
2845
  }
2779
2846
  ngOnInit() {
@@ -2816,35 +2883,14 @@ class GioFormJsonSchemaComponent {
2816
2883
  setDisabledState(_isDisabled) {
2817
2884
  throw new Error('Method not implemented.');
2818
2885
  }
2819
- toFormlyFieldConfig(jsonSchema) {
2820
- return this.formlyJsonschema.toFieldConfig(jsonSchema, {
2821
- map: (mappedField, mapSource) => {
2822
- var _a;
2823
- // Casting fields into our specific type
2824
- const gioMapSource = mapSource;
2825
- mappedField.props = Object.assign(Object.assign({}, mappedField.props), (((_a = gioMapSource.gioConfig) === null || _a === void 0 ? void 0 : _a.banner) ? this.getBannerProperties(gioMapSource.gioConfig.banner) : {}));
2826
- return mappedField;
2827
- },
2828
- });
2829
- }
2830
- getBannerProperties(banner) {
2831
- return {
2832
- bannerText: banner.text,
2833
- bannerTitle: 'title' in banner ? banner.title : undefined,
2834
- };
2835
- }
2836
2886
  }
2837
- 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 });
2838
- 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 });
2887
+ GioFormJsonSchemaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaComponent, deps: [{ token: GioFormlyJsonSchemaService }, { token: i0.ElementRef }, { token: i2$2.FocusMonitor }, { token: i7.NgControl, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Component });
2888
+ 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, styles: ["::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-outline:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)){padding-bottom:0}::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-outline:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)) .mat-form-field-wrapper{padding-bottom:0}::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-fill:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)){padding-bottom:0}::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-fill:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)) .mat-form-field-wrapper{margin-bottom:-1.34375em}\n"], 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"] }] });
2839
2889
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaComponent, decorators: [{
2840
2890
  type: Component,
2841
- args: [{
2842
- selector: 'gio-form-json-schema',
2843
- template: `<formly-form *ngIf="formGroup" [fields]="fields" [options]="options" [form]="formGroup" [model]="model"></formly-form>`,
2844
- changeDetection: ChangeDetectionStrategy.OnPush,
2845
- }]
2891
+ args: [{ selector: 'gio-form-json-schema', template: `<formly-form *ngIf="formGroup" [fields]="fields" [options]="options" [form]="formGroup" [model]="model"></formly-form>`, styles: ["::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-outline:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)){padding-bottom:0}::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-outline:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)) .mat-form-field-wrapper{padding-bottom:0}::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-fill:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)){padding-bottom:0}::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-fill:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)) .mat-form-field-wrapper{margin-bottom:-1.34375em}\n"] }]
2846
2892
  }], ctorParameters: function () {
2847
- return [{ type: i1$3.FormlyJsonschema }, { type: i0.ElementRef }, { type: i2$2.FocusMonitor }, { type: i7.NgControl, decorators: [{
2893
+ return [{ type: GioFormlyJsonSchemaService }, { type: i0.ElementRef }, { type: i2$2.FocusMonitor }, { type: i7.NgControl, decorators: [{
2848
2894
  type: Host
2849
2895
  }, {
2850
2896
  type: Optional
@@ -2855,6 +2901,147 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2855
2901
  type: Input
2856
2902
  }] } });
2857
2903
 
2904
+ /*
2905
+ * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
2906
+ *
2907
+ * Licensed under the Apache License, Version 2.0 (the "License");
2908
+ * you may not use this file except in compliance with the License.
2909
+ * You may obtain a copy of the License at
2910
+ *
2911
+ * http://www.apache.org/licenses/LICENSE-2.0
2912
+ *
2913
+ * Unless required by applicable law or agreed to in writing, software
2914
+ * distributed under the License is distributed on an "AS IS" BASIS,
2915
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2916
+ * See the License for the specific language governing permissions and
2917
+ * limitations under the License.
2918
+ */
2919
+ class GioFormLabelComponent {
2920
+ }
2921
+ GioFormLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2922
+ 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 });
2923
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormLabelComponent, decorators: [{
2924
+ type: Component,
2925
+ args: [{
2926
+ selector: 'gio-form-label',
2927
+ template: `<ng-content></ng-content>`,
2928
+ }]
2929
+ }] });
2930
+ class GioFormPrefixDirective {
2931
+ }
2932
+ GioFormPrefixDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormPrefixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2933
+ GioFormPrefixDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioFormPrefixDirective, selector: "[gioFormPrefix]", ngImport: i0 });
2934
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormPrefixDirective, decorators: [{
2935
+ type: Directive,
2936
+ args: [{
2937
+ selector: '[gioFormPrefix]',
2938
+ }]
2939
+ }] });
2940
+ class GioFormSlideToggleDirective {
2941
+ }
2942
+ GioFormSlideToggleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2943
+ GioFormSlideToggleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioFormSlideToggleDirective, selector: "[gioFormSlideToggle]", ngImport: i0 });
2944
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleDirective, decorators: [{
2945
+ type: Directive,
2946
+ args: [{
2947
+ selector: '[gioFormSlideToggle]',
2948
+ }]
2949
+ }] });
2950
+
2951
+ /*
2952
+ * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
2953
+ *
2954
+ * Licensed under the Apache License, Version 2.0 (the "License");
2955
+ * you may not use this file except in compliance with the License.
2956
+ * You may obtain a copy of the License at
2957
+ *
2958
+ * http://www.apache.org/licenses/LICENSE-2.0
2959
+ *
2960
+ * Unless required by applicable law or agreed to in writing, software
2961
+ * distributed under the License is distributed on an "AS IS" BASIS,
2962
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2963
+ * See the License for the specific language governing permissions and
2964
+ * limitations under the License.
2965
+ */
2966
+ class GioFormSlideToggleComponent {
2967
+ constructor() {
2968
+ this.unsubscribe$ = new Subject();
2969
+ this.appearance = 'outline';
2970
+ this.innerMatSlideToggle = null;
2971
+ this.innerFormControlName = null;
2972
+ this.disabled = false;
2973
+ }
2974
+ ngAfterContentInit() {
2975
+ var _a;
2976
+ let isDisabled$ = undefined;
2977
+ // Check if disabled is delegated to inner FormControlName
2978
+ if (this.innerFormControlName) {
2979
+ isDisabled$ = (_a = this.innerFormControlName.statusChanges) === null || _a === void 0 ? void 0 : _a.pipe(map(() => { var _a; return !!((_a = this.innerFormControlName) === null || _a === void 0 ? void 0 : _a.disabled); }), startWith(!!this.innerFormControlName.disabled));
2980
+ }
2981
+ // If not, check state of inner MatSlideToggle
2982
+ else if (this.innerMatSlideToggle) {
2983
+ isDisabled$ = this.innerMatSlideToggle.change.pipe(map(event => event.source.disabled), startWith(this.innerMatSlideToggle.disabled));
2984
+ }
2985
+ if (isDisabled$) {
2986
+ isDisabled$.pipe(takeUntil(this.unsubscribe$)).subscribe(disabled => {
2987
+ this.disabled = disabled;
2988
+ });
2989
+ }
2990
+ }
2991
+ ngOnDestroy() {
2992
+ this.unsubscribe$.next();
2993
+ this.unsubscribe$.complete();
2994
+ }
2995
+ }
2996
+ GioFormSlideToggleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2997
+ 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"] });
2998
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleComponent, decorators: [{
2999
+ type: Component,
3000
+ 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"] }]
3001
+ }], propDecorators: { appearance: [{
3002
+ type: Input
3003
+ }], innerMatSlideToggle: [{
3004
+ type: ContentChild,
3005
+ args: [MatSlideToggle, {
3006
+ static: false,
3007
+ }]
3008
+ }], innerFormControlName: [{
3009
+ type: ContentChild,
3010
+ args: [NgControl, {
3011
+ static: false,
3012
+ }]
3013
+ }] } });
3014
+
3015
+ /*
3016
+ * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3017
+ *
3018
+ * Licensed under the Apache License, Version 2.0 (the "License");
3019
+ * you may not use this file except in compliance with the License.
3020
+ * You may obtain a copy of the License at
3021
+ *
3022
+ * http://www.apache.org/licenses/LICENSE-2.0
3023
+ *
3024
+ * Unless required by applicable law or agreed to in writing, software
3025
+ * distributed under the License is distributed on an "AS IS" BASIS,
3026
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3027
+ * See the License for the specific language governing permissions and
3028
+ * limitations under the License.
3029
+ */
3030
+ class GioFormSlideToggleModule {
3031
+ }
3032
+ GioFormSlideToggleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3033
+ 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] });
3034
+ GioFormSlideToggleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleModule, imports: [[CommonModule]] });
3035
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleModule, decorators: [{
3036
+ type: NgModule,
3037
+ args: [{
3038
+ imports: [CommonModule],
3039
+ declarations: [GioFormSlideToggleComponent, GioFormLabelComponent, GioFormPrefixDirective],
3040
+ exports: [GioFormSlideToggleComponent, GioFormLabelComponent, GioFormPrefixDirective],
3041
+ entryComponents: [GioFormSlideToggleComponent],
3042
+ }]
3043
+ }] });
3044
+
2858
3045
  /*
2859
3046
  * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
2860
3047
  *
@@ -2910,24 +3097,28 @@ GioFjsObjectTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.
2910
3097
  <div class="wrapper">
2911
3098
  <div class="wrapper__title" *ngIf="to.label">{{ to.label }}</div>
2912
3099
  <p *ngIf="to.description">{{ to.description }}</p>
2913
- <div class="alert alert-danger" role="alert" *ngIf="showError && formControl.errors">
3100
+ <div class="wrapper__error" *ngIf="showError && formControl.errors">
2914
3101
  <formly-validation-message [field]="field"></formly-validation-message>
2915
3102
  </div>
2916
- <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
3103
+ <div class="wrapper__fields">
3104
+ <formly-field *ngFor="let f of field.fieldGroup" class="wrapper__fields__field" [field]="f"></formly-field>
3105
+ </div>
2917
3106
  </div>
2918
- `, 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"] }] });
3107
+ `, isInline: true, styles: [".wrapper{display:flex;flex-direction:column}.wrapper__title{font:600 18px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:16px}.wrapper:empty{display:none}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}.wrapper__fields{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__fields:empty{display:none}.wrapper__fields__field:empty{display:none}.wrapper__fields__field+.wrapper__fields__field:not(:empty){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"] }] });
2919
3108
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsObjectTypeComponent, decorators: [{
2920
3109
  type: Component,
2921
3110
  args: [{ selector: 'gio-fjs-object-type', template: `
2922
3111
  <div class="wrapper">
2923
3112
  <div class="wrapper__title" *ngIf="to.label">{{ to.label }}</div>
2924
3113
  <p *ngIf="to.description">{{ to.description }}</p>
2925
- <div class="alert alert-danger" role="alert" *ngIf="showError && formControl.errors">
3114
+ <div class="wrapper__error" *ngIf="showError && formControl.errors">
2926
3115
  <formly-validation-message [field]="field"></formly-validation-message>
2927
3116
  </div>
2928
- <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
3117
+ <div class="wrapper__fields">
3118
+ <formly-field *ngFor="let f of field.fieldGroup" class="wrapper__fields__field" [field]="f"></formly-field>
3119
+ </div>
2929
3120
  </div>
2930
- `, 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"] }]
3121
+ `, styles: [".wrapper{display:flex;flex-direction:column}.wrapper__title{font:600 18px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:16px}.wrapper:empty{display:none}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}.wrapper__fields{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__fields:empty{display:none}.wrapper__fields__field:empty{display:none}.wrapper__fields__field+.wrapper__fields__field:not(:empty){display:block;margin-top:8px}\n"] }]
2931
3122
  }] });
2932
3123
 
2933
3124
  /*
@@ -2946,52 +3137,82 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2946
3137
  * limitations under the License.
2947
3138
  */
2948
3139
  class GioFjsArrayTypeComponent extends FieldArrayType {
3140
+ constructor() {
3141
+ super(...arguments);
3142
+ this.collapse = false;
3143
+ }
2949
3144
  }
2950
3145
  GioFjsArrayTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsArrayTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2951
3146
  GioFjsArrayTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsArrayTypeComponent, selector: "gio-fjs-array-type", usesInheritance: true, ngImport: i0, template: `
2952
3147
  <div class="wrapper">
2953
- <div class="wrapper__title" *ngIf="to.label">{{ to.label }}</div>
2954
- <p *ngIf="to.description">{{ to.description }}</p>
3148
+ <div class="wrapper__header">
3149
+ <div class="wrapper__header__text">
3150
+ <div class="wrapper__header__text__title" *ngIf="to.label">{{ to.label }}</div>
3151
+ <p *ngIf="to.description">{{ to.description }}</p>
3152
+ </div>
3153
+ <div class="wrapper__header__collapse">
3154
+ <button type="button" mat-icon-button aria-label="Collapse" (click)="collapse = !collapse">
3155
+ <mat-icon [class.collapse-open]="collapse" [class.collapse-close]="!collapse" svgIcon="gio:nav-arrow-down"></mat-icon>
3156
+ </button>
3157
+ </div>
3158
+ </div>
2955
3159
 
2956
- <div class="alert alert-danger" role="alert" *ngIf="showError && formControl.errors">
3160
+ <div class="wrapper__error" *ngIf="showError && formControl.errors">
2957
3161
  <formly-validation-message [field]="field"></formly-validation-message>
2958
3162
  </div>
2959
3163
 
2960
- <div *ngFor="let field of field.fieldGroup; let i = index" class="row">
2961
- <formly-field [field]="field"></formly-field>
2962
- <div>
2963
- <button class="btn btn-danger" type="button" (click)="remove(i)">-</button>
3164
+ <div *ngIf="!collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
3165
+ <div *ngFor="let field of field.fieldGroup; let i = index" class="wrapper__rows__row">
3166
+ <formly-field class="wrapper__rows__row__field" [field]="field"></formly-field>
3167
+ <div class="wrapper__rows__row__remove">
3168
+ <button type="button" mat-icon-button aria-label="Remove" (click)="remove(i)">
3169
+ <mat-icon svgIcon="gio:cancel"></mat-icon>
3170
+ </button>
3171
+ </div>
2964
3172
  </div>
2965
- </div>
2966
3173
 
2967
- <div>
2968
- <button class="btn btn-primary" type="button" (click)="add()">+</button>
3174
+ <div>
3175
+ <button type="button" mat-stroked-button aria-label="Add" (click)="add()"><mat-icon svgIcon="gio:plus"></mat-icon> Add</button>
3176
+ </div>
2969
3177
  </div>
2970
3178
  </div>
2971
- `, 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"] }] });
3179
+ `, isInline: true, styles: [".wrapper{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper:empty{display:none}.wrapper__header{display:flex}.wrapper__header__text{flex:1 1 auto}.wrapper__header__text__title{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:8px}.wrapper__header__collapse{flex:0 0 auto}.wrapper__header__collapse .collapse-open{transform:rotate(180deg);transition:transform 225ms cubic-bezier(.4,0,.2,1)}.wrapper__header__collapse .collapse-close{transform:rotate(0);transition:transform 225ms cubic-bezier(.4,0,.2,1)}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}.wrapper__rows__row{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}.wrapper__rows__row+.wrapper__rows__row{padding-top:3px;border-top:1px solid #d3d5dc;margin-top:4px}.wrapper__rows__row__field{flex:1 1 auto}.wrapper__rows__row__remove{flex:0 0 auto}\n"], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { 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"] }] });
2972
3180
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsArrayTypeComponent, decorators: [{
2973
3181
  type: Component,
2974
3182
  args: [{ selector: 'gio-fjs-array-type', template: `
2975
3183
  <div class="wrapper">
2976
- <div class="wrapper__title" *ngIf="to.label">{{ to.label }}</div>
2977
- <p *ngIf="to.description">{{ to.description }}</p>
3184
+ <div class="wrapper__header">
3185
+ <div class="wrapper__header__text">
3186
+ <div class="wrapper__header__text__title" *ngIf="to.label">{{ to.label }}</div>
3187
+ <p *ngIf="to.description">{{ to.description }}</p>
3188
+ </div>
3189
+ <div class="wrapper__header__collapse">
3190
+ <button type="button" mat-icon-button aria-label="Collapse" (click)="collapse = !collapse">
3191
+ <mat-icon [class.collapse-open]="collapse" [class.collapse-close]="!collapse" svgIcon="gio:nav-arrow-down"></mat-icon>
3192
+ </button>
3193
+ </div>
3194
+ </div>
2978
3195
 
2979
- <div class="alert alert-danger" role="alert" *ngIf="showError && formControl.errors">
3196
+ <div class="wrapper__error" *ngIf="showError && formControl.errors">
2980
3197
  <formly-validation-message [field]="field"></formly-validation-message>
2981
3198
  </div>
2982
3199
 
2983
- <div *ngFor="let field of field.fieldGroup; let i = index" class="row">
2984
- <formly-field [field]="field"></formly-field>
2985
- <div>
2986
- <button class="btn btn-danger" type="button" (click)="remove(i)">-</button>
3200
+ <div *ngIf="!collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
3201
+ <div *ngFor="let field of field.fieldGroup; let i = index" class="wrapper__rows__row">
3202
+ <formly-field class="wrapper__rows__row__field" [field]="field"></formly-field>
3203
+ <div class="wrapper__rows__row__remove">
3204
+ <button type="button" mat-icon-button aria-label="Remove" (click)="remove(i)">
3205
+ <mat-icon svgIcon="gio:cancel"></mat-icon>
3206
+ </button>
3207
+ </div>
2987
3208
  </div>
2988
- </div>
2989
3209
 
2990
- <div>
2991
- <button class="btn btn-primary" type="button" (click)="add()">+</button>
3210
+ <div>
3211
+ <button type="button" mat-stroked-button aria-label="Add" (click)="add()"><mat-icon svgIcon="gio:plus"></mat-icon> Add</button>
3212
+ </div>
2992
3213
  </div>
2993
3214
  </div>
2994
- `, 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"] }]
3215
+ `, styles: [".wrapper{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper:empty{display:none}.wrapper__header{display:flex}.wrapper__header__text{flex:1 1 auto}.wrapper__header__text__title{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:8px}.wrapper__header__collapse{flex:0 0 auto}.wrapper__header__collapse .collapse-open{transform:rotate(180deg);transition:transform 225ms cubic-bezier(.4,0,.2,1)}.wrapper__header__collapse .collapse-close{transform:rotate(0);transition:transform 225ms cubic-bezier(.4,0,.2,1)}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}.wrapper__rows__row{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}.wrapper__rows__row+.wrapper__rows__row{padding-top:3px;border-top:1px solid #d3d5dc;margin-top:4px}.wrapper__rows__row__field{flex:1 1 auto}.wrapper__rows__row__remove{flex:0 0 auto}\n"] }]
2995
3216
  }] });
2996
3217
 
2997
3218
  function minItemsValidationMessage(error, field) {
@@ -3090,6 +3311,7 @@ function bannerExtension(field) {
3090
3311
  class GioFjsMultiSchemaTypeComponent extends FieldType {
3091
3312
  ngOnInit() {
3092
3313
  set(this.field, 'fieldGroup[0].props.appearance', 'fill');
3314
+ set(this.field, 'fieldGroup[0].props.label', 'Select option');
3093
3315
  }
3094
3316
  }
3095
3317
  GioFjsMultiSchemaTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsMultiSchemaTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
@@ -3097,24 +3319,159 @@ GioFjsMultiSchemaTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
3097
3319
  <div class="wrapper">
3098
3320
  <div class="wrapper__title" *ngIf="props.label">{{ props.label }}</div>
3099
3321
  <p *ngIf="props.description">{{ props.description }}</p>
3100
- <div role="alert" *ngIf="showError && formControl.errors">
3322
+ <div class="wrapper__error" *ngIf="showError && formControl.errors">
3101
3323
  <formly-validation-message [field]="field"></formly-validation-message>
3102
3324
  </div>
3103
3325
  <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
3104
3326
  </div>
3105
- `, 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"] }] });
3327
+ `, isInline: true, styles: [".wrapper{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__title{font-size:16px;font-weight:500;line-height:24px;font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:4px}.wrapper:empty{display:none}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}\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"] }] });
3106
3328
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsMultiSchemaTypeComponent, decorators: [{
3107
3329
  type: Component,
3108
3330
  args: [{ selector: 'gio-fjs-multi-schema-type', template: `
3109
3331
  <div class="wrapper">
3110
3332
  <div class="wrapper__title" *ngIf="props.label">{{ props.label }}</div>
3111
3333
  <p *ngIf="props.description">{{ props.description }}</p>
3112
- <div role="alert" *ngIf="showError && formControl.errors">
3334
+ <div class="wrapper__error" *ngIf="showError && formControl.errors">
3113
3335
  <formly-validation-message [field]="field"></formly-validation-message>
3114
3336
  </div>
3115
3337
  <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
3116
3338
  </div>
3117
- `, 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"] }]
3339
+ `, styles: [".wrapper{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__title{font-size:16px;font-weight:500;line-height:24px;font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:4px}.wrapper:empty{display:none}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}\n"] }]
3340
+ }] });
3341
+
3342
+ /*
3343
+ * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
3344
+ *
3345
+ * Licensed under the Apache License, Version 2.0 (the "License");
3346
+ * you may not use this file except in compliance with the License.
3347
+ * You may obtain a copy of the License at
3348
+ *
3349
+ * http://www.apache.org/licenses/LICENSE-2.0
3350
+ *
3351
+ * Unless required by applicable law or agreed to in writing, software
3352
+ * distributed under the License is distributed on an "AS IS" BASIS,
3353
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3354
+ * See the License for the specific language governing permissions and
3355
+ * limitations under the License.
3356
+ */
3357
+ class GioFjsToggleTypeComponent extends FieldType {
3358
+ }
3359
+ GioFjsToggleTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsToggleTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3360
+ GioFjsToggleTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsToggleTypeComponent, selector: "gio-fjs-toggle-type", usesInheritance: true, ngImport: i0, template: `
3361
+ <gio-form-slide-toggle>
3362
+ <gio-form-label>{{ props.label }}</gio-form-label>
3363
+ {{ props.description }}
3364
+ <mat-slide-toggle
3365
+ gioFormSlideToggle
3366
+ [id]="id"
3367
+ [formControl]="formControl"
3368
+ [formlyAttributes]="field"
3369
+ [tabIndex]="props.tabindex"
3370
+ ></mat-slide-toggle>
3371
+ </gio-form-slide-toggle>
3372
+ `, isInline: true, components: [{ type: GioFormSlideToggleComponent, selector: "gio-form-slide-toggle", inputs: ["appearance"] }, { type: GioFormLabelComponent, selector: "gio-form-label" }, { type: i3$2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex", "name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "checked"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }], directives: [{ type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i1$4.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }] });
3373
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsToggleTypeComponent, decorators: [{
3374
+ type: Component,
3375
+ args: [{
3376
+ selector: 'gio-fjs-toggle-type',
3377
+ template: `
3378
+ <gio-form-slide-toggle>
3379
+ <gio-form-label>{{ props.label }}</gio-form-label>
3380
+ {{ props.description }}
3381
+ <mat-slide-toggle
3382
+ gioFormSlideToggle
3383
+ [id]="id"
3384
+ [formControl]="formControl"
3385
+ [formlyAttributes]="field"
3386
+ [tabIndex]="props.tabindex"
3387
+ ></mat-slide-toggle>
3388
+ </gio-form-slide-toggle>
3389
+ `,
3390
+ }]
3391
+ }] });
3392
+
3393
+ /*
3394
+ * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
3395
+ *
3396
+ * Licensed under the Apache License, Version 2.0 (the "License");
3397
+ * you may not use this file except in compliance with the License.
3398
+ * You may obtain a copy of the License at
3399
+ *
3400
+ * http://www.apache.org/licenses/LICENSE-2.0
3401
+ *
3402
+ * Unless required by applicable law or agreed to in writing, software
3403
+ * distributed under the License is distributed on an "AS IS" BASIS,
3404
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3405
+ * See the License for the specific language governing permissions and
3406
+ * limitations under the License.
3407
+ */
3408
+ class GioFjsHeadersTypeComponent extends FieldType {
3409
+ constructor() {
3410
+ super(...arguments);
3411
+ this.defaultOptions = {
3412
+ props: {
3413
+ outputConfig: {
3414
+ keyName: 'name',
3415
+ valueName: 'value',
3416
+ },
3417
+ },
3418
+ };
3419
+ this.collapse = false;
3420
+ }
3421
+ get map() {
3422
+ return (headers) => [...(headers !== null && headers !== void 0 ? headers : [])].map(header => {
3423
+ return {
3424
+ [this.props.outputConfig.keyName]: header.key,
3425
+ [this.props.outputConfig.valueName]: header.value,
3426
+ };
3427
+ });
3428
+ }
3429
+ }
3430
+ GioFjsHeadersTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsHeadersTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3431
+ GioFjsHeadersTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsHeadersTypeComponent, selector: "gio-fjs-headers-type", usesInheritance: true, ngImport: i0, template: `
3432
+ <div class="wrapper">
3433
+ <div class="wrapper__header">
3434
+ <div class="wrapper__header__text">
3435
+ <div class="wrapper__header__text__title" *ngIf="to.label">{{ to.label }}</div>
3436
+ <p *ngIf="to.description">{{ to.description }}</p>
3437
+ </div>
3438
+ <div class="wrapper__header__collapse">
3439
+ <button type="button" mat-icon-button aria-label="Collapse" (click)="collapse = !collapse">
3440
+ <mat-icon [class.collapse-open]="collapse" [class.collapse-close]="!collapse" svgIcon="gio:nav-arrow-down"></mat-icon>
3441
+ </button>
3442
+ </div>
3443
+ </div>
3444
+ <div class="wrapper__error" *ngIf="showError && formControl.errors">
3445
+ <formly-validation-message [field]="field"></formly-validation-message>
3446
+ </div>
3447
+ <div *ngIf="!collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
3448
+ <gio-form-headers [adaptOutputFn]="map" [formControl]="formControl"></gio-form-headers>
3449
+ </div>
3450
+ </div>
3451
+ `, isInline: true, styles: [".wrapper{display:flex;flex-direction:column;padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__header{display:flex}.wrapper__header__text{flex:1 1 auto}.wrapper__header__text__title{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:8px}.wrapper__header__collapse{flex:0 0 auto}.wrapper__header__collapse .collapse-open{transform:rotate(180deg);transition:transform 225ms cubic-bezier(.4,0,.2,1)}.wrapper__header__collapse .collapse-close{transform:rotate(0);transition:transform 225ms cubic-bezier(.4,0,.2,1)}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}\n"], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i1$4.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: GioFormHeadersComponent, selector: "gio-form-headers", inputs: ["adaptOutputFn"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
3452
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsHeadersTypeComponent, decorators: [{
3453
+ type: Component,
3454
+ args: [{ selector: 'gio-fjs-headers-type', template: `
3455
+ <div class="wrapper">
3456
+ <div class="wrapper__header">
3457
+ <div class="wrapper__header__text">
3458
+ <div class="wrapper__header__text__title" *ngIf="to.label">{{ to.label }}</div>
3459
+ <p *ngIf="to.description">{{ to.description }}</p>
3460
+ </div>
3461
+ <div class="wrapper__header__collapse">
3462
+ <button type="button" mat-icon-button aria-label="Collapse" (click)="collapse = !collapse">
3463
+ <mat-icon [class.collapse-open]="collapse" [class.collapse-close]="!collapse" svgIcon="gio:nav-arrow-down"></mat-icon>
3464
+ </button>
3465
+ </div>
3466
+ </div>
3467
+ <div class="wrapper__error" *ngIf="showError && formControl.errors">
3468
+ <formly-validation-message [field]="field"></formly-validation-message>
3469
+ </div>
3470
+ <div *ngIf="!collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
3471
+ <gio-form-headers [adaptOutputFn]="map" [formControl]="formControl"></gio-form-headers>
3472
+ </div>
3473
+ </div>
3474
+ `, styles: [".wrapper{display:flex;flex-direction:column;padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__header{display:flex}.wrapper__header__text{flex:1 1 auto}.wrapper__header__text__title{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:8px}.wrapper__header__collapse{flex:0 0 auto}.wrapper__header__collapse .collapse-open{transform:rotate(180deg);transition:transform 225ms cubic-bezier(.4,0,.2,1)}.wrapper__header__collapse .collapse-close{transform:rotate(0);transition:transform 225ms cubic-bezier(.4,0,.2,1)}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}\n"] }]
3118
3475
  }] });
3119
3476
 
3120
3477
  /*
@@ -3140,11 +3497,17 @@ GioFormJsonSchemaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0",
3140
3497
  GioFjsObjectTypeComponent,
3141
3498
  GioFjsMultiSchemaTypeComponent,
3142
3499
  GioFjsArrayTypeComponent,
3500
+ GioFjsToggleTypeComponent,
3501
+ GioFjsHeadersTypeComponent,
3143
3502
  GioFormFieldWrapperComponent], imports: [CommonModule,
3144
3503
  A11yModule,
3145
3504
  ReactiveFormsModule, i1$4.FormlyModule, FormlyMaterialModule,
3146
- GioIconsModule], exports: [GioFormJsonSchemaComponent, FormlyModule] });
3147
- GioFormJsonSchemaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaModule, imports: [[
3505
+ GioIconsModule,
3506
+ GioFormSlideToggleModule,
3507
+ GioFormHeadersModule,
3508
+ MatSlideToggleModule,
3509
+ MatButtonModule], exports: [GioFormJsonSchemaComponent, FormlyModule] });
3510
+ GioFormJsonSchemaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaModule, providers: [GioFormlyJsonSchemaService], imports: [[
3148
3511
  CommonModule,
3149
3512
  A11yModule,
3150
3513
  ReactiveFormsModule,
@@ -3170,6 +3533,14 @@ GioFormJsonSchemaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
3170
3533
  { name: 'array', component: GioFjsArrayTypeComponent },
3171
3534
  { name: 'object', component: GioFjsObjectTypeComponent },
3172
3535
  { name: 'multischema', component: GioFjsMultiSchemaTypeComponent },
3536
+ {
3537
+ name: 'toggle',
3538
+ component: GioFjsToggleTypeComponent,
3539
+ },
3540
+ {
3541
+ name: 'gio-headers-array',
3542
+ component: GioFjsHeadersTypeComponent,
3543
+ },
3173
3544
  ],
3174
3545
  extensions: [{ name: 'banner', extension: { onPopulate: bannerExtension } }],
3175
3546
  extras: {
@@ -3178,6 +3549,10 @@ GioFormJsonSchemaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
3178
3549
  }),
3179
3550
  FormlyMaterialModule,
3180
3551
  GioIconsModule,
3552
+ GioFormSlideToggleModule,
3553
+ GioFormHeadersModule,
3554
+ MatSlideToggleModule,
3555
+ MatButtonModule,
3181
3556
  ], FormlyModule] });
3182
3557
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaModule, decorators: [{
3183
3558
  type: NgModule,
@@ -3188,6 +3563,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3188
3563
  GioFjsObjectTypeComponent,
3189
3564
  GioFjsMultiSchemaTypeComponent,
3190
3565
  GioFjsArrayTypeComponent,
3566
+ GioFjsToggleTypeComponent,
3567
+ GioFjsHeadersTypeComponent,
3191
3568
  GioFormFieldWrapperComponent,
3192
3569
  ],
3193
3570
  imports: [
@@ -3216,6 +3593,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3216
3593
  { name: 'array', component: GioFjsArrayTypeComponent },
3217
3594
  { name: 'object', component: GioFjsObjectTypeComponent },
3218
3595
  { name: 'multischema', component: GioFjsMultiSchemaTypeComponent },
3596
+ {
3597
+ name: 'toggle',
3598
+ component: GioFjsToggleTypeComponent,
3599
+ },
3600
+ {
3601
+ name: 'gio-headers-array',
3602
+ component: GioFjsHeadersTypeComponent,
3603
+ },
3219
3604
  ],
3220
3605
  extensions: [{ name: 'banner', extension: { onPopulate: bannerExtension } }],
3221
3606
  extras: {
@@ -3224,149 +3609,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3224
3609
  }),
3225
3610
  FormlyMaterialModule,
3226
3611
  GioIconsModule,
3612
+ GioFormSlideToggleModule,
3613
+ GioFormHeadersModule,
3614
+ MatSlideToggleModule,
3615
+ MatButtonModule,
3227
3616
  ],
3228
3617
  exports: [GioFormJsonSchemaComponent, FormlyModule],
3229
- }]
3230
- }] });
3231
-
3232
- /*
3233
- * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3234
- *
3235
- * Licensed under the Apache License, Version 2.0 (the "License");
3236
- * you may not use this file except in compliance with the License.
3237
- * You may obtain a copy of the License at
3238
- *
3239
- * http://www.apache.org/licenses/LICENSE-2.0
3240
- *
3241
- * Unless required by applicable law or agreed to in writing, software
3242
- * distributed under the License is distributed on an "AS IS" BASIS,
3243
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3244
- * See the License for the specific language governing permissions and
3245
- * limitations under the License.
3246
- */
3247
- class GioFormSlideToggleComponent {
3248
- constructor() {
3249
- this.unsubscribe$ = new Subject();
3250
- this.appearance = 'outline';
3251
- this.innerMatSlideToggle = null;
3252
- this.innerFormControlName = null;
3253
- this.disabled = false;
3254
- }
3255
- ngAfterContentInit() {
3256
- var _a;
3257
- let isDisabled$ = undefined;
3258
- // Check if disabled is delegated to inner FormControlName
3259
- if (this.innerFormControlName) {
3260
- isDisabled$ = (_a = this.innerFormControlName.statusChanges) === null || _a === void 0 ? void 0 : _a.pipe(map(() => { var _a; return !!((_a = this.innerFormControlName) === null || _a === void 0 ? void 0 : _a.disabled); }), startWith(!!this.innerFormControlName.disabled));
3261
- }
3262
- // If not, check state of inner MatSlideToggle
3263
- else if (this.innerMatSlideToggle) {
3264
- isDisabled$ = this.innerMatSlideToggle.change.pipe(map(event => event.source.disabled), startWith(this.innerMatSlideToggle.disabled));
3265
- }
3266
- if (isDisabled$) {
3267
- isDisabled$.pipe(takeUntil(this.unsubscribe$)).subscribe(disabled => {
3268
- this.disabled = disabled;
3269
- });
3270
- }
3271
- }
3272
- ngOnDestroy() {
3273
- this.unsubscribe$.next();
3274
- this.unsubscribe$.complete();
3275
- }
3276
- }
3277
- GioFormSlideToggleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3278
- 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"] });
3279
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleComponent, decorators: [{
3280
- type: Component,
3281
- 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"] }]
3282
- }], propDecorators: { appearance: [{
3283
- type: Input
3284
- }], innerMatSlideToggle: [{
3285
- type: ContentChild,
3286
- args: [MatSlideToggle, {
3287
- static: false,
3288
- }]
3289
- }], innerFormControlName: [{
3290
- type: ContentChild,
3291
- args: [NgControl, {
3292
- static: false,
3293
- }]
3294
- }] } });
3295
-
3296
- /*
3297
- * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3298
- *
3299
- * Licensed under the Apache License, Version 2.0 (the "License");
3300
- * you may not use this file except in compliance with the License.
3301
- * You may obtain a copy of the License at
3302
- *
3303
- * http://www.apache.org/licenses/LICENSE-2.0
3304
- *
3305
- * Unless required by applicable law or agreed to in writing, software
3306
- * distributed under the License is distributed on an "AS IS" BASIS,
3307
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3308
- * See the License for the specific language governing permissions and
3309
- * limitations under the License.
3310
- */
3311
- class GioFormLabelComponent {
3312
- }
3313
- GioFormLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3314
- 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 });
3315
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormLabelComponent, decorators: [{
3316
- type: Component,
3317
- args: [{
3318
- selector: 'gio-form-label',
3319
- template: `<ng-content></ng-content>`,
3320
- }]
3321
- }] });
3322
- class GioFormPrefixDirective {
3323
- }
3324
- GioFormPrefixDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormPrefixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3325
- GioFormPrefixDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioFormPrefixDirective, selector: "[gioFormPrefix]", ngImport: i0 });
3326
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormPrefixDirective, decorators: [{
3327
- type: Directive,
3328
- args: [{
3329
- selector: '[gioFormPrefix]',
3330
- }]
3331
- }] });
3332
- class GioFormSlideToggleDirective {
3333
- }
3334
- GioFormSlideToggleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3335
- GioFormSlideToggleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioFormSlideToggleDirective, selector: "[gioFormSlideToggle]", ngImport: i0 });
3336
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleDirective, decorators: [{
3337
- type: Directive,
3338
- args: [{
3339
- selector: '[gioFormSlideToggle]',
3340
- }]
3341
- }] });
3342
-
3343
- /*
3344
- * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3345
- *
3346
- * Licensed under the Apache License, Version 2.0 (the "License");
3347
- * you may not use this file except in compliance with the License.
3348
- * You may obtain a copy of the License at
3349
- *
3350
- * http://www.apache.org/licenses/LICENSE-2.0
3351
- *
3352
- * Unless required by applicable law or agreed to in writing, software
3353
- * distributed under the License is distributed on an "AS IS" BASIS,
3354
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3355
- * See the License for the specific language governing permissions and
3356
- * limitations under the License.
3357
- */
3358
- class GioFormSlideToggleModule {
3359
- }
3360
- GioFormSlideToggleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3361
- 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] });
3362
- GioFormSlideToggleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleModule, imports: [[CommonModule]] });
3363
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormSlideToggleModule, decorators: [{
3364
- type: NgModule,
3365
- args: [{
3366
- imports: [CommonModule],
3367
- declarations: [GioFormSlideToggleComponent, GioFormLabelComponent, GioFormPrefixDirective],
3368
- exports: [GioFormSlideToggleComponent, GioFormLabelComponent, GioFormPrefixDirective],
3369
- entryComponents: [GioFormSlideToggleComponent],
3618
+ providers: [GioFormlyJsonSchemaService],
3370
3619
  }]
3371
3620
  }] });
3372
3621