@tmagic/form 1.0.6 → 1.1.0-beta.10
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.es.js → tmagic-form.mjs} +225 -190
- package/dist/tmagic-form.mjs.map +1 -0
- package/dist/tmagic-form.umd.js +239 -204
- package/dist/tmagic-form.umd.js.map +1 -1
- package/package.json +17 -16
- package/src/Form.vue +3 -7
- package/src/containers/Container.vue +1 -1
- package/src/containers/GroupListItem.vue +4 -4
- package/src/containers/Panel.vue +1 -1
- package/src/containers/Table.vue +1 -1
- package/src/fields/Cascader.vue +3 -5
- package/src/fields/ColorPicker.vue +19 -26
- package/src/fields/Daterange.vue +73 -52
- package/src/fields/Display.vue +13 -23
- package/src/fields/Hidden.vue +10 -20
- package/src/fields/Select.vue +1 -2
- package/src/fields/Text.vue +6 -4
- package/src/index.ts +4 -4
- package/tsconfig.build.json +13 -0
- package/types/Form.vue.d.ts +125 -0
- package/types/FormDialog.vue.d.ts +300 -0
- package/{dist/types/src → types}/containers/Col.vue.d.ts +4 -4
- package/types/containers/Container.vue.d.ts +70 -0
- package/types/containers/Fieldset.vue.d.ts +118 -0
- package/{dist/types/src → types}/containers/GroupList.vue.d.ts +6 -6
- package/{dist/types/src → types}/containers/GroupListItem.vue.d.ts +15 -15
- package/{dist/types/src → types}/containers/Panel.vue.d.ts +6 -6
- package/{dist/types/src → types}/containers/Row.vue.d.ts +3 -3
- package/{dist/types/src → types}/containers/Step.vue.d.ts +4 -4
- package/types/containers/Table.vue.d.ts +128 -0
- package/{dist/types/src → types}/containers/Tabs.vue.d.ts +11 -7
- package/types/fields/Cascader.vue.d.ts +74 -0
- package/{dist/types/src → types}/fields/Checkbox.vue.d.ts +5 -5
- package/{dist/types/src → types}/fields/CheckboxGroup.vue.d.ts +3 -3
- package/types/fields/ColorPicker.vue.d.ts +100 -0
- package/{dist/types/src → types}/fields/Date.vue.d.ts +3 -3
- package/{dist/types/src → types}/fields/DateTime.vue.d.ts +3 -3
- package/types/fields/Daterange.vue.d.ts +100 -0
- package/types/fields/Display.vue.d.ts +84 -0
- package/{dist/types/src → types}/fields/DynamicField.vue.d.ts +4 -4
- package/types/fields/Hidden.vue.d.ts +84 -0
- package/types/fields/Link.vue.d.ts +686 -0
- package/{dist/types/src → types}/fields/Number.vue.d.ts +3 -3
- package/{dist/types/src → types}/fields/RadioGroup.vue.d.ts +4 -5
- package/types/fields/Select.vue.d.ts +67 -0
- package/types/fields/SelectOptionGroups.vue.d.ts +64 -0
- package/types/fields/SelectOptions.vue.d.ts +68 -0
- package/{dist/types/src → types}/fields/Switch.vue.d.ts +6 -6
- package/{dist/types/src → types}/fields/Text.vue.d.ts +4 -4
- package/{dist/types/src → types}/fields/Textarea.vue.d.ts +10 -4
- package/{dist/types/src → types}/fields/Time.vue.d.ts +8 -4
- package/{dist/types/src → types}/index.d.ts +1 -0
- package/{dist/types/src → types}/schema.d.ts +0 -0
- package/{dist/types/src → types}/utils/config.d.ts +0 -0
- package/types/utils/containerProps.d.ts +26 -0
- package/types/utils/createForm.d.ts +3 -0
- package/{dist/types/src → types}/utils/fieldProps.d.ts +0 -0
- package/{dist/types/src → types}/utils/form.d.ts +0 -0
- package/types/utils/useAddField.d.ts +1 -0
- package/dist/tmagic-form.es.js.map +0 -1
- package/dist/types/src/containers/Container.vue.d.ts +0 -70
- package/dist/types/src/containers/Fieldset.vue.d.ts +0 -79
- package/dist/types/src/containers/Table.vue.d.ts +0 -128
- package/dist/types/src/fields/Daterange.vue.d.ts +0 -57
- package/dist/types/src/fields/Display.vue.d.ts +0 -3
- package/dist/types/src/fields/Hidden.vue.d.ts +0 -3
- package/dist/types/src/fields/SelectOptionGroups.vue.d.ts +0 -13
- package/dist/types/src/fields/SelectOptions.vue.d.ts +0 -21
- package/dist/types/src/shims-vue.d.ts +0 -6
- package/dist/types/src/utils/useAddField.d.ts +0 -1
- package/dist/types/src/vite-env.d.ts +0 -1
- package/src/vite-env.d.ts +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { toRaw, defineComponent, inject, ref, computed, resolveComponent, watchEffect, openBlock, createElementBlock, normalizeStyle, normalizeClass, createBlock, resolveDynamicComponent, Fragment, createVNode, withCtx, createElementVNode, createCommentVNode, renderList, createTextVNode, toDisplayString, watch, unref, withDirectives, vShow, renderSlot, onMounted, toRefs, getCurrentInstance, reactive, onBeforeUnmount, vModelText, onBeforeMount, resolveDirective, createSlots, withModifiers, provide } from 'vue';
|
|
2
|
-
import { WarningFilled, CaretRight,
|
|
2
|
+
import { WarningFilled, CaretBottom, CaretRight, CaretTop, Delete, ArrowDown, ArrowUp, FullScreen, Grid } from '@element-plus/icons-vue';
|
|
3
3
|
import { cloneDeep, isEqual } from 'lodash-es';
|
|
4
4
|
import { ElMessage } from 'element-plus';
|
|
5
5
|
import Sortable from 'sortablejs';
|
|
6
|
-
import { asyncLoadJs, sleep, datetimeFormatter } from '@tmagic/utils';
|
|
6
|
+
import { asyncLoadJs, sleep, datetimeFormatter, isNumber } from '@tmagic/utils';
|
|
7
7
|
|
|
8
8
|
const isTableSelect = (type) => typeof type === "string" && ["table-select", "tableSelect"].includes(type);
|
|
9
9
|
const asyncLoadConfig = (value, initValue2, { asyncLoad, name, type }) => {
|
|
@@ -158,15 +158,7 @@ const initValue = async (mForm, { initValues, config }) => {
|
|
|
158
158
|
return valuesTmp || {};
|
|
159
159
|
};
|
|
160
160
|
|
|
161
|
-
|
|
162
|
-
const target = sfc.__vccOpts || sfc;
|
|
163
|
-
for (const [key, val] of props) {
|
|
164
|
-
target[key] = val;
|
|
165
|
-
}
|
|
166
|
-
return target;
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
const _sfc_main$v = defineComponent({
|
|
161
|
+
const _sfc_main$u = defineComponent({
|
|
170
162
|
name: "m-form-container",
|
|
171
163
|
components: { WarningFilled },
|
|
172
164
|
props: {
|
|
@@ -311,7 +303,16 @@ const _sfc_main$v = defineComponent({
|
|
|
311
303
|
};
|
|
312
304
|
}
|
|
313
305
|
});
|
|
314
|
-
|
|
306
|
+
|
|
307
|
+
const _export_sfc = (sfc, props) => {
|
|
308
|
+
const target = sfc.__vccOpts || sfc;
|
|
309
|
+
for (const [key, val] of props) {
|
|
310
|
+
target[key] = val;
|
|
311
|
+
}
|
|
312
|
+
return target;
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
const _hoisted_1$c = ["innerHTML"];
|
|
315
316
|
const _hoisted_2$7 = ["innerHTML"];
|
|
316
317
|
const _hoisted_3$7 = ["innerHTML"];
|
|
317
318
|
const _hoisted_4$6 = ["innerHTML"];
|
|
@@ -319,7 +320,7 @@ const _hoisted_5$4 = {
|
|
|
319
320
|
key: 4,
|
|
320
321
|
style: { "text-align": "center" }
|
|
321
322
|
};
|
|
322
|
-
function _sfc_render$
|
|
323
|
+
function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
323
324
|
const _component_m_fields_hidden = resolveComponent("m-fields-hidden");
|
|
324
325
|
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
325
326
|
const _component_el_form_item = resolveComponent("el-form-item");
|
|
@@ -361,7 +362,7 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
361
362
|
label: withCtx(() => [
|
|
362
363
|
createElementVNode("span", {
|
|
363
364
|
innerHTML: _ctx.type === "checkbox" ? "" : _ctx.config.text
|
|
364
|
-
}, null, 8, _hoisted_1$
|
|
365
|
+
}, null, 8, _hoisted_1$c)
|
|
365
366
|
]),
|
|
366
367
|
default: withCtx(() => [
|
|
367
368
|
_ctx.tooltip ? (openBlock(), createBlock(_component_el_tooltip, { key: 0 }, {
|
|
@@ -446,9 +447,9 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
446
447
|
])) : createCommentVNode("", true)
|
|
447
448
|
], 6)) : createCommentVNode("", true);
|
|
448
449
|
}
|
|
449
|
-
|
|
450
|
+
const Container = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$o]]);
|
|
450
451
|
|
|
451
|
-
const _hoisted_1$
|
|
452
|
+
const _hoisted_1$b = ["innerHTML"];
|
|
452
453
|
const _hoisted_2$6 = ["innerHTML"];
|
|
453
454
|
const _hoisted_3$6 = { key: 1 };
|
|
454
455
|
const _hoisted_4$5 = ["innerHTML"];
|
|
@@ -459,7 +460,7 @@ const _hoisted_6$2 = {
|
|
|
459
460
|
};
|
|
460
461
|
const _hoisted_7$2 = { style: { "flex": "1" } };
|
|
461
462
|
const _hoisted_8$1 = ["src"];
|
|
462
|
-
const _sfc_main$
|
|
463
|
+
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
463
464
|
__name: "Fieldset",
|
|
464
465
|
props: {
|
|
465
466
|
labelWidth: null,
|
|
@@ -515,7 +516,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
515
516
|
default: withCtx(() => [
|
|
516
517
|
createElementVNode("span", {
|
|
517
518
|
innerHTML: __props.config.legend
|
|
518
|
-
}, null, 8, _hoisted_1$
|
|
519
|
+
}, null, 8, _hoisted_1$b),
|
|
519
520
|
__props.config.extra ? (openBlock(), createElementBlock("span", {
|
|
520
521
|
key: 0,
|
|
521
522
|
innerHTML: __props.config.extra,
|
|
@@ -572,9 +573,9 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
572
573
|
}
|
|
573
574
|
});
|
|
574
575
|
|
|
575
|
-
const _sfc_main$
|
|
576
|
+
const _sfc_main$s = defineComponent({
|
|
576
577
|
name: "m-form-group-list-item",
|
|
577
|
-
components: { CaretRight,
|
|
578
|
+
components: { CaretBottom, CaretRight, CaretTop },
|
|
578
579
|
props: {
|
|
579
580
|
labelWidth: String,
|
|
580
581
|
model: {
|
|
@@ -656,26 +657,26 @@ const _sfc_main$t = defineComponent({
|
|
|
656
657
|
};
|
|
657
658
|
}
|
|
658
659
|
});
|
|
659
|
-
|
|
660
|
+
|
|
661
|
+
const _hoisted_1$a = { class: "m-fields-group-list-item" };
|
|
660
662
|
const _hoisted_2$5 = /* @__PURE__ */ createTextVNode("\u4E0A\u79FB");
|
|
661
663
|
const _hoisted_3$5 = /* @__PURE__ */ createTextVNode("\u4E0B\u79FB");
|
|
662
664
|
const _hoisted_4$4 = ["innerHTML"];
|
|
663
|
-
function _sfc_render$
|
|
664
|
-
const
|
|
665
|
-
const
|
|
665
|
+
function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
666
|
+
const _component_CaretBottom = resolveComponent("CaretBottom");
|
|
667
|
+
const _component_CaretRight = resolveComponent("CaretRight");
|
|
666
668
|
const _component_el_icon = resolveComponent("el-icon");
|
|
667
669
|
const _component_el_button = resolveComponent("el-button");
|
|
668
|
-
const
|
|
669
|
-
const _component_CaretBottom = resolveComponent("CaretBottom");
|
|
670
|
+
const _component_CaretTop = resolveComponent("CaretTop");
|
|
670
671
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
671
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
672
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
672
673
|
createElementVNode("div", null, [
|
|
673
674
|
createVNode(_component_el_icon, {
|
|
674
675
|
style: { "margin-right": "7px" },
|
|
675
676
|
onClick: _ctx.expandHandler
|
|
676
677
|
}, {
|
|
677
678
|
default: withCtx(() => [
|
|
678
|
-
_ctx.expand ? (openBlock(), createBlock(
|
|
679
|
+
_ctx.expand ? (openBlock(), createBlock(_component_CaretBottom, { key: 0 })) : (openBlock(), createBlock(_component_CaretRight, { key: 1 }))
|
|
679
680
|
]),
|
|
680
681
|
_: 1
|
|
681
682
|
}, 8, ["onClick"]),
|
|
@@ -706,7 +707,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
706
707
|
_hoisted_2$5,
|
|
707
708
|
createVNode(_component_el_icon, null, {
|
|
708
709
|
default: withCtx(() => [
|
|
709
|
-
createVNode(
|
|
710
|
+
createVNode(_component_CaretTop)
|
|
710
711
|
]),
|
|
711
712
|
_: 1
|
|
712
713
|
})
|
|
@@ -751,9 +752,9 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
751
752
|
}, null, 8, ["config", "model", "labelWidth", "prop", "size", "onChange"])) : createCommentVNode("", true)
|
|
752
753
|
]);
|
|
753
754
|
}
|
|
754
|
-
|
|
755
|
+
const MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$n]]);
|
|
755
756
|
|
|
756
|
-
const _sfc_main$
|
|
757
|
+
const _sfc_main$r = defineComponent({
|
|
757
758
|
name: "m-form-group-list",
|
|
758
759
|
components: { MFieldsGroupListItem },
|
|
759
760
|
props: {
|
|
@@ -849,7 +850,8 @@ const _sfc_main$s = defineComponent({
|
|
|
849
850
|
};
|
|
850
851
|
}
|
|
851
852
|
});
|
|
852
|
-
|
|
853
|
+
|
|
854
|
+
const _hoisted_1$9 = { class: "m-fields-group-list" };
|
|
853
855
|
const _hoisted_2$4 = ["innerHTML"];
|
|
854
856
|
const _hoisted_3$4 = {
|
|
855
857
|
key: 1,
|
|
@@ -861,10 +863,10 @@ const _hoisted_5$2 = [
|
|
|
861
863
|
];
|
|
862
864
|
const _hoisted_6$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0\u7EC4");
|
|
863
865
|
const _hoisted_7$1 = /* @__PURE__ */ createTextVNode("\u5207\u6362\u4E3A\u8868\u683C");
|
|
864
|
-
function _sfc_render$
|
|
866
|
+
function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
865
867
|
const _component_m_fields_group_list_item = resolveComponent("m-fields-group-list-item");
|
|
866
868
|
const _component_el_button = resolveComponent("el-button");
|
|
867
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
869
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
868
870
|
_ctx.config.extra ? (openBlock(), createElementBlock("div", {
|
|
869
871
|
key: 0,
|
|
870
872
|
innerHTML: _ctx.config.extra,
|
|
@@ -908,9 +910,9 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
908
910
|
}, 8, ["onClick"])) : createCommentVNode("", true)
|
|
909
911
|
]);
|
|
910
912
|
}
|
|
911
|
-
|
|
913
|
+
const GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$m]]);
|
|
912
914
|
|
|
913
|
-
const _sfc_main$
|
|
915
|
+
const _sfc_main$q = defineComponent({
|
|
914
916
|
name: "m-form-panel",
|
|
915
917
|
components: { CaretBottom, CaretRight },
|
|
916
918
|
props: {
|
|
@@ -943,7 +945,8 @@ const _sfc_main$r = defineComponent({
|
|
|
943
945
|
};
|
|
944
946
|
}
|
|
945
947
|
});
|
|
946
|
-
|
|
948
|
+
|
|
949
|
+
const _hoisted_1$8 = { class: "clearfix" };
|
|
947
950
|
const _hoisted_2$3 = ["innerHTML"];
|
|
948
951
|
const _hoisted_3$3 = {
|
|
949
952
|
key: 0,
|
|
@@ -951,7 +954,7 @@ const _hoisted_3$3 = {
|
|
|
951
954
|
};
|
|
952
955
|
const _hoisted_4$2 = { style: { "flex": "1" } };
|
|
953
956
|
const _hoisted_5$1 = ["src"];
|
|
954
|
-
function _sfc_render$
|
|
957
|
+
function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
955
958
|
const _component_caret_bottom = resolveComponent("caret-bottom");
|
|
956
959
|
const _component_caret_right = resolveComponent("caret-right");
|
|
957
960
|
const _component_el_icon = resolveComponent("el-icon");
|
|
@@ -963,7 +966,7 @@ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
963
966
|
"body-style": { display: _ctx.expand ? "block" : "none" }
|
|
964
967
|
}, {
|
|
965
968
|
header: withCtx(() => [
|
|
966
|
-
createElementVNode("div", _hoisted_1$
|
|
969
|
+
createElementVNode("div", _hoisted_1$8, [
|
|
967
970
|
createElementVNode("a", {
|
|
968
971
|
href: "javascript:",
|
|
969
972
|
style: { "width": "100%", "display": "block" },
|
|
@@ -1021,9 +1024,9 @@ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1021
1024
|
_: 3
|
|
1022
1025
|
}, 8, ["body-style"])) : createCommentVNode("", true);
|
|
1023
1026
|
}
|
|
1024
|
-
|
|
1027
|
+
const Panel = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$l]]);
|
|
1025
1028
|
|
|
1026
|
-
const _sfc_main$
|
|
1029
|
+
const _sfc_main$p = defineComponent({
|
|
1027
1030
|
props: {
|
|
1028
1031
|
labelWidth: String,
|
|
1029
1032
|
expandMore: Boolean,
|
|
@@ -1050,7 +1053,8 @@ const _sfc_main$q = defineComponent({
|
|
|
1050
1053
|
};
|
|
1051
1054
|
}
|
|
1052
1055
|
});
|
|
1053
|
-
|
|
1056
|
+
|
|
1057
|
+
function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1054
1058
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
1055
1059
|
const _component_el_col = resolveComponent("el-col");
|
|
1056
1060
|
return withDirectives((openBlock(), createBlock(_component_el_col, { span: _ctx.span }, {
|
|
@@ -1070,9 +1074,9 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1070
1074
|
[vShow, _ctx.display && _ctx.config.type !== "hidden"]
|
|
1071
1075
|
]);
|
|
1072
1076
|
}
|
|
1073
|
-
|
|
1077
|
+
const Col = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$k]]);
|
|
1074
1078
|
|
|
1075
|
-
const _sfc_main$
|
|
1079
|
+
const _sfc_main$o = defineComponent({
|
|
1076
1080
|
name: "m-form-row",
|
|
1077
1081
|
components: { Col },
|
|
1078
1082
|
props: {
|
|
@@ -1100,7 +1104,8 @@ const _sfc_main$p = defineComponent({
|
|
|
1100
1104
|
};
|
|
1101
1105
|
}
|
|
1102
1106
|
});
|
|
1103
|
-
|
|
1107
|
+
|
|
1108
|
+
function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1104
1109
|
const _component_Col = resolveComponent("Col");
|
|
1105
1110
|
const _component_el_row = resolveComponent("el-row");
|
|
1106
1111
|
return openBlock(), createBlock(_component_el_row, { gutter: 10 }, {
|
|
@@ -1122,9 +1127,9 @@ function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1122
1127
|
_: 1
|
|
1123
1128
|
});
|
|
1124
1129
|
}
|
|
1125
|
-
|
|
1130
|
+
const Row = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$j]]);
|
|
1126
1131
|
|
|
1127
|
-
const _sfc_main$
|
|
1132
|
+
const _sfc_main$n = defineComponent({
|
|
1128
1133
|
name: "m-form-step",
|
|
1129
1134
|
props: {
|
|
1130
1135
|
model: {
|
|
@@ -1159,7 +1164,8 @@ const _sfc_main$o = defineComponent({
|
|
|
1159
1164
|
return { mForm, active, stepClick, changeHandler };
|
|
1160
1165
|
}
|
|
1161
1166
|
});
|
|
1162
|
-
|
|
1167
|
+
|
|
1168
|
+
function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1163
1169
|
const _component_el_step = resolveComponent("el-step");
|
|
1164
1170
|
const _component_el_steps = resolveComponent("el-steps");
|
|
1165
1171
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
@@ -1202,11 +1208,11 @@ function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1202
1208
|
}), 256))
|
|
1203
1209
|
]);
|
|
1204
1210
|
}
|
|
1205
|
-
|
|
1211
|
+
const MStep = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$i]]);
|
|
1206
1212
|
|
|
1207
1213
|
let loadedAMapJS = false;
|
|
1208
1214
|
let firstLoadingAMapJS = true;
|
|
1209
|
-
const _sfc_main$
|
|
1215
|
+
const _sfc_main$m = defineComponent({
|
|
1210
1216
|
name: "m-form-table",
|
|
1211
1217
|
props: {
|
|
1212
1218
|
name: {
|
|
@@ -1575,7 +1581,8 @@ const _sfc_main$n = defineComponent({
|
|
|
1575
1581
|
};
|
|
1576
1582
|
}
|
|
1577
1583
|
});
|
|
1578
|
-
|
|
1584
|
+
|
|
1585
|
+
const _hoisted_1$7 = ["innerHTML"];
|
|
1579
1586
|
const _hoisted_2$2 = { class: "el-form-item__content" };
|
|
1580
1587
|
const _hoisted_3$2 = ["innerHTML"];
|
|
1581
1588
|
const _hoisted_4$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0");
|
|
@@ -1588,7 +1595,7 @@ const _hoisted_10 = {
|
|
|
1588
1595
|
class: "bottom",
|
|
1589
1596
|
style: { "text-align": "right" }
|
|
1590
1597
|
};
|
|
1591
|
-
function _sfc_render$
|
|
1598
|
+
function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1592
1599
|
const _component_el_table_column = resolveComponent("el-table-column");
|
|
1593
1600
|
const _component_el_button = resolveComponent("el-button");
|
|
1594
1601
|
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
@@ -1604,7 +1611,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1604
1611
|
key: 0,
|
|
1605
1612
|
style: { "color": "rgba(0, 0, 0, 0.45)" },
|
|
1606
1613
|
innerHTML: _ctx.config.extra
|
|
1607
|
-
}, null, 8, _hoisted_1$
|
|
1614
|
+
}, null, 8, _hoisted_1$7)) : createCommentVNode("", true),
|
|
1608
1615
|
createElementVNode("div", _hoisted_2$2, [
|
|
1609
1616
|
createVNode(_component_el_tooltip, {
|
|
1610
1617
|
content: "\u62D6\u62FD\u53EF\u6392\u5E8F",
|
|
@@ -1837,7 +1844,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1837
1844
|
])
|
|
1838
1845
|
], 2);
|
|
1839
1846
|
}
|
|
1840
|
-
|
|
1847
|
+
const Table = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$h]]);
|
|
1841
1848
|
|
|
1842
1849
|
const getActive = (mForm, props, activeTabName) => {
|
|
1843
1850
|
const { config, model, prop } = props;
|
|
@@ -1956,8 +1963,8 @@ const Tab = defineComponent({
|
|
|
1956
1963
|
};
|
|
1957
1964
|
}
|
|
1958
1965
|
});
|
|
1959
|
-
|
|
1960
|
-
function _sfc_render$
|
|
1966
|
+
|
|
1967
|
+
function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1961
1968
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
1962
1969
|
const _component_el_tab_pane = resolveComponent("el-tab-pane");
|
|
1963
1970
|
const _component_el_tabs = resolveComponent("el-tabs");
|
|
@@ -2003,7 +2010,7 @@ function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2003
2010
|
_: 1
|
|
2004
2011
|
}, 8, ["modelValue", "class", "type", "editable", "tab-position", "onTabClick", "onTabAdd", "onTabRemove"]);
|
|
2005
2012
|
}
|
|
2006
|
-
|
|
2013
|
+
const Tabs = /* @__PURE__ */ _export_sfc(Tab, [["render", _sfc_render$g]]);
|
|
2007
2014
|
|
|
2008
2015
|
let $MAGIC_FORM = {};
|
|
2009
2016
|
const setConfig = (option) => {
|
|
@@ -2011,7 +2018,7 @@ const setConfig = (option) => {
|
|
|
2011
2018
|
};
|
|
2012
2019
|
const getConfig = (key) => $MAGIC_FORM[key];
|
|
2013
2020
|
|
|
2014
|
-
|
|
2021
|
+
const fieldProps = {
|
|
2015
2022
|
model: {
|
|
2016
2023
|
type: Object,
|
|
2017
2024
|
required: true,
|
|
@@ -2062,8 +2069,8 @@ const _sfc_main$l = defineComponent({
|
|
|
2062
2069
|
const vm = getCurrentInstance();
|
|
2063
2070
|
useAddField(props.prop);
|
|
2064
2071
|
const requestFunc = getConfig("request");
|
|
2065
|
-
const cascader = ref(
|
|
2066
|
-
const dialog = ref(
|
|
2072
|
+
const cascader = ref();
|
|
2073
|
+
const dialog = ref();
|
|
2067
2074
|
const options = Array.isArray(props.config.options) ? ref(props.config.options) : ref([]);
|
|
2068
2075
|
const remoteData = ref(null);
|
|
2069
2076
|
const setRemoteOptions = async function() {
|
|
@@ -2140,13 +2147,14 @@ const _sfc_main$l = defineComponent({
|
|
|
2140
2147
|
};
|
|
2141
2148
|
}
|
|
2142
2149
|
});
|
|
2143
|
-
|
|
2150
|
+
|
|
2151
|
+
const _hoisted_1$6 = {
|
|
2144
2152
|
class: "m-cascader",
|
|
2145
2153
|
style: { "width": "100%" }
|
|
2146
2154
|
};
|
|
2147
|
-
function _sfc_render$
|
|
2155
|
+
function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2148
2156
|
const _component_el_cascader = resolveComponent("el-cascader");
|
|
2149
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2157
|
+
return openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
2150
2158
|
createVNode(_component_el_cascader, {
|
|
2151
2159
|
modelValue: _ctx.model[_ctx.name],
|
|
2152
2160
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2163,7 +2171,7 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2163
2171
|
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "options", "props", "onChange"])
|
|
2164
2172
|
]);
|
|
2165
2173
|
}
|
|
2166
|
-
|
|
2174
|
+
const Cascader = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$f]]);
|
|
2167
2175
|
|
|
2168
2176
|
const _sfc_main$k = defineComponent({
|
|
2169
2177
|
name: "m-fields-checkbox",
|
|
@@ -2204,7 +2212,8 @@ const _sfc_main$k = defineComponent({
|
|
|
2204
2212
|
};
|
|
2205
2213
|
}
|
|
2206
2214
|
});
|
|
2207
|
-
|
|
2215
|
+
|
|
2216
|
+
function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2208
2217
|
const _component_el_checkbox = resolveComponent("el-checkbox");
|
|
2209
2218
|
return openBlock(), createBlock(_component_el_checkbox, {
|
|
2210
2219
|
modelValue: _ctx.model[_ctx.name],
|
|
@@ -2217,7 +2226,7 @@ function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2217
2226
|
onChange: _ctx.changeHandler
|
|
2218
2227
|
}, null, 8, ["modelValue", "size", "trueLabel", "falseLabel", "disabled", "label", "onChange"]);
|
|
2219
2228
|
}
|
|
2220
|
-
|
|
2229
|
+
const Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$e]]);
|
|
2221
2230
|
|
|
2222
2231
|
const _sfc_main$j = defineComponent({
|
|
2223
2232
|
name: "m-fields-checkbox-group",
|
|
@@ -2241,7 +2250,8 @@ const _sfc_main$j = defineComponent({
|
|
|
2241
2250
|
};
|
|
2242
2251
|
}
|
|
2243
2252
|
});
|
|
2244
|
-
|
|
2253
|
+
|
|
2254
|
+
function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2245
2255
|
const _component_el_checkbox = resolveComponent("el-checkbox");
|
|
2246
2256
|
const _component_el_checkbox_group = resolveComponent("el-checkbox-group");
|
|
2247
2257
|
return openBlock(), createBlock(_component_el_checkbox_group, {
|
|
@@ -2267,20 +2277,19 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2267
2277
|
_: 1
|
|
2268
2278
|
}, 8, ["modelValue", "size", "disabled", "onChange"]);
|
|
2269
2279
|
}
|
|
2270
|
-
|
|
2280
|
+
const CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$d]]);
|
|
2271
2281
|
|
|
2272
|
-
const _hoisted_1$6 = { key: 0 };
|
|
2273
|
-
const __default__$2 = defineComponent({
|
|
2274
|
-
name: "m-fields-color-picker"
|
|
2275
|
-
});
|
|
2276
2282
|
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
2277
|
-
|
|
2283
|
+
__name: "ColorPicker",
|
|
2278
2284
|
props: {
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2285
|
+
config: null,
|
|
2286
|
+
model: null,
|
|
2287
|
+
initValues: null,
|
|
2288
|
+
values: null,
|
|
2289
|
+
name: null,
|
|
2290
|
+
prop: null,
|
|
2291
|
+
disabled: { type: Boolean },
|
|
2292
|
+
size: null
|
|
2284
2293
|
},
|
|
2285
2294
|
emits: ["change"],
|
|
2286
2295
|
setup(__props, { emit }) {
|
|
@@ -2289,16 +2298,14 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2289
2298
|
const changeHandler = (value) => emit("change", value);
|
|
2290
2299
|
return (_ctx, _cache) => {
|
|
2291
2300
|
const _component_el_color_picker = resolveComponent("el-color-picker");
|
|
2292
|
-
return
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
}, null, 8, ["modelValue", "size", "disabled"])
|
|
2301
|
-
])) : createCommentVNode("", true);
|
|
2301
|
+
return openBlock(), createBlock(_component_el_color_picker, {
|
|
2302
|
+
modelValue: __props.model[__props.name],
|
|
2303
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
2304
|
+
size: __props.size,
|
|
2305
|
+
disabled: __props.disabled,
|
|
2306
|
+
showAlpha: true,
|
|
2307
|
+
onChange: changeHandler
|
|
2308
|
+
}, null, 8, ["modelValue", "size", "disabled"]);
|
|
2302
2309
|
};
|
|
2303
2310
|
}
|
|
2304
2311
|
});
|
|
@@ -2323,7 +2330,8 @@ const _sfc_main$h = defineComponent({
|
|
|
2323
2330
|
};
|
|
2324
2331
|
}
|
|
2325
2332
|
});
|
|
2326
|
-
|
|
2333
|
+
|
|
2334
|
+
function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2327
2335
|
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
2328
2336
|
return openBlock(), createBlock(_component_el_date_picker, {
|
|
2329
2337
|
modelValue: _ctx.model[_ctx.name],
|
|
@@ -2337,74 +2345,95 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2337
2345
|
onChange: _ctx.changeHandler
|
|
2338
2346
|
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "format", "value-format", "onChange"]);
|
|
2339
2347
|
}
|
|
2340
|
-
|
|
2348
|
+
const Date$1 = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$c]]);
|
|
2341
2349
|
|
|
2342
|
-
const _sfc_main$g = defineComponent({
|
|
2343
|
-
|
|
2350
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
2351
|
+
__name: "Daterange",
|
|
2344
2352
|
props: {
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2353
|
+
config: null,
|
|
2354
|
+
model: null,
|
|
2355
|
+
initValues: null,
|
|
2356
|
+
values: null,
|
|
2357
|
+
name: null,
|
|
2358
|
+
prop: null,
|
|
2359
|
+
disabled: { type: Boolean },
|
|
2360
|
+
size: null
|
|
2350
2361
|
},
|
|
2351
2362
|
emits: ["change"],
|
|
2352
|
-
setup(
|
|
2363
|
+
setup(__props, { emit }) {
|
|
2364
|
+
const props = __props;
|
|
2353
2365
|
useAddField(props.prop);
|
|
2354
2366
|
const { names } = props.config;
|
|
2355
2367
|
const value = ref([]);
|
|
2356
2368
|
if (props.model !== void 0) {
|
|
2357
2369
|
if (names?.length) {
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
}
|
|
2362
|
-
}
|
|
2363
|
-
const setValue = (v) => {
|
|
2364
|
-
if (names?.length && v instanceof Array) {
|
|
2365
|
-
names.forEach((item, index) => {
|
|
2366
|
-
if (props.model) {
|
|
2367
|
-
props.model[item] = datetimeFormatter(v[index].toString(), "");
|
|
2370
|
+
watch([() => props.model[names[0]], () => props.model[names[1]]], ([start, end], [preStart, preEnd]) => {
|
|
2371
|
+
if (!value.value) {
|
|
2372
|
+
value.value = [];
|
|
2368
2373
|
}
|
|
2374
|
+
if (!start || !end)
|
|
2375
|
+
value.value = [];
|
|
2376
|
+
if (start !== preStart)
|
|
2377
|
+
value.value[0] = new Date(start);
|
|
2378
|
+
if (end !== preEnd)
|
|
2379
|
+
value.value[1] = new Date(end);
|
|
2380
|
+
}, {
|
|
2381
|
+
immediate: true
|
|
2369
2382
|
});
|
|
2370
|
-
} else if (props.
|
|
2371
|
-
props.model[props.name]
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
}
|
|
2383
|
+
} else if (props.name && props.model[props.name]) {
|
|
2384
|
+
watch(() => props.model[props.name], (start, preStart) => {
|
|
2385
|
+
if (start !== preStart)
|
|
2386
|
+
value.value = start.map((item) => item ? new Date(item) : void 0);
|
|
2387
|
+
}, {
|
|
2388
|
+
immediate: true
|
|
2377
2389
|
});
|
|
2378
|
-
} else if (props.name) {
|
|
2379
|
-
props.model[props.name] = void 0;
|
|
2380
2390
|
}
|
|
2391
|
+
}
|
|
2392
|
+
const setValue = (v) => {
|
|
2393
|
+
names?.forEach((item, index) => {
|
|
2394
|
+
if (!props.model) {
|
|
2395
|
+
return;
|
|
2396
|
+
}
|
|
2397
|
+
if (Array.isArray(v)) {
|
|
2398
|
+
props.model[item] = datetimeFormatter(v[index]?.toString(), "");
|
|
2399
|
+
} else {
|
|
2400
|
+
props.model[item] = void 0;
|
|
2401
|
+
}
|
|
2402
|
+
});
|
|
2381
2403
|
};
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2404
|
+
const changeHandler = (v) => {
|
|
2405
|
+
const value2 = v || [];
|
|
2406
|
+
if (props.name) {
|
|
2407
|
+
emit("change", value2.map((item) => {
|
|
2408
|
+
if (item)
|
|
2409
|
+
return datetimeFormatter(item, "");
|
|
2410
|
+
return void 0;
|
|
2411
|
+
}));
|
|
2412
|
+
} else {
|
|
2413
|
+
if (names?.length) {
|
|
2414
|
+
setValue(value2);
|
|
2415
|
+
}
|
|
2416
|
+
emit("change", value2);
|
|
2387
2417
|
}
|
|
2388
2418
|
};
|
|
2419
|
+
return (_ctx, _cache) => {
|
|
2420
|
+
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
2421
|
+
return openBlock(), createBlock(_component_el_date_picker, {
|
|
2422
|
+
modelValue: value.value,
|
|
2423
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
2424
|
+
type: "datetimerange",
|
|
2425
|
+
"range-separator": "-",
|
|
2426
|
+
"start-placeholder": "\u5F00\u59CB\u65E5\u671F",
|
|
2427
|
+
"end-placeholder": "\u7ED3\u675F\u65E5\u671F",
|
|
2428
|
+
size: __props.size,
|
|
2429
|
+
"unlink-panels": true,
|
|
2430
|
+
disabled: __props.disabled,
|
|
2431
|
+
"default-time": __props.config.defaultTime,
|
|
2432
|
+
onChange: changeHandler
|
|
2433
|
+
}, null, 8, ["modelValue", "size", "disabled", "default-time"]);
|
|
2434
|
+
};
|
|
2389
2435
|
}
|
|
2390
2436
|
});
|
|
2391
|
-
function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2392
|
-
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
2393
|
-
return openBlock(), createBlock(_component_el_date_picker, {
|
|
2394
|
-
modelValue: _ctx.value,
|
|
2395
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.value = $event),
|
|
2396
|
-
type: "datetimerange",
|
|
2397
|
-
"range-separator": "-",
|
|
2398
|
-
"start-placeholder": "\u5F00\u59CB\u65E5\u671F",
|
|
2399
|
-
"end-placeholder": "\u7ED3\u675F\u65E5\u671F",
|
|
2400
|
-
size: _ctx.size,
|
|
2401
|
-
"unlink-panels": true,
|
|
2402
|
-
disabled: _ctx.disabled,
|
|
2403
|
-
"default-time": _ctx.config.defaultTime,
|
|
2404
|
-
onChange: _ctx.changeHandler
|
|
2405
|
-
}, null, 8, ["modelValue", "size", "disabled", "default-time", "onChange"]);
|
|
2406
|
-
}
|
|
2407
|
-
var Daterange = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$c]]);
|
|
2408
2437
|
|
|
2409
2438
|
const _sfc_main$f = defineComponent({
|
|
2410
2439
|
name: "m-fields-datetime",
|
|
@@ -2434,6 +2463,7 @@ const _sfc_main$f = defineComponent({
|
|
|
2434
2463
|
};
|
|
2435
2464
|
}
|
|
2436
2465
|
});
|
|
2466
|
+
|
|
2437
2467
|
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2438
2468
|
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
2439
2469
|
return openBlock(), createBlock(_component_el_date_picker, {
|
|
@@ -2450,30 +2480,27 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2450
2480
|
onChange: _ctx.changeHandler
|
|
2451
2481
|
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "format", "value-format", "default-time", "onChange"]);
|
|
2452
2482
|
}
|
|
2453
|
-
|
|
2483
|
+
const DateTime = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$b]]);
|
|
2454
2484
|
|
|
2455
2485
|
const _hoisted_1$5 = { key: 0 };
|
|
2456
|
-
const __default__$1 = defineComponent({
|
|
2457
|
-
name: "m-fields-display"
|
|
2458
|
-
});
|
|
2459
2486
|
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
2460
|
-
|
|
2487
|
+
__name: "Display",
|
|
2461
2488
|
props: {
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2489
|
+
config: null,
|
|
2490
|
+
model: null,
|
|
2491
|
+
initValues: null,
|
|
2492
|
+
values: null,
|
|
2493
|
+
name: null,
|
|
2494
|
+
prop: null
|
|
2467
2495
|
},
|
|
2468
2496
|
setup(__props) {
|
|
2469
2497
|
const props = __props;
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
props.model[n.value] = props.config.initValue;
|
|
2498
|
+
if (props.config.initValue && props.model) {
|
|
2499
|
+
props.model[props.name] = props.config.initValue;
|
|
2473
2500
|
}
|
|
2474
2501
|
useAddField(props.prop);
|
|
2475
2502
|
return (_ctx, _cache) => {
|
|
2476
|
-
return
|
|
2503
|
+
return __props.model ? (openBlock(), createElementBlock("span", _hoisted_1$5, toDisplayString(__props.model[__props.name]), 1)) : createCommentVNode("", true);
|
|
2477
2504
|
};
|
|
2478
2505
|
}
|
|
2479
2506
|
});
|
|
@@ -2543,6 +2570,7 @@ const _sfc_main$d = defineComponent({
|
|
|
2543
2570
|
}
|
|
2544
2571
|
}
|
|
2545
2572
|
});
|
|
2573
|
+
|
|
2546
2574
|
const _hoisted_1$4 = { class: "m-fields-dynamic-field" };
|
|
2547
2575
|
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2548
2576
|
const _component_el_input = resolveComponent("el-input");
|
|
@@ -2572,31 +2600,28 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2572
2600
|
})
|
|
2573
2601
|
]);
|
|
2574
2602
|
}
|
|
2575
|
-
|
|
2603
|
+
const DynamicField = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$a]]);
|
|
2576
2604
|
|
|
2577
|
-
const __default__ = defineComponent({
|
|
2578
|
-
name: "m-fields-hidden"
|
|
2579
|
-
});
|
|
2580
2605
|
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
2581
|
-
|
|
2606
|
+
__name: "Hidden",
|
|
2582
2607
|
props: {
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2608
|
+
config: null,
|
|
2609
|
+
model: null,
|
|
2610
|
+
initValues: null,
|
|
2611
|
+
values: null,
|
|
2612
|
+
name: null,
|
|
2613
|
+
prop: null
|
|
2588
2614
|
},
|
|
2589
2615
|
setup(__props) {
|
|
2590
2616
|
const props = __props;
|
|
2591
|
-
const n = computed(() => props.name || props.config.name || "");
|
|
2592
2617
|
useAddField(props.prop);
|
|
2593
2618
|
return (_ctx, _cache) => {
|
|
2594
|
-
return
|
|
2619
|
+
return __props.model ? withDirectives((openBlock(), createElementBlock("input", {
|
|
2595
2620
|
key: 0,
|
|
2596
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
2621
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
2597
2622
|
type: "hidden"
|
|
2598
2623
|
}, null, 512)), [
|
|
2599
|
-
[vModelText,
|
|
2624
|
+
[vModelText, __props.model[__props.name]]
|
|
2600
2625
|
]) : createCommentVNode("", true);
|
|
2601
2626
|
};
|
|
2602
2627
|
}
|
|
@@ -2670,6 +2695,7 @@ const _sfc_main$b = defineComponent({
|
|
|
2670
2695
|
};
|
|
2671
2696
|
}
|
|
2672
2697
|
});
|
|
2698
|
+
|
|
2673
2699
|
const _hoisted_1$3 = ["href"];
|
|
2674
2700
|
const _hoisted_2$1 = {
|
|
2675
2701
|
key: 2,
|
|
@@ -2710,7 +2736,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2710
2736
|
}, null, 8, ["title", "width", "values", "config", "parentValues", "fullscreen", "onSubmit"])
|
|
2711
2737
|
]));
|
|
2712
2738
|
}
|
|
2713
|
-
|
|
2739
|
+
const Link = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$9]]);
|
|
2714
2740
|
|
|
2715
2741
|
const _sfc_main$a = defineComponent({
|
|
2716
2742
|
name: "m-fields-number",
|
|
@@ -2737,6 +2763,7 @@ const _sfc_main$a = defineComponent({
|
|
|
2737
2763
|
};
|
|
2738
2764
|
}
|
|
2739
2765
|
});
|
|
2766
|
+
|
|
2740
2767
|
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2741
2768
|
const _component_el_input_number = resolveComponent("el-input-number");
|
|
2742
2769
|
return _ctx.model ? (openBlock(), createBlock(_component_el_input_number, {
|
|
@@ -2755,7 +2782,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2755
2782
|
onInput: _ctx.inputHandler
|
|
2756
2783
|
}, null, 8, ["modelValue", "size", "max", "min", "step", "placeholder", "disabled", "onChange", "onInput"])) : createCommentVNode("", true);
|
|
2757
2784
|
}
|
|
2758
|
-
|
|
2785
|
+
const Number$1 = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$8]]);
|
|
2759
2786
|
|
|
2760
2787
|
const _sfc_main$9 = defineComponent({
|
|
2761
2788
|
name: "m-fields-radio-group",
|
|
@@ -2774,6 +2801,7 @@ const _sfc_main$9 = defineComponent({
|
|
|
2774
2801
|
};
|
|
2775
2802
|
}
|
|
2776
2803
|
});
|
|
2804
|
+
|
|
2777
2805
|
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2778
2806
|
const _component_el_radio = resolveComponent("el-radio");
|
|
2779
2807
|
const _component_el_radio_group = resolveComponent("el-radio-group");
|
|
@@ -2801,7 +2829,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2801
2829
|
_: 1
|
|
2802
2830
|
}, 8, ["modelValue", "size", "disabled", "onChange"])) : createCommentVNode("", true);
|
|
2803
2831
|
}
|
|
2804
|
-
|
|
2832
|
+
const RadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$7]]);
|
|
2805
2833
|
|
|
2806
2834
|
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
2807
2835
|
__name: "SelectOptionGroups",
|
|
@@ -3126,6 +3154,7 @@ const _sfc_main$6 = defineComponent({
|
|
|
3126
3154
|
};
|
|
3127
3155
|
}
|
|
3128
3156
|
});
|
|
3157
|
+
|
|
3129
3158
|
const _hoisted_1$2 = { key: 2 };
|
|
3130
3159
|
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3131
3160
|
const _component_select_option_groups = resolveComponent("select-option-groups");
|
|
@@ -3169,7 +3198,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3169
3198
|
[_directive_loading, _ctx.loading]
|
|
3170
3199
|
]) : createCommentVNode("", true);
|
|
3171
3200
|
}
|
|
3172
|
-
|
|
3201
|
+
const Select = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6]]);
|
|
3173
3202
|
|
|
3174
3203
|
const _sfc_main$5 = defineComponent({
|
|
3175
3204
|
name: "m-fields-switch",
|
|
@@ -3211,6 +3240,7 @@ const _sfc_main$5 = defineComponent({
|
|
|
3211
3240
|
};
|
|
3212
3241
|
}
|
|
3213
3242
|
});
|
|
3243
|
+
|
|
3214
3244
|
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3215
3245
|
const _component_el_switch = resolveComponent("el-switch");
|
|
3216
3246
|
return _ctx.model ? (openBlock(), createBlock(_component_el_switch, {
|
|
@@ -3224,7 +3254,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3224
3254
|
onChange: _ctx.changeHandler
|
|
3225
3255
|
}, null, 8, ["modelValue", "size", "activeValue", "inactiveValue", "disabled", "onChange"])) : createCommentVNode("", true);
|
|
3226
3256
|
}
|
|
3227
|
-
|
|
3257
|
+
const Switch = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]);
|
|
3228
3258
|
|
|
3229
3259
|
const _sfc_main$4 = defineComponent({
|
|
3230
3260
|
name: "m-fields-text",
|
|
@@ -3272,7 +3302,7 @@ const _sfc_main$4 = defineComponent({
|
|
|
3272
3302
|
const value = props.model[modelName.value];
|
|
3273
3303
|
let num;
|
|
3274
3304
|
let unit;
|
|
3275
|
-
if (
|
|
3305
|
+
if (isNumber(value)) {
|
|
3276
3306
|
num = +value;
|
|
3277
3307
|
} else {
|
|
3278
3308
|
value.replace(/^([0-9.]+)([a-z%]+)$/, ($0, $1, $2) => {
|
|
@@ -3284,14 +3314,14 @@ const _sfc_main$4 = defineComponent({
|
|
|
3284
3314
|
return;
|
|
3285
3315
|
}
|
|
3286
3316
|
const ctrl = navigator.platform.match("Mac") ? $event.metaKey : $event.ctrlKey;
|
|
3287
|
-
const
|
|
3317
|
+
const shift = $event.shiftKey;
|
|
3288
3318
|
const alt = $event.altKey;
|
|
3289
3319
|
if (arrowUp) {
|
|
3290
3320
|
if (ctrl) {
|
|
3291
3321
|
num += 100;
|
|
3292
3322
|
} else if (alt) {
|
|
3293
3323
|
num = (num * 1e4 + 1e3) / 1e4;
|
|
3294
|
-
} else if (
|
|
3324
|
+
} else if (shift) {
|
|
3295
3325
|
num = num + 10;
|
|
3296
3326
|
} else {
|
|
3297
3327
|
num += 1;
|
|
@@ -3301,7 +3331,7 @@ const _sfc_main$4 = defineComponent({
|
|
|
3301
3331
|
num -= 100;
|
|
3302
3332
|
} else if (alt) {
|
|
3303
3333
|
num = (num * 1e4 - 1e3) / 1e4;
|
|
3304
|
-
} else if (
|
|
3334
|
+
} else if (shift) {
|
|
3305
3335
|
num -= 10;
|
|
3306
3336
|
} else {
|
|
3307
3337
|
num -= 1;
|
|
@@ -3313,6 +3343,7 @@ const _sfc_main$4 = defineComponent({
|
|
|
3313
3343
|
};
|
|
3314
3344
|
}
|
|
3315
3345
|
});
|
|
3346
|
+
|
|
3316
3347
|
const _hoisted_1$1 = { key: 0 };
|
|
3317
3348
|
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3318
3349
|
const _component_el_button = resolveComponent("el-button");
|
|
@@ -3347,7 +3378,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3347
3378
|
} : void 0
|
|
3348
3379
|
]), 1032, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"]);
|
|
3349
3380
|
}
|
|
3350
|
-
|
|
3381
|
+
const Text = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]);
|
|
3351
3382
|
|
|
3352
3383
|
const _sfc_main$3 = defineComponent({
|
|
3353
3384
|
name: "m-fields-textarea",
|
|
@@ -3381,6 +3412,7 @@ const _sfc_main$3 = defineComponent({
|
|
|
3381
3412
|
};
|
|
3382
3413
|
}
|
|
3383
3414
|
});
|
|
3415
|
+
|
|
3384
3416
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3385
3417
|
const _component_el_input = resolveComponent("el-input");
|
|
3386
3418
|
return openBlock(), createBlock(_component_el_input, {
|
|
@@ -3395,7 +3427,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3395
3427
|
onInput: _ctx.inputHandler
|
|
3396
3428
|
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"]);
|
|
3397
3429
|
}
|
|
3398
|
-
|
|
3430
|
+
const Textarea = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
|
|
3399
3431
|
|
|
3400
3432
|
const _sfc_main$2 = defineComponent({
|
|
3401
3433
|
name: "m-fields-time",
|
|
@@ -3420,6 +3452,7 @@ const _sfc_main$2 = defineComponent({
|
|
|
3420
3452
|
};
|
|
3421
3453
|
}
|
|
3422
3454
|
});
|
|
3455
|
+
|
|
3423
3456
|
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3424
3457
|
const _component_el_time_picker = resolveComponent("el-time-picker");
|
|
3425
3458
|
return openBlock(), createBlock(_component_el_time_picker, {
|
|
@@ -3432,7 +3465,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3432
3465
|
onChange: _ctx.changeHandler
|
|
3433
3466
|
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange"]);
|
|
3434
3467
|
}
|
|
3435
|
-
|
|
3468
|
+
const Time = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
|
|
3436
3469
|
|
|
3437
3470
|
const _sfc_main$1 = defineComponent({
|
|
3438
3471
|
name: "m-form",
|
|
@@ -3558,6 +3591,7 @@ const _sfc_main$1 = defineComponent({
|
|
|
3558
3591
|
};
|
|
3559
3592
|
}
|
|
3560
3593
|
});
|
|
3594
|
+
|
|
3561
3595
|
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3562
3596
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
3563
3597
|
const _component_el_form = resolveComponent("el-form");
|
|
@@ -3587,7 +3621,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3587
3621
|
_: 1
|
|
3588
3622
|
}, 8, ["model", "label-width", "disabled", "style", "inline", "label-position"]);
|
|
3589
3623
|
}
|
|
3590
|
-
|
|
3624
|
+
const Form = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
3591
3625
|
|
|
3592
3626
|
const _sfc_main = defineComponent({
|
|
3593
3627
|
name: "m-form-dialog",
|
|
@@ -3677,6 +3711,7 @@ const _sfc_main = defineComponent({
|
|
|
3677
3711
|
};
|
|
3678
3712
|
}
|
|
3679
3713
|
});
|
|
3714
|
+
|
|
3680
3715
|
const _hoisted_1 = { style: { "min-height": "1px" } };
|
|
3681
3716
|
const _hoisted_2 = /* @__PURE__ */ createTextVNode("\u53D6 \u6D88");
|
|
3682
3717
|
const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u4E0A\u4E00\u6B65");
|
|
@@ -3789,9 +3824,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3789
3824
|
}, 8, ["modelValue", "title", "width", "fullscreen", "onClose"])
|
|
3790
3825
|
]);
|
|
3791
3826
|
}
|
|
3792
|
-
|
|
3827
|
+
const FormDialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
3793
3828
|
|
|
3794
|
-
|
|
3829
|
+
const index$1 = '';
|
|
3795
3830
|
|
|
3796
3831
|
const defaultInstallOpt = {};
|
|
3797
3832
|
const install = (app, opt) => {
|
|
@@ -3801,7 +3836,7 @@ const install = (app, opt) => {
|
|
|
3801
3836
|
app.component(Form.name, Form);
|
|
3802
3837
|
app.component(FormDialog.name, FormDialog);
|
|
3803
3838
|
app.component(Container.name, Container);
|
|
3804
|
-
app.component("m-form-fieldset", _sfc_main$
|
|
3839
|
+
app.component("m-form-fieldset", _sfc_main$t);
|
|
3805
3840
|
app.component(GroupList.name, GroupList);
|
|
3806
3841
|
app.component(Panel.name, Panel);
|
|
3807
3842
|
app.component(Row.name, Row);
|
|
@@ -3811,25 +3846,25 @@ const install = (app, opt) => {
|
|
|
3811
3846
|
app.component(Text.name, Text);
|
|
3812
3847
|
app.component(Number$1.name, Number$1);
|
|
3813
3848
|
app.component(Textarea.name, Textarea);
|
|
3814
|
-
app.component(
|
|
3849
|
+
app.component("m-fields-hidden", _sfc_main$c);
|
|
3815
3850
|
app.component(Date$1.name, Date$1);
|
|
3816
3851
|
app.component(DateTime.name, DateTime);
|
|
3817
3852
|
app.component(Time.name, Time);
|
|
3818
3853
|
app.component(Checkbox.name, Checkbox);
|
|
3819
3854
|
app.component(Switch.name, Switch);
|
|
3820
|
-
app.component(
|
|
3821
|
-
app.component(
|
|
3855
|
+
app.component("m-fields-daterange", _sfc_main$g);
|
|
3856
|
+
app.component("m-fields-color-picker", _sfc_main$i);
|
|
3822
3857
|
app.component(CheckboxGroup.name, CheckboxGroup);
|
|
3823
3858
|
app.component(RadioGroup.name, RadioGroup);
|
|
3824
|
-
app.component(
|
|
3859
|
+
app.component("m-fields-display", _sfc_main$e);
|
|
3825
3860
|
app.component(Link.name, Link);
|
|
3826
3861
|
app.component(Select.name, Select);
|
|
3827
3862
|
app.component(Cascader.name, Cascader);
|
|
3828
3863
|
app.component(DynamicField.name, DynamicField);
|
|
3829
3864
|
};
|
|
3830
|
-
|
|
3865
|
+
const index = {
|
|
3831
3866
|
install
|
|
3832
3867
|
};
|
|
3833
3868
|
|
|
3834
|
-
export { Cascader as MCascader, Checkbox as MCheckbox, CheckboxGroup as MCheckboxGroup, _sfc_main$i as MColorPicker, Container as MContainer, Date$1 as MDate, DateTime as MDateTime,
|
|
3835
|
-
//# sourceMappingURL=tmagic-form.
|
|
3869
|
+
export { Cascader as MCascader, Checkbox as MCheckbox, CheckboxGroup as MCheckboxGroup, _sfc_main$i as MColorPicker, Container as MContainer, Date$1 as MDate, DateTime as MDateTime, _sfc_main$g as MDaterange, _sfc_main$e as MDisplay, DynamicField as MDynamicField, _sfc_main$t as MFieldset, Form as MForm, FormDialog as MFormDialog, GroupList as MGroupList, _sfc_main$c as MHidden, Link as MLink, Number$1 as MNumber, Panel as MPanel, RadioGroup as MRadioGroup, Row as MRow, Select as MSelect, Switch as MSwitch, Table as MTable, Tabs as MTabs, Text as MText, Textarea as MTextarea, Time as MTime, index as default, display, fieldProps, filterFunction, getRules, initValue, useAddField };
|
|
3870
|
+
//# sourceMappingURL=tmagic-form.mjs.map
|