@vxe-ui/plugin-render-element 3.0.0
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/LICENSE +21 -0
- package/README.md +154 -0
- package/dist/all.common.js +1136 -0
- package/dist/form/index.js +411 -0
- package/dist/index.common.js +72 -0
- package/dist/index.js +72 -0
- package/dist/index.umd.js +1288 -0
- package/dist/index.umd.min.js +1 -0
- package/dist/style.css +54 -0
- package/dist/style.min.css +1 -0
- package/dist/table/index.js +649 -0
- package/package.json +73 -0
- package/src/form/index.ts +406 -0
- package/src/index.ts +76 -0
- package/src/table/index.ts +627 -0
- package/types/index.d.ts +12 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Xu Liangzhan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# @vxe-ui/plugin-render-element
|
|
2
|
+
|
|
3
|
+
[Vxe UI](https://vxeui.com/) plug-in for compatibility with the [element-ui](https://www.npmjs.com/package/element-ui) component.
|
|
4
|
+
|
|
5
|
+
## Compatibility
|
|
6
|
+
|
|
7
|
+
It corresponds to [vxe-table v3](https://www.npmjs.com/package/vxe-table) or [vxe-pc-ui v3](https://www.npmjs.com/package/vxe-pc-ui)
|
|
8
|
+
|
|
9
|
+
## Installing
|
|
10
|
+
|
|
11
|
+
```shell
|
|
12
|
+
npm install @vxe-ui/plugin-render-element
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
// ...
|
|
17
|
+
// Use vxe-pc-ui
|
|
18
|
+
import { VxeUI } from 'vxe-pc-ui'
|
|
19
|
+
// Use vxe-table
|
|
20
|
+
// import { VxeUI } from 'vxe-table'
|
|
21
|
+
import VxeUIPluginRenderElement from '@vxe-ui/plugin-render-element'
|
|
22
|
+
import '@vxe-ui/plugin-render-element/dist/style.css'
|
|
23
|
+
// ...
|
|
24
|
+
|
|
25
|
+
VxeUI.use(VxeUIPluginRenderElement)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## API
|
|
29
|
+
|
|
30
|
+
### cell-render 默认的渲染配置项说明
|
|
31
|
+
|
|
32
|
+
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
|
|
33
|
+
|------|------|-----|-----|-----|
|
|
34
|
+
| name | 支持的渲染组件 | String | ElInput, ElAutocomplete, ElInputNumber, ElSwitch, ElRate, ElSlider, ElButton, ElButtons | — |
|
|
35
|
+
| attrs | 渲染组件附加属性,参数请查看被渲染的 Component attrs | Object | — | {} |
|
|
36
|
+
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object | — | {} |
|
|
37
|
+
| options | 只对 name=ElSelect 有效,下拉组件选项列表 | Array | — | [] |
|
|
38
|
+
| optionProps | 只对 name=ElSelect 有效,下拉组件选项属性参数配置 | Object | — | { value: 'value', label: 'label' } |
|
|
39
|
+
| optionGroups | 只对 name=ElSelect 有效,下拉组件分组选项列表 | Array | — | [] |
|
|
40
|
+
| optionGroupProps | 只对 name=ElSelect 有效,下拉组件分组选项属性参数配置 | Object | — | { options: 'options', label: 'label' } |
|
|
41
|
+
| events | 渲染组件附加事件,参数为 ( {row,rowIndex,column,columnIndex}, ...Component arguments ) | Object | — | — |
|
|
42
|
+
|
|
43
|
+
### edit-render 可编辑渲染器配置项说明
|
|
44
|
+
|
|
45
|
+
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
|
|
46
|
+
|------|------|-----|-----|-----|
|
|
47
|
+
| name | 支持的渲染组件 | String | ElInput, ElAutocomplete, ElInputNumber, ElSelect, ElCascader, ElTimeSelect, ElTimePicker, ElDatePicker, ElSwitch, ElRate, ElSlider, ElButton, ElButtons | — |
|
|
48
|
+
| attrs | 渲染组件附加属性,参数请查看被渲染的 Component attrs | Object | — | {} |
|
|
49
|
+
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object | — | {} |
|
|
50
|
+
| options | 只对 name=ElSelect 有效,下拉组件选项列表 | Array | — | [] |
|
|
51
|
+
| optionProps | 只对 name=ElSelect 有效,下拉组件选项属性参数配置 | Object | — | { value: 'value', label: 'label' } |
|
|
52
|
+
| optionGroups | 只对 name=ElSelect 有效,下拉组件分组选项列表 | Array | — | [] |
|
|
53
|
+
| optionGroupProps | 只对 name=ElSelect 有效,下拉组件分组选项属性参数配置 | Object | — | { options: 'options', label: 'label' } |
|
|
54
|
+
| events | 渲染组件附加事件,参数为 ( {row,rowIndex,column,columnIndex}, ...Component arguments ) | Object | — | — |
|
|
55
|
+
|
|
56
|
+
### filter-render 筛选渲染器配置项说明
|
|
57
|
+
|
|
58
|
+
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
|
|
59
|
+
|------|------|-----|-----|-----|
|
|
60
|
+
| name | 支持的渲染组件 | String | ElInput, ElInputNumber, ElAutocomplete, ElSelect, ElDatePicker, ElSwitch, ElRate, ElSlider | — |
|
|
61
|
+
| attrs | 渲染组件附加属性,参数请查看被渲染的 Component attrs | Object | — | {} |
|
|
62
|
+
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object | — | {} |
|
|
63
|
+
| options | 只对 name=ElSelect 有效,下拉组件选项列表 | Array | — | [] |
|
|
64
|
+
| optionProps | 只对 name=ElSelect 有效,下拉组件选项属性参数配置 | Object | — | { value: 'value', label: 'label' } |
|
|
65
|
+
| optionGroups | 只对 name=ElSelect 有效,下拉组件分组选项列表 | Array | — | [] |
|
|
66
|
+
| optionGroupProps | 只对 name=ElSelect 有效,下拉组件分组选项属性参数配置 | Object | — | { options: 'options', label: 'label' } |
|
|
67
|
+
| events | 渲染组件附加事件,参数为 ( {}, ...Component arguments ) | Object | — | — |
|
|
68
|
+
|
|
69
|
+
### item-render 表单-项渲染器配置项说明
|
|
70
|
+
|
|
71
|
+
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
|
|
72
|
+
|------|------|-----|-----|-----|
|
|
73
|
+
| name | 支持的渲染组件 | String | ElInput, ElInputNumber, ElAutocomplete, ElSelect, ElDatePicker, ElSwitch, ElRate, ElSlider, ElRadio, ElCheckbox, ElButton, ElButtons | — |
|
|
74
|
+
| attrs | 渲染组件附加属性,参数请查看被渲染的 Component attrs | Object | — | {} |
|
|
75
|
+
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object | — | {} |
|
|
76
|
+
| options | 只对 name=ElSelect 有效,下拉组件选项列表 | Array | — | [] |
|
|
77
|
+
| optionProps | 只对 name=ElSelect 有效,下拉组件选项属性参数配置 | Object | — | { value: 'value', label: 'label' } |
|
|
78
|
+
| optionGroups | 只对 name=ElSelect 有效,下拉组件分组选项列表 | Array | — | [] |
|
|
79
|
+
| optionGroupProps | 只对 name=ElSelect 有效,下拉组件分组选项属性参数配置 | Object | — | { options: 'options', label: 'label' } |
|
|
80
|
+
| events | 渲染组件附加事件,参数为 ( {}, ...Component arguments ) | Object | — | — |
|
|
81
|
+
|
|
82
|
+
### 表单设计器配置项
|
|
83
|
+
|
|
84
|
+
| 描述 |
|
|
85
|
+
|------|
|
|
86
|
+
| 'ElInputWidget', 'ElTextareaWidget', 'ElNumberInputWidget', 'ElDatePickerWidget', 'ElSelectWidget', 'ElRadioWidget', 'ElCheckboxWidget', 'ElSwitchWidget' |
|
|
87
|
+
|
|
88
|
+
## Cell demo
|
|
89
|
+
|
|
90
|
+
```html
|
|
91
|
+
<vxe-table
|
|
92
|
+
height="600"
|
|
93
|
+
:data="tableData"
|
|
94
|
+
:edit-config="{trigger: 'click', mode: 'cell'}">
|
|
95
|
+
<vxe-column field="name" title="Name" :edit-render="{name: 'ElInput'}"></vxe-column>
|
|
96
|
+
<vxe-column field="age" title="Age" :edit-render="{name: 'ElInputNumber'}"></vxe-column>
|
|
97
|
+
<vxe-column field="date" title="Date" width="200" :edit-render="{name: 'ElDatePicker'}"></vxe-column>
|
|
98
|
+
</vxe-table>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```javascript
|
|
102
|
+
export default {
|
|
103
|
+
data () {
|
|
104
|
+
return {
|
|
105
|
+
tableData: [
|
|
106
|
+
{ id: 100, name: 'test0', age: 28, sex: '1', date: '' },
|
|
107
|
+
{ id: 101, name: 'test1', age: 32, sex: '0', date: '' },
|
|
108
|
+
{ id: 102, name: 'test2', age: 36, sex: '1', date: '' }
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Filter demo
|
|
116
|
+
|
|
117
|
+
```html
|
|
118
|
+
<vxe-table
|
|
119
|
+
height="600"
|
|
120
|
+
:data="tableData">
|
|
121
|
+
<vxe-column field="name" title="Name":filters="nameOptions" :filter-render="{name: 'ElInput'}"></vxe-column>
|
|
122
|
+
<vxe-column field="age" title="Age"></vxe-column>
|
|
123
|
+
<vxe-column field="date" title="Date" ></vxe-column>
|
|
124
|
+
</vxe-table>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```javascript
|
|
128
|
+
import { defineComponent } from 'vue'
|
|
129
|
+
|
|
130
|
+
export default defineComponent({
|
|
131
|
+
setup () {
|
|
132
|
+
return {
|
|
133
|
+
nameOptions: [
|
|
134
|
+
{ data: '' }
|
|
135
|
+
],
|
|
136
|
+
tableData: [
|
|
137
|
+
{ id: 100, name: 'test0', age: 28, date: null },
|
|
138
|
+
{ id: 101, name: 'test1', age: 32, date: null },
|
|
139
|
+
{ id: 102, name: 'test2', age: 36, date: null }
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
})
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Contributors
|
|
147
|
+
|
|
148
|
+
Thank you to everyone who contributed to this project.
|
|
149
|
+
|
|
150
|
+
[](https://github.com/x-extends/vxe-ui-plugins/graphs/contributors)
|
|
151
|
+
|
|
152
|
+
## License
|
|
153
|
+
|
|
154
|
+
[MIT](LICENSE) © 2019-present, Xu Liangzhan
|