Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@comparaonline/ui-form-fields
Advanced tools
yarn add @comparaonline/ui-form-fields
import { TextField } from '@comparaonline/ui-form-fields';
<TextField
label="Text Field Demo"
name="text-field-demo"
placeholder="Demo placeholder"
/>
The only required prop is name
, all the other can be any of the MUI's Text Field props.
import { RadioGroupField } from '@comparaonline/ui-form-fields';
<RadioGroupField
name="radioGroupDemo"
validate={validateWith(required)}
errorMessage="Error"
helperText="Radio button family"
renderLabel={<span>Demo with emoji 🇨🇱</span>}
options={[
{ label: 'Masculino', value: '99' },
{ label: 'Feminino', value: '100' }
]}
/>
import { CheckboxField } from '@comparaonline/ui-form-fields';
<CheckboxField
name="feature"
validate={validateList}
errorMessage="Error validating the Check List"
helperText="Boolean approach"
renderLabel={<span>Checkbox Field List ✅</span>}
options={[
{ name: 'feature.a', label: 'A' },
{ name: 'feature.b', label: 'B' },
{ name: 'feature.c', label: 'C' },
{ name: 'feature.d', label: 'D' }
]}
/>
This will create a value like this
{
"feature": {
"a": true,
"d": true
}
}
<CheckboxField
name="feature"
validate={validateList}
errorMessage="Error validating the Check List"
helperText="Boolean approach"
renderLabel={<span>Checkbox Field List ✅</span>}
options={[
{ name: 'feature', label: 'A', value: 'A' },
{ name: 'feature', label: 'B', value: 'B' },
{ name: 'feature', label: 'C', value: 'C' },
{ name: 'feature', label: 'D', value: 'D' }
]}
/>
This will create a value like this
{
"feature": [
"D",
"B"
]
}
The input listener actually renders a Field
component from react-final-form with the same input name that the field that we want to change and uses the onChange
function to update its value.
import { Form } from 'react-final-form';
import { TextField } from '@comparaonline/ui-form-fields';
import { InputListener } from '@comparaonline/ui-input-listener';
const onSubmit = () => undefined;
<Form onSubmit={onSubmit}>
{({ handleSubmit }) => (
<form onSubmit={handleSubmit}>
<TextField
name="inputA"
label="Placa"
/>
<TextField
name="inputB"
label="Placa"
/>
<InputListener field="inputA" when={value => value === 'foo'} set="inputB" to={new Promise(resolve => resolve('new value'))} />
</form>}
</Form>;
FAQs
## Installation
The npm package @comparaonline/ui-form-fields receives a total of 6 weekly downloads. As such, @comparaonline/ui-form-fields popularity was classified as not popular.
We found that @comparaonline/ui-form-fields demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 16 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.