Socket
Socket
Sign inDemoInstall

@jsonforms/core

Package Overview
Dependencies
Maintainers
1
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsonforms/core - npm Package Compare versions

Comparing version 2.3.2-alpha.0 to 2.3.2-beta.0

3

lib/testers/index.js

@@ -37,3 +37,2 @@ "use strict";

var toPairs_1 = __importDefault(require("lodash/toPairs"));
var has_1 = __importDefault(require("lodash/has"));
var includes_1 = __importDefault(require("lodash/includes"));

@@ -314,3 +313,3 @@ var resolvers_1 = require("../util/resolvers");

};
if (has_1.default(resolvedSchema, 'items')) {
if (resolvedSchema !== undefined && resolvedSchema.items !== undefined) {
// check if nested arrays

@@ -317,0 +316,0 @@ if (traverse(resolvedSchema.items, function (val) {

@@ -1,2 +0,2 @@

import { OwnPropsOfControl, OwnPropsOfEnum, StatePropsOfCell, StatePropsOfScopedRenderer } from '.';
import { OwnPropsOfControl, OwnPropsOfEnum, StatePropsOfScopedRenderer } from '.';
import { DispatchPropsOfControl } from './renderer';

@@ -3,0 +3,0 @@ import { JsonFormsState } from '../store';

@@ -51,3 +51,2 @@ "use strict";

var isEmpty_1 = __importDefault(require("lodash/isEmpty"));
var has_1 = __importDefault(require("lodash/has"));
var union_1 = __importDefault(require("lodash/union"));

@@ -67,6 +66,6 @@ var reducers_1 = require("../reducers");

var rootData = reducers_1.getData(state);
var visible = has_1.default(ownProps, 'visible')
var visible = ownProps.visible !== undefined
? ownProps.visible
: _1.isVisible(uischema, rootData);
var enabled = has_1.default(ownProps, 'enabled')
var enabled = ownProps.enabled !== undefined
? ownProps.enabled

@@ -73,0 +72,0 @@ : _1.isEnabled(uischema, rootData);

@@ -84,6 +84,4 @@ "use strict";

}
return isEmpty_1.default(segments)
? path
: exports.compose(path, segments.join('.'));
return isEmpty_1.default(segments) ? path : exports.compose(path, segments.join('.'));
};
//# sourceMappingURL=path.js.map

@@ -56,3 +56,2 @@ "use strict";

var util_1 = require("../util");
var has_1 = __importDefault(require("lodash/has"));
var actions_1 = require("../actions");

@@ -134,8 +133,8 @@ exports.isPlainLabel = function (label) {

var path = util_1.composeWithUi(uischema, ownProps.path);
var visible = has_1.default(ownProps, 'visible')
? ownProps.visible
: util_1.isVisible(uischema, rootData, ownProps.path);
var enabled = has_1.default(ownProps, 'enabled')
? ownProps.enabled
: util_1.isEnabled(uischema, rootData, ownProps.path);
var visible = ownProps.visible === undefined || util_1.hasShowRule(uischema)
? util_1.isVisible(uischema, rootData, ownProps.path)
: ownProps.visible;
var enabled = ownProps.enabled === undefined || util_1.hasEnableRule(uischema)
? util_1.isEnabled(uischema, rootData, ownProps.path)
: ownProps.enabled;
var controlElement = uischema;

@@ -292,8 +291,9 @@ var id = ownProps.id;

var rootData = reducers_1.getData(state);
var visible = has_1.default(ownProps, 'visible')
? ownProps.visible
: util_1.isVisible(ownProps.uischema, rootData, ownProps.path);
var enabled = has_1.default(ownProps, 'enabled')
? ownProps.enabled
: util_1.isEnabled(ownProps.uischema, rootData, ownProps.path);
var uischema = ownProps.uischema;
var visible = ownProps.visible === undefined || util_1.hasShowRule(uischema)
? util_1.isVisible(ownProps.uischema, rootData, ownProps.path)
: ownProps.visible;
var enabled = ownProps.enabled === undefined || util_1.hasEnableRule(uischema)
? util_1.isEnabled(ownProps.uischema, rootData, ownProps.path)
: ownProps.enabled;
var data = util_1.Resolve.data(rootData, ownProps.path);

@@ -329,5 +329,5 @@ return __assign({}, exports.layoutDefaultProps, { renderers: ownProps.renderers || reducers_1.getRenderers(state), visible: visible,

var resolvedSchema = util_1.Resolve.schema(ownProps.schema || rootSchema, uischema.scope, rootSchema);
var visible = has_1.default(ownProps, 'visible')
? ownProps.visible
: util_1.isVisible(uischema, reducers_1.getData(state), ownProps.path);
var visible = ownProps.visible === undefined || util_1.hasShowRule(uischema)
? util_1.isVisible(uischema, reducers_1.getData(state), ownProps.path)
: ownProps.visible;
var id = ownProps.id;

@@ -334,0 +334,0 @@ var data = util_1.Resolve.data(reducers_1.getData(state), path);

@@ -32,3 +32,2 @@ "use strict";

var get_1 = __importDefault(require("lodash/get"));
var has_1 = __importDefault(require("lodash/has"));
var isArray_1 = __importDefault(require("lodash/isArray"));

@@ -97,13 +96,2 @@ var isObject_1 = __importDefault(require("lodash/isObject"));

}
// tslint:disable:no-string-literal
if (has_1.default(schema, 'links')) {
get_1.default(schema, 'links').forEach(function (link) {
if (!isEmpty_1.default(link.targetSchema.$ref)) {
result[link.targetSchema.$ref] = schema;
}
else {
exports.findAllRefs(link.targetSchema, result);
}
});
}
return result;

@@ -110,0 +98,0 @@ };

import { UISchemaElement } from '../models/uischema';
export declare const evalVisibility: (uischema: UISchemaElement, data: any, path?: string) => boolean;
export declare const evalEnablement: (uischema: UISchemaElement, data: any, path?: string) => boolean;
export declare const hasShowRule: (uischema: UISchemaElement) => boolean;
export declare const hasEnableRule: (uischema: UISchemaElement) => boolean;
export declare const isVisible: (uischema: UISchemaElement, data: any, path?: string) => boolean;
export declare const isEnabled: (uischema: UISchemaElement, data: any, path?: string) => boolean;

@@ -99,2 +99,18 @@ "use strict";

};
exports.hasShowRule = function (uischema) {
if (uischema.rule &&
(uischema.rule.effect === uischema_1.RuleEffect.SHOW ||
uischema.rule.effect === uischema_1.RuleEffect.HIDE)) {
return true;
}
return false;
};
exports.hasEnableRule = function (uischema) {
if (uischema.rule &&
(uischema.rule.effect === uischema_1.RuleEffect.ENABLE ||
uischema.rule.effect === uischema_1.RuleEffect.DISABLE)) {
return true;
}
return false;
};
exports.isVisible = function (uischema, data, path) {

@@ -101,0 +117,0 @@ if (path === void 0) { path = undefined; }

{
"name": "@jsonforms/core",
"version": "2.3.2-alpha.0",
"version": "2.3.2-beta.0",
"description": "Core module of JSON Forms",

@@ -49,24 +49,24 @@ "repository": "https://github.com/eclipsesource/jsonforms",

"@types/json-schema": "^7.0.3",
"ajv": "^6.4.0",
"json-schema-ref-parser": "^6.1.0",
"lodash": "^4.17.4",
"ajv": "^6.10.2",
"json-schema-ref-parser": "^7.1.2",
"lodash": "^4.17.15",
"uri-js": "^4.2.2",
"uuid": "^3.2.1"
"uuid": "^3.3.3"
},
"peerDependencies": {
"redux": "^4.0.1"
"redux": "^4.0.4"
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "0.1.3",
"@types/redux-mock-store": "^1.0.0",
"ava": "~2.1.0",
"document-register-element": "^1.7.0",
"jsdom": "^11.9.0",
"@types/redux-mock-store": "^1.0.1",
"ava": "~2.4.0",
"document-register-element": "^1.14.3",
"jsdom": "^15.2.1",
"jsdom-global": "^3.0.2",
"redux": "^4.0.1",
"redux": "^4.0.4",
"redux-mock-store": "1.5.3",
"source-map-support": "0.5.12",
"ts-node": "^8.3.0"
"source-map-support": "0.5.16",
"ts-node": "^8.5.3"
},
"gitHead": "80ef93b5b7534a52e79a6411a87a65bf5610a63c"
"gitHead": "911c19282b1db03ae02f5fad7ff25d6e9967031a"
}

@@ -32,3 +32,2 @@ /*

import toPairs from 'lodash/toPairs';
import has from 'lodash/has';
import includes from 'lodash/includes';

@@ -416,3 +415,3 @@ import { JsonSchema } from '../models/jsonSchema';

};
if (has(resolvedSchema, 'items')) {
if (resolvedSchema !== undefined && resolvedSchema.items !== undefined) {
// check if nested arrays

@@ -419,0 +418,0 @@ if (

@@ -26,3 +26,2 @@ /*

import isEmpty from 'lodash/isEmpty';
import has from 'lodash/has';
import union from 'lodash/union';

@@ -37,3 +36,2 @@ import { getConfig, getData, getErrorAt, getSchema } from '../reducers';

Resolve,
StatePropsOfCell,
StatePropsOfScopedRenderer

@@ -106,8 +104,10 @@ } from '.';

const rootData = getData(state);
const visible = has(ownProps, 'visible')
? ownProps.visible
: isVisible(uischema, rootData);
const enabled = has(ownProps, 'enabled')
? ownProps.enabled
: isEnabled(uischema, rootData);
const visible =
ownProps.visible !== undefined
? ownProps.visible
: isVisible(uischema, rootData);
const enabled =
ownProps.enabled !== undefined
? ownProps.enabled
: isEnabled(uischema, rootData);
const errors = formatErrorMessage(

@@ -114,0 +114,0 @@ union(getErrorAt(path, schema)(state).map(error => error.message))

@@ -86,8 +86,3 @@ /*

return isEmpty(segments)
? path
: compose(
path,
segments.join('.')
);
return isEmpty(segments) ? path : compose(path, segments.join('.'));
};

@@ -50,2 +50,4 @@ /*

formatErrorMessage,
hasShowRule,
hasEnableRule,
isEnabled,

@@ -58,3 +60,2 @@ isVisible,

} from '../util';
import has from 'lodash/has';
import { update } from '../actions';

@@ -377,8 +378,10 @@ import { ErrorObject } from 'ajv';

const path = composeWithUi(uischema, ownProps.path);
const visible = has(ownProps, 'visible')
? ownProps.visible
: isVisible(uischema, rootData, ownProps.path);
const enabled = has(ownProps, 'enabled')
? ownProps.enabled
: isEnabled(uischema, rootData, ownProps.path);
const visible: boolean =
ownProps.visible === undefined || hasShowRule(uischema)
? isVisible(uischema, rootData, ownProps.path)
: ownProps.visible;
const enabled: boolean =
ownProps.enabled === undefined || hasEnableRule(uischema)
? isEnabled(uischema, rootData, ownProps.path)
: ownProps.enabled;
const controlElement = uischema as ControlElement;

@@ -659,8 +662,11 @@ const id = ownProps.id;

const rootData = getData(state);
const visible: boolean = has(ownProps, 'visible')
? ownProps.visible
: isVisible(ownProps.uischema, rootData, ownProps.path);
const enabled: boolean = has(ownProps, 'enabled')
? ownProps.enabled
: isEnabled(ownProps.uischema, rootData, ownProps.path);
const { uischema } = ownProps;
const visible: boolean =
ownProps.visible === undefined || hasShowRule(uischema)
? isVisible(ownProps.uischema, rootData, ownProps.path)
: ownProps.visible;
const enabled: boolean =
ownProps.enabled === undefined || hasEnableRule(uischema)
? isEnabled(ownProps.uischema, rootData, ownProps.path)
: ownProps.enabled;

@@ -753,5 +759,6 @@ const data = Resolve.data(rootData, ownProps.path);

);
const visible = has(ownProps, 'visible')
? ownProps.visible
: isVisible(uischema, getData(state), ownProps.path);
const visible: boolean =
ownProps.visible === undefined || hasShowRule(uischema)
? isVisible(uischema, getData(state), ownProps.path)
: ownProps.visible;
const id = ownProps.id;

@@ -758,0 +765,0 @@

@@ -27,3 +27,2 @@ /*

import get from 'lodash/get';
import has from 'lodash/has';
import isArray from 'lodash/isArray';

@@ -109,13 +108,2 @@ import isObject from 'lodash/isObject';

// tslint:disable:no-string-literal
if (has(schema, 'links')) {
get(schema, 'links').forEach((link: { targetSchema: JsonSchema }) => {
if (!isEmpty(link.targetSchema.$ref)) {
result[link.targetSchema.$ref] = schema;
} else {
findAllRefs(link.targetSchema, result);
}
});
}
return result;

@@ -122,0 +110,0 @@ };

@@ -131,2 +131,24 @@ /*

export const hasShowRule = (uischema: UISchemaElement): boolean => {
if (
uischema.rule &&
(uischema.rule.effect === RuleEffect.SHOW ||
uischema.rule.effect === RuleEffect.HIDE)
) {
return true;
}
return false;
};
export const hasEnableRule = (uischema: UISchemaElement): boolean => {
if (
uischema.rule &&
(uischema.rule.effect === RuleEffect.ENABLE ||
uischema.rule.effect === RuleEffect.DISABLE)
) {
return true;
}
return false;
};
export const isVisible = (

@@ -133,0 +155,0 @@ uischema: UISchemaElement,

@@ -1084,4 +1084,6 @@ /*

};
const filtered = subErrorsAt('colours', schema.properties.colours
.items as JsonSchema)(state);
const filtered = subErrorsAt(
'colours',
schema.properties.colours.items as JsonSchema
)(state);
t.is(filtered.length, 1);

@@ -1132,6 +1134,8 @@ t.deepEqual(filtered[0], state.errors[1]);

};
const filtered = subErrorsAt('coloursOrNumbers', schema.properties
.coloursOrNumbers.oneOf[1].items as JsonSchema)(state);
const filtered = subErrorsAt(
'coloursOrNumbers',
schema.properties.coloursOrNumbers.oneOf[1].items as JsonSchema
)(state);
t.is(filtered.length, 1);
t.deepEqual(filtered[0], state.errors[1]);
});

@@ -112,3 +112,3 @@ /*

const props = mapStateToControlProps(createState(uischema), ownProps);
t.true(props.visible);
t.false(props.visible);
});

@@ -228,3 +228,3 @@

const props = mapStateToControlProps(createState(uischema), ownProps);
t.true(props.enabled);
t.false(props.enabled);
});

@@ -231,0 +231,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc