@tmagic/form 1.7.2 → 1.7.3
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.
- package/dist/tmagic-form.js +42 -36
- package/dist/tmagic-form.umd.cjs +42 -36
- package/package.json +4 -4
- package/src/containers/GroupList.vue +2 -2
- package/src/containers/GroupListItem.vue +1 -1
- package/src/containers/Tabs.vue +6 -6
- package/src/fields/Text.vue +1 -1
- package/src/table/ActionsColumn.vue +12 -1
- package/src/table/useTableColumns.ts +11 -11
package/dist/tmagic-form.js
CHANGED
|
@@ -231,7 +231,7 @@ const _hoisted_1$e = {
|
|
|
231
231
|
style: { "display": "inline-flex", "align-items": "center" }
|
|
232
232
|
};
|
|
233
233
|
const _hoisted_2$8 = ["innerHTML", "title"];
|
|
234
|
-
const _hoisted_3$
|
|
234
|
+
const _hoisted_3$7 = ["innerHTML"];
|
|
235
235
|
const _hoisted_4$5 = ["innerHTML", "title"];
|
|
236
236
|
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
237
237
|
__name: "FormLabel",
|
|
@@ -254,7 +254,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
254
254
|
placement: "top"
|
|
255
255
|
}, {
|
|
256
256
|
content: withCtx(() => [
|
|
257
|
-
createElementVNode("div", { innerHTML: __props.tip }, null, 8, _hoisted_3$
|
|
257
|
+
createElementVNode("div", { innerHTML: __props.tip }, null, 8, _hoisted_3$7)
|
|
258
258
|
]),
|
|
259
259
|
default: withCtx(() => [
|
|
260
260
|
createVNode(unref(TMagicIcon), { style: { "margin-left": "5px", "display": "flex" } }, {
|
|
@@ -279,7 +279,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
279
279
|
|
|
280
280
|
const _hoisted_1$d = ["data-tmagic-id", "data-tmagic-form-item-prop"];
|
|
281
281
|
const _hoisted_2$7 = ["innerHTML"];
|
|
282
|
-
const _hoisted_3$
|
|
282
|
+
const _hoisted_3$6 = ["innerHTML"];
|
|
283
283
|
const _hoisted_4$4 = ["innerHTML"];
|
|
284
284
|
const _hoisted_5$3 = ["innerHTML"];
|
|
285
285
|
const _hoisted_6$1 = ["innerHTML"];
|
|
@@ -578,7 +578,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
578
578
|
content: withCtx(() => [
|
|
579
579
|
createElementVNode("div", {
|
|
580
580
|
innerHTML: __props.config.tip
|
|
581
|
-
}, null, 8, _hoisted_3$
|
|
581
|
+
}, null, 8, _hoisted_3$6)
|
|
582
582
|
]),
|
|
583
583
|
default: withCtx(() => [
|
|
584
584
|
createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
@@ -781,7 +781,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
781
781
|
|
|
782
782
|
const _hoisted_1$c = ["innerHTML"];
|
|
783
783
|
const _hoisted_2$6 = ["innerHTML"];
|
|
784
|
-
const _hoisted_3$
|
|
784
|
+
const _hoisted_3$5 = { key: 1 };
|
|
785
785
|
const _hoisted_4$3 = ["innerHTML"];
|
|
786
786
|
const _hoisted_5$2 = ["innerHTML"];
|
|
787
787
|
const _hoisted_6 = {
|
|
@@ -882,7 +882,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
882
882
|
]),
|
|
883
883
|
_: 1
|
|
884
884
|
/* STABLE */
|
|
885
|
-
})) : (openBlock(), createElementBlock("legend", _hoisted_3$
|
|
885
|
+
})) : (openBlock(), createElementBlock("legend", _hoisted_3$5, [
|
|
886
886
|
createElementVNode("span", {
|
|
887
887
|
innerHTML: __props.config.legend
|
|
888
888
|
}, null, 8, _hoisted_4$3),
|
|
@@ -1014,8 +1014,9 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
1014
1014
|
}
|
|
1015
1015
|
});
|
|
1016
1016
|
|
|
1017
|
-
const _hoisted_1$b =
|
|
1018
|
-
const _hoisted_2$5 =
|
|
1017
|
+
const _hoisted_1$b = ["innerHTML"];
|
|
1018
|
+
const _hoisted_2$5 = { style: { "text-align": "right", "margin-top": "20px" } };
|
|
1019
|
+
const _hoisted_3$4 = ["innerHTML"];
|
|
1019
1020
|
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
1020
1021
|
...{
|
|
1021
1022
|
name: "MFormGroupListItem"
|
|
@@ -1113,11 +1114,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
1113
1114
|
_: 1
|
|
1114
1115
|
/* STABLE */
|
|
1115
1116
|
}),
|
|
1116
|
-
|
|
1117
|
-
toDisplayString(title.value),
|
|
1118
|
-
1
|
|
1119
|
-
/* TEXT */
|
|
1120
|
-
)
|
|
1117
|
+
createElementVNode("span", { innerHTML: title.value }, null, 8, _hoisted_1$b)
|
|
1121
1118
|
]),
|
|
1122
1119
|
_: 1
|
|
1123
1120
|
/* STABLE */
|
|
@@ -1246,7 +1243,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
1246
1243
|
/* CACHED */
|
|
1247
1244
|
))
|
|
1248
1245
|
]),
|
|
1249
|
-
createElementVNode("div",
|
|
1246
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
1250
1247
|
createVNode(unref(TMagicButton), {
|
|
1251
1248
|
size: "small",
|
|
1252
1249
|
text: "",
|
|
@@ -1287,7 +1284,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
1287
1284
|
key: 3,
|
|
1288
1285
|
innerHTML: itemExtra.value,
|
|
1289
1286
|
class: "m-form-tip"
|
|
1290
|
-
}, null, 8,
|
|
1287
|
+
}, null, 8, _hoisted_3$4)) : createCommentVNode("v-if", true)
|
|
1291
1288
|
])
|
|
1292
1289
|
]),
|
|
1293
1290
|
default: withCtx(() => [
|
|
@@ -1431,11 +1428,11 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
1431
1428
|
return openBlock(), createBlock(_sfc_main$x, {
|
|
1432
1429
|
key: index,
|
|
1433
1430
|
model: item,
|
|
1434
|
-
lastValues: getLastValues(__props.lastValues[__props.name], index),
|
|
1431
|
+
lastValues: getLastValues(__props.lastValues[__props.name], Number(index)),
|
|
1435
1432
|
"is-compare": __props.isCompare,
|
|
1436
1433
|
config: __props.config,
|
|
1437
1434
|
prop: __props.prop,
|
|
1438
|
-
index,
|
|
1435
|
+
index: Number(index),
|
|
1439
1436
|
"label-width": __props.labelWidth,
|
|
1440
1437
|
size: __props.size,
|
|
1441
1438
|
disabled: __props.disabled,
|
|
@@ -1932,7 +1929,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
1932
1929
|
prop: props.prop,
|
|
1933
1930
|
config: props.config
|
|
1934
1931
|
});
|
|
1935
|
-
emit("change", props.model);
|
|
1932
|
+
emit("change", props.model[props.name]);
|
|
1936
1933
|
} else {
|
|
1937
1934
|
const newObj = await initValue(mForm, {
|
|
1938
1935
|
config: props.config.items,
|
|
@@ -1966,11 +1963,11 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
1966
1963
|
tabClick(mForm, { name: activeTabName.value }, props);
|
|
1967
1964
|
}
|
|
1968
1965
|
}
|
|
1969
|
-
emit("change", props.model);
|
|
1966
|
+
emit("change", props.model[props.name]);
|
|
1970
1967
|
mForm?.$emit("field-change", props.prop, props.model[props.name]);
|
|
1971
1968
|
};
|
|
1972
1969
|
const changeHandler = (v, eventData) => {
|
|
1973
|
-
emit("change", props.model, eventData);
|
|
1970
|
+
emit("change", props.name ? props.model[props.name] : props.model, eventData);
|
|
1974
1971
|
};
|
|
1975
1972
|
const onAddDiffCount = (tabIndex) => {
|
|
1976
1973
|
if (!diffCount.value[tabIndex]) {
|
|
@@ -2021,8 +2018,8 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
2021
2018
|
/* TEXT */
|
|
2022
2019
|
),
|
|
2023
2020
|
createVNode(unref(TMagicBadge), {
|
|
2024
|
-
hidden: !diffCount.value[tabIndex],
|
|
2025
|
-
value: diffCount.value[tabIndex],
|
|
2021
|
+
hidden: !diffCount.value[Number(tabIndex)],
|
|
2022
|
+
value: diffCount.value[Number(tabIndex)],
|
|
2026
2023
|
class: "diff-count-badge"
|
|
2027
2024
|
}, null, 8, ["hidden", "value"])
|
|
2028
2025
|
])
|
|
@@ -2044,7 +2041,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
2044
2041
|
"label-width": tab.labelWidth || __props.labelWidth,
|
|
2045
2042
|
"expand-more": __props.expandMore,
|
|
2046
2043
|
onChange: changeHandler,
|
|
2047
|
-
onAddDiffCount: ($event) => onAddDiffCount(tabIndex)
|
|
2044
|
+
onAddDiffCount: ($event) => onAddDiffCount(Number(tabIndex))
|
|
2048
2045
|
}, null, 8, ["config", "disabled", "model", "last-values", "is-compare", "prop", "size", "label-width", "expand-more", "onAddDiffCount"]);
|
|
2049
2046
|
}),
|
|
2050
2047
|
128
|
|
@@ -4296,7 +4293,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
4296
4293
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
4297
4294
|
ref_key: "input",
|
|
4298
4295
|
ref: input,
|
|
4299
|
-
clearable:
|
|
4296
|
+
clearable: __props.config.clearable ?? true,
|
|
4300
4297
|
size: __props.size,
|
|
4301
4298
|
placeholder: __props.config.placeholder,
|
|
4302
4299
|
disabled: __props.disabled,
|
|
@@ -4348,7 +4345,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
4348
4345
|
]),
|
|
4349
4346
|
key: "1"
|
|
4350
4347
|
} : void 0
|
|
4351
|
-
]), 1032, ["modelValue", "size", "placeholder", "disabled"]),
|
|
4348
|
+
]), 1032, ["modelValue", "clearable", "size", "placeholder", "disabled"]),
|
|
4352
4349
|
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
4353
4350
|
popoverVisible.value ? (openBlock(), createElementBlock(
|
|
4354
4351
|
"div",
|
|
@@ -4847,7 +4844,16 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4847
4844
|
emit("change", props.model[props.name].toSpliced(index, 1));
|
|
4848
4845
|
};
|
|
4849
4846
|
const copyHandler = (index) => {
|
|
4850
|
-
|
|
4847
|
+
let inputs = cloneDeep(props.model[props.name][index]);
|
|
4848
|
+
if (typeof props.config.copyHandler === "function") {
|
|
4849
|
+
const modelName = props.name || props.config.name || "";
|
|
4850
|
+
inputs = props.config.copyHandler(mForm, {
|
|
4851
|
+
model: props.model[modelName],
|
|
4852
|
+
prop: props.prop,
|
|
4853
|
+
formValue: mForm?.values,
|
|
4854
|
+
inputs
|
|
4855
|
+
});
|
|
4856
|
+
}
|
|
4851
4857
|
const { length } = props.model[props.name];
|
|
4852
4858
|
if (props.sortKey && length) {
|
|
4853
4859
|
inputs[props.sortKey] = props.model[props.name][length - 1][props.sortKey] - 1;
|
|
@@ -5106,6 +5112,16 @@ const useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
|
5106
5112
|
})
|
|
5107
5113
|
});
|
|
5108
5114
|
}
|
|
5115
|
+
if (selection.value) {
|
|
5116
|
+
columns2.push({
|
|
5117
|
+
props: {
|
|
5118
|
+
align: "center",
|
|
5119
|
+
headerAlign: "center",
|
|
5120
|
+
type: "selection",
|
|
5121
|
+
width: 45
|
|
5122
|
+
}
|
|
5123
|
+
});
|
|
5124
|
+
}
|
|
5109
5125
|
let actionFixed = props.config.fixed === false ? void 0 : "left";
|
|
5110
5126
|
if (typeof props.config.fixed === "string" && ["left", "right"].includes(props.config.fixed)) {
|
|
5111
5127
|
actionFixed = props.config.fixed;
|
|
@@ -5157,16 +5173,6 @@ const useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
|
5157
5173
|
})
|
|
5158
5174
|
});
|
|
5159
5175
|
}
|
|
5160
|
-
if (selection.value) {
|
|
5161
|
-
columns2.push({
|
|
5162
|
-
props: {
|
|
5163
|
-
align: "center",
|
|
5164
|
-
headerAlign: "center",
|
|
5165
|
-
type: "selection",
|
|
5166
|
-
width: 45
|
|
5167
|
-
}
|
|
5168
|
-
});
|
|
5169
|
-
}
|
|
5170
5176
|
if (props.showIndex && props.config.showIndex) {
|
|
5171
5177
|
columns2.push({
|
|
5172
5178
|
props: {
|
package/dist/tmagic-form.umd.cjs
CHANGED
|
@@ -3161,7 +3161,7 @@
|
|
|
3161
3161
|
style: { "display": "inline-flex", "align-items": "center" }
|
|
3162
3162
|
};
|
|
3163
3163
|
const _hoisted_2$8 = ["innerHTML", "title"];
|
|
3164
|
-
const _hoisted_3$
|
|
3164
|
+
const _hoisted_3$7 = ["innerHTML"];
|
|
3165
3165
|
const _hoisted_4$5 = ["innerHTML", "title"];
|
|
3166
3166
|
const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
3167
3167
|
__name: "FormLabel",
|
|
@@ -3184,7 +3184,7 @@
|
|
|
3184
3184
|
placement: "top"
|
|
3185
3185
|
}, {
|
|
3186
3186
|
content: vue.withCtx(() => [
|
|
3187
|
-
vue.createElementVNode("div", { innerHTML: __props.tip }, null, 8, _hoisted_3$
|
|
3187
|
+
vue.createElementVNode("div", { innerHTML: __props.tip }, null, 8, _hoisted_3$7)
|
|
3188
3188
|
]),
|
|
3189
3189
|
default: vue.withCtx(() => [
|
|
3190
3190
|
vue.createVNode(vue.unref(design.TMagicIcon), { style: { "margin-left": "5px", "display": "flex" } }, {
|
|
@@ -3209,7 +3209,7 @@
|
|
|
3209
3209
|
|
|
3210
3210
|
const _hoisted_1$d = ["data-tmagic-id", "data-tmagic-form-item-prop"];
|
|
3211
3211
|
const _hoisted_2$7 = ["innerHTML"];
|
|
3212
|
-
const _hoisted_3$
|
|
3212
|
+
const _hoisted_3$6 = ["innerHTML"];
|
|
3213
3213
|
const _hoisted_4$4 = ["innerHTML"];
|
|
3214
3214
|
const _hoisted_5$3 = ["innerHTML"];
|
|
3215
3215
|
const _hoisted_6$1 = ["innerHTML"];
|
|
@@ -3508,7 +3508,7 @@
|
|
|
3508
3508
|
content: vue.withCtx(() => [
|
|
3509
3509
|
vue.createElementVNode("div", {
|
|
3510
3510
|
innerHTML: __props.config.tip
|
|
3511
|
-
}, null, 8, _hoisted_3$
|
|
3511
|
+
}, null, 8, _hoisted_3$6)
|
|
3512
3512
|
]),
|
|
3513
3513
|
default: vue.withCtx(() => [
|
|
3514
3514
|
vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
|
|
@@ -3711,7 +3711,7 @@
|
|
|
3711
3711
|
|
|
3712
3712
|
const _hoisted_1$c = ["innerHTML"];
|
|
3713
3713
|
const _hoisted_2$6 = ["innerHTML"];
|
|
3714
|
-
const _hoisted_3$
|
|
3714
|
+
const _hoisted_3$5 = { key: 1 };
|
|
3715
3715
|
const _hoisted_4$3 = ["innerHTML"];
|
|
3716
3716
|
const _hoisted_5$2 = ["innerHTML"];
|
|
3717
3717
|
const _hoisted_6 = {
|
|
@@ -3812,7 +3812,7 @@
|
|
|
3812
3812
|
]),
|
|
3813
3813
|
_: 1
|
|
3814
3814
|
/* STABLE */
|
|
3815
|
-
})) : (vue.openBlock(), vue.createElementBlock("legend", _hoisted_3$
|
|
3815
|
+
})) : (vue.openBlock(), vue.createElementBlock("legend", _hoisted_3$5, [
|
|
3816
3816
|
vue.createElementVNode("span", {
|
|
3817
3817
|
innerHTML: __props.config.legend
|
|
3818
3818
|
}, null, 8, _hoisted_4$3),
|
|
@@ -3944,8 +3944,9 @@
|
|
|
3944
3944
|
}
|
|
3945
3945
|
});
|
|
3946
3946
|
|
|
3947
|
-
const _hoisted_1$b =
|
|
3948
|
-
const _hoisted_2$5 =
|
|
3947
|
+
const _hoisted_1$b = ["innerHTML"];
|
|
3948
|
+
const _hoisted_2$5 = { style: { "text-align": "right", "margin-top": "20px" } };
|
|
3949
|
+
const _hoisted_3$4 = ["innerHTML"];
|
|
3949
3950
|
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
3950
3951
|
...{
|
|
3951
3952
|
name: "MFormGroupListItem"
|
|
@@ -4043,11 +4044,7 @@
|
|
|
4043
4044
|
_: 1
|
|
4044
4045
|
/* STABLE */
|
|
4045
4046
|
}),
|
|
4046
|
-
vue.
|
|
4047
|
-
vue.toDisplayString(title.value),
|
|
4048
|
-
1
|
|
4049
|
-
/* TEXT */
|
|
4050
|
-
)
|
|
4047
|
+
vue.createElementVNode("span", { innerHTML: title.value }, null, 8, _hoisted_1$b)
|
|
4051
4048
|
]),
|
|
4052
4049
|
_: 1
|
|
4053
4050
|
/* STABLE */
|
|
@@ -4176,7 +4173,7 @@
|
|
|
4176
4173
|
/* CACHED */
|
|
4177
4174
|
))
|
|
4178
4175
|
]),
|
|
4179
|
-
vue.createElementVNode("div",
|
|
4176
|
+
vue.createElementVNode("div", _hoisted_2$5, [
|
|
4180
4177
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4181
4178
|
size: "small",
|
|
4182
4179
|
text: "",
|
|
@@ -4217,7 +4214,7 @@
|
|
|
4217
4214
|
key: 3,
|
|
4218
4215
|
innerHTML: itemExtra.value,
|
|
4219
4216
|
class: "m-form-tip"
|
|
4220
|
-
}, null, 8,
|
|
4217
|
+
}, null, 8, _hoisted_3$4)) : vue.createCommentVNode("v-if", true)
|
|
4221
4218
|
])
|
|
4222
4219
|
]),
|
|
4223
4220
|
default: vue.withCtx(() => [
|
|
@@ -4361,11 +4358,11 @@
|
|
|
4361
4358
|
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
4362
4359
|
key: index,
|
|
4363
4360
|
model: item,
|
|
4364
|
-
lastValues: getLastValues(__props.lastValues[__props.name], index),
|
|
4361
|
+
lastValues: getLastValues(__props.lastValues[__props.name], Number(index)),
|
|
4365
4362
|
"is-compare": __props.isCompare,
|
|
4366
4363
|
config: __props.config,
|
|
4367
4364
|
prop: __props.prop,
|
|
4368
|
-
index,
|
|
4365
|
+
index: Number(index),
|
|
4369
4366
|
"label-width": __props.labelWidth,
|
|
4370
4367
|
size: __props.size,
|
|
4371
4368
|
disabled: __props.disabled,
|
|
@@ -4862,7 +4859,7 @@
|
|
|
4862
4859
|
prop: props.prop,
|
|
4863
4860
|
config: props.config
|
|
4864
4861
|
});
|
|
4865
|
-
emit("change", props.model);
|
|
4862
|
+
emit("change", props.model[props.name]);
|
|
4866
4863
|
} else {
|
|
4867
4864
|
const newObj = await initValue(mForm, {
|
|
4868
4865
|
config: props.config.items,
|
|
@@ -4896,11 +4893,11 @@
|
|
|
4896
4893
|
tabClick(mForm, { name: activeTabName.value }, props);
|
|
4897
4894
|
}
|
|
4898
4895
|
}
|
|
4899
|
-
emit("change", props.model);
|
|
4896
|
+
emit("change", props.model[props.name]);
|
|
4900
4897
|
mForm?.$emit("field-change", props.prop, props.model[props.name]);
|
|
4901
4898
|
};
|
|
4902
4899
|
const changeHandler = (v, eventData) => {
|
|
4903
|
-
emit("change", props.model, eventData);
|
|
4900
|
+
emit("change", props.name ? props.model[props.name] : props.model, eventData);
|
|
4904
4901
|
};
|
|
4905
4902
|
const onAddDiffCount = (tabIndex) => {
|
|
4906
4903
|
if (!diffCount.value[tabIndex]) {
|
|
@@ -4951,8 +4948,8 @@
|
|
|
4951
4948
|
/* TEXT */
|
|
4952
4949
|
),
|
|
4953
4950
|
vue.createVNode(vue.unref(design.TMagicBadge), {
|
|
4954
|
-
hidden: !diffCount.value[tabIndex],
|
|
4955
|
-
value: diffCount.value[tabIndex],
|
|
4951
|
+
hidden: !diffCount.value[Number(tabIndex)],
|
|
4952
|
+
value: diffCount.value[Number(tabIndex)],
|
|
4956
4953
|
class: "diff-count-badge"
|
|
4957
4954
|
}, null, 8, ["hidden", "value"])
|
|
4958
4955
|
])
|
|
@@ -4974,7 +4971,7 @@
|
|
|
4974
4971
|
"label-width": tab.labelWidth || __props.labelWidth,
|
|
4975
4972
|
"expand-more": __props.expandMore,
|
|
4976
4973
|
onChange: changeHandler,
|
|
4977
|
-
onAddDiffCount: ($event) => onAddDiffCount(tabIndex)
|
|
4974
|
+
onAddDiffCount: ($event) => onAddDiffCount(Number(tabIndex))
|
|
4978
4975
|
}, null, 8, ["config", "disabled", "model", "last-values", "is-compare", "prop", "size", "label-width", "expand-more", "onAddDiffCount"]);
|
|
4979
4976
|
}),
|
|
4980
4977
|
128
|
|
@@ -7226,7 +7223,7 @@
|
|
|
7226
7223
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
7227
7224
|
ref_key: "input",
|
|
7228
7225
|
ref: input,
|
|
7229
|
-
clearable:
|
|
7226
|
+
clearable: __props.config.clearable ?? true,
|
|
7230
7227
|
size: __props.size,
|
|
7231
7228
|
placeholder: __props.config.placeholder,
|
|
7232
7229
|
disabled: __props.disabled,
|
|
@@ -7278,7 +7275,7 @@
|
|
|
7278
7275
|
]),
|
|
7279
7276
|
key: "1"
|
|
7280
7277
|
} : void 0
|
|
7281
|
-
]), 1032, ["modelValue", "size", "placeholder", "disabled"]),
|
|
7278
|
+
]), 1032, ["modelValue", "clearable", "size", "placeholder", "disabled"]),
|
|
7282
7279
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
7283
7280
|
popoverVisible.value ? (vue.openBlock(), vue.createElementBlock(
|
|
7284
7281
|
"div",
|
|
@@ -7777,7 +7774,16 @@
|
|
|
7777
7774
|
emit("change", props.model[props.name].toSpliced(index, 1));
|
|
7778
7775
|
};
|
|
7779
7776
|
const copyHandler = (index) => {
|
|
7780
|
-
|
|
7777
|
+
let inputs = cloneDeep(props.model[props.name][index]);
|
|
7778
|
+
if (typeof props.config.copyHandler === "function") {
|
|
7779
|
+
const modelName = props.name || props.config.name || "";
|
|
7780
|
+
inputs = props.config.copyHandler(mForm, {
|
|
7781
|
+
model: props.model[modelName],
|
|
7782
|
+
prop: props.prop,
|
|
7783
|
+
formValue: mForm?.values,
|
|
7784
|
+
inputs
|
|
7785
|
+
});
|
|
7786
|
+
}
|
|
7781
7787
|
const { length } = props.model[props.name];
|
|
7782
7788
|
if (props.sortKey && length) {
|
|
7783
7789
|
inputs[props.sortKey] = props.model[props.name][length - 1][props.sortKey] - 1;
|
|
@@ -8036,6 +8042,16 @@
|
|
|
8036
8042
|
})
|
|
8037
8043
|
});
|
|
8038
8044
|
}
|
|
8045
|
+
if (selection.value) {
|
|
8046
|
+
columns2.push({
|
|
8047
|
+
props: {
|
|
8048
|
+
align: "center",
|
|
8049
|
+
headerAlign: "center",
|
|
8050
|
+
type: "selection",
|
|
8051
|
+
width: 45
|
|
8052
|
+
}
|
|
8053
|
+
});
|
|
8054
|
+
}
|
|
8039
8055
|
let actionFixed = props.config.fixed === false ? void 0 : "left";
|
|
8040
8056
|
if (typeof props.config.fixed === "string" && ["left", "right"].includes(props.config.fixed)) {
|
|
8041
8057
|
actionFixed = props.config.fixed;
|
|
@@ -8087,16 +8103,6 @@
|
|
|
8087
8103
|
})
|
|
8088
8104
|
});
|
|
8089
8105
|
}
|
|
8090
|
-
if (selection.value) {
|
|
8091
|
-
columns2.push({
|
|
8092
|
-
props: {
|
|
8093
|
-
align: "center",
|
|
8094
|
-
headerAlign: "center",
|
|
8095
|
-
type: "selection",
|
|
8096
|
-
width: 45
|
|
8097
|
-
}
|
|
8098
|
-
});
|
|
8099
|
-
}
|
|
8100
8106
|
if (props.showIndex && props.config.showIndex) {
|
|
8101
8107
|
columns2.push({
|
|
8102
8108
|
props: {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.7.
|
|
2
|
+
"version": "1.7.3",
|
|
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/
|
|
55
|
-
"@tmagic/utils": "1.7.
|
|
56
|
-
"@tmagic/
|
|
54
|
+
"@tmagic/design": "1.7.3",
|
|
55
|
+
"@tmagic/utils": "1.7.3",
|
|
56
|
+
"@tmagic/form-schema": "1.7.3"
|
|
57
57
|
},
|
|
58
58
|
"peerDependenciesMeta": {
|
|
59
59
|
"typescript": {
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
v-for="(item, index) in model[name]"
|
|
11
11
|
:key="index"
|
|
12
12
|
:model="item"
|
|
13
|
-
:lastValues="getLastValues(lastValues[name], index)"
|
|
13
|
+
:lastValues="getLastValues(lastValues[name], Number(index))"
|
|
14
14
|
:is-compare="isCompare"
|
|
15
15
|
:config="config"
|
|
16
16
|
:prop="prop"
|
|
17
|
-
:index="index"
|
|
17
|
+
:index="Number(index)"
|
|
18
18
|
:label-width="labelWidth"
|
|
19
19
|
:size="size"
|
|
20
20
|
:disabled="disabled"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<template #header>
|
|
4
4
|
<div>
|
|
5
5
|
<TMagicButton link :disabled="disabled" @click="expandHandler">
|
|
6
|
-
<TMagicIcon><CaretBottom v-if="expand" /><CaretRight v-else /></TMagicIcon
|
|
6
|
+
<TMagicIcon><CaretBottom v-if="expand" /><CaretRight v-else /></TMagicIcon><span v-html="title"></span>
|
|
7
7
|
</TMagicButton>
|
|
8
8
|
|
|
9
9
|
<TMagicButton
|
package/src/containers/Tabs.vue
CHANGED
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
<span>
|
|
27
27
|
{{ filter(tab.title)
|
|
28
28
|
}}<TMagicBadge
|
|
29
|
-
:hidden="!diffCount[tabIndex]"
|
|
30
|
-
:value="diffCount[tabIndex]"
|
|
29
|
+
:hidden="!diffCount[Number(tabIndex)]"
|
|
30
|
+
:value="diffCount[Number(tabIndex)]"
|
|
31
31
|
class="diff-count-badge"
|
|
32
32
|
></TMagicBadge>
|
|
33
33
|
</span>
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
:label-width="tab.labelWidth || labelWidth"
|
|
70
70
|
:expand-more="expandMore"
|
|
71
71
|
@change="changeHandler"
|
|
72
|
-
@addDiffCount="onAddDiffCount(tabIndex)"
|
|
72
|
+
@addDiffCount="onAddDiffCount(Number(tabIndex))"
|
|
73
73
|
></Container>
|
|
74
74
|
</component>
|
|
75
75
|
</component>
|
|
@@ -195,7 +195,7 @@ const onTabAdd = async () => {
|
|
|
195
195
|
prop: props.prop,
|
|
196
196
|
config: props.config,
|
|
197
197
|
});
|
|
198
|
-
emit('change', props.model);
|
|
198
|
+
emit('change', props.model[props.name]);
|
|
199
199
|
} else {
|
|
200
200
|
const newObj = await initValue(mForm, {
|
|
201
201
|
config: props.config.items,
|
|
@@ -237,12 +237,12 @@ const onTabRemove = (tabName: string) => {
|
|
|
237
237
|
tabClick(mForm, { name: activeTabName.value }, props);
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
emit('change', props.model);
|
|
240
|
+
emit('change', props.model[props.name]);
|
|
241
241
|
mForm?.$emit('field-change', props.prop, props.model[props.name]);
|
|
242
242
|
};
|
|
243
243
|
|
|
244
244
|
const changeHandler = (v: any, eventData: ContainerChangeEventData) => {
|
|
245
|
-
emit('change', props.model, eventData);
|
|
245
|
+
emit('change', props.name ? props.model[props.name] : props.model, eventData);
|
|
246
246
|
};
|
|
247
247
|
|
|
248
248
|
// 在tabs组件中收集事件触发次数,即该tab下的差异数
|
package/src/fields/Text.vue
CHANGED
|
@@ -63,7 +63,18 @@ const removeHandler = (index: number) => {
|
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
const copyHandler = (index: number) => {
|
|
66
|
-
|
|
66
|
+
let inputs = cloneDeep(props.model[props.name][index]);
|
|
67
|
+
|
|
68
|
+
if (typeof props.config.copyHandler === 'function') {
|
|
69
|
+
const modelName = props.name || props.config.name || '';
|
|
70
|
+
inputs = props.config.copyHandler(mForm, {
|
|
71
|
+
model: props.model[modelName],
|
|
72
|
+
prop: props.prop,
|
|
73
|
+
formValue: mForm?.values,
|
|
74
|
+
inputs,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
67
78
|
const { length } = props.model[props.name];
|
|
68
79
|
if (props.sortKey && length) {
|
|
69
80
|
inputs[props.sortKey] = props.model[props.name][length - 1][props.sortKey] - 1;
|
|
@@ -101,6 +101,17 @@ export const useTableColumns = (
|
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
if (selection.value) {
|
|
105
|
+
columns.push({
|
|
106
|
+
props: {
|
|
107
|
+
align: 'center',
|
|
108
|
+
headerAlign: 'center',
|
|
109
|
+
type: 'selection',
|
|
110
|
+
width: 45,
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
104
115
|
let actionFixed: 'left' | 'right' | undefined = props.config.fixed === false ? undefined : 'left';
|
|
105
116
|
|
|
106
117
|
if (typeof props.config.fixed === 'string' && ['left', 'right'].includes(props.config.fixed)) {
|
|
@@ -159,17 +170,6 @@ export const useTableColumns = (
|
|
|
159
170
|
});
|
|
160
171
|
}
|
|
161
172
|
|
|
162
|
-
if (selection.value) {
|
|
163
|
-
columns.push({
|
|
164
|
-
props: {
|
|
165
|
-
align: 'center',
|
|
166
|
-
headerAlign: 'center',
|
|
167
|
-
type: 'selection',
|
|
168
|
-
width: 45,
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
|
|
173
173
|
if (props.showIndex && props.config.showIndex) {
|
|
174
174
|
columns.push({
|
|
175
175
|
props: {
|