@tmagic/form 1.0.0-beta.11 → 1.0.0-beta.14
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 +1 -0
- package/coverage/clover.xml +1361 -0
- package/coverage/coverage-final.json +38 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +176 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/src/Form.vue.html +676 -0
- package/coverage/lcov-report/src/FormDialog.vue.html +583 -0
- package/coverage/lcov-report/src/containers/Col.vue.html +253 -0
- package/coverage/lcov-report/src/containers/Container.vue.html +913 -0
- package/coverage/lcov-report/src/containers/Fieldset.vue.html +499 -0
- package/coverage/lcov-report/src/containers/GroupList.vue.html +541 -0
- package/coverage/lcov-report/src/containers/GroupListItem.vue.html +562 -0
- package/coverage/lcov-report/src/containers/Panel.vue.html +403 -0
- package/coverage/lcov-report/src/containers/Row.vue.html +277 -0
- package/coverage/lcov-report/src/containers/Step.vue.html +331 -0
- package/coverage/lcov-report/src/containers/Table.vue.html +1963 -0
- package/coverage/lcov-report/src/containers/Tabs.vue.html +625 -0
- package/coverage/lcov-report/src/containers/index.html +251 -0
- package/coverage/lcov-report/src/fields/Cascader.vue.html +526 -0
- package/coverage/lcov-report/src/fields/Checkbox.vue.html +286 -0
- package/coverage/lcov-report/src/fields/CheckboxGroup.vue.html +217 -0
- package/coverage/lcov-report/src/fields/ColorPicker.vue.html +199 -0
- package/coverage/lcov-report/src/fields/Date.vue.html +238 -0
- package/coverage/lcov-report/src/fields/DateTime.vue.html +262 -0
- package/coverage/lcov-report/src/fields/Daterange.vue.html +310 -0
- package/coverage/lcov-report/src/fields/Display.vue.html +187 -0
- package/coverage/lcov-report/src/fields/DynamicField.vue.html +412 -0
- package/coverage/lcov-report/src/fields/Hidden.vue.html +172 -0
- package/coverage/lcov-report/src/fields/Link.vue.html +421 -0
- package/coverage/lcov-report/src/fields/Number.vue.html +244 -0
- package/coverage/lcov-report/src/fields/RadioGroup.vue.html +184 -0
- package/coverage/lcov-report/src/fields/Select.vue.html +1267 -0
- package/coverage/lcov-report/src/fields/Switch.vue.html +280 -0
- package/coverage/lcov-report/src/fields/Text.vue.html +487 -0
- package/coverage/lcov-report/src/fields/Textarea.vue.html +265 -0
- package/coverage/lcov-report/src/fields/Time.vue.html +229 -0
- package/coverage/lcov-report/src/fields/index.html +371 -0
- package/coverage/lcov-report/src/index.html +146 -0
- package/coverage/lcov-report/src/index.ts.html +466 -0
- package/coverage/lcov-report/src/theme/index.html +116 -0
- package/coverage/lcov-report/src/theme/index.scss.html +112 -0
- package/coverage/lcov-report/src/utils/config.ts.html +166 -0
- package/coverage/lcov-report/src/utils/createForm.ts.html +160 -0
- package/coverage/lcov-report/src/utils/fieldProps.ts.html +202 -0
- package/coverage/lcov-report/src/utils/form.ts.html +895 -0
- package/coverage/lcov-report/src/utils/index.html +176 -0
- package/coverage/lcov-report/src/utils/useAddField.ts.html +205 -0
- package/coverage/lcov.info +3060 -0
- package/dist/style.css +2 -2
- package/dist/tmagic-form.es.js +129 -91
- package/dist/tmagic-form.es.js.map +1 -1
- package/dist/tmagic-form.umd.js +130 -93
- package/dist/tmagic-form.umd.js.map +1 -1
- package/dist/types/src/Form.vue.d.ts +354 -0
- package/dist/types/src/FormDialog.vue.d.ts +741 -0
- package/dist/types/src/containers/Col.vue.d.ts +42 -0
- package/dist/types/src/containers/Row.vue.d.ts +0 -1
- package/dist/types/src/fields/Checkbox.vue.d.ts +2 -2
- package/dist/types/src/fields/Link.vue.d.ts +1564 -0
- package/package.json +15 -6
- package/src/Form.vue +2 -2
- package/src/FormDialog.vue +1 -1
- package/src/containers/Col.vue +56 -0
- package/src/containers/Row.vue +14 -18
- package/src/fields/Checkbox.vue +2 -2
- package/src/fields/Select.vue +1 -3
- package/src/fields/Text.vue +3 -3
- package/src/fields/Textarea.vue +11 -13
- package/src/utils/form.ts +5 -1
- package/tsconfig.json +0 -9
- package/vite.config.ts +0 -27
package/dist/style.css
CHANGED
|
@@ -48,7 +48,7 @@ div.m-fields-link {
|
|
|
48
48
|
|
|
49
49
|
fieldset.m-fieldset {
|
|
50
50
|
position: relative;
|
|
51
|
-
border: 1px solid
|
|
51
|
+
border: 1px solid rgb(229, 229, 229);
|
|
52
52
|
margin-top: 10px;
|
|
53
53
|
margin-bottom: 10px;
|
|
54
54
|
min-inline-size: auto;
|
|
@@ -59,7 +59,7 @@ fieldset.m-fieldset legend {
|
|
|
59
59
|
border: 0;
|
|
60
60
|
top: -10px;
|
|
61
61
|
left: 20px;
|
|
62
|
-
background:
|
|
62
|
+
background: rgb(255, 255, 255);
|
|
63
63
|
width: auto;
|
|
64
64
|
padding: 0px 3px;
|
|
65
65
|
font-weight: bold;
|
package/dist/tmagic-form.es.js
CHANGED
|
@@ -59,7 +59,11 @@ const initValueItem = function(mForm, item, initValue2, value) {
|
|
|
59
59
|
asyncLoadConfig(value, initValue2, item);
|
|
60
60
|
if (name && !items && typeof initValue2[name] !== "undefined") {
|
|
61
61
|
if (typeof value[name] === "undefined") {
|
|
62
|
-
|
|
62
|
+
if (type === "number") {
|
|
63
|
+
value[name] = Number(initValue2[name]);
|
|
64
|
+
} else {
|
|
65
|
+
value[name] = typeof initValue2[name] === "object" ? cloneDeep(initValue2[name]) : initValue2[name];
|
|
66
|
+
}
|
|
63
67
|
}
|
|
64
68
|
return value;
|
|
65
69
|
}
|
|
@@ -169,7 +173,7 @@ var _export_sfc = (sfc, props) => {
|
|
|
169
173
|
return target;
|
|
170
174
|
};
|
|
171
175
|
|
|
172
|
-
const _sfc_main$
|
|
176
|
+
const _sfc_main$t = defineComponent({
|
|
173
177
|
name: "m-form-container",
|
|
174
178
|
components: { WarningFilled },
|
|
175
179
|
props: {
|
|
@@ -299,7 +303,7 @@ const _sfc_main$s = defineComponent({
|
|
|
299
303
|
};
|
|
300
304
|
}
|
|
301
305
|
});
|
|
302
|
-
const _hoisted_1$
|
|
306
|
+
const _hoisted_1$f = ["innerHTML"];
|
|
303
307
|
const _hoisted_2$7 = ["innerHTML"];
|
|
304
308
|
const _hoisted_3$7 = ["innerHTML"];
|
|
305
309
|
const _hoisted_4$6 = ["innerHTML"];
|
|
@@ -307,7 +311,7 @@ const _hoisted_5$4 = {
|
|
|
307
311
|
key: 4,
|
|
308
312
|
style: { "text-align": "center" }
|
|
309
313
|
};
|
|
310
|
-
function _sfc_render$
|
|
314
|
+
function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
311
315
|
const _component_m_fields_hidden = resolveComponent("m-fields-hidden");
|
|
312
316
|
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
313
317
|
const _component_el_form_item = resolveComponent("el-form-item");
|
|
@@ -348,7 +352,7 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
348
352
|
label: withCtx(() => [
|
|
349
353
|
createElementVNode("span", {
|
|
350
354
|
innerHTML: _ctx.type === "checkbox" ? "" : _ctx.config.text
|
|
351
|
-
}, null, 8, _hoisted_1$
|
|
355
|
+
}, null, 8, _hoisted_1$f)
|
|
352
356
|
]),
|
|
353
357
|
default: withCtx(() => [
|
|
354
358
|
_ctx.tooltip ? (openBlock(), createBlock(_component_el_tooltip, { key: 0 }, {
|
|
@@ -433,9 +437,9 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
433
437
|
])) : createCommentVNode("", true)
|
|
434
438
|
], 6)) : createCommentVNode("", true);
|
|
435
439
|
}
|
|
436
|
-
var Container = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
440
|
+
var Container = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$q]]);
|
|
437
441
|
|
|
438
|
-
const _sfc_main$
|
|
442
|
+
const _sfc_main$s = defineComponent({
|
|
439
443
|
name: "m-form-fieldset",
|
|
440
444
|
props: {
|
|
441
445
|
labelWidth: String,
|
|
@@ -487,7 +491,7 @@ const _sfc_main$r = defineComponent({
|
|
|
487
491
|
};
|
|
488
492
|
}
|
|
489
493
|
});
|
|
490
|
-
const _hoisted_1$
|
|
494
|
+
const _hoisted_1$e = ["innerHTML"];
|
|
491
495
|
const _hoisted_2$6 = ["innerHTML"];
|
|
492
496
|
const _hoisted_3$6 = { key: 1 };
|
|
493
497
|
const _hoisted_4$5 = ["innerHTML"];
|
|
@@ -501,7 +505,7 @@ const _hoisted_9$1 = {
|
|
|
501
505
|
};
|
|
502
506
|
const _hoisted_10$1 = { style: { "flex": "1" } };
|
|
503
507
|
const _hoisted_11 = ["src"];
|
|
504
|
-
function _sfc_render$
|
|
508
|
+
function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
505
509
|
const _component_el_checkbox = resolveComponent("el-checkbox");
|
|
506
510
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
507
511
|
return (_ctx.name ? _ctx.model[_ctx.name] : _ctx.model) ? (openBlock(), createElementBlock("fieldset", {
|
|
@@ -521,7 +525,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
521
525
|
default: withCtx(() => [
|
|
522
526
|
createElementVNode("span", {
|
|
523
527
|
innerHTML: _ctx.config.legend
|
|
524
|
-
}, null, 8, _hoisted_1$
|
|
528
|
+
}, null, 8, _hoisted_1$e),
|
|
525
529
|
_ctx.config.extra ? (openBlock(), createElementBlock("span", {
|
|
526
530
|
key: 0,
|
|
527
531
|
innerHTML: _ctx.config.extra,
|
|
@@ -593,9 +597,9 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
593
597
|
}), 128)) : createCommentVNode("", true)
|
|
594
598
|
], 4)) : createCommentVNode("", true);
|
|
595
599
|
}
|
|
596
|
-
var Fieldset = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
600
|
+
var Fieldset = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$p]]);
|
|
597
601
|
|
|
598
|
-
const _sfc_main$
|
|
602
|
+
const _sfc_main$r = defineComponent({
|
|
599
603
|
name: "m-form-group-list-item",
|
|
600
604
|
components: { CaretRight, CaretBottom },
|
|
601
605
|
props: {
|
|
@@ -679,11 +683,11 @@ const _sfc_main$q = defineComponent({
|
|
|
679
683
|
};
|
|
680
684
|
}
|
|
681
685
|
});
|
|
682
|
-
const _hoisted_1$
|
|
686
|
+
const _hoisted_1$d = { class: "m-fields-group-list-item" };
|
|
683
687
|
const _hoisted_2$5 = /* @__PURE__ */ createTextVNode("\u4E0A\u79FB");
|
|
684
688
|
const _hoisted_3$5 = /* @__PURE__ */ createTextVNode("\u4E0B\u79FB");
|
|
685
689
|
const _hoisted_4$4 = ["innerHTML"];
|
|
686
|
-
function _sfc_render$
|
|
690
|
+
function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
687
691
|
const _component_caret_bottom = resolveComponent("caret-bottom");
|
|
688
692
|
const _component_caret_right = resolveComponent("caret-right");
|
|
689
693
|
const _component_el_icon = resolveComponent("el-icon");
|
|
@@ -691,7 +695,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
691
695
|
const _component_CaretRight = resolveComponent("CaretRight");
|
|
692
696
|
const _component_CaretBottom = resolveComponent("CaretBottom");
|
|
693
697
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
694
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
698
|
+
return openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
695
699
|
createElementVNode("div", null, [
|
|
696
700
|
createVNode(_component_el_icon, {
|
|
697
701
|
style: { "margin-right": "7px" },
|
|
@@ -774,9 +778,9 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
774
778
|
}, null, 8, ["config", "model", "labelWidth", "prop", "size", "onChange"])) : createCommentVNode("", true)
|
|
775
779
|
]);
|
|
776
780
|
}
|
|
777
|
-
var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
781
|
+
var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$o]]);
|
|
778
782
|
|
|
779
|
-
const _sfc_main$
|
|
783
|
+
const _sfc_main$q = defineComponent({
|
|
780
784
|
name: "m-form-group-list",
|
|
781
785
|
components: { MFieldsGroupListItem },
|
|
782
786
|
props: {
|
|
@@ -868,7 +872,7 @@ const _sfc_main$p = defineComponent({
|
|
|
868
872
|
};
|
|
869
873
|
}
|
|
870
874
|
});
|
|
871
|
-
const _hoisted_1$
|
|
875
|
+
const _hoisted_1$c = { class: "m-fields-group-list" };
|
|
872
876
|
const _hoisted_2$4 = ["innerHTML"];
|
|
873
877
|
const _hoisted_3$4 = {
|
|
874
878
|
key: 1,
|
|
@@ -880,10 +884,10 @@ const _hoisted_5$2 = [
|
|
|
880
884
|
];
|
|
881
885
|
const _hoisted_6$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0\u7EC4");
|
|
882
886
|
const _hoisted_7$1 = /* @__PURE__ */ createTextVNode("\u5207\u6362\u4E3A\u8868\u683C");
|
|
883
|
-
function _sfc_render$
|
|
887
|
+
function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
884
888
|
const _component_m_fields_group_list_item = resolveComponent("m-fields-group-list-item");
|
|
885
889
|
const _component_el_button = resolveComponent("el-button");
|
|
886
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
890
|
+
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
887
891
|
_ctx.config.extra ? (openBlock(), createElementBlock("div", {
|
|
888
892
|
key: 0,
|
|
889
893
|
innerHTML: _ctx.config.extra,
|
|
@@ -927,9 +931,9 @@ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
927
931
|
}, 8, ["onClick"])) : createCommentVNode("", true)
|
|
928
932
|
]);
|
|
929
933
|
}
|
|
930
|
-
var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
934
|
+
var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$n]]);
|
|
931
935
|
|
|
932
|
-
const _sfc_main$
|
|
936
|
+
const _sfc_main$p = defineComponent({
|
|
933
937
|
name: "m-form-panel",
|
|
934
938
|
components: { CaretBottom, CaretRight },
|
|
935
939
|
props: {
|
|
@@ -962,7 +966,7 @@ const _sfc_main$o = defineComponent({
|
|
|
962
966
|
};
|
|
963
967
|
}
|
|
964
968
|
});
|
|
965
|
-
const _hoisted_1$
|
|
969
|
+
const _hoisted_1$b = { class: "clearfix" };
|
|
966
970
|
const _hoisted_2$3 = ["innerHTML"];
|
|
967
971
|
const _hoisted_3$3 = {
|
|
968
972
|
key: 0,
|
|
@@ -970,7 +974,7 @@ const _hoisted_3$3 = {
|
|
|
970
974
|
};
|
|
971
975
|
const _hoisted_4$2 = { style: { "flex": "1" } };
|
|
972
976
|
const _hoisted_5$1 = ["src"];
|
|
973
|
-
function _sfc_render$
|
|
977
|
+
function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
974
978
|
const _component_caret_bottom = resolveComponent("caret-bottom");
|
|
975
979
|
const _component_caret_right = resolveComponent("caret-right");
|
|
976
980
|
const _component_el_icon = resolveComponent("el-icon");
|
|
@@ -982,7 +986,7 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
982
986
|
"body-style": { display: _ctx.expand ? "block" : "none" }
|
|
983
987
|
}, {
|
|
984
988
|
header: withCtx(() => [
|
|
985
|
-
createElementVNode("div", _hoisted_1$
|
|
989
|
+
createElementVNode("div", _hoisted_1$b, [
|
|
986
990
|
createElementVNode("a", {
|
|
987
991
|
href: "javascript:",
|
|
988
992
|
style: { "width": "100%", "display": "block" },
|
|
@@ -1040,10 +1044,60 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1040
1044
|
_: 3
|
|
1041
1045
|
}, 8, ["body-style"])) : createCommentVNode("", true);
|
|
1042
1046
|
}
|
|
1043
|
-
var Panel = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1047
|
+
var Panel = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$m]]);
|
|
1048
|
+
|
|
1049
|
+
const _sfc_main$o = defineComponent({
|
|
1050
|
+
props: {
|
|
1051
|
+
labelWidth: String,
|
|
1052
|
+
expandMore: Boolean,
|
|
1053
|
+
span: Number,
|
|
1054
|
+
model: {
|
|
1055
|
+
type: Object,
|
|
1056
|
+
default: () => ({})
|
|
1057
|
+
},
|
|
1058
|
+
config: {
|
|
1059
|
+
type: Object,
|
|
1060
|
+
default: () => ({})
|
|
1061
|
+
},
|
|
1062
|
+
prop: String,
|
|
1063
|
+
size: String
|
|
1064
|
+
},
|
|
1065
|
+
emits: ["change"],
|
|
1066
|
+
setup(props, { emit }) {
|
|
1067
|
+
const mForm = inject("mForm");
|
|
1068
|
+
const changeHandler = () => emit("change", props.model);
|
|
1069
|
+
return {
|
|
1070
|
+
mForm,
|
|
1071
|
+
display: computed(() => display(mForm, props.config.display, props)),
|
|
1072
|
+
changeHandler
|
|
1073
|
+
};
|
|
1074
|
+
}
|
|
1075
|
+
});
|
|
1076
|
+
function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1077
|
+
const _component_m_form_container = resolveComponent("m-form-container");
|
|
1078
|
+
const _component_el_col = resolveComponent("el-col");
|
|
1079
|
+
return withDirectives((openBlock(), createBlock(_component_el_col, { span: _ctx.span }, {
|
|
1080
|
+
default: withCtx(() => [
|
|
1081
|
+
createVNode(_component_m_form_container, {
|
|
1082
|
+
model: _ctx.model,
|
|
1083
|
+
config: _ctx.config,
|
|
1084
|
+
prop: _ctx.prop,
|
|
1085
|
+
"label-width": _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1086
|
+
"expand-more": _ctx.expandMore,
|
|
1087
|
+
size: _ctx.size,
|
|
1088
|
+
onChange: _ctx.changeHandler
|
|
1089
|
+
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size", "onChange"])
|
|
1090
|
+
]),
|
|
1091
|
+
_: 1
|
|
1092
|
+
}, 8, ["span"])), [
|
|
1093
|
+
[vShow, _ctx.display && _ctx.config.type !== "hidden"]
|
|
1094
|
+
]);
|
|
1095
|
+
}
|
|
1096
|
+
var Col = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$l]]);
|
|
1044
1097
|
|
|
1045
1098
|
const _sfc_main$n = defineComponent({
|
|
1046
1099
|
name: "m-form-row",
|
|
1100
|
+
components: { Col },
|
|
1047
1101
|
props: {
|
|
1048
1102
|
labelWidth: String,
|
|
1049
1103
|
expandMore: Boolean,
|
|
@@ -1065,38 +1119,27 @@ const _sfc_main$n = defineComponent({
|
|
|
1065
1119
|
const changeHandler = () => emit("change", props.name ? props.model[props.name] : props.model);
|
|
1066
1120
|
return {
|
|
1067
1121
|
mForm,
|
|
1068
|
-
display(config) {
|
|
1069
|
-
return display(mForm, config.display, props);
|
|
1070
|
-
},
|
|
1071
1122
|
changeHandler
|
|
1072
1123
|
};
|
|
1073
1124
|
}
|
|
1074
1125
|
});
|
|
1075
1126
|
function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1076
|
-
const
|
|
1077
|
-
const _component_el_col = resolveComponent("el-col");
|
|
1127
|
+
const _component_Col = resolveComponent("Col");
|
|
1078
1128
|
const _component_el_row = resolveComponent("el-row");
|
|
1079
1129
|
return openBlock(), createBlock(_component_el_row, { gutter: 10 }, {
|
|
1080
1130
|
default: withCtx(() => [
|
|
1081
1131
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.config.items, (col, index) => {
|
|
1082
|
-
return openBlock(), createBlock(
|
|
1083
|
-
style: normalizeStyle(!_ctx.display(col) || col.type === "hidden" ? "display: none" : ""),
|
|
1132
|
+
return openBlock(), createBlock(_component_Col, {
|
|
1084
1133
|
key: col[_ctx.mForm?.keyProp || "__key"] ?? index,
|
|
1085
|
-
span:
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
size: _ctx.size,
|
|
1095
|
-
onChange: _ctx.changeHandler
|
|
1096
|
-
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size", "onChange"])
|
|
1097
|
-
]),
|
|
1098
|
-
_: 2
|
|
1099
|
-
}, 1032, ["style", "span"]);
|
|
1134
|
+
span: _ctx.config.span || _ctx.config.span || 24 / _ctx.config.items.length,
|
|
1135
|
+
config: col,
|
|
1136
|
+
labelWidth: _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1137
|
+
expandMore: _ctx.expandMore,
|
|
1138
|
+
model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
|
|
1139
|
+
prop: _ctx.prop,
|
|
1140
|
+
size: _ctx.size,
|
|
1141
|
+
onChange: _ctx.changeHandler
|
|
1142
|
+
}, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "prop", "size", "onChange"]);
|
|
1100
1143
|
}), 128))
|
|
1101
1144
|
]),
|
|
1102
1145
|
_: 1
|
|
@@ -1555,7 +1598,7 @@ const _sfc_main$l = defineComponent({
|
|
|
1555
1598
|
};
|
|
1556
1599
|
}
|
|
1557
1600
|
});
|
|
1558
|
-
const _hoisted_1$
|
|
1601
|
+
const _hoisted_1$a = ["innerHTML"];
|
|
1559
1602
|
const _hoisted_2$2 = { class: "el-form-item__content" };
|
|
1560
1603
|
const _hoisted_3$2 = ["innerHTML"];
|
|
1561
1604
|
const _hoisted_4$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0");
|
|
@@ -1584,7 +1627,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1584
1627
|
key: 0,
|
|
1585
1628
|
style: { "color": "rgba(0, 0, 0, 0.45)" },
|
|
1586
1629
|
innerHTML: _ctx.config.extra
|
|
1587
|
-
}, null, 8, _hoisted_1$
|
|
1630
|
+
}, null, 8, _hoisted_1$a)) : createCommentVNode("", true),
|
|
1588
1631
|
createElementVNode("div", _hoisted_2$2, [
|
|
1589
1632
|
createVNode(_component_el_tooltip, {
|
|
1590
1633
|
content: "\u62D6\u62FD\u53EF\u6392\u5E8F",
|
|
@@ -2106,13 +2149,13 @@ const _sfc_main$j = defineComponent({
|
|
|
2106
2149
|
};
|
|
2107
2150
|
}
|
|
2108
2151
|
});
|
|
2109
|
-
const _hoisted_1$
|
|
2152
|
+
const _hoisted_1$9 = {
|
|
2110
2153
|
class: "m-cascader",
|
|
2111
2154
|
style: { "width": "100%" }
|
|
2112
2155
|
};
|
|
2113
2156
|
function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2114
2157
|
const _component_el_cascader = resolveComponent("el-cascader");
|
|
2115
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2158
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
2116
2159
|
createVNode(_component_el_cascader, {
|
|
2117
2160
|
modelValue: _ctx.model[_ctx.name],
|
|
2118
2161
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2152,7 +2195,7 @@ const _sfc_main$i = defineComponent({
|
|
|
2152
2195
|
} else {
|
|
2153
2196
|
return props.config.activeValue;
|
|
2154
2197
|
}
|
|
2155
|
-
return
|
|
2198
|
+
return void 0;
|
|
2156
2199
|
}),
|
|
2157
2200
|
inactiveValue: computed(() => {
|
|
2158
2201
|
if (typeof props.config.inactiveValue === "undefined") {
|
|
@@ -2162,7 +2205,7 @@ const _sfc_main$i = defineComponent({
|
|
|
2162
2205
|
} else {
|
|
2163
2206
|
return props.config.inactiveValue;
|
|
2164
2207
|
}
|
|
2165
|
-
return
|
|
2208
|
+
return void 0;
|
|
2166
2209
|
}),
|
|
2167
2210
|
changeHandler(value) {
|
|
2168
2211
|
emit("change", value);
|
|
@@ -2235,7 +2278,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2235
2278
|
}
|
|
2236
2279
|
var CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$e]]);
|
|
2237
2280
|
|
|
2238
|
-
const _hoisted_1$
|
|
2281
|
+
const _hoisted_1$8 = { key: 0 };
|
|
2239
2282
|
const __default__$2 = defineComponent({
|
|
2240
2283
|
name: "m-fields-color-picker"
|
|
2241
2284
|
});
|
|
@@ -2255,7 +2298,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
2255
2298
|
const changeHandler = (value) => emit("change", value);
|
|
2256
2299
|
return (_ctx, _cache) => {
|
|
2257
2300
|
const _component_el_color_picker = resolveComponent("el-color-picker");
|
|
2258
|
-
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2301
|
+
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
2259
2302
|
createVNode(_component_el_color_picker, {
|
|
2260
2303
|
modelValue: _ctx.model[_ctx.name],
|
|
2261
2304
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2291,10 +2334,10 @@ const _sfc_main$f = defineComponent({
|
|
|
2291
2334
|
};
|
|
2292
2335
|
}
|
|
2293
2336
|
});
|
|
2294
|
-
const _hoisted_1$
|
|
2337
|
+
const _hoisted_1$7 = { key: 0 };
|
|
2295
2338
|
function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2296
2339
|
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
2297
|
-
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2340
|
+
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
2298
2341
|
createVNode(_component_el_date_picker, {
|
|
2299
2342
|
modelValue: _ctx.model[_ctx.modelName],
|
|
2300
2343
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.modelName] = $event),
|
|
@@ -2398,10 +2441,10 @@ const _sfc_main$d = defineComponent({
|
|
|
2398
2441
|
};
|
|
2399
2442
|
}
|
|
2400
2443
|
});
|
|
2401
|
-
const _hoisted_1$
|
|
2444
|
+
const _hoisted_1$6 = { key: 0 };
|
|
2402
2445
|
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2403
2446
|
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
2404
|
-
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2447
|
+
return _ctx.model ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
2405
2448
|
createVNode(_component_el_date_picker, {
|
|
2406
2449
|
modelValue: _ctx.model[_ctx.name],
|
|
2407
2450
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2418,7 +2461,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2418
2461
|
}
|
|
2419
2462
|
var DateTime = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$b]]);
|
|
2420
2463
|
|
|
2421
|
-
const _hoisted_1$
|
|
2464
|
+
const _hoisted_1$5 = { key: 0 };
|
|
2422
2465
|
const __default__$1 = defineComponent({
|
|
2423
2466
|
name: "m-fields-display"
|
|
2424
2467
|
});
|
|
@@ -2439,7 +2482,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
2439
2482
|
}
|
|
2440
2483
|
useAddField(props.prop);
|
|
2441
2484
|
return (_ctx, _cache) => {
|
|
2442
|
-
return _ctx.model ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
2485
|
+
return _ctx.model ? (openBlock(), createElementBlock("span", _hoisted_1$5, toDisplayString(_ctx.model[unref(n)]), 1)) : createCommentVNode("", true);
|
|
2443
2486
|
};
|
|
2444
2487
|
}
|
|
2445
2488
|
});
|
|
@@ -2509,12 +2552,12 @@ const _sfc_main$b = defineComponent({
|
|
|
2509
2552
|
}
|
|
2510
2553
|
}
|
|
2511
2554
|
});
|
|
2512
|
-
const _hoisted_1$
|
|
2555
|
+
const _hoisted_1$4 = { class: "m-fields-dynamic-field" };
|
|
2513
2556
|
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2514
2557
|
const _component_el_input = resolveComponent("el-input");
|
|
2515
2558
|
const _component_el_form_item = resolveComponent("el-form-item");
|
|
2516
2559
|
const _component_el_form = resolveComponent("el-form");
|
|
2517
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2560
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
2518
2561
|
createVNode(_component_el_form, { size: "small" }, {
|
|
2519
2562
|
default: withCtx(() => [
|
|
2520
2563
|
(openBlock(true), createElementBlock(Fragment, null, renderList(Object.keys(_ctx.fieldMap.value), (key) => {
|
|
@@ -2636,7 +2679,7 @@ const _sfc_main$9 = defineComponent({
|
|
|
2636
2679
|
};
|
|
2637
2680
|
}
|
|
2638
2681
|
});
|
|
2639
|
-
const _hoisted_1$
|
|
2682
|
+
const _hoisted_1$3 = ["href"];
|
|
2640
2683
|
const _hoisted_2$1 = {
|
|
2641
2684
|
key: 2,
|
|
2642
2685
|
class: "m-fields-link"
|
|
@@ -2650,7 +2693,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2650
2693
|
target: "_blank",
|
|
2651
2694
|
href: _ctx.href,
|
|
2652
2695
|
style: normalizeStyle(_ctx.config.css || {})
|
|
2653
|
-
}, toDisplayString(_ctx.displayText), 13, _hoisted_1$
|
|
2696
|
+
}, toDisplayString(_ctx.displayText), 13, _hoisted_1$3)) : _ctx.config.href && _ctx.disabled ? (openBlock(), createElementBlock("span", {
|
|
2654
2697
|
key: 1,
|
|
2655
2698
|
style: normalizeStyle(_ctx.config.disabledCss || {})
|
|
2656
2699
|
}, toDisplayString(_ctx.displayText), 5)) : (openBlock(), createElementBlock("div", _hoisted_2$1, [
|
|
@@ -3002,8 +3045,6 @@ const _sfc_main$6 = defineComponent({
|
|
|
3002
3045
|
getRequestFuc() {
|
|
3003
3046
|
return getConfig("request");
|
|
3004
3047
|
},
|
|
3005
|
-
async getInitOption() {
|
|
3006
|
-
},
|
|
3007
3048
|
changeHandler(value) {
|
|
3008
3049
|
emit("change", value);
|
|
3009
3050
|
},
|
|
@@ -3038,7 +3079,7 @@ const _sfc_main$6 = defineComponent({
|
|
|
3038
3079
|
};
|
|
3039
3080
|
}
|
|
3040
3081
|
});
|
|
3041
|
-
const _hoisted_1$
|
|
3082
|
+
const _hoisted_1$2 = { key: 2 };
|
|
3042
3083
|
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3043
3084
|
const _component_el_option = resolveComponent("el-option");
|
|
3044
3085
|
const _component_el_option_group = resolveComponent("el-option-group");
|
|
@@ -3060,7 +3101,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3060
3101
|
"value-key": _ctx.config.valueKey || "value",
|
|
3061
3102
|
"allow-create": _ctx.config.allowCreate,
|
|
3062
3103
|
disabled: _ctx.disabled,
|
|
3063
|
-
"remote-method": _ctx.remoteMethod,
|
|
3104
|
+
"remote-method": _ctx.config.remote && _ctx.remoteMethod,
|
|
3064
3105
|
onChange: _ctx.changeHandler,
|
|
3065
3106
|
onVisibleChange: _ctx.visibleHandler
|
|
3066
3107
|
}, {
|
|
@@ -3091,7 +3132,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3091
3132
|
disabled: option.disabled
|
|
3092
3133
|
}, null, 8, ["label", "value", "disabled"]);
|
|
3093
3134
|
}), 128)),
|
|
3094
|
-
_ctx.moreLoadingVisible ? withDirectives((openBlock(), createElementBlock("div", _hoisted_1$
|
|
3135
|
+
_ctx.moreLoadingVisible ? withDirectives((openBlock(), createElementBlock("div", _hoisted_1$2, null, 512)), [
|
|
3095
3136
|
[_directive_loading, true]
|
|
3096
3137
|
]) : createCommentVNode("", true)
|
|
3097
3138
|
]),
|
|
@@ -3168,6 +3209,7 @@ const _sfc_main$4 = defineComponent({
|
|
|
3168
3209
|
},
|
|
3169
3210
|
emits: ["change", "input"],
|
|
3170
3211
|
setup(props, { emit }) {
|
|
3212
|
+
const mForm = inject("mForm");
|
|
3171
3213
|
useAddField(props.prop);
|
|
3172
3214
|
const modelName = computed(() => props.name || props.config.name || "");
|
|
3173
3215
|
return {
|
|
@@ -3176,12 +3218,10 @@ const _sfc_main$4 = defineComponent({
|
|
|
3176
3218
|
emit("change", v);
|
|
3177
3219
|
},
|
|
3178
3220
|
inputHandler(v) {
|
|
3179
|
-
const mForm = inject("mForm");
|
|
3180
3221
|
emit("input", v);
|
|
3181
3222
|
mForm?.$emit("field-input", props.prop, v);
|
|
3182
3223
|
},
|
|
3183
3224
|
buttonClickHandler() {
|
|
3184
|
-
const mForm = inject("mForm");
|
|
3185
3225
|
if (typeof props.config.append === "string")
|
|
3186
3226
|
return;
|
|
3187
3227
|
if (props.config.append?.handler) {
|
|
@@ -3245,7 +3285,7 @@ const _sfc_main$4 = defineComponent({
|
|
|
3245
3285
|
};
|
|
3246
3286
|
}
|
|
3247
3287
|
});
|
|
3248
|
-
const _hoisted_1$
|
|
3288
|
+
const _hoisted_1$1 = { key: 0 };
|
|
3249
3289
|
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3250
3290
|
const _component_el_button = resolveComponent("el-button");
|
|
3251
3291
|
const _component_el_input = resolveComponent("el-input");
|
|
@@ -3263,17 +3303,18 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3263
3303
|
_ctx.config.append ? {
|
|
3264
3304
|
name: "append",
|
|
3265
3305
|
fn: withCtx(() => [
|
|
3266
|
-
typeof _ctx.config.append === "string" ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
3306
|
+
typeof _ctx.config.append === "string" ? (openBlock(), createElementBlock("span", _hoisted_1$1, toDisplayString(_ctx.config.append), 1)) : createCommentVNode("", true),
|
|
3267
3307
|
typeof _ctx.config.append === "object" && _ctx.config.append.type === "button" ? (openBlock(), createBlock(_component_el_button, {
|
|
3268
3308
|
key: 1,
|
|
3269
3309
|
style: { "color": "#409eff" },
|
|
3310
|
+
size: _ctx.size,
|
|
3270
3311
|
onClick: withModifiers(_ctx.buttonClickHandler, ["prevent"])
|
|
3271
3312
|
}, {
|
|
3272
3313
|
default: withCtx(() => [
|
|
3273
3314
|
createTextVNode(toDisplayString(_ctx.config.append.text), 1)
|
|
3274
3315
|
]),
|
|
3275
3316
|
_: 1
|
|
3276
|
-
}, 8, ["onClick"])) : createCommentVNode("", true)
|
|
3317
|
+
}, 8, ["size", "onClick"])) : createCommentVNode("", true)
|
|
3277
3318
|
])
|
|
3278
3319
|
} : void 0
|
|
3279
3320
|
]), 1032, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"]);
|
|
@@ -3312,22 +3353,19 @@ const _sfc_main$3 = defineComponent({
|
|
|
3312
3353
|
};
|
|
3313
3354
|
}
|
|
3314
3355
|
});
|
|
3315
|
-
const _hoisted_1$1 = { key: 0 };
|
|
3316
3356
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3317
3357
|
const _component_el_input = resolveComponent("el-input");
|
|
3318
|
-
return
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"])
|
|
3330
|
-
])) : createCommentVNode("", true);
|
|
3358
|
+
return openBlock(), createBlock(_component_el_input, {
|
|
3359
|
+
modelValue: _ctx.model[_ctx.name],
|
|
3360
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
3361
|
+
type: "textarea",
|
|
3362
|
+
size: _ctx.size,
|
|
3363
|
+
clearable: "",
|
|
3364
|
+
placeholder: _ctx.config.placeholder,
|
|
3365
|
+
disabled: _ctx.disabled,
|
|
3366
|
+
onChange: _ctx.changeHandler,
|
|
3367
|
+
onInput: _ctx.inputHandler
|
|
3368
|
+
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"]);
|
|
3331
3369
|
}
|
|
3332
3370
|
var Textarea = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
|
|
3333
3371
|
|
|
@@ -3475,7 +3513,7 @@ const _sfc_main$1 = defineComponent({
|
|
|
3475
3513
|
submitForm: async (native) => {
|
|
3476
3514
|
try {
|
|
3477
3515
|
await elForm.value?.validate();
|
|
3478
|
-
return native ? values.value : cloneDeep(values.value);
|
|
3516
|
+
return native ? values.value : cloneDeep(toRaw(values.value));
|
|
3479
3517
|
} catch (invalidFields) {
|
|
3480
3518
|
const error = [];
|
|
3481
3519
|
Object.entries(invalidFields).forEach(([, ValidateError]) => {
|