@gravitee/ui-particles-angular 5.13.0 → 5.14.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 (26) hide show
  1. package/esm2020/lib/gio-form-json-schema/model/GioJsonSchema.mjs +1 -1
  2. package/esm2020/lib/gio-form-json-schema/type-component/object-type.component.mjs +2 -2
  3. package/esm2020/lib/gio-monaco-editor/gio-monaco-editor.component.mjs +172 -0
  4. package/esm2020/lib/gio-monaco-editor/gio-monaco-editor.harness.mjs +63 -0
  5. package/esm2020/lib/gio-monaco-editor/gio-monaco-editor.module.mjs +58 -0
  6. package/esm2020/lib/gio-monaco-editor/gio-monaco-editor.testing.component.mjs +55 -0
  7. package/esm2020/lib/gio-monaco-editor/models/GioMonacoEditorConfig.mjs +18 -0
  8. package/esm2020/lib/gio-monaco-editor/models/MonacoEditorTheme.mjs +2 -0
  9. package/esm2020/lib/gio-monaco-editor/services/gio-language-json.service.mjs +71 -0
  10. package/esm2020/lib/gio-monaco-editor/services/gio-monaco-editor.service.mjs +67 -0
  11. package/esm2020/lib/public-api.mjs +4 -1
  12. package/fesm2015/gravitee-ui-particles-angular.mjs +464 -6
  13. package/fesm2015/gravitee-ui-particles-angular.mjs.map +1 -1
  14. package/fesm2020/gravitee-ui-particles-angular.mjs +476 -6
  15. package/fesm2020/gravitee-ui-particles-angular.mjs.map +1 -1
  16. package/lib/gio-form-json-schema/model/GioJsonSchema.d.ts +17 -11
  17. package/lib/gio-monaco-editor/gio-monaco-editor.component.d.ts +45 -0
  18. package/lib/gio-monaco-editor/gio-monaco-editor.harness.d.ts +16 -0
  19. package/lib/gio-monaco-editor/gio-monaco-editor.module.d.ts +18 -0
  20. package/lib/gio-monaco-editor/gio-monaco-editor.testing.component.d.ts +12 -0
  21. package/lib/gio-monaco-editor/models/GioMonacoEditorConfig.d.ts +6 -0
  22. package/lib/gio-monaco-editor/models/MonacoEditorTheme.d.ts +1 -0
  23. package/lib/gio-monaco-editor/services/gio-language-json.service.d.ts +17 -0
  24. package/lib/gio-monaco-editor/services/gio-monaco-editor.service.d.ts +18 -0
  25. package/lib/public-api.d.ts +3 -0
  26. package/package.json +1 -1
@@ -1,3 +1,18 @@
1
+ /**
2
+ * GioConfig is used to add some custom configuration to the JSONSchema7
3
+ * ⚠️ Keep updated with the GioJsonSchema.json to have the same interface ⚠️
4
+ */
5
+ export interface GioConfig {
6
+ banner?: GioBannerConfig;
7
+ uiType?: GioUiTypeConfig;
8
+ }
9
+ declare type GioBannerConfig = {
10
+ title: string;
11
+ text: string;
12
+ } | {
13
+ text: string;
14
+ };
15
+ declare type GioUiTypeConfig = 'gio-headers-array';
1
16
  /**
2
17
  * Override the JSONSchema7 interface to add gioConfig
3
18
  * Use this way because the JSONSchema7 interface is recursive
@@ -5,18 +20,9 @@
5
20
  */
6
21
  declare module 'json-schema' {
7
22
  interface JSONSchema7 {
8
- gioConfig?: {
9
- banner?: GioBannerConfig;
10
- uiType?: GioUiTypeConfig;
11
- };
23
+ gioConfig?: GioConfig;
12
24
  }
13
- type GioBannerConfig = {
14
- title: string;
15
- text: string;
16
- } | {
17
- text: string;
18
- };
19
- type GioUiTypeConfig = 'gio-headers-array';
20
25
  }
21
26
  import { JSONSchema7 } from 'json-schema';
22
27
  export declare type GioJsonSchema = JSONSchema7;
28
+ export {};
@@ -0,0 +1,45 @@
1
+ import { AfterViewInit, ChangeDetectorRef, ElementRef, NgZone, OnDestroy } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import { editor } from 'monaco-editor';
4
+ import { GioMonacoEditorConfig } from './models/GioMonacoEditorConfig';
5
+ import { GioLanguageJsonService } from './services/gio-language-json.service';
6
+ import { GioMonacoEditorService } from './services/gio-monaco-editor.service';
7
+ import * as i0 from "@angular/core";
8
+ export declare type MonacoEditorLanguageConfig = {
9
+ language: 'json';
10
+ schemas: {
11
+ uri: string;
12
+ schema: unknown;
13
+ }[];
14
+ };
15
+ export declare class GioMonacoEditorComponent implements ControlValueAccessor, AfterViewInit, OnDestroy {
16
+ private readonly config;
17
+ private readonly monacoEditorService;
18
+ private readonly languageJsonService;
19
+ private readonly hostElement;
20
+ private readonly changeDetectorRef;
21
+ private readonly ngZone;
22
+ languageConfig?: MonacoEditorLanguageConfig;
23
+ options: editor.IStandaloneEditorConstructionOptions;
24
+ id: string;
25
+ loading: boolean;
26
+ private defaultOptions;
27
+ protected value: string;
28
+ protected readOnly: boolean;
29
+ private standaloneCodeEditor?;
30
+ private textModel?;
31
+ protected _onChange: (_value: string | null) => void;
32
+ protected _onTouched: () => void;
33
+ private unsubscribe$;
34
+ constructor(config: GioMonacoEditorConfig, monacoEditorService: GioMonacoEditorService, languageJsonService: GioLanguageJsonService, hostElement: ElementRef, changeDetectorRef: ChangeDetectorRef, ngZone: NgZone);
35
+ ngAfterViewInit(): void;
36
+ ngOnDestroy(): void;
37
+ writeValue(_value: string): void;
38
+ registerOnChange(fn: (_value: string | null) => void): void;
39
+ registerOnTouched(fn: () => void): void;
40
+ setDisabledState(isDisabled: boolean): void;
41
+ private setupEditor;
42
+ private setupLanguage;
43
+ static ɵfac: i0.ɵɵFactoryDeclaration<GioMonacoEditorComponent, never>;
44
+ static ɵcmp: i0.ɵɵComponentDeclaration<GioMonacoEditorComponent, "gio-monaco-editor", never, { "languageConfig": "languageConfig"; "options": "options"; }, {}, never, never>;
45
+ }
@@ -0,0 +1,16 @@
1
+ import { BaseHarnessFilters, ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
2
+ export declare type GioMonacoEditorHarnessFilters = BaseHarnessFilters;
3
+ export declare class GioMonacoEditorHarness extends ComponentHarness {
4
+ static hostSelector: string;
5
+ /**
6
+ * Gets a `HarnessPredicate` that can be used to search for a `GioMonacoEditorHarness` that meets
7
+ * certain criteria.
8
+ *
9
+ * @param options Options for filtering which input instances are considered a match.
10
+ * @return a `HarnessPredicate` configured with the given options.
11
+ */
12
+ static with(options?: GioMonacoEditorHarnessFilters): HarnessPredicate<GioMonacoEditorHarness>;
13
+ protected getInputEl: import("@angular/cdk/testing").AsyncFactoryFn<import("@angular/cdk/testing").TestElement>;
14
+ setValue(value: string): Promise<void>;
15
+ getValue(): Promise<string>;
16
+ }
@@ -0,0 +1,18 @@
1
+ import { GioMonacoEditorConfig } from './models/GioMonacoEditorConfig';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "./gio-monaco-editor.component";
4
+ import * as i2 from "@angular/common";
5
+ import * as i3 from "@angular/common/http";
6
+ import * as i4 from "@angular/forms";
7
+ export declare class GioMonacoEditorModule {
8
+ static forRoot(config: GioMonacoEditorConfig): {
9
+ ngModule: typeof GioMonacoEditorModule;
10
+ providers: {
11
+ provide: import("@angular/core").InjectionToken<GioMonacoEditorConfig>;
12
+ useValue: GioMonacoEditorConfig;
13
+ }[];
14
+ };
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<GioMonacoEditorModule, never>;
16
+ static ɵmod: i0.ɵɵNgModuleDeclaration<GioMonacoEditorModule, [typeof i1.GioMonacoEditorComponent], [typeof i2.CommonModule, typeof i3.HttpClientModule, typeof i4.ReactiveFormsModule], [typeof i1.GioMonacoEditorComponent]>;
17
+ static ɵinj: i0.ɵɵInjectorDeclaration<GioMonacoEditorModule>;
18
+ }
@@ -0,0 +1,12 @@
1
+ import { GioMonacoEditorComponent } from './gio-monaco-editor.component';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * This component is used to test the GioMonacoEditorComponent.
5
+ * This component simulates monaco editor with a simple input.
6
+ */
7
+ export declare class GioMonacoEditorTestingComponent extends GioMonacoEditorComponent {
8
+ get getValue(): string;
9
+ changeValue(value: string): void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<GioMonacoEditorTestingComponent, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<GioMonacoEditorTestingComponent, "gio-monaco-editor", never, {}, {}, never, never>;
12
+ }
@@ -0,0 +1,6 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { MonacoEditorTheme } from './MonacoEditorTheme';
3
+ export declare type GioMonacoEditorConfig = {
4
+ theme?: MonacoEditorTheme;
5
+ };
6
+ export declare const GIO_MONACO_EDITOR_CONFIG: InjectionToken<GioMonacoEditorConfig>;
@@ -0,0 +1 @@
1
+ export declare type MonacoEditorTheme = `vs` | `vs-dark` | `hc-black` | 'hc-light';
@@ -0,0 +1,17 @@
1
+ import { OnDestroy } from '@angular/core';
2
+ import type Monaco from 'monaco-editor';
3
+ import { GioMonacoEditorService } from './gio-monaco-editor.service';
4
+ import * as i0 from "@angular/core";
5
+ export declare class GioLanguageJsonService implements OnDestroy {
6
+ private unsubscribe$;
7
+ private monaco?;
8
+ constructor(codeEditorService: GioMonacoEditorService);
9
+ ngOnDestroy(): void;
10
+ setup(monaco: typeof Monaco): void;
11
+ addSchemas(id: string, definitions?: Array<{
12
+ uri: string;
13
+ schema: unknown;
14
+ }>): void;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<GioLanguageJsonService, never>;
16
+ static ɵprov: i0.ɵɵInjectableDeclaration<GioLanguageJsonService>;
17
+ }
@@ -0,0 +1,18 @@
1
+ import { ReplaySubject } from 'rxjs';
2
+ import Monaco from 'monaco-editor';
3
+ import * as i0 from "@angular/core";
4
+ declare global {
5
+ interface Window {
6
+ require: any;
7
+ monaco: typeof Monaco;
8
+ }
9
+ }
10
+ export declare class GioMonacoEditorService {
11
+ loaded$: ReplaySubject<{
12
+ monaco: typeof Monaco;
13
+ }>;
14
+ private loaded;
15
+ loadEditor(): Promise<void>;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<GioMonacoEditorService, never>;
17
+ static ɵprov: i0.ɵɵInjectableDeclaration<GioMonacoEditorService>;
18
+ }
@@ -31,3 +31,6 @@ export * from './gio-form-slide-toogle/gio-form-slide-toggle.module';
31
31
  export * from './gio-form-slide-toogle/gio-form-label.directive';
32
32
  export * from './gio-form-focus-first-invalid/gio-form-focus-first-invalid.directive';
33
33
  export * from './gio-form-focus-first-invalid/gio-form-focus-first-invalid.module';
34
+ export * from './gio-monaco-editor/gio-monaco-editor.component';
35
+ export * from './gio-monaco-editor/gio-monaco-editor.module';
36
+ export * from './gio-monaco-editor/gio-monaco-editor.harness';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravitee/ui-particles-angular",
3
- "version": "5.13.0",
3
+ "version": "5.14.0",
4
4
  "description": "Gravitee.io - UI Particles Angular",
5
5
  "repository": {
6
6
  "type": "git",