Skip to content

Commit d56d00a

Browse files
committed
docs: add docs api
1 parent 995dd7c commit d56d00a

Some content is hidden

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

60 files changed

+454
-108
lines changed

docs/api/apiChildJSON/docs_api_apiDocs_apiEffect.json

+12-13
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@
2121
"description": "The current form item uid."
2222
}
2323
},
24+
"setValue": {
25+
"defaultValue": null,
26+
"name": "setValue",
27+
"type": {
28+
"name": "(value?: any) => void"
29+
},
30+
"tags": {
31+
"localKey": "API.formItem.setValue.desc",
32+
"description": "Set the value of the form item for external calls"
33+
}
34+
},
2435
"clearValidate": {
2536
"defaultValue": null,
2637
"name": "clearValidate",
@@ -57,18 +68,6 @@
5768
"resetType": "(bindId?: string | string[]) => void"
5869
}
5970
},
60-
"setValue": {
61-
"defaultValue": null,
62-
"name": "setValue",
63-
"type": {
64-
"name": "(bindId: any, value: any) => void"
65-
},
66-
"tags": {
67-
"description": "Set form item value",
68-
"localKey": "API.form.setValue.desc",
69-
"param": "bindId"
70-
}
71-
},
7271
"setError": {
7372
"defaultValue": null,
7473
"name": "setError",
@@ -86,7 +85,7 @@
8685
"defaultValue": null,
8786
"name": "validate",
8887
"type": {
89-
"name": "() => Promise<unknown>"
88+
"name": "(bindId?: string | string[] | undefined) => Promise<unknown>"
9089
},
9190
"tags": {
9291
"localKey": "API.form.share.validate.desc",

docs/api/apiChildJSON/docs_api_apiDocs_contextProps.json

+10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
{
2+
"model": {
3+
"defaultValue": null,
4+
"name": "model",
5+
"type": {
6+
"name": "Record<string, any>"
7+
},
8+
"tags": {
9+
"description": "form model"
10+
}
11+
},
212
"mounted": {
313
"defaultValue": null,
414
"name": "mounted",

docs/api/apiChildJSON/docs_api_apiDocs_renderConfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
"defaultValue": null,
207207
"name": "contextProps",
208208
"type": {
209-
"name": "ContextProps"
209+
"name": "ContextProps<Record<string, any>>"
210210
},
211211
"tags": {
212212
"localKey": "API.form.global.props.form.share.contextProps",

docs/api/apiDocs/useSubscribe.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @order 10
3+
* @name useSubscribe
4+
* @pageTitle useSubscribe
5+
* @toc false
6+
* @groupOrder 10
7+
* @embed /defaultContent/_useSubscribe.md
8+
*/
9+
export default function App(props: {}) {}

docs/api/apiDocs/useWatch.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @order 10
3+
* @name useWatch
4+
* @pageTitle useWatch
5+
* @toc false
6+
* @groupOrder 9
7+
* @embed /defaultContent/_useWatch.md
8+
*/
9+
export default function App(props: {}) {}

docs/api/defaultContent/_useFormStart.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default function App() {
1111
setValues,
1212
useSubscribe,
1313
useWatch,
14+
watch,
1415
validate,
1516
reset,
1617
removeValidator,
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
```jsx | pure
2+
import { useForm, useSubscribe } from 'react-form-simple';
3+
4+
export default function App() {
5+
const { contextProps } = useForm({ name: 'name' });
6+
const subscribeName = useSubscribe(contextProps, ({ model }) => model.name);
7+
}
8+
```

docs/api/defaultContent/_useWatch.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
```jsx | pure
2+
import { useForm, useWatch } from 'react-form-simple';
3+
4+
export default function App() {
5+
const { model, contextProps } = useForm({ name: 'name' });
6+
7+
useWatch(
8+
contextProps,
9+
({ model }) => model.name,
10+
(value, preValue) => {},
11+
);
12+
}
13+
```

docs/api/formItemProps.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ group:
5858
### fullWidth
5959
<APIWrap apiInstance="{&quot;defaultValue&quot;:{&quot;value&quot;:&quot;false&quot;},&quot;name&quot;:&quot;fullWidth&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;boolean&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.global.props.form.share.fullWidth&quot;,&quot;description&quot;:&quot;Whether the width of the form item fills the entire row&quot;}}" ></APIWrap>
6060
### contextProps
61-
<APIWrap apiInstance="{&quot;defaultValue&quot;:null,&quot;name&quot;:&quot;contextProps&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;ContextProps&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.global.props.form.share.contextProps&quot;,&quot;resetType&quot;:&quot;ContextProps&quot;,&quot;infoTitle&quot;:&quot;prop&quot;,&quot;infoPath&quot;:&quot;docs_api_apiDocs_contextProps&quot;,&quot;description&quot;:&quot;Form item option life cycle. Where dependencies are collected for the entire form&quot;}}" ></APIWrap>
61+
<APIWrap apiInstance="{&quot;defaultValue&quot;:null,&quot;name&quot;:&quot;contextProps&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;ContextProps<Record<string, any>>&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.global.props.form.share.contextProps&quot;,&quot;resetType&quot;:&quot;ContextProps&quot;,&quot;infoTitle&quot;:&quot;prop&quot;,&quot;infoPath&quot;:&quot;docs_api_apiDocs_contextProps&quot;,&quot;description&quot;:&quot;Form item option life cycle. Where dependencies are collected for the entire form&quot;}}" ></APIWrap>
6262
### readOnly
6363
<APIWrap apiInstance="{&quot;defaultValue&quot;:{&quot;value&quot;:&quot;false&quot;},&quot;name&quot;:&quot;readOnly&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;boolean&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.global.props.form.share.readOnly&quot;,&quot;description&quot;:&quot;Whether the form item is read-only will pass this property to the form item's rendering control&quot;}}" ></APIWrap>
6464
### readOnlyText

docs/api/formItemProps.zh-CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ group:
5858
### fullWidth
5959
<APIWrap apiInstance="{&quot;defaultValue&quot;:{&quot;value&quot;:&quot;false&quot;},&quot;name&quot;:&quot;fullWidth&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;boolean&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.global.props.form.share.fullWidth&quot;,&quot;description&quot;:&quot;Whether the width of the form item fills the entire row&quot;}}" ></APIWrap>
6060
### contextProps
61-
<APIWrap apiInstance="{&quot;defaultValue&quot;:null,&quot;name&quot;:&quot;contextProps&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;ContextProps&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.global.props.form.share.contextProps&quot;,&quot;resetType&quot;:&quot;ContextProps&quot;,&quot;infoTitle&quot;:&quot;prop&quot;,&quot;infoPath&quot;:&quot;docs_api_apiDocs_contextProps&quot;,&quot;description&quot;:&quot;Form item option life cycle. Where dependencies are collected for the entire form&quot;}}" ></APIWrap>
61+
<APIWrap apiInstance="{&quot;defaultValue&quot;:null,&quot;name&quot;:&quot;contextProps&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;ContextProps<Record<string, any>>&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.global.props.form.share.contextProps&quot;,&quot;resetType&quot;:&quot;ContextProps&quot;,&quot;infoTitle&quot;:&quot;prop&quot;,&quot;infoPath&quot;:&quot;docs_api_apiDocs_contextProps&quot;,&quot;description&quot;:&quot;Form item option life cycle. Where dependencies are collected for the entire form&quot;}}" ></APIWrap>
6262
### readOnly
6363
<APIWrap apiInstance="{&quot;defaultValue&quot;:{&quot;value&quot;:&quot;false&quot;},&quot;name&quot;:&quot;readOnly&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;boolean&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.global.props.form.share.readOnly&quot;,&quot;description&quot;:&quot;Whether the form item is read-only will pass this property to the form item's rendering control&quot;}}" ></APIWrap>
6464
### readOnlyText

docs/api/formMethods.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ group:
2626
### setError
2727
<APIWrap apiInstance="{&quot;defaultValue&quot;:null,&quot;name&quot;:&quot;setError&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;(bindId: any, message?: ReactNode) => void&quot;},&quot;tags&quot;:{&quot;description&quot;:&quot;Manually calling to set the error message will not trigger the onError event&quot;,&quot;localKey&quot;:&quot;API.formItem.setError.desc&quot;,&quot;version&quot;:&quot;1.3.0&quot;,&quot;resetType&quot;:&quot;(bindId: string | string[], message?: React.ReactNode) => void&quot;}}" ></APIWrap>
2828
### validate
29-
<APIWrap apiInstance="{&quot;defaultValue&quot;:null,&quot;name&quot;:&quot;validate&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;() => Promise<unknown>&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.share.validate.desc&quot;,&quot;description&quot;:&quot;Form validation.&quot;}}" ></APIWrap>
29+
<APIWrap apiInstance="{&quot;defaultValue&quot;:null,&quot;name&quot;:&quot;validate&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;(bindId?: string | string[] | undefined) => Promise<unknown>&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.share.validate.desc&quot;,&quot;description&quot;:&quot;Form validation.&quot;}}" ></APIWrap>
3030
### reset
3131
<APIWrap apiInstance="{&quot;defaultValue&quot;:null,&quot;name&quot;:&quot;reset&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;() => void&quot;},&quot;tags&quot;:{&quot;description&quot;:&quot;Reset the form.&quot;,&quot;localKey&quot;:&quot;API.form.share.reset.desc&quot;}}" ></APIWrap>

docs/api/formMethods.zh-CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ group:
2626
### setError
2727
<APIWrap apiInstance="{&quot;defaultValue&quot;:null,&quot;name&quot;:&quot;setError&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;(bindId: any, message?: ReactNode) => void&quot;},&quot;tags&quot;:{&quot;description&quot;:&quot;Manually calling to set the error message will not trigger the onError event&quot;,&quot;localKey&quot;:&quot;API.formItem.setError.desc&quot;,&quot;version&quot;:&quot;1.3.0&quot;,&quot;resetType&quot;:&quot;(bindId: string | string[], message?: React.ReactNode) => void&quot;}}" ></APIWrap>
2828
### validate
29-
<APIWrap apiInstance="{&quot;defaultValue&quot;:null,&quot;name&quot;:&quot;validate&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;() => Promise<unknown>&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.share.validate.desc&quot;,&quot;description&quot;:&quot;Form validation.&quot;}}" ></APIWrap>
29+
<APIWrap apiInstance="{&quot;defaultValue&quot;:null,&quot;name&quot;:&quot;validate&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;(bindId?: string | string[] | undefined) => Promise<unknown>&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.share.validate.desc&quot;,&quot;description&quot;:&quot;Form validation.&quot;}}" ></APIWrap>
3030
### reset
3131
<APIWrap apiInstance="{&quot;defaultValue&quot;:null,&quot;name&quot;:&quot;reset&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;() => void&quot;},&quot;tags&quot;:{&quot;description&quot;:&quot;Reset the form.&quot;,&quot;localKey&quot;:&quot;API.form.share.reset.desc&quot;}}" ></APIWrap>

docs/api/formProps.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ group:
4040
### fullWidth
4141
<APIWrap apiInstance="{&quot;defaultValue&quot;:{&quot;value&quot;:&quot;false&quot;},&quot;name&quot;:&quot;fullWidth&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;boolean&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.global.props.form.share.fullWidth&quot;,&quot;description&quot;:&quot;Whether the width of the form item fills the entire row&quot;}}" ></APIWrap>
4242
### contextProps
43-
<APIWrap apiInstance="{&quot;defaultValue&quot;:null,&quot;name&quot;:&quot;contextProps&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;ContextProps&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.global.props.form.share.contextProps&quot;,&quot;resetType&quot;:&quot;ContextProps&quot;,&quot;infoTitle&quot;:&quot;prop&quot;,&quot;infoPath&quot;:&quot;docs_api_apiDocs_contextProps&quot;,&quot;description&quot;:&quot;Form item option life cycle. Where dependencies are collected for the entire form&quot;}}" ></APIWrap>
43+
<APIWrap apiInstance="{&quot;defaultValue&quot;:null,&quot;name&quot;:&quot;contextProps&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;ContextProps<Record<string, any>>&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.global.props.form.share.contextProps&quot;,&quot;resetType&quot;:&quot;ContextProps&quot;,&quot;infoTitle&quot;:&quot;prop&quot;,&quot;infoPath&quot;:&quot;docs_api_apiDocs_contextProps&quot;,&quot;description&quot;:&quot;Form item option life cycle. Where dependencies are collected for the entire form&quot;}}" ></APIWrap>
4444
### readOnly
4545
<APIWrap apiInstance="{&quot;defaultValue&quot;:{&quot;value&quot;:&quot;false&quot;},&quot;name&quot;:&quot;readOnly&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;boolean&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.global.props.form.share.readOnly&quot;,&quot;description&quot;:&quot;Whether the form item is read-only will pass this property to the form item's rendering control&quot;}}" ></APIWrap>
4646
### readOnlyText

docs/api/formProps.zh-CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ group:
4040
### fullWidth
4141
<APIWrap apiInstance="{&quot;defaultValue&quot;:{&quot;value&quot;:&quot;false&quot;},&quot;name&quot;:&quot;fullWidth&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;boolean&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.global.props.form.share.fullWidth&quot;,&quot;description&quot;:&quot;Whether the width of the form item fills the entire row&quot;}}" ></APIWrap>
4242
### contextProps
43-
<APIWrap apiInstance="{&quot;defaultValue&quot;:null,&quot;name&quot;:&quot;contextProps&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;ContextProps&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.global.props.form.share.contextProps&quot;,&quot;resetType&quot;:&quot;ContextProps&quot;,&quot;infoTitle&quot;:&quot;prop&quot;,&quot;infoPath&quot;:&quot;docs_api_apiDocs_contextProps&quot;,&quot;description&quot;:&quot;Form item option life cycle. Where dependencies are collected for the entire form&quot;}}" ></APIWrap>
43+
<APIWrap apiInstance="{&quot;defaultValue&quot;:null,&quot;name&quot;:&quot;contextProps&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;ContextProps<Record<string, any>>&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.global.props.form.share.contextProps&quot;,&quot;resetType&quot;:&quot;ContextProps&quot;,&quot;infoTitle&quot;:&quot;prop&quot;,&quot;infoPath&quot;:&quot;docs_api_apiDocs_contextProps&quot;,&quot;description&quot;:&quot;Form item option life cycle. Where dependencies are collected for the entire form&quot;}}" ></APIWrap>
4444
### readOnly
4545
<APIWrap apiInstance="{&quot;defaultValue&quot;:{&quot;value&quot;:&quot;false&quot;},&quot;name&quot;:&quot;readOnly&quot;,&quot;type&quot;:{&quot;name&quot;:&quot;boolean&quot;},&quot;tags&quot;:{&quot;localKey&quot;:&quot;API.form.global.props.form.share.readOnly&quot;,&quot;description&quot;:&quot;Whether the form item is read-only will pass this property to the form item's rendering control&quot;}}" ></APIWrap>
4646
### readOnlyText

0 commit comments

Comments
 (0)