@tmagic/form 1.5.0-beta.6 → 1.5.0-beta.8
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/tmagic-form.js +85 -96
- package/dist/tmagic-form.umd.cjs +85 -96
- package/package.json +8 -8
- package/src/containers/Container.vue +1 -2
- package/src/fields/Date.vue +1 -1
- package/src/fields/Daterange.vue +14 -18
- package/src/fields/Text.vue +0 -1
- package/src/index.ts +3 -3
- package/types/index.d.ts +1085 -1757
package/dist/tmagic-form.js
CHANGED
|
@@ -185,11 +185,11 @@ const datetimeFormatter = (v, defaultValue = "-", format = "YYYY-MM-DD HH:mm:ss"
|
|
|
185
185
|
return defaultValue;
|
|
186
186
|
};
|
|
187
187
|
|
|
188
|
-
const _hoisted_1$d = ["data-tmagic-id"];
|
|
189
|
-
const _hoisted_2$
|
|
190
|
-
const _hoisted_3$
|
|
191
|
-
const _hoisted_4$
|
|
192
|
-
const _hoisted_5$
|
|
188
|
+
const _hoisted_1$d = ["data-tmagic-id", "data-tmagic-form-item-prop"];
|
|
189
|
+
const _hoisted_2$7 = ["innerHTML", "title"];
|
|
190
|
+
const _hoisted_3$4 = ["innerHTML"];
|
|
191
|
+
const _hoisted_4$3 = ["innerHTML"];
|
|
192
|
+
const _hoisted_5$3 = ["innerHTML"];
|
|
193
193
|
const _hoisted_6$2 = ["innerHTML", "title"];
|
|
194
194
|
const _hoisted_7$1 = ["innerHTML"];
|
|
195
195
|
const _hoisted_8$1 = ["innerHTML"];
|
|
@@ -340,6 +340,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
340
340
|
return _ctx.config ? (openBlock(), createElementBlock("div", {
|
|
341
341
|
key: 0,
|
|
342
342
|
"data-tmagic-id": _ctx.config.id,
|
|
343
|
+
"data-tmagic-form-item-prop": itemProp.value,
|
|
343
344
|
style: normalizeStyle(_ctx.config.tip ? "display: flex;align-items: baseline;" : ""),
|
|
344
345
|
class: normalizeClass(`m-form-container m-container-${type.value || ""} ${_ctx.config.className || ""}`)
|
|
345
346
|
}, [
|
|
@@ -377,16 +378,15 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
377
378
|
createElementVNode("span", {
|
|
378
379
|
innerHTML: type.value === "checkbox" ? "" : text.value,
|
|
379
380
|
title: _ctx.config.labelTitle
|
|
380
|
-
}, null, 8, _hoisted_2$
|
|
381
|
+
}, null, 8, _hoisted_2$7)
|
|
381
382
|
]),
|
|
382
383
|
default: withCtx(() => [
|
|
383
384
|
tooltip.value ? (openBlock(), createBlock(unref(TMagicTooltip), { key: 0 }, {
|
|
384
385
|
content: withCtx(() => [
|
|
385
|
-
createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_3$
|
|
386
|
+
createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_3$4)
|
|
386
387
|
]),
|
|
387
388
|
default: withCtx(() => [
|
|
388
389
|
(openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
|
|
389
|
-
"data-tmagic-form-item-prop": itemProp.value,
|
|
390
390
|
key: key(_ctx.config),
|
|
391
391
|
size: _ctx.size,
|
|
392
392
|
model: _ctx.model,
|
|
@@ -397,11 +397,10 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
397
397
|
prop: itemProp.value,
|
|
398
398
|
onChange: onChangeHandler,
|
|
399
399
|
onAddDiffCount
|
|
400
|
-
}, null, 40, ["
|
|
400
|
+
}, null, 40, ["size", "model", "last-values", "config", "name", "disabled", "prop"]))
|
|
401
401
|
]),
|
|
402
402
|
_: 1
|
|
403
403
|
})) : (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
|
|
404
|
-
"data-tmagic-form-item-prop": itemProp.value,
|
|
405
404
|
key: key(_ctx.config),
|
|
406
405
|
size: _ctx.size,
|
|
407
406
|
model: _ctx.model,
|
|
@@ -412,12 +411,12 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
412
411
|
prop: itemProp.value,
|
|
413
412
|
onChange: onChangeHandler,
|
|
414
413
|
onAddDiffCount
|
|
415
|
-
}, null, 40, ["
|
|
414
|
+
}, null, 40, ["size", "model", "last-values", "config", "name", "disabled", "prop"])),
|
|
416
415
|
extra.value && type.value !== "table" ? (openBlock(), createElementBlock("div", {
|
|
417
416
|
key: 2,
|
|
418
417
|
innerHTML: extra.value,
|
|
419
418
|
class: "m-form-tip"
|
|
420
|
-
}, null, 8, _hoisted_4$
|
|
419
|
+
}, null, 8, _hoisted_4$3)) : createCommentVNode("", true)
|
|
421
420
|
]),
|
|
422
421
|
_: 1
|
|
423
422
|
}, 8, ["style", "class", "prop", "label-width", "rules"]),
|
|
@@ -428,7 +427,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
428
427
|
content: withCtx(() => [
|
|
429
428
|
createElementVNode("div", {
|
|
430
429
|
innerHTML: _ctx.config.tip
|
|
431
|
-
}, null, 8, _hoisted_5$
|
|
430
|
+
}, null, 8, _hoisted_5$3)
|
|
432
431
|
]),
|
|
433
432
|
default: withCtx(() => [
|
|
434
433
|
createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
@@ -616,10 +615,10 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
616
615
|
});
|
|
617
616
|
|
|
618
617
|
const _hoisted_1$c = ["innerHTML"];
|
|
619
|
-
const _hoisted_2$
|
|
620
|
-
const _hoisted_3$
|
|
621
|
-
const _hoisted_4$
|
|
622
|
-
const _hoisted_5$
|
|
618
|
+
const _hoisted_2$6 = ["innerHTML"];
|
|
619
|
+
const _hoisted_3$3 = { key: 1 };
|
|
620
|
+
const _hoisted_4$2 = ["innerHTML"];
|
|
621
|
+
const _hoisted_5$2 = ["innerHTML"];
|
|
623
622
|
const _hoisted_6$1 = {
|
|
624
623
|
key: 2,
|
|
625
624
|
style: { "display": "flex" }
|
|
@@ -691,21 +690,21 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
691
690
|
key: 0,
|
|
692
691
|
innerHTML: _ctx.config.extra,
|
|
693
692
|
class: "m-form-tip"
|
|
694
|
-
}, null, 8, _hoisted_2$
|
|
693
|
+
}, null, 8, _hoisted_2$6)) : createCommentVNode("", true)
|
|
695
694
|
]),
|
|
696
695
|
_: 1
|
|
697
696
|
}, 8, ["modelValue", "prop"])
|
|
698
697
|
]),
|
|
699
698
|
_: 1
|
|
700
|
-
})) : (openBlock(), createElementBlock("legend", _hoisted_3$
|
|
699
|
+
})) : (openBlock(), createElementBlock("legend", _hoisted_3$3, [
|
|
701
700
|
createElementVNode("span", {
|
|
702
701
|
innerHTML: _ctx.config.legend
|
|
703
|
-
}, null, 8, _hoisted_4$
|
|
702
|
+
}, null, 8, _hoisted_4$2),
|
|
704
703
|
_ctx.config.extra ? (openBlock(), createElementBlock("span", {
|
|
705
704
|
key: 0,
|
|
706
705
|
innerHTML: _ctx.config.extra,
|
|
707
706
|
class: "m-form-tip"
|
|
708
|
-
}, null, 8, _hoisted_5$
|
|
707
|
+
}, null, 8, _hoisted_5$2)) : createCommentVNode("", true)
|
|
709
708
|
])),
|
|
710
709
|
_ctx.config.schematic && show.value ? (openBlock(), createElementBlock("div", _hoisted_6$1, [
|
|
711
710
|
createElementVNode("div", _hoisted_7, [
|
|
@@ -752,7 +751,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
752
751
|
});
|
|
753
752
|
|
|
754
753
|
const _hoisted_1$b = { class: "m-fields-group-list-item" };
|
|
755
|
-
const _hoisted_2$
|
|
754
|
+
const _hoisted_2$5 = ["innerHTML"];
|
|
756
755
|
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
757
756
|
...{
|
|
758
757
|
name: "MFormGroupListItem"
|
|
@@ -853,7 +852,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
853
852
|
onClick: _cache[0] || (_cache[0] = ($event) => changeOrder(-1))
|
|
854
853
|
}, {
|
|
855
854
|
default: withCtx(() => [
|
|
856
|
-
createTextVNode("上移"),
|
|
855
|
+
_cache[3] || (_cache[3] = createTextVNode("上移")),
|
|
857
856
|
createVNode(unref(TMagicIcon), null, {
|
|
858
857
|
default: withCtx(() => [
|
|
859
858
|
createVNode(unref(CaretTop))
|
|
@@ -872,7 +871,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
872
871
|
onClick: _cache[1] || (_cache[1] = ($event) => changeOrder(1))
|
|
873
872
|
}, {
|
|
874
873
|
default: withCtx(() => [
|
|
875
|
-
createTextVNode("下移"),
|
|
874
|
+
_cache[4] || (_cache[4] = createTextVNode("下移")),
|
|
876
875
|
createVNode(unref(TMagicIcon), null, {
|
|
877
876
|
default: withCtx(() => [
|
|
878
877
|
createVNode(unref(CaretBottom))
|
|
@@ -889,7 +888,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
889
888
|
key: 1,
|
|
890
889
|
innerHTML: itemExtra.value,
|
|
891
890
|
class: "m-form-tip"
|
|
892
|
-
}, null, 8, _hoisted_2$
|
|
891
|
+
}, null, 8, _hoisted_2$5)) : createCommentVNode("", true)
|
|
893
892
|
]),
|
|
894
893
|
expand.value ? (openBlock(), createBlock(_sfc_main$x, {
|
|
895
894
|
key: 0,
|
|
@@ -910,15 +909,11 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
910
909
|
});
|
|
911
910
|
|
|
912
911
|
const _hoisted_1$a = { class: "m-fields-group-list" };
|
|
913
|
-
const _hoisted_2$
|
|
914
|
-
const _hoisted_3$
|
|
912
|
+
const _hoisted_2$4 = ["innerHTML"];
|
|
913
|
+
const _hoisted_3$2 = {
|
|
915
914
|
key: 1,
|
|
916
915
|
class: "el-table__empty-block"
|
|
917
916
|
};
|
|
918
|
-
const _hoisted_4$2 = /* @__PURE__ */ createElementVNode("span", { class: "el-table__empty-text" }, "暂无数据", -1);
|
|
919
|
-
const _hoisted_5$2 = [
|
|
920
|
-
_hoisted_4$2
|
|
921
|
-
];
|
|
922
917
|
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
923
918
|
...{
|
|
924
919
|
name: "MFormGroupList"
|
|
@@ -1004,8 +999,10 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
1004
999
|
key: 0,
|
|
1005
1000
|
innerHTML: _ctx.config.extra,
|
|
1006
1001
|
style: { "color": "rgba(0, 0, 0, 0.45)" }
|
|
1007
|
-
}, null, 8, _hoisted_2$
|
|
1008
|
-
!_ctx.model[_ctx.name] || !_ctx.model[_ctx.name].length ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
1002
|
+
}, null, 8, _hoisted_2$4)) : createCommentVNode("", true),
|
|
1003
|
+
!_ctx.model[_ctx.name] || !_ctx.model[_ctx.name].length ? (openBlock(), createElementBlock("div", _hoisted_3$2, _cache[1] || (_cache[1] = [
|
|
1004
|
+
createElementVNode("span", { class: "el-table__empty-text" }, "暂无数据", -1)
|
|
1005
|
+
]))) : (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(_ctx.model[_ctx.name], (item, index) => {
|
|
1009
1006
|
return openBlock(), createBlock(_sfc_main$v, {
|
|
1010
1007
|
key: index,
|
|
1011
1008
|
model: item,
|
|
@@ -1030,9 +1027,9 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
1030
1027
|
size: "small",
|
|
1031
1028
|
disabled: _ctx.disabled
|
|
1032
1029
|
}, {
|
|
1033
|
-
default: withCtx(() => [
|
|
1030
|
+
default: withCtx(() => _cache[2] || (_cache[2] = [
|
|
1034
1031
|
createTextVNode("新增")
|
|
1035
|
-
]),
|
|
1032
|
+
])),
|
|
1036
1033
|
_: 1
|
|
1037
1034
|
}, 8, ["disabled"])) : createCommentVNode("", true),
|
|
1038
1035
|
_ctx.config.enableToggleMode ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
@@ -1041,9 +1038,9 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
1041
1038
|
size: "small",
|
|
1042
1039
|
onClick: toggleMode
|
|
1043
1040
|
}, {
|
|
1044
|
-
default: withCtx(() => [
|
|
1041
|
+
default: withCtx(() => _cache[3] || (_cache[3] = [
|
|
1045
1042
|
createTextVNode("切换为表格")
|
|
1046
|
-
]),
|
|
1043
|
+
])),
|
|
1047
1044
|
_: 1
|
|
1048
1045
|
}, 8, ["icon"])) : createCommentVNode("", true)
|
|
1049
1046
|
]);
|
|
@@ -1052,8 +1049,8 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
1052
1049
|
});
|
|
1053
1050
|
|
|
1054
1051
|
const _hoisted_1$9 = { style: { "width": "100%", "display": "flex", "align-items": "center" } };
|
|
1055
|
-
const _hoisted_2$
|
|
1056
|
-
const _hoisted_3$
|
|
1052
|
+
const _hoisted_2$3 = ["innerHTML"];
|
|
1053
|
+
const _hoisted_3$1 = {
|
|
1057
1054
|
key: 0,
|
|
1058
1055
|
style: { "display": "flex" }
|
|
1059
1056
|
};
|
|
@@ -1103,7 +1100,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
1103
1100
|
key: 0,
|
|
1104
1101
|
innerHTML: _ctx.config.extra,
|
|
1105
1102
|
class: "m-form-tip"
|
|
1106
|
-
}, null, 8, _hoisted_2$
|
|
1103
|
+
}, null, 8, _hoisted_2$3)) : createCommentVNode("", true),
|
|
1107
1104
|
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
1108
1105
|
createTextVNode(toDisplayString(filter(_ctx.config.title)), 1)
|
|
1109
1106
|
])
|
|
@@ -1112,7 +1109,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
1112
1109
|
default: withCtx(() => [
|
|
1113
1110
|
createElementVNode("div", null, [
|
|
1114
1111
|
renderSlot(_ctx.$slots, "default"),
|
|
1115
|
-
_ctx.config.schematic ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
1112
|
+
_ctx.config.schematic ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
1116
1113
|
createElementVNode("div", _hoisted_4$1, [
|
|
1117
1114
|
(openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item, index) => {
|
|
1118
1115
|
return openBlock(), createBlock(_sfc_main$x, {
|
|
@@ -1338,8 +1335,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
1338
1335
|
});
|
|
1339
1336
|
|
|
1340
1337
|
const _hoisted_1$8 = { class: "m-fields-table-wrap" };
|
|
1341
|
-
const _hoisted_2$
|
|
1342
|
-
const _hoisted_3
|
|
1338
|
+
const _hoisted_2$2 = ["innerHTML"];
|
|
1339
|
+
const _hoisted_3 = ["innerHTML"];
|
|
1343
1340
|
const _hoisted_4 = { style: { "display": "flex", "justify-content": "space-between", "margin": "10px 0" } };
|
|
1344
1341
|
const _hoisted_5 = { style: { "display": "flex" } };
|
|
1345
1342
|
const _hoisted_6 = {
|
|
@@ -1717,7 +1714,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1717
1714
|
key: 0,
|
|
1718
1715
|
style: { "color": "rgba(0, 0, 0, 0.45)" },
|
|
1719
1716
|
innerHTML: _ctx.config.extra
|
|
1720
|
-
}, null, 8, _hoisted_2$
|
|
1717
|
+
}, null, 8, _hoisted_2$2)) : createCommentVNode("", true),
|
|
1721
1718
|
createVNode(unref(TMagicTooltip), {
|
|
1722
1719
|
content: "拖拽可排序",
|
|
1723
1720
|
placement: "left-start",
|
|
@@ -1749,7 +1746,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1749
1746
|
createElementVNode("span", {
|
|
1750
1747
|
innerHTML: itemExtra(_ctx.config.itemExtra, scope.$index),
|
|
1751
1748
|
class: "m-form-tip"
|
|
1752
|
-
}, null, 8, _hoisted_3
|
|
1749
|
+
}, null, 8, _hoisted_3)
|
|
1753
1750
|
]),
|
|
1754
1751
|
_: 1
|
|
1755
1752
|
})) : createCommentVNode("", true),
|
|
@@ -1886,9 +1883,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1886
1883
|
plain: "",
|
|
1887
1884
|
onClick: _cache[2] || (_cache[2] = ($event) => newHandler())
|
|
1888
1885
|
}, {
|
|
1889
|
-
default: withCtx(() => [
|
|
1886
|
+
default: withCtx(() => _cache[4] || (_cache[4] = [
|
|
1890
1887
|
createTextVNode("新增一行")
|
|
1891
|
-
]),
|
|
1888
|
+
])),
|
|
1892
1889
|
_: 1
|
|
1893
1890
|
}, 8, ["disabled"])) : createCommentVNode("", true),
|
|
1894
1891
|
createElementVNode("div", _hoisted_5, [
|
|
@@ -1899,9 +1896,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1899
1896
|
type: "primary",
|
|
1900
1897
|
onClick: toggleMode
|
|
1901
1898
|
}, {
|
|
1902
|
-
default: withCtx(() => [
|
|
1899
|
+
default: withCtx(() => _cache[5] || (_cache[5] = [
|
|
1903
1900
|
createTextVNode("展开配置")
|
|
1904
|
-
]),
|
|
1901
|
+
])),
|
|
1905
1902
|
_: 1
|
|
1906
1903
|
}, 8, ["icon"])) : createCommentVNode("", true),
|
|
1907
1904
|
_ctx.config.enableFullscreen !== false ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
@@ -1933,9 +1930,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1933
1930
|
disabled: _ctx.disabled,
|
|
1934
1931
|
plain: ""
|
|
1935
1932
|
}, {
|
|
1936
|
-
default: withCtx(() => [
|
|
1933
|
+
default: withCtx(() => _cache[6] || (_cache[6] = [
|
|
1937
1934
|
createTextVNode("导入EXCEL")
|
|
1938
|
-
]),
|
|
1935
|
+
])),
|
|
1939
1936
|
_: 1
|
|
1940
1937
|
}, 8, ["disabled"])
|
|
1941
1938
|
]),
|
|
@@ -1949,9 +1946,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1949
1946
|
plain: "",
|
|
1950
1947
|
onClick: _cache[3] || (_cache[3] = ($event) => clearHandler())
|
|
1951
1948
|
}, {
|
|
1952
|
-
default: withCtx(() => [
|
|
1949
|
+
default: withCtx(() => _cache[7] || (_cache[7] = [
|
|
1953
1950
|
createTextVNode("清空")
|
|
1954
|
-
]),
|
|
1951
|
+
])),
|
|
1955
1952
|
_: 1
|
|
1956
1953
|
}, 8, ["disabled"])) : createCommentVNode("", true)
|
|
1957
1954
|
])
|
|
@@ -2478,7 +2475,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
2478
2475
|
const props = __props;
|
|
2479
2476
|
const emit = __emit;
|
|
2480
2477
|
useAddField(props.prop);
|
|
2481
|
-
props.model[props.name] = datetimeFormatter(props.model[props.name], "", "YYYY/MM/DD");
|
|
2478
|
+
props.model[props.name] = datetimeFormatter(props.model[props.name], "", props.config.valueFormat || "YYYY/MM/DD");
|
|
2482
2479
|
const changeHandler = (v) => {
|
|
2483
2480
|
emit("change", v);
|
|
2484
2481
|
};
|
|
@@ -2529,9 +2526,10 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2529
2526
|
if (!value.value) {
|
|
2530
2527
|
value.value = [];
|
|
2531
2528
|
}
|
|
2529
|
+
const format = `${props.config.dateFormat || "YYYY/MM/DD"} ${props.config.timeFormat || "HH:mm:ss"}`;
|
|
2532
2530
|
if (!start || !end) value.value = [];
|
|
2533
|
-
if (start !== preStart) value.value[0] =
|
|
2534
|
-
if (end !== preEnd) value.value[1] =
|
|
2531
|
+
if (start !== preStart) value.value[0] = datetimeFormatter(start, "", format);
|
|
2532
|
+
if (end !== preEnd) value.value[1] = datetimeFormatter(end, "", format);
|
|
2535
2533
|
},
|
|
2536
2534
|
{
|
|
2537
2535
|
immediate: true
|
|
@@ -2541,7 +2539,11 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2541
2539
|
watch(
|
|
2542
2540
|
() => props.model[props.name],
|
|
2543
2541
|
(start, preStart) => {
|
|
2544
|
-
|
|
2542
|
+
const format = `${props.config.dateFormat || "YYYY/MM/DD"} ${props.config.timeFormat || "HH:mm:ss"}`;
|
|
2543
|
+
if (start !== preStart)
|
|
2544
|
+
value.value = start.map(
|
|
2545
|
+
(item) => item ? datetimeFormatter(item, "", format) : void 0
|
|
2546
|
+
);
|
|
2545
2547
|
},
|
|
2546
2548
|
{
|
|
2547
2549
|
immediate: true
|
|
@@ -2555,11 +2557,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2555
2557
|
return;
|
|
2556
2558
|
}
|
|
2557
2559
|
if (Array.isArray(v)) {
|
|
2558
|
-
props.model[item] =
|
|
2559
|
-
v[index]?.toString(),
|
|
2560
|
-
"",
|
|
2561
|
-
props.config.valueFormat || "YYYY/MM/DD HH:mm:ss"
|
|
2562
|
-
);
|
|
2560
|
+
props.model[item] = v[index];
|
|
2563
2561
|
} else {
|
|
2564
2562
|
props.model[item] = void 0;
|
|
2565
2563
|
}
|
|
@@ -2568,18 +2566,12 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2568
2566
|
const changeHandler = (v) => {
|
|
2569
2567
|
const value2 = v || [];
|
|
2570
2568
|
if (props.name) {
|
|
2571
|
-
emit(
|
|
2572
|
-
"change",
|
|
2573
|
-
value2.map((item) => {
|
|
2574
|
-
if (item) return datetimeFormatter(item, "", props.config.valueFormat || "YYYY/MM/DD HH:mm:ss");
|
|
2575
|
-
return void 0;
|
|
2576
|
-
})
|
|
2577
|
-
);
|
|
2569
|
+
emit("change", value2);
|
|
2578
2570
|
} else {
|
|
2579
2571
|
if (names?.length) {
|
|
2580
2572
|
setValue(value2);
|
|
2581
2573
|
}
|
|
2582
|
-
emit("change",
|
|
2574
|
+
emit("change", props.model);
|
|
2583
2575
|
}
|
|
2584
2576
|
};
|
|
2585
2577
|
return (_ctx, _cache) => {
|
|
@@ -3089,9 +3081,9 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
3089
3081
|
onClick: cancel,
|
|
3090
3082
|
size: "small"
|
|
3091
3083
|
}, {
|
|
3092
|
-
default: withCtx(() => [
|
|
3084
|
+
default: withCtx(() => _cache[2] || (_cache[2] = [
|
|
3093
3085
|
createTextVNode("取 消")
|
|
3094
|
-
]),
|
|
3086
|
+
])),
|
|
3095
3087
|
_: 1
|
|
3096
3088
|
}),
|
|
3097
3089
|
hasStep.value && stepActive.value > 1 ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
@@ -3100,9 +3092,9 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
3100
3092
|
size: "small",
|
|
3101
3093
|
onClick: preStep
|
|
3102
3094
|
}, {
|
|
3103
|
-
default: withCtx(() => [
|
|
3095
|
+
default: withCtx(() => _cache[3] || (_cache[3] = [
|
|
3104
3096
|
createTextVNode("上一步")
|
|
3105
|
-
]),
|
|
3097
|
+
])),
|
|
3106
3098
|
_: 1
|
|
3107
3099
|
})) : createCommentVNode("", true),
|
|
3108
3100
|
hasStep.value && stepCount.value > stepActive.value ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
@@ -3111,9 +3103,9 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
3111
3103
|
size: "small",
|
|
3112
3104
|
onClick: nextStep
|
|
3113
3105
|
}, {
|
|
3114
|
-
default: withCtx(() => [
|
|
3106
|
+
default: withCtx(() => _cache[4] || (_cache[4] = [
|
|
3115
3107
|
createTextVNode("下一步")
|
|
3116
|
-
]),
|
|
3108
|
+
])),
|
|
3117
3109
|
_: 1
|
|
3118
3110
|
})) : (openBlock(), createBlock(unref(TMagicButton), {
|
|
3119
3111
|
key: 2,
|
|
@@ -3167,7 +3159,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
3167
3159
|
});
|
|
3168
3160
|
|
|
3169
3161
|
const _hoisted_1$4 = ["href"];
|
|
3170
|
-
const _hoisted_2$
|
|
3162
|
+
const _hoisted_2$1 = {
|
|
3171
3163
|
key: 2,
|
|
3172
3164
|
class: "m-fields-link"
|
|
3173
3165
|
};
|
|
@@ -3243,15 +3235,15 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
3243
3235
|
}, toDisplayString(displayText.value), 13, _hoisted_1$4)) : _ctx.config.href && _ctx.disabled ? (openBlock(), createElementBlock("span", {
|
|
3244
3236
|
key: 1,
|
|
3245
3237
|
style: normalizeStyle(_ctx.config.disabledCss || {})
|
|
3246
|
-
}, toDisplayString(displayText.value), 5)) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
3238
|
+
}, toDisplayString(displayText.value), 5)) : (openBlock(), createElementBlock("div", _hoisted_2$1, [
|
|
3247
3239
|
createVNode(unref(TMagicButton), {
|
|
3248
3240
|
link: "",
|
|
3249
3241
|
type: "primary",
|
|
3250
3242
|
onClick: editHandler
|
|
3251
3243
|
}, {
|
|
3252
|
-
default: withCtx(() => [
|
|
3244
|
+
default: withCtx(() => _cache[0] || (_cache[0] = [
|
|
3253
3245
|
createTextVNode("点击编辑")
|
|
3254
|
-
]),
|
|
3246
|
+
])),
|
|
3255
3247
|
_: 1
|
|
3256
3248
|
}),
|
|
3257
3249
|
createVNode(_sfc_main$c, {
|
|
@@ -3320,7 +3312,6 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
3320
3312
|
});
|
|
3321
3313
|
|
|
3322
3314
|
const _hoisted_1$3 = { class: "m-fields-number-range" };
|
|
3323
|
-
const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("span", { class: "split-tag" }, "-", -1);
|
|
3324
3315
|
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
3325
3316
|
...{
|
|
3326
3317
|
name: "MFormNumberRange"
|
|
@@ -3361,7 +3352,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
3361
3352
|
disabled: _ctx.disabled,
|
|
3362
3353
|
onChange: minChangeHandler
|
|
3363
3354
|
}, null, 8, ["modelValue", "size", "disabled"]),
|
|
3364
|
-
|
|
3355
|
+
_cache[2] || (_cache[2] = createElementVNode("span", { class: "split-tag" }, "-", -1)),
|
|
3365
3356
|
createVNode(unref(TMagicInput), {
|
|
3366
3357
|
modelValue: _ctx.model[_ctx.name][1],
|
|
3367
3358
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.model[_ctx.name][1] = $event),
|
|
@@ -3884,8 +3875,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3884
3875
|
});
|
|
3885
3876
|
|
|
3886
3877
|
const _hoisted_1$1 = { class: "m-form-item__content" };
|
|
3887
|
-
const _hoisted_2 =
|
|
3888
|
-
const _hoisted_3 = { style: { "display": "flex", "justify-content": "flex-end" } };
|
|
3878
|
+
const _hoisted_2 = { style: { "display": "flex", "justify-content": "flex-end" } };
|
|
3889
3879
|
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
3890
3880
|
...{
|
|
3891
3881
|
name: "MFormText"
|
|
@@ -4011,7 +4001,6 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
4011
4001
|
modelValue: _ctx.model[_ctx.name],
|
|
4012
4002
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
4013
4003
|
clearable: "",
|
|
4014
|
-
"data-tmagic-form-item-prop": _ctx.prop,
|
|
4015
4004
|
size: _ctx.size,
|
|
4016
4005
|
placeholder: _ctx.config.placeholder,
|
|
4017
4006
|
disabled: _ctx.disabled,
|
|
@@ -4036,20 +4025,20 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
4036
4025
|
]),
|
|
4037
4026
|
key: "0"
|
|
4038
4027
|
} : void 0
|
|
4039
|
-
]), 1032, ["modelValue", "
|
|
4028
|
+
]), 1032, ["modelValue", "size", "placeholder", "disabled"])
|
|
4040
4029
|
]),
|
|
4041
4030
|
default: withCtx(() => [
|
|
4042
4031
|
createElementVNode("div", _hoisted_1$1, [
|
|
4043
|
-
|
|
4044
|
-
createElementVNode("div",
|
|
4032
|
+
_cache[5] || (_cache[5] = createElementVNode("div", { class: "m-form-validate__warning" }, "输入内容前后有空格,是否移除空格?", -1)),
|
|
4033
|
+
createElementVNode("div", _hoisted_2, [
|
|
4045
4034
|
createVNode(unref(TMagicButton), {
|
|
4046
4035
|
link: "",
|
|
4047
4036
|
size: "small",
|
|
4048
4037
|
onClick: _cache[2] || (_cache[2] = ($event) => popoverVisible.value = false)
|
|
4049
4038
|
}, {
|
|
4050
|
-
default: withCtx(() => [
|
|
4039
|
+
default: withCtx(() => _cache[3] || (_cache[3] = [
|
|
4051
4040
|
createTextVNode("保持原样")
|
|
4052
|
-
]),
|
|
4041
|
+
])),
|
|
4053
4042
|
_: 1
|
|
4054
4043
|
}),
|
|
4055
4044
|
createVNode(unref(TMagicButton), {
|
|
@@ -4057,9 +4046,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
4057
4046
|
size: "small",
|
|
4058
4047
|
onClick: confirmTrimHandler
|
|
4059
4048
|
}, {
|
|
4060
|
-
default: withCtx(() => [
|
|
4049
|
+
default: withCtx(() => _cache[4] || (_cache[4] = [
|
|
4061
4050
|
createTextVNode("移除空格")
|
|
4062
|
-
]),
|
|
4051
|
+
])),
|
|
4063
4052
|
_: 1
|
|
4064
4053
|
})
|
|
4065
4054
|
])
|
|
@@ -4345,9 +4334,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4345
4334
|
default: withCtx(() => [
|
|
4346
4335
|
renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
4347
4336
|
createVNode(unref(TMagicButton), { onClick: handleClose }, {
|
|
4348
|
-
default: withCtx(() => [
|
|
4337
|
+
default: withCtx(() => _cache[1] || (_cache[1] = [
|
|
4349
4338
|
createTextVNode("关闭")
|
|
4350
|
-
]),
|
|
4339
|
+
])),
|
|
4351
4340
|
_: 1
|
|
4352
4341
|
}),
|
|
4353
4342
|
createVNode(unref(TMagicButton), {
|
|
@@ -4522,8 +4511,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4522
4511
|
const createForm = (config) => config;
|
|
4523
4512
|
const defaultInstallOpt = {};
|
|
4524
4513
|
const index = {
|
|
4525
|
-
install(app, opt
|
|
4526
|
-
const option = Object.assign(defaultInstallOpt, opt);
|
|
4514
|
+
install(app, opt) {
|
|
4515
|
+
const option = Object.assign(defaultInstallOpt, opt || {});
|
|
4527
4516
|
app.config.globalProperties.$MAGIC_FORM = option;
|
|
4528
4517
|
setConfig(option);
|
|
4529
4518
|
app.component("m-form", _sfc_main$d);
|