@gravitee/ui-particles-angular 12.11.4 → 12.12.0-conditional-json-schema-245b66c
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.
- package/esm2022/lib/gio-form-json-schema/gio-form-json-schema.component.mjs +8 -7
- package/esm2022/lib/gio-form-json-schema/gio-formly-json-schema.service.mjs +47 -5
- package/esm2022/lib/gio-form-json-schema/model/GioJsonSchema.mjs +1 -1
- package/esm2022/lib/gio-form-json-schema/model/GioJsonSchemaContext.mjs +2 -0
- package/esm2022/lib/gio-form-json-schema/type-component/code-editor-type.component.mjs +2 -12
- package/esm2022/lib/gio-monaco-editor/gio-monaco-editor.component.mjs +1 -1
- package/fesm2022/gravitee-ui-particles-angular.mjs +54 -21
- package/fesm2022/gravitee-ui-particles-angular.mjs.map +1 -1
- package/lib/gio-form-json-schema/gio-form-json-schema.component.d.ts +4 -2
- package/lib/gio-form-json-schema/gio-formly-json-schema.service.d.ts +3 -1
- package/lib/gio-form-json-schema/model/GioJsonSchema.d.ts +5 -2
- package/lib/gio-form-json-schema/model/GioJsonSchemaContext.d.ts +1 -0
- package/lib/gio-form-json-schema/type-component/code-editor-type.component.d.ts +1 -3
- package/lib/gio-monaco-editor/gio-monaco-editor.component.d.ts +3 -1
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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,12 +1,14 @@
|
|
|
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 displayOnlyIfMap;
|
|
10
12
|
private uiTypeMap;
|
|
11
13
|
private formatMap;
|
|
12
14
|
private bannerMap;
|
|
@@ -1,8 +1,13 @@
|
|
|
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
|
+
displayOnlyIf?: {
|
|
9
|
+
$eq: Record<string, string | number | boolean | Array<string | number | boolean>>;
|
|
10
|
+
};
|
|
6
11
|
banner?: GioBannerConfig;
|
|
7
12
|
monacoEditorConfig?: GioMonacoEditorConfig;
|
|
8
13
|
enumLabelMap?: Record<string, string>;
|
|
@@ -31,7 +36,5 @@ declare module 'json-schema' {
|
|
|
31
36
|
deprecated?: boolean;
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
|
-
import { JSONSchema7 } from 'json-schema';
|
|
35
|
-
import { GioMonacoEditorConfig } from '../type-component/code-editor-type.component';
|
|
36
39
|
export type GioJsonSchema = JSONSchema7;
|
|
37
40
|
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;
|