Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
type="submit"
/>
);
SubmitField.contextTypes = BaseField.contextTypes;
// This field is a kind of a shortcut for few fields. You can also access all
// field props here, like value or onChange for some extra logic.
const Composite = () => (
<section>
</section>
);
const CompositeField = connectField(Composite);
export default function ExamplesSubmitField() {
return (
alert(JSON.stringify(model, null, 2))}
>
<hr>
<br>
);
}
const handleChange = (e, onChange, max, min) => {
const { value, type } = e.target
// Prevent numbers lower than the minimum
if (type === 'number' && value < min) {
return
}
onChange(value.substr(0, max))
}
Text.defaultProps = { type: 'text' }
export default connectField(Text)
it('is in chain (true)', () => {
const Field1 = connectField(props => props.children, {
includeInChain: true
});
const Field2 = connectField(Test);
mount(
,
reactContext
);
expect(Test.mock.calls[0]).toEqual(
expect.arrayContaining([
expect.objectContaining({ name: 'field.subfield' })
])
);
.concat(parent.value.slice(1 + fieldIndex))
)
}
{...filterDOMProps(props)}
/>
);
};
ListDel.defaultProps = {
icon: 'delete',
shape: 'circle-outline',
size: 'small',
type: 'ghost'
};
export default connectField(ListDel, {
includeParent: true,
initialValue: false
});
<div>
limitNotReached &&
parent.onChange(parent.value.concat([cloneDeep(value)]))
}
{...filterDOMProps(props)}
>
{addIcon}
</div>
);
};
ListAdd.defaultProps = { addIcon: <i> };
export default connectField(ListAdd, {
includeParent: true,
initialValue: false
});
</i>
disabled || dateParse(event.target.valueAsNumber, onChange)
}
placeholder={placeholder}
ref={inputRef}
type="datetime-local"
value={dateFormat(value)}
{...filterDOMProps(props)}
/>
);
Date.defaultProps = {
fullWidth: true,
margin: 'dense'
};
export default connectField(Date);
);
};
export default connectField(ApplicationProps, {baseField: ApplicationField});
control={}
key={item}
label={transform ? transform(item) : item}
value={`${item}`}
/>
))}
);
};
Radio.defaultProps = {
fullWidth: true,
margin: 'dense'
};
export default connectField(Radio);
import React from 'react';
import connectField from 'uniforms/connectField';
import filterDOMProps from 'uniforms/filterDOMProps';
import nothing from 'uniforms/nothing';
const Error = ({ children, error, errorMessage, ...props }) =>
!error ? (
nothing
) : (
<div>{children || errorMessage}</div>
);
export default connectField(Error, { initialValue: false });
allowedValues,
disabled,
id,
name,
onChange,
transform,
value,
inputRef,
label,
placeholder,
required
})}
);
export default connectField(Select);