@tmagic/form 1.2.0-beta.1 → 1.2.0-beta.2

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.
@@ -1,4 +1,4 @@
1
- import { toRaw, defineComponent, inject, ref, computed, resolveComponent, watchEffect, openBlock, createElementBlock, normalizeStyle, normalizeClass, createBlock, resolveDynamicComponent, Fragment, createVNode, withCtx, createElementVNode, createCommentVNode, renderList, createTextVNode, toDisplayString, watch, unref, withDirectives, vShow, renderSlot, onMounted, toRefs, getCurrentInstance, reactive, onBeforeUnmount, vModelText, onBeforeMount, resolveDirective, createSlots, withModifiers, provide, Teleport } from 'vue';
1
+ import { toRaw, defineComponent, inject, ref, computed, resolveComponent, watchEffect, openBlock, createElementBlock, normalizeStyle, normalizeClass, createBlock, resolveDynamicComponent, Fragment, createVNode, withCtx, createElementVNode, createCommentVNode, renderList, createTextVNode, toDisplayString, watch, unref, withDirectives, vShow, renderSlot, onMounted, toRefs, getCurrentInstance, reactive, onBeforeUnmount, vModelText, onBeforeMount, resolveDirective, createSlots, withModifiers, provide } from 'vue';
2
2
  import { WarningFilled, CaretBottom, CaretRight, CaretTop, Delete, Grid, ArrowDown, ArrowUp, FullScreen } from '@element-plus/icons-vue';
3
3
  import { cloneDeep, isEqual } from 'lodash-es';
4
4
  import { ElMessage } from 'element-plus';
@@ -320,7 +320,7 @@ const _hoisted_1$c = ["innerHTML"];
320
320
  const _hoisted_2$7 = ["innerHTML"];
321
321
  const _hoisted_3$7 = ["innerHTML"];
322
322
  const _hoisted_4$6 = ["innerHTML"];
323
- const _hoisted_5$5 = {
323
+ const _hoisted_5$4 = {
324
324
  key: 4,
325
325
  style: { "text-align": "center" }
326
326
  };
@@ -438,7 +438,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
438
438
  }, null, 8, ["model", "config", "size", "step-active", "expand-more", "label-width", "prop", "onChange"]);
439
439
  }), 128)) : createCommentVNode("", true)
440
440
  ], 64)) : createCommentVNode("", true),
441
- _ctx.config.expand && _ctx.type !== "fieldset" ? (openBlock(), createElementBlock("div", _hoisted_5$5, [
441
+ _ctx.config.expand && _ctx.type !== "fieldset" ? (openBlock(), createElementBlock("div", _hoisted_5$4, [
442
442
  createVNode(_component_el_button, {
443
443
  text: "",
444
444
  onClick: _ctx.expandHandler
@@ -457,7 +457,7 @@ const _hoisted_1$b = ["innerHTML"];
457
457
  const _hoisted_2$6 = ["innerHTML"];
458
458
  const _hoisted_3$6 = { key: 1 };
459
459
  const _hoisted_4$5 = ["innerHTML"];
460
- const _hoisted_5$4 = ["innerHTML"];
460
+ const _hoisted_5$3 = ["innerHTML"];
461
461
  const _hoisted_6$2 = {
462
462
  key: 2,
463
463
  style: { "display": "flex" }
@@ -542,7 +542,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
542
542
  key: 0,
543
543
  innerHTML: __props.config.extra,
544
544
  class: "m-form-tip"
545
- }, null, 8, _hoisted_5$4)) : createCommentVNode("", true)
545
+ }, null, 8, _hoisted_5$3)) : createCommentVNode("", true)
546
546
  ])),
547
547
  __props.config.schematic && unref(show) ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
548
548
  createElementVNode("div", _hoisted_7$2, [
@@ -866,7 +866,7 @@ const _hoisted_3$4 = {
866
866
  class: "el-table__empty-block"
867
867
  };
868
868
  const _hoisted_4$3 = /* @__PURE__ */ createElementVNode("span", { class: "el-table__empty-text" }, "\u6682\u65E0\u6570\u636E", -1);
869
- const _hoisted_5$3 = [
869
+ const _hoisted_5$2 = [
870
870
  _hoisted_4$3
871
871
  ];
872
872
  const _hoisted_6$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0\u7EC4");
@@ -880,7 +880,7 @@ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
880
880
  innerHTML: _ctx.config.extra,
881
881
  style: { "color": "rgba(0, 0, 0, 0.45)" }
882
882
  }, null, 8, _hoisted_2$4)) : createCommentVNode("", true),
883
- !_ctx.model[_ctx.name] || !_ctx.model[_ctx.name].length ? (openBlock(), createElementBlock("div", _hoisted_3$4, _hoisted_5$3)) : (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(_ctx.model[_ctx.name], (item, index) => {
883
+ !_ctx.model[_ctx.name] || !_ctx.model[_ctx.name].length ? (openBlock(), createElementBlock("div", _hoisted_3$4, _hoisted_5$2)) : (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(_ctx.model[_ctx.name], (item, index) => {
884
884
  return openBlock(), createBlock(_component_m_fields_group_list_item, {
885
885
  key: index,
886
886
  model: item,
@@ -961,7 +961,7 @@ const _hoisted_3$3 = {
961
961
  style: { "display": "flex" }
962
962
  };
963
963
  const _hoisted_4$2 = { style: { "flex": "1" } };
964
- const _hoisted_5$2 = ["src"];
964
+ const _hoisted_5$1 = ["src"];
965
965
  function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
966
966
  const _component_caret_bottom = resolveComponent("caret-bottom");
967
967
  const _component_caret_right = resolveComponent("caret-right");
@@ -1015,7 +1015,7 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
1015
1015
  createElementVNode("img", {
1016
1016
  class: "m-form-schematic",
1017
1017
  src: _ctx.config.schematic
1018
- }, null, 8, _hoisted_5$2)
1018
+ }, null, 8, _hoisted_5$1)
1019
1019
  ])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.items, (item, index) => {
1020
1020
  return openBlock(), createBlock(_component_m_form_container, {
1021
1021
  key: item[_ctx.mForm?.keyProp || "__key"] ?? index,
@@ -1601,7 +1601,7 @@ const _hoisted_1$7 = ["innerHTML"];
1601
1601
  const _hoisted_2$2 = { class: "el-form-item__content" };
1602
1602
  const _hoisted_3$2 = ["innerHTML"];
1603
1603
  const _hoisted_4$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0");
1604
- const _hoisted_5$1 = /* @__PURE__ */ createTextVNode(" \xA0 ");
1604
+ const _hoisted_5 = /* @__PURE__ */ createTextVNode(" \xA0 ");
1605
1605
  const _hoisted_6 = /* @__PURE__ */ createTextVNode("\u5C55\u5F00\u914D\u7F6E");
1606
1606
  const _hoisted_7 = /* @__PURE__ */ createTextVNode("\u5BFC\u5165EXCEL");
1607
1607
  const _hoisted_8 = /* @__PURE__ */ createTextVNode("\xA0 ");
@@ -1791,7 +1791,7 @@ function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
1791
1791
  ]),
1792
1792
  _: 1
1793
1793
  })) : createCommentVNode("", true),
1794
- _hoisted_5$1,
1794
+ _hoisted_5,
1795
1795
  _ctx.enableToggleMode && !_ctx.isFullscreen ? (openBlock(), createBlock(_component_el_button, {
1796
1796
  key: 1,
1797
1797
  icon: _ctx.Grid,
@@ -3767,121 +3767,117 @@ const _sfc_main = defineComponent({
3767
3767
  }
3768
3768
  });
3769
3769
 
3770
- const _hoisted_1 = { class: "m-form-dialog" };
3771
- const _hoisted_2 = { style: { "min-height": "1px" } };
3772
- const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u53D6 \u6D88");
3773
- const _hoisted_4 = /* @__PURE__ */ createTextVNode("\u4E0A\u4E00\u6B65");
3774
- const _hoisted_5 = /* @__PURE__ */ createTextVNode("\u4E0B\u4E00\u6B65");
3770
+ const _hoisted_1 = { style: { "min-height": "1px" } };
3771
+ const _hoisted_2 = /* @__PURE__ */ createTextVNode("\u53D6 \u6D88");
3772
+ const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u4E0A\u4E00\u6B65");
3773
+ const _hoisted_4 = /* @__PURE__ */ createTextVNode("\u4E0B\u4E00\u6B65");
3775
3774
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
3776
3775
  const _component_m_form = resolveComponent("m-form");
3777
3776
  const _component_el_col = resolveComponent("el-col");
3778
3777
  const _component_el_button = resolveComponent("el-button");
3779
3778
  const _component_el_row = resolveComponent("el-row");
3780
3779
  const _component_el_dialog = resolveComponent("el-dialog");
3781
- return openBlock(), createBlock(Teleport, { to: "body" }, [
3782
- withDirectives(createElementVNode("div", _hoisted_1, [
3783
- createVNode(_component_el_dialog, {
3784
- modelValue: _ctx.dialogVisible,
3785
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.dialogVisible = $event),
3786
- top: "20px",
3787
- title: _ctx.title,
3788
- width: _ctx.width,
3789
- fullscreen: _ctx.fullscreen,
3790
- "close-on-click-modal": false,
3791
- onClose: _ctx.closeHandler
3792
- }, {
3793
- footer: withCtx(() => [
3794
- createVNode(_component_el_row, { class: "dialog-footer" }, {
3780
+ return openBlock(), createBlock(_component_el_dialog, {
3781
+ modelValue: _ctx.dialogVisible,
3782
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.dialogVisible = $event),
3783
+ class: "m-form-dialog",
3784
+ top: "20px",
3785
+ "append-to-body": "",
3786
+ title: _ctx.title,
3787
+ width: _ctx.width,
3788
+ fullscreen: _ctx.fullscreen,
3789
+ "close-on-click-modal": false,
3790
+ onClose: _ctx.closeHandler
3791
+ }, {
3792
+ footer: withCtx(() => [
3793
+ createVNode(_component_el_row, { class: "dialog-footer" }, {
3794
+ default: withCtx(() => [
3795
+ createVNode(_component_el_col, {
3796
+ span: 12,
3797
+ style: { "text-align": "left" }
3798
+ }, {
3795
3799
  default: withCtx(() => [
3796
- createVNode(_component_el_col, {
3797
- span: 12,
3798
- style: { "text-align": "left" }
3799
- }, {
3800
- default: withCtx(() => [
3801
- createElementVNode("div", _hoisted_2, [
3802
- renderSlot(_ctx.$slots, "left")
3803
- ])
3804
- ]),
3805
- _: 3
3806
- }),
3807
- createVNode(_component_el_col, { span: 12 }, {
3808
- default: withCtx(() => [
3809
- renderSlot(_ctx.$slots, "footer", {}, () => [
3810
- createVNode(_component_el_button, {
3811
- onClick: _ctx.cancel,
3812
- size: "small"
3813
- }, {
3814
- default: withCtx(() => [
3815
- _hoisted_3
3816
- ]),
3817
- _: 1
3818
- }, 8, ["onClick"]),
3819
- _ctx.hasStep && _ctx.stepActive > 1 ? (openBlock(), createBlock(_component_el_button, {
3820
- key: 0,
3821
- type: "info",
3822
- size: "small",
3823
- onClick: _ctx.preStep
3824
- }, {
3825
- default: withCtx(() => [
3826
- _hoisted_4
3827
- ]),
3828
- _: 1
3829
- }, 8, ["onClick"])) : createCommentVNode("", true),
3830
- _ctx.hasStep && _ctx.stepCount > _ctx.stepActive ? (openBlock(), createBlock(_component_el_button, {
3831
- key: 1,
3832
- type: "info",
3833
- size: "small",
3834
- onClick: _ctx.nextStep
3835
- }, {
3836
- default: withCtx(() => [
3837
- _hoisted_5
3838
- ]),
3839
- _: 1
3840
- }, 8, ["onClick"])) : (openBlock(), createBlock(_component_el_button, {
3841
- key: 2,
3842
- type: "primary",
3843
- size: "small",
3844
- loading: _ctx.saveFetch,
3845
- onClick: _ctx.save
3846
- }, {
3847
- default: withCtx(() => [
3848
- createTextVNode(toDisplayString(_ctx.confirmText), 1)
3849
- ]),
3850
- _: 1
3851
- }, 8, ["loading", "onClick"]))
3852
- ])
3853
- ]),
3854
- _: 3
3855
- })
3800
+ createElementVNode("div", _hoisted_1, [
3801
+ renderSlot(_ctx.$slots, "left")
3802
+ ])
3803
+ ]),
3804
+ _: 3
3805
+ }),
3806
+ createVNode(_component_el_col, { span: 12 }, {
3807
+ default: withCtx(() => [
3808
+ renderSlot(_ctx.$slots, "footer", {}, () => [
3809
+ createVNode(_component_el_button, {
3810
+ onClick: _ctx.cancel,
3811
+ size: "small"
3812
+ }, {
3813
+ default: withCtx(() => [
3814
+ _hoisted_2
3815
+ ]),
3816
+ _: 1
3817
+ }, 8, ["onClick"]),
3818
+ _ctx.hasStep && _ctx.stepActive > 1 ? (openBlock(), createBlock(_component_el_button, {
3819
+ key: 0,
3820
+ type: "info",
3821
+ size: "small",
3822
+ onClick: _ctx.preStep
3823
+ }, {
3824
+ default: withCtx(() => [
3825
+ _hoisted_3
3826
+ ]),
3827
+ _: 1
3828
+ }, 8, ["onClick"])) : createCommentVNode("", true),
3829
+ _ctx.hasStep && _ctx.stepCount > _ctx.stepActive ? (openBlock(), createBlock(_component_el_button, {
3830
+ key: 1,
3831
+ type: "info",
3832
+ size: "small",
3833
+ onClick: _ctx.nextStep
3834
+ }, {
3835
+ default: withCtx(() => [
3836
+ _hoisted_4
3837
+ ]),
3838
+ _: 1
3839
+ }, 8, ["onClick"])) : (openBlock(), createBlock(_component_el_button, {
3840
+ key: 2,
3841
+ type: "primary",
3842
+ size: "small",
3843
+ loading: _ctx.saveFetch,
3844
+ onClick: _ctx.save
3845
+ }, {
3846
+ default: withCtx(() => [
3847
+ createTextVNode(toDisplayString(_ctx.confirmText), 1)
3848
+ ]),
3849
+ _: 1
3850
+ }, 8, ["loading", "onClick"]))
3851
+ ])
3856
3852
  ]),
3857
3853
  _: 3
3858
3854
  })
3859
3855
  ]),
3860
- default: withCtx(() => [
3861
- createElementVNode("div", {
3862
- class: "m-dialog-body",
3863
- style: normalizeStyle(`max-height: ${_ctx.bodyHeight}; overflow-y: auto; overflow-x: hidden;`)
3864
- }, [
3865
- createVNode(_component_m_form, {
3866
- modelValue: _ctx.stepActive,
3867
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.stepActive = $event),
3868
- ref: "form",
3869
- size: _ctx.size,
3870
- config: _ctx.config,
3871
- "init-values": _ctx.values,
3872
- "parent-values": _ctx.parentValues,
3873
- "label-width": _ctx.labelWidth,
3874
- onChange: _ctx.changeHandler
3875
- }, null, 8, ["modelValue", "size", "config", "init-values", "parent-values", "label-width", "onChange"]),
3876
- renderSlot(_ctx.$slots, "default")
3877
- ], 4)
3878
- ]),
3879
3856
  _: 3
3880
- }, 8, ["modelValue", "title", "width", "fullscreen", "onClose"])
3881
- ], 512), [
3882
- [vShow, _ctx.dialogVisible]
3883
- ])
3884
- ]);
3857
+ })
3858
+ ]),
3859
+ default: withCtx(() => [
3860
+ _ctx.dialogVisible ? (openBlock(), createElementBlock("div", {
3861
+ key: 0,
3862
+ class: "m-dialog-body",
3863
+ style: normalizeStyle(`max-height: ${_ctx.bodyHeight}; overflow-y: auto; overflow-x: hidden;`)
3864
+ }, [
3865
+ createVNode(_component_m_form, {
3866
+ modelValue: _ctx.stepActive,
3867
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.stepActive = $event),
3868
+ ref: "form",
3869
+ size: _ctx.size,
3870
+ config: _ctx.config,
3871
+ "init-values": _ctx.values,
3872
+ "parent-values": _ctx.parentValues,
3873
+ "label-width": _ctx.labelWidth,
3874
+ onChange: _ctx.changeHandler
3875
+ }, null, 8, ["modelValue", "size", "config", "init-values", "parent-values", "label-width", "onChange"]),
3876
+ renderSlot(_ctx.$slots, "default")
3877
+ ], 4)) : createCommentVNode("", true)
3878
+ ]),
3879
+ _: 3
3880
+ }, 8, ["modelValue", "title", "width", "fullscreen", "onClose"]);
3885
3881
  }
3886
3882
  const FormDialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
3887
3883