Skip to content

Commit 9b77bab

Browse files
committed
v2.0
1 parent 59a0fc5 commit 9b77bab

File tree

11 files changed

+42
-42
lines changed

11 files changed

+42
-42
lines changed

docs/asset-manifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"index.css": "static/css/index.98230644.chunk.css",
3-
"index.js": "static/js/index.98230644.chunk.js",
4-
"runtime~index.js": "static/js/runtime~index.a017096d.js",
5-
"static/js/2.717fe54e.chunk.js": "static/js/2.717fe54e.chunk.js",
2+
"index.css": "static/css/index.b7cf3bc7.chunk.css",
3+
"index.js": "static/js/index.b7cf3bc7.chunk.js",
4+
"runtime~index.js": "static/js/runtime~index.b1cf17c6.js",
5+
"static/js/2.d628d586.chunk.js": "static/js/2.d628d586.chunk.js",
66
"index.html": "index.html"
77
}

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html style="width:100%;height:100%;overflow:auto"><head><meta charset="utf-8"/><title>Form</title><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1"/><style>.demo{width:1100px;height:500px;margin:50px auto;background:#fff;font-size:12px;overflow:auto}.rw-layout-content{height:200px}.rw-layout.rw-layout-has-sider{text-align:center;background:#3ba0e9}.rw-layout-sider{width:200px;text-align:center;background:#3ba0e9;color:#fff}.rw-layout-footer,.rw-layout-header{background:#7dbcea;color:#fff;height:64px;line-height:64px;text-align:center}.rw-layout-content{background:#108ee9;color:#fff;text-align:center}</style><link href="static/css/index.98230644.chunk.css" rel="stylesheet"></head><body style="background:#f5f5f5"><div class="demo" id="demo"></div><script src="static/js/runtime~index.a017096d.js"></script><script src="static/js/2.717fe54e.chunk.js"></script><script src="static/js/index.98230644.chunk.js"></script></body></html>
1+
<!doctype html><html style="width:100%;height:100%;overflow:auto"><head><meta charset="utf-8"/><title>Form</title><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1"/><style>.demo{width:1100px;height:500px;margin:50px auto;background:#fff;font-size:12px;overflow:auto}.rw-layout-content{height:200px}.rw-layout.rw-layout-has-sider{text-align:center;background:#3ba0e9}.rw-layout-sider{width:200px;text-align:center;background:#3ba0e9;color:#fff}.rw-layout-footer,.rw-layout-header{background:#7dbcea;color:#fff;height:64px;line-height:64px;text-align:center}.rw-layout-content{background:#108ee9;color:#fff;text-align:center}</style><link href="static/css/index.b7cf3bc7.chunk.css" rel="stylesheet"></head><body style="background:#f5f5f5"><div class="demo" id="demo"></div><script src="static/js/runtime~index.b1cf17c6.js"></script><script src="static/js/2.d628d586.chunk.js"></script><script src="static/js/index.b7cf3bc7.chunk.js"></script></body></html>

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-widget-form",
3-
"version": "2.0.0-alpha1",
3+
"version": "2.0.0",
44
"description": "",
55
"main": "cjs/index.js",
66
"module": "esm/index.js",
@@ -33,7 +33,7 @@
3333
"*.md"
3434
],
3535
"scripts": {
36-
"docs": "packez build ./examples/index.js -d docs -c -w",
36+
"docs": "packez build ./examples/index.js -d docs -c",
3737
"start": "tsc -w",
3838
"cjs": "transform-es src -d cjs -c -t cjs",
3939
"esm": "transform-es src -d esm -c -t esm",

packez.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
const _ = require("lodash");
22

33
module.exports = function({ method, program, ...defaults }) {
4-
const opts = {
5-
tsCheck: true,
6-
};
4+
const opts = {
5+
tsCheck: false,
6+
};
77

8-
return _.defaultsDeep(opts, defaults);
8+
return _.defaultsDeep(opts, defaults);
99
};

src/Form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ export class Form extends React.Component<Partial<IFormProps>, IFormState> {
432432
return Object.keys(validatingFields).some(key => validatingFields[key]);
433433
}
434434

435-
_validateField(name: string, callback: ValidationCallback, triggerType = "none") {
435+
_validateField(name: string, callback: ValidationCallback, triggerType: TriggerType = "none") {
436436
callback = typeof callback === "function" ? callback : noop;
437437
const { formValue } = this.state;
438438
const value = this.getValue(name);

src/types.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ export type ValidationError = { name: string; message: any };
99
export type ValueChangeCallback = (fromValue: FormValue) => void;
1010

1111
export type ValidationCallback = (
12-
errors: ValidationError[] | null,
13-
value: any,
14-
isAbort?: boolean
12+
errors: ValidationError[] | null,
13+
value: any,
14+
isAbort?: boolean
1515
) => void;
1616

17-
export type Validator = (
18-
value: any,
19-
formValue: FormValue,
20-
triggerType: string
21-
) => boolean | null | undefined | PromiseLike<any> | any;
17+
export type Validator<T = boolean | null | undefined | PromiseLike<any> | any> = (
18+
value: any,
19+
formValue: FormValue,
20+
triggerType: TriggerType
21+
) => T;
2222

2323
export type FormItemChildrenProps = {
24-
value: any;
25-
onChange: (value: any, e?: React.SyntheticEvent) => void;
26-
onFocus: (e: React.FocusEvent) => void;
27-
onBlur: (e: React.FocusEvent) => void;
28-
[x: string]: any;
24+
value: any;
25+
onChange: (value: any, e?: React.SyntheticEvent) => void;
26+
onFocus: (e: React.FocusEvent) => void;
27+
onBlur: (e: React.FocusEvent) => void;
28+
[x: string]: any;
2929
};

0 commit comments

Comments
 (0)