@vxe-ui/plugin-render-element 4.0.10 → 4.0.12
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 +26 -0
- package/dist/all.common.js +116 -58
- package/dist/form/index.js +13 -12
- package/dist/form-design/checkbox-widget.js +4 -3
- package/dist/form-design/date-picker-widget.js +3 -2
- package/dist/form-design/input-widget.js +3 -2
- package/dist/form-design/number-input-widget.js +3 -2
- package/dist/form-design/radio-widget.js +4 -3
- package/dist/form-design/select-widget.js +4 -3
- package/dist/form-design/switch-widget.js +3 -2
- package/dist/form-design/textarea-widget.js +3 -2
- package/dist/index.common.js +31 -4
- package/dist/index.js +31 -4
- package/dist/index.umd.js +127 -48
- package/dist/index.umd.min.js +1 -1
- package/dist/store/index.js +8 -0
- package/dist/table/index.js +13 -12
- package/dist/util/comp.js +11 -0
- package/package.json +3 -3
- package/src/form/index.ts +14 -13
- package/src/form-design/checkbox-widget.ts +5 -4
- package/src/form-design/date-picker-widget.ts +4 -3
- package/src/form-design/input-widget.ts +4 -3
- package/src/form-design/number-input-widget.ts +5 -3
- package/src/form-design/radio-widget.ts +5 -4
- package/src/form-design/select-widget.ts +5 -4
- package/src/form-design/switch-widget.ts +4 -3
- package/src/form-design/textarea-widget.ts +4 -3
- package/src/index.ts +32 -6
- package/src/store/index.ts +5 -0
- package/src/table/index.ts +14 -13
- package/src/util/comp.ts +6 -0
- package/types/index.d.ts +6 -3
package/README.md
CHANGED
|
@@ -22,6 +22,32 @@ import VxeUIPluginRenderElement from '@vxe-ui/plugin-render-element'
|
|
|
22
22
|
import '@vxe-ui/plugin-render-element/dist/style.css'
|
|
23
23
|
// ...
|
|
24
24
|
|
|
25
|
+
VxeUI.use(VxeUIPluginRenderElement)
|
|
26
|
+
// VxeUI.use(VxeUIPluginRenderElement, {
|
|
27
|
+
// ElementPlus
|
|
28
|
+
// })
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Demand import
|
|
32
|
+
|
|
33
|
+
```javascript
|
|
34
|
+
// ...
|
|
35
|
+
// Use vxe-pc-ui
|
|
36
|
+
import { VxeUI } from 'vxe-pc-ui'
|
|
37
|
+
// Use vxe-table
|
|
38
|
+
// import { VxeUI } from 'vxe-table'
|
|
39
|
+
import VxeUIPluginRenderElement from '@vxe-ui/plugin-render-element'
|
|
40
|
+
import '@vxe-ui/plugin-render-element/dist/style.css'
|
|
41
|
+
// ...
|
|
42
|
+
|
|
43
|
+
// If it is not a global installation, then a single import is required.
|
|
44
|
+
import { ElInput, ElInputNumber, ElSelect } from 'element-plus'
|
|
45
|
+
// ...
|
|
46
|
+
VxeUIPluginRenderElement.component(ElInput)
|
|
47
|
+
VxeUIPluginRenderElement.component(ElInputNumber)
|
|
48
|
+
VxeUIPluginRenderElement.component(ElSelect)
|
|
49
|
+
// ...
|
|
50
|
+
|
|
25
51
|
VxeUI.use(VxeUIPluginRenderElement)
|
|
26
52
|
```
|
|
27
53
|
|
package/dist/all.common.js
CHANGED
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.createWidgetElCheckbox = createWidgetElCheckbox;
|
|
8
8
|
var _vue = require("vue");
|
|
9
9
|
var _use = require("./use");
|
|
10
|
+
var _comp = require("../util/comp");
|
|
10
11
|
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
11
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
13
|
function createWidgetElCheckbox(VxeUI) {
|
|
@@ -61,7 +62,7 @@ function createWidgetElCheckbox(VxeUI) {
|
|
|
61
62
|
title: VxeUI.getI18n('vxe.formDesign.widgetProp.name')
|
|
62
63
|
}, {
|
|
63
64
|
"default": function _default() {
|
|
64
|
-
return (0, _vue.h)((0,
|
|
65
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-input'), {
|
|
65
66
|
modelValue: widget.title,
|
|
66
67
|
'onUpdate:modelValue': function onUpdateModelValue(val) {
|
|
67
68
|
widget.title = val;
|
|
@@ -129,7 +130,7 @@ function createWidgetElCheckbox(VxeUI) {
|
|
|
129
130
|
title: widget.title
|
|
130
131
|
}, {
|
|
131
132
|
"default": function _default() {
|
|
132
|
-
return (0, _vue.h)((0,
|
|
133
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-checkbox-group'), {
|
|
133
134
|
modelValue: $formView ? $formView.getItemValue(widget) : null,
|
|
134
135
|
onChange: changeEvent,
|
|
135
136
|
'onUpdate:modelValue': function onUpdateModelValue(val) {
|
|
@@ -140,7 +141,7 @@ function createWidgetElCheckbox(VxeUI) {
|
|
|
140
141
|
}, {
|
|
141
142
|
"default": function _default() {
|
|
142
143
|
return options.options ? options.options.map(function (item, index) {
|
|
143
|
-
return (0, _vue.h)((0,
|
|
144
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-checkbox'), {
|
|
144
145
|
key: index,
|
|
145
146
|
value: item.value
|
|
146
147
|
}, {
|
|
@@ -162,7 +163,7 @@ function createWidgetElCheckbox(VxeUI) {
|
|
|
162
163
|
WidgetElCheckboxViewComponent: WidgetElCheckboxViewComponent
|
|
163
164
|
};
|
|
164
165
|
}
|
|
165
|
-
},{"./use":10,"vue":"vue","xe-utils":"xe-utils"}],2:[function(require,module,exports){
|
|
166
|
+
},{"../util/comp":15,"./use":10,"vue":"vue","xe-utils":"xe-utils"}],2:[function(require,module,exports){
|
|
166
167
|
"use strict";
|
|
167
168
|
|
|
168
169
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -170,6 +171,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
170
171
|
});
|
|
171
172
|
exports.createWidgetElDatePicker = createWidgetElDatePicker;
|
|
172
173
|
var _vue = require("vue");
|
|
174
|
+
var _comp = require("../util/comp");
|
|
173
175
|
function createWidgetElDatePicker(VxeUI) {
|
|
174
176
|
var getWidgetElDatePickerConfig = function getWidgetElDatePickerConfig(params) {
|
|
175
177
|
return {
|
|
@@ -216,7 +218,7 @@ function createWidgetElDatePicker(VxeUI) {
|
|
|
216
218
|
title: VxeUI.getI18n('vxe.formDesign.widgetProp.name')
|
|
217
219
|
}, {
|
|
218
220
|
"default": function _default() {
|
|
219
|
-
return (0, _vue.h)((0,
|
|
221
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-input'), {
|
|
220
222
|
modelValue: widget.title,
|
|
221
223
|
'onUpdate:modelValue': function onUpdateModelValue(val) {
|
|
222
224
|
widget.title = val;
|
|
@@ -284,7 +286,7 @@ function createWidgetElDatePicker(VxeUI) {
|
|
|
284
286
|
title: widget.title
|
|
285
287
|
}, {
|
|
286
288
|
"default": function _default() {
|
|
287
|
-
return (0, _vue.h)((0,
|
|
289
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-date-picker'), {
|
|
288
290
|
modelValue: $formView ? $formView.getItemValue(widget) : null,
|
|
289
291
|
placeholder: options.placeholder,
|
|
290
292
|
onChange: changeEvent,
|
|
@@ -305,7 +307,7 @@ function createWidgetElDatePicker(VxeUI) {
|
|
|
305
307
|
WidgetElDatePickerViewComponent: WidgetElDatePickerViewComponent
|
|
306
308
|
};
|
|
307
309
|
}
|
|
308
|
-
},{"vue":"vue"}],3:[function(require,module,exports){
|
|
310
|
+
},{"../util/comp":15,"vue":"vue"}],3:[function(require,module,exports){
|
|
309
311
|
"use strict";
|
|
310
312
|
|
|
311
313
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -491,6 +493,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
491
493
|
});
|
|
492
494
|
exports.createWidgetElInput = createWidgetElInput;
|
|
493
495
|
var _vue = require("vue");
|
|
496
|
+
var _comp = require("../util/comp");
|
|
494
497
|
function createWidgetElInput(VxeUI) {
|
|
495
498
|
var getWidgetElInputConfig = function getWidgetElInputConfig(params) {
|
|
496
499
|
return {
|
|
@@ -538,7 +541,7 @@ function createWidgetElInput(VxeUI) {
|
|
|
538
541
|
title: VxeUI.getI18n('vxe.formDesign.widgetProp.name')
|
|
539
542
|
}, {
|
|
540
543
|
"default": function _default() {
|
|
541
|
-
return (0, _vue.h)((0,
|
|
544
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-input'), {
|
|
542
545
|
modelValue: widget.title,
|
|
543
546
|
'onUpdate:modelValue': function onUpdateModelValue(val) {
|
|
544
547
|
widget.title = val;
|
|
@@ -606,7 +609,7 @@ function createWidgetElInput(VxeUI) {
|
|
|
606
609
|
title: widget.title
|
|
607
610
|
}, {
|
|
608
611
|
"default": function _default() {
|
|
609
|
-
return (0, _vue.h)((0,
|
|
612
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-input'), {
|
|
610
613
|
modelValue: $formView ? $formView.getItemValue(widget) : null,
|
|
611
614
|
placeholder: options.placeholder,
|
|
612
615
|
onChange: changeEvent,
|
|
@@ -627,7 +630,7 @@ function createWidgetElInput(VxeUI) {
|
|
|
627
630
|
WidgetElInputViewComponent: WidgetElInputViewComponent
|
|
628
631
|
};
|
|
629
632
|
}
|
|
630
|
-
},{"vue":"vue"}],5:[function(require,module,exports){
|
|
633
|
+
},{"../util/comp":15,"vue":"vue"}],5:[function(require,module,exports){
|
|
631
634
|
"use strict";
|
|
632
635
|
|
|
633
636
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -635,6 +638,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
635
638
|
});
|
|
636
639
|
exports.createWidgetElInputNumber = createWidgetElInputNumber;
|
|
637
640
|
var _vue = require("vue");
|
|
641
|
+
var _comp = require("../util/comp");
|
|
638
642
|
function createWidgetElInputNumber(VxeUI) {
|
|
639
643
|
var getWidgetElInputNumberConfig = function getWidgetElInputNumberConfig(params) {
|
|
640
644
|
return {
|
|
@@ -681,7 +685,7 @@ function createWidgetElInputNumber(VxeUI) {
|
|
|
681
685
|
title: VxeUI.getI18n('vxe.formDesign.widgetProp.name')
|
|
682
686
|
}, {
|
|
683
687
|
"default": function _default() {
|
|
684
|
-
return (0, _vue.h)((0,
|
|
688
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-input'), {
|
|
685
689
|
modelValue: widget.title,
|
|
686
690
|
'onUpdate:modelValue': function onUpdateModelValue(val) {
|
|
687
691
|
widget.title = val;
|
|
@@ -749,7 +753,7 @@ function createWidgetElInputNumber(VxeUI) {
|
|
|
749
753
|
title: widget.title
|
|
750
754
|
}, {
|
|
751
755
|
"default": function _default() {
|
|
752
|
-
return (0, _vue.h)((0,
|
|
756
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-input-number'), {
|
|
753
757
|
modelValue: $formView ? $formView.getItemValue(widget) : null,
|
|
754
758
|
placeholder: options.placeholder,
|
|
755
759
|
onChange: changeEvent,
|
|
@@ -770,7 +774,7 @@ function createWidgetElInputNumber(VxeUI) {
|
|
|
770
774
|
WidgetElInputNumberViewComponent: WidgetElInputNumberViewComponent
|
|
771
775
|
};
|
|
772
776
|
}
|
|
773
|
-
},{"vue":"vue"}],6:[function(require,module,exports){
|
|
777
|
+
},{"../util/comp":15,"vue":"vue"}],6:[function(require,module,exports){
|
|
774
778
|
"use strict";
|
|
775
779
|
|
|
776
780
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -779,6 +783,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
779
783
|
exports.createWidgetElRadio = createWidgetElRadio;
|
|
780
784
|
var _vue = require("vue");
|
|
781
785
|
var _use = require("./use");
|
|
786
|
+
var _comp = require("../util/comp");
|
|
782
787
|
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
783
788
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
784
789
|
function createWidgetElRadio(VxeUI) {
|
|
@@ -833,7 +838,7 @@ function createWidgetElRadio(VxeUI) {
|
|
|
833
838
|
title: VxeUI.getI18n('vxe.formDesign.widgetProp.name')
|
|
834
839
|
}, {
|
|
835
840
|
"default": function _default() {
|
|
836
|
-
return (0, _vue.h)((0,
|
|
841
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-input'), {
|
|
837
842
|
modelValue: widget.title,
|
|
838
843
|
'onUpdate:modelValue': function onUpdateModelValue(val) {
|
|
839
844
|
widget.title = val;
|
|
@@ -901,7 +906,7 @@ function createWidgetElRadio(VxeUI) {
|
|
|
901
906
|
title: widget.title
|
|
902
907
|
}, {
|
|
903
908
|
"default": function _default() {
|
|
904
|
-
return (0, _vue.h)((0,
|
|
909
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-radio-group'), {
|
|
905
910
|
modelValue: $formView ? $formView.getItemValue(widget) : null,
|
|
906
911
|
onChange: changeEvent,
|
|
907
912
|
'onUpdate:modelValue': function onUpdateModelValue(val) {
|
|
@@ -912,7 +917,7 @@ function createWidgetElRadio(VxeUI) {
|
|
|
912
917
|
}, {
|
|
913
918
|
"default": function _default() {
|
|
914
919
|
return options.options ? options.options.map(function (item, index) {
|
|
915
|
-
return (0, _vue.h)((0,
|
|
920
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-radio'), {
|
|
916
921
|
key: index,
|
|
917
922
|
value: item.value
|
|
918
923
|
}, {
|
|
@@ -934,7 +939,7 @@ function createWidgetElRadio(VxeUI) {
|
|
|
934
939
|
WidgetElRadioViewComponent: WidgetElRadioViewComponent
|
|
935
940
|
};
|
|
936
941
|
}
|
|
937
|
-
},{"./use":10,"vue":"vue","xe-utils":"xe-utils"}],7:[function(require,module,exports){
|
|
942
|
+
},{"../util/comp":15,"./use":10,"vue":"vue","xe-utils":"xe-utils"}],7:[function(require,module,exports){
|
|
938
943
|
"use strict";
|
|
939
944
|
|
|
940
945
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -943,6 +948,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
943
948
|
exports.createWidgetElSelect = createWidgetElSelect;
|
|
944
949
|
var _vue = require("vue");
|
|
945
950
|
var _use = require("./use");
|
|
951
|
+
var _comp = require("../util/comp");
|
|
946
952
|
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
947
953
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
948
954
|
function createWidgetElSelect(VxeUI) {
|
|
@@ -998,7 +1004,7 @@ function createWidgetElSelect(VxeUI) {
|
|
|
998
1004
|
title: VxeUI.getI18n('vxe.formDesign.widgetProp.name')
|
|
999
1005
|
}, {
|
|
1000
1006
|
"default": function _default() {
|
|
1001
|
-
return (0, _vue.h)((0,
|
|
1007
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-input'), {
|
|
1002
1008
|
modelValue: widget.title,
|
|
1003
1009
|
'onUpdate:modelValue': function onUpdateModelValue(val) {
|
|
1004
1010
|
widget.title = val;
|
|
@@ -1066,7 +1072,7 @@ function createWidgetElSelect(VxeUI) {
|
|
|
1066
1072
|
title: widget.title
|
|
1067
1073
|
}, {
|
|
1068
1074
|
"default": function _default() {
|
|
1069
|
-
return (0, _vue.h)((0,
|
|
1075
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-select'), {
|
|
1070
1076
|
modelValue: $formView ? $formView.getItemValue(widget) : null,
|
|
1071
1077
|
placeholder: options.placeholder,
|
|
1072
1078
|
onChange: changeEvent,
|
|
@@ -1078,7 +1084,7 @@ function createWidgetElSelect(VxeUI) {
|
|
|
1078
1084
|
}, {
|
|
1079
1085
|
"default": function _default() {
|
|
1080
1086
|
return options.options ? options.options.map(function (item) {
|
|
1081
|
-
return (0, _vue.h)((0,
|
|
1087
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-option'), {
|
|
1082
1088
|
label: item.value,
|
|
1083
1089
|
value: item.value
|
|
1084
1090
|
});
|
|
@@ -1096,7 +1102,7 @@ function createWidgetElSelect(VxeUI) {
|
|
|
1096
1102
|
WidgetElSelectViewComponent: WidgetElSelectViewComponent
|
|
1097
1103
|
};
|
|
1098
1104
|
}
|
|
1099
|
-
},{"./use":10,"vue":"vue","xe-utils":"xe-utils"}],8:[function(require,module,exports){
|
|
1105
|
+
},{"../util/comp":15,"./use":10,"vue":"vue","xe-utils":"xe-utils"}],8:[function(require,module,exports){
|
|
1100
1106
|
"use strict";
|
|
1101
1107
|
|
|
1102
1108
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -1104,6 +1110,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1104
1110
|
});
|
|
1105
1111
|
exports.createWidgetElSwitch = createWidgetElSwitch;
|
|
1106
1112
|
var _vue = require("vue");
|
|
1113
|
+
var _comp = require("../util/comp");
|
|
1107
1114
|
function createWidgetElSwitch(VxeUI) {
|
|
1108
1115
|
var getWidgetElSwitchConfig = function getWidgetElSwitchConfig(params) {
|
|
1109
1116
|
return {
|
|
@@ -1148,7 +1155,7 @@ function createWidgetElSwitch(VxeUI) {
|
|
|
1148
1155
|
title: VxeUI.getI18n('vxe.formDesign.widgetProp.name')
|
|
1149
1156
|
}, {
|
|
1150
1157
|
"default": function _default() {
|
|
1151
|
-
return (0, _vue.h)((0,
|
|
1158
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-input'), {
|
|
1152
1159
|
modelValue: widget.title,
|
|
1153
1160
|
'onUpdate:modelValue': function onUpdateModelValue(val) {
|
|
1154
1161
|
widget.title = val;
|
|
@@ -1215,7 +1222,7 @@ function createWidgetElSwitch(VxeUI) {
|
|
|
1215
1222
|
title: widget.title
|
|
1216
1223
|
}, {
|
|
1217
1224
|
"default": function _default() {
|
|
1218
|
-
return (0, _vue.h)((0,
|
|
1225
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-switch'), {
|
|
1219
1226
|
modelValue: $formView ? $formView.getItemValue(widget) : null,
|
|
1220
1227
|
onChange: changeEvent,
|
|
1221
1228
|
'onUpdate:modelValue': function onUpdateModelValue(val) {
|
|
@@ -1235,7 +1242,7 @@ function createWidgetElSwitch(VxeUI) {
|
|
|
1235
1242
|
WidgetElSwitchViewComponent: WidgetElSwitchViewComponent
|
|
1236
1243
|
};
|
|
1237
1244
|
}
|
|
1238
|
-
},{"vue":"vue"}],9:[function(require,module,exports){
|
|
1245
|
+
},{"../util/comp":15,"vue":"vue"}],9:[function(require,module,exports){
|
|
1239
1246
|
"use strict";
|
|
1240
1247
|
|
|
1241
1248
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -1243,6 +1250,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1243
1250
|
});
|
|
1244
1251
|
exports.createWidgetElTextarea = createWidgetElTextarea;
|
|
1245
1252
|
var _vue = require("vue");
|
|
1253
|
+
var _comp = require("../util/comp");
|
|
1246
1254
|
function createWidgetElTextarea(VxeUI) {
|
|
1247
1255
|
var getWidgetElTextareaConfig = function getWidgetElTextareaConfig(params) {
|
|
1248
1256
|
return {
|
|
@@ -1289,7 +1297,7 @@ function createWidgetElTextarea(VxeUI) {
|
|
|
1289
1297
|
title: VxeUI.getI18n('vxe.formDesign.widgetProp.name')
|
|
1290
1298
|
}, {
|
|
1291
1299
|
"default": function _default() {
|
|
1292
|
-
return (0, _vue.h)((0,
|
|
1300
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-input'), {
|
|
1293
1301
|
modelValue: widget.title,
|
|
1294
1302
|
'onUpdate:modelValue': function onUpdateModelValue(val) {
|
|
1295
1303
|
widget.title = val;
|
|
@@ -1357,7 +1365,7 @@ function createWidgetElTextarea(VxeUI) {
|
|
|
1357
1365
|
title: widget.title
|
|
1358
1366
|
}, {
|
|
1359
1367
|
"default": function _default() {
|
|
1360
|
-
return (0, _vue.h)((0,
|
|
1368
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-input'), {
|
|
1361
1369
|
modelValue: $formView ? $formView.getItemValue(widget) : null,
|
|
1362
1370
|
placeholder: options.placeholder,
|
|
1363
1371
|
type: 'textarea',
|
|
@@ -1383,7 +1391,7 @@ function createWidgetElTextarea(VxeUI) {
|
|
|
1383
1391
|
WidgetElTextareaViewComponent: WidgetElTextareaViewComponent
|
|
1384
1392
|
};
|
|
1385
1393
|
}
|
|
1386
|
-
},{"vue":"vue"}],10:[function(require,module,exports){
|
|
1394
|
+
},{"../util/comp":15,"vue":"vue"}],10:[function(require,module,exports){
|
|
1387
1395
|
"use strict";
|
|
1388
1396
|
|
|
1389
1397
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -1617,6 +1625,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1617
1625
|
});
|
|
1618
1626
|
exports.defineFormRender = defineFormRender;
|
|
1619
1627
|
var _vue = require("vue");
|
|
1628
|
+
var _comp = require("../util/comp");
|
|
1620
1629
|
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
1621
1630
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
1622
1631
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
@@ -1714,7 +1723,7 @@ function defineFormRender(VxeUI) {
|
|
|
1714
1723
|
var labelProp = optionProps.label || 'label';
|
|
1715
1724
|
var valueProp = optionProps.value || 'value';
|
|
1716
1725
|
return _xeUtils["default"].map(options, function (item, oIndex) {
|
|
1717
|
-
return (0, _vue.h)((0,
|
|
1726
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-option'), {
|
|
1718
1727
|
key: oIndex,
|
|
1719
1728
|
value: item[valueProp],
|
|
1720
1729
|
label: item[labelProp],
|
|
@@ -1732,13 +1741,13 @@ function defineFormRender(VxeUI) {
|
|
|
1732
1741
|
var name = renderOpts.name;
|
|
1733
1742
|
var attrs = renderOpts.attrs;
|
|
1734
1743
|
var itemValue = _xeUtils["default"].get(data, field);
|
|
1735
|
-
return [(0, _vue.h)((0,
|
|
1744
|
+
return [(0, _vue.h)((0, _comp.getCurrComponent)(name), _objectSpread(_objectSpread(_objectSpread({}, attrs), getItemProps(renderOpts, params, itemValue, defaultProps)), getItemOns(renderOpts, params)))];
|
|
1736
1745
|
};
|
|
1737
1746
|
}
|
|
1738
1747
|
function defaultButtonItemRender(renderOpts, params) {
|
|
1739
1748
|
var attrs = renderOpts.attrs;
|
|
1740
1749
|
var props = getItemProps(renderOpts, params, null);
|
|
1741
|
-
return [(0, _vue.h)((0,
|
|
1750
|
+
return [(0, _vue.h)((0, _comp.getCurrComponent)('el-button'), _objectSpread(_objectSpread(_objectSpread({}, attrs), props), getOns(renderOpts, params)), {
|
|
1742
1751
|
"default": function _default() {
|
|
1743
1752
|
return cellText(renderOpts.content || props.content);
|
|
1744
1753
|
}
|
|
@@ -1770,10 +1779,10 @@ function defineFormRender(VxeUI) {
|
|
|
1770
1779
|
var labelProp = optionProps.label || 'label';
|
|
1771
1780
|
var valueProp = optionProps.value || 'value';
|
|
1772
1781
|
var itemValue = _xeUtils["default"].get(data, field);
|
|
1773
|
-
return [(0, _vue.h)((0,
|
|
1782
|
+
return [(0, _vue.h)((0, _comp.getCurrComponent)("".concat(name, "Group")), _objectSpread(_objectSpread(_objectSpread({}, attrs), getItemProps(renderOpts, params, itemValue)), getItemOns(renderOpts, params)), {
|
|
1774
1783
|
"default": function _default() {
|
|
1775
1784
|
return options.map(function (option, oIndex) {
|
|
1776
|
-
return (0, _vue.h)((0,
|
|
1785
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)(name), {
|
|
1777
1786
|
key: oIndex,
|
|
1778
1787
|
label: option[valueProp],
|
|
1779
1788
|
disabled: option.disabled
|
|
@@ -1815,10 +1824,10 @@ function defineFormRender(VxeUI) {
|
|
|
1815
1824
|
if (optionGroups) {
|
|
1816
1825
|
var groupOptions = optionGroupProps.options || 'options';
|
|
1817
1826
|
var groupLabel = optionGroupProps.label || 'label';
|
|
1818
|
-
return [(0, _vue.h)((0,
|
|
1827
|
+
return [(0, _vue.h)((0, _comp.getCurrComponent)('el-select'), _objectSpread(_objectSpread(_objectSpread({}, attrs), props), ons), {
|
|
1819
1828
|
"default": function _default() {
|
|
1820
1829
|
return _xeUtils["default"].map(optionGroups, function (group, gIndex) {
|
|
1821
|
-
return (0, _vue.h)((0,
|
|
1830
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-option-group'), {
|
|
1822
1831
|
label: group[groupLabel],
|
|
1823
1832
|
key: gIndex
|
|
1824
1833
|
}, {
|
|
@@ -1830,7 +1839,7 @@ function defineFormRender(VxeUI) {
|
|
|
1830
1839
|
}
|
|
1831
1840
|
})];
|
|
1832
1841
|
}
|
|
1833
|
-
return [(0, _vue.h)((0,
|
|
1842
|
+
return [(0, _vue.h)((0, _comp.getCurrComponent)('el-select'), _objectSpread(_objectSpread(_objectSpread({}, attrs), props), ons), {
|
|
1834
1843
|
"default": function _default() {
|
|
1835
1844
|
return renderOptions(options, optionProps);
|
|
1836
1845
|
}
|
|
@@ -1870,10 +1879,10 @@ function defineFormRender(VxeUI) {
|
|
|
1870
1879
|
var labelProp = optionProps.label || 'label';
|
|
1871
1880
|
var valueProp = optionProps.value || 'value';
|
|
1872
1881
|
var itemValue = _xeUtils["default"].get(data, field);
|
|
1873
|
-
return [(0, _vue.h)((0,
|
|
1882
|
+
return [(0, _vue.h)((0, _comp.getCurrComponent)('el-radio-group'), _objectSpread(_objectSpread(_objectSpread({}, attrs), getItemProps(renderOpts, params, itemValue)), getItemOns(renderOpts, params)), {
|
|
1874
1883
|
"default": function _default() {
|
|
1875
1884
|
return options.map(function (option, oIndex) {
|
|
1876
|
-
return (0, _vue.h)((0,
|
|
1885
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-radio'), {
|
|
1877
1886
|
key: oIndex,
|
|
1878
1887
|
value: option[valueProp],
|
|
1879
1888
|
disabled: option.disabled
|
|
@@ -1899,10 +1908,10 @@ function defineFormRender(VxeUI) {
|
|
|
1899
1908
|
var labelProp = optionProps.label || 'label';
|
|
1900
1909
|
var valueProp = optionProps.value || 'value';
|
|
1901
1910
|
var itemValue = _xeUtils["default"].get(data, field);
|
|
1902
|
-
return [(0, _vue.h)((0,
|
|
1911
|
+
return [(0, _vue.h)((0, _comp.getCurrComponent)('el-checkbox-group'), _objectSpread(_objectSpread(_objectSpread({}, attrs), getItemProps(renderOpts, params, itemValue)), getItemOns(renderOpts, params)), {
|
|
1903
1912
|
"default": function _default() {
|
|
1904
1913
|
return options.map(function (option, oIndex) {
|
|
1905
|
-
return (0, _vue.h)((0,
|
|
1914
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-checkbox'), {
|
|
1906
1915
|
key: oIndex,
|
|
1907
1916
|
value: option[valueProp],
|
|
1908
1917
|
label: option[labelProp],
|
|
@@ -1928,7 +1937,7 @@ function defineFormRender(VxeUI) {
|
|
|
1928
1937
|
}
|
|
1929
1938
|
});
|
|
1930
1939
|
}
|
|
1931
|
-
},{"vue":"vue","xe-utils":"xe-utils"}],12:[function(require,module,exports){
|
|
1940
|
+
},{"../util/comp":15,"vue":"vue","xe-utils":"xe-utils"}],12:[function(require,module,exports){
|
|
1932
1941
|
"use strict";
|
|
1933
1942
|
|
|
1934
1943
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -1938,6 +1947,9 @@ exports["default"] = exports.VxeUIPluginRenderElement = void 0;
|
|
|
1938
1947
|
var _table = require("./table");
|
|
1939
1948
|
var _form = require("./form");
|
|
1940
1949
|
var _formDesign = require("./form-design");
|
|
1950
|
+
var _store = require("./store");
|
|
1951
|
+
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
1952
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
1941
1953
|
// eslint-disable-next-line no-unused-vars
|
|
1942
1954
|
var ElementPlus;
|
|
1943
1955
|
function getEventTarget(evnt) {
|
|
@@ -1990,12 +2002,31 @@ function handleClearEvent(params) {
|
|
|
1990
2002
|
return false;
|
|
1991
2003
|
}
|
|
1992
2004
|
}
|
|
2005
|
+
function toComponentName(name) {
|
|
2006
|
+
if (name) {
|
|
2007
|
+
return name.slice(0, 1).toUpperCase() + name.slice(1);
|
|
2008
|
+
}
|
|
2009
|
+
return name;
|
|
2010
|
+
}
|
|
1993
2011
|
var VxeUIPluginRenderElement = exports.VxeUIPluginRenderElement = {
|
|
2012
|
+
component: function component(comp) {
|
|
2013
|
+
if (comp && comp.name) {
|
|
2014
|
+
var kcName = _xeUtils["default"].kebabCase('el-button');
|
|
2015
|
+
var ccName = toComponentName(_xeUtils["default"].camelCase('el-button'));
|
|
2016
|
+
_store.componentMaps[kcName] = comp;
|
|
2017
|
+
_store.componentMaps[ccName] = comp;
|
|
2018
|
+
} else {
|
|
2019
|
+
console.error('[@vxe-ui/plugin-render-element 4.0.12] error component.', comp);
|
|
2020
|
+
}
|
|
2021
|
+
},
|
|
1994
2022
|
install: function install(VxeUI, options) {
|
|
1995
|
-
|
|
2023
|
+
if (options) {
|
|
2024
|
+
ElementPlus = options.ElementPlus;
|
|
2025
|
+
Object.assign(_store.globalConfig, options);
|
|
2026
|
+
}
|
|
1996
2027
|
// 检查版本
|
|
1997
2028
|
if (!/^(4)\./.test(VxeUI.uiVersion)) {
|
|
1998
|
-
console.error('[@vxe-ui/plugin-render-element 4.0.
|
|
2029
|
+
console.error('[@vxe-ui/plugin-render-element 4.0.12] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-render-element/install');
|
|
1999
2030
|
}
|
|
2000
2031
|
(0, _table.defineTableRender)(VxeUI);
|
|
2001
2032
|
(0, _form.defineFormRender)(VxeUI);
|
|
@@ -2007,11 +2038,25 @@ var VxeUIPluginRenderElement = exports.VxeUIPluginRenderElement = {
|
|
|
2007
2038
|
VxeUI.interceptor.add('event.clearActived', handleClearEvent);
|
|
2008
2039
|
}
|
|
2009
2040
|
};
|
|
2010
|
-
if (typeof window !== 'undefined'
|
|
2011
|
-
window.VxeUI.use
|
|
2041
|
+
if (typeof window !== 'undefined') {
|
|
2042
|
+
if (window.VxeUI && window.VxeUI.use) {
|
|
2043
|
+
window.VxeUI.use(VxeUIPluginRenderElement);
|
|
2044
|
+
}
|
|
2045
|
+
if (window.ElementPlus) {
|
|
2046
|
+
_store.globalConfig.ElementPlus = window.ElementPlus;
|
|
2047
|
+
}
|
|
2012
2048
|
}
|
|
2013
2049
|
var _default = exports["default"] = VxeUIPluginRenderElement;
|
|
2014
|
-
},{"./form":11,"./form-design":3,"./table":
|
|
2050
|
+
},{"./form":11,"./form-design":3,"./store":13,"./table":14,"xe-utils":"xe-utils"}],13:[function(require,module,exports){
|
|
2051
|
+
"use strict";
|
|
2052
|
+
|
|
2053
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2054
|
+
value: true
|
|
2055
|
+
});
|
|
2056
|
+
exports.globalConfig = exports.componentMaps = void 0;
|
|
2057
|
+
var globalConfig = exports.globalConfig = {};
|
|
2058
|
+
var componentMaps = exports.componentMaps = {};
|
|
2059
|
+
},{}],14:[function(require,module,exports){
|
|
2015
2060
|
"use strict";
|
|
2016
2061
|
|
|
2017
2062
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -2019,6 +2064,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
2019
2064
|
});
|
|
2020
2065
|
exports.defineTableRender = defineTableRender;
|
|
2021
2066
|
var _vue = require("vue");
|
|
2067
|
+
var _comp = require("../util/comp");
|
|
2022
2068
|
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
2023
2069
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
2024
2070
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -2294,12 +2340,12 @@ function defineTableRender(VxeUI) {
|
|
|
2294
2340
|
var name = renderOpts.name,
|
|
2295
2341
|
attrs = renderOpts.attrs;
|
|
2296
2342
|
var cellValue = _xeUtils["default"].get(row, column.field);
|
|
2297
|
-
return [(0, _vue.h)((0,
|
|
2343
|
+
return [(0, _vue.h)((0, _comp.getCurrComponent)(name), _objectSpread(_objectSpread(_objectSpread({}, attrs), getCellEditFilterProps(renderOpts, params, cellValue, defaultProps)), getEditOns(renderOpts, params)))];
|
|
2298
2344
|
};
|
|
2299
2345
|
}
|
|
2300
2346
|
function defaultButtonEditRender(renderOpts, params) {
|
|
2301
2347
|
var attrs = renderOpts.attrs;
|
|
2302
|
-
return [(0, _vue.h)((0,
|
|
2348
|
+
return [(0, _vue.h)((0, _comp.getCurrComponent)('el-button'), _objectSpread(_objectSpread(_objectSpread({}, attrs), getCellEditFilterProps(renderOpts, params, null)), getOns(renderOpts, params)), cellText(renderOpts.content))];
|
|
2303
2349
|
}
|
|
2304
2350
|
function defaultButtonsEditRender(renderOpts, params) {
|
|
2305
2351
|
var children = renderOpts.children;
|
|
@@ -2319,7 +2365,7 @@ function defineTableRender(VxeUI) {
|
|
|
2319
2365
|
"class": 'vxe-table--filter-element-wrapper'
|
|
2320
2366
|
}, column.filters.map(function (option, oIndex) {
|
|
2321
2367
|
var optionValue = option.data;
|
|
2322
|
-
return (0, _vue.h)((0,
|
|
2368
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)(name), _objectSpread(_objectSpread(_objectSpread({
|
|
2323
2369
|
key: oIndex
|
|
2324
2370
|
}, attrs), getCellEditFilterProps(renderOpts, params, optionValue, defaultProps)), getFilterOns(renderOpts, params, option, function () {
|
|
2325
2371
|
// 处理 change 事件相关逻辑
|
|
@@ -2361,7 +2407,7 @@ function defineTableRender(VxeUI) {
|
|
|
2361
2407
|
var labelProp = optionProps.label || 'label';
|
|
2362
2408
|
var valueProp = optionProps.value || 'value';
|
|
2363
2409
|
return _xeUtils["default"].map(options, function (item, oIndex) {
|
|
2364
|
-
return (0, _vue.h)((0,
|
|
2410
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-option'), {
|
|
2365
2411
|
key: oIndex,
|
|
2366
2412
|
value: item[valueProp],
|
|
2367
2413
|
label: item[labelProp],
|
|
@@ -2420,10 +2466,10 @@ function defineTableRender(VxeUI) {
|
|
|
2420
2466
|
if (optionGroups) {
|
|
2421
2467
|
var groupOptions = optionGroupProps.options || 'options';
|
|
2422
2468
|
var groupLabel = optionGroupProps.label || 'label';
|
|
2423
|
-
return [(0, _vue.h)((0,
|
|
2469
|
+
return [(0, _vue.h)((0, _comp.getCurrComponent)('el-select'), _objectSpread(_objectSpread(_objectSpread({}, attrs), props), ons), {
|
|
2424
2470
|
"default": function _default() {
|
|
2425
2471
|
return _xeUtils["default"].map(optionGroups, function (group, gIndex) {
|
|
2426
|
-
return (0, _vue.h)((0,
|
|
2472
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-option-group'), {
|
|
2427
2473
|
key: gIndex,
|
|
2428
2474
|
label: group[groupLabel]
|
|
2429
2475
|
}, {
|
|
@@ -2435,7 +2481,7 @@ function defineTableRender(VxeUI) {
|
|
|
2435
2481
|
}
|
|
2436
2482
|
})];
|
|
2437
2483
|
}
|
|
2438
|
-
return [(0, _vue.h)((0,
|
|
2484
|
+
return [(0, _vue.h)((0, _comp.getCurrComponent)('el-select'), _objectSpread(_objectSpread(_objectSpread({}, props), attrs), ons), {
|
|
2439
2485
|
"default": function _default() {
|
|
2440
2486
|
return renderOptions(options, optionProps);
|
|
2441
2487
|
}
|
|
@@ -2461,7 +2507,7 @@ function defineTableRender(VxeUI) {
|
|
|
2461
2507
|
}, optionGroups ? column.filters.map(function (option, oIndex) {
|
|
2462
2508
|
var optionValue = option.data;
|
|
2463
2509
|
var props = getCellEditFilterProps(renderOpts, params, optionValue);
|
|
2464
|
-
return (0, _vue.h)((0,
|
|
2510
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-select'), _objectSpread(_objectSpread(_objectSpread({
|
|
2465
2511
|
key: oIndex
|
|
2466
2512
|
}, attrs), props), getFilterOns(renderOpts, params, option, function () {
|
|
2467
2513
|
// 处理 change 事件相关逻辑
|
|
@@ -2469,7 +2515,7 @@ function defineTableRender(VxeUI) {
|
|
|
2469
2515
|
})), {
|
|
2470
2516
|
"default": function _default() {
|
|
2471
2517
|
return _xeUtils["default"].map(optionGroups, function (group, gIndex) {
|
|
2472
|
-
return (0, _vue.h)((0,
|
|
2518
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-option-group'), {
|
|
2473
2519
|
key: gIndex,
|
|
2474
2520
|
label: group[groupLabel]
|
|
2475
2521
|
}, {
|
|
@@ -2483,7 +2529,7 @@ function defineTableRender(VxeUI) {
|
|
|
2483
2529
|
}) : column.filters.map(function (option, oIndex) {
|
|
2484
2530
|
var optionValue = option.data;
|
|
2485
2531
|
var props = getCellEditFilterProps(renderOpts, params, optionValue);
|
|
2486
|
-
return (0, _vue.h)((0,
|
|
2532
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)('el-select'), _objectSpread(_objectSpread(_objectSpread({
|
|
2487
2533
|
key: oIndex
|
|
2488
2534
|
}, attrs), props), getFilterOns(renderOpts, params, option, function () {
|
|
2489
2535
|
// 处理 change 事件相关逻辑
|
|
@@ -2536,7 +2582,7 @@ function defineTableRender(VxeUI) {
|
|
|
2536
2582
|
"class": 'vxe-table--filter-element-wrapper'
|
|
2537
2583
|
}, column.filters.map(function (option, oIndex) {
|
|
2538
2584
|
var optionValue = option.data;
|
|
2539
|
-
return (0, _vue.h)((0,
|
|
2585
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)(name), _objectSpread(_objectSpread(_objectSpread({
|
|
2540
2586
|
key: oIndex
|
|
2541
2587
|
}, attrs), getCellEditFilterProps(renderOpts, params, optionValue)), getFilterOns(renderOpts, params, option, function () {
|
|
2542
2588
|
// 处理 change 事件相关逻辑
|
|
@@ -2596,7 +2642,7 @@ function defineTableRender(VxeUI) {
|
|
|
2596
2642
|
"class": 'vxe-table--filter-element-wrapper'
|
|
2597
2643
|
}, column.filters.map(function (option, oIndex) {
|
|
2598
2644
|
var optionValue = option.data;
|
|
2599
|
-
return (0, _vue.h)((0,
|
|
2645
|
+
return (0, _vue.h)((0, _comp.getCurrComponent)(name), _objectSpread(_objectSpread(_objectSpread({
|
|
2600
2646
|
key: oIndex
|
|
2601
2647
|
}, attrs), getCellEditFilterProps(renderOpts, params, optionValue)), getFilterOns(renderOpts, params, option, function () {
|
|
2602
2648
|
// 处理 change 事件相关逻辑
|
|
@@ -2620,4 +2666,16 @@ function defineTableRender(VxeUI) {
|
|
|
2620
2666
|
}
|
|
2621
2667
|
});
|
|
2622
2668
|
}
|
|
2623
|
-
},{"dayjs":"dayjs","vue":"vue","xe-utils":"xe-utils"}]
|
|
2669
|
+
},{"../util/comp":15,"dayjs":"dayjs","vue":"vue","xe-utils":"xe-utils"}],15:[function(require,module,exports){
|
|
2670
|
+
"use strict";
|
|
2671
|
+
|
|
2672
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2673
|
+
value: true
|
|
2674
|
+
});
|
|
2675
|
+
exports.getCurrComponent = getCurrComponent;
|
|
2676
|
+
var _vue = require("vue");
|
|
2677
|
+
var _store = require("../store");
|
|
2678
|
+
function getCurrComponent(name) {
|
|
2679
|
+
return (0, _vue.resolveComponent)(name) || _store.componentMaps[name] || (_store.globalConfig.ElementPlus ? _store.globalConfig.ElementPlus[name] : null);
|
|
2680
|
+
}
|
|
2681
|
+
},{"../store":13,"vue":"vue"}]},{},[12]);
|