6.43.1 • Published 2 months ago

@talend/react-forms v6.43.1

Weekly downloads
884
License
Apache-2.0
Repository
github
Last release
2 months ago

@talend/react-forms

Build Status

Introduction

This library is designed to be used on top of react-jsonschema-form, a React component for building Web forms from JSONSchema.

In addition of Mozilla lib, this wrapper uses react-bootstrap to not have to maintain Bootstrap markup.

Installation

Run npm install --save @talend/react-forms.

Usage

The forms can be used like any other React components. You'll have to pass it a JSONSchema and a onSubmit callback as a minimum to handle forms rendering and get the data back.

import Form from '@talend/react-forms';

class MyForm extends React.Component {
	onSubmit(formData) {
		console.log(formData);
	}

	onCancel() {
		console.log('Cancelled');
	}

	render() {
		const actions = [
			{ style: 'link', onClick: this.onCancel, type: 'button', label: 'CANCEL' },
			{ style: 'primary', type: 'submit', label: 'VALIDATE' },
		];
		return <Form data={this.props.data} actions={actions} onSubmit={this.onSubmit} />;
	}
}

Here is the archetype of the data property required to render the form:

{
	"jsonSchema": {},
	"uiSchema": {},
	"properties": {}
}

Actions

Forms now render a react-talend-components Action component for each action given to it. Each action accept the following properties :

propertypropTyperequireddefaultdoc
iconPositionotherno-
iconstringno-
hideLabelboolno-
disabledboolno{false}
stylestringno"default"equivalent to action bsStyle props
iconTransformstringno-
idstringno-
inProgressboolno{false}
labelstringyes-
linkboolno-
modelobjectno-
namestringno-render a name button html property
onClickfuncyes-execute the callback with formData, formId, propertyName, propertyValue as parameters
tooltipboolno-
tooltipPlacementotherno"top"
type'submit'|'button'no-by default render a button without submit type

Handlers

If uiSchema has some triggers like

{
	"jsonSchema": {
		"id": "ListExample",
		"type": "object",
		"properties": {
			"propertyName": {
				"type": "string",
				"enum": ["option 0", "option 1", "option 2"]
			}
		}
	},
	"uiSchema": {
		"propertyName": {
			"ui:trigger": ["after"]
		}
	},
	"properties": {}
}

Then onChange will be triggered when propertyName field value has changed.

import Form from '@talend/react-forms';

class MyForm extends React.Component {
	onChange(formData, formId, propertyName, propertyValue) {
		console.log(formData, formId, propertyName, propertyValue);
	}

	onSubmit(formData) {
		console.log(formData);
	}

	render() {
		return <Form data={this.props.data} onChange={this.onChange} onSubmit={this.onSubmit} />;
	}
}

PropTypes

The data and actions PropTypes are exported for easy reuse. You can use them by importing the DataPropTypes and ActionsPropTypes functions.

import Form, { DataPropTypes, ActionsPropTypes } from '@talend/react-forms';

Validation

You can use validation from outside (let say button outside the form) this way:

import validate from '@talend/react-forms/lib/validate';

function isValid({ payload}) {
	return validate(payload.jsonSchema, payload.formData);
}

LICENSE

Copyright (c) 2006-2016 Talend

Licensed under the Apache V2 License

6.43.1

2 months ago

6.43.0

3 months ago

6.42.1

3 months ago

6.42.0

3 months ago

6.41.2

3 months ago

6.41.1

4 months ago

6.41.3

3 months ago

6.41.0

4 months ago

6.40.0

4 months ago

6.39.3

4 months ago

6.39.2

4 months ago

6.39.0

4 months ago

6.39.1

4 months ago

6.38.1

5 months ago

6.38.0

5 months ago

6.37.0

5 months ago

6.36.0

5 months ago

6.35.0

6 months ago

6.34.0

6 months ago

6.33.0

6 months ago

6.32.0

7 months ago

6.31.0

7 months ago

6.30.0

7 months ago

6.29.0

8 months ago

6.28.0

8 months ago

6.27.0

8 months ago

6.26.0

8 months ago

6.25.0

9 months ago

6.24.0

9 months ago

6.24.1

9 months ago

6.23.0

9 months ago

6.22.0

9 months ago

6.21.0

9 months ago

6.20.0

10 months ago

6.19.0

10 months ago

6.18.0

10 months ago

6.17.0

10 months ago

6.16.0

11 months ago

6.15.1

11 months ago

6.15.0

11 months ago

6.14.2

11 months ago

6.14.1

11 months ago

6.14.0

11 months ago

7.0.0-alpha.1

11 months ago

6.13.0

12 months ago

6.12.0

12 months ago

6.11.1

12 months ago

6.12.0-alpha.0

12 months ago

6.11.0

12 months ago

6.10.1

1 year ago

6.10.0

1 year ago

6.9.1

1 year ago

6.9.0

1 year ago

6.8.0

1 year ago

6.7.0

1 year ago

6.6.0

1 year ago

6.5.1

1 year ago

6.5.0

1 year ago

6.4.0

1 year ago

6.3.1

1 year ago

6.3.0

1 year ago

6.2.4

1 year ago

6.2.3

1 year ago

6.2.2

1 year ago

6.2.1

1 year ago

6.2.0

1 year ago

5.31.0

1 year ago

6.1.8

1 year ago

5.30.3

1 year ago

6.1.7

1 year ago

5.30.2

1 year ago

6.1.6

1 year ago

6.1.5

1 year ago

6.1.4

1 year ago

5.30.1

1 year ago

6.1.2

1 year ago

6.1.3

1 year ago

6.1.1

1 year ago

5.30.0

1 year ago

6.1.0

1 year ago

6.0.1

1 year ago

6.0.0

1 year ago

5.29.4

1 year ago

5.29.3

1 year ago

5.29.2

1 year ago

5.29.1

1 year ago

5.29.0

1 year ago

5.28.1-alpha.0

1 year ago

6.0.0-ds.0

1 year ago

5.29.0-alpha.0

1 year ago

5.28.0

1 year ago

6.0.0-alpha.43

1 year ago

5.27.1

1 year ago

5.27.0

1 year ago

6.0.0-alpha.41

1 year ago

6.0.0-alpha.42

1 year ago

6.0.0-alpha.40

1 year ago

5.26.0

1 year ago

6.0.0-alpha.39

1 year ago

6.0.0-alpha.38

1 year ago

6.0.0-alpha.37

1 year ago

6.0.0-alpha.36

1 year ago

6.0.0-alpha.35

1 year ago

6.0.0-alpha.29

1 year ago

6.0.0-alpha.30

1 year ago

6.0.0-alpha.31

1 year ago

6.0.0-alpha.32

1 year ago

6.0.0-alpha.33

1 year ago

6.0.0-alpha.34

1 year ago

5.25.0

1 year ago

6.0.0-alpha.28

1 year ago

6.0.0-alpha.27

1 year ago

6.0.0-alpha.26

1 year ago

6.0.0-alpha.25

1 year ago

6.0.0-alpha.22

1 year ago

6.0.0-alpha.23

1 year ago

6.0.0-alpha.24

1 year ago

6.0.0-alpha.21

1 year ago

6.0.0-y.0

1 year ago

6.0.0-alpha.20

1 year ago

6.0.0-alpha.19

1 year ago

5.24.0

1 year ago

6.0.0-alpha.18

1 year ago

6.0.0-alpha.17

1 year ago

5.23.0

1 year ago

6.0.0-alpha.16

1 year ago

6.0.0-alpha.13

1 year ago

6.0.0-alpha.14

1 year ago

6.0.0-alpha.15

1 year ago

5.22.1

1 year ago

5.22.0

1 year ago

6.0.0-alpha.12

1 year ago

5.21.0

1 year ago

6.0.0-alpha.11

1 year ago

5.20.0

1 year ago

5.20.0-alpha.0

1 year ago

5.19.0

1 year ago

5.18.0

1 year ago

5.17.0

1 year ago

5.16.0

1 year ago

5.15.0

1 year ago

5.14.0

2 years ago

5.14.0-alpha.0

2 years ago

5.13.0

2 years ago

5.12.0

2 years ago

5.11.0

2 years ago

6.0.0-alpha.10

2 years ago

6.0.0-alpha.9

2 years ago

5.10.3

2 years ago

5.9.2

2 years ago

5.7.2

2 years ago

5.10.2

2 years ago

5.9.1

2 years ago

6.0.0-alpha.8

2 years ago

6.0.0-alpha.7

2 years ago

5.10.1

2 years ago

5.10.0

2 years ago

5.7.1

2 years ago

6.0.0-alpha.6

2 years ago

6.0.0-alpha.5

2 years ago

6.0.0-alpha.4

2 years ago

6.0.0-alpha.3

2 years ago

6.0.0-alpha.1

2 years ago

6.0.0-alpha.2

2 years ago

6.0.0-alpha.0

2 years ago

5.9.0

2 years ago

5.8.0

2 years ago

5.7.0

2 years ago

5.6.0

2 years ago

5.1.3

2 years ago

5.5.0

2 years ago

5.5.0-alpha.0

2 years ago

5.4.0

2 years ago

5.3.0

2 years ago

4.38.2

2 years ago

4.38.1

2 years ago

4.38.0

2 years ago

5.2.0

2 years ago

5.2.0-y.4

2 years ago

5.1.2

2 years ago

5.2.0-y.1

2 years ago

5.2.0-y.0

2 years ago

4.37.1

2 years ago

5.1.2-alpha.2

2 years ago

5.1.1

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

4.37.0

2 years ago

4.36.3

2 years ago

4.36.2

2 years ago

4.36.1

2 years ago

4.36.0

2 years ago

4.35.0

2 years ago

4.34.1

2 years ago

4.34.0

2 years ago

4.32.2

2 years ago

4.33.0

2 years ago

4.32.1

2 years ago

4.32.0

2 years ago

4.32.0-0

2 years ago

4.31.0

2 years ago

4.30.0

2 years ago

4.29.0

2 years ago

4.28.1

2 years ago

4.28.0

2 years ago

4.27.0

2 years ago

4.26.0

2 years ago

4.26.1

2 years ago

4.26.2

2 years ago

4.25.0

2 years ago

4.25.0-0

2 years ago

4.24.0

2 years ago

4.23.0

2 years ago

4.23.0-0

2 years ago

4.21.1

2 years ago

4.22.0

2 years ago

4.21.0

2 years ago

4.19.1

2 years ago

4.20.0

2 years ago

4.19.0

2 years ago

4.19.0-1

2 years ago

4.19.0-0

2 years ago

4.18.0

2 years ago

4.17.0

2 years ago

4.16.0

2 years ago

4.15.0

2 years ago

4.14.0

2 years ago

4.14.0-1

2 years ago

4.14.0-0

2 years ago

4.13.0

2 years ago

4.13.0-1

2 years ago

4.10.3

2 years ago

4.13.0-0

2 years ago

4.12.0

2 years ago

4.11.0

2 years ago

4.10.2

2 years ago

4.10.1

2 years ago

4.10.0

2 years ago

4.9.0

2 years ago

4.8.2

2 years ago

4.9.0-2

2 years ago

4.9.0-1

2 years ago

4.9.0-0

2 years ago

4.8.1

2 years ago

4.8.0

2 years ago

4.7.0

2 years ago

4.7.0-1

2 years ago

4.7.0-0

2 years ago

4.6.0

2 years ago

4.5.0

2 years ago

4.4.0

2 years ago

4.3.0

3 years ago

4.2.0

3 years ago

4.1.1

3 years ago

4.1.0

3 years ago

4.0.1

3 years ago

3.9.12

3 years ago

3.12.1

3 years ago

3.9.11

3 years ago

4.0.0

3 years ago

3.12.0

3 years ago

3.9.10

3 years ago

3.9.9

3 years ago

3.9.8

3 years ago

3.11.0

3 years ago

3.9.7

3 years ago

3.9.6

3 years ago

3.8.4

3 years ago

3.8.3

3 years ago

3.8.2

3 years ago

3.9.5

3 years ago

3.10.0

3 years ago

3.9.4

3 years ago

3.9.3

3 years ago

3.9.2

3 years ago

3.9.1

3 years ago

3.10.0-alpha.0

3 years ago

3.9.0

3 years ago

3.8.1

3 years ago

3.8.0

3 years ago

3.8.0-1

3 years ago

3.7.2

3 years ago

3.6.3

3 years ago

3.7.1

3 years ago

3.6.2

3 years ago

3.8.0-0

3 years ago

3.7.0

3 years ago

3.7.0-0

3 years ago

3.6.1

3 years ago

3.6.0

3 years ago

3.6.0-1

3 years ago

3.6.0-0

3 years ago

3.5.0

3 years ago

3.4.0

3 years ago

2.6.19

3 years ago

3.4.0-0

3 years ago

3.3.0

3 years ago

3.2.1

3 years ago

3.2.0

3 years ago

3.1.0

3 years ago

2.12.2

3 years ago

3.0.0

3 years ago

2.12.1

3 years ago

2.12.0

3 years ago

2.6.18

3 years ago

2.11.0

3 years ago

2.6.17

3 years ago

2.6.16

3 years ago

2.6.15

3 years ago

2.10.0

3 years ago

2.6.14

3 years ago

2.6.13

3 years ago

2.6.12

3 years ago

2.6.11

3 years ago

2.9.0

3 years ago

2.6.10

3 years ago

2.6.9

3 years ago

2.8.0

3 years ago

2.6.8

3 years ago

2.6.7

3 years ago

2.6.6

3 years ago

2.6.5

3 years ago

2.6.4

3 years ago

2.7.0

3 years ago

2.6.3

3 years ago

2.6.2

3 years ago

2.6.1

3 years ago

2.6.0

3 years ago

2.5.1-0

3 years ago

2.5.0

3 years ago

2.5.0-1

3 years ago

2.4.1

3 years ago

2.5.0-0

3 years ago

2.4.0

3 years ago

2.4.0-0

3 years ago

2.3.1

3 years ago

2.3.0

3 years ago

2.2.0

3 years ago

2.2.0-0

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.13.0

3 years ago

1.12.0

3 years ago

1.12.0-1

3 years ago

1.12.0-0

3 years ago

1.11.0

3 years ago

1.10.1

3 years ago

1.10.0-webpack4

3 years ago

1.10.0

3 years ago

1.10.0-1

3 years ago

1.9.1

3 years ago

1.10.0-0

3 years ago

1.9.0

3 years ago

2.0.0-0

3 years ago

1.9.0-1

3 years ago

1.9.0-0

3 years ago

1.8.0

3 years ago

1.7.0

3 years ago

1.6.3

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.4.0-0

3 years ago

1.3.0

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.211.0-0

3 years ago

0.210.2

3 years ago

0.210.1

3 years ago

0.210.0

3 years ago

0.210.0-0

3 years ago

0.209.0

3 years ago

0.208.1-0

3 years ago

0.197.1-tdp

3 years ago

0.208.0

3 years ago

0.207.1

3 years ago

0.207.0

3 years ago

0.206.0

3 years ago

0.206.0-2

3 years ago

0.206.0-1

3 years ago

0.206.0-0

3 years ago

0.205.0

3 years ago

0.205.0-0

3 years ago

0.204.1

3 years ago

0.204.0

3 years ago

0.203.1

3 years ago

0.203.0

3 years ago

0.202.0

4 years ago

0.201.1

4 years ago

0.201.0

4 years ago

0.201.0-2

4 years ago

0.201.0-1

4 years ago

0.201.0-0

4 years ago

0.200.2

4 years ago

0.200.1

4 years ago

0.200.0

4 years ago

0.200.0-0

4 years ago

0.199.0

4 years ago

0.198.3

4 years ago

0.198.2

4 years ago

0.198.1

4 years ago

0.198.0

4 years ago

0.197.0

4 years ago

0.196.0

4 years ago

0.195.0

4 years ago

0.194.0

4 years ago

0.193.0

4 years ago

0.192.0

4 years ago

0.191.0

4 years ago

0.190.0

4 years ago

0.189.0

4 years ago

0.188.0

4 years ago

0.187.1

4 years ago

0.187.0

4 years ago

0.186.0

4 years ago

0.186.0-beta-1

4 years ago

0.185.0

4 years ago

0.184.0

4 years ago

0.183.0

4 years ago

0.183.0-beta-2

4 years ago

0.182.0

4 years ago

0.181.0

4 years ago

0.180.0

4 years ago

0.179.0

4 years ago

0.178.0

4 years ago

0.177.0

4 years ago

0.176.0

4 years ago

0.175.0

4 years ago

0.174.0

4 years ago

0.173.0

4 years ago

0.172.0

4 years ago

0.171.0

4 years ago

0.170.0

4 years ago

0.169.0

4 years ago

0.168.0

4 years ago

0.167.0

4 years ago

0.166.0

4 years ago

0.165.0

4 years ago

0.164.0

4 years ago

0.163.1

4 years ago

0.163.0

4 years ago

0.162.0

4 years ago

0.161.0

4 years ago

0.160.0

4 years ago

0.159.0

4 years ago

0.158.0

4 years ago

0.157.0

4 years ago

0.156.0

4 years ago

0.155.3-0

4 years ago

0.155.1

4 years ago

0.154.0

4 years ago

0.153.0

4 years ago

0.152.0

4 years ago

0.151.0

4 years ago

0.150.0

4 years ago

0.149.0

4 years ago

0.148.0

4 years ago

0.147.0

4 years ago

0.146.0

4 years ago

0.145.0

4 years ago

0.144.0

4 years ago

0.143.0

4 years ago

0.142.0

4 years ago

0.141.0

4 years ago

0.140.0

4 years ago

0.139.0

4 years ago

0.138.0

4 years ago

0.137.0

4 years ago

0.136.0

4 years ago

0.135.0

4 years ago

0.134.0

4 years ago

0.133.0

4 years ago

0.132.0

4 years ago

0.131.0

4 years ago

0.130.0

4 years ago

0.129.0

4 years ago

0.128.0

4 years ago

0.127.0

4 years ago

0.126.0

4 years ago

0.125.0

4 years ago

0.124.0

4 years ago

0.123.0

4 years ago

0.122.0

4 years ago

0.121.0

4 years ago

0.120.0

4 years ago

0.119.0

4 years ago

0.118.0

4 years ago

0.117.0

4 years ago

0.116.0

4 years ago

0.115.0

4 years ago

0.114.0

4 years ago

0.113.1

4 years ago

0.113.0

4 years ago

0.112.0

4 years ago

0.111.0

4 years ago

0.110.0

4 years ago

0.109.0

4 years ago

0.108.0

4 years ago

0.107.0

4 years ago

0.106.1

4 years ago

0.106.0

4 years ago

0.105.0

4 years ago

0.104.0

4 years ago

0.103.0

4 years ago

0.102.4

4 years ago

0.102.3

4 years ago

0.102.1

4 years ago

0.102.0

4 years ago

0.101.0

4 years ago

0.100.0

4 years ago

0.99.0

4 years ago

0.98.0

5 years ago

0.97.1

5 years ago

0.97.0

5 years ago

0.96.0

5 years ago

0.95.0

5 years ago

0.94.0

5 years ago

0.93.0

5 years ago

0.92.0

5 years ago

0.91.0

5 years ago

0.90.0

5 years ago

0.89.0

5 years ago

0.88.0

5 years ago

0.87.0

5 years ago

0.86.0

5 years ago

0.85.1

5 years ago

0.85.0

5 years ago

0.84.0

5 years ago

0.83.1

5 years ago

0.83.0

5 years ago

0.82.0

5 years ago

0.81.0

5 years ago

0.80.0

5 years ago

0.79.0

5 years ago

0.78.0

5 years ago

0.77.0

5 years ago