Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const withVanillaControlProps = (Component: ComponentType) => (props: any) => {
const ctx = useJsonForms();
const controlElement = props.uischema as ControlElement;
const config = ctx.config;
const trim = config && config.trim;
const styles = findStyle(ctx.styles)('control');
let classNames: string[] = !isEmpty(controlElement.scope)
? styles.concat([`${convertToValidClassName(controlElement.scope)}`])
: [''];
if (trim) {
classNames = classNames.concat(findStyle(ctx.styles)('control.trim'));
}
const isValid = isEmpty(props.errors);
const labelClass = findStyleAsClassName(ctx.styles)('control.label');
const descriptionClassName = findStyleAsClassName(ctx.styles)('input.description');
const inputClassName = ['validate'].concat(isValid ? 'valid' : 'invalid');
return (
export const withVanillaCellProps = (Component: ComponentType) => (props: any) => {
const ctx = useJsonForms();
const inputClassName = ['validate'].concat(
props.isValid ? 'valid' : 'invalid'
);
return (
)
};
const NonEmptyCell = (ownProps: OwnPropsOfNonEmptyCell) => {
const ctx = useJsonForms();
const {
path,
propName,
schema,
rootSchema,
errors,
enabled
} = ctxToNonEmptyCellProps(ctx, ownProps);
const isValid = isEmpty(errors);
return (
{schema.properties ? (