@gravitee/ui-particles-angular 12.12.0 → 12.13.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.
@@ -4,6 +4,7 @@ import { FormlyFieldConfig, FormlyFormOptions } from '@ngx-formly/core';
4
4
  import { FocusMonitor } from '@angular/cdk/a11y';
5
5
  import { GioJsonSchema } from './model/GioJsonSchema';
6
6
  import { GioFormlyJsonSchemaService } from './gio-formly-json-schema.service';
7
+ import { GioJsonSchemaContext } from './model/GioJsonSchemaContext';
7
8
  import * as i0 from "@angular/core";
8
9
  export declare class GioFormJsonSchemaComponent implements ControlValueAccessor, OnChanges, OnInit, AfterViewInit, OnDestroy {
9
10
  private readonly gioFormlyJsonSchema;
@@ -14,7 +15,8 @@ export declare class GioFormJsonSchemaComponent implements ControlValueAccessor,
14
15
  static isDisplayable(jsonSchema: GioJsonSchema): boolean;
15
16
  private unsubscribe$;
16
17
  private gioFormFocusInvalidIgnore;
17
- set jsonSchema(jsonSchema: GioJsonSchema);
18
+ jsonSchema: GioJsonSchema;
19
+ context?: GioJsonSchemaContext;
18
20
  formGroup: UntypedFormGroup;
19
21
  options: FormlyFormOptions;
20
22
  ready: EventEmitter<boolean>;
@@ -37,5 +39,5 @@ export declare class GioFormJsonSchemaComponent implements ControlValueAccessor,
37
39
  registerOnTouched(fn: () => void): void;
38
40
  setDisabledState?(isDisabled: boolean): void;
39
41
  static ɵfac: i0.ɵɵFactoryDeclaration<GioFormJsonSchemaComponent, [null, null, null, null, { optional: true; host: true; }]>;
40
- static ɵcmp: i0.ɵɵComponentDeclaration<GioFormJsonSchemaComponent, "gio-form-json-schema", never, { "jsonSchema": { "alias": "jsonSchema"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, { "ready": "ready"; }, never, never, false, never>;
42
+ static ɵcmp: i0.ɵɵComponentDeclaration<GioFormJsonSchemaComponent, "gio-form-json-schema", never, { "jsonSchema": { "alias": "jsonSchema"; "required": true; }; "context": { "alias": "context"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, { "ready": "ready"; }, never, never, false, never>;
41
43
  }
@@ -1,17 +1,19 @@
1
1
  import { FormlyFieldConfig, FormlyFormBuilder } from '@ngx-formly/core';
2
2
  import { FormlyJsonschema } from '@ngx-formly/core/json-schema';
3
3
  import { GioJsonSchema } from './model/GioJsonSchema';
4
+ import { GioJsonSchemaContext } from './model/GioJsonSchemaContext';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class GioFormlyJsonSchemaService {
6
7
  private readonly formlyJsonschema;
7
8
  private readonly builder;
8
9
  constructor(formlyJsonschema: FormlyJsonschema, builder: FormlyFormBuilder);
9
- toFormlyFieldConfig(jsonSchema: GioJsonSchema): FormlyFieldConfig;
10
+ toFormlyFieldConfig(jsonSchema: GioJsonSchema, context?: GioJsonSchemaContext): FormlyFieldConfig;
11
+ private displayIfMap;
10
12
  private uiTypeMap;
11
13
  private formatMap;
12
14
  private bannerMap;
13
15
  private toggleMap;
14
- private disabledMap;
16
+ private disableIfMap;
15
17
  private enumLabelMap;
16
18
  private deprecatedMap;
17
19
  static ɵfac: i0.ɵɵFactoryDeclaration<GioFormlyJsonSchemaService, never>;
@@ -1,8 +1,12 @@
1
+ import { JSONSchema7 } from 'json-schema';
2
+ import { GioMonacoEditorConfig } from '../type-component/code-editor-type.component';
1
3
  /**
2
4
  * GioConfig is used to add some custom configuration to the JSONSchema7
3
5
  * ⚠️ Keep updated with the GioJsonSchema.json to have the same interface ⚠️
4
6
  */
5
7
  export interface GioConfig extends GioUiTypeConfig {
8
+ displayIf?: GioIfConfig;
9
+ disableIf?: GioIfConfig;
6
10
  banner?: GioBannerConfig;
7
11
  monacoEditorConfig?: GioMonacoEditorConfig;
8
12
  enumLabelMap?: Record<string, string>;
@@ -20,6 +24,9 @@ type GioUiTypeConfig = {
20
24
  uiType?: 'gio-headers-array' | string;
21
25
  uiTypeProps?: Record<string, unknown>;
22
26
  };
27
+ export type GioIfConfig = {
28
+ $eq: Record<string, string | number | boolean | Array<string | number | boolean>>;
29
+ };
23
30
  /**
24
31
  * Override the JSONSchema7 interface to add gioConfig
25
32
  * Use this way because the JSONSchema7 interface is recursive
@@ -31,7 +38,5 @@ declare module 'json-schema' {
31
38
  deprecated?: boolean;
32
39
  }
33
40
  }
34
- import { JSONSchema7 } from 'json-schema';
35
- import { GioMonacoEditorConfig } from '../type-component/code-editor-type.component';
36
41
  export type GioJsonSchema = JSONSchema7;
37
42
  export {};
@@ -0,0 +1 @@
1
+ export type GioJsonSchemaContext = Record<string, unknown>;
@@ -3,9 +3,7 @@ import { FieldTypeConfig, FormlyFieldProps } from '@ngx-formly/core';
3
3
  import { FieldType } from '@ngx-formly/material';
4
4
  import { MonacoEditorLanguageConfig } from '../../gio-monaco-editor/gio-monaco-editor.component';
5
5
  import * as i0 from "@angular/core";
6
- export type GioMonacoEditorConfig = {
7
- language: 'json';
8
- };
6
+ export type GioMonacoEditorConfig = MonacoEditorLanguageConfig;
9
7
  type CodeEditorProps = FormlyFieldProps & {
10
8
  monacoEditorConfig?: GioMonacoEditorConfig;
11
9
  };
@@ -10,7 +10,7 @@ import { JSONSchema } from './models/JSONSchemaAutoComplete';
10
10
  import * as i0 from "@angular/core";
11
11
  export type MonacoEditorLanguageConfig = {
12
12
  language: 'json';
13
- schemas: {
13
+ schemas?: {
14
14
  uri: string;
15
15
  schema: unknown;
16
16
  }[];
@@ -18,6 +18,8 @@ export type MonacoEditorLanguageConfig = {
18
18
  language: 'markdown';
19
19
  } | {
20
20
  language: 'html';
21
+ } | {
22
+ language: 'yaml';
21
23
  } | {
22
24
  language: 'spel';
23
25
  schema?: JSONSchema;
@@ -24,6 +24,7 @@ export * from './gio-mat-config';
24
24
  export * from './gio-form-json-schema/gio-form-json-schema.component';
25
25
  export * from './gio-form-json-schema/gio-form-json-schema.module';
26
26
  export * from './gio-form-json-schema/model/GioJsonSchema';
27
+ export * from './gio-form-json-schema/model/GioJsonSchemaContext';
27
28
  export * from './gio-form-slide-toggle/gio-form-slide-toggle.component';
28
29
  export * from './gio-form-slide-toggle/gio-form-slide-toggle.module';
29
30
  export * from './gio-form-slide-toggle/gio-form-label.directive';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravitee/ui-particles-angular",
3
- "version": "12.12.0",
3
+ "version": "12.13.0",
4
4
  "description": "Gravitee.io - UI Particles Angular",
5
5
  "repository": {
6
6
  "type": "git",