@tmagic/form 1.7.0 → 1.7.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.
@@ -1864,12 +1864,13 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
1864
1864
  name: {},
1865
1865
  size: {},
1866
1866
  labelWidth: {},
1867
- prop: {},
1867
+ prop: { default: "" },
1868
1868
  expandMore: { type: Boolean },
1869
1869
  disabled: { type: Boolean }
1870
1870
  },
1871
1871
  emits: ["change", "addDiffCount"],
1872
1872
  setup(__props, { emit: __emit }) {
1873
+ const props = __props;
1873
1874
  const tabPaneComponent = getDesignConfig("components")?.tabPane;
1874
1875
  const tabsComponent = getDesignConfig("components")?.tabs;
1875
1876
  const getActive = (mForm2, props2, activeTabName2) => {
@@ -1891,7 +1892,6 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
1891
1892
  tabConfig.onTabClick(mForm2, tab, { model, formValue: mForm2?.values, prop, config });
1892
1893
  }
1893
1894
  };
1894
- const props = __props;
1895
1895
  const emit = __emit;
1896
1896
  const mForm = inject("mForm");
1897
1897
  const activeTabName = ref(getActive(mForm, props));
@@ -2039,7 +2039,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
2039
2039
  model: __props.config.dynamic ? (__props.name ? __props.model[__props.name] : __props.model)[tabIndex] : tab.name ? (__props.name ? __props.model[__props.name] : __props.model)[tab.name] : __props.name ? __props.model[__props.name] : __props.model,
2040
2040
  "last-values": unref(isEmpty)(__props.lastValues) ? {} : __props.config.dynamic ? (__props.name ? __props.lastValues[__props.name] : __props.lastValues)[tabIndex] : tab.name ? (__props.name ? __props.lastValues[__props.name] : __props.lastValues)[tab.name] : __props.name ? __props.lastValues[__props.name] : __props.lastValues,
2041
2041
  "is-compare": __props.isCompare,
2042
- prop: __props.config.dynamic ? `${__props.prop}${__props.prop ? "." : ""}${String(tabIndex)}` : __props.prop,
2042
+ prop: __props.config.dynamic ? `${__props.prop}${__props.prop ? "." : ""}${String(tabIndex)}` : tab.name ? `${__props.prop}${__props.prop ? "." : ""}${tab.name}` : __props.prop,
2043
2043
  size: __props.size,
2044
2044
  "label-width": tab.labelWidth || __props.labelWidth,
2045
2045
  "expand-more": __props.expandMore,
@@ -4794,12 +4794,13 @@
4794
4794
  name: {},
4795
4795
  size: {},
4796
4796
  labelWidth: {},
4797
- prop: {},
4797
+ prop: { default: "" },
4798
4798
  expandMore: { type: Boolean },
4799
4799
  disabled: { type: Boolean }
4800
4800
  },
4801
4801
  emits: ["change", "addDiffCount"],
4802
4802
  setup(__props, { emit: __emit }) {
4803
+ const props = __props;
4803
4804
  const tabPaneComponent = design.getDesignConfig("components")?.tabPane;
4804
4805
  const tabsComponent = design.getDesignConfig("components")?.tabs;
4805
4806
  const getActive = (mForm2, props2, activeTabName2) => {
@@ -4821,7 +4822,6 @@
4821
4822
  tabConfig.onTabClick(mForm2, tab, { model, formValue: mForm2?.values, prop, config });
4822
4823
  }
4823
4824
  };
4824
- const props = __props;
4825
4825
  const emit = __emit;
4826
4826
  const mForm = vue.inject("mForm");
4827
4827
  const activeTabName = vue.ref(getActive(mForm, props));
@@ -4969,7 +4969,7 @@
4969
4969
  model: __props.config.dynamic ? (__props.name ? __props.model[__props.name] : __props.model)[tabIndex] : tab.name ? (__props.name ? __props.model[__props.name] : __props.model)[tab.name] : __props.name ? __props.model[__props.name] : __props.model,
4970
4970
  "last-values": vue.unref(isEmpty)(__props.lastValues) ? {} : __props.config.dynamic ? (__props.name ? __props.lastValues[__props.name] : __props.lastValues)[tabIndex] : tab.name ? (__props.name ? __props.lastValues[__props.name] : __props.lastValues)[tab.name] : __props.name ? __props.lastValues[__props.name] : __props.lastValues,
4971
4971
  "is-compare": __props.isCompare,
4972
- prop: __props.config.dynamic ? `${__props.prop}${__props.prop ? "." : ""}${String(tabIndex)}` : __props.prop,
4972
+ prop: __props.config.dynamic ? `${__props.prop}${__props.prop ? "." : ""}${String(tabIndex)}` : tab.name ? `${__props.prop}${__props.prop ? "." : ""}${tab.name}` : __props.prop,
4973
4973
  size: __props.size,
4974
4974
  "label-width": tab.labelWidth || __props.labelWidth,
4975
4975
  "expand-more": __props.expandMore,
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.7.0",
2
+ "version": "1.7.2",
3
3
  "name": "@tmagic/form",
4
4
  "type": "module",
5
5
  "sideEffects": [
@@ -51,9 +51,9 @@
51
51
  "peerDependencies": {
52
52
  "vue": "^3.5.24",
53
53
  "typescript": "^5.9.3",
54
- "@tmagic/design": "1.7.0",
55
- "@tmagic/form-schema": "1.7.0",
56
- "@tmagic/utils": "1.7.0"
54
+ "@tmagic/form-schema": "1.7.2",
55
+ "@tmagic/utils": "1.7.2",
56
+ "@tmagic/design": "1.7.2"
57
57
  },
58
58
  "peerDependenciesMeta": {
59
59
  "typescript": {
@@ -58,7 +58,13 @@
58
58
  : lastValues
59
59
  "
60
60
  :is-compare="isCompare"
61
- :prop="config.dynamic ? `${prop}${prop ? '.' : ''}${String(tabIndex)}` : prop"
61
+ :prop="
62
+ config.dynamic
63
+ ? `${prop}${prop ? '.' : ''}${String(tabIndex)}`
64
+ : tab.name
65
+ ? `${prop}${prop ? '.' : ''}${tab.name}`
66
+ : prop
67
+ "
62
68
  :size="size"
63
69
  :label-width="tab.labelWidth || labelWidth"
64
70
  :expand-more="expandMore"
@@ -88,6 +94,26 @@ type DiffCount = {
88
94
  [tabIndex: number]: number;
89
95
  };
90
96
 
97
+ const props = withDefaults(
98
+ defineProps<{
99
+ model: any;
100
+ lastValues?: any;
101
+ isCompare?: boolean;
102
+ config: TabConfig;
103
+ name: string;
104
+ size?: string;
105
+ labelWidth?: string;
106
+ prop?: string;
107
+ expandMore?: boolean;
108
+ disabled?: boolean;
109
+ }>(),
110
+ {
111
+ lastValues: () => ({}),
112
+ isCompare: false,
113
+ prop: '',
114
+ },
115
+ );
116
+
91
117
  const tabPaneComponent = getDesignConfig('components')?.tabPane;
92
118
  const tabsComponent = getDesignConfig('components')?.tabs;
93
119
 
@@ -118,25 +144,6 @@ const tabClick = (mForm: FormState | undefined, tab: any, props: any) => {
118
144
  }
119
145
  };
120
146
 
121
- const props = withDefaults(
122
- defineProps<{
123
- model: any;
124
- lastValues?: any;
125
- isCompare?: boolean;
126
- config: TabConfig;
127
- name: string;
128
- size?: string;
129
- labelWidth?: string;
130
- prop?: string;
131
- expandMore?: boolean;
132
- disabled?: boolean;
133
- }>(),
134
- {
135
- lastValues: () => ({}),
136
- isCompare: false,
137
- },
138
- );
139
-
140
147
  const emit = defineEmits<{
141
148
  change: [v: any, eventData?: ContainerChangeEventData];
142
149
  addDiffCount: [];
package/types/index.d.ts CHANGED
@@ -1061,6 +1061,7 @@ declare const __VLS_export$m: _vue_runtime_core.DefineComponent<__VLS_Props$l, {
1061
1061
  onChange?: ((v: any, eventData?: ContainerChangeEventData | undefined) => any) | undefined;
1062
1062
  onAddDiffCount?: (() => any) | undefined;
1063
1063
  }>, {
1064
+ prop: string;
1064
1065
  lastValues: any;
1065
1066
  isCompare: boolean;
1066
1067
  }, {}, {}, {}, string, _vue_runtime_core.ComponentProvideOptions, false, {}, any>;