@jsonforms/angular 3.0.0-beta.2 → 3.0.0-beta.5
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/README.md +5 -0
- package/docs/assets/js/search.json +1 -1
- package/docs/classes/jsonforms.html +35 -21
- package/docs/classes/jsonformsabstractcontrol.html +30 -30
- package/docs/classes/jsonformsangularservice.html +30 -27
- package/docs/classes/jsonformsarraycontrol.html +30 -30
- package/docs/classes/jsonformsbaserenderer.html +4 -4
- package/docs/classes/jsonformscontrol.html +30 -30
- package/docs/classes/jsonformscontrolwithdetail.html +30 -30
- package/docs/classes/jsonformsoutlet.html +14 -14
- package/docs/globals.html +2 -2
- package/docs/index.html +6 -0
- package/lib/cjs/jsonforms-root.component.d.ts +1 -0
- package/lib/cjs/jsonforms-root.component.js +6 -3
- package/lib/cjs/jsonforms-root.component.js.map +1 -1
- package/lib/cjs/jsonforms-root.component.metadata.json +1 -1
- package/lib/cjs/jsonforms.service.d.ts +2 -2
- package/lib/cjs/jsonforms.service.js +4 -3
- package/lib/cjs/jsonforms.service.js.map +1 -1
- package/lib/esm/jsonforms-root.component.d.ts +1 -0
- package/lib/esm/jsonforms-root.component.js +6 -3
- package/lib/esm/jsonforms-root.component.js.map +1 -1
- package/lib/esm/jsonforms-root.component.metadata.json +1 -1
- package/lib/esm/jsonforms.service.d.ts +2 -2
- package/lib/esm/jsonforms.service.js +4 -3
- package/lib/esm/jsonforms.service.js.map +1 -1
- package/package.json +4 -4
- package/src/jsonforms-root.component.ts +7 -3
- package/src/jsonforms.service.ts +6 -4
package/src/jsonforms.service.ts
CHANGED
|
@@ -49,7 +49,7 @@ import { BehaviorSubject, Observable } from 'rxjs';
|
|
|
49
49
|
import { JsonFormsBaseRenderer } from './base.renderer';
|
|
50
50
|
|
|
51
51
|
import { cloneDeep } from 'lodash';
|
|
52
|
-
import Ajv from 'ajv';
|
|
52
|
+
import Ajv, { ErrorObject } from 'ajv';
|
|
53
53
|
|
|
54
54
|
export const USE_STATE_VALUE = Symbol('Marker to use state value');
|
|
55
55
|
export class JsonFormsAngularService {
|
|
@@ -57,7 +57,7 @@ export class JsonFormsAngularService {
|
|
|
57
57
|
private _state: JsonFormsSubStates;
|
|
58
58
|
private state: BehaviorSubject<JsonFormsState>;
|
|
59
59
|
|
|
60
|
-
init(initialState: JsonFormsSubStates = { core: { data: undefined, schema: undefined, uischema: undefined, validationMode: 'ValidateAndShow' } }) {
|
|
60
|
+
init(initialState: JsonFormsSubStates = { core: { data: undefined, schema: undefined, uischema: undefined, validationMode: 'ValidateAndShow', additionalErrors: undefined } }) {
|
|
61
61
|
this._state = initialState;
|
|
62
62
|
this._state.config = configReducer(undefined, setConfig(this._state.config));
|
|
63
63
|
this._state.i18n = i18nReducer(this._state.i18n, updateI18n(this._state.i18n?.locale, this._state.i18n?.translate, this._state.i18n?.translateError));
|
|
@@ -209,15 +209,17 @@ export class JsonFormsAngularService {
|
|
|
209
209
|
schema: JsonSchema | typeof USE_STATE_VALUE,
|
|
210
210
|
uischema: UISchemaElement | typeof USE_STATE_VALUE,
|
|
211
211
|
ajv: Ajv | typeof USE_STATE_VALUE,
|
|
212
|
-
validationMode: ValidationMode | typeof USE_STATE_VALUE
|
|
212
|
+
validationMode: ValidationMode | typeof USE_STATE_VALUE,
|
|
213
|
+
additionalErrors: ErrorObject[] | typeof USE_STATE_VALUE,
|
|
213
214
|
): void {
|
|
214
215
|
const newData = data === USE_STATE_VALUE ? this._state.core.data : data;
|
|
215
216
|
const newSchema = schema === USE_STATE_VALUE ? this._state.core.schema : schema ?? generateJsonSchema(newData);
|
|
216
217
|
const newUischema = uischema === USE_STATE_VALUE ? this._state.core.uischema : uischema ?? generateDefaultUISchema(newSchema);
|
|
217
218
|
const newAjv = ajv === USE_STATE_VALUE ? this._state.core.ajv : ajv;
|
|
218
219
|
const newValidationMode = validationMode === USE_STATE_VALUE ? this._state.core.validationMode : validationMode;
|
|
220
|
+
const newAdditionalErrors = additionalErrors === USE_STATE_VALUE ? this._state.core.additionalErrors : additionalErrors;
|
|
219
221
|
this.updateCore(
|
|
220
|
-
Actions.updateCore(newData, newSchema, newUischema, {ajv: newAjv, validationMode: newValidationMode})
|
|
222
|
+
Actions.updateCore(newData, newSchema, newUischema, {ajv: newAjv, validationMode: newValidationMode, additionalErrors: newAdditionalErrors})
|
|
221
223
|
);
|
|
222
224
|
}
|
|
223
225
|
|