@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
@@ -7,9 +7,11 @@ export declare type Header = {
7
7
  key: string;
8
8
  value: string;
9
9
  };
10
+ export declare type FormHeaderAdaptOutputFn<H> = (headers: Header[] | null) => H;
10
11
  export declare class GioFormHeadersComponent implements OnInit, ControlValueAccessor {
11
12
  private readonly fm;
12
13
  private readonly elRef;
14
+ adaptOutputFn?: FormHeaderAdaptOutputFn<unknown>;
13
15
  mainForm: FormGroup;
14
16
  headersFormArray: FormArray;
15
17
  disabled: boolean;
@@ -19,7 +21,7 @@ export declare class GioFormHeadersComponent implements OnInit, ControlValueAcce
19
21
  private filteredHeaderNames;
20
22
  constructor(fm: FocusMonitor, elRef: ElementRef);
21
23
  writeValue(value: Header[] | null): void;
22
- registerOnChange(fn: (headers: Header[] | null) => void): void;
24
+ registerOnChange(fn: (headers: unknown) => void): void;
23
25
  registerOnTouched(fn: () => void): void;
24
26
  setDisabledState(isDisabled: boolean): void;
25
27
  ngOnInit(): void;
@@ -31,5 +33,5 @@ export declare class GioFormHeadersComponent implements OnInit, ControlValueAcce
31
33
  private removeLastHeader;
32
34
  private _filter;
33
35
  static ɵfac: i0.ɵɵFactoryDeclaration<GioFormHeadersComponent, never>;
34
- static ɵcmp: i0.ɵɵComponentDeclaration<GioFormHeadersComponent, "gio-form-headers", never, {}, {}, never, never>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<GioFormHeadersComponent, "gio-form-headers", never, { "adaptOutputFn": "adaptOutputFn"; }, {}, never, never>;
35
37
  }
@@ -1,12 +1,12 @@
1
1
  import { ElementRef, OnDestroy, OnInit } from '@angular/core';
2
2
  import { ControlValueAccessor, FormGroup, NgControl } from '@angular/forms';
3
3
  import { FormlyFieldConfig, FormlyFormOptions } from '@ngx-formly/core';
4
- import { FormlyJsonschema } from '@ngx-formly/core/json-schema';
5
4
  import { FocusMonitor } from '@angular/cdk/a11y';
6
5
  import { GioJsonSchema } from './model/GioJsonSchema';
6
+ import { GioFormlyJsonSchemaService } from './gio-formly-json-schema.service';
7
7
  import * as i0 from "@angular/core";
8
8
  export declare class GioFormJsonSchemaComponent implements ControlValueAccessor, OnInit, OnDestroy {
9
- private readonly formlyJsonschema;
9
+ private readonly gioFormlyJsonSchema;
10
10
  private readonly elRef;
11
11
  private readonly fm;
12
12
  readonly ngControl?: NgControl | undefined;
@@ -19,15 +19,13 @@ export declare class GioFormJsonSchemaComponent implements ControlValueAccessor,
19
19
  _onChange: (value: unknown | null) => void;
20
20
  _onTouched: () => void;
21
21
  private touched;
22
- constructor(formlyJsonschema: FormlyJsonschema, elRef: ElementRef, fm: FocusMonitor, ngControl?: NgControl | undefined);
22
+ constructor(gioFormlyJsonSchema: GioFormlyJsonSchemaService, elRef: ElementRef, fm: FocusMonitor, ngControl?: NgControl | undefined);
23
23
  ngOnInit(): void;
24
24
  ngOnDestroy(): void;
25
25
  writeValue(value: unknown): void;
26
26
  registerOnChange(fn: (value: unknown | null) => void): void;
27
27
  registerOnTouched(fn: () => void): void;
28
28
  setDisabledState?(_isDisabled: boolean): void;
29
- private toFormlyFieldConfig;
30
- private getBannerProperties;
31
29
  static ɵfac: i0.ɵɵFactoryDeclaration<GioFormJsonSchemaComponent, [null, null, null, { optional: true; host: true; }]>;
32
30
  static ɵcmp: i0.ɵɵComponentDeclaration<GioFormJsonSchemaComponent, "gio-form-json-schema", never, { "jsonSchema": "jsonSchema"; "options": "options"; }, {}, never, never>;
33
31
  }
@@ -4,15 +4,21 @@ import * as i2 from "./type-component/null-type.component";
4
4
  import * as i3 from "./type-component/object-type.component";
5
5
  import * as i4 from "./type-component/multischema-type.component";
6
6
  import * as i5 from "./type-component/array-type.component";
7
- import * as i6 from "./wrappers/gio-form-field-wrapper.component";
8
- import * as i7 from "@angular/common";
9
- import * as i8 from "@angular/cdk/a11y";
10
- import * as i9 from "@angular/forms";
11
- import * as i10 from "@ngx-formly/core";
12
- import * as i11 from "@ngx-formly/material";
13
- import * as i12 from "../gio-icons/gio-icons.module";
7
+ import * as i6 from "./type-component/toggle-type.component";
8
+ import * as i7 from "./type-component/headers-type.component";
9
+ import * as i8 from "./wrappers/gio-form-field-wrapper.component";
10
+ import * as i9 from "@angular/common";
11
+ import * as i10 from "@angular/cdk/a11y";
12
+ import * as i11 from "@angular/forms";
13
+ import * as i12 from "@ngx-formly/core";
14
+ import * as i13 from "@ngx-formly/material";
15
+ import * as i14 from "../gio-icons/gio-icons.module";
16
+ import * as i15 from "../gio-form-slide-toogle/gio-form-slide-toggle.module";
17
+ import * as i16 from "../gio-form-headers/gio-form-headers.module";
18
+ import * as i17 from "@angular/material/slide-toggle";
19
+ import * as i18 from "@angular/material/button";
14
20
  export declare class GioFormJsonSchemaModule {
15
21
  static ɵfac: i0.ɵɵFactoryDeclaration<GioFormJsonSchemaModule, never>;
16
- static ɵmod: i0.ɵɵNgModuleDeclaration<GioFormJsonSchemaModule, [typeof i1.GioFormJsonSchemaComponent, typeof i2.GioFjsNullTypeComponent, typeof i3.GioFjsObjectTypeComponent, typeof i4.GioFjsMultiSchemaTypeComponent, typeof i5.GioFjsArrayTypeComponent, typeof i6.GioFormFieldWrapperComponent], [typeof i7.CommonModule, typeof i8.A11yModule, typeof i9.ReactiveFormsModule, typeof i10.FormlyModule, typeof i11.FormlyMaterialModule, typeof i12.GioIconsModule], [typeof i1.GioFormJsonSchemaComponent, typeof i10.FormlyModule]>;
22
+ static ɵmod: i0.ɵɵNgModuleDeclaration<GioFormJsonSchemaModule, [typeof i1.GioFormJsonSchemaComponent, typeof i2.GioFjsNullTypeComponent, typeof i3.GioFjsObjectTypeComponent, typeof i4.GioFjsMultiSchemaTypeComponent, typeof i5.GioFjsArrayTypeComponent, typeof i6.GioFjsToggleTypeComponent, typeof i7.GioFjsHeadersTypeComponent, typeof i8.GioFormFieldWrapperComponent], [typeof i9.CommonModule, typeof i10.A11yModule, typeof i11.ReactiveFormsModule, typeof i12.FormlyModule, typeof i13.FormlyMaterialModule, typeof i14.GioIconsModule, typeof i15.GioFormSlideToggleModule, typeof i16.GioFormHeadersModule, typeof i17.MatSlideToggleModule, typeof i18.MatButtonModule], [typeof i1.GioFormJsonSchemaComponent, typeof i12.FormlyModule]>;
17
23
  static ɵinj: i0.ɵɵInjectorDeclaration<GioFormJsonSchemaModule>;
18
24
  }
@@ -0,0 +1,15 @@
1
+ import { FormlyFieldConfig, FormlyFormBuilder } from '@ngx-formly/core';
2
+ import { FormlyJsonschema } from '@ngx-formly/core/json-schema';
3
+ import { GioJsonSchema } from './model/GioJsonSchema';
4
+ import * as i0 from "@angular/core";
5
+ export declare class GioFormlyJsonSchemaService {
6
+ private readonly formlyJsonschema;
7
+ private readonly builder;
8
+ constructor(formlyJsonschema: FormlyJsonschema, builder: FormlyFormBuilder);
9
+ toFormlyFieldConfig(jsonSchema: GioJsonSchema): FormlyFieldConfig;
10
+ private uiTypeMap;
11
+ private bannerMap;
12
+ private toggleMap;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<GioFormlyJsonSchemaService, never>;
14
+ static ɵprov: i0.ɵɵInjectableDeclaration<GioFormlyJsonSchemaService>;
15
+ }
@@ -1,14 +1,22 @@
1
- import { JSONSchema7 } from 'json-schema';
2
- export interface GioJsonSchema extends JSONSchema7 {
3
- gioConfig?: {
4
- banner?: {
5
- title: string;
6
- text: string;
7
- } | {
8
- text: string;
1
+ /**
2
+ * Override the JSONSchema7 interface to add gioConfig
3
+ * Use this way because the JSONSchema7 interface is recursive
4
+ * And export with new name `GioJsonSchema` to make it more clear
5
+ */
6
+ declare module 'json-schema' {
7
+ interface JSONSchema7 {
8
+ gioConfig?: {
9
+ banner?: GioBannerConfig;
10
+ uiType?: GioUiTypeConfig;
9
11
  };
12
+ }
13
+ type GioBannerConfig = {
14
+ title: string;
15
+ text: string;
16
+ } | {
17
+ text: string;
10
18
  };
11
- properties?: {
12
- [key: string]: GioJsonSchema;
13
- };
19
+ type GioUiTypeConfig = 'gio-headers-array';
14
20
  }
21
+ import { JSONSchema7 } from 'json-schema';
22
+ export declare type GioJsonSchema = JSONSchema7;
@@ -1,6 +1,7 @@
1
1
  import { FieldArrayType } from '@ngx-formly/core';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class GioFjsArrayTypeComponent extends FieldArrayType {
4
+ collapse: boolean;
4
5
  static ɵfac: i0.ɵɵFactoryDeclaration<GioFjsArrayTypeComponent, never>;
5
6
  static ɵcmp: i0.ɵɵComponentDeclaration<GioFjsArrayTypeComponent, "gio-fjs-array-type", never, {}, {}, never, never>;
6
7
  }
@@ -0,0 +1,19 @@
1
+ import { FieldType, FieldTypeConfig, FormlyFieldProps } from '@ngx-formly/core';
2
+ import { FormHeaderAdaptOutputFn } from '../../gio-form-headers/gio-form-headers.component';
3
+ import * as i0 from "@angular/core";
4
+ declare type HeadersProps = FormlyFieldProps & {
5
+ outputConfig: {
6
+ keyName: string;
7
+ valueName: string;
8
+ };
9
+ };
10
+ export declare class GioFjsHeadersTypeComponent extends FieldType<FieldTypeConfig<HeadersProps>> {
11
+ defaultOptions?: Partial<FieldTypeConfig<HeadersProps>> | undefined;
12
+ collapse: boolean;
13
+ get map(): FormHeaderAdaptOutputFn<{
14
+ [x: string]: string;
15
+ }[]>;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<GioFjsHeadersTypeComponent, never>;
17
+ static ɵcmp: i0.ɵɵComponentDeclaration<GioFjsHeadersTypeComponent, "gio-fjs-headers-type", never, {}, {}, never, never>;
18
+ }
19
+ export {};
@@ -0,0 +1,8 @@
1
+ import { FieldType, FieldTypeConfig, FormlyFieldProps } from '@ngx-formly/core';
2
+ import * as i0 from "@angular/core";
3
+ declare type ToggleProps = FormlyFieldProps;
4
+ export declare class GioFjsToggleTypeComponent extends FieldType<FieldTypeConfig<ToggleProps>> {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<GioFjsToggleTypeComponent, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<GioFjsToggleTypeComponent, "gio-fjs-toggle-type", never, {}, {}, never, never>;
7
+ }
8
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravitee/ui-particles-angular",
3
- "version": "5.10.0",
3
+ "version": "5.11.0",
4
4
  "description": "Gravitee.io - UI Particles Angular",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,8 +29,8 @@ $background: map.get(theme.$mat-theme, background);
29
29
  // Remove bottom padding on mat-form-field inside mat-cell
30
30
  // Note: In Angular 15, we should be able to use SubscriptSizing option for that
31
31
  .mat-cell {
32
- // appearance=fill
33
- .mat-form-field.mat-form-field-appearance-outline:not(.ng-invalid, :has(mat-hint)) {
32
+ // appearance=outline
33
+ .mat-form-field.mat-form-field-appearance-outline:not(:has(mat-hint), :has(mat-error)) {
34
34
  padding-bottom: 0;
35
35
 
36
36
  .mat-form-field-wrapper {
@@ -39,7 +39,7 @@ $background: map.get(theme.$mat-theme, background);
39
39
  }
40
40
 
41
41
  // appearance=standard
42
- .mat-form-field.mat-form-field-appearance-standard:not(.ng-invalid, :has(mat-hint)) {
42
+ .mat-form-field.mat-form-field-appearance-standard:not(:has(mat-hint), :has(mat-error)) {
43
43
  padding-bottom: 0;
44
44
 
45
45
  .mat-form-field-wrapper {