@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/tmagic-form.umd.js
CHANGED
|
@@ -62,7 +62,11 @@
|
|
|
62
62
|
asyncLoadConfig(value, initValue2, item);
|
|
63
63
|
if (name && !items && typeof initValue2[name] !== "undefined") {
|
|
64
64
|
if (typeof value[name] === "undefined") {
|
|
65
|
-
|
|
65
|
+
if (type === "number") {
|
|
66
|
+
value[name] = Number(initValue2[name]);
|
|
67
|
+
} else {
|
|
68
|
+
value[name] = typeof initValue2[name] === "object" ? lodashEs.cloneDeep(initValue2[name]) : initValue2[name];
|
|
69
|
+
}
|
|
66
70
|
}
|
|
67
71
|
return value;
|
|
68
72
|
}
|
|
@@ -172,7 +176,7 @@
|
|
|
172
176
|
return target;
|
|
173
177
|
};
|
|
174
178
|
|
|
175
|
-
const _sfc_main$
|
|
179
|
+
const _sfc_main$t = vue.defineComponent({
|
|
176
180
|
name: "m-form-container",
|
|
177
181
|
components: { WarningFilled: icons.WarningFilled },
|
|
178
182
|
props: {
|
|
@@ -302,7 +306,7 @@
|
|
|
302
306
|
};
|
|
303
307
|
}
|
|
304
308
|
});
|
|
305
|
-
const _hoisted_1$
|
|
309
|
+
const _hoisted_1$f = ["innerHTML"];
|
|
306
310
|
const _hoisted_2$7 = ["innerHTML"];
|
|
307
311
|
const _hoisted_3$7 = ["innerHTML"];
|
|
308
312
|
const _hoisted_4$6 = ["innerHTML"];
|
|
@@ -310,7 +314,7 @@
|
|
|
310
314
|
key: 4,
|
|
311
315
|
style: { "text-align": "center" }
|
|
312
316
|
};
|
|
313
|
-
function _sfc_render$
|
|
317
|
+
function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
314
318
|
const _component_m_fields_hidden = vue.resolveComponent("m-fields-hidden");
|
|
315
319
|
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
316
320
|
const _component_el_form_item = vue.resolveComponent("el-form-item");
|
|
@@ -351,7 +355,7 @@
|
|
|
351
355
|
label: vue.withCtx(() => [
|
|
352
356
|
vue.createElementVNode("span", {
|
|
353
357
|
innerHTML: _ctx.type === "checkbox" ? "" : _ctx.config.text
|
|
354
|
-
}, null, 8, _hoisted_1$
|
|
358
|
+
}, null, 8, _hoisted_1$f)
|
|
355
359
|
]),
|
|
356
360
|
default: vue.withCtx(() => [
|
|
357
361
|
_ctx.tooltip ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, { key: 0 }, {
|
|
@@ -436,9 +440,9 @@
|
|
|
436
440
|
])) : vue.createCommentVNode("", true)
|
|
437
441
|
], 6)) : vue.createCommentVNode("", true);
|
|
438
442
|
}
|
|
439
|
-
var Container = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
443
|
+
var Container = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$q]]);
|
|
440
444
|
|
|
441
|
-
const _sfc_main$
|
|
445
|
+
const _sfc_main$s = vue.defineComponent({
|
|
442
446
|
name: "m-form-fieldset",
|
|
443
447
|
props: {
|
|
444
448
|
labelWidth: String,
|
|
@@ -490,7 +494,7 @@
|
|
|
490
494
|
};
|
|
491
495
|
}
|
|
492
496
|
});
|
|
493
|
-
const _hoisted_1$
|
|
497
|
+
const _hoisted_1$e = ["innerHTML"];
|
|
494
498
|
const _hoisted_2$6 = ["innerHTML"];
|
|
495
499
|
const _hoisted_3$6 = { key: 1 };
|
|
496
500
|
const _hoisted_4$5 = ["innerHTML"];
|
|
@@ -504,7 +508,7 @@
|
|
|
504
508
|
};
|
|
505
509
|
const _hoisted_10$1 = { style: { "flex": "1" } };
|
|
506
510
|
const _hoisted_11 = ["src"];
|
|
507
|
-
function _sfc_render$
|
|
511
|
+
function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
508
512
|
const _component_el_checkbox = vue.resolveComponent("el-checkbox");
|
|
509
513
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
510
514
|
return (_ctx.name ? _ctx.model[_ctx.name] : _ctx.model) ? (vue.openBlock(), vue.createElementBlock("fieldset", {
|
|
@@ -524,7 +528,7 @@
|
|
|
524
528
|
default: vue.withCtx(() => [
|
|
525
529
|
vue.createElementVNode("span", {
|
|
526
530
|
innerHTML: _ctx.config.legend
|
|
527
|
-
}, null, 8, _hoisted_1$
|
|
531
|
+
}, null, 8, _hoisted_1$e),
|
|
528
532
|
_ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
529
533
|
key: 0,
|
|
530
534
|
innerHTML: _ctx.config.extra,
|
|
@@ -596,9 +600,9 @@
|
|
|
596
600
|
}), 128)) : vue.createCommentVNode("", true)
|
|
597
601
|
], 4)) : vue.createCommentVNode("", true);
|
|
598
602
|
}
|
|
599
|
-
var Fieldset = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
603
|
+
var Fieldset = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$p]]);
|
|
600
604
|
|
|
601
|
-
const _sfc_main$
|
|
605
|
+
const _sfc_main$r = vue.defineComponent({
|
|
602
606
|
name: "m-form-group-list-item",
|
|
603
607
|
components: { CaretRight: icons.CaretRight, CaretBottom: icons.CaretBottom },
|
|
604
608
|
props: {
|
|
@@ -682,11 +686,11 @@
|
|
|
682
686
|
};
|
|
683
687
|
}
|
|
684
688
|
});
|
|
685
|
-
const _hoisted_1$
|
|
689
|
+
const _hoisted_1$d = { class: "m-fields-group-list-item" };
|
|
686
690
|
const _hoisted_2$5 = /* @__PURE__ */ vue.createTextVNode("\u4E0A\u79FB");
|
|
687
691
|
const _hoisted_3$5 = /* @__PURE__ */ vue.createTextVNode("\u4E0B\u79FB");
|
|
688
692
|
const _hoisted_4$4 = ["innerHTML"];
|
|
689
|
-
function _sfc_render$
|
|
693
|
+
function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
690
694
|
const _component_caret_bottom = vue.resolveComponent("caret-bottom");
|
|
691
695
|
const _component_caret_right = vue.resolveComponent("caret-right");
|
|
692
696
|
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
@@ -694,7 +698,7 @@
|
|
|
694
698
|
const _component_CaretRight = vue.resolveComponent("CaretRight");
|
|
695
699
|
const _component_CaretBottom = vue.resolveComponent("CaretBottom");
|
|
696
700
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
697
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
701
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
|
|
698
702
|
vue.createElementVNode("div", null, [
|
|
699
703
|
vue.createVNode(_component_el_icon, {
|
|
700
704
|
style: { "margin-right": "7px" },
|
|
@@ -777,9 +781,9 @@
|
|
|
777
781
|
}, null, 8, ["config", "model", "labelWidth", "prop", "size", "onChange"])) : vue.createCommentVNode("", true)
|
|
778
782
|
]);
|
|
779
783
|
}
|
|
780
|
-
var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
784
|
+
var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$o]]);
|
|
781
785
|
|
|
782
|
-
const _sfc_main$
|
|
786
|
+
const _sfc_main$q = vue.defineComponent({
|
|
783
787
|
name: "m-form-group-list",
|
|
784
788
|
components: { MFieldsGroupListItem },
|
|
785
789
|
props: {
|
|
@@ -871,7 +875,7 @@
|
|
|
871
875
|
};
|
|
872
876
|
}
|
|
873
877
|
});
|
|
874
|
-
const _hoisted_1$
|
|
878
|
+
const _hoisted_1$c = { class: "m-fields-group-list" };
|
|
875
879
|
const _hoisted_2$4 = ["innerHTML"];
|
|
876
880
|
const _hoisted_3$4 = {
|
|
877
881
|
key: 1,
|
|
@@ -883,10 +887,10 @@
|
|
|
883
887
|
];
|
|
884
888
|
const _hoisted_6$1 = /* @__PURE__ */ vue.createTextVNode("\u6DFB\u52A0\u7EC4");
|
|
885
889
|
const _hoisted_7$1 = /* @__PURE__ */ vue.createTextVNode("\u5207\u6362\u4E3A\u8868\u683C");
|
|
886
|
-
function _sfc_render$
|
|
890
|
+
function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
887
891
|
const _component_m_fields_group_list_item = vue.resolveComponent("m-fields-group-list-item");
|
|
888
892
|
const _component_el_button = vue.resolveComponent("el-button");
|
|
889
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
893
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
|
|
890
894
|
_ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
891
895
|
key: 0,
|
|
892
896
|
innerHTML: _ctx.config.extra,
|
|
@@ -930,9 +934,9 @@
|
|
|
930
934
|
}, 8, ["onClick"])) : vue.createCommentVNode("", true)
|
|
931
935
|
]);
|
|
932
936
|
}
|
|
933
|
-
var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
937
|
+
var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$n]]);
|
|
934
938
|
|
|
935
|
-
const _sfc_main$
|
|
939
|
+
const _sfc_main$p = vue.defineComponent({
|
|
936
940
|
name: "m-form-panel",
|
|
937
941
|
components: { CaretBottom: icons.CaretBottom, CaretRight: icons.CaretRight },
|
|
938
942
|
props: {
|
|
@@ -965,7 +969,7 @@
|
|
|
965
969
|
};
|
|
966
970
|
}
|
|
967
971
|
});
|
|
968
|
-
const _hoisted_1$
|
|
972
|
+
const _hoisted_1$b = { class: "clearfix" };
|
|
969
973
|
const _hoisted_2$3 = ["innerHTML"];
|
|
970
974
|
const _hoisted_3$3 = {
|
|
971
975
|
key: 0,
|
|
@@ -973,7 +977,7 @@
|
|
|
973
977
|
};
|
|
974
978
|
const _hoisted_4$2 = { style: { "flex": "1" } };
|
|
975
979
|
const _hoisted_5$1 = ["src"];
|
|
976
|
-
function _sfc_render$
|
|
980
|
+
function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
977
981
|
const _component_caret_bottom = vue.resolveComponent("caret-bottom");
|
|
978
982
|
const _component_caret_right = vue.resolveComponent("caret-right");
|
|
979
983
|
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
@@ -985,7 +989,7 @@
|
|
|
985
989
|
"body-style": { display: _ctx.expand ? "block" : "none" }
|
|
986
990
|
}, {
|
|
987
991
|
header: vue.withCtx(() => [
|
|
988
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
992
|
+
vue.createElementVNode("div", _hoisted_1$b, [
|
|
989
993
|
vue.createElementVNode("a", {
|
|
990
994
|
href: "javascript:",
|
|
991
995
|
style: { "width": "100%", "display": "block" },
|
|
@@ -1043,10 +1047,60 @@
|
|
|
1043
1047
|
_: 3
|
|
1044
1048
|
}, 8, ["body-style"])) : vue.createCommentVNode("", true);
|
|
1045
1049
|
}
|
|
1046
|
-
var Panel = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1050
|
+
var Panel = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$m]]);
|
|
1051
|
+
|
|
1052
|
+
const _sfc_main$o = vue.defineComponent({
|
|
1053
|
+
props: {
|
|
1054
|
+
labelWidth: String,
|
|
1055
|
+
expandMore: Boolean,
|
|
1056
|
+
span: Number,
|
|
1057
|
+
model: {
|
|
1058
|
+
type: Object,
|
|
1059
|
+
default: () => ({})
|
|
1060
|
+
},
|
|
1061
|
+
config: {
|
|
1062
|
+
type: Object,
|
|
1063
|
+
default: () => ({})
|
|
1064
|
+
},
|
|
1065
|
+
prop: String,
|
|
1066
|
+
size: String
|
|
1067
|
+
},
|
|
1068
|
+
emits: ["change"],
|
|
1069
|
+
setup(props, { emit }) {
|
|
1070
|
+
const mForm = vue.inject("mForm");
|
|
1071
|
+
const changeHandler = () => emit("change", props.model);
|
|
1072
|
+
return {
|
|
1073
|
+
mForm,
|
|
1074
|
+
display: vue.computed(() => display(mForm, props.config.display, props)),
|
|
1075
|
+
changeHandler
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
});
|
|
1079
|
+
function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1080
|
+
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
1081
|
+
const _component_el_col = vue.resolveComponent("el-col");
|
|
1082
|
+
return vue.withDirectives((vue.openBlock(), vue.createBlock(_component_el_col, { span: _ctx.span }, {
|
|
1083
|
+
default: vue.withCtx(() => [
|
|
1084
|
+
vue.createVNode(_component_m_form_container, {
|
|
1085
|
+
model: _ctx.model,
|
|
1086
|
+
config: _ctx.config,
|
|
1087
|
+
prop: _ctx.prop,
|
|
1088
|
+
"label-width": _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1089
|
+
"expand-more": _ctx.expandMore,
|
|
1090
|
+
size: _ctx.size,
|
|
1091
|
+
onChange: _ctx.changeHandler
|
|
1092
|
+
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size", "onChange"])
|
|
1093
|
+
]),
|
|
1094
|
+
_: 1
|
|
1095
|
+
}, 8, ["span"])), [
|
|
1096
|
+
[vue.vShow, _ctx.display && _ctx.config.type !== "hidden"]
|
|
1097
|
+
]);
|
|
1098
|
+
}
|
|
1099
|
+
var Col = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$l]]);
|
|
1047
1100
|
|
|
1048
1101
|
const _sfc_main$n = vue.defineComponent({
|
|
1049
1102
|
name: "m-form-row",
|
|
1103
|
+
components: { Col },
|
|
1050
1104
|
props: {
|
|
1051
1105
|
labelWidth: String,
|
|
1052
1106
|
expandMore: Boolean,
|
|
@@ -1068,38 +1122,27 @@
|
|
|
1068
1122
|
const changeHandler = () => emit("change", props.name ? props.model[props.name] : props.model);
|
|
1069
1123
|
return {
|
|
1070
1124
|
mForm,
|
|
1071
|
-
display(config) {
|
|
1072
|
-
return display(mForm, config.display, props);
|
|
1073
|
-
},
|
|
1074
1125
|
changeHandler
|
|
1075
1126
|
};
|
|
1076
1127
|
}
|
|
1077
1128
|
});
|
|
1078
1129
|
function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1079
|
-
const
|
|
1080
|
-
const _component_el_col = vue.resolveComponent("el-col");
|
|
1130
|
+
const _component_Col = vue.resolveComponent("Col");
|
|
1081
1131
|
const _component_el_row = vue.resolveComponent("el-row");
|
|
1082
1132
|
return vue.openBlock(), vue.createBlock(_component_el_row, { gutter: 10 }, {
|
|
1083
1133
|
default: vue.withCtx(() => [
|
|
1084
1134
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (col, index) => {
|
|
1085
|
-
return vue.openBlock(), vue.createBlock(
|
|
1086
|
-
style: vue.normalizeStyle(!_ctx.display(col) || col.type === "hidden" ? "display: none" : ""),
|
|
1135
|
+
return vue.openBlock(), vue.createBlock(_component_Col, {
|
|
1087
1136
|
key: col[_ctx.mForm?.keyProp || "__key"] ?? index,
|
|
1088
|
-
span:
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
size: _ctx.size,
|
|
1098
|
-
onChange: _ctx.changeHandler
|
|
1099
|
-
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size", "onChange"])
|
|
1100
|
-
]),
|
|
1101
|
-
_: 2
|
|
1102
|
-
}, 1032, ["style", "span"]);
|
|
1137
|
+
span: _ctx.config.span || _ctx.config.span || 24 / _ctx.config.items.length,
|
|
1138
|
+
config: col,
|
|
1139
|
+
labelWidth: _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1140
|
+
expandMore: _ctx.expandMore,
|
|
1141
|
+
model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
|
|
1142
|
+
prop: _ctx.prop,
|
|
1143
|
+
size: _ctx.size,
|
|
1144
|
+
onChange: _ctx.changeHandler
|
|
1145
|
+
}, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "prop", "size", "onChange"]);
|
|
1103
1146
|
}), 128))
|
|
1104
1147
|
]),
|
|
1105
1148
|
_: 1
|
|
@@ -1558,7 +1601,7 @@
|
|
|
1558
1601
|
};
|
|
1559
1602
|
}
|
|
1560
1603
|
});
|
|
1561
|
-
const _hoisted_1$
|
|
1604
|
+
const _hoisted_1$a = ["innerHTML"];
|
|
1562
1605
|
const _hoisted_2$2 = { class: "el-form-item__content" };
|
|
1563
1606
|
const _hoisted_3$2 = ["innerHTML"];
|
|
1564
1607
|
const _hoisted_4$1 = /* @__PURE__ */ vue.createTextVNode("\u6DFB\u52A0");
|
|
@@ -1587,7 +1630,7 @@
|
|
|
1587
1630
|
key: 0,
|
|
1588
1631
|
style: { "color": "rgba(0, 0, 0, 0.45)" },
|
|
1589
1632
|
innerHTML: _ctx.config.extra
|
|
1590
|
-
}, null, 8, _hoisted_1$
|
|
1633
|
+
}, null, 8, _hoisted_1$a)) : vue.createCommentVNode("", true),
|
|
1591
1634
|
vue.createElementVNode("div", _hoisted_2$2, [
|
|
1592
1635
|
vue.createVNode(_component_el_tooltip, {
|
|
1593
1636
|
content: "\u62D6\u62FD\u53EF\u6392\u5E8F",
|
|
@@ -2109,13 +2152,13 @@
|
|
|
2109
2152
|
};
|
|
2110
2153
|
}
|
|
2111
2154
|
});
|
|
2112
|
-
const _hoisted_1$
|
|
2155
|
+
const _hoisted_1$9 = {
|
|
2113
2156
|
class: "m-cascader",
|
|
2114
2157
|
style: { "width": "100%" }
|
|
2115
2158
|
};
|
|
2116
2159
|
function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2117
2160
|
const _component_el_cascader = vue.resolveComponent("el-cascader");
|
|
2118
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2161
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
|
|
2119
2162
|
vue.createVNode(_component_el_cascader, {
|
|
2120
2163
|
modelValue: _ctx.model[_ctx.name],
|
|
2121
2164
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2155,7 +2198,7 @@
|
|
|
2155
2198
|
} else {
|
|
2156
2199
|
return props.config.activeValue;
|
|
2157
2200
|
}
|
|
2158
|
-
return
|
|
2201
|
+
return void 0;
|
|
2159
2202
|
}),
|
|
2160
2203
|
inactiveValue: vue.computed(() => {
|
|
2161
2204
|
if (typeof props.config.inactiveValue === "undefined") {
|
|
@@ -2165,7 +2208,7 @@
|
|
|
2165
2208
|
} else {
|
|
2166
2209
|
return props.config.inactiveValue;
|
|
2167
2210
|
}
|
|
2168
|
-
return
|
|
2211
|
+
return void 0;
|
|
2169
2212
|
}),
|
|
2170
2213
|
changeHandler(value) {
|
|
2171
2214
|
emit("change", value);
|
|
@@ -2238,7 +2281,7 @@
|
|
|
2238
2281
|
}
|
|
2239
2282
|
var CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$e]]);
|
|
2240
2283
|
|
|
2241
|
-
const _hoisted_1$
|
|
2284
|
+
const _hoisted_1$8 = { key: 0 };
|
|
2242
2285
|
const __default__$2 = vue.defineComponent({
|
|
2243
2286
|
name: "m-fields-color-picker"
|
|
2244
2287
|
});
|
|
@@ -2258,7 +2301,7 @@
|
|
|
2258
2301
|
const changeHandler = (value) => emit("change", value);
|
|
2259
2302
|
return (_ctx, _cache) => {
|
|
2260
2303
|
const _component_el_color_picker = vue.resolveComponent("el-color-picker");
|
|
2261
|
-
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2304
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
|
|
2262
2305
|
vue.createVNode(_component_el_color_picker, {
|
|
2263
2306
|
modelValue: _ctx.model[_ctx.name],
|
|
2264
2307
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2294,10 +2337,10 @@
|
|
|
2294
2337
|
};
|
|
2295
2338
|
}
|
|
2296
2339
|
});
|
|
2297
|
-
const _hoisted_1$
|
|
2340
|
+
const _hoisted_1$7 = { key: 0 };
|
|
2298
2341
|
function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2299
2342
|
const _component_el_date_picker = vue.resolveComponent("el-date-picker");
|
|
2300
|
-
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2343
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
|
|
2301
2344
|
vue.createVNode(_component_el_date_picker, {
|
|
2302
2345
|
modelValue: _ctx.model[_ctx.modelName],
|
|
2303
2346
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.modelName] = $event),
|
|
@@ -2401,10 +2444,10 @@
|
|
|
2401
2444
|
};
|
|
2402
2445
|
}
|
|
2403
2446
|
});
|
|
2404
|
-
const _hoisted_1$
|
|
2447
|
+
const _hoisted_1$6 = { key: 0 };
|
|
2405
2448
|
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2406
2449
|
const _component_el_date_picker = vue.resolveComponent("el-date-picker");
|
|
2407
|
-
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2450
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
|
|
2408
2451
|
vue.createVNode(_component_el_date_picker, {
|
|
2409
2452
|
modelValue: _ctx.model[_ctx.name],
|
|
2410
2453
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2421,7 +2464,7 @@
|
|
|
2421
2464
|
}
|
|
2422
2465
|
var DateTime = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$b]]);
|
|
2423
2466
|
|
|
2424
|
-
const _hoisted_1$
|
|
2467
|
+
const _hoisted_1$5 = { key: 0 };
|
|
2425
2468
|
const __default__$1 = vue.defineComponent({
|
|
2426
2469
|
name: "m-fields-display"
|
|
2427
2470
|
});
|
|
@@ -2442,7 +2485,7 @@
|
|
|
2442
2485
|
}
|
|
2443
2486
|
useAddField(props.prop);
|
|
2444
2487
|
return (_ctx, _cache) => {
|
|
2445
|
-
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$
|
|
2488
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$5, vue.toDisplayString(_ctx.model[vue.unref(n)]), 1)) : vue.createCommentVNode("", true);
|
|
2446
2489
|
};
|
|
2447
2490
|
}
|
|
2448
2491
|
});
|
|
@@ -2512,12 +2555,12 @@
|
|
|
2512
2555
|
}
|
|
2513
2556
|
}
|
|
2514
2557
|
});
|
|
2515
|
-
const _hoisted_1$
|
|
2558
|
+
const _hoisted_1$4 = { class: "m-fields-dynamic-field" };
|
|
2516
2559
|
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2517
2560
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
2518
2561
|
const _component_el_form_item = vue.resolveComponent("el-form-item");
|
|
2519
2562
|
const _component_el_form = vue.resolveComponent("el-form");
|
|
2520
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2563
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
|
|
2521
2564
|
vue.createVNode(_component_el_form, { size: "small" }, {
|
|
2522
2565
|
default: vue.withCtx(() => [
|
|
2523
2566
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Object.keys(_ctx.fieldMap.value), (key) => {
|
|
@@ -2639,7 +2682,7 @@
|
|
|
2639
2682
|
};
|
|
2640
2683
|
}
|
|
2641
2684
|
});
|
|
2642
|
-
const _hoisted_1$
|
|
2685
|
+
const _hoisted_1$3 = ["href"];
|
|
2643
2686
|
const _hoisted_2$1 = {
|
|
2644
2687
|
key: 2,
|
|
2645
2688
|
class: "m-fields-link"
|
|
@@ -2653,7 +2696,7 @@
|
|
|
2653
2696
|
target: "_blank",
|
|
2654
2697
|
href: _ctx.href,
|
|
2655
2698
|
style: vue.normalizeStyle(_ctx.config.css || {})
|
|
2656
|
-
}, vue.toDisplayString(_ctx.displayText), 13, _hoisted_1$
|
|
2699
|
+
}, vue.toDisplayString(_ctx.displayText), 13, _hoisted_1$3)) : _ctx.config.href && _ctx.disabled ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
2657
2700
|
key: 1,
|
|
2658
2701
|
style: vue.normalizeStyle(_ctx.config.disabledCss || {})
|
|
2659
2702
|
}, vue.toDisplayString(_ctx.displayText), 5)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [
|
|
@@ -3005,8 +3048,6 @@
|
|
|
3005
3048
|
getRequestFuc() {
|
|
3006
3049
|
return getConfig("request");
|
|
3007
3050
|
},
|
|
3008
|
-
async getInitOption() {
|
|
3009
|
-
},
|
|
3010
3051
|
changeHandler(value) {
|
|
3011
3052
|
emit("change", value);
|
|
3012
3053
|
},
|
|
@@ -3041,7 +3082,7 @@
|
|
|
3041
3082
|
};
|
|
3042
3083
|
}
|
|
3043
3084
|
});
|
|
3044
|
-
const _hoisted_1$
|
|
3085
|
+
const _hoisted_1$2 = { key: 2 };
|
|
3045
3086
|
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3046
3087
|
const _component_el_option = vue.resolveComponent("el-option");
|
|
3047
3088
|
const _component_el_option_group = vue.resolveComponent("el-option-group");
|
|
@@ -3063,7 +3104,7 @@
|
|
|
3063
3104
|
"value-key": _ctx.config.valueKey || "value",
|
|
3064
3105
|
"allow-create": _ctx.config.allowCreate,
|
|
3065
3106
|
disabled: _ctx.disabled,
|
|
3066
|
-
"remote-method": _ctx.remoteMethod,
|
|
3107
|
+
"remote-method": _ctx.config.remote && _ctx.remoteMethod,
|
|
3067
3108
|
onChange: _ctx.changeHandler,
|
|
3068
3109
|
onVisibleChange: _ctx.visibleHandler
|
|
3069
3110
|
}, {
|
|
@@ -3094,7 +3135,7 @@
|
|
|
3094
3135
|
disabled: option.disabled
|
|
3095
3136
|
}, null, 8, ["label", "value", "disabled"]);
|
|
3096
3137
|
}), 128)),
|
|
3097
|
-
_ctx.moreLoadingVisible ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3138
|
+
_ctx.moreLoadingVisible ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, null, 512)), [
|
|
3098
3139
|
[_directive_loading, true]
|
|
3099
3140
|
]) : vue.createCommentVNode("", true)
|
|
3100
3141
|
]),
|
|
@@ -3171,6 +3212,7 @@
|
|
|
3171
3212
|
},
|
|
3172
3213
|
emits: ["change", "input"],
|
|
3173
3214
|
setup(props, { emit }) {
|
|
3215
|
+
const mForm = vue.inject("mForm");
|
|
3174
3216
|
useAddField(props.prop);
|
|
3175
3217
|
const modelName = vue.computed(() => props.name || props.config.name || "");
|
|
3176
3218
|
return {
|
|
@@ -3179,12 +3221,10 @@
|
|
|
3179
3221
|
emit("change", v);
|
|
3180
3222
|
},
|
|
3181
3223
|
inputHandler(v) {
|
|
3182
|
-
const mForm = vue.inject("mForm");
|
|
3183
3224
|
emit("input", v);
|
|
3184
3225
|
mForm?.$emit("field-input", props.prop, v);
|
|
3185
3226
|
},
|
|
3186
3227
|
buttonClickHandler() {
|
|
3187
|
-
const mForm = vue.inject("mForm");
|
|
3188
3228
|
if (typeof props.config.append === "string")
|
|
3189
3229
|
return;
|
|
3190
3230
|
if (props.config.append?.handler) {
|
|
@@ -3248,7 +3288,7 @@
|
|
|
3248
3288
|
};
|
|
3249
3289
|
}
|
|
3250
3290
|
});
|
|
3251
|
-
const _hoisted_1$
|
|
3291
|
+
const _hoisted_1$1 = { key: 0 };
|
|
3252
3292
|
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3253
3293
|
const _component_el_button = vue.resolveComponent("el-button");
|
|
3254
3294
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
@@ -3266,17 +3306,18 @@
|
|
|
3266
3306
|
_ctx.config.append ? {
|
|
3267
3307
|
name: "append",
|
|
3268
3308
|
fn: vue.withCtx(() => [
|
|
3269
|
-
typeof _ctx.config.append === "string" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$
|
|
3309
|
+
typeof _ctx.config.append === "string" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$1, vue.toDisplayString(_ctx.config.append), 1)) : vue.createCommentVNode("", true),
|
|
3270
3310
|
typeof _ctx.config.append === "object" && _ctx.config.append.type === "button" ? (vue.openBlock(), vue.createBlock(_component_el_button, {
|
|
3271
3311
|
key: 1,
|
|
3272
3312
|
style: { "color": "#409eff" },
|
|
3313
|
+
size: _ctx.size,
|
|
3273
3314
|
onClick: vue.withModifiers(_ctx.buttonClickHandler, ["prevent"])
|
|
3274
3315
|
}, {
|
|
3275
3316
|
default: vue.withCtx(() => [
|
|
3276
3317
|
vue.createTextVNode(vue.toDisplayString(_ctx.config.append.text), 1)
|
|
3277
3318
|
]),
|
|
3278
3319
|
_: 1
|
|
3279
|
-
}, 8, ["onClick"])) : vue.createCommentVNode("", true)
|
|
3320
|
+
}, 8, ["size", "onClick"])) : vue.createCommentVNode("", true)
|
|
3280
3321
|
])
|
|
3281
3322
|
} : void 0
|
|
3282
3323
|
]), 1032, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"]);
|
|
@@ -3315,22 +3356,19 @@
|
|
|
3315
3356
|
};
|
|
3316
3357
|
}
|
|
3317
3358
|
});
|
|
3318
|
-
const _hoisted_1$1 = { key: 0 };
|
|
3319
3359
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3320
3360
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
3321
|
-
return
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"])
|
|
3333
|
-
])) : vue.createCommentVNode("", true);
|
|
3361
|
+
return vue.openBlock(), vue.createBlock(_component_el_input, {
|
|
3362
|
+
modelValue: _ctx.model[_ctx.name],
|
|
3363
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
3364
|
+
type: "textarea",
|
|
3365
|
+
size: _ctx.size,
|
|
3366
|
+
clearable: "",
|
|
3367
|
+
placeholder: _ctx.config.placeholder,
|
|
3368
|
+
disabled: _ctx.disabled,
|
|
3369
|
+
onChange: _ctx.changeHandler,
|
|
3370
|
+
onInput: _ctx.inputHandler
|
|
3371
|
+
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"]);
|
|
3334
3372
|
}
|
|
3335
3373
|
var Textarea = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
|
|
3336
3374
|
|
|
@@ -3478,7 +3516,7 @@
|
|
|
3478
3516
|
submitForm: async (native) => {
|
|
3479
3517
|
try {
|
|
3480
3518
|
await elForm.value?.validate();
|
|
3481
|
-
return native ? values.value : lodashEs.cloneDeep(values.value);
|
|
3519
|
+
return native ? values.value : lodashEs.cloneDeep(vue.toRaw(values.value));
|
|
3482
3520
|
} catch (invalidFields) {
|
|
3483
3521
|
const error = [];
|
|
3484
3522
|
Object.entries(invalidFields).forEach(([, ValidateError]) => {
|
|
@@ -3805,8 +3843,7 @@
|
|
|
3805
3843
|
exports.initValue = initValue;
|
|
3806
3844
|
exports.useAddField = useAddField;
|
|
3807
3845
|
|
|
3808
|
-
Object.
|
|
3809
|
-
exports[Symbol.toStringTag] = 'Module';
|
|
3846
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
3810
3847
|
|
|
3811
3848
|
}));
|
|
3812
3849
|
//# sourceMappingURL=tmagic-form.umd.js.map
|