@tmagic/form 1.3.16 → 1.4.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.
- package/dist/style.css +3 -8
- package/dist/tmagic-form.js +132 -123
- package/dist/tmagic-form.umd.cjs +131 -122
- package/package.json +12 -11
- package/src/FormBox.vue +48 -34
- package/src/containers/Container.vue +3 -3
- package/src/containers/Fieldset.vue +2 -2
- package/src/fields/Cascader.vue +1 -0
- package/src/fields/Checkbox.vue +2 -2
- package/src/fields/CheckboxGroup.vue +1 -6
- package/src/fields/RadioGroup.vue +3 -7
- package/src/schema.ts +6 -2
- package/src/theme/form-box.scss +3 -8
- package/types/Form.vue.d.ts +12 -12
- package/types/FormBox.vue.d.ts +195 -244
- package/types/FormDialog.vue.d.ts +191 -241
- package/types/FormDrawer.vue.d.ts +192 -242
- package/types/containers/Col.vue.d.ts +3 -3
- package/types/containers/Container.vue.d.ts +12 -12
- package/types/containers/Fieldset.vue.d.ts +11 -11
- package/types/containers/GroupList.vue.d.ts +3 -3
- package/types/containers/GroupListItem.vue.d.ts +3 -3
- package/types/containers/Panel.vue.d.ts +8 -8
- package/types/containers/Row.vue.d.ts +3 -3
- package/types/containers/Step.vue.d.ts +11 -11
- package/types/containers/Table.vue.d.ts +11 -11
- package/types/containers/Tabs.vue.d.ts +11 -11
- package/types/fields/Cascader.vue.d.ts +3 -3
- package/types/fields/Checkbox.vue.d.ts +3 -3
- package/types/fields/CheckboxGroup.vue.d.ts +3 -3
- package/types/fields/ColorPicker.vue.d.ts +3 -3
- package/types/fields/Date.vue.d.ts +3 -3
- package/types/fields/DateTime.vue.d.ts +3 -3
- package/types/fields/Daterange.vue.d.ts +3 -3
- package/types/fields/Display.vue.d.ts +2 -2
- package/types/fields/DynamicField.vue.d.ts +3 -3
- package/types/fields/Hidden.vue.d.ts +2 -2
- package/types/fields/Link.vue.d.ts +3 -3
- package/types/fields/Number.vue.d.ts +3 -3
- package/types/fields/NumberRange.vue.d.ts +3 -3
- package/types/fields/RadioGroup.vue.d.ts +3 -3
- package/types/fields/Select.vue.d.ts +3 -3
- package/types/fields/SelectOptionGroups.vue.d.ts +3 -3
- package/types/fields/SelectOptions.vue.d.ts +3 -3
- package/types/fields/Switch.vue.d.ts +3 -3
- package/types/fields/Text.vue.d.ts +3 -3
- package/types/fields/Textarea.vue.d.ts +3 -3
- package/types/fields/Time.vue.d.ts +3 -3
- package/types/fields/Timerange.vue.d.ts +3 -3
- package/types/schema.d.ts +6 -2
package/dist/tmagic-form.umd.cjs
CHANGED
|
@@ -165,16 +165,16 @@
|
|
|
165
165
|
return valuesTmp || {};
|
|
166
166
|
};
|
|
167
167
|
|
|
168
|
-
const _hoisted_1$
|
|
169
|
-
const _hoisted_2$
|
|
168
|
+
const _hoisted_1$d = ["id", "data-magic-id"];
|
|
169
|
+
const _hoisted_2$8 = ["innerHTML", "title"];
|
|
170
170
|
const _hoisted_3$5 = ["innerHTML"];
|
|
171
171
|
const _hoisted_4$4 = ["innerHTML"];
|
|
172
172
|
const _hoisted_5$4 = ["innerHTML"];
|
|
173
|
-
const _hoisted_6$2 = ["innerHTML"];
|
|
173
|
+
const _hoisted_6$2 = ["innerHTML", "title"];
|
|
174
174
|
const _hoisted_7$1 = ["innerHTML"];
|
|
175
175
|
const _hoisted_8$1 = ["innerHTML"];
|
|
176
176
|
const _hoisted_9 = ["innerHTML"];
|
|
177
|
-
const _hoisted_10 = ["innerHTML"];
|
|
177
|
+
const _hoisted_10 = ["innerHTML", "title"];
|
|
178
178
|
const _hoisted_11 = ["innerHTML"];
|
|
179
179
|
const _hoisted_12 = ["innerHTML"];
|
|
180
180
|
const _hoisted_13 = ["innerHTML"];
|
|
@@ -370,8 +370,9 @@
|
|
|
370
370
|
}, {
|
|
371
371
|
label: vue.withCtx(() => [
|
|
372
372
|
vue.createElementVNode("span", {
|
|
373
|
-
innerHTML: type.value === "checkbox" ? "" : text.value
|
|
374
|
-
|
|
373
|
+
innerHTML: type.value === "checkbox" ? "" : text.value,
|
|
374
|
+
title: _ctx.config.labelTitle
|
|
375
|
+
}, null, 8, _hoisted_2$8)
|
|
375
376
|
]),
|
|
376
377
|
default: vue.withCtx(() => [
|
|
377
378
|
tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
|
|
@@ -442,7 +443,8 @@
|
|
|
442
443
|
}, {
|
|
443
444
|
label: vue.withCtx(() => [
|
|
444
445
|
vue.createElementVNode("span", {
|
|
445
|
-
innerHTML: type.value === "checkbox" ? "" : text.value
|
|
446
|
+
innerHTML: type.value === "checkbox" ? "" : text.value,
|
|
447
|
+
title: _ctx.config.labelTitle
|
|
446
448
|
}, null, 8, _hoisted_6$2)
|
|
447
449
|
]),
|
|
448
450
|
default: vue.withCtx(() => [
|
|
@@ -509,7 +511,8 @@
|
|
|
509
511
|
}, {
|
|
510
512
|
label: vue.withCtx(() => [
|
|
511
513
|
vue.createElementVNode("span", {
|
|
512
|
-
innerHTML: type.value === "checkbox" ? "" : text.value
|
|
514
|
+
innerHTML: type.value === "checkbox" ? "" : text.value,
|
|
515
|
+
title: _ctx.config.labelTitle
|
|
513
516
|
}, null, 8, _hoisted_10)
|
|
514
517
|
]),
|
|
515
518
|
default: vue.withCtx(() => [
|
|
@@ -600,13 +603,13 @@
|
|
|
600
603
|
_: 1
|
|
601
604
|
})
|
|
602
605
|
])) : vue.createCommentVNode("", true)
|
|
603
|
-
], 14, _hoisted_1$
|
|
606
|
+
], 14, _hoisted_1$d)) : vue.createCommentVNode("", true);
|
|
604
607
|
};
|
|
605
608
|
}
|
|
606
609
|
});
|
|
607
610
|
|
|
608
|
-
const _hoisted_1$
|
|
609
|
-
const _hoisted_2$
|
|
611
|
+
const _hoisted_1$c = ["innerHTML"];
|
|
612
|
+
const _hoisted_2$7 = ["innerHTML"];
|
|
610
613
|
const _hoisted_3$4 = { key: 1 };
|
|
611
614
|
const _hoisted_4$3 = ["innerHTML"];
|
|
612
615
|
const _hoisted_5$3 = ["innerHTML"];
|
|
@@ -670,18 +673,18 @@
|
|
|
670
673
|
change
|
|
671
674
|
],
|
|
672
675
|
prop: `${_ctx.prop}${_ctx.prop ? "." : ""}${_ctx.config.name}.value`,
|
|
673
|
-
"true-
|
|
674
|
-
"false-
|
|
676
|
+
"true-value": 1,
|
|
677
|
+
"false-value": 0
|
|
675
678
|
}, {
|
|
676
679
|
default: vue.withCtx(() => [
|
|
677
680
|
vue.createElementVNode("span", {
|
|
678
681
|
innerHTML: _ctx.config.legend
|
|
679
|
-
}, null, 8, _hoisted_1$
|
|
682
|
+
}, null, 8, _hoisted_1$c),
|
|
680
683
|
_ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
681
684
|
key: 0,
|
|
682
685
|
innerHTML: _ctx.config.extra,
|
|
683
686
|
class: "m-form-tip"
|
|
684
|
-
}, null, 8, _hoisted_2$
|
|
687
|
+
}, null, 8, _hoisted_2$7)) : vue.createCommentVNode("", true)
|
|
685
688
|
]),
|
|
686
689
|
_: 1
|
|
687
690
|
}, 8, ["modelValue", "prop"])
|
|
@@ -741,8 +744,8 @@
|
|
|
741
744
|
}
|
|
742
745
|
});
|
|
743
746
|
|
|
744
|
-
const _hoisted_1$
|
|
745
|
-
const _hoisted_2$
|
|
747
|
+
const _hoisted_1$b = { class: "m-fields-group-list-item" };
|
|
748
|
+
const _hoisted_2$6 = ["innerHTML"];
|
|
746
749
|
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
747
750
|
...{
|
|
748
751
|
name: "MFormGroupListItem"
|
|
@@ -809,7 +812,7 @@
|
|
|
809
812
|
};
|
|
810
813
|
const onAddDiffCount = () => emit("addDiffCount");
|
|
811
814
|
return (_ctx, _cache) => {
|
|
812
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
815
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
|
|
813
816
|
vue.createElementVNode("div", null, [
|
|
814
817
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
815
818
|
link: "",
|
|
@@ -875,7 +878,7 @@
|
|
|
875
878
|
key: 1,
|
|
876
879
|
innerHTML: itemExtra.value,
|
|
877
880
|
class: "m-form-tip"
|
|
878
|
-
}, null, 8, _hoisted_2$
|
|
881
|
+
}, null, 8, _hoisted_2$6)) : vue.createCommentVNode("", true)
|
|
879
882
|
]),
|
|
880
883
|
expand.value ? (vue.openBlock(), vue.createBlock(_sfc_main$z, {
|
|
881
884
|
key: 0,
|
|
@@ -895,8 +898,8 @@
|
|
|
895
898
|
}
|
|
896
899
|
});
|
|
897
900
|
|
|
898
|
-
const _hoisted_1$
|
|
899
|
-
const _hoisted_2$
|
|
901
|
+
const _hoisted_1$a = { class: "m-fields-group-list" };
|
|
902
|
+
const _hoisted_2$5 = ["innerHTML"];
|
|
900
903
|
const _hoisted_3$3 = {
|
|
901
904
|
key: 1,
|
|
902
905
|
class: "el-table__empty-block"
|
|
@@ -989,12 +992,12 @@
|
|
|
989
992
|
const onAddDiffCount = () => emit("addDiffCount");
|
|
990
993
|
const getLastValues = (item, index) => item?.[index] || {};
|
|
991
994
|
return (_ctx, _cache) => {
|
|
992
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
995
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
|
|
993
996
|
_ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
994
997
|
key: 0,
|
|
995
998
|
innerHTML: _ctx.config.extra,
|
|
996
999
|
style: { "color": "rgba(0, 0, 0, 0.45)" }
|
|
997
|
-
}, null, 8, _hoisted_2$
|
|
1000
|
+
}, null, 8, _hoisted_2$5)) : vue.createCommentVNode("", true),
|
|
998
1001
|
!_ctx.model[_ctx.name] || !_ctx.model[_ctx.name].length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, _hoisted_5$2)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 2 }, vue.renderList(_ctx.model[_ctx.name], (item, index) => {
|
|
999
1002
|
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
1000
1003
|
key: index,
|
|
@@ -1041,8 +1044,8 @@
|
|
|
1041
1044
|
}
|
|
1042
1045
|
});
|
|
1043
1046
|
|
|
1044
|
-
const _hoisted_1$
|
|
1045
|
-
const _hoisted_2$
|
|
1047
|
+
const _hoisted_1$9 = { style: { "width": "100%", "display": "flex", "align-items": "center" } };
|
|
1048
|
+
const _hoisted_2$4 = ["innerHTML"];
|
|
1046
1049
|
const _hoisted_3$2 = {
|
|
1047
1050
|
key: 0,
|
|
1048
1051
|
style: { "display": "flex" }
|
|
@@ -1082,7 +1085,7 @@
|
|
|
1082
1085
|
"body-style": { display: expand.value ? "block" : "none" }
|
|
1083
1086
|
}, {
|
|
1084
1087
|
header: vue.withCtx(() => [
|
|
1085
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
1088
|
+
vue.createElementVNode("div", _hoisted_1$9, [
|
|
1086
1089
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
1087
1090
|
style: { "padding": "0" },
|
|
1088
1091
|
link: "",
|
|
@@ -1093,7 +1096,7 @@
|
|
|
1093
1096
|
key: 0,
|
|
1094
1097
|
innerHTML: _ctx.config.extra,
|
|
1095
1098
|
class: "m-form-tip"
|
|
1096
|
-
}, null, 8, _hoisted_2$
|
|
1099
|
+
}, null, 8, _hoisted_2$4)) : vue.createCommentVNode("", true),
|
|
1097
1100
|
vue.renderSlot(_ctx.$slots, "header", {}, () => [
|
|
1098
1101
|
vue.createTextVNode(vue.toDisplayString(filter(_ctx.config.title)), 1)
|
|
1099
1102
|
])
|
|
@@ -1327,8 +1330,8 @@
|
|
|
1327
1330
|
}
|
|
1328
1331
|
});
|
|
1329
1332
|
|
|
1330
|
-
const _hoisted_1$
|
|
1331
|
-
const _hoisted_2$
|
|
1333
|
+
const _hoisted_1$8 = { class: "m-fields-table-wrap" };
|
|
1334
|
+
const _hoisted_2$3 = ["innerHTML"];
|
|
1332
1335
|
const _hoisted_3$1 = ["innerHTML"];
|
|
1333
1336
|
const _hoisted_4 = { style: { "display": "flex", "justify-content": "space-between", "margin": "10px 0" } };
|
|
1334
1337
|
const _hoisted_5 = { style: { "display": "flex" } };
|
|
@@ -1697,7 +1700,7 @@
|
|
|
1697
1700
|
toggleRowSelection
|
|
1698
1701
|
});
|
|
1699
1702
|
return (_ctx, _cache) => {
|
|
1700
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1703
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
|
|
1701
1704
|
(vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
1702
1705
|
to: "body",
|
|
1703
1706
|
disabled: !isFullscreen.value
|
|
@@ -1711,7 +1714,7 @@
|
|
|
1711
1714
|
key: 0,
|
|
1712
1715
|
style: { "color": "rgba(0, 0, 0, 0.45)" },
|
|
1713
1716
|
innerHTML: _ctx.config.extra
|
|
1714
|
-
}, null, 8, _hoisted_2$
|
|
1717
|
+
}, null, 8, _hoisted_2$3)) : vue.createCommentVNode("", true),
|
|
1715
1718
|
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
1716
1719
|
content: "拖拽可排序",
|
|
1717
1720
|
placement: "left-start",
|
|
@@ -2262,13 +2265,14 @@
|
|
|
2262
2265
|
placeholder: _ctx.config.placeholder,
|
|
2263
2266
|
disabled: _ctx.disabled,
|
|
2264
2267
|
options: options.value,
|
|
2268
|
+
"popper-class": _ctx.config.popperClass,
|
|
2265
2269
|
props: {
|
|
2266
2270
|
multiple: _ctx.config.multiple ?? false,
|
|
2267
2271
|
emitPath: _ctx.config.emitPath ?? true,
|
|
2268
2272
|
checkStrictly: _ctx.config.checkStrictly ?? false
|
|
2269
2273
|
},
|
|
2270
2274
|
onChange: changeHandler
|
|
2271
|
-
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "options", "props"]);
|
|
2275
|
+
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "options", "popper-class", "props"]);
|
|
2272
2276
|
};
|
|
2273
2277
|
}
|
|
2274
2278
|
});
|
|
@@ -2322,8 +2326,8 @@
|
|
|
2322
2326
|
modelValue: _ctx.model[_ctx.name],
|
|
2323
2327
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
2324
2328
|
size: _ctx.size,
|
|
2325
|
-
|
|
2326
|
-
|
|
2329
|
+
trueValue: activeValue.value,
|
|
2330
|
+
falseValue: inactiveValue.value,
|
|
2327
2331
|
disabled: _ctx.disabled,
|
|
2328
2332
|
onChange: changeHandler
|
|
2329
2333
|
}, {
|
|
@@ -2331,7 +2335,7 @@
|
|
|
2331
2335
|
vue.createTextVNode(vue.toDisplayString(_ctx.config.text), 1)
|
|
2332
2336
|
]),
|
|
2333
2337
|
_: 1
|
|
2334
|
-
}, 8, ["modelValue", "size", "
|
|
2338
|
+
}, 8, ["modelValue", "size", "trueValue", "falseValue", "disabled"]);
|
|
2335
2339
|
};
|
|
2336
2340
|
}
|
|
2337
2341
|
});
|
|
@@ -2382,7 +2386,6 @@
|
|
|
2382
2386
|
default: vue.withCtx(() => [
|
|
2383
2387
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(options.value, (option) => {
|
|
2384
2388
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCheckbox), {
|
|
2385
|
-
label: option.value,
|
|
2386
2389
|
value: option.value,
|
|
2387
2390
|
key: option.value,
|
|
2388
2391
|
disabled: option.disabled
|
|
@@ -2391,7 +2394,7 @@
|
|
|
2391
2394
|
vue.createTextVNode(vue.toDisplayString(option.text), 1)
|
|
2392
2395
|
]),
|
|
2393
2396
|
_: 2
|
|
2394
|
-
}, 1032, ["
|
|
2397
|
+
}, 1032, ["value", "disabled"]);
|
|
2395
2398
|
}), 128))
|
|
2396
2399
|
]),
|
|
2397
2400
|
_: 1
|
|
@@ -2629,7 +2632,7 @@
|
|
|
2629
2632
|
}
|
|
2630
2633
|
});
|
|
2631
2634
|
|
|
2632
|
-
const _hoisted_1$
|
|
2635
|
+
const _hoisted_1$7 = { key: 0 };
|
|
2633
2636
|
const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
2634
2637
|
...{
|
|
2635
2638
|
name: "MFormDisplay"
|
|
@@ -2653,12 +2656,12 @@
|
|
|
2653
2656
|
}
|
|
2654
2657
|
useAddField(props.prop);
|
|
2655
2658
|
return (_ctx, _cache) => {
|
|
2656
|
-
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$
|
|
2659
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$7, vue.toDisplayString(_ctx.model[_ctx.name]), 1)) : vue.createCommentVNode("", true);
|
|
2657
2660
|
};
|
|
2658
2661
|
}
|
|
2659
2662
|
});
|
|
2660
2663
|
|
|
2661
|
-
const _hoisted_1$
|
|
2664
|
+
const _hoisted_1$6 = { class: "m-fields-dynamic-field" };
|
|
2662
2665
|
const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
2663
2666
|
...{
|
|
2664
2667
|
name: "MFormDynamicField"
|
|
@@ -2725,7 +2728,7 @@
|
|
|
2725
2728
|
emit("change", fieldMap.value[key], key);
|
|
2726
2729
|
};
|
|
2727
2730
|
return (_ctx, _cache) => {
|
|
2728
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2731
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
|
|
2729
2732
|
vue.createVNode(vue.unref(design.TMagicForm), { size: "small" }, {
|
|
2730
2733
|
default: vue.withCtx(() => [
|
|
2731
2734
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Object.keys(fieldMap.value), (key) => {
|
|
@@ -2944,7 +2947,7 @@
|
|
|
2944
2947
|
}
|
|
2945
2948
|
});
|
|
2946
2949
|
|
|
2947
|
-
const _hoisted_1$
|
|
2950
|
+
const _hoisted_1$5 = { style: { "min-height": "1px" } };
|
|
2948
2951
|
const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
2949
2952
|
...{
|
|
2950
2953
|
name: "MFormDialog"
|
|
@@ -3053,7 +3056,7 @@
|
|
|
3053
3056
|
style: { "text-align": "left" }
|
|
3054
3057
|
}, {
|
|
3055
3058
|
default: vue.withCtx(() => [
|
|
3056
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
3059
|
+
vue.createElementVNode("div", _hoisted_1$5, [
|
|
3057
3060
|
vue.renderSlot(_ctx.$slots, "left")
|
|
3058
3061
|
])
|
|
3059
3062
|
]),
|
|
@@ -3143,8 +3146,8 @@
|
|
|
3143
3146
|
}
|
|
3144
3147
|
});
|
|
3145
3148
|
|
|
3146
|
-
const _hoisted_1$
|
|
3147
|
-
const _hoisted_2$
|
|
3149
|
+
const _hoisted_1$4 = ["href"];
|
|
3150
|
+
const _hoisted_2$2 = {
|
|
3148
3151
|
key: 2,
|
|
3149
3152
|
class: "m-fields-link"
|
|
3150
3153
|
};
|
|
@@ -3217,10 +3220,10 @@
|
|
|
3217
3220
|
target: "_blank",
|
|
3218
3221
|
href: href.value,
|
|
3219
3222
|
style: vue.normalizeStyle(_ctx.config.css || {})
|
|
3220
|
-
}, vue.toDisplayString(displayText.value), 13, _hoisted_1$
|
|
3223
|
+
}, vue.toDisplayString(displayText.value), 13, _hoisted_1$4)) : _ctx.config.href && _ctx.disabled ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
3221
3224
|
key: 1,
|
|
3222
3225
|
style: vue.normalizeStyle(_ctx.config.disabledCss || {})
|
|
3223
|
-
}, vue.toDisplayString(displayText.value), 5)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
3226
|
+
}, vue.toDisplayString(displayText.value), 5)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [
|
|
3224
3227
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
3225
3228
|
link: "",
|
|
3226
3229
|
type: "primary",
|
|
@@ -3296,8 +3299,8 @@
|
|
|
3296
3299
|
}
|
|
3297
3300
|
});
|
|
3298
3301
|
|
|
3299
|
-
const _hoisted_1$
|
|
3300
|
-
const _hoisted_2$
|
|
3302
|
+
const _hoisted_1$3 = { class: "m-fields-number-range" };
|
|
3303
|
+
const _hoisted_2$1 = /* @__PURE__ */ vue.createElementVNode("span", { class: "split-tag" }, "-", -1);
|
|
3301
3304
|
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
3302
3305
|
...{
|
|
3303
3306
|
name: "MFormNumberRange"
|
|
@@ -3329,7 +3332,7 @@
|
|
|
3329
3332
|
emit("change", [props.model[props.name][0], Number(v)]);
|
|
3330
3333
|
};
|
|
3331
3334
|
return (_ctx, _cache) => {
|
|
3332
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3335
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
|
|
3333
3336
|
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
3334
3337
|
modelValue: _ctx.model[_ctx.name][0],
|
|
3335
3338
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name][0] = $event),
|
|
@@ -3338,7 +3341,7 @@
|
|
|
3338
3341
|
disabled: _ctx.disabled,
|
|
3339
3342
|
onChange: minChangeHandler
|
|
3340
3343
|
}, null, 8, ["modelValue", "size", "disabled"]),
|
|
3341
|
-
_hoisted_2$
|
|
3344
|
+
_hoisted_2$1,
|
|
3342
3345
|
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
3343
3346
|
modelValue: _ctx.model[_ctx.name][1],
|
|
3344
3347
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.model[_ctx.name][1] = $event),
|
|
@@ -3388,7 +3391,6 @@
|
|
|
3388
3391
|
default: vue.withCtx(() => [
|
|
3389
3392
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.options, (option) => {
|
|
3390
3393
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicRadio), {
|
|
3391
|
-
label: option.value,
|
|
3392
3394
|
value: option.value,
|
|
3393
3395
|
key: `${option.value}`
|
|
3394
3396
|
}, {
|
|
@@ -3396,7 +3398,7 @@
|
|
|
3396
3398
|
vue.createTextVNode(vue.toDisplayString(option.text), 1)
|
|
3397
3399
|
]),
|
|
3398
3400
|
_: 2
|
|
3399
|
-
}, 1032, ["
|
|
3401
|
+
}, 1032, ["value"]);
|
|
3400
3402
|
}), 128))
|
|
3401
3403
|
]),
|
|
3402
3404
|
_: 1
|
|
@@ -3462,7 +3464,7 @@
|
|
|
3462
3464
|
}
|
|
3463
3465
|
});
|
|
3464
3466
|
|
|
3465
|
-
const _hoisted_1$
|
|
3467
|
+
const _hoisted_1$2 = { key: 2 };
|
|
3466
3468
|
const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
3467
3469
|
...{
|
|
3468
3470
|
name: "MFormSelect"
|
|
@@ -3811,7 +3813,7 @@
|
|
|
3811
3813
|
key: 1,
|
|
3812
3814
|
options: vue.unref(itemOptions)
|
|
3813
3815
|
}, null, 8, ["options"])),
|
|
3814
|
-
moreLoadingVisible.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3816
|
+
moreLoadingVisible.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, null, 512)), [
|
|
3815
3817
|
[_directive_loading, true]
|
|
3816
3818
|
]) : vue.createCommentVNode("", true)
|
|
3817
3819
|
]),
|
|
@@ -3881,8 +3883,8 @@
|
|
|
3881
3883
|
}
|
|
3882
3884
|
});
|
|
3883
3885
|
|
|
3884
|
-
const _hoisted_1$
|
|
3885
|
-
const _hoisted_2
|
|
3886
|
+
const _hoisted_1$1 = { class: "m-form-item__content" };
|
|
3887
|
+
const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "m-form-validate__warning" }, "输入内容前后有空格,是否移除空格?", -1);
|
|
3886
3888
|
const _hoisted_3 = { style: { "display": "flex", "justify-content": "flex-end" } };
|
|
3887
3889
|
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
3888
3890
|
...{
|
|
@@ -4031,15 +4033,15 @@
|
|
|
4031
4033
|
vue.createTextVNode(vue.toDisplayString(appendConfig.value.text), 1)
|
|
4032
4034
|
]),
|
|
4033
4035
|
_: 1
|
|
4034
|
-
}, 8, ["size"
|
|
4036
|
+
}, 8, ["size"])) : vue.createCommentVNode("", true)
|
|
4035
4037
|
]),
|
|
4036
4038
|
key: "0"
|
|
4037
4039
|
} : void 0
|
|
4038
4040
|
]), 1032, ["modelValue", "size", "placeholder", "disabled"])
|
|
4039
4041
|
]),
|
|
4040
4042
|
default: vue.withCtx(() => [
|
|
4041
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
4042
|
-
_hoisted_2
|
|
4043
|
+
vue.createElementVNode("div", _hoisted_1$1, [
|
|
4044
|
+
_hoisted_2,
|
|
4043
4045
|
vue.createElementVNode("div", _hoisted_3, [
|
|
4044
4046
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4045
4047
|
link: "",
|
|
@@ -4233,7 +4235,7 @@
|
|
|
4233
4235
|
}
|
|
4234
4236
|
});
|
|
4235
4237
|
|
|
4236
|
-
const _hoisted_1
|
|
4238
|
+
const _hoisted_1 = { style: { "min-height": "1px" } };
|
|
4237
4239
|
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
4238
4240
|
...{
|
|
4239
4241
|
name: "MFormDialog"
|
|
@@ -4337,7 +4339,7 @@
|
|
|
4337
4339
|
style: { "text-align": "left" }
|
|
4338
4340
|
}, {
|
|
4339
4341
|
default: vue.withCtx(() => [
|
|
4340
|
-
vue.createElementVNode("div", _hoisted_1
|
|
4342
|
+
vue.createElementVNode("div", _hoisted_1, [
|
|
4341
4343
|
vue.renderSlot(_ctx.$slots, "left")
|
|
4342
4344
|
])
|
|
4343
4345
|
]),
|
|
@@ -4400,11 +4402,10 @@
|
|
|
4400
4402
|
}
|
|
4401
4403
|
});
|
|
4402
4404
|
|
|
4403
|
-
const
|
|
4404
|
-
const _hoisted_2 = { style: { "min-height": "1px" } };
|
|
4405
|
+
const footerHeight = 60;
|
|
4405
4406
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
4406
4407
|
...{
|
|
4407
|
-
name: "
|
|
4408
|
+
name: "MFormBox"
|
|
4408
4409
|
},
|
|
4409
4410
|
__name: "FormBox",
|
|
4410
4411
|
props: {
|
|
@@ -4412,6 +4413,7 @@
|
|
|
4412
4413
|
values: { default: () => ({}) },
|
|
4413
4414
|
parentValues: {},
|
|
4414
4415
|
width: {},
|
|
4416
|
+
height: {},
|
|
4415
4417
|
labelWidth: {},
|
|
4416
4418
|
disabled: { type: Boolean },
|
|
4417
4419
|
size: {},
|
|
@@ -4421,15 +4423,26 @@
|
|
|
4421
4423
|
},
|
|
4422
4424
|
emits: ["submit", "change", "error"],
|
|
4423
4425
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
4426
|
+
const props = __props;
|
|
4424
4427
|
const emit = __emit;
|
|
4428
|
+
const style = vue.computed(() => {
|
|
4429
|
+
const style2 = {};
|
|
4430
|
+
if (typeof props.width === "number") {
|
|
4431
|
+
style2.width = `${props.width}px`;
|
|
4432
|
+
}
|
|
4433
|
+
if (typeof props.height === "number") {
|
|
4434
|
+
style2.height = `${props.height}px`;
|
|
4435
|
+
}
|
|
4436
|
+
return style2;
|
|
4437
|
+
});
|
|
4425
4438
|
const form = vue.ref();
|
|
4426
|
-
const boxBody = vue.ref();
|
|
4427
4439
|
const saveFetch = vue.ref(false);
|
|
4428
4440
|
const bodyHeight = vue.ref(0);
|
|
4429
4441
|
vue.watchEffect(() => {
|
|
4430
|
-
if (
|
|
4431
|
-
|
|
4442
|
+
if (!props.height) {
|
|
4443
|
+
return;
|
|
4432
4444
|
}
|
|
4445
|
+
bodyHeight.value = props.height - footerHeight;
|
|
4433
4446
|
});
|
|
4434
4447
|
const submitHandler = async () => {
|
|
4435
4448
|
try {
|
|
@@ -4449,67 +4462,63 @@
|
|
|
4449
4462
|
__expose({
|
|
4450
4463
|
form,
|
|
4451
4464
|
saveFetch,
|
|
4452
|
-
bodyHeight,
|
|
4453
4465
|
show,
|
|
4454
4466
|
hide
|
|
4455
4467
|
});
|
|
4456
4468
|
return (_ctx, _cache) => {
|
|
4457
|
-
return vue.openBlock(), vue.createElementBlock("div",
|
|
4469
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4470
|
+
class: "m-form-box",
|
|
4471
|
+
style: vue.normalizeStyle(style.value)
|
|
4472
|
+
}, [
|
|
4458
4473
|
vue.createElementVNode("div", {
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
class: "m-box-body"
|
|
4474
|
+
class: "m-box-body",
|
|
4475
|
+
style: vue.normalizeStyle(bodyHeight.value ? { height: `${bodyHeight.value}px` } : {})
|
|
4462
4476
|
}, [
|
|
4463
|
-
vue.createVNode(
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
_: 3
|
|
4490
|
-
}),
|
|
4491
|
-
vue.createVNode(vue.unref(design.TMagicCol), { span: 12 }, {
|
|
4492
|
-
default: vue.withCtx(() => [
|
|
4493
|
-
vue.renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
4494
|
-
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4495
|
-
type: "primary",
|
|
4496
|
-
disabled: _ctx.disabled,
|
|
4497
|
-
loading: saveFetch.value,
|
|
4498
|
-
onClick: submitHandler
|
|
4499
|
-
}, {
|
|
4500
|
-
default: vue.withCtx(() => [
|
|
4501
|
-
vue.createTextVNode(vue.toDisplayString(_ctx.confirmText), 1)
|
|
4502
|
-
]),
|
|
4503
|
-
_: 1
|
|
4504
|
-
}, 8, ["disabled", "loading"])
|
|
4505
|
-
])
|
|
4506
|
-
]),
|
|
4507
|
-
_: 3
|
|
4508
|
-
})
|
|
4477
|
+
vue.createVNode(vue.unref(design.TMagicScrollbar), null, {
|
|
4478
|
+
default: vue.withCtx(() => [
|
|
4479
|
+
vue.createVNode(_sfc_main$f, {
|
|
4480
|
+
ref_key: "form",
|
|
4481
|
+
ref: form,
|
|
4482
|
+
size: _ctx.size,
|
|
4483
|
+
disabled: _ctx.disabled,
|
|
4484
|
+
config: _ctx.config,
|
|
4485
|
+
"init-values": _ctx.values,
|
|
4486
|
+
"parent-values": _ctx.parentValues,
|
|
4487
|
+
"label-width": _ctx.labelWidth,
|
|
4488
|
+
"label-position": _ctx.labelPosition,
|
|
4489
|
+
inline: _ctx.inline,
|
|
4490
|
+
onChange: changeHandler
|
|
4491
|
+
}, null, 8, ["size", "disabled", "config", "init-values", "parent-values", "label-width", "label-position", "inline"]),
|
|
4492
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
4493
|
+
]),
|
|
4494
|
+
_: 3
|
|
4495
|
+
})
|
|
4496
|
+
], 4),
|
|
4497
|
+
vue.createElementVNode("div", {
|
|
4498
|
+
class: "dialog-footer",
|
|
4499
|
+
style: vue.normalizeStyle(`height: ${footerHeight}px`)
|
|
4500
|
+
}, [
|
|
4501
|
+
vue.createElementVNode("div", null, [
|
|
4502
|
+
vue.renderSlot(_ctx.$slots, "left")
|
|
4509
4503
|
]),
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4504
|
+
vue.createElementVNode("div", null, [
|
|
4505
|
+
vue.renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
4506
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4507
|
+
type: "primary",
|
|
4508
|
+
size: _ctx.size,
|
|
4509
|
+
disabled: _ctx.disabled,
|
|
4510
|
+
loading: saveFetch.value,
|
|
4511
|
+
onClick: submitHandler
|
|
4512
|
+
}, {
|
|
4513
|
+
default: vue.withCtx(() => [
|
|
4514
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.confirmText), 1)
|
|
4515
|
+
]),
|
|
4516
|
+
_: 1
|
|
4517
|
+
}, 8, ["size", "disabled", "loading"])
|
|
4518
|
+
])
|
|
4519
|
+
])
|
|
4520
|
+
], 4)
|
|
4521
|
+
], 4);
|
|
4513
4522
|
};
|
|
4514
4523
|
}
|
|
4515
4524
|
});
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "1.4.0-beta.2",
|
|
3
3
|
"name": "@tmagic/form",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@element-plus/icons-vue": "^2.3.1",
|
|
35
|
-
"@tmagic/design": "1.
|
|
36
|
-
"@tmagic/utils": "1.
|
|
35
|
+
"@tmagic/design": "1.4.0-beta.2",
|
|
36
|
+
"@tmagic/utils": "1.4.0-beta.2",
|
|
37
37
|
"lodash-es": "^4.17.21",
|
|
38
38
|
"sortablejs": "^1.14.0",
|
|
39
|
-
"vue": "^3.
|
|
39
|
+
"vue": "^3.4.21"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"vue": "^3.
|
|
42
|
+
"vue": "^3.4.21"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@babel/core": "^7.18.0",
|
|
@@ -47,17 +47,18 @@
|
|
|
47
47
|
"@types/node": "^18.19.0",
|
|
48
48
|
"@types/sortablejs": "^1.10.7",
|
|
49
49
|
"@vitejs/plugin-vue": "^4.5.2",
|
|
50
|
-
"@vue/compiler-sfc": "^3.
|
|
51
|
-
"@vue/test-utils": "^2.
|
|
50
|
+
"@vue/compiler-sfc": "^3.4.21",
|
|
51
|
+
"@vue/test-utils": "^2.4.4",
|
|
52
52
|
"rimraf": "^3.0.2",
|
|
53
53
|
"sass": "^1.35.1",
|
|
54
|
-
"typescript": "^5.
|
|
55
|
-
"vite": "^5.
|
|
56
|
-
"vue-tsc": "^
|
|
54
|
+
"typescript": "^5.4.2",
|
|
55
|
+
"vite": "^5.1.6",
|
|
56
|
+
"vue-tsc": "^2.0.6"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "npm run build:type && vite build",
|
|
60
60
|
"build:type": "npm run clear:type && vue-tsc --declaration --emitDeclarationOnly --project tsconfig.build.json",
|
|
61
|
-
"clear:type": "rimraf ./types"
|
|
61
|
+
"clear:type": "rimraf ./types",
|
|
62
|
+
"type:check": "vue-tsc --noEmit"
|
|
62
63
|
}
|
|
63
64
|
}
|