1.0.6 • Published 2 years ago

custom-inputs-from-data-driven-form-pf4 v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

custom-inputs-from-data-driven-form-pf4

custom inputs from data-driven-form and patternfly4

how to use custom-password-input in data-driven-forms:

yarn add custom-inputs-from-data-driven-form-pf4

myForm.js:

import { componentMapper } from "@data-driven-forms/pf4-component-mapper";
import PasswordInput from "custom-inputs-from-data-driven-form-pf4/inputs/PasswordInput";
...

add property:

const _componentMapper = {
  ...componentMapper,
  "custom-password-input": PasswordInput,
};

add form schema section:

const schema = {
  fields: [
    ...
    {
      component: "custom-password-input",
      name: "password",
      type: "password",
      label: t("password"),
      validate: [
        { type: "min-length", threshold: 8, message: t("min_8_char") },
        { type: "required", message: t("required_field") },
      ],
      isRequired: true,
    },
  ]
}

add FormRenderer props:

<FormRenderer
  schema={schema}
  componentMapper={_componentMapper}
 ...
>
1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago