@hzab/form-render-mobile 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -6
- package/lib/index.js +1 -46475
- package/package.json +4 -6
- package/src/components/NumberPicker/index.jsx +3 -0
- package/src/components/Select/index.tsx +4 -2
- package/src/components/Uploader/Image/index.less +43 -0
- package/src/components/Uploader/Image/index.tsx +32 -0
- package/src/components/Uploader/index.jsx +1 -2
- package/src/components/Uploader/uploader.jsx +2 -1
- package/src/components/index.ts +1 -2
- package/src/index.tsx +12 -10
- package/src/type.d.ts +22 -1
- package/lib/static/imgs/approachPointIcon_f2eb69df51.png +0 -0
- package/lib/static/imgs/layers-2x_8f2c4d1147.png +0 -0
- package/lib/static/imgs/layers_416d91365b.png +0 -0
- package/lib/static/imgs/marker-icon_2b3e1faf89.png +0 -0
- package/src/components/MapPicker/common/approachPointIcon.png +0 -0
- package/src/components/MapPicker/common/getCurrentPosition.js +0 -27
- package/src/components/MapPicker/common/gpsConvert.js +0 -236
- package/src/components/MapPicker/common/map-config.js +0 -7
- package/src/components/MapPicker/index.jsx +0 -82
- package/src/components/MapPicker/line-picker/car-route.json +0 -426
- package/src/components/MapPicker/line-picker/index.jsx +0 -188
- package/src/components/MapPicker/line-picker/index.less +0 -41
- package/src/components/MapPicker/line-picker/mockLonLat.js +0 -1
- package/src/components/MapPicker/location-picker/index.jsx +0 -104
- package/src/components/MapPicker/location-picker/index.less +0 -36
package/README.md
CHANGED
|
@@ -9,19 +9,47 @@
|
|
|
9
9
|
## 示例
|
|
10
10
|
|
|
11
11
|
```jsx
|
|
12
|
+
import { useRef } from "react";
|
|
12
13
|
import FormRender from "@hzab/form-render-mobile";
|
|
13
|
-
import Schema from './test.schema.json'
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
import Schema from "./test.schema.json";
|
|
16
|
+
|
|
17
|
+
export default () => {
|
|
18
|
+
const formRef = useRef({
|
|
19
|
+
formRender: Object,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
function onClick() {
|
|
23
|
+
console.log(JSON.stringify(formRef?.current?.formRender.values));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div>
|
|
28
|
+
<FormRender ref={formRef} schema={Schema} initialValues={ipt:'xxxxssss'} />
|
|
29
|
+
<button onClick={onClick}>提交</button>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
16
33
|
```
|
|
17
34
|
|
|
18
35
|
## API
|
|
19
36
|
|
|
20
37
|
### InfoPanel Attributes
|
|
21
38
|
|
|
22
|
-
| 参数
|
|
23
|
-
|
|
|
24
|
-
| schema
|
|
39
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
40
|
+
| ------------- | --------------------- | ---- | ------ | ----------------------------- | --- |
|
|
41
|
+
| schema | Object | 是 | - | 数据信息的 schema | |
|
|
42
|
+
| className | string | 否 | - | 元素类名 | |
|
|
43
|
+
| initialValues | Object | 否 | - | 表单初始值 | |
|
|
44
|
+
| schemaScope | Object | 否 | - | formily scope 自定义数据 | |
|
|
45
|
+
| components | SchemaReactComponents | 否 | - | formily 自定义组件 | |
|
|
46
|
+
| readOnly | boolean | 否 | - | 是否只读 | |
|
|
47
|
+
| disabled | boolean | 否 | - | 是否禁用 | |
|
|
48
|
+
| formOptions | Object | 否 | - | createForm 配置项 | |
|
|
49
|
+
| hasSubmit | boolean | 否 | - | 是否有提交按钮 | |
|
|
50
|
+
| onSubmit | Function | 否 | - | 提交事件 (values): void | |
|
|
51
|
+
| init | Function | 否 | - | 组件初始化 (form): void | |
|
|
52
|
+
| footerRender | Function | 否 | - | 底部渲染插槽 (): ReactElement | |
|
|
25
53
|
|
|
26
54
|
# 组件开发流程
|
|
27
55
|
|
|
@@ -39,7 +67,8 @@ import Schema from './test.schema.json'
|
|
|
39
67
|
## 命令
|
|
40
68
|
|
|
41
69
|
- Mac 执行该命令,设置 pre-commit 为可执行文件
|
|
42
|
-
|
|
70
|
+
|
|
71
|
+
- npm run mac-chmod
|
|
43
72
|
- chmod +x .husky && chmod +x .husky/pre-commit
|
|
44
73
|
|
|
45
74
|
- 生成文档:npm run docs
|