@vxe-ui/plugin-render-antd 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 +171 -171
- package/dist/index.umd.js +117 -19
- 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 +92 -4
- package/lib/index.common.js +3 -3
- package/lib/index.js +3 -3
- package/lib/index.umd.js +117 -19
- package/lib/index.umd.min.js +1 -1
- package/lib/table/index.js +109 -11
- package/package.json +76 -77
- package/src/form/index.ts +313 -313
- package/src/form-design/checkbox-widget.ts +165 -165
- package/src/form-design/date-picker-widget.ts +145 -145
- 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 +145 -145
- package/src/form-design/radio-widget.ts +165 -165
- package/src/form-design/select-widget.ts +157 -157
- package/src/form-design/switch-widget.ts +141 -141
- package/src/form-design/textarea-widget.ts +149 -149
- package/src/form-design/use.ts +255 -255
- package/src/index.ts +118 -118
- package/src/store/index.ts +5 -5
- package/src/table/index.ts +631 -544
- package/src/util/comp.ts +10 -10
- package/types/index.d.ts +19 -19
|
@@ -1,149 +1,149 @@
|
|
|
1
|
-
import { defineComponent, h, PropType, ComponentOptions } from 'vue'
|
|
2
|
-
import { getCurrComponent } from '../util/comp'
|
|
3
|
-
|
|
4
|
-
import type { VxeUIExport, VxeGlobalRendererHandles } from 'vxe-pc-ui'
|
|
5
|
-
|
|
6
|
-
interface WidgetATextareaFormObjVO {
|
|
7
|
-
placeholder: string
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function createWidgetATextarea (VxeUI: VxeUIExport) {
|
|
11
|
-
const getWidgetATextareaConfig = (params: VxeGlobalRendererHandles.CreateFormDesignWidgetConfigParams): VxeGlobalRendererHandles.CreateFormDesignWidgetConfigObj<WidgetATextareaFormObjVO> => {
|
|
12
|
-
return {
|
|
13
|
-
title: '文本域',
|
|
14
|
-
icon: 'vxe-icon-textarea',
|
|
15
|
-
options: {
|
|
16
|
-
placeholder: '请输入'
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const WidgetATextareaFormComponent = defineComponent({
|
|
22
|
-
props: {
|
|
23
|
-
renderOpts: {
|
|
24
|
-
type: Object as PropType<VxeGlobalRendererHandles.RenderFormDesignWidgetFormViewOptions>,
|
|
25
|
-
default: () => ({})
|
|
26
|
-
},
|
|
27
|
-
renderParams: {
|
|
28
|
-
type: Object as PropType<VxeGlobalRendererHandles.RenderFormDesignWidgetFormViewParams<WidgetATextareaFormObjVO>>,
|
|
29
|
-
default: () => ({})
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
emits: [],
|
|
33
|
-
setup (props) {
|
|
34
|
-
const VxeUIFormComponent = VxeUI.getComponent('VxeForm')
|
|
35
|
-
const VxeUIFormItemComponent = VxeUI.getComponent('VxeFormItem')
|
|
36
|
-
const VxeUISwitchComponent = VxeUI.getComponent('VxeSwitch')
|
|
37
|
-
const VxeUIInputComponent = VxeUI.getComponent('VxeInput')
|
|
38
|
-
|
|
39
|
-
return () => {
|
|
40
|
-
const { renderParams } = props
|
|
41
|
-
const { widget } = renderParams
|
|
42
|
-
|
|
43
|
-
return h(VxeUIFormComponent, {
|
|
44
|
-
class: 'vxe-form-design--widget-render-form-wrapper',
|
|
45
|
-
vertical: true,
|
|
46
|
-
span: 24,
|
|
47
|
-
titleBold: true,
|
|
48
|
-
titleOverflow: true,
|
|
49
|
-
data: widget.options
|
|
50
|
-
}, {
|
|
51
|
-
default () {
|
|
52
|
-
return [
|
|
53
|
-
h(VxeUIFormItemComponent, {
|
|
54
|
-
title: VxeUI.getI18n('vxe.formDesign.widgetProp.name')
|
|
55
|
-
}, {
|
|
56
|
-
default () {
|
|
57
|
-
return h(VxeUIInputComponent, {
|
|
58
|
-
modelValue: widget.title,
|
|
59
|
-
'onUpdate:modelValue' (val: any) {
|
|
60
|
-
widget.title = val
|
|
61
|
-
}
|
|
62
|
-
})
|
|
63
|
-
}
|
|
64
|
-
}),
|
|
65
|
-
h(VxeUIFormItemComponent, {
|
|
66
|
-
title: VxeUI.getI18n('vxe.formDesign.widgetProp.placeholder'),
|
|
67
|
-
field: 'placeholder',
|
|
68
|
-
itemRender: { name: 'ElInput' }
|
|
69
|
-
}),
|
|
70
|
-
h(VxeUIFormItemComponent, {
|
|
71
|
-
title: VxeUI.getI18n('vxe.formDesign.widgetProp.required')
|
|
72
|
-
}, {
|
|
73
|
-
default () {
|
|
74
|
-
return h(VxeUISwitchComponent, {
|
|
75
|
-
modelValue: widget.required,
|
|
76
|
-
'onUpdate:modelValue' (val: any) {
|
|
77
|
-
widget.required = val
|
|
78
|
-
}
|
|
79
|
-
})
|
|
80
|
-
}
|
|
81
|
-
})
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
})
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
const WidgetATextareaViewComponent = defineComponent({
|
|
90
|
-
props: {
|
|
91
|
-
renderOpts: {
|
|
92
|
-
type: Object as PropType<VxeGlobalRendererHandles.RenderFormDesignWidgetViewOptions>,
|
|
93
|
-
default: () => ({})
|
|
94
|
-
},
|
|
95
|
-
renderParams: {
|
|
96
|
-
type: Object as PropType<VxeGlobalRendererHandles.RenderFormDesignWidgetViewParams<WidgetATextareaFormObjVO>>,
|
|
97
|
-
default: () => ({})
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
emits: [],
|
|
101
|
-
setup (props) {
|
|
102
|
-
const VxeUIFormItemComponent = VxeUI.getComponent('VxeFormItem')
|
|
103
|
-
|
|
104
|
-
const changeEvent = () => {
|
|
105
|
-
const { renderParams } = props
|
|
106
|
-
const { widget, $formView } = renderParams
|
|
107
|
-
if ($formView) {
|
|
108
|
-
const itemValue = $formView ? $formView.getItemValue(widget) : null
|
|
109
|
-
$formView.updateWidgetStatus(widget, itemValue)
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return () => {
|
|
114
|
-
const { renderParams } = props
|
|
115
|
-
const { widget, $formView } = renderParams
|
|
116
|
-
const { options } = widget
|
|
117
|
-
|
|
118
|
-
return h(VxeUIFormItemComponent, {
|
|
119
|
-
class: ['vxe-form-design--widget-render-form-item'],
|
|
120
|
-
field: widget.field,
|
|
121
|
-
title: widget.title
|
|
122
|
-
}, {
|
|
123
|
-
default () {
|
|
124
|
-
return h(getCurrComponent('a-textarea') as ComponentOptions, {
|
|
125
|
-
value: $formView ? $formView.getItemValue(widget) : null,
|
|
126
|
-
placeholder: options.placeholder,
|
|
127
|
-
autoSize: {
|
|
128
|
-
minRows: 2,
|
|
129
|
-
maxRows: 4
|
|
130
|
-
},
|
|
131
|
-
onChange: changeEvent,
|
|
132
|
-
'onUpdate:value' (val: any) {
|
|
133
|
-
if ($formView) {
|
|
134
|
-
$formView.setItemValue(widget, val)
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
})
|
|
138
|
-
}
|
|
139
|
-
})
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
})
|
|
143
|
-
|
|
144
|
-
return {
|
|
145
|
-
getWidgetATextareaConfig,
|
|
146
|
-
WidgetATextareaFormComponent,
|
|
147
|
-
WidgetATextareaViewComponent
|
|
148
|
-
}
|
|
149
|
-
}
|
|
1
|
+
import { defineComponent, h, PropType, ComponentOptions } from 'vue'
|
|
2
|
+
import { getCurrComponent } from '../util/comp'
|
|
3
|
+
|
|
4
|
+
import type { VxeUIExport, VxeGlobalRendererHandles } from 'vxe-pc-ui'
|
|
5
|
+
|
|
6
|
+
interface WidgetATextareaFormObjVO {
|
|
7
|
+
placeholder: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function createWidgetATextarea (VxeUI: VxeUIExport) {
|
|
11
|
+
const getWidgetATextareaConfig = (params: VxeGlobalRendererHandles.CreateFormDesignWidgetConfigParams): VxeGlobalRendererHandles.CreateFormDesignWidgetConfigObj<WidgetATextareaFormObjVO> => {
|
|
12
|
+
return {
|
|
13
|
+
title: '文本域',
|
|
14
|
+
icon: 'vxe-icon-textarea',
|
|
15
|
+
options: {
|
|
16
|
+
placeholder: '请输入'
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const WidgetATextareaFormComponent = defineComponent({
|
|
22
|
+
props: {
|
|
23
|
+
renderOpts: {
|
|
24
|
+
type: Object as PropType<VxeGlobalRendererHandles.RenderFormDesignWidgetFormViewOptions>,
|
|
25
|
+
default: () => ({})
|
|
26
|
+
},
|
|
27
|
+
renderParams: {
|
|
28
|
+
type: Object as PropType<VxeGlobalRendererHandles.RenderFormDesignWidgetFormViewParams<WidgetATextareaFormObjVO>>,
|
|
29
|
+
default: () => ({})
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
emits: [],
|
|
33
|
+
setup (props) {
|
|
34
|
+
const VxeUIFormComponent = VxeUI.getComponent('VxeForm')
|
|
35
|
+
const VxeUIFormItemComponent = VxeUI.getComponent('VxeFormItem')
|
|
36
|
+
const VxeUISwitchComponent = VxeUI.getComponent('VxeSwitch')
|
|
37
|
+
const VxeUIInputComponent = VxeUI.getComponent('VxeInput')
|
|
38
|
+
|
|
39
|
+
return () => {
|
|
40
|
+
const { renderParams } = props
|
|
41
|
+
const { widget } = renderParams
|
|
42
|
+
|
|
43
|
+
return h(VxeUIFormComponent, {
|
|
44
|
+
class: 'vxe-form-design--widget-render-form-wrapper',
|
|
45
|
+
vertical: true,
|
|
46
|
+
span: 24,
|
|
47
|
+
titleBold: true,
|
|
48
|
+
titleOverflow: true,
|
|
49
|
+
data: widget.options
|
|
50
|
+
}, {
|
|
51
|
+
default () {
|
|
52
|
+
return [
|
|
53
|
+
h(VxeUIFormItemComponent, {
|
|
54
|
+
title: VxeUI.getI18n('vxe.formDesign.widgetProp.name')
|
|
55
|
+
}, {
|
|
56
|
+
default () {
|
|
57
|
+
return h(VxeUIInputComponent, {
|
|
58
|
+
modelValue: widget.title,
|
|
59
|
+
'onUpdate:modelValue' (val: any) {
|
|
60
|
+
widget.title = val
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
}),
|
|
65
|
+
h(VxeUIFormItemComponent, {
|
|
66
|
+
title: VxeUI.getI18n('vxe.formDesign.widgetProp.placeholder'),
|
|
67
|
+
field: 'placeholder',
|
|
68
|
+
itemRender: { name: 'ElInput' }
|
|
69
|
+
}),
|
|
70
|
+
h(VxeUIFormItemComponent, {
|
|
71
|
+
title: VxeUI.getI18n('vxe.formDesign.widgetProp.required')
|
|
72
|
+
}, {
|
|
73
|
+
default () {
|
|
74
|
+
return h(VxeUISwitchComponent, {
|
|
75
|
+
modelValue: widget.required,
|
|
76
|
+
'onUpdate:modelValue' (val: any) {
|
|
77
|
+
widget.required = val
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
const WidgetATextareaViewComponent = defineComponent({
|
|
90
|
+
props: {
|
|
91
|
+
renderOpts: {
|
|
92
|
+
type: Object as PropType<VxeGlobalRendererHandles.RenderFormDesignWidgetViewOptions>,
|
|
93
|
+
default: () => ({})
|
|
94
|
+
},
|
|
95
|
+
renderParams: {
|
|
96
|
+
type: Object as PropType<VxeGlobalRendererHandles.RenderFormDesignWidgetViewParams<WidgetATextareaFormObjVO>>,
|
|
97
|
+
default: () => ({})
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
emits: [],
|
|
101
|
+
setup (props) {
|
|
102
|
+
const VxeUIFormItemComponent = VxeUI.getComponent('VxeFormItem')
|
|
103
|
+
|
|
104
|
+
const changeEvent = () => {
|
|
105
|
+
const { renderParams } = props
|
|
106
|
+
const { widget, $formView } = renderParams
|
|
107
|
+
if ($formView) {
|
|
108
|
+
const itemValue = $formView ? $formView.getItemValue(widget) : null
|
|
109
|
+
$formView.updateWidgetStatus(widget, itemValue)
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return () => {
|
|
114
|
+
const { renderParams } = props
|
|
115
|
+
const { widget, $formView } = renderParams
|
|
116
|
+
const { options } = widget
|
|
117
|
+
|
|
118
|
+
return h(VxeUIFormItemComponent, {
|
|
119
|
+
class: ['vxe-form-design--widget-render-form-item'],
|
|
120
|
+
field: widget.field,
|
|
121
|
+
title: widget.title
|
|
122
|
+
}, {
|
|
123
|
+
default () {
|
|
124
|
+
return h(getCurrComponent('a-textarea') as ComponentOptions, {
|
|
125
|
+
value: $formView ? $formView.getItemValue(widget) : null,
|
|
126
|
+
placeholder: options.placeholder,
|
|
127
|
+
autoSize: {
|
|
128
|
+
minRows: 2,
|
|
129
|
+
maxRows: 4
|
|
130
|
+
},
|
|
131
|
+
onChange: changeEvent,
|
|
132
|
+
'onUpdate:value' (val: any) {
|
|
133
|
+
if ($formView) {
|
|
134
|
+
$formView.setItemValue(widget, val)
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
return {
|
|
145
|
+
getWidgetATextareaConfig,
|
|
146
|
+
WidgetATextareaFormComponent,
|
|
147
|
+
WidgetATextareaViewComponent
|
|
148
|
+
}
|
|
149
|
+
}
|