Skip to content

Commit cb8d896

Browse files
committed
Merge remote-tracking branch 'upstream/state-manager' into buildprocess
2 parents 6eb76ac + fdfaae5 commit cb8d896

File tree

189 files changed

+633
-33911
lines changed

Some content is hidden

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

189 files changed

+633
-33911
lines changed

README.md

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Data Driven Forms is a React library used for rendering and managing forms with
1717

1818
:tada: Features :tada:
1919
- **Easily readable schema**, you don't need to know any HTML or JS to be able to write your own form schemas!
20-
- You can use your **own components** or use one of our **provided mappers** ([PatternFly 3](https://patternfly-react.surge.sh/patternfly-3/index.html), [PatternFly 4](https://patternfly-react.surge.sh/patternfly-4/), [Material-UI](https://material-ui.com/), [Ant Design](https://ant.design/)! and more, see below!)
20+
- You can use your **own components** or use one of our **provided mappers**: [PatternFly 4](https://patternfly-react.surge.sh/patternfly-4/), [Material-UI](https://material-ui.com/), [Ant Design](https://ant.design/)! and more, see below!)
2121
- **Form state manager** out-of-the-box (including error states!)
2222
- Fully **customizable** (you can use your own buttons, actions, etc.)!
2323
- **Conditional** fields!
@@ -36,7 +36,6 @@ Data Driven Forms is a React library used for rendering and managing forms with
3636
- [Installation](#installation)
3737
- [React Form Renderer](#react-form-renderer)
3838
- [Material-UI Mapper](#material-ui-mapper)
39-
- [PatternFly 3 Mapper](#patternfly-3-mapper)
4039
- [PatternFly 4 Mapper](#patternfly-4-mapper)
4140
- [BlueprintJS Mapper](#blueprintjs-mapper)
4241
- [Semantic UI Mapper](#semantic-ui-mapper)
@@ -81,16 +80,6 @@ $ npm install @data-driven-forms/mui-component-mapper -S
8180
$ yarn add @data-driven-forms/mui-component-mapper
8281
```
8382

84-
#### [PatternFly 3 Mapper](https://data-driven-forms.org/mappers/pf3-component-mapper)
85-
86-
```console
87-
$ npm install @data-driven-forms/pf3-component-mapper -S
88-
```
89-
90-
```console
91-
$ yarn add @data-driven-forms/pf3-component-mapper
92-
```
93-
9483
#### [PatternFly 4 Mapper](https://data-driven-forms.org/mappers/pf4-component-mapper)
9584

9685
```console
@@ -237,7 +226,6 @@ Please use our [documentation site](https://data-driven-forms.org/). In case of
237226
### Useful links
238227

239228
- [Data Driven Forms documentation](https://data-driven-forms.org/)
240-
- [PatternFly 3 Design documentation](https://www.patternfly.org/v3/)
241229
- [PatternFly 4 Design documentation](https://www.patternfly.org/v4/)
242230
- [Material-UI documentation](https://material-ui.com/)
243231
- [Ant Design documentation](https://ant.design/)
@@ -246,7 +234,6 @@ Please use our [documentation site](https://data-driven-forms.org/). In case of
246234
- [IBM Carbon](https://www.carbondesignsystem.com/)
247235
- NPM
248236
- [React Form Renderer](https://www.npmjs.com/package/@data-driven-forms/react-form-renderer)
249-
- [PatternFly 3 Mapper](https://www.npmjs.com/package/@data-driven-forms/pf3-component-mapper)
250237
- [PatternFly 4 Mapper](https://www.npmjs.com/package/@data-driven-forms/pf4-component-mapper)
251238
- [MaterialUI Mapper](https://www.npmjs.com/package/@data-driven-forms/mui-component-mapper)
252239
- [Ant Design Mapper](https://www.npmjs.com/package/@data-driven-forms/ant-component-mapper)
@@ -275,7 +262,7 @@ yarn build
275262
Each package has a small playground `package/demo`, where you can test your changes.
276263

277264
```console
278-
cd packages/pf3-component-mapper
265+
cd packages/pf4-component-mapper
279266
yarn start
280267
```
281268

@@ -294,7 +281,7 @@ Tests needed to be run from the core folder.
294281
```console
295282
yarn test
296283

297-
yarn test packages/pf3-component-mapper
284+
yarn test packages/pf4-component-mapper
298285
```
299286

300287
#### Commits
@@ -306,15 +293,15 @@ Format:
306293
```
307294
[type]([package]): message
308295
309-
fix(pf3): title accepts node
296+
fix(pf4): title accepts node
310297
```
311298

312299
Types:
313300
- `feat`: a new feature, will trigger new `_.X._` release
314301
- `fix`: a fix, will trigger new `_._.X` release
315302

316303
Packages:
317-
- Please describe which package is being changed `pf3`, `renderer`, ...
304+
- Please describe which package is being changed `4`, `renderer`, ...
318305

319306
Please, do not use Semantic Release, if you update only the demo.
320307

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"!<rootDir>/packages/react-renderer-demo/**/*.js",
4242
"!<rootDir>/packages/pf3-component-mapper/**/*.js",
4343
"!<rootDir>/packages/**/dist",
44-
"!<rootDir>/templates/**/*.js"
44+
"!<rootDir>/templates/**/*.js",
45+
"!<rootDir>/packages/**/src/**/index.js"
4546
],
4647
"moduleNameMapper": {
4748
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",

packages/ant-component-mapper/src/tests/components.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ describe('formFields generated tests', () => {
107107
const errorField = {
108108
...field,
109109
validate: [{ type: validatorTypes.REQUIRED, warning: true }],
110-
useWarnings: true,
111110
validateOnMount: true
112111
};
113112
let wrapper;

packages/ant-component-mapper/src/tests/dual-list-select.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ describe('DualListSelect', () => {
123123
wrapper.find('form').simulate('submit');
124124
});
125125

126-
expect(onSubmit).toHaveBeenCalledWith({});
126+
expect(onSubmit).toHaveBeenCalledWith({
127+
'dual-Menu': []
128+
});
127129
});
128130
});

packages/blueprint-component-mapper/src/tests/components.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ describe('formFields generated tests', () => {
112112
const errorField = {
113113
...field,
114114
validate: [{ type: validatorTypes.REQUIRED, warning: true }],
115-
useWarnings: true,
116115
validateOnMount: true
117116
};
118117
let wrapper;

packages/blueprint-component-mapper/src/tests/dual-list-select.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ describe('DualListSelect', () => {
254254
wrapper.find('form').simulate('submit');
255255
});
256256

257-
expect(onSubmit).toHaveBeenCalledWith({});
257+
expect(onSubmit).toHaveBeenCalledWith({
258+
'dual-Menu': []
259+
});
258260
});
259261

260262
it('switch all to right', async () => {
@@ -288,7 +290,9 @@ describe('DualListSelect', () => {
288290
wrapper.find('form').simulate('submit');
289291
});
290292

291-
expect(onSubmit).toHaveBeenCalledWith({});
293+
expect(onSubmit).toHaveBeenCalledWith({
294+
'dual-Menu': []
295+
});
292296
});
293297

294298
it('filters options', async () => {

packages/carbon-component-mapper/src/tests/components.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ describe('component tests', () => {
103103
const errorField = {
104104
...field,
105105
validate: [{ type: validatorTypes.REQUIRED, warning: true }],
106-
useWarnings: true,
107106
validateOnMount: true
108107
};
109108
let wrapper;

packages/carbon-component-mapper/src/tests/dual-list-select.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,9 @@ describe('DualListSelect', () => {
249249
wrapper.find('form').simulate('submit');
250250
});
251251

252-
expect(onSubmit).toHaveBeenCalledWith({});
252+
expect(onSubmit).toHaveBeenCalledWith({
253+
'dual-StructuredListWrapper': []
254+
});
253255
});
254256

255257
it('switch all to right', async () => {
@@ -283,7 +285,9 @@ describe('DualListSelect', () => {
283285
wrapper.find('form').simulate('submit');
284286
});
285287

286-
expect(onSubmit).toHaveBeenCalledWith({});
288+
expect(onSubmit).toHaveBeenCalledWith({
289+
'dual-StructuredListWrapper': []
290+
});
287291
});
288292

289293
it('filters options', async () => {

packages/form-state-manager/package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22
"name": "@data-driven-forms/form-state-manager",
33
"version": "0.0.1-beta.0",
44
"description": "Form state management library for data driven forms",
5-
"main": "index.js",
5+
"main": "dist/cjs/index.js",
6+
"module": "dist/esm/index.js",
67
"author": "Martin Marosi",
78
"typings": "dist/cjs/index.d.ts",
8-
"private": true,
9+
"repository": "[email protected]:data-driven-forms/react-forms.git",
10+
"keywords": [
11+
"react",
12+
"forms",
13+
"javascript"
14+
],
915
"devDependencies": {
1016
"@babel/core": "^7.2.2",
1117
"@babel/plugin-proposal-class-properties": "^7.1.0",

packages/form-state-manager/src/files/compose-validators.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import ComposeValidators from '../types/compose-validators';
99
* Synchronous validators are run in synchrounously and sync error is prioritized over async errors.
1010
* @returns {Function} New validation function
1111
*/
12-
const composeValidators: ComposeValidators = (validators = []) => (value, allValues) => {
12+
const composeValidators: ComposeValidators = (validators = []) => (value, allValues, meta) => {
1313
const promises: Promise<any>[] = [];
1414
let index = 0;
1515
let error: any;
1616
while (validators.length > 0 && !error && index < validators.length) {
17-
const result = validators[index](value, allValues);
17+
const result = validators[index](value, allValues, meta);
1818
if (isPromise(result)) {
1919
promises.push(result as Promise<any>);
2020
} else {

0 commit comments

Comments
 (0)