@form-create/element-ui 3.1.30 → 3.1.32
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/dist/form-create.esm.js +116 -16
- package/dist/form-create.esm.min.js +2 -2
- package/dist/form-create.js +115 -15
- package/dist/form-create.min.js +2 -2
- package/package.json +6 -6
package/dist/form-create.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @form-create/element-ui v3.1.
|
|
2
|
+
* @form-create/element-ui v3.1.32
|
|
3
3
|
* (c) 2018-2024 xaboy
|
|
4
4
|
* Github https://github.com/xaboy/form-create
|
|
5
5
|
* Released under the MIT License.
|
|
@@ -209,6 +209,10 @@
|
|
|
209
209
|
}, []);
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
+
function toArray(value) {
|
|
213
|
+
return Array.isArray(value) ? value : [null, undefined, ''].indexOf(value) > -1 ? [] : [value];
|
|
214
|
+
}
|
|
215
|
+
|
|
212
216
|
var NAME$9 = 'fcCheckbox';
|
|
213
217
|
var Checkbox = vue.defineComponent({
|
|
214
218
|
name: NAME$9,
|
|
@@ -221,22 +225,72 @@
|
|
|
221
225
|
return [];
|
|
222
226
|
}
|
|
223
227
|
},
|
|
224
|
-
type: String
|
|
228
|
+
type: String,
|
|
229
|
+
input: Boolean,
|
|
230
|
+
inputValue: String
|
|
225
231
|
},
|
|
226
232
|
emits: ['update:modelValue', 'fc.el'],
|
|
227
233
|
setup: function setup(props, _) {
|
|
228
234
|
var options = vue.toRef(props.formCreateInject, 'options', []);
|
|
229
235
|
var value = vue.toRef(props, 'modelValue');
|
|
236
|
+
var inputValue = vue.toRef(props, 'inputValue', '');
|
|
237
|
+
var customValue = vue.ref(inputValue.value);
|
|
238
|
+
var input = vue.toRef(props, 'input', false);
|
|
239
|
+
|
|
240
|
+
var updateCustomValue = function updateCustomValue(n) {
|
|
241
|
+
var _value = _toConsumableArray(toArray(value.value));
|
|
242
|
+
|
|
243
|
+
var idx = _value.indexOf(customValue.value);
|
|
244
|
+
|
|
245
|
+
customValue.value = n;
|
|
246
|
+
|
|
247
|
+
if (idx > -1) {
|
|
248
|
+
_value.splice(idx, 1);
|
|
249
|
+
|
|
250
|
+
_value.push(n);
|
|
251
|
+
|
|
252
|
+
onInput(_value);
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
vue.watch(inputValue, function (n) {
|
|
257
|
+
if (!input.value) {
|
|
258
|
+
customValue.value = n;
|
|
259
|
+
return undefined;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
updateCustomValue(n);
|
|
263
|
+
});
|
|
230
264
|
|
|
231
265
|
var _options = function _options() {
|
|
232
266
|
return Array.isArray(options.value) ? options.value : [];
|
|
233
267
|
};
|
|
234
268
|
|
|
269
|
+
var onInput = function onInput(n) {
|
|
270
|
+
_.emit('update:modelValue', n);
|
|
271
|
+
};
|
|
272
|
+
|
|
235
273
|
return {
|
|
236
274
|
options: _options,
|
|
237
275
|
value: value,
|
|
238
|
-
onInput:
|
|
239
|
-
|
|
276
|
+
onInput: onInput,
|
|
277
|
+
updateCustomValue: updateCustomValue,
|
|
278
|
+
makeInput: function makeInput(Type) {
|
|
279
|
+
if (!input.value) {
|
|
280
|
+
return undefined;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return vue.createVNode(Type, {
|
|
284
|
+
"value": customValue.value,
|
|
285
|
+
"label": customValue.value
|
|
286
|
+
}, {
|
|
287
|
+
"default": function _default() {
|
|
288
|
+
return [vue.createVNode(vue.resolveComponent("ElInput"), {
|
|
289
|
+
"modelValue": customValue.value,
|
|
290
|
+
"onUpdate:modelValue": updateCustomValue
|
|
291
|
+
}, null)];
|
|
292
|
+
}
|
|
293
|
+
});
|
|
240
294
|
}
|
|
241
295
|
};
|
|
242
296
|
},
|
|
@@ -261,6 +315,7 @@
|
|
|
261
315
|
delete props.value;
|
|
262
316
|
delete props.label;
|
|
263
317
|
return vue.createVNode(Type, vue.mergeProps(props, {
|
|
318
|
+
"label": value,
|
|
264
319
|
"value": value,
|
|
265
320
|
"key": name + index + '-' + value
|
|
266
321
|
}), {
|
|
@@ -268,7 +323,7 @@
|
|
|
268
323
|
return [label || value || ''];
|
|
269
324
|
}
|
|
270
325
|
});
|
|
271
|
-
}), (_this$$slots$default = (_this$$slots = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)];
|
|
326
|
+
}), (_this$$slots$default = (_this$$slots = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots), _this.makeInput(Type)];
|
|
272
327
|
}
|
|
273
328
|
}, getSlot(this.$slots, ['default'])));
|
|
274
329
|
},
|
|
@@ -277,10 +332,6 @@
|
|
|
277
332
|
}
|
|
278
333
|
});
|
|
279
334
|
|
|
280
|
-
function toArray(value) {
|
|
281
|
-
return Array.isArray(value) ? value : [null, undefined, ''].indexOf(value) > -1 ? [] : [value];
|
|
282
|
-
}
|
|
283
|
-
|
|
284
335
|
// https://github.com/developit/mitt
|
|
285
336
|
function Mitt(all) {
|
|
286
337
|
all = all || new Map();
|
|
@@ -967,22 +1018,66 @@
|
|
|
967
1018
|
type: [String, Number, Boolean],
|
|
968
1019
|
"default": ''
|
|
969
1020
|
},
|
|
970
|
-
type: String
|
|
1021
|
+
type: String,
|
|
1022
|
+
input: Boolean,
|
|
1023
|
+
inputValue: String
|
|
971
1024
|
},
|
|
972
1025
|
emits: ['update:modelValue', 'fc.el'],
|
|
973
1026
|
setup: function setup(props, _) {
|
|
974
1027
|
var options = vue.toRef(props.formCreateInject, 'options', []);
|
|
975
1028
|
var value = vue.toRef(props, 'modelValue');
|
|
1029
|
+
var inputValue = vue.toRef(props, 'inputValue', '');
|
|
1030
|
+
var customValue = vue.ref(inputValue.value);
|
|
1031
|
+
var input = vue.toRef(props, 'input', false);
|
|
976
1032
|
|
|
977
1033
|
var _options = function _options() {
|
|
978
1034
|
return Array.isArray(options.value) ? options.value : [];
|
|
979
1035
|
};
|
|
980
1036
|
|
|
1037
|
+
vue.watch(inputValue, function (n) {
|
|
1038
|
+
if (!input.value) {
|
|
1039
|
+
customValue.value = n;
|
|
1040
|
+
return undefined;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
updateCustomValue(n);
|
|
1044
|
+
});
|
|
1045
|
+
|
|
1046
|
+
var onInput = function onInput(n) {
|
|
1047
|
+
_.emit('update:modelValue', n);
|
|
1048
|
+
};
|
|
1049
|
+
|
|
1050
|
+
var updateCustomValue = function updateCustomValue(n) {
|
|
1051
|
+
var o = customValue.value;
|
|
1052
|
+
customValue.value = n;
|
|
1053
|
+
|
|
1054
|
+
if (value.value === o) {
|
|
1055
|
+
onInput(n);
|
|
1056
|
+
}
|
|
1057
|
+
};
|
|
1058
|
+
|
|
981
1059
|
return {
|
|
982
1060
|
options: _options,
|
|
983
1061
|
value: value,
|
|
984
|
-
onInput:
|
|
985
|
-
|
|
1062
|
+
onInput: onInput,
|
|
1063
|
+
updateCustomValue: updateCustomValue,
|
|
1064
|
+
customValue: customValue,
|
|
1065
|
+
makeInput: function makeInput(Type) {
|
|
1066
|
+
if (!input.value) {
|
|
1067
|
+
return undefined;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
return vue.createVNode(Type, {
|
|
1071
|
+
"value": customValue.value,
|
|
1072
|
+
"label": customValue.value
|
|
1073
|
+
}, {
|
|
1074
|
+
"default": function _default() {
|
|
1075
|
+
return [vue.createVNode(vue.resolveComponent("ElInput"), {
|
|
1076
|
+
"modelValue": customValue.value,
|
|
1077
|
+
"onUpdate:modelValue": updateCustomValue
|
|
1078
|
+
}, null)];
|
|
1079
|
+
}
|
|
1080
|
+
});
|
|
986
1081
|
}
|
|
987
1082
|
};
|
|
988
1083
|
},
|
|
@@ -1007,6 +1102,7 @@
|
|
|
1007
1102
|
delete props.value;
|
|
1008
1103
|
delete props.label;
|
|
1009
1104
|
return vue.createVNode(Type, vue.mergeProps(props, {
|
|
1105
|
+
"label": value,
|
|
1010
1106
|
"value": value,
|
|
1011
1107
|
"key": name + index + '-' + value
|
|
1012
1108
|
}), {
|
|
@@ -1014,7 +1110,7 @@
|
|
|
1014
1110
|
return [label || value || ''];
|
|
1015
1111
|
}
|
|
1016
1112
|
});
|
|
1017
|
-
}), (_this$$slots$default = (_this$$slots = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)];
|
|
1113
|
+
}), (_this$$slots$default = (_this$$slots = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots), _this.makeInput(Type)];
|
|
1018
1114
|
}
|
|
1019
1115
|
}, getSlot(this.$slots, ['default'])));
|
|
1020
1116
|
},
|
|
@@ -2232,6 +2328,10 @@
|
|
|
2232
2328
|
}
|
|
2233
2329
|
});
|
|
2234
2330
|
|
|
2331
|
+
if (props.option && props.option.style) {
|
|
2332
|
+
content += props.option.style;
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2235
2335
|
if (content) {
|
|
2236
2336
|
styleEl = document.createElement('style');
|
|
2237
2337
|
styleEl.type = 'text/css';
|
|
@@ -6309,7 +6409,7 @@
|
|
|
6309
6409
|
},
|
|
6310
6410
|
mergeOptions: function mergeOptions(target, opt, parent) {
|
|
6311
6411
|
opt = deepCopy(opt);
|
|
6312
|
-
parent && ['page', 'onSubmit', 'mounted', 'reload', 'formData', 'el', 'globalClass'].forEach(function (n) {
|
|
6412
|
+
parent && ['page', 'onSubmit', 'mounted', 'reload', 'formData', 'el', 'globalClass', 'style'].forEach(function (n) {
|
|
6313
6413
|
delete opt[n];
|
|
6314
6414
|
});
|
|
6315
6415
|
|
|
@@ -7318,7 +7418,7 @@
|
|
|
7318
7418
|
function elmFormCreate() {
|
|
7319
7419
|
return FormCreateFactory({
|
|
7320
7420
|
ui: 'element-ui',
|
|
7321
|
-
version: '3.1.
|
|
7421
|
+
version: '3.1.32',
|
|
7322
7422
|
manager: manager,
|
|
7323
7423
|
extendApi: extendApi,
|
|
7324
7424
|
install: install,
|