@tmagic/form 1.5.0-beta.5 → 1.5.0-beta.7

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.
@@ -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$8 = ["innerHTML", "title"];
190
- const _hoisted_3$5 = ["innerHTML"];
191
- const _hoisted_4$4 = ["innerHTML"];
192
- const _hoisted_5$4 = ["innerHTML"];
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$8)
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$5)
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, ["data-tmagic-form-item-prop", "size", "model", "last-values", "config", "name", "disabled", "prop"]))
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, ["data-tmagic-form-item-prop", "size", "model", "last-values", "config", "name", "disabled", "prop"])),
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$4)) : createCommentVNode("", true)
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$4)
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$7 = ["innerHTML"];
620
- const _hoisted_3$4 = { key: 1 };
621
- const _hoisted_4$3 = ["innerHTML"];
622
- const _hoisted_5$3 = ["innerHTML"];
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$7)) : createCommentVNode("", true)
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$4, [
699
+ })) : (openBlock(), createElementBlock("legend", _hoisted_3$3, [
701
700
  createElementVNode("span", {
702
701
  innerHTML: _ctx.config.legend
703
- }, null, 8, _hoisted_4$3),
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$3)) : createCommentVNode("", true)
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$6 = ["innerHTML"];
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$6)) : createCommentVNode("", true)
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$5 = ["innerHTML"];
914
- const _hoisted_3$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$5)) : createCommentVNode("", true),
1008
- !_ctx.model[_ctx.name] || !_ctx.model[_ctx.name].length ? (openBlock(), createElementBlock("div", _hoisted_3$3, _hoisted_5$2)) : (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(_ctx.model[_ctx.name], (item, index) => {
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$4 = ["innerHTML"];
1056
- const _hoisted_3$2 = {
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$4)) : createCommentVNode("", true),
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$2, [
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$3 = ["innerHTML"];
1342
- const _hoisted_3$1 = ["innerHTML"];
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$3)) : createCommentVNode("", true),
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$1)
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
  };
@@ -2530,8 +2527,8 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
2530
2527
  value.value = [];
2531
2528
  }
2532
2529
  if (!start || !end) value.value = [];
2533
- if (start !== preStart) value.value[0] = new Date(start);
2534
- if (end !== preEnd) value.value[1] = new Date(end);
2530
+ if (start !== preStart) value.value[0] = start;
2531
+ if (end !== preEnd) value.value[1] = end;
2535
2532
  },
2536
2533
  {
2537
2534
  immediate: true
@@ -2540,8 +2537,8 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
2540
2537
  } else if (props.name && props.model[props.name]) {
2541
2538
  watch(
2542
2539
  () => props.model[props.name],
2543
- (start, preStart) => {
2544
- if (start !== preStart) value.value = start.map((item) => item ? new Date(item) : void 0);
2540
+ (start) => {
2541
+ value.value = start;
2545
2542
  },
2546
2543
  {
2547
2544
  immediate: true
@@ -2555,11 +2552,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
2555
2552
  return;
2556
2553
  }
2557
2554
  if (Array.isArray(v)) {
2558
- props.model[item] = datetimeFormatter(
2559
- v[index]?.toString(),
2560
- "",
2561
- props.config.valueFormat || "YYYY/MM/DD HH:mm:ss"
2562
- );
2555
+ props.model[item] = v[index];
2563
2556
  } else {
2564
2557
  props.model[item] = void 0;
2565
2558
  }
@@ -2568,18 +2561,12 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
2568
2561
  const changeHandler = (v) => {
2569
2562
  const value2 = v || [];
2570
2563
  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
- );
2564
+ emit("change", value2);
2578
2565
  } else {
2579
2566
  if (names?.length) {
2580
2567
  setValue(value2);
2581
2568
  }
2582
- emit("change", value2);
2569
+ emit("change", props.model);
2583
2570
  }
2584
2571
  };
2585
2572
  return (_ctx, _cache) => {
@@ -3089,9 +3076,9 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3089
3076
  onClick: cancel,
3090
3077
  size: "small"
3091
3078
  }, {
3092
- default: withCtx(() => [
3079
+ default: withCtx(() => _cache[2] || (_cache[2] = [
3093
3080
  createTextVNode("取 消")
3094
- ]),
3081
+ ])),
3095
3082
  _: 1
3096
3083
  }),
3097
3084
  hasStep.value && stepActive.value > 1 ? (openBlock(), createBlock(unref(TMagicButton), {
@@ -3100,9 +3087,9 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3100
3087
  size: "small",
3101
3088
  onClick: preStep
3102
3089
  }, {
3103
- default: withCtx(() => [
3090
+ default: withCtx(() => _cache[3] || (_cache[3] = [
3104
3091
  createTextVNode("上一步")
3105
- ]),
3092
+ ])),
3106
3093
  _: 1
3107
3094
  })) : createCommentVNode("", true),
3108
3095
  hasStep.value && stepCount.value > stepActive.value ? (openBlock(), createBlock(unref(TMagicButton), {
@@ -3111,9 +3098,9 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3111
3098
  size: "small",
3112
3099
  onClick: nextStep
3113
3100
  }, {
3114
- default: withCtx(() => [
3101
+ default: withCtx(() => _cache[4] || (_cache[4] = [
3115
3102
  createTextVNode("下一步")
3116
- ]),
3103
+ ])),
3117
3104
  _: 1
3118
3105
  })) : (openBlock(), createBlock(unref(TMagicButton), {
3119
3106
  key: 2,
@@ -3167,7 +3154,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3167
3154
  });
3168
3155
 
3169
3156
  const _hoisted_1$4 = ["href"];
3170
- const _hoisted_2$2 = {
3157
+ const _hoisted_2$1 = {
3171
3158
  key: 2,
3172
3159
  class: "m-fields-link"
3173
3160
  };
@@ -3243,15 +3230,15 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
3243
3230
  }, toDisplayString(displayText.value), 13, _hoisted_1$4)) : _ctx.config.href && _ctx.disabled ? (openBlock(), createElementBlock("span", {
3244
3231
  key: 1,
3245
3232
  style: normalizeStyle(_ctx.config.disabledCss || {})
3246
- }, toDisplayString(displayText.value), 5)) : (openBlock(), createElementBlock("div", _hoisted_2$2, [
3233
+ }, toDisplayString(displayText.value), 5)) : (openBlock(), createElementBlock("div", _hoisted_2$1, [
3247
3234
  createVNode(unref(TMagicButton), {
3248
3235
  link: "",
3249
3236
  type: "primary",
3250
3237
  onClick: editHandler
3251
3238
  }, {
3252
- default: withCtx(() => [
3239
+ default: withCtx(() => _cache[0] || (_cache[0] = [
3253
3240
  createTextVNode("点击编辑")
3254
- ]),
3241
+ ])),
3255
3242
  _: 1
3256
3243
  }),
3257
3244
  createVNode(_sfc_main$c, {
@@ -3320,7 +3307,6 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
3320
3307
  });
3321
3308
 
3322
3309
  const _hoisted_1$3 = { class: "m-fields-number-range" };
3323
- const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("span", { class: "split-tag" }, "-", -1);
3324
3310
  const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3325
3311
  ...{
3326
3312
  name: "MFormNumberRange"
@@ -3361,7 +3347,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3361
3347
  disabled: _ctx.disabled,
3362
3348
  onChange: minChangeHandler
3363
3349
  }, null, 8, ["modelValue", "size", "disabled"]),
3364
- _hoisted_2$1,
3350
+ _cache[2] || (_cache[2] = createElementVNode("span", { class: "split-tag" }, "-", -1)),
3365
3351
  createVNode(unref(TMagicInput), {
3366
3352
  modelValue: _ctx.model[_ctx.name][1],
3367
3353
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.model[_ctx.name][1] = $event),
@@ -3884,8 +3870,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3884
3870
  });
3885
3871
 
3886
3872
  const _hoisted_1$1 = { class: "m-form-item__content" };
3887
- const _hoisted_2 = /* @__PURE__ */ createElementVNode("div", { class: "m-form-validate__warning" }, "输入内容前后有空格,是否移除空格?", -1);
3888
- const _hoisted_3 = { style: { "display": "flex", "justify-content": "flex-end" } };
3873
+ const _hoisted_2 = { style: { "display": "flex", "justify-content": "flex-end" } };
3889
3874
  const _sfc_main$5 = /* @__PURE__ */ defineComponent({
3890
3875
  ...{
3891
3876
  name: "MFormText"
@@ -4011,7 +3996,6 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4011
3996
  modelValue: _ctx.model[_ctx.name],
4012
3997
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
4013
3998
  clearable: "",
4014
- "data-tmagic-form-item-prop": _ctx.prop,
4015
3999
  size: _ctx.size,
4016
4000
  placeholder: _ctx.config.placeholder,
4017
4001
  disabled: _ctx.disabled,
@@ -4036,20 +4020,20 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4036
4020
  ]),
4037
4021
  key: "0"
4038
4022
  } : void 0
4039
- ]), 1032, ["modelValue", "data-tmagic-form-item-prop", "size", "placeholder", "disabled"])
4023
+ ]), 1032, ["modelValue", "size", "placeholder", "disabled"])
4040
4024
  ]),
4041
4025
  default: withCtx(() => [
4042
4026
  createElementVNode("div", _hoisted_1$1, [
4043
- _hoisted_2,
4044
- createElementVNode("div", _hoisted_3, [
4027
+ _cache[5] || (_cache[5] = createElementVNode("div", { class: "m-form-validate__warning" }, "输入内容前后有空格,是否移除空格?", -1)),
4028
+ createElementVNode("div", _hoisted_2, [
4045
4029
  createVNode(unref(TMagicButton), {
4046
4030
  link: "",
4047
4031
  size: "small",
4048
4032
  onClick: _cache[2] || (_cache[2] = ($event) => popoverVisible.value = false)
4049
4033
  }, {
4050
- default: withCtx(() => [
4034
+ default: withCtx(() => _cache[3] || (_cache[3] = [
4051
4035
  createTextVNode("保持原样")
4052
- ]),
4036
+ ])),
4053
4037
  _: 1
4054
4038
  }),
4055
4039
  createVNode(unref(TMagicButton), {
@@ -4057,9 +4041,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4057
4041
  size: "small",
4058
4042
  onClick: confirmTrimHandler
4059
4043
  }, {
4060
- default: withCtx(() => [
4044
+ default: withCtx(() => _cache[4] || (_cache[4] = [
4061
4045
  createTextVNode("移除空格")
4062
- ]),
4046
+ ])),
4063
4047
  _: 1
4064
4048
  })
4065
4049
  ])
@@ -4345,9 +4329,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
4345
4329
  default: withCtx(() => [
4346
4330
  renderSlot(_ctx.$slots, "footer", {}, () => [
4347
4331
  createVNode(unref(TMagicButton), { onClick: handleClose }, {
4348
- default: withCtx(() => [
4332
+ default: withCtx(() => _cache[1] || (_cache[1] = [
4349
4333
  createTextVNode("关闭")
4350
- ]),
4334
+ ])),
4351
4335
  _: 1
4352
4336
  }),
4353
4337
  createVNode(unref(TMagicButton), {
@@ -4522,8 +4506,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4522
4506
  const createForm = (config) => config;
4523
4507
  const defaultInstallOpt = {};
4524
4508
  const index = {
4525
- install(app, opt = {}) {
4526
- const option = Object.assign(defaultInstallOpt, opt);
4509
+ install(app, opt) {
4510
+ const option = Object.assign(defaultInstallOpt, opt || {});
4527
4511
  app.config.globalProperties.$MAGIC_FORM = option;
4528
4512
  setConfig(option);
4529
4513
  app.component("m-form", _sfc_main$d);