@jsonforms/angular 3.2.0-beta.0 → 3.2.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 (103) hide show
  1. package/lib/LICENSE +22 -0
  2. package/lib/README.md +151 -0
  3. package/lib/esm2022/jsonforms-angular.mjs +5 -0
  4. package/lib/esm2022/library/abstract-control.mjs +143 -0
  5. package/lib/esm2022/library/array-control.mjs +33 -0
  6. package/lib/esm2022/library/base.renderer.mjs +50 -0
  7. package/lib/esm2022/library/control.mjs +39 -0
  8. package/lib/esm2022/library/index.mjs +34 -0
  9. package/lib/esm2022/library/jsonforms-root.component.mjs +182 -0
  10. package/lib/esm2022/library/jsonforms.component.mjs +126 -0
  11. package/lib/esm2022/library/jsonforms.module.mjs +42 -0
  12. package/lib/esm2022/library/jsonforms.service.mjs +204 -0
  13. package/lib/esm2022/library/unknown.component.mjs +38 -0
  14. package/lib/esm2022/public_api.mjs +2 -0
  15. package/lib/fesm2022/jsonforms-angular.mjs +857 -0
  16. package/lib/fesm2022/jsonforms-angular.mjs.map +1 -0
  17. package/lib/index.d.ts +6 -0
  18. package/lib/jsonforms-angular.d.ts.map +1 -0
  19. package/lib/{cjs → library}/abstract-control.d.ts +1 -0
  20. package/lib/library/abstract-control.d.ts.map +1 -0
  21. package/lib/{esm → library}/array-control.d.ts +1 -0
  22. package/lib/library/array-control.d.ts.map +1 -0
  23. package/lib/{cjs → library}/base.renderer.d.ts +1 -0
  24. package/lib/library/base.renderer.d.ts.map +1 -0
  25. package/lib/{cjs → library}/control.d.ts +1 -0
  26. package/lib/library/control.d.ts.map +1 -0
  27. package/lib/{cjs → library}/index.d.ts +1 -0
  28. package/lib/library/index.d.ts.map +1 -0
  29. package/lib/{esm → library}/jsonforms-root.component.d.ts +4 -2
  30. package/lib/library/jsonforms-root.component.d.ts.map +1 -0
  31. package/lib/{cjs → library}/jsonforms.component.d.ts +1 -0
  32. package/lib/library/jsonforms.component.d.ts.map +1 -0
  33. package/lib/{cjs → library}/jsonforms.module.d.ts +1 -0
  34. package/lib/library/jsonforms.module.d.ts.map +1 -0
  35. package/lib/{cjs → library}/jsonforms.service.d.ts +5 -2
  36. package/lib/library/jsonforms.service.d.ts.map +1 -0
  37. package/lib/{cjs → library}/unknown.component.d.ts +1 -0
  38. package/lib/library/unknown.component.d.ts.map +1 -0
  39. package/lib/package.json +79 -0
  40. package/lib/public_api.d.ts +2 -0
  41. package/lib/public_api.d.ts.map +1 -0
  42. package/package.json +6 -7
  43. package/src/index.ts +1 -33
  44. package/{lib/esm/index.js → src/library/index.ts} +0 -1
  45. package/src/{jsonforms-root.component.ts → library/jsonforms-root.component.ts} +20 -14
  46. package/src/{jsonforms.service.ts → library/jsonforms.service.ts} +28 -10
  47. package/src/public_api.ts +1 -0
  48. package/lib/cjs/abstract-control.js +0 -138
  49. package/lib/cjs/abstract-control.js.map +0 -1
  50. package/lib/cjs/array-control.d.ts +0 -6
  51. package/lib/cjs/array-control.js +0 -43
  52. package/lib/cjs/array-control.js.map +0 -1
  53. package/lib/cjs/base.renderer.js +0 -55
  54. package/lib/cjs/base.renderer.js.map +0 -1
  55. package/lib/cjs/control.js +0 -55
  56. package/lib/cjs/control.js.map +0 -1
  57. package/lib/cjs/index.js +0 -37
  58. package/lib/cjs/index.js.map +0 -1
  59. package/lib/cjs/jsonforms-root.component.d.ts +0 -34
  60. package/lib/cjs/jsonforms-root.component.js +0 -174
  61. package/lib/cjs/jsonforms-root.component.js.map +0 -1
  62. package/lib/cjs/jsonforms.component.js +0 -136
  63. package/lib/cjs/jsonforms.component.js.map +0 -1
  64. package/lib/cjs/jsonforms.module.js +0 -50
  65. package/lib/cjs/jsonforms.module.js.map +0 -1
  66. package/lib/cjs/jsonforms.service.js +0 -210
  67. package/lib/cjs/jsonforms.service.js.map +0 -1
  68. package/lib/cjs/unknown.component.js +0 -46
  69. package/lib/cjs/unknown.component.js.map +0 -1
  70. package/lib/esm/abstract-control.d.ts +0 -38
  71. package/lib/esm/abstract-control.js +0 -135
  72. package/lib/esm/abstract-control.js.map +0 -1
  73. package/lib/esm/array-control.js +0 -40
  74. package/lib/esm/array-control.js.map +0 -1
  75. package/lib/esm/base.renderer.d.ts +0 -10
  76. package/lib/esm/base.renderer.js +0 -51
  77. package/lib/esm/base.renderer.js.map +0 -1
  78. package/lib/esm/control.d.ts +0 -9
  79. package/lib/esm/control.js +0 -52
  80. package/lib/esm/control.js.map +0 -1
  81. package/lib/esm/index.d.ts +0 -9
  82. package/lib/esm/index.js.map +0 -1
  83. package/lib/esm/jsonforms-root.component.js +0 -170
  84. package/lib/esm/jsonforms-root.component.js.map +0 -1
  85. package/lib/esm/jsonforms.component.d.ts +0 -19
  86. package/lib/esm/jsonforms.component.js +0 -133
  87. package/lib/esm/jsonforms.component.js.map +0 -1
  88. package/lib/esm/jsonforms.module.d.ts +0 -9
  89. package/lib/esm/jsonforms.module.js +0 -46
  90. package/lib/esm/jsonforms.module.js.map +0 -1
  91. package/lib/esm/jsonforms.service.d.ts +0 -50
  92. package/lib/esm/jsonforms.service.js +0 -207
  93. package/lib/esm/jsonforms.service.js.map +0 -1
  94. package/lib/esm/unknown.component.d.ts +0 -5
  95. package/lib/esm/unknown.component.js +0 -42
  96. package/lib/esm/unknown.component.js.map +0 -1
  97. /package/src/{abstract-control.ts → library/abstract-control.ts} +0 -0
  98. /package/src/{array-control.ts → library/array-control.ts} +0 -0
  99. /package/src/{base.renderer.ts → library/base.renderer.ts} +0 -0
  100. /package/src/{control.ts → library/control.ts} +0 -0
  101. /package/src/{jsonforms.component.ts → library/jsonforms.component.ts} +0 -0
  102. /package/src/{jsonforms.module.ts → library/jsonforms.module.ts} +0 -0
  103. /package/src/{unknown.component.ts → library/unknown.component.ts} +0 -0
@@ -44,6 +44,8 @@ import {
44
44
  UISchemaTester,
45
45
  ValidationMode,
46
46
  updateI18n,
47
+ Middleware,
48
+ defaultMiddleware,
47
49
  } from '@jsonforms/core';
48
50
  import { BehaviorSubject, Observable } from 'rxjs';
49
51
  import type { JsonFormsBaseRenderer } from './base.renderer';
@@ -56,6 +58,7 @@ export const USE_STATE_VALUE = Symbol('Marker to use state value');
56
58
  export class JsonFormsAngularService {
57
59
  private _state: JsonFormsSubStates;
58
60
  private state: BehaviorSubject<JsonFormsState>;
61
+ private middleware: Middleware;
59
62
 
60
63
  init(
61
64
  initialState: JsonFormsSubStates = {
@@ -66,8 +69,10 @@ export class JsonFormsAngularService {
66
69
  validationMode: 'ValidateAndShow',
67
70
  additionalErrors: undefined,
68
71
  },
69
- }
72
+ },
73
+ middleware: Middleware = defaultMiddleware
70
74
  ) {
75
+ this.middleware = middleware;
71
76
  this._state = initialState;
72
77
  this._state.config = configReducer(
73
78
  undefined,
@@ -143,9 +148,10 @@ export class JsonFormsAngularService {
143
148
  }
144
149
 
145
150
  updateValidationMode(validationMode: ValidationMode): void {
146
- const coreState = coreReducer(
151
+ const coreState = this.middleware(
147
152
  this._state.core,
148
- Actions.setValidationMode(validationMode)
153
+ Actions.setValidationMode(validationMode),
154
+ coreReducer
149
155
  );
150
156
  this._state.core = coreState;
151
157
  this.updateSubject();
@@ -161,7 +167,11 @@ export class JsonFormsAngularService {
161
167
  }
162
168
 
163
169
  updateCore<T extends CoreActions>(coreAction: T): T {
164
- const coreState = coreReducer(this._state.core, coreAction);
170
+ const coreState = this.middleware(
171
+ this._state.core,
172
+ coreAction,
173
+ coreReducer
174
+ );
165
175
  if (coreState !== this._state.core) {
166
176
  this._state.core = coreState;
167
177
  this.updateSubject();
@@ -199,13 +209,14 @@ export class JsonFormsAngularService {
199
209
  setUiSchema(uischema: UISchemaElement | undefined): void {
200
210
  const newUiSchema =
201
211
  uischema ?? generateDefaultUISchema(this._state.core.schema);
202
- const coreState = coreReducer(
212
+ const coreState = this.middleware(
203
213
  this._state.core,
204
214
  Actions.updateCore(
205
215
  this._state.core.data,
206
216
  this._state.core.schema,
207
217
  newUiSchema
208
- )
218
+ ),
219
+ coreReducer
209
220
  );
210
221
  if (coreState !== this._state.core) {
211
222
  this._state.core = coreState;
@@ -214,13 +225,14 @@ export class JsonFormsAngularService {
214
225
  }
215
226
 
216
227
  setSchema(schema: JsonSchema | undefined): void {
217
- const coreState = coreReducer(
228
+ const coreState = this.middleware(
218
229
  this._state.core,
219
230
  Actions.updateCore(
220
231
  this._state.core.data,
221
232
  schema ?? generateJsonSchema(this._state.core.data),
222
233
  this._state.core.uischema
223
- )
234
+ ),
235
+ coreReducer
224
236
  );
225
237
  if (coreState !== this._state.core) {
226
238
  this._state.core = coreState;
@@ -229,13 +241,14 @@ export class JsonFormsAngularService {
229
241
  }
230
242
 
231
243
  setData(data: any): void {
232
- const coreState = coreReducer(
244
+ const coreState = this.middleware(
233
245
  this._state.core,
234
246
  Actions.updateCore(
235
247
  data,
236
248
  this._state.core.schema,
237
249
  this._state.core.uischema
238
- )
250
+ ),
251
+ coreReducer
239
252
  );
240
253
  if (coreState !== this._state.core) {
241
254
  this._state.core = coreState;
@@ -257,6 +270,11 @@ export class JsonFormsAngularService {
257
270
  this.updateSubject();
258
271
  }
259
272
 
273
+ setMiddleware(middleware: Middleware): void {
274
+ this._state.middleware = middleware;
275
+ this.updateSubject();
276
+ }
277
+
260
278
  getState(): JsonFormsState {
261
279
  return cloneDeep({ jsonforms: this._state });
262
280
  }
@@ -0,0 +1 @@
1
+ export * from './library';
@@ -1,138 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JsonFormsAbstractControl = void 0;
4
- var tslib_1 = require("tslib");
5
- /*
6
- The MIT License
7
-
8
- Copyright (c) 2017-2019 EclipseSource Munich
9
- https://github.com/eclipsesource/jsonforms
10
-
11
- Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions:
17
-
18
- The above copyright notice and this permission notice shall be included in
19
- all copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
- THE SOFTWARE.
28
- */
29
- var core_1 = require("@jsonforms/core");
30
- var core_2 = require("@angular/core");
31
- var forms_1 = require("@angular/forms");
32
- var base_renderer_1 = require("./base.renderer");
33
- var jsonforms_service_1 = require("./jsonforms.service");
34
- var merge_1 = tslib_1.__importDefault(require("lodash/merge"));
35
- var i0 = tslib_1.__importStar(require("@angular/core"));
36
- var i1 = tslib_1.__importStar(require("./jsonforms.service"));
37
- var JsonFormsAbstractControl = /** @class */ (function (_super) {
38
- tslib_1.__extends(JsonFormsAbstractControl, _super);
39
- function JsonFormsAbstractControl(jsonFormsService) {
40
- var _this = _super.call(this) || this;
41
- _this.jsonFormsService = jsonFormsService;
42
- _this.getEventValue = function (event) { return event.value; };
43
- _this.validator = function (_c) {
44
- return _this.error ? { error: _this.error } : null;
45
- };
46
- _this.form = new forms_1.FormControl({
47
- value: '',
48
- disabled: true,
49
- }, {
50
- updateOn: 'change',
51
- validators: _this.validator.bind(_this),
52
- });
53
- return _this;
54
- }
55
- JsonFormsAbstractControl.prototype.onChange = function (ev) {
56
- var _this = this;
57
- this.jsonFormsService.updateCore(core_1.Actions.update(this.propsPath, function () { return _this.getEventValue(ev); }));
58
- this.triggerValidation();
59
- };
60
- JsonFormsAbstractControl.prototype.shouldShowUnfocusedDescription = function () {
61
- var config = this.jsonFormsService.getConfig();
62
- var appliedUiSchemaOptions = (0, merge_1.default)({}, config, this.uischema.options);
63
- return !!appliedUiSchemaOptions.showUnfocusedDescription;
64
- };
65
- JsonFormsAbstractControl.prototype.ngOnInit = function () {
66
- var _this = this;
67
- this.jsonFormsService.$state.subscribe({
68
- next: function (state) {
69
- var props = _this.mapToProps(state);
70
- var data = props.data, enabled = props.enabled, errors = props.errors, label = props.label, required = props.required, schema = props.schema, rootSchema = props.rootSchema, visible = props.visible, path = props.path, config = props.config;
71
- _this.label = (0, core_1.computeLabel)(label, required, config ? config.hideRequiredAsterisk : false);
72
- _this.data = data;
73
- _this.error = errors;
74
- _this.enabled = enabled;
75
- _this.isEnabled() ? _this.form.enable() : _this.form.disable();
76
- _this.hidden = !visible;
77
- _this.scopedSchema = schema;
78
- _this.rootSchema = rootSchema;
79
- _this.description =
80
- _this.scopedSchema !== undefined ? _this.scopedSchema.description : '';
81
- _this.id = props.id;
82
- _this.form.setValue(data);
83
- _this.propsPath = path;
84
- _this.mapAdditionalProps(props);
85
- },
86
- });
87
- this.triggerValidation();
88
- };
89
- JsonFormsAbstractControl.prototype.mapAdditionalProps = function (_props) {
90
- // do nothing by default
91
- };
92
- JsonFormsAbstractControl.prototype.ngOnDestroy = function () {
93
- if (this.subscription) {
94
- this.subscription.unsubscribe();
95
- }
96
- };
97
- JsonFormsAbstractControl.prototype.isEnabled = function () {
98
- return this.enabled;
99
- };
100
- JsonFormsAbstractControl.prototype.getOwnProps = function () {
101
- var props = {
102
- uischema: this.uischema,
103
- schema: this.schema,
104
- path: this.path,
105
- id: this.id,
106
- };
107
- if (this.disabled !== undefined) {
108
- props.enabled = !this.disabled;
109
- }
110
- if (this.visible !== undefined) {
111
- props.visible = this.visible;
112
- }
113
- return props;
114
- };
115
- JsonFormsAbstractControl.prototype.triggerValidation = function () {
116
- // these cause the correct update of the error underline, seems to be
117
- // related to ionic-team/ionic#11640
118
- this.form.markAsTouched();
119
- this.form.updateValueAndValidity();
120
- };
121
- JsonFormsAbstractControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: JsonFormsAbstractControl, deps: [{ token: i1.JsonFormsAngularService }], target: i0.ɵɵFactoryTarget.Component });
122
- JsonFormsAbstractControl.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: JsonFormsAbstractControl, selector: "ng-component", inputs: { id: "id", disabled: "disabled", visible: "visible" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
123
- return JsonFormsAbstractControl;
124
- }(base_renderer_1.JsonFormsBaseRenderer));
125
- exports.JsonFormsAbstractControl = JsonFormsAbstractControl;
126
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: JsonFormsAbstractControl, decorators: [{
127
- type: core_2.Component,
128
- args: [{
129
- template: '',
130
- }]
131
- }], ctorParameters: function () { return [{ type: i1.JsonFormsAngularService }]; }, propDecorators: { id: [{
132
- type: core_2.Input
133
- }], disabled: [{
134
- type: core_2.Input
135
- }], visible: [{
136
- type: core_2.Input
137
- }] } });
138
- //# sourceMappingURL=abstract-control.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"abstract-control.js","sourceRoot":"","sources":["../../src/abstract-control.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;AACF,wCAQyB;AACzB,sCAAoE;AACpE,wCAKwB;AAGxB,iDAAwD;AACxD,yDAA8D;AAC9D,+DAAiC;;;AACjC;IAMU,oDAAqC;IAmB7C,kCAAsB,gBAAyC;QAA/D,YACE,iBAAO,SAWR;QAZqB,sBAAgB,GAAhB,gBAAgB,CAAyB;QAc/D,mBAAa,GAAG,UAAC,KAAU,IAAK,OAAA,KAAK,CAAC,KAAK,EAAX,CAAW,CAAC;QAsD5C,eAAS,GAAgB,UAAC,EAAmB;YAC3C,OAAO,KAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE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,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;SACjC;IACH,CAAC;IAED,4CAAS,GAAT;QACE,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAES,8CAAW,GAArB;QACE,IAAM,KAAK,GAAsB;YAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,EAAE,EAAE,IAAI,CAAC,EAAE;SACZ,CAAC;QACF,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;YAC/B,KAAK,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;SAChC;QACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE;YAC9B,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;SAC9B;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAIS,oDAAiB,GAA3B;QACE,qEAAqE;QACrE,oCAAoC;QACpC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC;IACrC,CAAC;0HAnImB,wBAAwB;8GAAxB,wBAAwB,2IAFlC,EAAE;mCA9Cd;CAoLC,AAvID,CAMU,qCAAqB,GAiI9B;AApIqB,4DAAwB;4FAAxB,wBAAwB;kBAH7C,gBAAS;mBAAC;oBACT,QAAQ,EAAE,EAAE;iBACb;8GAOU,EAAE;sBAAV,YAAK;gBACG,QAAQ;sBAAhB,YAAK;gBACG,OAAO;sBAAf,YAAK"}
@@ -1,6 +0,0 @@
1
- import { 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
- }
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JsonFormsArrayControl = void 0;
4
- var tslib_1 = require("tslib");
5
- /*
6
- The MIT License
7
-
8
- Copyright (c) 2017-2019 EclipseSource Munich
9
- https://github.com/eclipsesource/jsonforms
10
-
11
- Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions:
17
-
18
- The above copyright notice and this permission notice shall be included in
19
- all copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
- THE SOFTWARE.
28
- */
29
- var core_1 = require("@jsonforms/core");
30
- var abstract_control_1 = require("./abstract-control");
31
- var JsonFormsArrayControl = /** @class */ (function (_super) {
32
- tslib_1.__extends(JsonFormsArrayControl, _super);
33
- function JsonFormsArrayControl() {
34
- return _super !== null && _super.apply(this, arguments) || this;
35
- }
36
- JsonFormsArrayControl.prototype.mapToProps = function (state) {
37
- var props = (0, core_1.mapStateToArrayControlProps)(state, this.getOwnProps());
38
- return tslib_1.__assign({}, props);
39
- };
40
- return JsonFormsArrayControl;
41
- }(abstract_control_1.JsonFormsAbstractControl));
42
- exports.JsonFormsArrayControl = JsonFormsArrayControl;
43
- //# sourceMappingURL=array-control.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"array-control.js","sourceRoot":"","sources":["../../src/array-control.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;AACF,wCAIyB;AAEzB,uDAA8D;AAE9D;IACU,iDAAkD;IAD5D;;IAQA,CAAC;IAJW,0CAAU,GAApB,UAAqB,KAAqB;QACxC,IAAM,KAAK,GAAG,IAAA,kCAA2B,EAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QACrE,4BAAY,KAAK,EAAG;IACtB,CAAC;IACH,4BAAC;AAAD,CAAC,AARD,CACU,2CAAwB,GAOjC;AARY,sDAAqB"}
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JsonFormsBaseRenderer = void 0;
4
- var tslib_1 = require("tslib");
5
- /*
6
- The MIT License
7
-
8
- Copyright (c) 2017-2019 EclipseSource Munich
9
- https://github.com/eclipsesource/jsonforms
10
-
11
- Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions:
17
-
18
- The above copyright notice and this permission notice shall be included in
19
- all copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
- THE SOFTWARE.
28
- */
29
- var core_1 = require("@angular/core");
30
- var i0 = tslib_1.__importStar(require("@angular/core"));
31
- var JsonFormsBaseRenderer = /** @class */ (function () {
32
- function JsonFormsBaseRenderer() {
33
- }
34
- JsonFormsBaseRenderer.prototype.getOwnProps = function () {
35
- return {
36
- uischema: this.uischema,
37
- schema: this.schema,
38
- path: this.path,
39
- };
40
- };
41
- JsonFormsBaseRenderer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: JsonFormsBaseRenderer, deps: [], target: i0.ɵɵFactoryTarget.Directive });
42
- JsonFormsBaseRenderer.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: JsonFormsBaseRenderer, inputs: { uischema: "uischema", schema: "schema", path: "path" }, ngImport: i0 });
43
- return JsonFormsBaseRenderer;
44
- }());
45
- exports.JsonFormsBaseRenderer = JsonFormsBaseRenderer;
46
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: JsonFormsBaseRenderer, decorators: [{
47
- type: core_1.Directive
48
- }], propDecorators: { uischema: [{
49
- type: core_1.Input
50
- }], schema: [{
51
- type: core_1.Input
52
- }], path: [{
53
- type: core_1.Input
54
- }] } });
55
- //# sourceMappingURL=base.renderer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.renderer.js","sourceRoot":"","sources":["../../src/base.renderer.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;AACF,sCAAiD;;AAOjD;IAAA;KAaC;IAPW,2CAAW,GAArB;QACE,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;IACJ,CAAC;uHAXU,qBAAqB;2GAArB,qBAAqB;gCAhClC;CA4CC,AAbD,IAaC;AAZY,sDAAqB;4FAArB,qBAAqB;kBADjC,gBAAS;8BAEC,QAAQ;sBAAhB,YAAK;gBACG,MAAM;sBAAd,YAAK;gBACG,IAAI;sBAAZ,YAAK"}
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JsonFormsControlWithDetail = exports.JsonFormsControl = void 0;
4
- var tslib_1 = require("tslib");
5
- /*
6
- The MIT License
7
-
8
- Copyright (c) 2017-2019 EclipseSource Munich
9
- https://github.com/eclipsesource/jsonforms
10
-
11
- Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions:
17
-
18
- The above copyright notice and this permission notice shall be included in
19
- all copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
- THE SOFTWARE.
28
- */
29
- var core_1 = require("@jsonforms/core");
30
- var abstract_control_1 = require("./abstract-control");
31
- var JsonFormsControl = /** @class */ (function (_super) {
32
- tslib_1.__extends(JsonFormsControl, _super);
33
- function JsonFormsControl() {
34
- return _super !== null && _super.apply(this, arguments) || this;
35
- }
36
- JsonFormsControl.prototype.mapToProps = function (state) {
37
- var props = (0, core_1.mapStateToControlProps)(state, this.getOwnProps());
38
- return tslib_1.__assign({}, props);
39
- };
40
- return JsonFormsControl;
41
- }(abstract_control_1.JsonFormsAbstractControl));
42
- exports.JsonFormsControl = JsonFormsControl;
43
- var JsonFormsControlWithDetail = /** @class */ (function (_super) {
44
- tslib_1.__extends(JsonFormsControlWithDetail, _super);
45
- function JsonFormsControlWithDetail() {
46
- return _super !== null && _super.apply(this, arguments) || this;
47
- }
48
- JsonFormsControlWithDetail.prototype.mapToProps = function (state) {
49
- var props = (0, core_1.mapStateToControlWithDetailProps)(state, this.getOwnProps());
50
- return tslib_1.__assign({}, props);
51
- };
52
- return JsonFormsControlWithDetail;
53
- }(abstract_control_1.JsonFormsAbstractControl));
54
- exports.JsonFormsControlWithDetail = JsonFormsControlWithDetail;
55
- //# sourceMappingURL=control.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"control.js","sourceRoot":"","sources":["../../src/control.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;AACF,wCAMyB;AAEzB,uDAA8D;AAE9D;IACU,4CAA6C;IADvD;;IAQA,CAAC;IAJW,qCAAU,GAApB,UAAqB,KAAqB;QACxC,IAAM,KAAK,GAAG,IAAA,6BAAsB,EAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAChE,4BAAY,KAAK,EAAG;IACtB,CAAC;IACH,uBAAC;AAAD,CAAC,AARD,CACU,2CAAwB,GAOjC;AARY,4CAAgB;AAU7B;IACU,sDAAuD;IADjE;;IAQA,CAAC;IAJW,+CAAU,GAApB,UAAqB,KAAqB;QACxC,IAAM,KAAK,GAAG,IAAA,uCAAgC,EAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAC1E,4BAAY,KAAK,EAAG;IACtB,CAAC;IACH,iCAAC;AAAD,CAAC,AARD,CACU,2CAAwB,GAOjC;AARY,gEAA0B"}
package/lib/cjs/index.js DELETED
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
4
- /*
5
- The MIT License
6
-
7
- Copyright (c) 2017-2020 EclipseSource Munich
8
- https://github.com/eclipsesource/jsonforms
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in
18
- all copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26
- THE SOFTWARE.
27
- */
28
- tslib_1.__exportStar(require("./base.renderer"), exports);
29
- tslib_1.__exportStar(require("./control"), exports);
30
- tslib_1.__exportStar(require("./array-control"), exports);
31
- tslib_1.__exportStar(require("./jsonforms.component"), exports);
32
- tslib_1.__exportStar(require("./jsonforms.module"), exports);
33
- tslib_1.__exportStar(require("./unknown.component"), exports);
34
- tslib_1.__exportStar(require("./jsonforms.service"), exports);
35
- tslib_1.__exportStar(require("./jsonforms-root.component"), exports);
36
- tslib_1.__exportStar(require("./abstract-control"), exports);
37
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;AACF,0DAAgC;AAChC,oDAA0B;AAC1B,0DAAgC;AAChC,gEAAsC;AACtC,6DAAmC;AACnC,8DAAoC;AACpC,8DAAoC;AACpC,qEAA2C;AAC3C,6DAAmC"}
@@ -1,34 +0,0 @@
1
- import { DoCheck, EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core';
2
- import { JsonFormsI18nState, JsonFormsRendererRegistryEntry, JsonSchema, UISchemaElement, UISchemaTester, ValidationMode } from '@jsonforms/core';
3
- import Ajv, { ErrorObject } from 'ajv';
4
- import { JsonFormsAngularService } from './jsonforms.service';
5
- import * as i0 from "@angular/core";
6
- export declare class JsonForms implements DoCheck, OnChanges, OnInit {
7
- private jsonformsService;
8
- uischema: UISchemaElement;
9
- schema: JsonSchema;
10
- data: any;
11
- renderers: JsonFormsRendererRegistryEntry[];
12
- uischemas: {
13
- tester: UISchemaTester;
14
- uischema: UISchemaElement;
15
- }[];
16
- dataChange: EventEmitter<any>;
17
- readonly: boolean;
18
- validationMode: ValidationMode;
19
- ajv: Ajv;
20
- config: any;
21
- i18n: JsonFormsI18nState;
22
- additionalErrors: ErrorObject[];
23
- errors: EventEmitter<ErrorObject<string, Record<string, any>, unknown>[]>;
24
- private previousData;
25
- private previousErrors;
26
- private initialized;
27
- oldI18N: JsonFormsI18nState;
28
- constructor(jsonformsService: JsonFormsAngularService);
29
- ngOnInit(): void;
30
- ngDoCheck(): void;
31
- ngOnChanges(changes: SimpleChanges): void;
32
- static ɵfac: i0.ɵɵFactoryDeclaration<JsonForms, never>;
33
- 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; }; }, { "dataChange": "dataChange"; "errors": "errors"; }, never, never, false, never>;
34
- }