@vxe-ui/plugin-render-element 4.3.1 → 4.4.1
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 +20 -20
- package/README.md +176 -176
- package/dist/index.umd.js +56 -17
- package/dist/index.umd.min.js +1 -1
- package/es/index.esm.js +3 -3
- package/es/index.js +3 -3
- package/es/table/index.js +35 -6
- package/lib/index.common.js +3 -3
- package/lib/index.js +3 -3
- package/lib/index.umd.js +56 -17
- package/lib/index.umd.min.js +1 -1
- package/lib/table/index.js +48 -9
- package/package.json +77 -78
- package/src/form/index.ts +326 -326
- package/src/form-design/checkbox-widget.ts +167 -167
- package/src/form-design/date-picker-widget.ts +144 -144
- package/src/form-design/index.ts +101 -101
- package/src/form-design/input-widget.ts +145 -145
- package/src/form-design/number-input-widget.ts +144 -144
- package/src/form-design/radio-widget.ts +167 -167
- package/src/form-design/select-widget.ts +166 -166
- package/src/form-design/switch-widget.ts +140 -140
- package/src/form-design/textarea-widget.ts +149 -149
- package/src/form-design/use.ts +255 -255
- package/src/index.ts +124 -124
- package/src/store/index.ts +5 -5
- package/src/table/index.ts +759 -729
- package/src/util/comp.ts +21 -21
- package/types/index.d.ts +19 -19
package/LICENSE
CHANGED
|
@@ -1,21 +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
|
|
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
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,176 +1,176 @@
|
|
|
1
|
-
# @vxe-ui/plugin-render-element
|
|
2
|
-
|
|
3
|
-
[Vxe UI](https://vxeui.com/) plug-in for compatibility with the [element-plus](https://www.npmjs.com/package/element-plus) component.
|
|
4
|
-
|
|
5
|
-
## Compatibility
|
|
6
|
-
|
|
7
|
-
It corresponds to [vxe-table v4](https://www.npmjs.com/package/vxe-table) or [vxe-pc-ui v4](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
|
-
// VxeUI.use(VxeUIPluginRenderElement, {
|
|
27
|
-
// ElementPlus,
|
|
28
|
-
// prefixCls: 'el'
|
|
29
|
-
// })
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Import on-demand
|
|
33
|
-
|
|
34
|
-
```javascript
|
|
35
|
-
// ...
|
|
36
|
-
import VxeUIPluginRenderElement from '@vxe-ui/plugin-render-element'
|
|
37
|
-
// ...
|
|
38
|
-
|
|
39
|
-
// If it is not a global installation, then a single import is required.
|
|
40
|
-
import { ElInput, ElInputNumber, ElSelect } from 'element-plus'
|
|
41
|
-
// ...
|
|
42
|
-
VxeUIPluginRenderElement.component(ElInput)
|
|
43
|
-
VxeUIPluginRenderElement.component(ElInputNumber)
|
|
44
|
-
VxeUIPluginRenderElement.component(ElSelect)
|
|
45
|
-
// ...
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## API
|
|
49
|
-
|
|
50
|
-
### cell-render 默认的渲染配置项说明
|
|
51
|
-
|
|
52
|
-
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
|
|
53
|
-
|------|------|-----|-----|-----|
|
|
54
|
-
| name | 支持的渲染组件 | String | ElInput, ElAutocomplete, ElInputNumber, ElSwitch, ElRate, ElSlider, ElButton, ElButtons | — |
|
|
55
|
-
| attrs | 渲染组件附加属性,参数请查看被渲染的 Component attrs | Object | — | {} |
|
|
56
|
-
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object | — | {} |
|
|
57
|
-
| options | 只对 name=ElSelect 有效,下拉组件选项列表 | Array | — | [] |
|
|
58
|
-
| optionProps | 只对 name=ElSelect 有效,下拉组件选项属性参数配置 | Object | — | { value: 'value', label: 'label' } |
|
|
59
|
-
| optionGroups | 只对 name=ElSelect 有效,下拉组件分组选项列表 | Array | — | [] |
|
|
60
|
-
| optionGroupProps | 只对 name=ElSelect 有效,下拉组件分组选项属性参数配置 | Object | — | { options: 'options', label: 'label' } |
|
|
61
|
-
| events | 渲染组件附加事件,参数为 ( {row,rowIndex,column,columnIndex}, ...Component arguments ) | Object | — | — |
|
|
62
|
-
|
|
63
|
-
### edit-render 可编辑渲染器配置项说明
|
|
64
|
-
|
|
65
|
-
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
|
|
66
|
-
|------|------|-----|-----|-----|
|
|
67
|
-
| name | 支持的渲染组件 | String | ElInput, ElAutocomplete, ElInputNumber, ElSelect, ElCascader, ElTimeSelect, ElTimePicker, ElDatePicker, ElSwitch, ElRate, ElSlider, ElButton, ElButtons | — |
|
|
68
|
-
| attrs | 渲染组件附加属性,参数请查看被渲染的 Component attrs | Object | — | {} |
|
|
69
|
-
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object | — | {} |
|
|
70
|
-
| options | 只对 name=ElSelect 有效,下拉组件选项列表 | Array | — | [] |
|
|
71
|
-
| optionProps | 只对 name=ElSelect 有效,下拉组件选项属性参数配置 | Object | — | { value: 'value', label: 'label' } |
|
|
72
|
-
| optionGroups | 只对 name=ElSelect 有效,下拉组件分组选项列表 | Array | — | [] |
|
|
73
|
-
| optionGroupProps | 只对 name=ElSelect 有效,下拉组件分组选项属性参数配置 | Object | — | { options: 'options', label: 'label' } |
|
|
74
|
-
| events | 渲染组件附加事件,参数为 ( {row,rowIndex,column,columnIndex}, ...Component arguments ) | Object | — | — |
|
|
75
|
-
|
|
76
|
-
### filter-render 筛选渲染器配置项说明
|
|
77
|
-
|
|
78
|
-
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
|
|
79
|
-
|------|------|-----|-----|-----|
|
|
80
|
-
| name | 支持的渲染组件 | String | ElInput, ElInputNumber, ElAutocomplete, ElSelect, ElDatePicker, ElSwitch, ElRate, ElSlider | — |
|
|
81
|
-
| attrs | 渲染组件附加属性,参数请查看被渲染的 Component attrs | Object | — | {} |
|
|
82
|
-
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object | — | {} |
|
|
83
|
-
| options | 只对 name=ElSelect 有效,下拉组件选项列表 | Array | — | [] |
|
|
84
|
-
| optionProps | 只对 name=ElSelect 有效,下拉组件选项属性参数配置 | Object | — | { value: 'value', label: 'label' } |
|
|
85
|
-
| optionGroups | 只对 name=ElSelect 有效,下拉组件分组选项列表 | Array | — | [] |
|
|
86
|
-
| optionGroupProps | 只对 name=ElSelect 有效,下拉组件分组选项属性参数配置 | Object | — | { options: 'options', label: 'label' } |
|
|
87
|
-
| events | 渲染组件附加事件,参数为 ( {}, ...Component arguments ) | Object | — | — |
|
|
88
|
-
|
|
89
|
-
### item-render 表单-项渲染器配置项说明
|
|
90
|
-
|
|
91
|
-
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
|
|
92
|
-
|------|------|-----|-----|-----|
|
|
93
|
-
| name | 支持的渲染组件 | String | ElInput, ElInputNumber, ElAutocomplete, ElSelect, ElDatePicker, ElSwitch, ElRate, ElSlider, ElRadio, ElCheckbox, ElButton, ElButtons | — |
|
|
94
|
-
| attrs | 渲染组件附加属性,参数请查看被渲染的 Component attrs | Object | — | {} |
|
|
95
|
-
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object | — | {} |
|
|
96
|
-
| options | 只对 name=ElSelect 有效,下拉组件选项列表 | Array | — | [] |
|
|
97
|
-
| optionProps | 只对 name=ElSelect 有效,下拉组件选项属性参数配置 | Object | — | { value: 'value', label: 'label' } |
|
|
98
|
-
| optionGroups | 只对 name=ElSelect 有效,下拉组件分组选项列表 | Array | — | [] |
|
|
99
|
-
| optionGroupProps | 只对 name=ElSelect 有效,下拉组件分组选项属性参数配置 | Object | — | { options: 'options', label: 'label' } |
|
|
100
|
-
| events | 渲染组件附加事件,参数为 ( {}, ...Component arguments ) | Object | — | — |
|
|
101
|
-
|
|
102
|
-
### 表单设计器配置项
|
|
103
|
-
|
|
104
|
-
| 描述 |
|
|
105
|
-
|------|
|
|
106
|
-
| 'ElInputWidget', 'ElTextareaWidget', 'ElNumberInputWidget', 'ElDatePickerWidget', 'ElSelectWidget', 'ElRadioWidget', 'ElCheckboxWidget', 'ElSwitchWidget' |
|
|
107
|
-
|
|
108
|
-
## Table Cell demo
|
|
109
|
-
|
|
110
|
-
```html
|
|
111
|
-
<template>
|
|
112
|
-
<vxe-table
|
|
113
|
-
height="600"
|
|
114
|
-
:data="tableData"
|
|
115
|
-
:edit-config="{trigger: 'click', mode: 'cell'}">
|
|
116
|
-
<vxe-column field="name" title="Name" :edit-render="{name: 'ElInput'}"></vxe-column>
|
|
117
|
-
<vxe-column field="age" title="Age" :edit-render="{name: 'ElInputNumber'}"></vxe-column>
|
|
118
|
-
<vxe-column field="date" title="Date" width="200" :edit-render="{name: 'ElDatePicker'}"></vxe-column>
|
|
119
|
-
</vxe-table>
|
|
120
|
-
</template>
|
|
121
|
-
|
|
122
|
-
<script>
|
|
123
|
-
export default {
|
|
124
|
-
data () {
|
|
125
|
-
return {
|
|
126
|
-
tableData: [
|
|
127
|
-
{ id: 100, name: 'test0', age: 28, sex: '1', date: '' },
|
|
128
|
-
{ id: 101, name: 'test1', age: 32, sex: '0', date: '' },
|
|
129
|
-
{ id: 102, name: 'test2', age: 36, sex: '1', date: '' }
|
|
130
|
-
]
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
</script>
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
## Table Filter demo
|
|
138
|
-
|
|
139
|
-
```html
|
|
140
|
-
<template>
|
|
141
|
-
<vxe-table
|
|
142
|
-
height="600"
|
|
143
|
-
:data="tableData">
|
|
144
|
-
<vxe-column field="name" title="Name":filters="nameOptions" :filter-render="{name: 'ElInput'}"></vxe-column>
|
|
145
|
-
<vxe-column field="age" title="Age"></vxe-column>
|
|
146
|
-
<vxe-column field="date" title="Date" ></vxe-column>
|
|
147
|
-
</vxe-table>
|
|
148
|
-
</template>
|
|
149
|
-
|
|
150
|
-
<script>
|
|
151
|
-
export default {
|
|
152
|
-
data () {
|
|
153
|
-
return {
|
|
154
|
-
nameOptions: [
|
|
155
|
-
{ data: '' }
|
|
156
|
-
],
|
|
157
|
-
tableData: [
|
|
158
|
-
{ id: 100, name: 'test0', age: 28, date: null },
|
|
159
|
-
{ id: 101, name: 'test1', age: 32, date: null },
|
|
160
|
-
{ id: 102, name: 'test2', age: 36, date: null }
|
|
161
|
-
]
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
</script>
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
## Contributors
|
|
169
|
-
|
|
170
|
-
Thank you to everyone who contributed to this project.
|
|
171
|
-
|
|
172
|
-
[](https://github.com/x-extends/vxe-ui-plugins/graphs/contributors)
|
|
173
|
-
|
|
174
|
-
## License
|
|
175
|
-
|
|
176
|
-
[MIT](LICENSE) © 2019-present, Xu Liangzhan
|
|
1
|
+
# @vxe-ui/plugin-render-element
|
|
2
|
+
|
|
3
|
+
[Vxe UI](https://vxeui.com/) plug-in for compatibility with the [element-plus](https://www.npmjs.com/package/element-plus) component.
|
|
4
|
+
|
|
5
|
+
## Compatibility
|
|
6
|
+
|
|
7
|
+
It corresponds to [vxe-table v4](https://www.npmjs.com/package/vxe-table) or [vxe-pc-ui v4](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
|
+
// VxeUI.use(VxeUIPluginRenderElement, {
|
|
27
|
+
// ElementPlus,
|
|
28
|
+
// prefixCls: 'el'
|
|
29
|
+
// })
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Import on-demand
|
|
33
|
+
|
|
34
|
+
```javascript
|
|
35
|
+
// ...
|
|
36
|
+
import VxeUIPluginRenderElement from '@vxe-ui/plugin-render-element'
|
|
37
|
+
// ...
|
|
38
|
+
|
|
39
|
+
// If it is not a global installation, then a single import is required.
|
|
40
|
+
import { ElInput, ElInputNumber, ElSelect } from 'element-plus'
|
|
41
|
+
// ...
|
|
42
|
+
VxeUIPluginRenderElement.component(ElInput)
|
|
43
|
+
VxeUIPluginRenderElement.component(ElInputNumber)
|
|
44
|
+
VxeUIPluginRenderElement.component(ElSelect)
|
|
45
|
+
// ...
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## API
|
|
49
|
+
|
|
50
|
+
### cell-render 默认的渲染配置项说明
|
|
51
|
+
|
|
52
|
+
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
|
|
53
|
+
|------|------|-----|-----|-----|
|
|
54
|
+
| name | 支持的渲染组件 | String | ElInput, ElAutocomplete, ElInputNumber, ElSwitch, ElRate, ElSlider, ElButton, ElButtons | — |
|
|
55
|
+
| attrs | 渲染组件附加属性,参数请查看被渲染的 Component attrs | Object | — | {} |
|
|
56
|
+
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object | — | {} |
|
|
57
|
+
| options | 只对 name=ElSelect 有效,下拉组件选项列表 | Array | — | [] |
|
|
58
|
+
| optionProps | 只对 name=ElSelect 有效,下拉组件选项属性参数配置 | Object | — | { value: 'value', label: 'label' } |
|
|
59
|
+
| optionGroups | 只对 name=ElSelect 有效,下拉组件分组选项列表 | Array | — | [] |
|
|
60
|
+
| optionGroupProps | 只对 name=ElSelect 有效,下拉组件分组选项属性参数配置 | Object | — | { options: 'options', label: 'label' } |
|
|
61
|
+
| events | 渲染组件附加事件,参数为 ( {row,rowIndex,column,columnIndex}, ...Component arguments ) | Object | — | — |
|
|
62
|
+
|
|
63
|
+
### edit-render 可编辑渲染器配置项说明
|
|
64
|
+
|
|
65
|
+
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
|
|
66
|
+
|------|------|-----|-----|-----|
|
|
67
|
+
| name | 支持的渲染组件 | String | ElInput, ElAutocomplete, ElInputNumber, ElSelect, ElCascader, ElTimeSelect, ElTimePicker, ElDatePicker, ElSwitch, ElRate, ElSlider, ElButton, ElButtons | — |
|
|
68
|
+
| attrs | 渲染组件附加属性,参数请查看被渲染的 Component attrs | Object | — | {} |
|
|
69
|
+
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object | — | {} |
|
|
70
|
+
| options | 只对 name=ElSelect 有效,下拉组件选项列表 | Array | — | [] |
|
|
71
|
+
| optionProps | 只对 name=ElSelect 有效,下拉组件选项属性参数配置 | Object | — | { value: 'value', label: 'label' } |
|
|
72
|
+
| optionGroups | 只对 name=ElSelect 有效,下拉组件分组选项列表 | Array | — | [] |
|
|
73
|
+
| optionGroupProps | 只对 name=ElSelect 有效,下拉组件分组选项属性参数配置 | Object | — | { options: 'options', label: 'label' } |
|
|
74
|
+
| events | 渲染组件附加事件,参数为 ( {row,rowIndex,column,columnIndex}, ...Component arguments ) | Object | — | — |
|
|
75
|
+
|
|
76
|
+
### filter-render 筛选渲染器配置项说明
|
|
77
|
+
|
|
78
|
+
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
|
|
79
|
+
|------|------|-----|-----|-----|
|
|
80
|
+
| name | 支持的渲染组件 | String | ElInput, ElInputNumber, ElAutocomplete, ElSelect, ElDatePicker, ElSwitch, ElRate, ElSlider | — |
|
|
81
|
+
| attrs | 渲染组件附加属性,参数请查看被渲染的 Component attrs | Object | — | {} |
|
|
82
|
+
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object | — | {} |
|
|
83
|
+
| options | 只对 name=ElSelect 有效,下拉组件选项列表 | Array | — | [] |
|
|
84
|
+
| optionProps | 只对 name=ElSelect 有效,下拉组件选项属性参数配置 | Object | — | { value: 'value', label: 'label' } |
|
|
85
|
+
| optionGroups | 只对 name=ElSelect 有效,下拉组件分组选项列表 | Array | — | [] |
|
|
86
|
+
| optionGroupProps | 只对 name=ElSelect 有效,下拉组件分组选项属性参数配置 | Object | — | { options: 'options', label: 'label' } |
|
|
87
|
+
| events | 渲染组件附加事件,参数为 ( {}, ...Component arguments ) | Object | — | — |
|
|
88
|
+
|
|
89
|
+
### item-render 表单-项渲染器配置项说明
|
|
90
|
+
|
|
91
|
+
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
|
|
92
|
+
|------|------|-----|-----|-----|
|
|
93
|
+
| name | 支持的渲染组件 | String | ElInput, ElInputNumber, ElAutocomplete, ElSelect, ElDatePicker, ElSwitch, ElRate, ElSlider, ElRadio, ElCheckbox, ElButton, ElButtons | — |
|
|
94
|
+
| attrs | 渲染组件附加属性,参数请查看被渲染的 Component attrs | Object | — | {} |
|
|
95
|
+
| props | 渲染组件附加属性,参数请查看被渲染的 Component props | Object | — | {} |
|
|
96
|
+
| options | 只对 name=ElSelect 有效,下拉组件选项列表 | Array | — | [] |
|
|
97
|
+
| optionProps | 只对 name=ElSelect 有效,下拉组件选项属性参数配置 | Object | — | { value: 'value', label: 'label' } |
|
|
98
|
+
| optionGroups | 只对 name=ElSelect 有效,下拉组件分组选项列表 | Array | — | [] |
|
|
99
|
+
| optionGroupProps | 只对 name=ElSelect 有效,下拉组件分组选项属性参数配置 | Object | — | { options: 'options', label: 'label' } |
|
|
100
|
+
| events | 渲染组件附加事件,参数为 ( {}, ...Component arguments ) | Object | — | — |
|
|
101
|
+
|
|
102
|
+
### 表单设计器配置项
|
|
103
|
+
|
|
104
|
+
| 描述 |
|
|
105
|
+
|------|
|
|
106
|
+
| 'ElInputWidget', 'ElTextareaWidget', 'ElNumberInputWidget', 'ElDatePickerWidget', 'ElSelectWidget', 'ElRadioWidget', 'ElCheckboxWidget', 'ElSwitchWidget' |
|
|
107
|
+
|
|
108
|
+
## Table Cell demo
|
|
109
|
+
|
|
110
|
+
```html
|
|
111
|
+
<template>
|
|
112
|
+
<vxe-table
|
|
113
|
+
height="600"
|
|
114
|
+
:data="tableData"
|
|
115
|
+
:edit-config="{trigger: 'click', mode: 'cell'}">
|
|
116
|
+
<vxe-column field="name" title="Name" :edit-render="{name: 'ElInput'}"></vxe-column>
|
|
117
|
+
<vxe-column field="age" title="Age" :edit-render="{name: 'ElInputNumber'}"></vxe-column>
|
|
118
|
+
<vxe-column field="date" title="Date" width="200" :edit-render="{name: 'ElDatePicker'}"></vxe-column>
|
|
119
|
+
</vxe-table>
|
|
120
|
+
</template>
|
|
121
|
+
|
|
122
|
+
<script>
|
|
123
|
+
export default {
|
|
124
|
+
data () {
|
|
125
|
+
return {
|
|
126
|
+
tableData: [
|
|
127
|
+
{ id: 100, name: 'test0', age: 28, sex: '1', date: '' },
|
|
128
|
+
{ id: 101, name: 'test1', age: 32, sex: '0', date: '' },
|
|
129
|
+
{ id: 102, name: 'test2', age: 36, sex: '1', date: '' }
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
</script>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Table Filter demo
|
|
138
|
+
|
|
139
|
+
```html
|
|
140
|
+
<template>
|
|
141
|
+
<vxe-table
|
|
142
|
+
height="600"
|
|
143
|
+
:data="tableData">
|
|
144
|
+
<vxe-column field="name" title="Name":filters="nameOptions" :filter-render="{name: 'ElInput'}"></vxe-column>
|
|
145
|
+
<vxe-column field="age" title="Age"></vxe-column>
|
|
146
|
+
<vxe-column field="date" title="Date" ></vxe-column>
|
|
147
|
+
</vxe-table>
|
|
148
|
+
</template>
|
|
149
|
+
|
|
150
|
+
<script>
|
|
151
|
+
export default {
|
|
152
|
+
data () {
|
|
153
|
+
return {
|
|
154
|
+
nameOptions: [
|
|
155
|
+
{ data: '' }
|
|
156
|
+
],
|
|
157
|
+
tableData: [
|
|
158
|
+
{ id: 100, name: 'test0', age: 28, date: null },
|
|
159
|
+
{ id: 101, name: 'test1', age: 32, date: null },
|
|
160
|
+
{ id: 102, name: 'test2', age: 36, date: null }
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
</script>
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Contributors
|
|
169
|
+
|
|
170
|
+
Thank you to everyone who contributed to this project.
|
|
171
|
+
|
|
172
|
+
[](https://github.com/x-extends/vxe-ui-plugins/graphs/contributors)
|
|
173
|
+
|
|
174
|
+
## License
|
|
175
|
+
|
|
176
|
+
[MIT](LICENSE) © 2019-present, Xu Liangzhan
|
package/dist/index.umd.js
CHANGED
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function handleSelectCellValue(cellValue, renderOpts, renderParams) {
|
|
305
305
|
var _renderOpts$options = renderOpts.options,
|
|
306
306
|
options = _renderOpts$options === void 0 ? [] : _renderOpts$options,
|
|
307
307
|
optionGroups = renderOpts.optionGroups,
|
|
@@ -311,16 +311,14 @@
|
|
|
311
311
|
optionProps = _renderOpts$optionPro === void 0 ? {} : _renderOpts$optionPro,
|
|
312
312
|
_renderOpts$optionGro = renderOpts.optionGroupProps,
|
|
313
313
|
optionGroupProps = _renderOpts$optionGro === void 0 ? {} : _renderOpts$optionGro;
|
|
314
|
-
var $table =
|
|
315
|
-
rowid =
|
|
316
|
-
|
|
317
|
-
column = params.column;
|
|
314
|
+
var $table = renderParams.$table,
|
|
315
|
+
rowid = renderParams.rowid,
|
|
316
|
+
column = renderParams.column;
|
|
318
317
|
var filterable = props.filterable,
|
|
319
318
|
multiple = props.multiple;
|
|
320
319
|
var labelProp = optionProps.label || 'label';
|
|
321
320
|
var valueProp = optionProps.value || 'value';
|
|
322
321
|
var groupOptions = optionGroupProps.options || 'options';
|
|
323
|
-
var cellValue = _xeUtils["default"].get(row, column.field);
|
|
324
322
|
var colid = column.id;
|
|
325
323
|
var cellData;
|
|
326
324
|
if (filterable) {
|
|
@@ -365,6 +363,12 @@
|
|
|
365
363
|
}
|
|
366
364
|
return '';
|
|
367
365
|
}
|
|
366
|
+
function getSelectCellValue(renderOpts, renderParams) {
|
|
367
|
+
var row = renderParams.row,
|
|
368
|
+
column = renderParams.column;
|
|
369
|
+
var cellValue = _xeUtils["default"].get(row, column.field);
|
|
370
|
+
return handleSelectCellValue(cellValue, renderOpts, renderParams);
|
|
371
|
+
}
|
|
368
372
|
function getCascaderCellValue(renderOpts, params) {
|
|
369
373
|
var _renderOpts$props2 = renderOpts.props,
|
|
370
374
|
props = _renderOpts$props2 === void 0 ? {} : _renderOpts$props2;
|
|
@@ -565,7 +569,14 @@
|
|
|
565
569
|
createTableFilterOptions: defaultFilterOptions,
|
|
566
570
|
renderTableFilter: createFilterRender(),
|
|
567
571
|
renderTableFloatingFilter: createFloatingFilterRender(),
|
|
568
|
-
tableFilterDefaultMethod:
|
|
572
|
+
tableFilterDefaultMethod: function tableFilterDefaultMethod(params) {
|
|
573
|
+
var option = params.option,
|
|
574
|
+
row = params.row,
|
|
575
|
+
column = params.column;
|
|
576
|
+
var data = option.data;
|
|
577
|
+
var cellValue = _xeUtils["default"].get(row, column.field);
|
|
578
|
+
return cellValue == data;
|
|
579
|
+
}
|
|
569
580
|
},
|
|
570
581
|
ElSelect: {
|
|
571
582
|
tableAutoFocus: 'input',
|
|
@@ -607,8 +618,36 @@
|
|
|
607
618
|
}
|
|
608
619
|
})];
|
|
609
620
|
},
|
|
610
|
-
renderTableCell: function renderTableCell(renderOpts,
|
|
611
|
-
|
|
621
|
+
renderTableCell: function renderTableCell(renderOpts, renderParams) {
|
|
622
|
+
var options = renderOpts.options,
|
|
623
|
+
optionGroups = renderOpts.optionGroups;
|
|
624
|
+
var $table = renderParams.$table,
|
|
625
|
+
row = renderParams.row,
|
|
626
|
+
column = renderParams.column;
|
|
627
|
+
var opSize = options ? options.length : null;
|
|
628
|
+
var ogSize = optionGroups ? optionGroups.length : null;
|
|
629
|
+
if ($table.effectCellData) {
|
|
630
|
+
var _$table$effectCellDat = $table.effectCellData(row, column, {
|
|
631
|
+
key: 'render_table_cell',
|
|
632
|
+
isChanged: function isChanged(_ref2) {
|
|
633
|
+
var oldValue = _ref2.oldValue,
|
|
634
|
+
cellValue = _ref2.cellValue;
|
|
635
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
636
|
+
},
|
|
637
|
+
setValue: function setValue(_ref3) {
|
|
638
|
+
var cellValue = _ref3.cellValue;
|
|
639
|
+
return [cellValue, opSize, ogSize];
|
|
640
|
+
},
|
|
641
|
+
getResult: function getResult(_ref4) {
|
|
642
|
+
var cellValue = _ref4.cellValue;
|
|
643
|
+
return handleSelectCellValue(cellValue, renderOpts, renderParams);
|
|
644
|
+
}
|
|
645
|
+
}),
|
|
646
|
+
_cellResult = _$table$effectCellDat.cellResult;
|
|
647
|
+
return getCellLabelVNs(renderOpts, renderParams, _cellResult);
|
|
648
|
+
}
|
|
649
|
+
var cellResult = getSelectCellValue(renderOpts, renderParams);
|
|
650
|
+
return getCellLabelVNs(renderOpts, renderParams, cellResult);
|
|
612
651
|
},
|
|
613
652
|
createTableFilterOptions: defaultFilterOptions,
|
|
614
653
|
renderTableFilter: function renderTableFilter(renderOpts, params) {
|
|
@@ -2833,12 +2872,12 @@
|
|
|
2833
2872
|
function requireLib () {
|
|
2834
2873
|
if (hasRequiredLib) return lib;
|
|
2835
2874
|
hasRequiredLib = 1;
|
|
2836
|
-
(function (exports
|
|
2875
|
+
(function (exports) {
|
|
2837
2876
|
|
|
2838
|
-
Object.defineProperty(exports
|
|
2877
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2839
2878
|
value: true
|
|
2840
2879
|
});
|
|
2841
|
-
exports
|
|
2880
|
+
exports["default"] = exports.VxeUIPluginRenderElement = void 0;
|
|
2842
2881
|
var _table = requireTable();
|
|
2843
2882
|
var _form = requireForm();
|
|
2844
2883
|
var _formDesign = requireFormDesign();
|
|
@@ -2881,7 +2920,7 @@
|
|
|
2881
2920
|
}
|
|
2882
2921
|
return name;
|
|
2883
2922
|
}
|
|
2884
|
-
var VxeUIPluginRenderElement = exports
|
|
2923
|
+
var VxeUIPluginRenderElement = exports.VxeUIPluginRenderElement = {
|
|
2885
2924
|
component: function component(comp) {
|
|
2886
2925
|
if (comp && comp.name) {
|
|
2887
2926
|
var kcName = _xeUtils["default"].kebabCase(comp.name);
|
|
@@ -2889,7 +2928,7 @@
|
|
|
2889
2928
|
_store.componentMaps[kcName] = comp;
|
|
2890
2929
|
_store.componentMaps[ccName] = comp;
|
|
2891
2930
|
} else {
|
|
2892
|
-
console.error('[@vxe-ui/plugin-render-element 4.
|
|
2931
|
+
console.error('[@vxe-ui/plugin-render-element 4.4.1] error component.', comp);
|
|
2893
2932
|
}
|
|
2894
2933
|
},
|
|
2895
2934
|
install: function install(VxeUI, options) {
|
|
@@ -2903,11 +2942,11 @@
|
|
|
2903
2942
|
var pVersion = 4;
|
|
2904
2943
|
var sVersion = 11;
|
|
2905
2944
|
if (!VxeUI.checkVersion(VxeUI.tableVersion, pVersion, sVersion)) {
|
|
2906
|
-
console.error("[@vxe-ui/plugin-render-element 4.
|
|
2945
|
+
console.error("[@vxe-ui/plugin-render-element 4.4.1] ".concat(VxeUI.getI18n('vxe.error.errorVersion', ["vxe-table@".concat(VxeUI.tableVersion || '?'), "vxe-table v".concat(pVersion, ".").concat(sVersion, "+")]), " https://vxeui.com/other4/#/plugin-render-element/install"));
|
|
2907
2946
|
}
|
|
2908
2947
|
} else {
|
|
2909
2948
|
if (!/^(4)\./.test(VxeUI.uiVersion || VxeUI.tableVersion)) {
|
|
2910
|
-
console.error('[@vxe-ui/plugin-render-element 4.
|
|
2949
|
+
console.error('[@vxe-ui/plugin-render-element 4.4.1] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-render-element/install');
|
|
2911
2950
|
}
|
|
2912
2951
|
}
|
|
2913
2952
|
/**
|
|
@@ -2949,7 +2988,7 @@
|
|
|
2949
2988
|
_store.globalConfig.ElementPlus = window.ElementPlus;
|
|
2950
2989
|
}
|
|
2951
2990
|
}
|
|
2952
|
-
exports
|
|
2991
|
+
exports["default"] = VxeUIPluginRenderElement;
|
|
2953
2992
|
} (lib));
|
|
2954
2993
|
return lib;
|
|
2955
2994
|
}
|