@tmagic/form 1.2.12 → 1.2.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.
Files changed (39) hide show
  1. package/dist/style.css +2 -2
  2. package/dist/tmagic-form.js +37 -37
  3. package/dist/tmagic-form.js.map +1 -1
  4. package/dist/tmagic-form.umd.cjs +39 -44
  5. package/dist/tmagic-form.umd.cjs.map +1 -1
  6. package/package.json +7 -7
  7. package/types/Form.vue.d.ts +5 -5
  8. package/types/FormDialog.vue.d.ts +41 -743
  9. package/types/containers/Col.vue.d.ts +2 -2
  10. package/types/containers/Container.vue.d.ts +3 -3
  11. package/types/containers/Fieldset.vue.d.ts +3 -3
  12. package/types/containers/GroupList.vue.d.ts +2 -2
  13. package/types/containers/GroupListItem.vue.d.ts +2 -2
  14. package/types/containers/Panel.vue.d.ts +22 -90
  15. package/types/containers/Row.vue.d.ts +2 -2
  16. package/types/containers/Step.vue.d.ts +3 -3
  17. package/types/containers/Table.vue.d.ts +42 -155
  18. package/types/containers/Tabs.vue.d.ts +3 -3
  19. package/types/fields/Cascader.vue.d.ts +4 -4
  20. package/types/fields/Checkbox.vue.d.ts +4 -4
  21. package/types/fields/CheckboxGroup.vue.d.ts +4 -4
  22. package/types/fields/ColorPicker.vue.d.ts +4 -4
  23. package/types/fields/Date.vue.d.ts +4 -4
  24. package/types/fields/DateTime.vue.d.ts +4 -4
  25. package/types/fields/Daterange.vue.d.ts +4 -4
  26. package/types/fields/Display.vue.d.ts +2 -2
  27. package/types/fields/DynamicField.vue.d.ts +4 -4
  28. package/types/fields/Hidden.vue.d.ts +2 -2
  29. package/types/fields/Link.vue.d.ts +4 -4
  30. package/types/fields/Number.vue.d.ts +4 -4
  31. package/types/fields/RadioGroup.vue.d.ts +4 -4
  32. package/types/fields/Select.vue.d.ts +4 -4
  33. package/types/fields/SelectOptionGroups.vue.d.ts +2 -2
  34. package/types/fields/SelectOptions.vue.d.ts +2 -2
  35. package/types/fields/Switch.vue.d.ts +4 -4
  36. package/types/fields/Text.vue.d.ts +4 -4
  37. package/types/fields/Textarea.vue.d.ts +4 -4
  38. package/types/fields/Time.vue.d.ts +4 -4
  39. package/types/schema.d.ts +14 -14
package/dist/style.css CHANGED
@@ -47,7 +47,7 @@ div.m-fields-link {
47
47
 
48
48
  fieldset.m-fieldset {
49
49
  position: relative;
50
- border: 1px solid rgb(229, 229, 229);
50
+ border: 1px solid #e5e5e5;
51
51
  margin-top: 10px;
52
52
  margin-bottom: 10px;
53
53
  min-inline-size: auto;
@@ -61,7 +61,7 @@ fieldset.m-fieldset legend {
61
61
  border: 0;
62
62
  top: -10px;
63
63
  left: 20px;
64
- background: rgb(255, 255, 255);
64
+ background: white;
65
65
  width: auto;
66
66
  padding: 0px 3px;
67
67
  font-weight: bold;
@@ -154,7 +154,7 @@ const getRules = function(mForm, rules = [], props) {
154
154
  };
155
155
  const initValue = async (mForm, { initValues, config }) => {
156
156
  if (!Array.isArray(config))
157
- throw new Error("config\u5E94\u8BE5\u4E3A\u6570\u7EC4");
157
+ throw new Error("config应该为数组");
158
158
  let valuesTmp = createValues(mForm, config, toRaw(initValues), {});
159
159
  const [firstForm] = config;
160
160
  if (firstForm && typeof firstForm.onInitValue === "function") {
@@ -589,7 +589,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
589
589
  onClick: expandHandler
590
590
  }, {
591
591
  default: withCtx(() => [
592
- createTextVNode(toDisplayString(expand.value ? "\u6536\u8D77\u914D\u7F6E" : "\u5C55\u5F00\u66F4\u591A\u914D\u7F6E"), 1)
592
+ createTextVNode(toDisplayString(expand.value ? "收起配置" : "展开更多配置"), 1)
593
593
  ]),
594
594
  _: 1
595
595
  })
@@ -740,8 +740,8 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
740
740
  });
741
741
 
742
742
  const _hoisted_1$9 = { class: "m-fields-group-list-item" };
743
- const _hoisted_2$5 = /* @__PURE__ */ createTextVNode("\u4E0A\u79FB");
744
- const _hoisted_3$5 = /* @__PURE__ */ createTextVNode("\u4E0B\u79FB");
743
+ const _hoisted_2$5 = /* @__PURE__ */ createTextVNode("上移");
744
+ const _hoisted_3$5 = /* @__PURE__ */ createTextVNode("下移");
745
745
  const _hoisted_4$4 = ["innerHTML"];
746
746
  const __default__$t = defineComponent({
747
747
  name: "MFormGroupListItem"
@@ -779,7 +779,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
779
779
  if (props.config.titleKey && props.model[props.config.titleKey]) {
780
780
  return props.model[props.config.titleKey];
781
781
  }
782
- return `\u7EC4 ${String(props.index)}`;
782
+ return `组 ${String(props.index)}`;
783
783
  });
784
784
  const length = computed(() => props.groupModel?.length || 0);
785
785
  const itemExtra = computed(() => filterFunction(mForm, props.config.itemExtra, props));
@@ -899,12 +899,12 @@ const _hoisted_3$4 = {
899
899
  key: 1,
900
900
  class: "el-table__empty-block"
901
901
  };
902
- const _hoisted_4$3 = /* @__PURE__ */ createElementVNode("span", { class: "el-table__empty-text" }, "\u6682\u65E0\u6570\u636E", -1);
902
+ const _hoisted_4$3 = /* @__PURE__ */ createElementVNode("span", { class: "el-table__empty-text" }, "暂无数据", -1);
903
903
  const _hoisted_5$2 = [
904
904
  _hoisted_4$3
905
905
  ];
906
- const _hoisted_6$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0\u7EC4");
907
- const _hoisted_7$1 = /* @__PURE__ */ createTextVNode("\u5207\u6362\u4E3A\u8868\u683C");
906
+ const _hoisted_6$1 = /* @__PURE__ */ createTextVNode("添加组");
907
+ const _hoisted_7$1 = /* @__PURE__ */ createTextVNode("切换为表格");
908
908
  const __default__$s = defineComponent({
909
909
  name: "MFormGroupList"
910
910
  });
@@ -1325,12 +1325,12 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
1325
1325
  const _hoisted_1$6 = ["innerHTML"];
1326
1326
  const _hoisted_2$2 = { class: "el-form-item__content" };
1327
1327
  const _hoisted_3$2 = ["innerHTML"];
1328
- const _hoisted_4$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0");
1329
- const _hoisted_5 = /* @__PURE__ */ createTextVNode(" \xA0 ");
1330
- const _hoisted_6 = /* @__PURE__ */ createTextVNode("\u5C55\u5F00\u914D\u7F6E");
1331
- const _hoisted_7 = /* @__PURE__ */ createTextVNode("\u5BFC\u5165EXCEL");
1332
- const _hoisted_8 = /* @__PURE__ */ createTextVNode("\xA0 ");
1333
- const _hoisted_9 = /* @__PURE__ */ createTextVNode("\u6E05\u7A7A");
1328
+ const _hoisted_4$1 = /* @__PURE__ */ createTextVNode("添加");
1329
+ const _hoisted_5 = /* @__PURE__ */ createTextVNode("   ");
1330
+ const _hoisted_6 = /* @__PURE__ */ createTextVNode("展开配置");
1331
+ const _hoisted_7 = /* @__PURE__ */ createTextVNode("导入EXCEL");
1332
+ const _hoisted_8 = /* @__PURE__ */ createTextVNode("  ");
1333
+ const _hoisted_9 = /* @__PURE__ */ createTextVNode("清空");
1334
1334
  const _hoisted_10 = {
1335
1335
  key: 1,
1336
1336
  class: "bottom",
@@ -1430,7 +1430,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
1430
1430
  };
1431
1431
  const newHandler = async (row) => {
1432
1432
  if (props.config.max && props.model[modelName.value].length >= props.config.max) {
1433
- tMagicMessage.error(`\u6700\u591A\u65B0\u589E\u914D\u7F6E\u4E0D\u80FD\u8D85\u8FC7${props.config.max}\u6761`);
1433
+ tMagicMessage.error(`最多新增配置不能超过${props.config.max}条`);
1434
1434
  return;
1435
1435
  }
1436
1436
  const columns = props.config.items;
@@ -1694,7 +1694,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
1694
1694
  }, null, 8, _hoisted_1$6)) : createCommentVNode("", true),
1695
1695
  createElementVNode("div", _hoisted_2$2, [
1696
1696
  createVNode(unref(TMagicTooltip), {
1697
- content: "\u62D6\u62FD\u53EF\u6392\u5E8F",
1697
+ content: "拖拽可排序",
1698
1698
  placement: "left-start",
1699
1699
  disabled: __props.config.dropSort !== true
1700
1700
  }, {
@@ -1729,7 +1729,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
1729
1729
  _: 1
1730
1730
  })) : createCommentVNode("", true),
1731
1731
  createVNode(unref(TMagicTableColumn), {
1732
- label: "\u64CD\u4F5C",
1732
+ label: "操作",
1733
1733
  width: __props.config.operateColWidth || 55,
1734
1734
  align: "center",
1735
1735
  fixed: __props.config.fixed === false ? void 0 : "left"
@@ -1752,13 +1752,13 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
1752
1752
  }, 8, ["width", "fixed"]),
1753
1753
  __props.sort && __props.model[unref(modelName)] && __props.model[unref(modelName)].length > 1 ? (openBlock(), createBlock(unref(TMagicTableColumn), {
1754
1754
  key: 1,
1755
- label: "\u6392\u5E8F",
1755
+ label: "排序",
1756
1756
  width: "60"
1757
1757
  }, {
1758
1758
  default: withCtx((scope) => [
1759
1759
  scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== 0 ? (openBlock(), createBlock(unref(TMagicTooltip), {
1760
1760
  key: 0,
1761
- content: "\u70B9\u51FB\u4E0A\u79FB\uFF0C\u53CC\u51FB\u7F6E\u9876",
1761
+ content: "点击上移,双击置顶",
1762
1762
  placement: "top"
1763
1763
  }, {
1764
1764
  default: withCtx(() => [
@@ -1777,7 +1777,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
1777
1777
  }, 1024)) : createCommentVNode("", true),
1778
1778
  scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== __props.model[unref(modelName)].length - 1 ? (openBlock(), createBlock(unref(TMagicTooltip), {
1779
1779
  key: 1,
1780
- content: "\u70B9\u51FB\u4E0B\u79FB\uFF0C\u53CC\u51FB\u7F6E\u5E95",
1780
+ content: "点击下移,双击置底",
1781
1781
  placement: "top"
1782
1782
  }, {
1783
1783
  default: withCtx(() => [
@@ -1807,7 +1807,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
1807
1807
  __props.showIndex && __props.config.showIndex ? (openBlock(), createBlock(unref(TMagicTableColumn), {
1808
1808
  key: 3,
1809
1809
  width: "60",
1810
- label: "\u5E8F\u53F7"
1810
+ label: "序号"
1811
1811
  }, {
1812
1812
  default: withCtx((scope) => [
1813
1813
  createTextVNode(toDisplayString(scope.$index + 1 + pagecontext.value * pagesize.value), 1)
@@ -1886,7 +1886,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
1886
1886
  onClick: toggleFullscreen
1887
1887
  }, {
1888
1888
  default: withCtx(() => [
1889
- createTextVNode(toDisplayString(isFullscreen.value ? "\u9000\u51FA\u5168\u5C4F" : "\u5168\u5C4F\u7F16\u8F91"), 1)
1889
+ createTextVNode(toDisplayString(isFullscreen.value ? "退出全屏" : "全屏编辑"), 1)
1890
1890
  ]),
1891
1891
  _: 1
1892
1892
  }, 8, ["icon"])) : createCommentVNode("", true),
@@ -1996,7 +1996,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
1996
1996
  const tabs = computed(() => {
1997
1997
  if (props.config.dynamic) {
1998
1998
  if (!props.config.name)
1999
- throw new Error("dynamic tab \u5FC5\u987B\u914D\u7F6Ename");
1999
+ throw new Error("dynamic tab 必须配置name");
2000
2000
  return props.model[props.config.name] || [];
2001
2001
  }
2002
2002
  return props.config.items;
@@ -2014,7 +2014,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
2014
2014
  const tabClickHandler = (tab) => tabClick(mForm, tab, props);
2015
2015
  const onTabAdd = () => {
2016
2016
  if (!props.config.name)
2017
- throw new Error("dynamic tab \u5FC5\u987B\u914D\u7F6Ename");
2017
+ throw new Error("dynamic tab 必须配置name");
2018
2018
  if (typeof props.config.onTabAdd === "function") {
2019
2019
  props.config.onTabAdd(mForm, {
2020
2020
  model: props.model,
@@ -2023,7 +2023,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
2023
2023
  });
2024
2024
  } else if (tabs.value.length > 0) {
2025
2025
  const newObj = cloneDeep(tabs.value[0]);
2026
- newObj.title = `\u6807\u7B7E${tabs.value.length + 1}`;
2026
+ newObj.title = `标签${tabs.value.length + 1}`;
2027
2027
  props.model[props.config.name].push(newObj);
2028
2028
  }
2029
2029
  emit("change", props.model);
@@ -2031,7 +2031,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
2031
2031
  };
2032
2032
  const onTabRemove = (tabName) => {
2033
2033
  if (!props.config.name)
2034
- throw new Error("dynamic tab \u5FC5\u987B\u914D\u7F6Ename");
2034
+ throw new Error("dynamic tab 必须配置name");
2035
2035
  if (typeof props.config.onTabRemove === "function") {
2036
2036
  props.config.onTabRemove(mForm, tabName, {
2037
2037
  model: props.model,
@@ -2520,8 +2520,8 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
2520
2520
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
2521
2521
  type: "datetimerange",
2522
2522
  "range-separator": "-",
2523
- "start-placeholder": "\u5F00\u59CB\u65E5\u671F",
2524
- "end-placeholder": "\u7ED3\u675F\u65E5\u671F",
2523
+ "start-placeholder": "开始日期",
2524
+ "end-placeholder": "结束日期",
2525
2525
  size: __props.size,
2526
2526
  "unlink-panels": true,
2527
2527
  disabled: __props.disabled,
@@ -2836,7 +2836,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2836
2836
  if (field && message)
2837
2837
  error.push(`${field} -> ${message}`);
2838
2838
  if (field && !message)
2839
- error.push(`${field} -> \u51FA\u73B0\u9519\u8BEF`);
2839
+ error.push(`${field} -> 出现错误`);
2840
2840
  if (!field && message)
2841
2841
  error.push(`${message}`);
2842
2842
  });
@@ -2879,9 +2879,9 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2879
2879
  });
2880
2880
 
2881
2881
  const _hoisted_1$3 = { style: { "min-height": "1px" } };
2882
- const _hoisted_2$1 = /* @__PURE__ */ createTextVNode("\u53D6 \u6D88");
2883
- const _hoisted_3$1 = /* @__PURE__ */ createTextVNode("\u4E0A\u4E00\u6B65");
2884
- const _hoisted_4 = /* @__PURE__ */ createTextVNode("\u4E0B\u4E00\u6B65");
2882
+ const _hoisted_2$1 = /* @__PURE__ */ createTextVNode(" ");
2883
+ const _hoisted_3$1 = /* @__PURE__ */ createTextVNode("上一步");
2884
+ const _hoisted_4 = /* @__PURE__ */ createTextVNode("下一步");
2885
2885
  const __default__$a = defineComponent({
2886
2886
  name: "MFormDialog"
2887
2887
  });
@@ -2898,7 +2898,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
2898
2898
  title: null,
2899
2899
  zIndex: null,
2900
2900
  size: null,
2901
- confirmText: { default: "\u786E\u5B9A" }
2901
+ confirmText: { default: "确定" }
2902
2902
  },
2903
2903
  emits: ["close", "submit", "error", "change"],
2904
2904
  setup(__props, { expose, emit }) {
@@ -3071,7 +3071,7 @@ const _hoisted_2 = {
3071
3071
  key: 2,
3072
3072
  class: "m-fields-link"
3073
3073
  };
3074
- const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u70B9\u51FB\u7F16\u8F91");
3074
+ const _hoisted_3 = /* @__PURE__ */ createTextVNode("点击编辑");
3075
3075
  const __default__$9 = defineComponent({
3076
3076
  name: "MFormLink"
3077
3077
  });
@@ -3119,7 +3119,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3119
3119
  if (props.config.displayText) {
3120
3120
  return props.config.displayText;
3121
3121
  }
3122
- return "\u8DF3\u8F6C";
3122
+ return "跳转";
3123
3123
  });
3124
3124
  const editHandler = () => {
3125
3125
  init();
@@ -3156,7 +3156,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3156
3156
  createVNode(_sfc_main$a, {
3157
3157
  ref_key: "editor",
3158
3158
  ref: editor,
3159
- title: __props.config.formTitle || "\u7F16\u8F91\u6269\u5C55\u914D\u7F6E",
3159
+ title: __props.config.formTitle || "编辑扩展配置",
3160
3160
  width: __props.config.formWidth,
3161
3161
  values: formValue.value,
3162
3162
  config: unref(formConfig),
@@ -3344,7 +3344,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
3344
3344
  setup(__props, { emit }) {
3345
3345
  const props = __props;
3346
3346
  if (!props.model)
3347
- throw new Error("\u4E0D\u80FD\u6CA1\u6709model");
3347
+ throw new Error("不能没有model");
3348
3348
  useAddField(props.prop);
3349
3349
  const tMagicSelect = ref();
3350
3350
  const mForm = inject("mForm");