How to use @talend/json-schema-form-core - 5 common examples

To help you get started, we’ve selected a few @talend/json-schema-form-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Talend / ui / packages / forms / src / UIForm / utils / validation.js View on Github external
export function validateValue(schema, value, properties, customValidationFn) {
	const validationSchema = adaptAdditionalRules(schema);
	const staticResult = validate(validationSchema, value);
	if (staticResult.valid && schema.customValidation && customValidationFn) {
		return customValidationFn(schema, value, properties);
	}
	return staticResult.valid ? null : staticResult.error.message;
}
github Talend / ui / packages / forms / src / compound / widgets / Widget / Widget.component.js View on Github external
export default function Widget({ id, schema }) {
	const { properties } = useContext(formContext);
	const WidgetComponent = widgetDictionary[schema.widget || schema.type];
	const value = getValue(properties, schema);
	const widgetId = sfPath.name(schema.key, '_', id);

	return ;
}
Widget.propTypes = {
github Talend / ui / packages / forms / src / UIForm-v3 / schema / Widget / Widget.component.js View on Github external
const values = rhf.getValues({ nest: true });
	if (!shouldRender(condition, values, key)) {
		return null;
	}

	const widgetName = widget || type;
	const WidgetImpl = getWidget(displayMode || schema.displayMode, widgetName, widgets);
	if (!WidgetImpl) {
		return <p>Widget not found {widgetName}</p>;
	}

	const instance = (
		
	);

	if (tooltip) {
		return (
			
				<div>{instance}</div>
			
		);
github Talend / ui / packages / forms / src / UIForm / Widget / Widget.component.js View on Github external
tooltip,
		tooltipPlacement,
	} = props.schema;
	const widgetId = widget || type;

	if (widgetId === 'hidden' || !shouldRender(condition, props.properties, key)) {
		return null;
	}

	const WidgetImpl = getWidget(props.displayMode || displayMode, widgetId, props.widgets);

	if (!WidgetImpl) {
		return <p>Widget not found {widgetId}</p>;
	}

	const id = sfPath.name(key, '_', props.id);
	const error = getError(props.errors, props.schema);
	const errorMessage = validationMessage || error;
	const all = {
		...props,
		id,
		key: id,
		options,
		errorMessage,
		isValid: !error,
		value: getValue(props.properties, props.schema),
		valueIsUpdating: isUpdating(props.updating, props.schema.key),
	};

	if (tooltip) {
		return (
github Talend / ui / packages / forms / src / UIForm / merge.js View on Github external
export default (jsonSchema, uiSchema) => {
	const props = { jsonSchema, uiSchema };
	if (!jsonSchema) {
		return props;
	}
	props.mergedSchema = merge(props.jsonSchema, props.uiSchema);
	return props;
};

@talend/json-schema-form-core

JSON-Schema and JSON-UI-Schema utilities for form generation.

MIT
Latest version published 16 days ago

Package Health Score

66 / 100
Full package analysis