Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
get data() {
return getData(this._store.getState());
}
const mapStateToProps = (state: any) => {
const examples = state.examples.data;
const selectedExample = state.examples.selectedExample || examples[0];
const extensionState = state.examples.extensionState;
return {
dataAsString: JSON.stringify(getData(state), null, 2),
examples,
selectedExample,
extensionState
};
};
const mapDispatchToProps = (dispatch: Dispatch) => ({
const mapStateToProps = (state: JsonFormsState, ownProps: any) => {
const index = indexFromPath(ownProps.path);
const containerProperties: Property[] = findContainerProperties(
ownProps.schema,
getSchema(state) as JsonSchema7,
false
);
return {
index: index,
rootData: getData(state),
rootSchema: getSchema(state),
containerProperties
};
};
);
const visible = ownProps.visible !== undefined
? ownProps.visible
: Runtime.isVisible(ownProps.uischema, rootData);
const enabled = ownProps.enabled !== undefined
? ownProps.enabled
: Runtime.isEnabled(ownProps.uischema, rootData);
const rootSchema = getSchema(state);
const resolvedSchema = Resolve.schema(
ownProps.schema,
ownProps.uischema.scope,
rootSchema
);
return {
rootData: getData(state),
label: get(ownProps.uischema, 'label') as string,
data: Resolve.data(rootData, path),
uischema: ownProps.uischema,
schema: resolvedSchema || rootSchema,
uischemas: state.jsonforms.uischemas,
path,
visible,
enabled,
filterPredicate: ownProps.filterPredicate,
imageProvider: ownProps.imageProvider,
labelProviders: ownProps.labelProviders,
rootSchema: getSchema(state),
id: createId('tree'),
errors: formatErrorMessage(
union(
getErrorAt(path, resolvedSchema || rootSchema)(state).map(
const mapStateToProps = (state: JsonFormsState) => {
return {
schema: getSchema(state),
rootData: getData(state)
};
};
const mapStateToProps = (state: JsonFormsState) => ({
rootData: getData(state)
});
const mapStateToProps = (
state: JsonFormsState,
ownProps: OwnPropsOfTreeControl & WithImageProvider & WithLabelProviders
): StatePropsOfTreeWithDetail => {
const rootData = getData(state);
const path = Paths.compose(
ownProps.path,
Paths.fromScopable(ownProps.uischema)
);
const visible = ownProps.visible !== undefined
? ownProps.visible
: Runtime.isVisible(ownProps.uischema, rootData);
const enabled = ownProps.enabled !== undefined
? ownProps.enabled
: Runtime.isEnabled(ownProps.uischema, rootData);
const rootSchema = getSchema(state);
const resolvedSchema = Resolve.schema(
ownProps.schema,
ownProps.uischema.scope,
rootSchema
);
const mapStateToProps = (
state: JsonFormsState,
ownProps: OwnPropsOfRenderer
) => {
const visible =
ownProps.visible !== undefined
? ownProps.visible
: isVisible(ownProps.uischema, getData(state));
return {
visible
};
};
const mapStateToProps = (state, ownProps) => {
const path = Paths.compose(ownProps.path, Paths.fromScopable(ownProps.uischema));
const visible = _.has(ownProps, 'visible') ?
ownProps.visible : Runtime.isVisible(ownProps, state);
const enabled = _.has(ownProps, 'enabled') ?
ownProps.enabled : Runtime.isEnabled(ownProps, state);
const rootData = getData(state);
return {
rootData: getData(state),
resolvedRootData: Resolve.data(rootData, path),
uischema: ownProps.uischema,
schema: ownProps.schema,
resolvedSchema: Resolve.schema(ownProps.schema, ownProps.uischema.scope.$ref),
path,
visible,
enabled,
getStyle: findStyle(state),
getStyleAsClassName: findStyleAsClassName(state),
};
};