@hzab/form-render 1.7.16 → 1.7.18
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/CHANGELOG.md +9 -1
- package/README.md +62 -3
- package/docs/README.md +21 -0
- package/docs/components/ArrayCards.md +68 -0
- package/docs/components/ArrayTable.md +111 -0
- package/docs/components/CheckboxWithTip.md +43 -0
- package/docs/components/DatePicker.md +54 -0
- package/docs/components/LocationListPicker.md +41 -0
- package/docs/components/LocationPicker.md +67 -0
- package/docs/components/PersonnelSelect.md +77 -0
- package/docs/components/RadioGroupWithTip.md +43 -0
- package/docs/components/RichEditor.md +94 -0
- package/docs/components/Text.md +26 -0
- package/docs/components/TreeCheckbox.md +52 -0
- package/{src/components/Upload/README.md → docs/components/Upload.md} +14 -1
- package/docs/components/UserSelect.md +59 -0
- package/package.json +11 -2
- package/src/components/LocationListPicker/index.tsx +1 -1
- package/src/components/LocationPicker/Map/AMap/common/loader.ts +2 -3
- package/src/components/Upload/common/handleIOFileList.ts +4 -40
- package/src/components/Upload/common/utils.js +3 -2
- package/src/components/Upload/uploader-input.jsx +1 -2
- package/src/components/Upload/uploader.jsx +71 -6
- package/src/components/LocationPicker/README.md +0 -44
- package/src/components/RichEditor/README.md +0 -82
- package/src/components/TreeCheckbox/README.md +0 -11
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
## PC使用前安装依赖
|
|
2
|
-
|
|
3
|
-
npm install @wangeditor/editor-for-react
|
|
4
|
-
|
|
5
|
-
## 引入
|
|
6
|
-
|
|
7
|
-
```jsx
|
|
8
|
-
import wangEditor from "./wangEditor";
|
|
9
|
-
|
|
10
|
-
export default function AMap(props) {
|
|
11
|
-
return <wangEditor ref={editorRef}></wangEditor>;
|
|
12
|
-
}
|
|
13
|
-
```
|
|
14
|
-
向富文本内set内容
|
|
15
|
-
editorRef.current.setEditorContent(HtmlString)
|
|
16
|
-
|
|
17
|
-
获取富文本当前内容
|
|
18
|
-
editorRef.current.getEditorContent()
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
### InfoPanel Attributes
|
|
22
|
-
|
|
23
|
-
| 参数 | 类型 | 必填 | 默认值 |
|
|
24
|
-
| ------------------ | ---------------------- | ---- | --------- |
|
|
25
|
-
| toolbarConfig | Partial<IToolbarConfig> | 否 | {} |
|
|
26
|
-
| editorConfig | Partial<IEditorConfig> | 否 | { placeholder: '请输入内容...' } |
|
|
27
|
-
|
|
28
|
-
图片上传的配置
|
|
29
|
-
```jsx
|
|
30
|
-
editorConfig = {
|
|
31
|
-
MENU_CONF{
|
|
32
|
-
uploadImage:{
|
|
33
|
-
|
|
34
|
-
server: '/api/upload',
|
|
35
|
-
|
|
36
|
-
// form-data fieldName ,默认值 'wangeditor-uploaded-image'
|
|
37
|
-
fieldName: 'your-custom-name',
|
|
38
|
-
|
|
39
|
-
// 单个文件的最大体积限制,默认为 2M
|
|
40
|
-
maxFileSize: 1 * 1024 * 1024, // 1M
|
|
41
|
-
|
|
42
|
-
// 最多可上传几个文件,默认为 100
|
|
43
|
-
maxNumberOfFiles: 10,
|
|
44
|
-
|
|
45
|
-
// 选择文件时的类型限制,默认为 ['image/*'] 。如不想限制,则设置为 []
|
|
46
|
-
allowedFileTypes: ['image/*'],
|
|
47
|
-
|
|
48
|
-
// 自定义上传参数,例如传递验证的 token 等。参数会被添加到 formData 中,一起上传到服务端。
|
|
49
|
-
meta: {
|
|
50
|
-
token: 'xxx',
|
|
51
|
-
otherKey: 'yyy'
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
// 将 meta 拼接到 url 参数中,默认 false
|
|
55
|
-
metaWithUrl: false,
|
|
56
|
-
|
|
57
|
-
// 自定义增加 http header
|
|
58
|
-
headers: {
|
|
59
|
-
Accept: 'text/x-json',
|
|
60
|
-
otherKey: 'xxx'
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
// 跨域是否传递 cookie ,默认为 false
|
|
64
|
-
withCredentials: true,
|
|
65
|
-
|
|
66
|
-
// 超时时间,默认为 10 秒
|
|
67
|
-
timeout: 5 * 1000, // 5 秒
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## 移动端使用前安装依赖
|
|
74
|
-
npm install lib-flexible
|
|
75
|
-
|
|
76
|
-
```jsx
|
|
77
|
-
import wangEditor from "./wangEditor/handleMobile";
|
|
78
|
-
|
|
79
|
-
export default function AMap(props) {
|
|
80
|
-
return <HandleMobile content={HtmlString}></HandleMobile>;
|
|
81
|
-
}
|
|
82
|
-
```
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
### InfoPanel Attributes
|
|
2
|
-
|
|
3
|
-
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
4
|
-
| ------------- | ------- | ---- | -------------------------------------------------- | --------------------------------------------- |
|
|
5
|
-
| dataSource | Array | 是 | - | 树数据 |
|
|
6
|
-
| mergeFullLeaf | boolean | 否 | true | 合并不存在 children 的层级 |
|
|
7
|
-
| mergeLeaf | boolean | 否 | true | 合并每一层级的叶子节点 |
|
|
8
|
-
| fieldNames | Object | 否 | { label: label, value: value, children: children } | 自定义 options 中 label value children 的字段 |
|
|
9
|
-
| disabled | boolean | 否 | false | 禁用状态 |
|
|
10
|
-
| readOnly | boolean | 否 | false | 只读状态 |
|
|
11
|
-
| tabBox | boolean | 否 | false | 最外层使用 tab |
|