@jsonforms/angular 3.8.0-alpha.1 → 3.8.0-beta.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 (33) hide show
  1. package/lib/fesm2022/jsonforms-angular.mjs +102 -63
  2. package/lib/fesm2022/jsonforms-angular.mjs.map +1 -1
  3. package/lib/index.d.ts +191 -4
  4. package/lib/index.d.ts.map +1 -0
  5. package/package.json +15 -15
  6. package/src/library/abstract-control.ts +20 -12
  7. package/src/library/index.ts +9 -8
  8. package/src/library/jsonforms-root.component.ts +12 -6
  9. package/src/library/jsonforms.component.ts +5 -8
  10. package/src/library/jsonforms.config.ts +57 -0
  11. package/lib/jsonforms-angular.d.ts.map +0 -1
  12. package/lib/library/abstract-control.d.ts +0 -37
  13. package/lib/library/abstract-control.d.ts.map +0 -1
  14. package/lib/library/array-control.d.ts +0 -9
  15. package/lib/library/array-control.d.ts.map +0 -1
  16. package/lib/library/base.renderer.d.ts +0 -16
  17. package/lib/library/base.renderer.d.ts.map +0 -1
  18. package/lib/library/control.d.ts +0 -10
  19. package/lib/library/control.d.ts.map +0 -1
  20. package/lib/library/index.d.ts +0 -10
  21. package/lib/library/index.d.ts.map +0 -1
  22. package/lib/library/jsonforms-root.component.d.ts +0 -40
  23. package/lib/library/jsonforms-root.component.d.ts.map +0 -1
  24. package/lib/library/jsonforms.component.d.ts +0 -17
  25. package/lib/library/jsonforms.component.d.ts.map +0 -1
  26. package/lib/library/jsonforms.module.d.ts +0 -10
  27. package/lib/library/jsonforms.module.d.ts.map +0 -1
  28. package/lib/library/jsonforms.service.d.ts +0 -53
  29. package/lib/library/jsonforms.service.d.ts.map +0 -1
  30. package/lib/library/unknown.component.d.ts +0 -6
  31. package/lib/library/unknown.component.d.ts.map +0 -1
  32. package/lib/public_api.d.ts +0 -2
  33. package/lib/public_api.d.ts.map +0 -1
@@ -1,19 +1,19 @@
1
1
  /*
2
2
  The MIT License
3
-
3
+
4
4
  Copyright (c) 2017-2020 EclipseSource Munich
5
5
  https://github.com/eclipsesource/jsonforms
6
-
6
+
7
7
  Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  of this software and associated documentation files (the "Software"), to deal
9
9
  in the Software without restriction, including without limitation the rights
10
10
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
11
  copies of the Software, and to permit persons to whom the Software is
12
12
  furnished to do so, subject to the following conditions:
13
-
13
+
14
14
  The above copyright notice and this permission notice shall be included in
15
15
  all copies or substantial portions of the Software.
16
-
16
+
17
17
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
18
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
19
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -22,12 +22,13 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
+ export * from './abstract-control';
26
+ export * from './array-control';
25
27
  export * from './base.renderer';
26
28
  export * from './control';
27
- export * from './array-control';
29
+ export * from './jsonforms-root.component';
28
30
  export * from './jsonforms.component';
31
+ export * from './jsonforms.config';
29
32
  export * from './jsonforms.module';
30
- export * from './unknown.component';
31
33
  export * from './jsonforms.service';
32
- export * from './jsonforms-root.component';
33
- export * from './abstract-control';
34
+ export * from './unknown.component';
@@ -26,6 +26,7 @@ import {
26
26
  Component,
27
27
  DoCheck,
28
28
  EventEmitter,
29
+ inject,
29
30
  Input,
30
31
  OnChanges,
31
32
  OnDestroy,
@@ -35,6 +36,7 @@ import {
35
36
  } from '@angular/core';
36
37
  import {
37
38
  Actions,
39
+ defaultMiddleware,
38
40
  JsonFormsI18nState,
39
41
  JsonFormsRendererRegistryEntry,
40
42
  JsonSchema,
@@ -42,13 +44,14 @@ import {
42
44
  UISchemaElement,
43
45
  UISchemaTester,
44
46
  ValidationMode,
45
- defaultMiddleware,
46
47
  } from '@jsonforms/core';
47
48
  import type Ajv from 'ajv';
48
49
  import type { ErrorObject } from 'ajv';
49
- import { JsonFormsAngularService, USE_STATE_VALUE } from './jsonforms.service';
50
+ import merge from 'lodash/merge';
50
51
  import { Subscription } from 'rxjs';
51
52
  import { JsonFormsOutlet } from './jsonforms.component';
53
+ import { JSONFORMS_CONFIG, JsonFormsAngularConfig } from './jsonforms.config';
54
+ import { JsonFormsAngularService, USE_STATE_VALUE } from './jsonforms.service';
52
55
 
53
56
  // TODO Can this be rewritten to not use DoCheck and OnChanges?
54
57
  /* eslint-disable @angular-eslint/no-conflicting-lifecycle */
@@ -68,7 +71,7 @@ export class JsonForms implements DoCheck, OnChanges, OnInit, OnDestroy {
68
71
  @Input() readonly: boolean;
69
72
  @Input() validationMode: ValidationMode;
70
73
  @Input() ajv: Ajv;
71
- @Input() config: any;
74
+ @Input() config: JsonFormsAngularConfig;
72
75
  @Input() i18n: JsonFormsI18nState;
73
76
  @Input() additionalErrors: ErrorObject[];
74
77
  @Input() middleware: Middleware = defaultMiddleware;
@@ -81,7 +84,8 @@ export class JsonForms implements DoCheck, OnChanges, OnInit, OnDestroy {
81
84
  private initialized = false;
82
85
  oldI18N: JsonFormsI18nState;
83
86
 
84
- constructor(private jsonformsService: JsonFormsAngularService) {}
87
+ private jsonformsService = inject(JsonFormsAngularService);
88
+ private providedConfig = inject(JSONFORMS_CONFIG, { optional: true });
85
89
 
86
90
  ngOnInit(): void {
87
91
  this.jsonformsService.init(
@@ -97,7 +101,7 @@ export class JsonForms implements DoCheck, OnChanges, OnInit, OnDestroy {
97
101
  uischemas: this.uischemas,
98
102
  i18n: this.i18n,
99
103
  renderers: this.renderers,
100
- config: this.config,
104
+ config: merge({}, this.providedConfig, this.config),
101
105
  readonly: this.readonly,
102
106
  },
103
107
  this.middleware
@@ -201,7 +205,9 @@ export class JsonForms implements DoCheck, OnChanges, OnInit, OnDestroy {
201
205
 
202
206
  if (newConfig && !newConfig.isFirstChange()) {
203
207
  this.jsonformsService.updateConfig(
204
- Actions.setConfig(newConfig.currentValue)
208
+ Actions.setConfig(
209
+ merge({}, this.providedConfig, newConfig.currentValue)
210
+ )
205
211
  );
206
212
  }
207
213
  }
@@ -25,13 +25,14 @@
25
25
  import maxBy from 'lodash/maxBy';
26
26
  import {
27
27
  Directive,
28
+ inject,
28
29
  Input,
29
30
  OnInit,
30
31
  Type,
31
32
  ViewContainerRef,
32
33
  } from '@angular/core';
33
34
  import {
34
- createId,
35
+ Id,
35
36
  isControl,
36
37
  getConfig,
37
38
  JsonFormsProps,
@@ -73,12 +74,8 @@ export class JsonFormsOutlet
73
74
  {
74
75
  private previousProps: StatePropsOfJsonFormsRenderer;
75
76
 
76
- constructor(
77
- private viewContainerRef: ViewContainerRef,
78
- private jsonformsService: JsonFormsAngularService
79
- ) {
80
- super();
81
- }
77
+ private viewContainerRef = inject(ViewContainerRef);
78
+ private jsonformsService = inject(JsonFormsAngularService);
82
79
 
83
80
  @Input()
84
81
  set renderProps(renderProps: OwnPropsOfRenderer) {
@@ -140,7 +137,7 @@ export class JsonFormsOutlet
140
137
  const controlInstance = instance as JsonFormsControl;
141
138
  if (controlInstance.id === undefined) {
142
139
  const id = isControl(props.uischema)
143
- ? createId(props.uischema.scope)
140
+ ? Id.createId(props.uischema.scope)
144
141
  : undefined;
145
142
  (instance as JsonFormsControl).id = id;
146
143
  }
@@ -0,0 +1,57 @@
1
+ /*
2
+ The MIT License
3
+
4
+ Copyright (c) 2017-2020 EclipseSource Munich
5
+ https://github.com/eclipsesource/jsonforms
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+ */
25
+ import { InjectionToken, Provider } from '@angular/core';
26
+
27
+ export interface JsonFormsAngularConfig {
28
+ /**
29
+ * When true, validation errors only appear after the user has interacted with the field.
30
+ */
31
+ showErrorsOnTouch?: boolean;
32
+ [key: string]: unknown;
33
+ }
34
+
35
+ /**
36
+ * Injection token for providing a global JSONForms config via Angular's DI system.
37
+ * Config provided via this token acts as the base; the `config` @Input on the
38
+ * `<jsonforms>` component takes precedence when both are supplied.
39
+ */
40
+ export const JSONFORMS_CONFIG = new InjectionToken<JsonFormsAngularConfig>(
41
+ 'JsonFormsConfig'
42
+ );
43
+
44
+ /**
45
+ * Returns an Angular provider that sets the global JSONForms config.
46
+ *
47
+ * @example
48
+ * // Standalone bootstrap (app.config.ts)
49
+ * export const appConfig: ApplicationConfig = {
50
+ * providers: [provideJsonFormsConfig({ showErrorsOnTouch: false })],
51
+ * };
52
+ */
53
+ export function provideJsonFormsConfig(
54
+ config: JsonFormsAngularConfig
55
+ ): Provider {
56
+ return { provide: JSONFORMS_CONFIG, useValue: config };
57
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonforms-angular.d.ts","sourceRoot":"","sources":["../src/jsonforms-angular.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,cAAc,cAAc,CAAC"}
@@ -1,37 +0,0 @@
1
- import { ControlElement, JsonFormsState, JsonSchema, OwnPropsOfControl, StatePropsOfControl } from '@jsonforms/core';
2
- import { OnDestroy, OnInit } from '@angular/core';
3
- import { FormControl, ValidatorFn } from '@angular/forms';
4
- import { JsonFormsBaseRenderer } from './base.renderer';
5
- import { JsonFormsAngularService } from './jsonforms.service';
6
- import * as i0 from "@angular/core";
7
- export declare abstract class JsonFormsAbstractControl<Props extends StatePropsOfControl> extends JsonFormsBaseRenderer<ControlElement> implements OnInit, OnDestroy {
8
- protected jsonFormsService: JsonFormsAngularService;
9
- id: string;
10
- disabled: boolean;
11
- visible: boolean;
12
- form: FormControl;
13
- data: any;
14
- label: string;
15
- description: string;
16
- error: string | null;
17
- scopedSchema: JsonSchema;
18
- rootSchema: JsonSchema;
19
- enabled: boolean;
20
- hidden: boolean;
21
- propsPath: string;
22
- constructor(jsonFormsService: JsonFormsAngularService);
23
- getEventValue: (event: any) => any;
24
- onChange(ev: any): void;
25
- shouldShowUnfocusedDescription(): boolean;
26
- ngOnInit(): void;
27
- validator: ValidatorFn;
28
- mapAdditionalProps(_props: Props): void;
29
- ngOnDestroy(): void;
30
- isEnabled(): boolean;
31
- protected getOwnProps(): OwnPropsOfControl;
32
- protected abstract mapToProps(state: JsonFormsState): Props;
33
- protected triggerValidation(): void;
34
- static ɵfac: i0.ɵɵFactoryDeclaration<JsonFormsAbstractControl<any>, never>;
35
- static ɵcmp: i0.ɵɵComponentDeclaration<JsonFormsAbstractControl<any>, "ng-component", never, { "id": { "alias": "id"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "visible": { "alias": "visible"; "required": false; }; }, {}, never, never, true, never>;
36
- }
37
- //# sourceMappingURL=abstract-control.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"abstract-control.d.ts","sourceRoot":"","sources":["../../src/library/abstract-control.ts"],"names":[],"mappings":"AAwBA,OAAO,EAGL,cAAc,EACd,cAAc,EACd,UAAU,EACV,iBAAiB,EAEjB,mBAAmB,EACpB,MAAM,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AwB;CAmI7C"}
@@ -1,9 +0,0 @@
1
- import { ArrayTranslations, JsonFormsState, StatePropsOfArrayControl } from '@jsonforms/core';
2
- import type { OnDestroy, OnInit } from '@angular/core';
3
- import { JsonFormsAbstractControl } from './abstract-control';
4
- export declare class JsonFormsArrayControl extends JsonFormsAbstractControl<StatePropsOfArrayControl> implements OnInit, OnDestroy {
5
- protected mapToProps(state: JsonFormsState): StatePropsOfArrayControl & {
6
- translations: ArrayTranslations;
7
- };
8
- }
9
- //# sourceMappingURL=array-control.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"array-control.d.ts","sourceRoot":"","sources":["../../src/library/array-control.ts"],"names":[],"mappings":"AAwBA,OAAO,EAEL,iBAAiB,EAGjB,cAAc,EAEd,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,qBAAa,qBACX,SAAQ,wBAAwB,CAAC,wBAAwB,CACzD,YAAW,MAAM,EAAE,SAAS;IAE5B,SAAS,CAAC,UAAU,CAClB,KAAK,EAAE,cAAc,GACpB,wBAAwB,GAAG;QAAE,YAAY,EAAE,iBAAiB,CAAA;KAAE;CAYlE"}
@@ -1,16 +0,0 @@
1
- import { OnDestroy } from '@angular/core';
2
- import { JsonSchema, OwnPropsOfRenderer, UISchemaElement } from '@jsonforms/core';
3
- import { Subscription } from 'rxjs';
4
- import * as i0 from "@angular/core";
5
- export declare class JsonFormsBaseRenderer<T extends UISchemaElement> implements OnDestroy {
6
- uischema: T;
7
- schema: JsonSchema;
8
- path: string;
9
- protected subscriptions: Subscription;
10
- protected addSubscription(subscription: Subscription | Subscription[]): void;
11
- protected getOwnProps(): OwnPropsOfRenderer;
12
- ngOnDestroy(): void;
13
- static ɵfac: i0.ɵɵFactoryDeclaration<JsonFormsBaseRenderer<any>, never>;
14
- static ɵdir: i0.ɵɵDirectiveDeclaration<JsonFormsBaseRenderer<any>, never, never, { "uischema": { "alias": "uischema"; "required": false; }; "schema": { "alias": "schema"; "required": false; }; "path": { "alias": "path"; "required": false; }; }, {}, never, never, true, never>;
15
- }
16
- //# sourceMappingURL=base.renderer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.renderer.d.ts","sourceRoot":"","sources":["../../src/library/base.renderer.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAoB,SAAS,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;;AAEpC,qBACa,qBAAqB,CAAC,CAAC,SAAS,eAAe,CAC1D,YAAW,SAAS;IAEX,QAAQ,EAAE,CAAC,CAAC;IACZ,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,aAAa,EAAE,YAAY,CAAsB;IAE3D,SAAS,CAAC,eAAe,CAAC,YAAY,EAAE,YAAY,GAAG,YAAY,EAAE;IAQrE,SAAS,CAAC,WAAW,IAAI,kBAAkB;IAQ3C,WAAW,IAAI,IAAI;yCAxBR,qBAAqB;2CAArB,qBAAqB;CA2BjC"}
@@ -1,10 +0,0 @@
1
- import { JsonFormsState, StatePropsOfControl, StatePropsOfControlWithDetail } from '@jsonforms/core';
2
- import type { OnDestroy, OnInit } from '@angular/core';
3
- import { JsonFormsAbstractControl } from './abstract-control';
4
- export declare class JsonFormsControl extends JsonFormsAbstractControl<StatePropsOfControl> implements OnInit, OnDestroy {
5
- protected mapToProps(state: JsonFormsState): StatePropsOfControl;
6
- }
7
- export declare class JsonFormsControlWithDetail extends JsonFormsAbstractControl<StatePropsOfControlWithDetail> implements OnInit, OnDestroy {
8
- protected mapToProps(state: JsonFormsState): StatePropsOfControlWithDetail;
9
- }
10
- //# sourceMappingURL=control.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../src/library/control.ts"],"names":[],"mappings":"AAwBA,OAAO,EACL,cAAc,EAGd,mBAAmB,EACnB,6BAA6B,EAC9B,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,qBAAa,gBACX,SAAQ,wBAAwB,CAAC,mBAAmB,CACpD,YAAW,MAAM,EAAE,SAAS;IAE5B,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,cAAc,GAAG,mBAAmB;CAIjE;AAED,qBAAa,0BACX,SAAQ,wBAAwB,CAAC,6BAA6B,CAC9D,YAAW,MAAM,EAAE,SAAS;IAE5B,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,cAAc,GAAG,6BAA6B;CAI3E"}
@@ -1,10 +0,0 @@
1
- export * from './base.renderer';
2
- export * from './control';
3
- export * from './array-control';
4
- export * from './jsonforms.component';
5
- export * from './jsonforms.module';
6
- export * from './unknown.component';
7
- export * from './jsonforms.service';
8
- export * from './jsonforms-root.component';
9
- export * from './abstract-control';
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAwBA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC"}
@@ -1,40 +0,0 @@
1
- import { DoCheck, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
2
- import { JsonFormsI18nState, JsonFormsRendererRegistryEntry, JsonSchema, Middleware, UISchemaElement, UISchemaTester, ValidationMode } from '@jsonforms/core';
3
- import type Ajv from 'ajv';
4
- import type { ErrorObject } from 'ajv';
5
- import { JsonFormsAngularService } from './jsonforms.service';
6
- import { Subscription } from 'rxjs';
7
- import * as i0 from "@angular/core";
8
- export declare class JsonForms implements DoCheck, OnChanges, OnInit, OnDestroy {
9
- private jsonformsService;
10
- uischema: UISchemaElement;
11
- schema: JsonSchema;
12
- data: any;
13
- renderers: JsonFormsRendererRegistryEntry[];
14
- uischemas: {
15
- tester: UISchemaTester;
16
- uischema: UISchemaElement;
17
- }[];
18
- dataChange: EventEmitter<any>;
19
- readonly: boolean;
20
- validationMode: ValidationMode;
21
- ajv: Ajv;
22
- config: any;
23
- i18n: JsonFormsI18nState;
24
- additionalErrors: ErrorObject[];
25
- middleware: Middleware;
26
- errors: EventEmitter<ErrorObject<string, Record<string, any>, unknown>[]>;
27
- private previousData;
28
- private previousErrors;
29
- subscription: Subscription;
30
- private initialized;
31
- oldI18N: JsonFormsI18nState;
32
- constructor(jsonformsService: JsonFormsAngularService);
33
- ngOnInit(): void;
34
- ngDoCheck(): void;
35
- ngOnChanges(changes: SimpleChanges): void;
36
- ngOnDestroy(): void;
37
- static ɵfac: i0.ɵɵFactoryDeclaration<JsonForms, never>;
38
- static ɵcmp: i0.ɵɵComponentDeclaration<JsonForms, "jsonforms", never, { "uischema": { "alias": "uischema"; "required": false; }; "schema": { "alias": "schema"; "required": false; }; "data": { "alias": "data"; "required": false; }; "renderers": { "alias": "renderers"; "required": false; }; "uischemas": { "alias": "uischemas"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "validationMode": { "alias": "validationMode"; "required": false; }; "ajv": { "alias": "ajv"; "required": false; }; "config": { "alias": "config"; "required": false; }; "i18n": { "alias": "i18n"; "required": false; }; "additionalErrors": { "alias": "additionalErrors"; "required": false; }; "middleware": { "alias": "middleware"; "required": false; }; }, { "dataChange": "dataChange"; "errors": "errors"; }, never, never, true, never>;
39
- }
40
- //# sourceMappingURL=jsonforms-root.component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonforms-root.component.d.ts","sourceRoot":"","sources":["../../src/library/jsonforms-root.component.ts"],"names":[],"mappings":"AAwBA,OAAO,EAEL,OAAO,EACP,YAAY,EAEZ,SAAS,EACT,SAAS,EACT,MAAM,EAEN,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,kBAAkB,EAClB,8BAA8B,EAC9B,UAAU,EACV,UAAU,EACV,eAAe,EACf,cAAc,EACd,cAAc,EAEf,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAmB,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;;AAKpC,qBAMa,SAAU,YAAW,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS;IAuBzD,OAAO,CAAC,gBAAgB;IAtB3B,QAAQ,EAAE,eAAe,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,GAAG,CAAC;IACV,SAAS,EAAE,8BAA8B,EAAE,CAAC;IAC5C,SAAS,EAAE;QAAE,MAAM,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,eAAe,CAAA;KAAE,EAAE,CAAC;IAClE,UAAU,oBAA2B;IACtC,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,cAAc,CAAC;IAC/B,GAAG,EAAE,GAAG,CAAC;IACT,MAAM,EAAE,GAAG,CAAC;IACZ,IAAI,EAAE,kBAAkB,CAAC;IACzB,gBAAgB,EAAE,WAAW,EAAE,CAAC;IAChC,UAAU,EAAE,UAAU,CAAqB;IAC1C,MAAM,oEAAqC;IAErD,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,cAAc,CAAgB;IACtC,YAAY,EAAE,YAAY,CAAC;IAE3B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,EAAE,kBAAkB,CAAC;gBAER,gBAAgB,EAAE,uBAAuB;IAE7D,QAAQ,IAAI,IAAI;IAmChB,SAAS,IAAI,IAAI;IAyBjB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IA+DzC,WAAW,IAAI,IAAI;yCApJR,SAAS;2CAAT,SAAS;CAuJrB"}
@@ -1,17 +0,0 @@
1
- import { OnInit, ViewContainerRef } from '@angular/core';
2
- import { JsonFormsState, OwnPropsOfRenderer, UISchemaElement } from '@jsonforms/core';
3
- import { JsonFormsBaseRenderer } from './base.renderer';
4
- import { JsonFormsAngularService } from './jsonforms.service';
5
- import * as i0 from "@angular/core";
6
- export declare class JsonFormsOutlet extends JsonFormsBaseRenderer<UISchemaElement> implements OnInit {
7
- private viewContainerRef;
8
- private jsonformsService;
9
- private previousProps;
10
- constructor(viewContainerRef: ViewContainerRef, jsonformsService: JsonFormsAngularService);
11
- set renderProps(renderProps: OwnPropsOfRenderer);
12
- ngOnInit(): void;
13
- update(state: JsonFormsState): void;
14
- static ɵfac: i0.ɵɵFactoryDeclaration<JsonFormsOutlet, never>;
15
- static ɵdir: i0.ɵɵDirectiveDeclaration<JsonFormsOutlet, "jsonforms-outlet", never, { "renderProps": { "alias": "renderProps"; "required": false; }; }, {}, never, never, true, never>;
16
- }
17
- //# sourceMappingURL=jsonforms.component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonforms.component.d.ts","sourceRoot":"","sources":["../../src/library/jsonforms.component.ts"],"names":[],"mappings":"AAyBA,OAAO,EAGL,MAAM,EAEN,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAKL,cAAc,EAGd,kBAAkB,EAElB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;;AAmB9D,qBAGa,eACX,SAAQ,qBAAqB,CAAC,eAAe,CAC7C,YAAW,MAAM;IAKf,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,gBAAgB;IAJ1B,OAAO,CAAC,aAAa,CAAgC;gBAG3C,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,uBAAuB;IAKnD,IACI,WAAW,CAAC,WAAW,EAAE,kBAAkB,EAK9C;IAED,QAAQ,IAAI,IAAI;IAQhB,MAAM,CAAC,KAAK,EAAE,cAAc;yCA7BjB,eAAe;2CAAf,eAAe;CAgF3B"}
@@ -1,10 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "./jsonforms.component";
3
- import * as i2 from "./unknown.component";
4
- import * as i3 from "./jsonforms-root.component";
5
- export declare class JsonFormsModule {
6
- static ɵfac: i0.ɵɵFactoryDeclaration<JsonFormsModule, never>;
7
- static ɵmod: i0.ɵɵNgModuleDeclaration<JsonFormsModule, never, [typeof i1.JsonFormsOutlet, typeof i2.UnknownRenderer, typeof i3.JsonForms], [typeof i1.JsonFormsOutlet, typeof i3.JsonForms]>;
8
- static ɵinj: i0.ɵɵInjectorDeclaration<JsonFormsModule>;
9
- }
10
- //# sourceMappingURL=jsonforms.module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonforms.module.d.ts","sourceRoot":"","sources":["../../src/library/jsonforms.module.ts"],"names":[],"mappings":";;;;AA6BA,qBAIa,eAAe;yCAAf,eAAe;0CAAf,eAAe;0CAAf,eAAe;CAAG"}
@@ -1,53 +0,0 @@
1
- import { CoreActions, JsonFormsRendererRegistryEntry, JsonFormsState, JsonFormsSubStates, JsonSchema, I18nActions, RankedTester, SetConfigAction, UISchemaActions, UISchemaElement, UISchemaTester, ValidationMode, Middleware } from '@jsonforms/core';
2
- import { Observable } from 'rxjs';
3
- import type { JsonFormsBaseRenderer } from './base.renderer';
4
- import type Ajv from 'ajv';
5
- import type { ErrorObject } from 'ajv';
6
- export declare const USE_STATE_VALUE: unique symbol;
7
- export declare class JsonFormsAngularService {
8
- private _state;
9
- private state;
10
- private middleware;
11
- init(initialState?: JsonFormsSubStates, middleware?: Middleware): void;
12
- get $state(): Observable<JsonFormsState>;
13
- /**
14
- * @deprecated use {@link JsonFormsAngularService.addRenderer}
15
- */
16
- registerRenderer(renderer: JsonFormsBaseRenderer<UISchemaElement>, tester: RankedTester): void;
17
- addRenderer(renderer: JsonFormsBaseRenderer<UISchemaElement>, tester: RankedTester): void;
18
- /**
19
- * @deprecated use {@link JsonFormsAngularService.setRenderer}
20
- */
21
- registerRenderers(renderers: JsonFormsRendererRegistryEntry[]): void;
22
- setRenderers(renderers: JsonFormsRendererRegistryEntry[]): void;
23
- /**
24
- * @deprecated use {@link JsonFormsAngularService.removeRenderer}
25
- */
26
- unregisterRenderer(tester: RankedTester): void;
27
- removeRenderer(tester: RankedTester): void;
28
- updateValidationMode(validationMode: ValidationMode): void;
29
- updateI18n<T extends I18nActions>(i18nAction: T): T;
30
- updateCore<T extends CoreActions>(coreAction: T): T;
31
- /**
32
- * @deprecated use {@link JsonFormsAngularService.setUiSchemas}
33
- */
34
- updateUiSchema<T extends UISchemaActions>(uischemaAction: T): T;
35
- setUiSchemas(uischemas: {
36
- tester: UISchemaTester;
37
- uischema: UISchemaElement;
38
- }[]): void;
39
- updateConfig<T extends SetConfigAction>(setConfigAction: T): T;
40
- setUiSchema(uischema: UISchemaElement | undefined): void;
41
- setSchema(schema: JsonSchema | undefined): void;
42
- setData(data: any): void;
43
- getLocale(): string | undefined;
44
- setLocale(locale: string): void;
45
- setReadonly(readonly: boolean): void;
46
- setMiddleware(middleware: Middleware): void;
47
- getState(): JsonFormsState;
48
- getConfig(): any;
49
- refresh(): void;
50
- updateCoreState(data: any | typeof USE_STATE_VALUE, schema: JsonSchema | typeof USE_STATE_VALUE, uischema: UISchemaElement | typeof USE_STATE_VALUE, ajv: Ajv | typeof USE_STATE_VALUE, validationMode: ValidationMode | typeof USE_STATE_VALUE, additionalErrors: ErrorObject[] | typeof USE_STATE_VALUE): void;
51
- private updateSubject;
52
- }
53
- //# sourceMappingURL=jsonforms.service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonforms.service.d.ts","sourceRoot":"","sources":["../../src/library/jsonforms.service.ts"],"names":[],"mappings":"AAwBA,OAAO,EAGL,WAAW,EAKX,8BAA8B,EAC9B,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,YAAY,EAEZ,eAAe,EACf,eAAe,EACf,eAAe,EAEf,cAAc,EACd,cAAc,EAEd,UAAU,EAEX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAmB,UAAU,EAAE,MAAM,MAAM,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAG7D,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAEvC,eAAO,MAAM,eAAe,eAAsC,CAAC;AACnE,qBAAa,uBAAuB;IAClC,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,KAAK,CAAkC;IAC/C,OAAO,CAAC,UAAU,CAAa;IAE/B,IAAI,CACF,YAAY,GAAE,kBAQb,EACD,UAAU,GAAE,UAA8B;IAwB5C,IAAI,MAAM,IAAI,UAAU,CAAC,cAAc,CAAC,CAKvC;IAED;;OAEG;IACH,gBAAgB,CACd,QAAQ,EAAE,qBAAqB,CAAC,eAAe,CAAC,EAChD,MAAM,EAAE,YAAY,GACnB,IAAI;IAGP,WAAW,CACT,QAAQ,EAAE,qBAAqB,CAAC,eAAe,CAAC,EAChD,MAAM,EAAE,YAAY,GACnB,IAAI;IAKP;;OAEG;IACH,iBAAiB,CAAC,SAAS,EAAE,8BAA8B,EAAE,GAAG,IAAI;IAGpE,YAAY,CAAC,SAAS,EAAE,8BAA8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AAc,EAAE,cAAc,GAAG,OAAO,eAAe,EACvD,gBAAgB,EAAE,WAAW,EAAE,GAAG,OAAO,eAAe,GACvD,IAAI;IA4BP,OAAO,CAAC,aAAa;CAGtB"}
@@ -1,6 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- export declare class UnknownRenderer {
3
- static ɵfac: i0.ɵɵFactoryDeclaration<UnknownRenderer, never>;
4
- static ɵcmp: i0.ɵɵComponentDeclaration<UnknownRenderer, "unknown.renderer", never, {}, {}, never, never, true, never>;
5
- }
6
- //# sourceMappingURL=unknown.component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unknown.component.d.ts","sourceRoot":"","sources":["../../src/library/unknown.component.ts"],"names":[],"mappings":";AAyBA,qBAIa,eAAe;yCAAf,eAAe;2CAAf,eAAe;CAAG"}
@@ -1,2 +0,0 @@
1
- export * from './library';
2
- //# sourceMappingURL=public_api.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"public_api.d.ts","sourceRoot":"","sources":["../src/public_api.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}