Skip to content

Commit 038d90b

Browse files
authored
Merge pull request #513 from data-driven-forms/release-2.4
Release 2.4
2 parents 3f335d3 + bc0f460 commit 038d90b

File tree

387 files changed

+21071
-3723
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

387 files changed

+21071
-3723
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- run:
5353
name: Predeploy demo
5454
command: |
55-
yarn --cwd packages/react-renderer-demo/ create-deploy-files
55+
yarn --cwd packages/react-renderer-demo/ build
5656
- persist_to_workspace:
5757
root: ~/react-forms
5858
paths:

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/**/vendor.js
66
/**/*.config.js
77
/templates/**/*.*
8+
packages/**/service-worker.js

README.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ Data Driven Forms is a React library used for rendering and managing forms with
2929

3030
:book: For more information please visit the [documentation](https://data-driven-forms.org/). :book:
3131

32-
Used by [ManageIQ](http://manageiq.org/), Red Hat Cloud Services.
33-
3432
**Table of Contents**
3533

3634
- [Installation](#installation)
@@ -51,7 +49,7 @@ Used by [ManageIQ](http://manageiq.org/), Red Hat Cloud Services.
5149

5250
### Installation
5351

54-
You neet to add React Form Renderer
52+
Add React Form Renderer
5553

5654
#### [React Form Renderer](https://www.npmjs.com/package/@data-driven-forms/react-form-renderer)
5755

@@ -65,39 +63,42 @@ $ yarn add @data-driven-forms/react-form-renderer
6563

6664
Optionally you can install one of provided mappers:
6765

68-
#### [PatternFly 3 Mapper](https://www.npmjs.com/package/@data-driven-forms/pf3-component-mapper)
66+
67+
#### [Material-UI Mapper](https://www.npmjs.com/package/@data-driven-forms/mui-component-mapper)
6968

7069
```console
71-
$ npm install @data-driven-forms/pf3-component-mapper -S
70+
$ npm install @data-driven-forms/mui-component-mapper -S
7271
```
7372

7473
```console
75-
$ yarn add @data-driven-forms/pf3-component-mapper
74+
$ yarn add @data-driven-forms/mui-component-mapper
7675
```
7776

78-
#### [PatternFly 4 Mapper](https://www.npmjs.com/package/@data-driven-forms/pf4-component-mapper)
77+
#### [PatternFly 3 Mapper](https://www.npmjs.com/package/@data-driven-forms/pf3-component-mapper)
7978

8079
```console
81-
$ npm install @data-driven-forms/pf4-component-mapper -S
80+
$ npm install @data-driven-forms/pf3-component-mapper -S
8281
```
8382

8483
```console
85-
$ yarn add @data-driven-forms/pf4-component-mapper
84+
$ yarn add @data-driven-forms/pf3-component-mapper
8685
```
8786

88-
#### [Material-UI Mapper](https://www.npmjs.com/package/@data-driven-forms/mui-component-mapper)
87+
#### [PatternFly 4 Mapper](https://www.npmjs.com/package/@data-driven-forms/pf4-component-mapper)
8988

9089
```console
91-
$ npm install @data-driven-forms/mui-component-mapper -S
90+
$ npm install @data-driven-forms/pf4-component-mapper -S
9291
```
9392

9493
```console
95-
$ yarn add @data-driven-forms/mui-component-mapper
94+
$ yarn add @data-driven-forms/pf4-component-mapper
9695
```
9796

97+
Component libraries in mappers are external dependencies. Make sure to install them in your bundles.
98+
9899
### Usage
99100

100-
For using Data Driven Forms in your component you need the renderer and a component mapper, which provides formFields components and layoutFields components.
101+
In order to Data Driven Forms in your component you need the renderer and a component mapper, which provides component mapper and form template
101102

102103
```jsx
103104
import React from 'react';
@@ -138,6 +139,8 @@ Data Driven Forms supports all kinds of component, basic set is consisted of:
138139
- Sub-form
139140
- Wizard
140141

142+
Any other components can be added to mapper and renderer with the form renderer. Existing components can be also overriden.
143+
141144
### Documentation
142145

143146
Please use our [documentation site](https://data-driven-forms.org/). In case of any problem, you can access documentation files directly in GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"private": true,
99
"scripts": {
1010
"bootstrap": "lerna bootstrap",
11-
"build": "lerna run build --ignore @data-driven-forms/react-render-demo",
11+
"build": "lerna run build --ignore @data-driven-forms/react-renderer-demo",
1212
"vendor": "lerna run vendor",
1313
"test": "jest --coverage",
1414
"test:ci": "jest --coverage --runInBand",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../common/.gitignore
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../LICENSE
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
[![npm version](https://badge.fury.io/js/%40data-driven-forms%2Fblueprint-component-mapper.svg)](https://badge.fury.io/js/%40data-driven-forms%2Fblueprint-component-mapper)
2+
3+
[![Data Driven Form logo](images/logo.png)](https://data-driven-forms.org/)
4+
5+
Blueprint component mapper for [Data Driven Forms](https://github.com/data-driven-forms/react-forms).
6+
7+
:book: For more information please visit the [documentation](https://data-driven-forms.org/). :book:
8+
9+
**Table of Contents**
10+
11+
- [Installation](#installation)
12+
- [React Form Renderer](#react-form-renderer)
13+
- [Blueprint Mapper](#blueprint-mapper)
14+
- [Usage](#usage)
15+
- [Basic provided components](#basic-provided-components)
16+
- [Useful links](#useful-links)
17+
- [Development setup](#development-setup)
18+
- [Tests](#tests)
19+
- [Commits](#commits)
20+
- [Changes to documentation](#changes-to-documentation)
21+
- [Contribution](#contribution)
22+
- [LICENSE](#license)
23+
24+
### Installation
25+
26+
You neet to add React Form Renderer
27+
28+
#### [React Form Renderer](https://www.npmjs.com/package/@data-driven-forms/react-form-renderer)
29+
30+
```console
31+
$ npm install @data-driven-forms/react-form-renderer -S
32+
```
33+
34+
```console
35+
$ yarn add @data-driven-forms/react-form-renderer
36+
```
37+
38+
Optionally you can install one of provided mappers:
39+
40+
#### [Blueprint Mapper](https://www.npmjs.com/package/@data-driven-forms/blueprint-component-mapper)
41+
42+
```console
43+
$ npm install @data-driven-forms/blueprint-component-mapper -S
44+
```
45+
46+
```console
47+
$ yarn add @data-driven-forms/blueprint-component-mapper
48+
```
49+
50+
51+
### Usage
52+
53+
For using Data Driven Forms in your component you need the renderer and a component mapper, which provides formFields components and layoutFields components.
54+
55+
```jsx
56+
import React from 'react';
57+
import FormRenderer, { componentTypes } from '@data-driven-forms/react-form-renderer';
58+
import { componentMapper, FormTemplate } from '@data-driven-forms/blueprint-component-mapper';
59+
60+
const schema = {
61+
fields: [{
62+
component: componentTypes.TEXT_FIELD,
63+
name: 'name',
64+
label: 'Your name'
65+
}]
66+
}
67+
68+
const Form = () => (
69+
<FormRenderer
70+
schema={schema}
71+
componentMapper={componentMapper}
72+
FormTemplate={FormTemplate}
73+
onSubmit={console.log}
74+
/>
75+
)
76+
```
77+
78+
### Basic provided components
79+
80+
Data Driven Forms supports all kinds of component, basic set is consisted of:
81+
82+
- Text input
83+
- Text area
84+
- Checkbox (Multiple checkboxes)
85+
- Select (dropdown)
86+
- Switch
87+
- Radio buttons
88+
- Date picker
89+
- Time picker
90+
- Tabs
91+
- Sub-form
92+
- Wizard
93+
- Plain-text
94+
95+
### Useful links
96+
97+
- [Data Driven Forms documentation](https://data-driven-forms.org/)
98+
- [Blueprint Design documentation](https://blueprintjs.com/docs/)
99+
- NPM
100+
- [React Form Renderer](https://www.npmjs.com/package/@data-driven-forms/react-form-renderer)
101+
- [Blueprint 4 Mapper](https://www.npmjs.com/package/@data-driven-forms/blueprint-component-mapper)
102+
103+
104+
### Development setup
105+
106+
Data Driven Forms is a monorepo which uses [Lerna](https://github.com/lerna/lerna), so you can use all its commands as well.
107+
108+
1. Install
109+
110+
```console
111+
yarn install
112+
```
113+
114+
2. Build
115+
116+
```console
117+
yarn build
118+
```
119+
120+
3. Run a package
121+
122+
Each package has a small playground `package/demo`, where you can test your changes.
123+
124+
```console
125+
cd packages/blueprint-component-mapper
126+
yarn start
127+
```
128+
129+
4. How to clean?
130+
131+
```console
132+
rm yarn.lock
133+
yarn lerna clean # will delete all node_modules
134+
```
135+
136+
All packages are linked together by default, so if you run a `yarn build` in a package, all other packages are updated to the latest version of that package.
137+
138+
#### Tests
139+
140+
Tests needed to be run from the core folder.
141+
142+
```console
143+
yarn test
144+
145+
yarn test packages/blueprint-component-mapper
146+
```
147+
148+
#### Commits
149+
150+
Data Driven Forms uses [Semantic Release](https://github.com/semantic-release/commit-analyzer)
151+
152+
Format:
153+
154+
```
155+
[type]([package]): message
156+
157+
fix(blueprint): title accepts node
158+
```
159+
160+
Types:
161+
- `feat`: a new feature, will trigger new `_.X._` release
162+
- `fix`: a fix, will trigger new `_._.X` release
163+
164+
Packages:
165+
- Please describe which package is being changed `pf3`, `renderer`, ...
166+
167+
Please, do not use Semantic Release, if you update only the demo.
168+
169+
All packages are releasing together and they share the version number.
170+
171+
#### Changes to documentation
172+
173+
If your changes influence API or add new features, you should describe these new options in the `demo` repository. Thanks!
174+
175+
### Contribution
176+
177+
We welcome any community contribution. Don't be afraid to report bug or to create issues and pull-requests! :trophy:
178+
179+
### LICENSE
180+
181+
Apache License 2.0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../common/babel.config.js
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../common/config/jest.setup.js
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
const TerserPlugin = require('terser-webpack-plugin');
2+
const HtmlWebPackPlugin = require('html-webpack-plugin');
3+
const resolve = require('path').resolve;
4+
const merge = require('webpack-merge');
5+
6+
const commonConfig = {
7+
module: {
8+
rules: [{
9+
test: /\.(js|jsx)$/,
10+
exclude: /node_modules/,
11+
use: {
12+
loader: 'babel-loader',
13+
},
14+
}, {
15+
test: /\.(sa|sc|c)ss$/,
16+
use: [ 'style-loader', 'css-loader', 'sass-loader', 'resolve-url-loader' ],
17+
}, {
18+
test: /\.(png|jpg|gif|svg|woff|ttf|eot)/,
19+
loader: 'url-loader',
20+
},
21+
],
22+
},
23+
};
24+
25+
const htmlPlugin = new HtmlWebPackPlugin({
26+
template: './demo/index.html',
27+
filename: './index.html',
28+
});
29+
30+
const devConfig = {
31+
mode: 'development',
32+
entry: './demo/index.js',
33+
output: {
34+
path: resolve('../dist'),
35+
filename: '[name].[hash].js',
36+
},
37+
devtool: 'source-map',
38+
plugins: [ htmlPlugin ],
39+
};
40+
41+
const prodConfig = {
42+
mode: 'development',
43+
entry: './src/index.js',
44+
optimization: {
45+
minimizer: [
46+
new TerserPlugin({
47+
cache: true,
48+
parallel: true,
49+
terserOptions: {
50+
keep_classnames: true,
51+
keep_fnames: true,
52+
},
53+
}),
54+
],
55+
},
56+
output: {
57+
path: resolve('./dist'),
58+
library: '[name]',
59+
libraryTarget: 'umd',
60+
filename: 'index.js',
61+
umdNamedDefine: true,
62+
globalObject: 'this',
63+
},
64+
};
65+
66+
module.exports = env => ({
67+
dev: merge(commonConfig, devConfig),
68+
prod: merge(commonConfig, prodConfig),
69+
})[env];
70+

0 commit comments

Comments
 (0)