@tmagic/form 1.1.6 → 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.
@@ -323,7 +323,7 @@
323
323
  const _hoisted_2$7 = ["innerHTML"];
324
324
  const _hoisted_3$7 = ["innerHTML"];
325
325
  const _hoisted_4$6 = ["innerHTML"];
326
- const _hoisted_5$5 = {
326
+ const _hoisted_5$4 = {
327
327
  key: 4,
328
328
  style: { "text-align": "center" }
329
329
  };
@@ -441,7 +441,7 @@
441
441
  }, null, 8, ["model", "config", "size", "step-active", "expand-more", "label-width", "prop", "onChange"]);
442
442
  }), 128)) : vue.createCommentVNode("", true)
443
443
  ], 64)) : vue.createCommentVNode("", true),
444
- _ctx.config.expand && _ctx.type !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$5, [
444
+ _ctx.config.expand && _ctx.type !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$4, [
445
445
  vue.createVNode(_component_el_button, {
446
446
  text: "",
447
447
  onClick: _ctx.expandHandler
@@ -460,7 +460,7 @@
460
460
  const _hoisted_2$6 = ["innerHTML"];
461
461
  const _hoisted_3$6 = { key: 1 };
462
462
  const _hoisted_4$5 = ["innerHTML"];
463
- const _hoisted_5$4 = ["innerHTML"];
463
+ const _hoisted_5$3 = ["innerHTML"];
464
464
  const _hoisted_6$2 = {
465
465
  key: 2,
466
466
  style: { "display": "flex" }
@@ -545,7 +545,7 @@
545
545
  key: 0,
546
546
  innerHTML: __props.config.extra,
547
547
  class: "m-form-tip"
548
- }, null, 8, _hoisted_5$4)) : vue.createCommentVNode("", true)
548
+ }, null, 8, _hoisted_5$3)) : vue.createCommentVNode("", true)
549
549
  ])),
550
550
  __props.config.schematic && vue.unref(show) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$2, [
551
551
  vue.createElementVNode("div", _hoisted_7$2, [
@@ -869,7 +869,7 @@
869
869
  class: "el-table__empty-block"
870
870
  };
871
871
  const _hoisted_4$3 = /* @__PURE__ */ vue.createElementVNode("span", { class: "el-table__empty-text" }, "\u6682\u65E0\u6570\u636E", -1);
872
- const _hoisted_5$3 = [
872
+ const _hoisted_5$2 = [
873
873
  _hoisted_4$3
874
874
  ];
875
875
  const _hoisted_6$1 = /* @__PURE__ */ vue.createTextVNode("\u6DFB\u52A0\u7EC4");
@@ -883,7 +883,7 @@
883
883
  innerHTML: _ctx.config.extra,
884
884
  style: { "color": "rgba(0, 0, 0, 0.45)" }
885
885
  }, null, 8, _hoisted_2$4)) : vue.createCommentVNode("", true),
886
- !_ctx.model[_ctx.name] || !_ctx.model[_ctx.name].length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$4, _hoisted_5$3)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 2 }, vue.renderList(_ctx.model[_ctx.name], (item, index) => {
886
+ !_ctx.model[_ctx.name] || !_ctx.model[_ctx.name].length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$4, _hoisted_5$2)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 2 }, vue.renderList(_ctx.model[_ctx.name], (item, index) => {
887
887
  return vue.openBlock(), vue.createBlock(_component_m_fields_group_list_item, {
888
888
  key: index,
889
889
  model: item,
@@ -964,7 +964,7 @@
964
964
  style: { "display": "flex" }
965
965
  };
966
966
  const _hoisted_4$2 = { style: { "flex": "1" } };
967
- const _hoisted_5$2 = ["src"];
967
+ const _hoisted_5$1 = ["src"];
968
968
  function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
969
969
  const _component_caret_bottom = vue.resolveComponent("caret-bottom");
970
970
  const _component_caret_right = vue.resolveComponent("caret-right");
@@ -1018,7 +1018,7 @@
1018
1018
  vue.createElementVNode("img", {
1019
1019
  class: "m-form-schematic",
1020
1020
  src: _ctx.config.schematic
1021
- }, null, 8, _hoisted_5$2)
1021
+ }, null, 8, _hoisted_5$1)
1022
1022
  ])) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(_ctx.items, (item, index) => {
1023
1023
  return vue.openBlock(), vue.createBlock(_component_m_form_container, {
1024
1024
  key: item[_ctx.mForm?.keyProp || "__key"] ?? index,
@@ -1604,7 +1604,7 @@
1604
1604
  const _hoisted_2$2 = { class: "el-form-item__content" };
1605
1605
  const _hoisted_3$2 = ["innerHTML"];
1606
1606
  const _hoisted_4$1 = /* @__PURE__ */ vue.createTextVNode("\u6DFB\u52A0");
1607
- const _hoisted_5$1 = /* @__PURE__ */ vue.createTextVNode(" \xA0 ");
1607
+ const _hoisted_5 = /* @__PURE__ */ vue.createTextVNode(" \xA0 ");
1608
1608
  const _hoisted_6 = /* @__PURE__ */ vue.createTextVNode("\u5C55\u5F00\u914D\u7F6E");
1609
1609
  const _hoisted_7 = /* @__PURE__ */ vue.createTextVNode("\u5BFC\u5165EXCEL");
1610
1610
  const _hoisted_8 = /* @__PURE__ */ vue.createTextVNode("\xA0 ");
@@ -1794,7 +1794,7 @@
1794
1794
  ]),
1795
1795
  _: 1
1796
1796
  })) : vue.createCommentVNode("", true),
1797
- _hoisted_5$1,
1797
+ _hoisted_5,
1798
1798
  _ctx.enableToggleMode && !_ctx.isFullscreen ? (vue.openBlock(), vue.createBlock(_component_el_button, {
1799
1799
  key: 1,
1800
1800
  icon: _ctx.Grid,
@@ -3116,34 +3116,23 @@
3116
3116
  return options2;
3117
3117
  };
3118
3118
  if (typeof props.config.options === "function") {
3119
- vue.watch(
3120
- () => mForm?.values,
3121
- () => {
3122
- typeof props.config.options === "function" && Promise.resolve(
3123
- props.config.options(mForm, {
3124
- model: props.model,
3125
- prop: props.prop,
3126
- formValues: mForm?.values,
3127
- formValue: mForm?.values,
3128
- config: props.config
3129
- })
3130
- ).then((data) => {
3131
- options.value = data;
3132
- });
3133
- },
3134
- {
3135
- deep: true,
3136
- immediate: true
3137
- }
3138
- );
3119
+ vue.watchEffect(() => {
3120
+ typeof props.config.options === "function" && Promise.resolve(
3121
+ props.config.options(mForm, {
3122
+ model: props.model,
3123
+ prop: props.prop,
3124
+ formValues: mForm?.values,
3125
+ formValue: mForm?.values,
3126
+ config: props.config
3127
+ })
3128
+ ).then((data) => {
3129
+ options.value = data;
3130
+ });
3131
+ });
3139
3132
  } else if (Array.isArray(props.config.options)) {
3140
- vue.watch(
3141
- () => props.config.options,
3142
- () => {
3143
- options.value = props.config.options;
3144
- },
3145
- { immediate: true }
3146
- );
3133
+ vue.watchEffect(() => {
3134
+ options.value = props.config.options;
3135
+ });
3147
3136
  } else if (props.config.option) {
3148
3137
  vue.onBeforeMount(() => {
3149
3138
  if (!props.model)
@@ -3781,121 +3770,117 @@
3781
3770
  }
3782
3771
  });
3783
3772
 
3784
- const _hoisted_1 = { class: "m-form-dialog" };
3785
- const _hoisted_2 = { style: { "min-height": "1px" } };
3786
- const _hoisted_3 = /* @__PURE__ */ vue.createTextVNode("\u53D6 \u6D88");
3787
- const _hoisted_4 = /* @__PURE__ */ vue.createTextVNode("\u4E0A\u4E00\u6B65");
3788
- const _hoisted_5 = /* @__PURE__ */ vue.createTextVNode("\u4E0B\u4E00\u6B65");
3773
+ const _hoisted_1 = { style: { "min-height": "1px" } };
3774
+ const _hoisted_2 = /* @__PURE__ */ vue.createTextVNode("\u53D6 \u6D88");
3775
+ const _hoisted_3 = /* @__PURE__ */ vue.createTextVNode("\u4E0A\u4E00\u6B65");
3776
+ const _hoisted_4 = /* @__PURE__ */ vue.createTextVNode("\u4E0B\u4E00\u6B65");
3789
3777
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
3790
3778
  const _component_m_form = vue.resolveComponent("m-form");
3791
3779
  const _component_el_col = vue.resolveComponent("el-col");
3792
3780
  const _component_el_button = vue.resolveComponent("el-button");
3793
3781
  const _component_el_row = vue.resolveComponent("el-row");
3794
3782
  const _component_el_dialog = vue.resolveComponent("el-dialog");
3795
- return vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
3796
- vue.withDirectives(vue.createElementVNode("div", _hoisted_1, [
3797
- vue.createVNode(_component_el_dialog, {
3798
- modelValue: _ctx.dialogVisible,
3799
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.dialogVisible = $event),
3800
- top: "20px",
3801
- title: _ctx.title,
3802
- width: _ctx.width,
3803
- fullscreen: _ctx.fullscreen,
3804
- "close-on-click-modal": false,
3805
- onClose: _ctx.closeHandler
3806
- }, {
3807
- footer: vue.withCtx(() => [
3808
- vue.createVNode(_component_el_row, { class: "dialog-footer" }, {
3783
+ return vue.openBlock(), vue.createBlock(_component_el_dialog, {
3784
+ modelValue: _ctx.dialogVisible,
3785
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.dialogVisible = $event),
3786
+ class: "m-form-dialog",
3787
+ top: "20px",
3788
+ "append-to-body": "",
3789
+ title: _ctx.title,
3790
+ width: _ctx.width,
3791
+ fullscreen: _ctx.fullscreen,
3792
+ "close-on-click-modal": false,
3793
+ onClose: _ctx.closeHandler
3794
+ }, {
3795
+ footer: vue.withCtx(() => [
3796
+ vue.createVNode(_component_el_row, { class: "dialog-footer" }, {
3797
+ default: vue.withCtx(() => [
3798
+ vue.createVNode(_component_el_col, {
3799
+ span: 12,
3800
+ style: { "text-align": "left" }
3801
+ }, {
3809
3802
  default: vue.withCtx(() => [
3810
- vue.createVNode(_component_el_col, {
3811
- span: 12,
3812
- style: { "text-align": "left" }
3813
- }, {
3814
- default: vue.withCtx(() => [
3815
- vue.createElementVNode("div", _hoisted_2, [
3816
- vue.renderSlot(_ctx.$slots, "left")
3817
- ])
3818
- ]),
3819
- _: 3
3820
- }),
3821
- vue.createVNode(_component_el_col, { span: 12 }, {
3822
- default: vue.withCtx(() => [
3823
- vue.renderSlot(_ctx.$slots, "footer", {}, () => [
3824
- vue.createVNode(_component_el_button, {
3825
- onClick: _ctx.cancel,
3826
- size: "small"
3827
- }, {
3828
- default: vue.withCtx(() => [
3829
- _hoisted_3
3830
- ]),
3831
- _: 1
3832
- }, 8, ["onClick"]),
3833
- _ctx.hasStep && _ctx.stepActive > 1 ? (vue.openBlock(), vue.createBlock(_component_el_button, {
3834
- key: 0,
3835
- type: "info",
3836
- size: "small",
3837
- onClick: _ctx.preStep
3838
- }, {
3839
- default: vue.withCtx(() => [
3840
- _hoisted_4
3841
- ]),
3842
- _: 1
3843
- }, 8, ["onClick"])) : vue.createCommentVNode("", true),
3844
- _ctx.hasStep && _ctx.stepCount > _ctx.stepActive ? (vue.openBlock(), vue.createBlock(_component_el_button, {
3845
- key: 1,
3846
- type: "info",
3847
- size: "small",
3848
- onClick: _ctx.nextStep
3849
- }, {
3850
- default: vue.withCtx(() => [
3851
- _hoisted_5
3852
- ]),
3853
- _: 1
3854
- }, 8, ["onClick"])) : (vue.openBlock(), vue.createBlock(_component_el_button, {
3855
- key: 2,
3856
- type: "primary",
3857
- size: "small",
3858
- loading: _ctx.saveFetch,
3859
- onClick: _ctx.save
3860
- }, {
3861
- default: vue.withCtx(() => [
3862
- vue.createTextVNode(vue.toDisplayString(_ctx.confirmText), 1)
3863
- ]),
3864
- _: 1
3865
- }, 8, ["loading", "onClick"]))
3866
- ])
3867
- ]),
3868
- _: 3
3869
- })
3803
+ vue.createElementVNode("div", _hoisted_1, [
3804
+ vue.renderSlot(_ctx.$slots, "left")
3805
+ ])
3806
+ ]),
3807
+ _: 3
3808
+ }),
3809
+ vue.createVNode(_component_el_col, { span: 12 }, {
3810
+ default: vue.withCtx(() => [
3811
+ vue.renderSlot(_ctx.$slots, "footer", {}, () => [
3812
+ vue.createVNode(_component_el_button, {
3813
+ onClick: _ctx.cancel,
3814
+ size: "small"
3815
+ }, {
3816
+ default: vue.withCtx(() => [
3817
+ _hoisted_2
3818
+ ]),
3819
+ _: 1
3820
+ }, 8, ["onClick"]),
3821
+ _ctx.hasStep && _ctx.stepActive > 1 ? (vue.openBlock(), vue.createBlock(_component_el_button, {
3822
+ key: 0,
3823
+ type: "info",
3824
+ size: "small",
3825
+ onClick: _ctx.preStep
3826
+ }, {
3827
+ default: vue.withCtx(() => [
3828
+ _hoisted_3
3829
+ ]),
3830
+ _: 1
3831
+ }, 8, ["onClick"])) : vue.createCommentVNode("", true),
3832
+ _ctx.hasStep && _ctx.stepCount > _ctx.stepActive ? (vue.openBlock(), vue.createBlock(_component_el_button, {
3833
+ key: 1,
3834
+ type: "info",
3835
+ size: "small",
3836
+ onClick: _ctx.nextStep
3837
+ }, {
3838
+ default: vue.withCtx(() => [
3839
+ _hoisted_4
3840
+ ]),
3841
+ _: 1
3842
+ }, 8, ["onClick"])) : (vue.openBlock(), vue.createBlock(_component_el_button, {
3843
+ key: 2,
3844
+ type: "primary",
3845
+ size: "small",
3846
+ loading: _ctx.saveFetch,
3847
+ onClick: _ctx.save
3848
+ }, {
3849
+ default: vue.withCtx(() => [
3850
+ vue.createTextVNode(vue.toDisplayString(_ctx.confirmText), 1)
3851
+ ]),
3852
+ _: 1
3853
+ }, 8, ["loading", "onClick"]))
3854
+ ])
3870
3855
  ]),
3871
3856
  _: 3
3872
3857
  })
3873
3858
  ]),
3874
- default: vue.withCtx(() => [
3875
- vue.createElementVNode("div", {
3876
- class: "m-dialog-body",
3877
- style: vue.normalizeStyle(`max-height: ${_ctx.bodyHeight}; overflow-y: auto; overflow-x: hidden;`)
3878
- }, [
3879
- vue.createVNode(_component_m_form, {
3880
- modelValue: _ctx.stepActive,
3881
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.stepActive = $event),
3882
- ref: "form",
3883
- size: _ctx.size,
3884
- config: _ctx.config,
3885
- "init-values": _ctx.values,
3886
- "parent-values": _ctx.parentValues,
3887
- "label-width": _ctx.labelWidth,
3888
- onChange: _ctx.changeHandler
3889
- }, null, 8, ["modelValue", "size", "config", "init-values", "parent-values", "label-width", "onChange"]),
3890
- vue.renderSlot(_ctx.$slots, "default")
3891
- ], 4)
3892
- ]),
3893
3859
  _: 3
3894
- }, 8, ["modelValue", "title", "width", "fullscreen", "onClose"])
3895
- ], 512), [
3896
- [vue.vShow, _ctx.dialogVisible]
3897
- ])
3898
- ]);
3860
+ })
3861
+ ]),
3862
+ default: vue.withCtx(() => [
3863
+ _ctx.dialogVisible ? (vue.openBlock(), vue.createElementBlock("div", {
3864
+ key: 0,
3865
+ class: "m-dialog-body",
3866
+ style: vue.normalizeStyle(`max-height: ${_ctx.bodyHeight}; overflow-y: auto; overflow-x: hidden;`)
3867
+ }, [
3868
+ vue.createVNode(_component_m_form, {
3869
+ modelValue: _ctx.stepActive,
3870
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.stepActive = $event),
3871
+ ref: "form",
3872
+ size: _ctx.size,
3873
+ config: _ctx.config,
3874
+ "init-values": _ctx.values,
3875
+ "parent-values": _ctx.parentValues,
3876
+ "label-width": _ctx.labelWidth,
3877
+ onChange: _ctx.changeHandler
3878
+ }, null, 8, ["modelValue", "size", "config", "init-values", "parent-values", "label-width", "onChange"]),
3879
+ vue.renderSlot(_ctx.$slots, "default")
3880
+ ], 4)) : vue.createCommentVNode("", true)
3881
+ ]),
3882
+ _: 3
3883
+ }, 8, ["modelValue", "title", "width", "fullscreen", "onClose"]);
3899
3884
  }
3900
3885
  const FormDialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
3901
3886