From 3cada09b0113beeb053fb94bb5b4fcad031ea991 Mon Sep 17 00:00:00 2001 From: Mariana Caetano Pereira <67270558+Mariana-Caetano@users.noreply.github.com> Date: Thu, 6 Jul 2023 15:02:53 -0300 Subject: [PATCH] Doc: Feedback #3070 - Add the `value` prop (#76) #### What problem is this solving? This PR adds a prop `value` that can be passed to `inputType` when set to `hidden`. This prop set a pre-defined text in the input to be submitted. You can find more information on the task `EDU-9870 Feedback #2996 - Improvement` --------- Co-authored-by: Carolina Menezes <60782333+carolinamenezes@users.noreply.github.com> --- CHANGELOG.md | 3 +++ docs/README.md | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 197cf79..8c48d95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added +- Prop `value` to the documentation + ## [0.10.0] - 2023-02-28 ### Added diff --git a/docs/README.md b/docs/README.md index 944d480..b4b24b6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -158,9 +158,10 @@ In the example below, the form block is contained in a Flex Layout row: | Prop name | Type | Description | Default Value | | ----------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | -| `pointer` | `string` | ![https://img.shields.io/badge/-Mandatory-red](https://img.shields.io/badge/-Mandatory-red) JSON schema pointer i.e. the JSON schema path (for example: #/properties/firstName) in which the form block inputs should be validated against. | `undefined` | -| `inputType` | `enum` | Defines which type of a text field should be rendered:
`input`: renders a normal text field.
`hidden`: does not render any text field. It should be used in scenarios in which you want to pre-define a field value to be submitted to the form but that shouldn't be visible (and therefore editable) to users.
`password`: renders a password text field. | `input` | -| `label` | `string` | ![https://img.shields.io/badge/-Mandatory-red](https://img.shields.io/badge/-Mandatory-red) Field's name when rendered | Property's title | +| `pointer` | `string` | ![https://img.shields.io/badge/-Mandatory-red](https://img.shields.io/badge/-Mandatory-red) JSON schema path (e.g., `#/properties/firstName`) for validating form block inputs. | `undefined` | +| `inputType` | `enum` | Defines the type of the text field. Possible values are: `input` - renders a regular text field; `hidden` - renders a hidden text field used for pre-defining an editable value to be submitted to the form; `password` - renders a password text field. | `input` | +| `value` (optional) | `string` | Displays a pre-defined text to be submitted when the `inputType` is set as `hidden`. | `undefined` | +| `label` | `string` | ![https://img.shields.io/badge/-Mandatory-red](https://img.shields.io/badge/-Mandatory-red) Label of the input field. | Property's title | | `placeholder` | `string` | Placeholder for the text input. | `undefined` | ### `form-field-group` props @@ -204,7 +205,7 @@ Where `childName` should be replaced for the desired sub-property name and the - `checkbox`: the sub-property will be rendered as a`form-input.checkbox` block. - `upload`: the sub-property will be rendered as a`form-input.upload` block. -## Modus operandi +## App behavior The JSON schema created in Master Data is firstly responsible for telling form blocks which data they must receive i.e. specifying which kind of input each form field should expect from users.